:root {
  color-scheme: light;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --surface-raised: #ffffff;
  --sidebar: #111827;
  --sidebar-soft: #1b2537;
  --sidebar-text: #d8deea;
  --sidebar-muted: #8792a6;
  --text: #172033;
  --text-soft: #647087;
  --text-faint: #667187;
  --border: #e3e7ef;
  --border-strong: #d3d9e5;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eeedff;
  --primary-ink: #3730a3;
  --success: #116c4f;
  --success-soft: #e9f8f2;
  --warning: #875008;
  --warning-soft: #fff5df;
  --danger: #c53c4a;
  --danger-soft: #fff0f2;
  --info: #2473b6;
  --info-soft: #eaf5ff;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 8px 24px rgba(22, 32, 51, .07);
  --shadow-lg: 0 28px 70px rgba(15, 23, 42, .2);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 256px;
  --topbar-height: 72px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1320;
  --surface: #141c2b;
  --surface-soft: #101827;
  --surface-raised: #192335;
  --sidebar: #080d16;
  --sidebar-soft: #151e2e;
  --sidebar-text: #e5eaf3;
  --sidebar-muted: #8490a5;
  --text: #edf1f7;
  --text-soft: #a4afc0;
  --text-faint: #a4afc0;
  --border: #273348;
  --border-strong: #344158;
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --primary-soft: #25284d;
  --primary-ink: #c7d2fe;
  --success: #45c79a;
  --success-soft: #153b34;
  --warning: #f1b34f;
  --warning-soft: #3e2f18;
  --danger: #fb7185;
  --danger-soft: #40212b;
  --info: #62b4ee;
  --info-soft: #18344b;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, .18);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, .48);
}

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 18px;
  --text-xl: 24px;
  --line-body: 1.5;
  --form-gap: var(--space-4);
  --table-cell-y: var(--space-2);
  --table-cell-x: var(--space-4);
  --sidebar-compact-width: 72px;
  --focus-ring: var(--primary);
  --on-primary: #ffffff;
}
html[data-theme="dark"] { --on-primary: #101827; }
