/* ==========================================================================
   Design tokens — two tiers.

   1. Raw palette (--color-*): values lifted from the Figma "WF Supply Chain
      Scorecard" frame. Referenced ONLY in this file.
   2. Semantic tier: what components use. The dark theme overrides this tier
      only, so no component ever needs a theme selector.
   ========================================================================== */

:root {
  color-scheme: light;

  /* --- raw palette (Figma) --- */
  --color-navy-950: #061854;   /* Blue10: accent bar */
  --color-navy-900: #1c2b45;   /* ink, table header */
  --color-blue-700: #2748ba;   /* Blue07: brand */
  --color-blue-200: #c5d2ff;   /* Blue02 */
  --color-slate-600: #5b6472;
  --color-slate-500: #667085;
  --color-slate-400: #868f9d;   /* control edge; Figma's #d7e0ea was 1.33:1 on white (WCAG 1.4.11 wants 3) */
  --color-slate-300: #c3c9d1;
  --color-slate-200: #dde1e7;
  --color-slate-100: #f6f8fa;
  --color-slate-50: #fafbfc;
  --color-green-700: #1e6437;
  --color-green-600: #3f6b52;
  --color-green-100: #def1e4;
  --color-green-50: #e1ece6;
  --color-amber-700: #835f1e;   /* Figma's #b4832a was 2.8:1 on amber-100 */
  --color-purple-700: #6b3fa0;  /* the burn-up's launch marker, as in the design */
  --color-amber-100: #f3e9d6;
  --color-red-800: #991a1a;
  --color-red-700: #a63a2e;
  --color-red-100: #f2dede;
  --color-grey-700: #616161;   /* Grey08 #686868 was 4.3:1 on Grey02 */
  --color-grey-200: #e2e2e2;   /* Grey02 */
  --color-white: #ffffff;

  /* --- semantic: surfaces --- */
  --page: var(--color-slate-50);
  --band: var(--color-slate-100);
  --surface: var(--color-white);
  --surface-muted: rgba(255, 255, 255, 0.6);
  --surface-inverse: var(--color-navy-900);
  --accent-bar: var(--color-navy-950);

  /* --- semantic: text --- */
  --text: var(--color-navy-900);
  --text-2: var(--color-slate-600);
  --text-3: var(--color-slate-500);
  --text-on-inverse: var(--color-white);
  --brand: var(--color-blue-700);
  --wordmark-from: #022791;
  --wordmark-to: #000f3a;

  /* --- semantic: lines --- */
  --border: var(--color-slate-200);
  --border-strong: var(--color-slate-300);
  --border-input: var(--color-slate-400);
  --rule: var(--color-navy-900);
  --track: var(--color-slate-200);
  --focus: var(--color-blue-700);
  --chart-line: var(--color-blue-700);
  --chart-fill: rgba(39, 72, 186, 0.10);   /* blue-700 tint under the burndown line */
  --chart-fill-projection: rgba(39, 72, 186, 0.05);  /* half the fill, the projected stretch */
  --chart-target: var(--color-amber-700);
  --chart-gap: rgba(131, 95, 30, 0.10);      /* amber-700 tint: still to deliver */
  --chart-launch: var(--color-purple-700);

  /* --- semantic: status tones (good | warn | bad | info | neutral) --- */
  --status-good-fg: var(--color-green-600);
  --status-good-bg: var(--color-green-50);
  --status-good-strong-fg: var(--color-green-700);
  --status-good-strong-bg: var(--color-green-100);
  --status-warn-fg: var(--color-amber-700);
  --status-warn-bg: var(--color-amber-100);
  --status-bad-fg: var(--color-red-800);
  --status-bad-bg: var(--color-red-100);
  --status-bad-strong-fg: var(--color-red-700);
  --status-bad-strong-bg: rgba(166, 58, 46, 0.2);
  --status-info-fg: var(--color-blue-700);
  --status-info-bg: var(--color-blue-200);
  --status-neutral-fg: var(--color-grey-700);
  --status-neutral-bg: var(--color-grey-200);

  /* --- shape & type --- */
  --radius-badge: 5px;
  --radius-input: 8px;
  --radius-control: 6px;
  --radius-card: 10px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow-overlay: 0 12px 32px -16px rgba(6, 24, 84, 0.35);
}

/* Dark palette — derived; Figma only specifies light. Overrides the semantic tier only. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --page: #0b1220;
  --band: #111a2b;
  --surface: #16213a;
  --surface-muted: rgba(255, 255, 255, 0.04);
  --surface-inverse: #2a3a5c;
  --accent-bar: #2748ba;

  --text: #e6eaf2;
  --text-2: #a8b1c2;
  --text-3: #8c96a8;
  --text-on-inverse: #f5f7fb;
  --brand: #9db2ff;
  --wordmark-from: #c5d2ff;
  --wordmark-to: #7f97e6;

  --border: #26324a;
  --border-strong: #34425e;
  --border-input: #5e7093;
  --rule: #3d4d6e;
  --track: #26324a;
  --focus: #9db2ff;
  --chart-line: #9db2ff;
  --chart-fill: rgba(157, 178, 255, 0.14);
  --chart-fill-projection: rgba(157, 178, 255, 0.07);
  --chart-target: #d9a54a;
  --chart-gap: rgba(217, 165, 74, 0.12);
  --chart-launch: #c4a6f0;

  --status-good-fg: #6fbf8a;
  --status-good-bg: rgba(111, 191, 138, 0.18);
  --status-good-strong-fg: #7ed09a;
  --status-good-strong-bg: rgba(126, 208, 154, 0.2);
  --status-warn-fg: #d9a54a;
  --status-warn-bg: rgba(217, 165, 74, 0.18);
  --status-bad-fg: #e87d7d;
  --status-bad-bg: rgba(232, 125, 125, 0.18);
  --status-bad-strong-fg: #ef8a7c;
  --status-bad-strong-bg: rgba(239, 138, 124, 0.22);
  --status-info-fg: #9db2ff;
  --status-info-bg: rgba(157, 178, 255, 0.2);
  --status-neutral-fg: #b3b3b3;
  --status-neutral-bg: rgba(179, 179, 179, 0.2);

  --shadow-overlay: 0 12px 32px -16px rgba(0, 0, 0, 0.7);
}
