/* ─────────────────────────────────────────────────────────────────────────────
   Kontor — Design Tokens (v1.1 · 2026-05-25)
   ─────────────────────────────────────────────────────────────────────────────
   Single source of truth for colors, geometry, motion, and elevation.
   All pages include this file and use these tokens via `var(--…)` instead of
   hard-coded hex.

   v1.1 consolidates tokens previously split across theme.css, aurora-overrides.css,
   and dashboard-aurora.css. There are no token `:root` blocks elsewhere — those
   files now contain CSS rules only. To change a color, radius, shadow, or motion
   timing, change it HERE.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  /* ── Surfaces (Option B cool slate) ────────────────────────────── */
  --bg:          #F8FAFC;   /* page surface — was #F7F6F3 warm cream (v1.0) */
  --card:        #FFFFFF;
  --sidebar:     #FFFFFF;
  --border:      #CBD5E1;   /* card borders — was #E2E1DC (v1.0) */
  --border-lt:   #E2E8F0;   /* dividers, hover backs — was #EFEFEB (v1.0) */

  /* ── Text hierarchy ────────────────────────────────────────────── */
  --text:        #111827;
  --text-2:      #6B7280;
  --text-3:      #9CA3AF;

  /* ── Brand ─────────────────────────────────────────────────────── */
  --blue:        #1B3A6B;
  --blue-lt:     #EEF2F9;
  --blue-mid:    #B8C9E4;
  --blue-hover:  #244A85;   /* interactive hover state */
  --blue-soft:   #EEF2F9;   /* matches --blue-lt */
  --blue-soft-text: #1B3A6B;   /* matches --blue */
  --green:       #0A7355;
  --green-lt:    #DCF0E8;
  --red:         #C0392B;
  --red-lt:      #F5DADA;
  --amber:       #B86E00;
  --amber-lt:    #F5E9CC;
  --gold-warm:   #ECB260;   /* warm honey, landing hero animation accent (processing warmth) */
  --teal:        #0E6B8E;   /* steel teal — also exposed as --cash-0 */
  --teal-lt:     #DFF1F4;
  --purple:      #6B46C1;
  --purple-lt:   #EEEAFE;

  /* ── Semantic (canonical names — use these in new code) ────────── */
  --success:     #0A7355;   /* forest green */
  --success-lt:  #DCF0E8;
  --warning:     #B86E00;   /* mustard amber */
  --warning-lt:  #F5E9CC;
  --danger:      #C0392B;   /* tomato red */
  --danger-lt:   #F5DADA;
  --info:        #1B3A6B;
  --info-lt:     #EEF2F9;

  /* Extended semantic (for graded intensity — e.g. badges, pills) */
  --success-50:  #DCFCE7;
  --success-500: #10B981;
  --success-700: #0A7355;
  --warning-50:  #FEF3C7;
  --warning-500: #F59E0B;
  --warning-700: #B86E00;
  --danger-50:   #FEE2E2;
  --danger-500:  #EF4444;
  --danger-700:  #C0392B;
  --info-50:     #EEF2F9;
  --info-500:    #3B82F6;

  /* ── Banner severity — ONE source per severity ─────────────────────
     Every banner / notice / callout surface draws its background, its
     lead colour and its border from exactly one of these three trios.
     Nothing outside this file may hard-code a severity colour.

       info     informational, no action needed
       warning  action recommended or confirmation pending, non-blocking
       error    blocks posting or requires review

     These are the platform's existing severity colours, not new ones:
     info and error alias the semantic families above unchanged, and
     warning is the brand amber the Bill-to band already carried. The
     stray Tailwind butter yellow (--warning-50) that a handful of
     notice surfaces had drifted onto is retired from banner duty; it
     survives only as the hover tint of the amber outline button/chip.
     ──────────────────────────────────────────────────────────────── */
  --severity-info-bg:        var(--info-lt);     /* #EEF2F9 */
  --severity-info-fg:        var(--info);        /* #1B3A6B */
  --severity-info-border:    var(--blue-mid);    /* #B8C9E4 */
  --severity-warning-bg:     var(--warning-lt);  /* #F5E9CC */
  /* Darkened one step along the brand amber hue (R:G held at 184:110, B=0) so
     the lead text clears WCAG AA on both the tint and the white expansion
     body: --warning #B86E00 scored 3.30:1 / 3.99:1, this scores 4.52:1 /
     5.45:1. Deliberately NOT --warning — the brand amber stays as-is for
     chips, buttons and icons; only banner lead text needs the AA floor. */
  --severity-warning-fg:     #995B00;
  --severity-warning-border: #FDE68A;
  --severity-error-bg:       var(--danger-lt);   /* #F5DADA */
  /* Same treatment as the warning lead above: darkened along its own hue
     (R:G:B held at 192:57:43) until the lead text clears WCAG AA on the
     tint as well as on white. --danger #C0392B scored 4.12:1 / 5.44:1,
     this scores 4.55:1 / 6.00:1. --danger itself is unchanged — the brand
     red still drives buttons, icons and inline error text. */
  --severity-error-fg:       #B43628;
  --severity-error-border:   #FECACA;

  /* ── Sequential scales (analytics charts) ──────────────────────── */
  /* Aging — brand-aligned, sharper progression for bucket separation */
  --aging-0:     #0A7355;   /* forest green — not yet due (= brand --success) */
  --aging-1:     #D4A106;   /* goldenrod — 1–30 (caution) */
  --aging-2:     #D97706;   /* darker amber — 31–60 (warning) */
  --aging-3:     #9A3412;   /* deep rust — 61–90 (serious) */
  --aging-4:     #991B1B;   /* deep red — 90+ (critical) */

  /* Cash Projection — brand-aligned blue/teal progression */
  --cash-0:      #0E6B8E;   /* steel teal — next 7d */
  --cash-1:      #2E5F9E;   /* muted blue — 8–14d */
  --cash-2:      #1B3A6B;   /* brand blue — 15–30d (matches --blue) */
  --cash-3:      #3E5780;   /* slate blue — 31–60d */
  --cash-4:      #9CA3AF;   /* neutral gray — beyond (matches --text-3) */

  /* ── Elevation (Aurora refined shadows) ────────────────────────── */
  --shadow-sm:         0 1px 2px rgba(17,24,39,.04);
  --shadow:            0 1px 3px rgba(17,24,39,.05), 0 4px 12px rgba(17,24,39,.04);
  --shadow-card-hover: 0 2px 8px rgba(17,24,39,.06), 0 8px 24px rgba(17,24,39,.06);
  --shadow-focus-ring: 0 0 0 3px rgba(27,58,107,.14);

  /* ── Geometry (Aurora radii) ───────────────────────────────────── */
  --radius-sm:   6px;    /* form inputs, small buttons */
  --radius:      8px;    /* default — buttons, pills, tabs */
  --radius-lg:   12px;   /* modals, drawers */
  --radius-xl:   14px;   /* default card radius */
  --radius-2xl:  16px;   /* hero cards */
  --radius-pill: 100px;

  /* ── Landing content width ──────────────────────────────────────
     One container for the rebuilt landing sections, from the hero
     (prototype v15) downwards. .wrap-landing in landing.css consumes
     both, and so does the nav bar on every page (.nav-inner); the gutter
     narrows to 20px up to 720px (see the end of file). */
  --landing-container: 1680px;
  --landing-gutter:    clamp(24px, 6vw, 112px);

  /* ── Knowledge-article diagram palette ─────────────────────────────
     The inline SVGs on /wissen and /en/knowledge address their fills by
     these names. The three rate-type tiers are a SINGLE-HUE NAVY VALUE
     RAMP, per the sequential-scale doctrine: monochrome by design, no
     red / green / gold as a signal. Editorial diagrams carry no severity
     colour, so nothing here is green or amber any more, and the tiers are
     FLAT fills. Depth comes from the drop shadow, not a gradient: a
     gradient whose top is the next lighter ramp step drops white-on-fill
     contrast to 3.05 at the top of the secondary tier, under AA.

       tier-1  closing rate / primary     #1B3A6B, white text, 11.27
       tier-2  average rate / secondary   #47598A, white text,  6.85
       tier-3  historical rate / tertiary #8494B5, --text,      5.82

     WHERE THE TIER VALUES COME FROM. They are the navy aging ramp
     `--aging-2 / -3 / -4` in spa/src/theme.css. They are written out here
     rather than referenced, because THIS file still carries the older
     green-to-red aging ramp under those same names, and /analytics is a
     live page that reads it. Retargeting --aging-* here to match the SPA
     would recolour that page. The two files need reconciling; that is a
     separate change, and until it happens these three values are the
     mirror. --kontor-tier-1 stays a var() because #1B3A6B is --blue here
     as well, so there is nothing to mirror.

     On `cta`: the balancing figure is the one non-tier role. --danger
     draws the hatch, the bracket and the legend swatch, where it is a
     graphic mark; --severity-error-fg draws every red TEXT run, because
     --danger on --danger-lt scores 4.12 and misses AA, which is the
     documented reason --severity-error-fg exists.
     ──────────────────────────────────────────────────────────────── */
  --kontor-text:            var(--text);        /* #111827 */
  --kontor-text-muted:      var(--text-2);      /* #6B7280 */
  --kontor-hairline:        var(--border-lt);   /* #E2E8F0 */
  --kontor-panel:           var(--bg);          /* #F8FAFC */
  --kontor-card:            var(--card);        /* #FFFFFF */
  --kontor-on-fill:         var(--card);        /* text and plates on a filled tier */
  --kontor-shadow:          var(--text);        /* drop-shadow flood, always with an opacity */
  --kontor-tier-1:          var(--blue);        /* #1B3A6B — = spa --aging-4 */
  --kontor-tier-2:          #47598A;            /* mirrors spa/src/theme.css --aging-3 */
  --kontor-tier-3:          #8494B5;            /* mirrors spa/src/theme.css --aging-2 */
  --kontor-on-tier-3:       var(--text);        /* #111827 — tier 3 is too light for white */
  --kontor-cta:             var(--danger);            /* #C0392B — graphic marks only */
  --kontor-cta-text:        var(--severity-error-fg); /* #B43628 — every red text run */
  --kontor-cta-bg:          var(--danger-lt);         /* #F5DADA */

  /* ── Motion ────────────────────────────────────────────────────── */
  --ease-out:         cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:      cubic-bezier(0.4, 0, 0.2, 1);
  --duration-instant: 80ms;
  --duration-fast:    180ms;
  --duration:         220ms;
  --duration-medium:  280ms;
  --duration-slow:    350ms;
}

@media (max-width: 720px) {
  :root { --landing-gutter: 20px; }
}
