/*
 * Design tokens: single source of truth for the dashboard.
 * Declared on both :root (top-level pages) and :host (views mounted in a
 * shadow root by the workspace shell, where :root variables do not apply).
 * Base values are contrast-checked; see docs/decisions and the design-tokens
 * test for the checks this file must keep passing.
 */
:root,:host{
  /* Accent (purple), unified across the app. White text on accent: 6.8:1. */
  --color-accent:#5145ce;
  --color-accent-hover:#4336b5;
  --color-accent-soft:#eeecfb;
  --color-accent-border:#dfdaf7;

  /* Text */
  --color-ink:#273043;
  --color-text-secondary:#4f5a6e;
  --color-text-muted:#5b6478;

  /* Surfaces */
  --color-bg:#f7f8fc;
  --color-surface:#ffffff;
  --color-surface-tint:#fbf9ff;
  --color-surface-soft:#f4f3fc;

  /* Lines */
  --color-line:#e3e7ef;
  --color-line-strong:#cfd5e1;

  /* State: success (green). Text/bg contrast 5.4:1. */
  --color-success-text:#1f6f4a;
  --color-success-bg:#e6f4ec;
  --color-success-border:#bfe3cf;

  /* State: warning (amber). Text/bg contrast 5.31:1. */
  --color-warning-text:#8a5a00;
  --color-warning-bg:#fff1d6;
  --color-warning-border:#f0d9a6;

  /* State: danger (red). Text/bg contrast 6.39:1. */
  --color-danger-text:#9a3324;
  --color-danger-bg:#fdecea;
  --color-danger-border:#f3c6bd;

  /* State: info (blue). No dedicated text token: info blocks use --color-ink
     or --color-text-secondary, which both clear 4.5:1 on this background. */
  --color-info-bg:#edf3ff;
  --color-info-border:#d7e6fb;

  /* Focus ring */
  --focus-ring:3px solid #9c98ed;
  --focus-offset:3px;

  /* Type scale */
  --text-xs:12px;
  --text-sm:13px;
  --text-md:15px;
  --text-lg:17px;
  --text-xl:21px;
  --text-2xl:28px;
  --leading-tight:1.3;
  --leading-normal:1.5;
  --leading-loose:1.7;
  --font-sans:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,monospace;

  /* Spacing */
  --space-1:4px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:20px;
  --space-6:24px;
  --space-8:32px;
  --space-10:40px;

  /* Radius (50% for circles stays outside the scale) */
  --radius-sm:6px;
  --radius-md:10px;
  --radius-lg:14px;

  /* Shadow */
  --shadow-sm:0 3px 12px #27304306;
  --shadow-md:0 12px 28px #242b3c18;
  --shadow-lg:0 24px 70px #27304330;

  /* Modal/dialog backdrop overlay, consolidated from several near-identical values. */
  --overlay-backdrop:#20243370;

  /* Legacy aliases kept during migration; new code should use the tokens above. */
  --accent:var(--color-accent);
  --blue:var(--color-accent);
  --muted:var(--color-text-muted);
  --line:var(--color-line);
  --navy:var(--color-ink);

  /*
   * Legacy dark sidebar (styles.css / index.html auth workspace only): this
   * one component keeps a dark navy sidebar distinct from the rest of the
   * light-surface system, so its handful of one-off shades live here rather
   * than being forced into the shared light-surface tokens above.
   */
  --legacy-sidebar-hover:#203453;
  --legacy-sidebar-active:#253d66;
  --legacy-sidebar-badge:#3c64a5;
  --legacy-sidebar-text:#b7c4d8;
  --legacy-sidebar-text-dim:#94a4bd;
  --legacy-sidebar-text-faint:#8495af;
  --legacy-sidebar-caption:#c1cee0;
  --legacy-sidebar-accent:#5286ff;
  --legacy-sidebar-link-border:#57739a;
  --legacy-sidebar-link-hover:#24436a;
}
