@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root, [data-theme="light"] {
  /* Notion Design System Palette - Light (Warm Paper) */
  --canvas: #f6f5f4;
  --canvas-soft: #f6f5f4;
  --surface-1: #ffffff;
  --surface-2: #f0efed;
  --surface-3: #e6e6e6;
  --surface-4: #d3d3d3;
  
  --hairline: #e6e6e6;
  --hairline-strong: #d3d3d3;
  --hairline-tertiary: #b3b3b3;
  
  --primary: #0075de;
  --primary-hover: #005bab;
  --primary-focus: #0075de;
  --secondary: #213183;
  --on-primary: #ffffff;
  
  --ink: #000000;
  --ink-secondary: #31302e;
  --ink-muted: #615d59;
  --ink-subtle: #615d59;
  --ink-tertiary: #a39e98;
  --ink-faint: #a39e98;
  
  /* Notion Decorative Sticker Palette */
  --accent-sky: #62aef0;
  --accent-purple: #d6b6f6;
  --accent-purple-deep: #391c57;
  --accent-pink: #ff64c8;
  --accent-orange: #dd5b00;
  --accent-orange-deep: #793400;
  --accent-teal: #2a9d99;
  --accent-green: #1aae39;
  --accent-brown: #523410;
  
  --semantic-success: #1aae39;
  --semantic-success-bg: rgba(26, 174, 57, 0.1);
  --semantic-danger: #dd5b00;
  --semantic-danger-bg: rgba(221, 91, 0, 0.1);
  --semantic-info: #0075de;
  --semantic-info-bg: rgba(0, 117, 222, 0.1);
  
  --top-nav-bg: rgba(255, 255, 255, 0.9);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  /* Notion Design System Palette - Dark */
  --canvas: #191919;
  --canvas-soft: #191919;
  --surface-1: #202020;
  --surface-2: #262626;
  --surface-3: #2f2f2f;
  --surface-4: #383838;
  
  --hairline: #2f2f2f;
  --hairline-strong: #3f3f3f;
  --hairline-tertiary: #525252;
  
  --primary: #2383e2;
  --primary-hover: #0075de;
  --primary-focus: #2383e2;
  --secondary: #213183;
  --on-primary: #ffffff;
  
  --ink: #f7f7f7;
  --ink-secondary: #d3d3d3;
  --ink-muted: #9b9b9b;
  --ink-subtle: #9b9b9b;
  --ink-tertiary: #6f6f6f;
  --ink-faint: #6f6f6f;
  
  /* Decorative Sticker Accents Dark */
  --accent-sky: #62aef0;
  --accent-purple: #d6b6f6;
  --accent-purple-deep: #d6b6f6;
  --accent-pink: #ff64c8;
  --accent-orange: #ff8c3a;
  --accent-orange-deep: #ff8c3a;
  --accent-teal: #36c5c0;
  --accent-green: #2aae48;
  --accent-brown: #d4a373;
  
  --semantic-success: #2aae48;
  --semantic-success-bg: rgba(42, 174, 72, 0.15);
  --semantic-danger: #ff6059;
  --semantic-danger-bg: rgba(255, 96, 89, 0.15);
  --semantic-info: #2383e2;
  --semantic-info-bg: rgba(35, 131, 226, 0.15);
  
  --top-nav-bg: rgba(25, 25, 25, 0.9);
}

/* Base resets & global styles */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

/* Headings with Notion measured negative tracking */
h1, .display-xl, .display-1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -1.875px;
  line-height: 1.05;
  color: var(--ink);
}

h2, .display-md, .heading-1, .heading-2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.625px;
  line-height: 1.23;
  color: var(--ink);
}

h3, .headline, .heading-3 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.25px;
  line-height: 1.27;
  color: var(--ink);
}

.title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.125px;
  line-height: 1.4;
  color: var(--ink);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.125px;
  text-transform: uppercase;
  color: var(--ink-subtle);
  line-height: 1.33;
}

/* Surface Cards & Panels */
.card-linear, .card-notion {
  background-color: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .card-linear, 
[data-theme="dark"] .card-notion {
  box-shadow: none;
}

.card-linear:hover, .card-notion:hover {
  border-color: var(--hairline-strong);
}

.card-linear-featured {
  background-color: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  padding: 24px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--on-primary);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--primary-focus);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-1);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid var(--hairline);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: var(--surface-2);
  border-color: var(--hairline-strong);
  color: var(--ink);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-utility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-1);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.btn-utility:hover {
  background-color: var(--surface-2);
  border-color: var(--hairline-strong);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--semantic-danger-bg);
  color: var(--semantic-danger);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(221, 91, 0, 0.25);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-danger:hover {
  background-color: rgba(221, 91, 0, 0.2);
  border-color: rgba(221, 91, 0, 0.4);
}

