/* ─────────────────────────────────────────────────────────────────────────
   FRW-754 — Admin cash design tokens, shipped.

   Bridges design/admin-cash/prototype/tokens.css's `--color-*` vocabulary onto
   THIS repo's own brand tokens (website/assets/css/fr-sporty-1.46.css :root),
   per HANDOFF.md's "Tokens — the one rule": name the token, never the hex.
   Every custom property below RESOLVES to a value the repo already ships
   (--fr-*) or to #4b5563, the one genuinely new value — the measured contrast
   fix already used ad hoc at reports_hub.php:60 (7.56:1 on a card, 6.62:1 on
   the page; the repo's own --fr-muted #6b7280 fails at 4.24:1 on the page bg).
   No sixth colour is invented here; see design/admin-cash/HANDOFF.md and
   DECISIONS.md for the full reconciliation.

   🛑 NAMESPACED ON PURPOSE. Every custom property is `--cash-*` (never the
   generic `--color-*` the prototype uses) and the one shared class is
   `.cash-btn-ghost` — both names collision-free with anything already in
   style-2.03.css/fr-sporty-1.46.css, so loading this file globally (the same
   single-load-point pattern as fr-sporty-1.46.css — see .ai/served-assets.json)
   cannot restyle a non-cash page. The admin cash views keep their own
   bespoke, already-unique class prefixes (.co-, .copen-, .cppl-, .bs-, .csx-)
   rather than adopting the prototype's generic vocabulary (.card, .btn,
   .field, .note, ...) verbatim — those names are already Bootstrap classes
   used everywhere else in this admin surface, and repainting them site-wide
   is exactly the "restyle non-cash pages" failure this file exists to avoid.
   The visual result still matches the Design viewer screens pixel-for-pixel,
   because the VALUES are identical; only the class names stay local. */

:root {
  /* accent — the ONE red that may carry a word or a white label (6.30:1) */
  --cash-accent:            var(--fr-red-2);
  /* accent-surface — borders/dots/left-rules only (4.23:1, fails as text) */
  --cash-accent-surface:    var(--fr-red);
  --cash-accent-soft:       var(--fr-red-soft);

  --cash-card:              var(--fr-card);
  --cash-ink:               var(--fr-ink);
  --cash-line:              var(--fr-line);
  /* a form-control-strength border, one step darker than --fr-line */
  --cash-border-strong:     #cbd2dc;

  /* the measured contrast fix — NOT --fr-muted (#6b7280), which fails 4.5:1
     against these panels' page background. See header note. */
  --cash-muted-foreground:  #4b5563;
  /* a quieter tone still, for an already-resolved/quiet row (a turned-off
     account, a quiet day) — --fr-muted2, already in the repo's own palette */
  --cash-quiet:             var(--fr-muted2);

  --cash-ok:                var(--fr-green);
  --cash-ok-ink:            var(--fr-green-ink);
  --cash-ok-soft:           var(--fr-green-soft);

  --cash-warn:              var(--fr-amber);
  --cash-warn-ink:          var(--fr-amber-ink);
  --cash-warn-soft:         var(--fr-amber-soft);

  /* one light neutral panel fill, reused wherever these views already used
     f8fafc / f8f9fa / fafbfc interchangeably for the same "quiet panel" role */
  --cash-muted:             #f8fafc;
  /* the "today" row tint and the hover tint below are visual-only additions
     that have no repo token to alias — kept as the exact values already
     shipped in these views, just named instead of scattered. */
  --cash-today-tint:        var(--fr-red-soft);
  --cash-hover-tint:        #eef4ff;
  --cash-notice-soft:       var(--fr-amber-soft);

  /* FRW-754 — the alert-style border that pairs with each *-soft fill above,
     used by the .copen-/.cppl- note boxes and bank_statement's guard cells.
     No repo `--fr-*` equivalent exists for these; kept as the exact values
     already shipped ad hoc across the three views this file now bridges. */
  --cash-ok-border:          #bbf7d0;
  --cash-warn-border:        #fde68a;
  --cash-accent-soft-border: #fecaca;

  /* FRW-760 remediation — the salary views (.sal-) need one blue accent with
     no --fr-* equivalent: the selected-filter-chip fill, the "Adjusted"
     payroll badge, and the blue info-note. `--fr-blue` (#2f6fed) already
     exists but is a different, more saturated blue used for primary CTAs
     elsewhere in the app — aliasing onto it here would visibly shift these
     views' colour, so (same reasoning as --cash-today-tint/--cash-hover-tint
     above) these are kept as the exact values the .sal- views already
     shipped, just named instead of scattered as raw hex. */
  --cash-info:             #0d6efd;
  --cash-info-ink:         #084298;
  --cash-info-soft:        #eef6ff;
  --cash-info-soft-border: #cfe2ff;
}

