/* app/design/tokens.css
 * Design tokens (single source of truth).
 * Loaded before styles.css so every var(--…) resolves.
 */
:root {
  /* ---- Colour ---- */
  --primary: #0f172a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg-main: #f1f5f9;
  --bg-panel: #ffffff;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #059669;
  --danger: #ef4444;
  --header-pale-blue: #f0f7ff;
  --bg-subtle: #f8fafc;
  --bg-info-light: #eff6ff;
  --bg-success-light: #f0fdf4;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;
  --amber-bg: #fef3c7;
  --amber-border: #f59e0b;
  --amber-text: #92400e;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --success-border: #bbf7d0;
  --info-bg: #dbeafe;
  --info-text: #1e40af;
  --info-border: #bfdbfe;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --accent-ring: rgba(37, 99, 235, 0.2);
  --accent-ring-strong: rgba(37, 99, 235, 0.5);

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-dropdown: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-modal: 0 25px 50px rgba(0,0,0,0.25);

  /* ---- Typography ---- */
  --font-display: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Public Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  /* six-step scale (rem, relative to the 13px root) */
  --fs-display: 2rem;   /* hero numeric displays only */
  --fs-h1: 1.5rem;
  --fs-h2: 1.25rem;
  --fs-h3: 1rem;
  --fs-body: 0.9375rem;
  --fs-sm: 0.8125rem;
  --fs-caption: 0.75rem;
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;

  /* ---- Spacing scale (4px base rhythm) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;

  /* ---- Radius scale ---- */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* ---- Z-index scale ---- */
  --z-base: 1;
  --z-elevated: 10;
  --z-sticky: 100;
  --z-dropdown: 1000;
  --z-modal: 1100;
  --z-tooltip: 9999;

  /* ---- Motion ---- */
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: ease-out;

  /* ---- Layout ---- */
  --group-grid: minmax(80px, 1.2fr) minmax(115px, 0.8fr) minmax(100px, 1.2fr) minmax(250px, 1.5fr) 60px;
  --sidebar-width-expanded: 210px;
  --sidebar-width-collapsed: 64px;
  --sidebar-width: var(--sidebar-width-expanded);
  --snapshot-width: 315px;
  --snapshot-width-max: 394px;
}

/* ---- Dark mode overrides ---- */
[data-bs-theme="dark"] {
  --primary: #e2e8f0;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --bg-main: #0f172a;
  --bg-panel: #1e293b;
  --bg-subtle: #253347;
  --bg-info-light: #1e3a5f;
  --bg-success-light: #14532d;
  --text-muted: #94a3b8;
  --border: #334155;
  --success: #34d399;
  --danger: #f87171;
  --header-pale-blue: #1e3a5f;
  --danger-bg: #450a0a;
  --danger-border: #991b1b;
  --danger-text: #fca5a5;
  --amber-bg: #451a03;
  --amber-border: #b45309;
  --amber-text: #fcd34d;
  --success-bg: #052e16;
  --success-text: #86efac;
  --success-border: #166534;
  --info-bg: #1e3a5f;
  --info-text: #93c5fd;
  --info-border: #1d4ed8;
  --gray-300: #64748b;
  --gray-400: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-card: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-dropdown: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-modal: 0 25px 50px rgba(0,0,0,0.5);
  --accent-ring: rgba(96, 165, 250, 0.25);
  --accent-ring-strong: rgba(96, 165, 250, 0.5);
  /* Override Bootstrap's primary to match our --primary in dark mode */
  --bs-primary: #e2e8f0;
  --bs-primary-rgb: 226, 232, 240;
}
