/* ==========================================================================
   WardDesk — Design tokens
   Every colour, radius, shadow and spacing value used in the app lives here.
   Components reference tokens only, so the dark theme is a token swap.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Typography ------------------------------------------------------------ */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;     /* 12 */
  --text-sm: 0.8125rem;   /* 13 */
  --text-base: 0.875rem;  /* 14 */
  --text-md: 0.9375rem;   /* 15 */
  --text-lg: 1.0625rem;   /* 17 */
  --text-xl: 1.25rem;     /* 20 */
  --text-2xl: 1.5rem;     /* 24 */
  --text-3xl: 1.875rem;   /* 30 */

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --tracking-tight: -0.011em;
  --tracking-display: -0.022em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Spacing (4px grid) ------------------------------------------------------ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii ------------------------------------------------------------------- */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Surfaces ---------------------------------------------------------------- */
  --bg: #f7f7f5;              /* warm off-white page */
  --bg-subtle: #f1f1ee;
  --surface: #ffffff;         /* cards */
  --surface-2: #fafaf9;       /* table headers, inset areas */
  --surface-hover: #f5f5f3;
  --surface-active: #efefec;
  --overlay: rgba(15, 23, 42, 0.36);

  --border: #e7e6e2;
  --border-strong: #d6d5d0;
  --border-focus: #6366f1;

  /* Text -------------------------------------------------------------------- */
  --text: #111827;            /* deep navy-charcoal */
  --text-2: #4b5563;
  --text-3: #8b909a;
  --text-inverse: #ffffff;

  /* Accent (refined indigo) ------------------------------------------------- */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-active: #3730a3;
  --accent-soft: #eef0fe;
  --accent-soft-2: #e0e3fd;
  --accent-text: #4338ca;

  /* Status ------------------------------------------------------------------ */
  --success: #15803d;
  --success-strong: #16a34a;
  --success-soft: #ecfdf3;
  --success-border: #bbf7d0;

  --warning: #b45309;
  --warning-strong: #d97706;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --info: #2563eb;
  --info-soft: #eff6ff;

  /* Chart series — mapped to status semantics ------------------------------- */
  --chart-verified: #22a35a;
  --chart-pending: #e0a43a;
  --chart-correction: #e5534b;
  --chart-total: #6366f1;
  --chart-track: #efeeea;

  /* Elevation --------------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05), 0 1px 3px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(17, 24, 39, 0.08), 0 2px 4px -2px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 16px 40px -8px rgba(17, 24, 39, 0.18), 0 4px 12px -4px rgba(17, 24, 39, 0.06);
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.22);
  --ring-danger: 0 0 0 3px rgba(220, 38, 38, 0.18);

  /* Layout ------------------------------------------------------------------ */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 60px;
  --content-max: 1320px;
  --content-pad: var(--space-8);

  /* Motion ------------------------------------------------------------------ */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 260ms;

  --z-sidebar: 40;
  --z-topbar: 30;
  --z-dropdown: 60;
  --z-drawer: 70;
  --z-modal: 80;
  --z-toast: 90;
}

/* Dark theme ---------------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0c0e13;
  --bg-subtle: #11141a;
  --surface: #14171e;
  --surface-2: #181c24;
  --surface-hover: #1c2029;
  --surface-active: #222733;
  --overlay: rgba(0, 0, 0, 0.6);

  --border: #252a35;
  --border-strong: #323846;
  --border-focus: #818cf8;

  --text: #e7e9ee;
  --text-2: #a3a9b6;
  --text-3: #6d7482;
  --text-inverse: #0c0e13;

  --accent: #6d72f6;
  --accent-hover: #8187f8;
  --accent-active: #969bfa;
  --accent-soft: rgba(109, 114, 246, 0.14);
  --accent-soft-2: rgba(109, 114, 246, 0.22);
  --accent-text: #a5aafb;

  --success: #4ade80;
  --success-strong: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --success-border: rgba(34, 197, 94, 0.3);

  --warning: #fbbf24;
  --warning-strong: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);

  --danger: #f87171;
  --danger-hover: #fca5a5;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.32);

  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);

  --chart-verified: #34c46f;
  --chart-pending: #e6b24f;
  --chart-correction: #ef6b63;
  --chart-total: #7c82f7;
  --chart-track: #20242e;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 48px -8px rgba(0, 0, 0, 0.65);
  --ring: 0 0 0 3px rgba(129, 140, 248, 0.32);
  --ring-danger: 0 0 0 3px rgba(248, 113, 113, 0.28);
}