/* ── the one shared component this row's port needs: the plain/"ghost"
   secondary button (Cancel, Go back, the aria-disabled turn-off control).
   Replaces the repeated `style="background:#fff;color:#495057;
   border:1.5px solid #ced4da"` inline attributes across cash_openings.php /
   cash_people.php — same look, one definition. */
.cash-btn-ghost {
  background: var(--cash-card);
  color: var(--cash-muted-foreground);
  border: 1.5px solid var(--cash-border-strong);
}

/* FRW-752 follow-up (jutt cold review) — fr_cash_balance() (app/Helpers/
   venue_helper.php) wraps any negative pot in `<span class="csx-neg">`
   wherever it's called, but the only `.csx-neg`/`.csx-zero` rule in the tree
   was an inline <style> scoped to owner/profile.php's own monthly cash sheet
   (DELETED by the FRW-786 remediation — see the note under .csx-neg below).
   FRW-732 moved cash_openings/cash_people onto their
   own pages (profile/admin/cash_openings_page.php, cash_people_page.php) that
   never carried that inline block, and the bank statement's footer `bs-bal`
   cell (bank_statement_results.php) also renders through fr_cash_balance()
   rather than its own `.bs-neg` class — so a negative balance on any of the
   three rendered unstyled (correct figure, missing colour). This file is the
   one stylesheet loaded on all three (via website/style.php), so the rule
   lives here once instead of copied inline again. */
.csx-zero{color:var(--cash-quiet);}
.csx-neg{color:var(--cash-warn-ink);}
/* 🛑 AMBER, NOT RED — and this line is THE definition (FRW-786 remediation).
   DECISIONS.md §1b: red (--cash-accent) is reserved for a money HAZARD — an action
   that could put cash in the wrong pot. A negative balance is a state, not a hazard,
   so it is amber. The first FRW-786 build changed only the inline <style> in
   owner/profile.php and left this rule red, so Openings, People, a person's history,
   the bank balance cell and the SCR-89 rename screen all still rendered red while the
   owner dashboard rendered amber — the exact split the row existed to remove. That
   inline duplicate has been DELETED: this rule is now the only place .csx-neg is
   coloured, and CashNegativeAmberAndDeleteWarningTest asserts on THIS file. */

/* ─────────────────────────────────────────────────────────────────────────
   FRW-998 — Admin profile: Features (SCR-145…150) and Super Settings (SCR-151),
   design/admin-profile/HANDOFF.md v5, v3's design under today's header.

   🛑 SCOPED TO `.apx`, NEVER GLOBAL. The design's vocabulary (.tool, .badge, .note,
   .search, .potrow …) is generic, and `.badge` is a Bootstrap class used all over the
   admin UI; every rule below hangs off the `.apx` wrapper that only features_hub.php,
   deploy_guide.php and admin/profile.php render, so no other page is restyled.
   The design's `--color-*` / `--text-*` names are DEFINED ON THAT WRAPPER ONLY, each
   one an alias of a value this repo already ships (--fr-* / --cash-*): no new colour,
   and the global `--cash-*`-only rule at the top of this file still holds.
   Text floor (SCR-153): nothing below --text-xs (12px). */
