/* =============================================================================
   brand-tokens.css — thin early-load alias (Phase 8.1 / B6)
   Canonical brand primitives also live at the TOP of tokens.css (bundled in
   bundle-foundation.css). This file remains for early cascade load in css.blade.php
   and for standalone auth/public pages. Prefer editing tokens.css brand section and
   syncing here, or re-run: keep both in sync via css:bundle source order.
   FOLDED INTO tokens.css: yes
   ============================================================================= */

/* =============================================================================
   AIO ERP — BRAND TOKENS (single source of truth)
   -----------------------------------------------------------------------------
   Part of the AIO Nexus family design system. AIO ERP = the navy node.
   LOAD THIS FIRST in the cascade, before bundle-foundation.css and all themes.
   Everything downstream consumes these via var(--brand-*).

   Sections:
     1. Brand primitives        — raw palette, never used directly in components
     2. Compatibility shims      — bridge legacy --nx-* / --gold during migration
     3. Module → product colors  — KPI tiles, sidebar glyphs, charts
   Spec: docs/brand-theme/SPEC.md §2
   ============================================================================= */

/* ── 1. BRAND PRIMITIVES ──────────────────────────────────────────────────── */
:root {
  /* Core */
  --brand-ink:        #0A1733;
  --brand-ink-2:      #142849;
  --brand-navy:       #1E3A6F;
  --brand-navy-soft:  #2C4F8A;
  --brand-navy-light: #EEF2F9;
  --brand-gold:       #D4A24C;
  --brand-gold-2:     #B8862E;
  --brand-gold-light: #FAF3E2;
  --brand-blue:       var(--brand-navy); /* legacy alias was #147CBB */

  /* Product / status hues */
  --brand-teal:        #0F766E;
  --brand-teal-light:  #E6F4F2;
  --brand-green:       #15803D;
  --brand-green-light: #E8F5EC;
  --brand-violet:      #6D28D9;
  --brand-violet-light:#F1ECFB;
  --brand-violet-2:    #4C1D95;
  --brand-violet-soft: #7C3AED;
  --brand-red:         #DC2626;
  --brand-red-light:   #FCEDED;
  --brand-wa:          #25D366;

  /* Neutrals + text scale */
  --brand-surface: #F6F8FB;
  --brand-paper:   #FCFCFD;
  --brand-line:    #E5E9F0;
  --brand-line-2:  #D5DBE5;
  --brand-t1:      #0A1733;
  --brand-t2:      #3D4D6B;
  --brand-t3:      #7A8AA6;
  --brand-t4:      #A8B3C6;

  /* Type — Inter for UI, JetBrains Mono for code/currency codes. No italic. */
  --brand-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Display font — used for headings, KPIs, hero text. Defaults to sans (no display font). */
  --brand-font-display: var(--brand-font-sans);

  /* Semantic leading scale — role-based line-height aliases */
  --leading-tight:   1.25;
  --leading-snug:    1.375;
  --leading-body:    1.6;
  --leading-relaxed: 1.75;

  /* Motion */
  --brand-ease: cubic-bezier(.4, 0, .2, 1);
  --brand-dur-fast: 150ms;
  --brand-dur:      250ms;
  --brand-dur-slow: 400ms;
}

/* ── 2. COMPATIBILITY SHIMS ───────────────────────────────────────────────────
   Keep existing pages working while callers migrate to --brand-*.
   Removed in PR-7 once nothing references these directly. */
:root {
  --nx-ink:      var(--brand-ink);
  --nx-ink-2:    var(--brand-ink-2);
  --nx-navy:     var(--brand-navy);
  --nx-navy-soft:var(--brand-navy-soft);
  --nx-gold:     var(--brand-gold);
  --nx-gold-dark:var(--brand-gold-2);
  --nx-surface:  var(--brand-surface);
  --nx-paper:    var(--brand-paper);
  --nx-border:   var(--brand-line);
  --nx-shadow:   var(--brand-shadow-lg);
  --nx-r:        var(--brand-r);
  --nx-r-sm:     var(--brand-r-sm);

  /* Legacy theme-layer alias used widely today */
  --gold: var(--brand-gold);
}

/* ── 3. MODULE → PRODUCT COLOR MAP ────────────────────────────────────────────
   Drives KPI tiles, sidebar module glyphs, and chart series per module. */
:root {
  --mod-erp:        var(--brand-navy);
  --mod-remit:      var(--brand-gold);
  --mod-market:     var(--brand-teal);
  --mod-crm:        var(--brand-green);
  --mod-accounting: var(--brand-violet);
  --mod-tax:        var(--brand-red);
  --mod-legal:      var(--brand-teal);
  --mod-marketing:  var(--brand-gold-2);
  --mod-dev:        var(--brand-navy);
  --mod-hosting:    var(--brand-green);
  --mod-wa-api:     var(--brand-wa);
  --mod-loc-api:    var(--brand-red);
}
