/* giixi DORA — GLOBAL DESIGN TOKENS (single source of truth).
   Historically named ir-tokens.css; it is loaded after style.css in the base
   <head>, so it owns the system palette and remaps every legacy/module alias.
   Change colours HERE — modules reference these tokens, they don't define their own.
   System accent: indigo. Body background (--bg-0) is intentionally kept as-is. */

:root {
  /* ===== Surfaces — near-black canvas (body --bg-0 kept as-is) ===== */
  --bg-0: #161618;
  --bg-1: #1C1C20;
  --bg-2: #1A1A1D;
  --surf-1: #222227;
  --surf-2: #2A2A30;
  --surf-3: #32323A;
  --line: #2A2A30;
  --line-strong: #3A3A42;

  /* ===== Text ===== */
  --ink-0: #FAFAFA;
  --ink-1: #D4D4D8;
  --ink-2: #A1A1AA;
  --ink-3: #71717A;

  /* ===== Accent — system-wide STEEL/SLATE (the one accent for the whole app) ===== */
  --accent:      #475569;
  --accent-hi:   #64748B;   /* lighter — hover */
  --accent-dark: #334155;   /* deeper — pressed / gradients */
  --accent-soft: rgba(71, 85, 105, 0.15);   /* tinted fills */
  --accent-line: rgba(71, 85, 105, 0.40);   /* tinted borders / rings */
  --accent-ink:  #FFFFFF;   /* text & icons sitting ON an accent fill */

  /* ===== Semantic status — consistent everywhere ===== */
  --ok:     #22C55E;  --ok-soft:     rgba(34, 197, 94, 0.15);
  --warn:   #F59E0B;  --warn-soft:   rgba(245, 158, 11, 0.15);
  --danger: #EF4444;  --danger-soft: rgba(239, 68, 68, 0.14);
  --info:   #3B82F6;  --info-soft:   rgba(59, 130, 246, 0.14);

  /* Legacy "gold" tokens now ALIAS the accent, so every existing var(--gold)
     usage (IR primary buttons, focus rings, icon chips) becomes the system
     indigo. Genuine warnings use --warn (amber), never --gold. */
  --gold:      var(--accent);
  --gold-hi:   var(--accent-hi);
  --gold-soft: var(--accent-soft);
  --gold-line: var(--accent-line);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px -12px rgba(0,0,0,0.6);

  --font-sans: "Plus Jakarta Sans", "Inter", "Roboto", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: "Fraunces", "Plus Jakarta Sans", serif;

  /* ===== Remap legacy giixi aliases onto the central tokens ===== */
  /* Primary (was a muted grey-blue in style.css) now follows the accent */
  --color-primary:       var(--accent);
  --color-primary-hover: var(--accent-hi);
  --color-primary-dark:  var(--accent-dark);

  --bg-body: var(--bg-0);
  --bg-card: var(--surf-1);
  --bg-card-secondary: var(--bg-1);
  --bg-input: var(--bg-0);
  --bg-sidebar: var(--bg-2);
  --bg-navbar: var(--bg-1);
  --bg-hover: var(--surf-2);
  --bg-table-header: rgba(0, 0, 0, 0.12);
  --bg-table-row-alt: var(--surf-1);
  --bg-table-row-hover: var(--surf-2);

  --text-primary: var(--ink-0);
  --text-secondary: var(--ink-1);
  --text-muted: var(--ink-3);
  --text-heading: var(--ink-0);
  --text-link: var(--ink-1);
  --text-link-hover: var(--ink-0);

  --border-color: var(--line);
  --border-light: var(--line);
  --border-focus: var(--accent);
}

/* ===== Light theme =====
   Overriding the raw surface/text tokens is enough: every alias above resolves
   through var(--bg-0)/var(--ink-0)/etc., so the whole app's chrome flips from
   this one block. The accent (indigo) and status hues are kept; only
   surfaces/text/lines invert. Dark stays the default (opt-in light). */
:root[data-bs-theme="light"] {
  --bg-0: #f4f4f5;
  --bg-1: #fafafa;
  --bg-2: #f7f7f8;
  --surf-1: #ffffff;
  --surf-2: #f1f1f3;
  --surf-3: #e8e8eb;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;

  --ink-0: #18181b;
  --ink-1: #3f3f46;
  --ink-2: #52525b;
  --ink-3: #71717a;

  /* black overlay was tuned for a dark surface; soften it on white */
  --bg-table-header: rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px -12px rgba(0,0,0,0.18);
}