.apx {
  --color-background:       var(--fr-bg);
  --color-foreground:       var(--fr-ink);
  --color-card:             var(--fr-card);
  --color-muted:            var(--cash-muted);
  /* the tile-description contrast fix: 7.56:1 on a card (the shipped #9198a1 was ~3:1) */
  --color-muted-foreground: var(--cash-muted-foreground);
  --color-border:           var(--fr-line);
  --color-border-strong:    var(--cash-border-strong);
  --color-ring:             var(--fr-blue);
  --color-info:             var(--fr-blue);
  --color-ok:               var(--fr-green);
  --color-ok-ink:           var(--fr-green-ink);
  --color-ok-soft:          var(--fr-green-soft);
  --color-warn:             var(--fr-amber);
  --color-warn-ink:         var(--fr-amber-ink);
  --color-warn-soft:        var(--fr-amber-soft);
  --text-xs: 0.75rem; --text-sm: 0.8125rem; --text-base: 0.9375rem;
  --text-lg: 1.0625rem; --text-2xl: 1.5rem;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 28px; --space-7: 40px;
  --radius-sm: 6px; --radius-full: 999px;
  --tap-min: 44px;
  color: var(--color-foreground);
  font-size: var(--text-base);
}
.apx .page__title { font-size: var(--text-2xl); font-weight: 800; margin: 0 0 var(--space-1); }
.apx .page__sub { font-size: var(--text-sm); color: var(--color-muted-foreground); margin: 0 0 var(--space-3); }
.apx .page__sub a { color: var(--color-ring); }
.apx .sect__h {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-muted-foreground); margin: var(--space-4) 0 var(--space-2);
}
.apx .ctx { font-size: var(--text-sm); color: var(--color-muted-foreground); margin: 0; }
.apx .badge {
  display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2);
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 700; line-height: 1.4;
  border: 1px solid var(--color-border-strong); background: var(--color-card); color: var(--color-foreground);
  white-space: normal; text-align: left;
}
.apx .badge--warn { background: var(--color-warn-soft); border-color: var(--color-warn); color: var(--color-warn-ink); }
.apx .badge--ok   { background: var(--color-ok-soft);   border-color: var(--color-ok);   color: var(--color-ok-ink); }
.apx .note {
  border-radius: var(--radius-sm); padding: var(--space-3); font-size: var(--text-sm); line-height: 1.45;
  border: 1px solid var(--color-border); background: var(--color-card); margin: var(--space-3) 0;
}
.apx .note--info { border-left: 3px solid var(--color-info); }
.apx .note__t { display: block; font-weight: 700; margin-bottom: var(--space-1); }
.apx .apx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
  min-height: var(--tap-min); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong); background: var(--color-card); color: var(--color-foreground);
  font-size: var(--text-sm); font-weight: 700; text-decoration: none; cursor: pointer;
}
.apx .apx-btn--quiet { border-color: transparent; background: transparent; color: var(--color-ring); }
.apx .apx-btn:focus-visible, .apx .tool:focus-visible, .apx .potrow:focus-visible, .apx .jump a:focus-visible {
  outline: 2px solid var(--color-ring); outline-offset: 2px;
}
.apx .apx-acts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* Features — SCR-145 … 149 */
.apx .search {
  position: sticky; top: var(--apx-head, 72px); z-index: 5; background: var(--color-background);
  padding: var(--space-2) 0; display: grid; gap: var(--space-1);
}
.apx .field__label { font-size: var(--text-sm); font-weight: 700; color: var(--color-foreground); }
.apx .field__ctl {
  min-height: var(--tap-min); width: 100%; max-width: 480px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: var(--color-card); color: var(--color-foreground);
  /* FRW-1124 — 16px literal, not a --text-base change: --text-base (0.9375rem/15px) is
     shared by every other .apx control, and this row's decision scopes the bump to the
     Features search input alone. */
  font-size: 16px;
}
.apx .jump { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
.apx .jump a {
  display: inline-flex; align-items: center; min-height: var(--tap-min); padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); background: var(--color-card);
  font-size: var(--text-sm); font-weight: 600; text-decoration: none; color: var(--color-foreground);
}
.apx .tools__sec { display: grid; gap: var(--space-2); }
/* a jump lands below BOTH sticky layers: the site header and the Features search bar
   (--fh-search is measured by features_hub.php; 0 on a page without one) */
