/* CURSA — Color tokens. Source of truth: app/globals.css (Design Language V3),
   which supersedes the purple palette described in docs/DESIGN_SYSTEM.md §4 —
   the codebase moved from purple to blue primary since that document was
   written. Primitive → semantic, per docs/DESIGN_SYSTEM.md §3. */
:root {
  /* Primitives — Blue (Primary) */
  --primitive-blue-50: hsl(221 100% 97%);
  --primitive-blue-100: hsl(221 100% 91%);
  --primitive-blue-400: hsl(227 100% 74%);
  --primitive-blue-500: hsl(227 100% 66%);
  --primitive-blue-600: hsl(226 93% 61%);
  --primitive-blue-700: hsl(226 79% 54%);

  /* Primitives — Slate (Secondary / Neutral) */
  --primitive-slate-50: hsl(210 40% 96%);
  --primitive-slate-100: hsl(60 8% 93%);
  --primitive-slate-400: hsl(215 20% 65%);
  --primitive-slate-500: hsl(215 16% 47%);
  --primitive-slate-600: hsl(215 19% 35%);

  /* Primitives — Status */
  --primitive-green-50: hsl(138 76% 97%);
  --primitive-green-500: hsl(142 71% 45%);
  --primitive-green-600: hsl(142 76% 36%);
  --primitive-amber-50: hsl(48 100% 96%);
  --primitive-amber-500: hsl(38 92% 50%);
  --primitive-amber-600: hsl(32 95% 44%);
  --primitive-amber-900: hsl(26 90% 20%);
  --primitive-red-50: hsl(0 86% 97%);
  --primitive-red-500: hsl(0 84% 60%);
  --primitive-red-600: hsl(0 72% 51%);

  /* Semantic — Primary */
  --color-primary: var(--primitive-blue-500); /* #4F7CFF */
  --color-primary-hover: var(--primitive-blue-600); /* #3D6EF8 */
  --color-primary-pressed: var(--primitive-blue-700); /* #315DE8 */
  --color-primary-subtle: var(--primitive-blue-50); /* #EEF4FF */
  --color-primary-border: var(--primitive-blue-100); /* #D6E3FF */
  --color-primary-foreground: hsl(0 0% 100%);

  /* Semantic — Secondary */
  --color-secondary: var(--primitive-slate-500);
  --color-secondary-hover: var(--primitive-slate-600);
  --color-secondary-subtle: var(--primitive-slate-50);
  --color-secondary-foreground: hsl(0 0% 100%);

  /* Semantic — Status */
  --color-success: var(--primitive-green-500);
  --color-success-hover: var(--primitive-green-600);
  --color-success-subtle: var(--primitive-green-50);
  --color-success-foreground: hsl(0 0% 100%);
  --color-warning: var(--primitive-amber-500);
  --color-warning-hover: var(--primitive-amber-600);
  --color-warning-subtle: var(--primitive-amber-50);
  --color-warning-foreground: var(--primitive-amber-900);
  --color-error: var(--primitive-red-500);
  --color-error-hover: var(--primitive-red-600);
  --color-error-subtle: var(--primitive-red-50);
  --color-error-foreground: hsl(0 0% 100%);

  /* Semantic — Background & Surface (warm off-white canvas, pure-white cards) */
  --color-background: hsl(60 9% 97%); /* ~#F7F7F5 */
  --color-background-gradient: linear-gradient(180deg, hsl(60 12% 98%) 0%, hsl(60 8% 96%) 100%);
  --color-surface: hsl(0 0% 100%);
  --color-surface-secondary: hsl(60 8% 93%);
  --color-surface-raised: hsl(0 0% 100%);
  --color-surface-overlay: hsl(0 0% 100%);

  /* Semantic — Border */
  --color-border: hsl(0 0% 0% / 0.06);
  --color-border-strong: hsl(0 0% 0% / 0.1);
  --color-border-focus: var(--color-primary);

  /* Semantic — Text */
  --color-text: hsl(354 13% 26%);
  --color-text-secondary: hsl(334 5% 63%);
  --color-text-tertiary: hsl(215 20% 65%);
  --color-text-disabled: hsl(214 32% 91%);
  --color-text-inverse: hsl(0 0% 100%);

  /* Semantic — Sidebar / Navigation */
  --color-sidebar-bg: hsl(60 9% 98%);
  --color-sidebar-text: hsl(215 16% 40%);
  --color-sidebar-text-active: hsl(222 47% 11%);
  --color-sidebar-item-hover: hsl(0 0% 0% / 0.035);

  /* CURSA Surface material — sidebar, topbar, dialogs, popovers ONLY, never cards/tables/forms */
  --cursa-surface-bg: linear-gradient(180deg, hsl(0 0% 100% / 0.92) 0%, hsl(248 40% 98% / 0.88) 100%);
  --cursa-surface-border: hsl(248 30% 90% / 0.5);
  --cursa-surface-blur: 6px;
  --cursa-surface-shadow: 0 1px 2px 0 hsl(354 13% 26% / 0.04), 0 8px 24px -8px hsl(354 13% 26% / 0.08), 0 24px 48px -16px hsl(354 13% 26% / 0.06);
}

[data-theme='dark'] {
  --color-background: hsl(222 47% 7%);
  --color-surface: hsl(222 47% 11%);
  --color-surface-secondary: hsl(222 40% 13%);
  --color-surface-raised: hsl(217 33% 17%);
  --color-border: hsl(0 0% 100% / 0.08);
  --color-border-strong: hsl(0 0% 100% / 0.14);
  --color-text: hsl(210 40% 96%);
  --color-text-secondary: hsl(215 20% 65%);
  --color-text-tertiary: hsl(215 16% 47%);
  --color-sidebar-bg: hsl(222 47% 9%);
  --color-sidebar-text: hsl(215 20% 65%);
  --color-sidebar-text-active: hsl(0 0% 100%);
  --color-sidebar-item-hover: hsl(0 0% 100% / 0.05);
  --cursa-surface-bg: linear-gradient(180deg, hsl(217 33% 17% / 0.9) 0%, hsl(222 47% 11% / 0.85) 100%);
  --cursa-surface-border: hsl(0 0% 100% / 0.08);
  --cursa-surface-shadow: 0 1px 2px 0 hsl(0 0% 0% / 0.2), 0 8px 24px -8px hsl(0 0% 0% / 0.3), 0 24px 48px -16px hsl(0 0% 0% / 0.24);
}
