/*
 * Dashboard v2 — semantic colour tokens.
 *
 * One place where colour MEANS something, so the same meaning renders the same way on
 * every card. Same mechanism the components already use (CSS custom properties), just
 * hoisted — not a second token system.
 *
 * ALIGNED WITH THE NEW DESIGN SYSTEM (branch
 * VOM-14548-redesign-the-sidebar-to-follow-the-new-design-standards, which introduces
 * public/css/tokens.css). Every value here is that palette's own, copied verbatim —
 * primary #25B395, info #3B82F6, warning #F59E0B, error #EF4444, neutral #64748B — and
 * expressed as RGB triplets using the same convention that file uses, so tints compose
 * with rgba() at any strength from one source colour. When tokens.css lands app-wide,
 * adopting it is repointing these five declarations at its `--primary` / `--info` / etc.
 *
 * They are deliberately NOT written as `var(--primary, 37, 179, 149)` today. The running
 * theme ALREADY defines --primary (#11B99F), --info (#6cb2eb), --warning (#ffed4a) and
 * --success (#38c172) as HEX values, so that fallback form silently resolved to a hex
 * where a triplet was expected — `rgba(#11B99F, 0.28)` is invalid, and the ageing bar's
 * "current" and "31-60" segments rendered fully transparent. Caught on screen 2026-09-07;
 * namespaced literals avoid the collision entirely.
 *
 * RULES.md §1.2 note: this covers the DASHBOARD's own components only. The v2 report
 * pages keep their copy-pasted `--ard-*` blocks untouched.
 */

:root {
    /* ---- Core palette -----------------------------------------------------
     * Primary is the brand blue-green and carries "money in / healthy". Info is
     * the secondary blue and carries "further along" on the ageing scale — it is
     * a progression, not an alarm. Warning is cost. Error is reserved for the
     * genuinely severe end and appears in exactly two places (91+ ageing, and a
     * loss on the Net Profit tile).
     */
    --vom-dash-primary-rgb: 37, 179, 149;
    --vom-dash-primary: rgb(var(--vom-dash-primary-rgb));

    --vom-dash-info-rgb: 59, 130, 246;
    --vom-dash-info: rgb(var(--vom-dash-info-rgb));

    --vom-dash-warning-rgb: 245, 158, 11;
    --vom-dash-warning: rgb(var(--vom-dash-warning-rgb));

    --vom-dash-danger-rgb: 239, 68, 68;
    --vom-dash-danger: rgb(var(--vom-dash-danger-rgb));

    /* Revenue-side metrics. The design system separates `primary` (brand) from
     * `success` (state); revenue is a brand-positive, so it takes primary and
     * the two stay visually of a piece rather than introducing a third green. */
    --vom-dash-success-rgb: var(--vom-dash-primary-rgb);
    --vom-dash-success: var(--vom-dash-primary);

    /* Interactive, never semantic — links and icon buttons mean "you can click
     * this", not "this is good". */
    --vom-dash-accent-rgb: var(--vom-dash-primary-rgb);
    --vom-dash-accent: var(--vom-dash-primary);

    /* ---- Ageing ramp ------------------------------------------------------
     * Five ordered stops, least → most overdue, built from SHADES OF THE BRAND
     * BLUE-GREEN AND THE SECONDARY BLUE rather than a green→amber→red alarm
     * ramp. The previous version was read as far too loud on the receivables and
     * payables bars: five saturated, adjacent hues competing along one 8px bar
     * made the card shout before the reader had taken in a single number.
     *
     * The scale now cools as it ages — brand blue-green, through blue, to red at
     * the single most severe stop only — so severity still orders, but the page
     * reads calm and only genuinely bad debt draws the eye. Every stop is
     * consumed as a TINT (see the strengths below), never as a solid fill.
     */
    --vom-dash-age-0-rgb: var(--vom-dash-primary-rgb);
    --vom-dash-age-1-rgb: 20, 148, 160;
    --vom-dash-age-2-rgb: var(--vom-dash-info-rgb);
    --vom-dash-age-3-rgb: 79, 91, 197;
    --vom-dash-age-4-rgb: var(--vom-dash-danger-rgb);

    --vom-dash-age-0: rgb(var(--vom-dash-age-0-rgb));
    --vom-dash-age-1: rgb(var(--vom-dash-age-1-rgb));
    --vom-dash-age-2: rgb(var(--vom-dash-age-2-rgb));
    --vom-dash-age-3: rgb(var(--vom-dash-age-3-rgb));
    --vom-dash-age-4: rgb(var(--vom-dash-age-4-rgb));

    /* A credit balance (a bucket that nets negative) is not "worse than 91+
     * days" — it is a different kind of number, so it sits outside the ramp
     * entirely rather than borrowing its most severe stop. */
    --vom-dash-credit-rgb: 100, 116, 139;
    --vom-dash-credit: rgb(var(--vom-dash-credit-rgb));

    /* ---- Tint strengths ---------------------------------------------------
     * "How loud is a tint" is one decision, not one per component.
     * Surface  — KPI card washes. Barely there by design; the card is a large
     *            area and anything stronger tints the whole row.
     * Element  — pills and legend swatches. Small, so they can take more, but
     *            0.12 matches the design system's own --color-primary-tint.
     * Bar      — the ageing bar segments. These sit edge to edge with no gap, so
     *            they read louder than their opacity suggests and get the
     *            gentlest treatment of the three.
     */
    --vom-dash-tint-surface: 0.035;
    --vom-dash-tint-element: 0.12;
    --vom-dash-tint-bar: 0.28;
}
