:root {
  color-scheme: light;
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

  --color-black: #1a1a1a;
  --color-white: #ffffff;
  --color-red: #d9534f;
  --color-blue: #5b5ea6;
  --color-dark-blue: #3b3d7a;
  --color-light: #f9f8f6;
  --color-bg: #f3f1ed;
  --color-surface: #ffffff;
  --color-primary: #5b5ea6;
  --color-text: #1a1a1a;
  --color-border: #dfdbd6;
  --color-muted: #625c56;
  --color-gray-50: #f9f8f6;
  --color-gray-100: #f9f8f6;
  --color-gray-200: #ebe9e5;
  --color-gray-300: #dfdbd6;
  --color-gray-400: #d0cbc5;
  --color-gray-500: #8a8279;
  --color-gray-600: #625c56;
  --color-gray-700: #4d4843;
  --color-gray-800: #38342f;
  --color-success: #2a7d5f;
  --color-success-light: #dff5e8;
  --color-warning: #e8a838;
  --color-warning-light: #fef3dc;
  --color-danger: #d9534f;
  --color-danger-light: #fce8e6;
  --color-error: var(--color-danger);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --max-width: 1200px;
  --sidebar-width: 260px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --transition: 150ms ease;

  /* Sidebar — light defaults */
  --sidebar-bg: linear-gradient(180deg, var(--color-surface) 0%, var(--color-gray-50) 100%);
  --sidebar-text: var(--color-text);
  --sidebar-text-strong: var(--color-dark-blue);
  --sidebar-divider: var(--color-border);
  --sidebar-hover-bg: rgba(59, 61, 122, 0.06);
  --sidebar-active-bg: rgba(59, 61, 122, 0.12);
  --sidebar-active-border: var(--color-dark-blue);
  --sidebar-avatar-bg: rgba(59, 61, 122, 0.12);
  --sidebar-avatar-ring: rgba(59, 61, 122, 0.18);
  --sidebar-shadow: 1px 0 0 var(--color-border);
  --sidebar-focus-ring: rgba(59, 61, 122, 0.55);
  --sidebar-brand-shadow: none;
}

[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #0e1014;
  --color-surface: #181b21;
  --color-light: #1f232b;
  --color-text: #e6e8eb;
  --color-black: #f0f1f3;
  --color-border: #2a2e37;
  --color-muted: #9aa0a8;

  --color-blue: #8587c8;
  --color-dark-blue: #9b9edb;
  --color-primary: #8587c8;

  --color-gray-50: #181b21;
  --color-gray-100: #1f232b;
  --color-gray-200: #2a2e37;
  --color-gray-300: #383d48;
  --color-gray-400: #636a76;
  --color-gray-500: #8b909a;
  --color-gray-600: #b0b4bc;
  --color-gray-700: #d0d3d9;
  --color-gray-800: #e6e8eb;

  --color-success-light: #16331f;
  --color-warning-light: #3a2c14;
  --color-danger-light: #3a1a1a;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.55), 0 2px 4px rgba(0,0,0,0.35);

  /* Sidebar — neutral dark surface that matches the rest of the dark theme */
  --sidebar-bg: linear-gradient(180deg, #14161b 0%, #0e1014 100%);
  --sidebar-text: var(--color-gray-700);
  --sidebar-text-strong: var(--color-gray-800);
  --sidebar-divider: rgba(255,255,255,0.06);
  --sidebar-hover-bg: rgba(255,255,255,0.05);
  --sidebar-active-bg: rgba(255,255,255,0.10);
  --sidebar-active-border: var(--color-gray-700);
  --sidebar-avatar-bg: rgba(255,255,255,0.08);
  --sidebar-avatar-ring: rgba(255,255,255,0.14);
  --sidebar-shadow: 1px 0 0 rgba(255,255,255,0.04);
  --sidebar-focus-ring: rgba(255,255,255,0.45);
  --sidebar-brand-shadow: none;
}