/* Forms & Inputs */
.input-linear, select.input-linear, textarea.input-linear {
  background-color: var(--surface-1);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.input-linear::placeholder {
  color: var(--ink-tertiary);
}

.input-linear:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 117, 222, 0.2);
}

select.input-linear option {
  background-color: var(--surface-1);
  color: var(--ink);
}

/* Tables */
.table-container {
  background-color: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
}

.table-linear {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--ink);
}

.table-linear th {
  background-color: var(--surface-2);
  color: var(--ink-subtle);
  font-weight: 600;
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.125px;
}

.table-linear td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-secondary);
}

.table-linear tbody tr {
  transition: background-color 0.12s ease;
}

.table-linear tbody tr:last-child td {
  border-bottom: none;
}

.table-linear tbody tr:hover {
  background-color: var(--surface-2);
}

/* Badges & Status - Notion Sticker Style */
.badge-status, .badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 9999px;
  line-height: 1;
}

.badge-success {
  background-color: rgba(26, 174, 57, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(26, 174, 57, 0.25);
}

.badge-danger {
  background-color: rgba(221, 91, 0, 0.12);
  color: var(--accent-orange);
  border: 1px solid rgba(221, 91, 0, 0.25);
}

.badge-neutral {
  background-color: var(--surface-2);
  color: var(--ink-subtle);
  border: 1px solid var(--hairline);
}

/* Color Utilities */
.text-ink { color: var(--ink) !important; }
.text-muted { color: var(--ink-muted) !important; }
.text-subtle { color: var(--ink-subtle) !important; }
.text-tertiary { color: var(--ink-tertiary) !important; }

/* Top Navigation Bar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--top-nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.brand-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar-linear {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 240px;
  background-color: var(--surface-1);
  border-right: 1px solid var(--hairline);
  z-index: 30;
  padding: 16px 12px;
  overflow-y: auto;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  margin-bottom: 2px;
}

.sidebar-nav-item:hover {
  background-color: var(--surface-2);
  color: var(--ink);
}

.sidebar-nav-item.active {
  background-color: var(--surface-2);
  color: var(--primary);
  font-weight: 600;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

[data-theme="dark"] .modal-overlay {
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-card {
  background-color: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

[data-theme="dark"] .modal-card {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Checkbox Notion styling */
input[type="checkbox"].kas-cb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background-color: var(--surface-1);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  vertical-align: middle;
}

input[type="checkbox"].kas-cb:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"].kas-cb:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Number display code style */
.font-mono-num {
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

/* Activity Log Badge Classes - Notion Sticker Palette */
.badge-tambah        { background: rgba(26, 174, 57, 0.12); color: #1aae39; padding: 3px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.badge-edit          { background: rgba(0, 117, 222, 0.12); color: #0075de; padding: 3px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.badge-hapus         { background: rgba(221, 91, 0, 0.12); color: #dd5b00; padding: 3px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.badge-update_status { background: rgba(214, 182, 246, 0.2); color: #793400; padding: 3px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; }

[data-theme="dark"] .badge-tambah { color: #2aae48; }
[data-theme="dark"] .badge-edit { color: #2383e2; }
[data-theme="dark"] .badge-hapus { color: #ff8c3a; }
[data-theme="dark"] .badge-update_status { color: #d6b6f6; }

/* ── Pagination Component ─────────────────────────────────────────────── */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--hairline);
  background-color: var(--surface-1);
  border-radius: 0 0 12px 12px;
}

.pagination-info {
  font-size: 13px;
  color: var(--ink-subtle);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background-color: var(--surface-1);
  color: var(--ink-subtle);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1;
}

.pagination-btn:hover:not(:disabled):not(.pagination-btn-active) {
  background-color: var(--surface-2);
  border-color: var(--hairline-strong);
  color: var(--ink);
}

.pagination-btn-active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  cursor: default;
}

.pagination-btn:disabled,
.pagination-btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-btn-ellipsis {
  border: none;
  background: transparent;
  color: var(--ink-tertiary);
  cursor: default;
  pointer-events: none;
}