.apx .tools__sec { scroll-margin-top: calc(var(--apx-head, 72px) + var(--fh-search, 0px) + var(--space-3)); }
.apx .tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-2); }
.apx .tool {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-1) var(--space-3); align-items: start;
  padding: var(--space-3); background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); min-height: var(--tap-min); text-decoration: none; color: inherit;
}
.apx .tool:hover { border-color: var(--color-border-strong); color: inherit; }
.apx .tool__icon { grid-row: span 2; font-size: var(--text-lg); line-height: 1.2; color: var(--color-muted-foreground); }
.apx .tool__t { font-weight: 700; font-size: var(--text-base); line-height: 1.3; }
.apx .tool__s { grid-column: 2; font-size: var(--text-xs); color: var(--color-muted-foreground); line-height: 1.45; }
.apx .tool__chev { grid-row: span 2; align-self: center; color: var(--color-muted-foreground); }
.apx .tool__tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.apx .tool--match { border-color: var(--color-info); box-shadow: inset 3px 0 0 var(--color-info); }
.apx mark { background: var(--color-warn-soft); color: var(--color-foreground); border-radius: 2px; padding: 0 1px; }
.apx .fh-grp { display: none; }
.apx.is-searching .fh-grp { display: inline-flex; }
.apx.is-searching .jump,
.apx.is-searching .tools__sec > .sect__h:not(.fh-keep) { display: none; }

/* Super Settings — SCR-151: configuration rows, not big-number tiles */
.apx .potrow {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3); margin-bottom: var(--space-2); background: var(--color-card);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); min-height: var(--tap-min);
  text-decoration: none; color: inherit; width: 100%; box-sizing: border-box; text-align: left;
  font-family: inherit; font-size: var(--text-base);
}
.apx button.potrow { cursor: pointer; }
.apx a.potrow:hover, .apx button.potrow:hover { border-color: var(--color-border-strong); color: inherit; }
.apx .potrow > :first-child { min-width: 0; flex: 1 1 16ch; }
.apx .potrow__name { display: block; font-weight: 700; }
.apx .potrow__sub { display: block; font-size: var(--text-xs); color: var(--color-muted-foreground); }
.apx .potrow__count { font-weight: 800; font-variant-numeric: tabular-nums; }
.apx .potrow__chev { color: var(--color-muted-foreground); flex: 0 0 auto; }
.apx .inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.apx .field__help { font-size: var(--text-xs); color: var(--color-muted-foreground); line-height: 1.4; margin: var(--space-2) 0 0; }
.apx .ss-sect { scroll-margin-top: calc(var(--apx-head, 72px) + var(--space-3)); }
/* HANDOFF rule 5 — `--apx-head` is the sticky site header's height, measured from
   .navbar-area onto :root by features_hub.php and the profile's deep-link script;
   72px is only the fallback before that runs. */
.ss-panel { scroll-margin-top: calc(var(--apx-head, 72px) + 12px); }
/* `hidden` must win over the display values above (search filtering toggles it). */
.apx [hidden] { display: none !important; }
.apx .apx-link {
  border: 0; background: none; padding: 2px 0; min-height: 24px; font: inherit;
  color: var(--color-ring); text-decoration: underline; cursor: pointer;
}
