/* globals.css — ConsultOps beta design tokens (single source of truth).
   Loaded before consultops-beta.css so every component rule resolves var(--*) from here.
   Light defaults on :root; dark overrides on body.theme-dark. Do not add component rules.
   .theme-scope-light / .theme-scope-dark pin one subtree to a palette regardless of the page's
   (the Settings theme previews), so a preview never re-states a hex the tokens already own. */

:root, .theme-scope-light {
  color-scheme: light;
  --bg: #f6f6f7;
  --panel: var(--white);
  --border: #e7e7ea;
  --border-subtle: rgba(231, 231, 234, 0.8);
  --muted: #64748b;
  --text: #0f172a;
  --primary: #0f172a;
  --primary-foreground: var(--white);
  --accent: #f0f0f2;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);

  --radius-card: 28px;
  --radius-panel: 24px;
  --radius-control: 12px;
  --radius-input: 14px;
  --radius-pill: 9999px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-round: 50%;
  --white: #fff;
  --black: #000;
  --danger-solid: #ef4444;
  --sp-0: 0px;
  --sp-1: 1px;
  --sp-2: 2px;
  --sp-3: 3px;
  --sp-4: 4px;
  --sp-5: 5px;
  --sp-6: 6px;
  --sp-7: 7px;
  --sp-8: 8px;
  --sp-9: 9px;
  --sp-10: 10px;
  --sp-11: 11px;
  --sp-12: 12px;
  --sp-13: 13px;
  --sp-14: 14px;
  --sp-16: 16px;
  --sp-18: 18px;
  --sp-20: 20px;
  --sp-22: 22px;
  --sp-24: 24px;
  --sp-26: 26px;
  --sp-28: 28px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-44: 44px;
  --sp-48: 48px;
  --sp-52: 52px;
  --sp-56: 56px;
  --sp-180: 180px;

  --ease: 0.18s ease;
  --hover-transition: background-color var(--ease), color var(--ease),
    border-color var(--ease), box-shadow var(--ease), opacity var(--ease);

  /* Motion curves. Built-in ease-out is too weak to read as intentional; these are the stronger
     custom curves. out: things entering/leaving or answering a press. in-out: something already
     on screen changing shape (a section opening). drawer: iOS-sheet glide for a thumb or an
     indicator travelling a distance. Never ease-in for UI — it lands late and feels slow. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 150ms;
  --dur-fast: 160ms;
  --dur-base: 220ms;
  --dur-reveal: 280ms;
  --dur-enter: 360ms;
  --press-scale: 0.97;

  --success-bg: #dcfce7;
  --success-text: #166534;
  --success-border: #86efac;
  --error-bg: #fee2e2;
  --error-text: #b91c1c;
  --error-border: #fca5a5;
  --warning-bg: #fff7ed;
  --warning-text: #c2410c;
  --warning-border: #fed7aa;
  --info-bg: #eff6ff;
  --info-text: #1d4ed8;
  --info-border: #bfdbfe;

  --stat-blue-border: #3b82f6;
  --stat-blue-bg: #eff6ff;
  --stat-blue-icon-bg: #dbeafe;
  --stat-blue-label: #3b82f6;
  --stat-blue-count: #1e40af;
  --stat-purple-border: #8b5cf6;
  --stat-purple-bg: #f5f3ff;
  --stat-purple-icon-bg: #ede9fe;
  --stat-purple-label: #8b5cf6;
  --stat-purple-count: #5b21b6;
  --stat-orange-border: #f97316;
  --stat-orange-bg: #fff7ed;
  --stat-orange-icon-bg: #fed7aa;
  --stat-orange-label: #f97316;
  --stat-orange-count: #c2410c;
  --stat-green-border: #10b981;
  --stat-green-bg: #f0fdf4;
  --stat-green-icon-bg: #bbf7d0;
  --stat-green-label: #10b981;
  --stat-green-count: #065f46;

  --goal-h0: 222;
  --goal-h1: 158;
  --goal-h2: 25;
  --goal-h3: 280;
  --goal-h4: 190;
  --goal-h5: 340;
  --goal-h6: 95;
  --goal-h7: 255;
  --goal-h8: 45;
  --goal-h9: 0;

  /* Copilot skill hues — one per consultant-selectable skill, reusing the goal ramp's hues so
     the composer chip and the `/` menu sit in the same colour family as the rest of the journey
     UI. Hue only: bg/border/text are colour-mixed against --panel/--text at the use site, so
     both themes adapt without a second palette. Keyed by skill NAME (not index) because the
     mapping is semantic, not positional. */
  --skill-h-setup: var(--goal-h3);        /* 280 violet — structural: goals, phases, placement */
  --skill-h-prepare: var(--goal-h0);      /* 222 blue   — calm, pre-session briefing */
  --skill-h-brainstorm: var(--goal-h2);   /* 25  amber  — generative: ideas and follow-ups */

  --badge-booked-bg: #dbeafe;
  --badge-booked-text: #1e40af;
  --badge-completed-bg: #ede9fe;
  --badge-completed-text: #5b21b6;
  --badge-noshow-bg: #fee2e2;
  --badge-noshow-text: #991b1b;
  --badge-free-bg: #d1fae5;
  --badge-free-text: #065f46;
  --badge-busy-bg: #fef3c7;
  --badge-busy-text: #92400e;
  --badge-cancelled-bg: #f1f5f9;
  --badge-cancelled-text: #64748b;
  --badge-onboarded-bg: #dcfce7;
  --badge-onboarded-text: #166534;
  --badge-msg-bg: #dbeafe;
  --badge-msg-text: #1d4ed8;
  --today-bg: #7c3aed;
  --today-text: var(--white);

  --font-text: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-display: 'Nunito', system-ui, sans-serif;
  --font-family: var(--font-text);

  --fs-xs: 13px;
  --fs-sm: 14px;
  --fs-md: 15px;
  --fs-base: 16px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-title: 36px;

  --lh-sm: 20px;
  --lh-base: 24px;
  --lh-xl: 28px;
  --lh-title: 44px;

  --fw-light: 320;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  font-family: var(--font-text);
}

