/* Per-macro-area design tokens — see docs/reference-style.md §1.1.
   Components read var(--area-*), never raw hex, so a page re-skins to another macro-area purely via
   the body.bs-area-{slug} class (stamped by the layout from Controller::getMacroArea()).
   Defaults below are Marina (teal accent + navy primary). */
:root {
    --area-accent: #1abc9c;
    --area-accent-dark: #16a085;
    --area-accent-ring: rgba(26, 188, 156, .15);
    --area-accent-ring-strong: rgba(26, 188, 156, .25);
    --area-primary: #2c3e50;
    --area-primary-dark: #1e2b37;

    /* ---- The privileged-session warning colour -------------------------------------------------
       NOT an area token: it does not change by macro-area, because it is not an identity — it is a
       warning. The root menu bar has been this brown for years, and until 2026-09-17 the value existed
       ONLY inside `css/bootstrap.min.css`, a customised build where `.navbar-default` was re-themed.
       That made it invisible to anyone reading the application's own CSS, and unusable by anything
       else: the flag in the bar, the support-session strip and root's destructive confirms each had to
       either repeat the hex or settle for a different colour. Naming it here is what makes the warning
       ONE colour with one meaning — "this session can do things to somebody else's data".
       Contrast: #802900 carries white at 8.5:1, so it is safe for text as well as for a band. */
    --root-warn: #802900;
    --root-warn-edge: #5f1e00;
    --root-warn-ink: #fff;
}

/* Per-area accent palette (all areas now defined). The accent drives icons, focus rings,
   hover/active states and the "primary highlight"; the neutral chrome and the navy --area-primary
   stay constant. Accents are tuned to read legibly on white (WCAG AA for text/UI), so a few are
   deepened from the lighter section-icon identity colours — notably accounting, where the pure
   #f1c40f yellow is unreadable as an accent. Marina uses the :root defaults (teal). */

/* Every area block below is declared for BOTH `body.bs-area-<slug>` (the whole page, stamped by the
   layout from Controller::getMacroArea()) and the bare `.bs-area-<slug>` class, so a SINGLE page that
   belongs to another area than its controller can carry that area's identity on its own wrapper —
   without a controller-wide getMacroArea() override that would re-skin every other page of it. The
   tokens are custom properties, so the wrapper's values simply inherit down to its subtree. */

/* Application / settings (super-admin / tenant-config) — the platform top-bar blue
   (.navbar-default #064a71 / #043552), so settings carries the identity of the ever-present bar. */
body.bs-area-app,
.bs-area-app            { --area-accent:#064a71; --area-accent-dark:#043552; --area-accent-ring:rgba(6,74,113,.15);   --area-accent-ring-strong:rgba(6,74,113,.25); }

/* Yard (cantiere) — dark amber. NOT red, on purpose: red was the yard identity AND the alarm colour,
   so the alarm had no channel left to speak in. With `.ref-btn i { color: var(--area-accent) }` every
   icon in a nav row was red, including the collisions warning triangle: at zero collisions it was red
   because everything was red, and when it fired it filled #e03131 — a fourth red on the page. Moving
   the identity out of the red family frees red for attention, which is now a real hue change.

   Why amber and not a bright yellow: this token is used 35 times as `color:` on white (button labels,
   icons), so it has to survive as text. Every yellow light enough to read as yellow fails badly there
   — #f1c40f is 1.66:1 and #f39c12 is 2.19:1, both under even the 3:1 a graphical object needs — and
   the lightest true yellow that reaches 4.5:1 is #7a7a00, which reads olive. #a16b00 is the yellow
   family at the only luminance that works: 4.55:1 as text on white, which is BETTER than the red it
   replaces (3.82:1, a value that never passed). White on the dark step is 6.82:1, up from 5.44:1.
   A bright yellow could only live as a FILL with dark content on it, which means flipping those 35
   `color:` uses to the dark step — a design-system change that moves Marina too, so it is separate. */
body.bs-area-yard,
.bs-area-yard       { --area-accent:#a16b00; --area-accent-dark:#7d5200; --area-accent-ring:rgba(161,107,0,.15);  --area-accent-ring-strong:rgba(161,107,0,.25); }

/* YardApp (operator PWA) — steel blue, a macro-area of its own and NOT the yard red: red reads as
   danger/destructive on a full-screen touch app, so the mobile operator app got a calmer accent. */
body.bs-area-yardapp    { --area-accent:#2E86C1; --area-accent-dark:#21618C; --area-accent-ring:rgba(46,134,193,.15); --area-accent-ring-strong:rgba(46,134,193,.25); }

/* Master data (anagrafiche) — green (deepened from #2ecc71 for accent legibility). */
body.bs-area-master,
.bs-area-master     { --area-accent:#27ae60; --area-accent-dark:#1e8449; --area-accent-ring:rgba(39,174,96,.15);  --area-accent-ring-strong:rgba(39,174,96,.25); }

/* Prices (listini) — purple (deepened from #9b59b6). */
body.bs-area-prices,
.bs-area-prices     { --area-accent:#8e44ad; --area-accent-dark:#703688; --area-accent-ring:rgba(142,68,173,.15); --area-accent-ring-strong:rgba(142,68,173,.25); }

/* Accounting (contabilità) — gold (deepened from #f1c40f, which fails contrast as an accent). */
body.bs-area-accounting,
.bs-area-accounting { --area-accent:#b7791f; --area-accent-dark:#92610f; --area-accent-ring:rgba(183,121,31,.15); --area-accent-ring-strong:rgba(183,121,31,.25); }

/* Organization — orange. */
body.bs-area-org,
.bs-area-org        { --area-accent:#e67e22; --area-accent-dark:#d35400; --area-accent-ring:rgba(230,126,34,.15); --area-accent-ring-strong:rgba(230,126,34,.25); }
