/* =========================================================================
   Design tokens. White-label: a tenant only sets --brand, --accent and
   --ink-brand (injected per request); every other shade is derived here.
   ========================================================================= */
:root {
  --brand: #1747c9;
  --accent: #f97316;
  --ink-brand: #0a1f44;

  --brand-50: color-mix(in oklab, var(--brand) 6%, #fff);
  --brand-100: color-mix(in oklab, var(--brand) 12%, #fff);
  --brand-200: color-mix(in oklab, var(--brand) 24%, #fff);
  --brand-300: color-mix(in oklab, var(--brand) 45%, #fff);
  --brand-600: var(--brand);
  --brand-700: color-mix(in oklab, var(--brand) 84%, #000);
  --brand-800: color-mix(in oklab, var(--brand) 66%, #000);
  --accent-50: color-mix(in oklab, var(--accent) 9%, #fff);
  --accent-100: color-mix(in oklab, var(--accent) 18%, #fff);
  --accent-700: color-mix(in oklab, var(--accent) 82%, #000);

  /* Surfaces & text */
  --bg: #f6f8fc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --surface-3: #e8edf6;
  --border: #e2e8f2;
  --border-strong: #cdd6e4;
  --text: #0d1730;
  --text-2: #44506a;
  --text-3: #6b7790;
  --text-inverse: #ffffff;
  --on-brand: #ffffff;
  --ink: var(--ink-brand);

  /* Status */
  --success: #15803d;
  --success-bg: #e8f7ee;
  --warning: #b45309;
  --warning-bg: #fff5e5;
  --danger: #c62828;
  --danger-bg: #fdecec;
  --info: var(--brand-700);
  --info-bg: var(--brand-50);

  /* Typography */
  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Inter Tight", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.375rem, 1.1rem + 0.9vw, 1.625rem);
  --fs-2xl: clamp(1.625rem, 1.2rem + 1.6vw, 2.125rem);
  --fs-3xl: clamp(2rem, 1.3rem + 2.6vw, 3rem);
  --fs-4xl: clamp(2.375rem, 1.4rem + 3.8vw, 4rem);
  --lh-tight: 1.12;
  --lh-snug: 1.3;
  --lh-normal: 1.6;

  /* Spacing (4px grid) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.25rem;
  --s-6: 1.5rem; --s-8: 2rem; --s-10: 2.5rem; --s-12: 3rem; --s-16: 4rem; --s-20: 5rem; --s-24: 6rem;

  /* Shape & depth */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-2xl: 28px; --r-full: 999px;
  --shadow-xs: 0 1px 2px rgb(13 23 48 / 0.06);
  --shadow-sm: 0 1px 3px rgb(13 23 48 / 0.08), 0 1px 2px rgb(13 23 48 / 0.04);
  --shadow-md: 0 8px 24px -8px rgb(13 23 48 / 0.14), 0 2px 6px rgb(13 23 48 / 0.05);
  --shadow-lg: 0 24px 48px -16px rgb(13 23 48 / 0.22), 0 4px 12px rgb(13 23 48 / 0.06);
  --shadow-brand: 0 10px 30px -10px color-mix(in oklab, var(--brand) 60%, transparent);
  --ring: 0 0 0 3px color-mix(in oklab, var(--brand) 32%, transparent);

  --container: 1200px;
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 120ms var(--ease);
  --t: 200ms var(--ease);

  color-scheme: light;
}

/* ---- Dark theme: follows the OS unless the user picked one ------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-50: color-mix(in oklab, var(--brand) 16%, #0b1222);
    --brand-100: color-mix(in oklab, var(--brand) 24%, #0b1222);
    --brand-200: color-mix(in oklab, var(--brand) 36%, #0b1222);
    --brand-300: color-mix(in oklab, var(--brand) 60%, #fff);
    --brand-700: color-mix(in oklab, var(--brand) 55%, #fff);
    --accent-50: color-mix(in oklab, var(--accent) 16%, #0b1222);
    --accent-100: color-mix(in oklab, var(--accent) 26%, #0b1222);
    --accent-700: color-mix(in oklab, var(--accent) 70%, #fff);
    --bg: #0a1020; --bg-elevated: #111a2e; --surface: #111a2e; --surface-2: #17223a; --surface-3: #1e2a45;
    --border: #233150; --border-strong: #2f3f63;
    --text: #e8edf7; --text-2: #b3bdd2; --text-3: #8592ad; --ink: #e8edf7;
    --success: #4ade80; --success-bg: #0f2a1b; --warning: #fbbf24; --warning-bg: #2c220b;
    --danger: #f87171; --danger-bg: #2f1214; --info: var(--brand-300); --info-bg: var(--brand-50);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 10px 30px -10px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 28px 56px -18px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-50: color-mix(in oklab, var(--brand) 16%, #0b1222);
  --brand-100: color-mix(in oklab, var(--brand) 24%, #0b1222);
  --brand-200: color-mix(in oklab, var(--brand) 36%, #0b1222);
  --brand-300: color-mix(in oklab, var(--brand) 60%, #fff);
  --brand-700: color-mix(in oklab, var(--brand) 55%, #fff);
  --accent-50: color-mix(in oklab, var(--accent) 16%, #0b1222);
  --accent-100: color-mix(in oklab, var(--accent) 26%, #0b1222);
  --accent-700: color-mix(in oklab, var(--accent) 70%, #fff);
  --bg: #0a1020; --bg-elevated: #111a2e; --surface: #111a2e; --surface-2: #17223a; --surface-3: #1e2a45;
  --border: #233150; --border-strong: #2f3f63;
  --text: #e8edf7; --text-2: #b3bdd2; --text-3: #8592ad; --ink: #e8edf7;
  --success: #4ade80; --success-bg: #0f2a1b; --warning: #fbbf24; --warning-bg: #2c220b;
  --danger: #f87171; --danger-bg: #2f1214; --info: var(--brand-300); --info-bg: var(--brand-50);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 10px 30px -10px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 28px 56px -18px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}
