/* Design tokens — the only place a colour, size, radius, shadow or font is written.
 *
 * Every other stylesheet uses `var(--…)`. Names follow the inventory manager's
 * `index.css` where they overlap, so the two tools stay siblings. The text colours on
 * light status fills (`--color-*-text`) are separate tokens because the fill colours
 * themselves fail WCAG AA as small text (audit 2026-09-25; docs/research/
 * ui-system-failure-modes.md SH2). Contrast of every text pair here is >= 4.5:1.
 */

:root {
  /* --- type ------------------------------------------------------------------------ */
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 12px;   /* labels, meta, badges, table headers */
  --text-sm: 13px;   /* table cells, inputs, secondary copy */
  --text-md: 14px;   /* body */
  --text-lg: 16px;   /* card and drawer titles */
  --text-xl: 20px;   /* page title */
  --text-2xl: 24px;  /* KPI figures */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.25;
  --leading-normal: 1.5;

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

  /* --- neutrals ---------------------------------------------------------------------- */
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-surface-sunk: #f8f9fb;
  --color-surface-hover: #f3f5f8;
  --color-border: #e2e5ea;
  --color-border-strong: #ccd0d8;
  --color-border-light: #eff0f3;

  --color-text: #1a1d26;
  --color-text-secondary: #5e6578;
  --color-text-muted: #6b7280;   /* was #8a91a3 (3.2:1); now 4.8:1 on white */
  --color-text-inverse: #ffffff;

  /* --- sidebar ----------------------------------------------------------------------- */
  --color-sidebar: #0b1120;
  --color-sidebar-hover: rgba(255, 255, 255, 0.06);
  --color-sidebar-active: rgba(99, 149, 255, 0.15);
  --color-sidebar-accent: #6395ff;
  --color-sidebar-rule: rgba(255, 255, 255, 0.08);
  --color-sidebar-text: rgba(255, 255, 255, 0.62);

  /* --- the one accent ---------------------------------------------------------------- */
  --color-accent: #3b6cf5;
  --color-accent-hover: #2d5ce0;
  --color-accent-light: #eef2ff;
  --color-accent-text: #2d5ce0;
  --color-focus-ring: rgba(59, 108, 245, 0.35);

  /* --- status ------------------------------------------------------------------------ */
  --color-success: #0d9668;
  --color-success-light: #ecfdf5;
  --color-success-text: #047857;
  --color-warning: #b86e0b;
  --color-warning-light: #fffbeb;
  --color-warning-text: #92580a;
  --color-danger: #dc2626;
  --color-danger-hover: #c81e1e;
  --color-danger-light: #fef2f2;
  --color-danger-text: #b91c1c;
  --color-purple: #7c3aed;
  --color-purple-light: #f5f3ff;
  --color-neutral-light: #f0f1f4;

  /* --- shape ------------------------------------------------------------------------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);

  --transition-fast: 120ms ease;

  /* --- layout ------------------------------------------------------------------------ */
  --sidebar-width: 232px;
  --page-pad-x: var(--space-8);
  --content-max: 1440px;
  --drawer-width: 480px;
  --control-height: 34px;

  --z-sticky: 10;
  --z-bulkbar: 30;
  --z-overlay: 40;
  --z-toast: 50;
}