body.theme-dark, .theme-scope-dark {
  color-scheme: dark;

  --bg: #070707;
  --panel: #0f1010;
  --border: #1c1c1c;
  --border-subtle: rgba(28, 28, 28, 0.7);
  --muted: rgba(255, 255, 255, 0.55);
  --text: #e3e3e3;
  --primary: #e3e3e3;
  --primary-foreground: #171717;
  --accent: rgba(255, 255, 255, 0.06);
  --shadow: 0 0 20px rgba(0, 0, 0, 0.28);

  --nav-active-bg: rgba(255, 255, 255, 0.10);
  --nav-active-text: var(--text);
  --nav-active-border: transparent;

  --success-bg: rgba(34, 197, 94, 0.12);
  --success-text: #86efac;
  --success-border: rgba(34, 197, 94, 0.25);
  --error-bg: rgba(239, 68, 68, 0.12);
  --error-text: #fca5a5;
  --error-border: rgba(239, 68, 68, 0.25);
  --warning-bg: rgba(249, 115, 22, 0.12);
  --warning-text: #fdba74;
  --warning-border: rgba(249, 115, 22, 0.25);
  --info-bg: rgba(59, 130, 246, 0.12);
  --info-text: #93c5fd;
  --info-border: rgba(59, 130, 246, 0.25);

  --stat-blue-border: rgba(59, 130, 246, 0.4);
  --stat-blue-bg: rgba(59, 130, 246, 0.10);
  --stat-blue-icon-bg: rgba(59, 130, 246, 0.15);
  --stat-blue-label: #60a5fa;
  --stat-blue-count: #93c5fd;
  --stat-purple-border: rgba(139, 92, 246, 0.4);
  --stat-purple-bg: rgba(139, 92, 246, 0.10);
  --stat-purple-icon-bg: rgba(139, 92, 246, 0.15);
  --stat-purple-label: #c4b5fd;
  --stat-purple-count: #ddd6fe;
  --stat-orange-border: rgba(249, 115, 22, 0.4);
  --stat-orange-bg: rgba(249, 115, 22, 0.10);
  --stat-orange-icon-bg: rgba(249, 115, 22, 0.15);
  --stat-orange-label: #fb923c;
  --stat-orange-count: #fdba74;
  --stat-green-border: rgba(16, 185, 129, 0.4);
  --stat-green-bg: rgba(16, 185, 129, 0.10);
  --stat-green-icon-bg: rgba(16, 185, 129, 0.15);
  --stat-green-label: #34d399;
  --stat-green-count: #6ee7b7;

  --badge-booked-bg: rgba(59, 130, 246, 0.15);
  --badge-booked-text: #3b82f6;
  --badge-completed-bg: rgba(139, 92, 246, 0.15);
  --badge-completed-text: #c4b5fd;
  --badge-noshow-bg: rgba(239, 68, 68, 0.15);
  --badge-noshow-text: #fca5a5;
  --badge-free-bg: rgba(16, 185, 129, 0.15);
  --badge-free-text: #6ee7b7;
  --badge-busy-bg: rgba(245, 158, 11, 0.15);
  --badge-busy-text: #fcd34d;
  --badge-cancelled-bg: rgba(148, 163, 184, 0.15);
  --badge-cancelled-text: #94a3b8;
  --badge-onboarded-bg: rgba(34, 197, 94, 0.15);
  --badge-onboarded-text: #86efac;
  --badge-msg-bg: rgba(59, 130, 246, 0.15);
  --badge-msg-text: #93c5fd;
  --today-bg: #a78bfa;
  --today-text: #1e1333;
}

/* Feature-scoped token additions (moved from component styles). */
:root {
  --scrim: rgba(15, 23, 42, 0.45);
}

body.theme-dark {
  --scrim: rgba(0, 0, 0, 0.6);
}

:root {
  --journey-drawer-width: 420px;
  --journey-chat-rail-width: 52px;

  --journey-sidebar-w: var(--consultops-sidebar-w, 256px);
  --journey-rail-offset: var(--journey-chat-rail-width);
}

:root {
  --sn-progress-bg: color-mix(in srgb, #16a34a 10%, var(--panel));
  --sn-concern-bg: color-mix(in srgb, #0d9488 10%, var(--panel));
  --sn-obs-bg: var(--panel);
  --sn-progress-hdr: #166534;
  --sn-concern-hdr: #0f766e;
  --sn-highlight-bg: #fef08a;
  --sn-highlight-text: var(--black);
}

body.theme-dark {
  --sn-progress-hdr: #4ade80;
  --sn-concern-hdr: var(--muted);
}

/* AI accent (Copilot identity) — added when merging main. */
:root {
  --ai-indigo: #4f46e5;
  --ai-violet: #7c3aed;
  --ai-grad: linear-gradient(135deg, var(--ai-indigo), var(--ai-violet));
  --ai-border: color-mix(in srgb, var(--ai-violet) 32%, var(--border));
}
body.theme-dark {
  --ai-indigo: #818cf8;
  --ai-violet: #a78bfa;
  --ai-grad: linear-gradient(135deg, var(--ai-indigo), var(--ai-violet));
  --ai-border: color-mix(in srgb, var(--ai-violet) 34%, var(--border));
}
