/* Fixes kept from the Brand B work; no brand colours here (owner, Nov 4 2026). Black and gold come from theme-brand.css and
   menu-theme.css, the same rules the live CRM uses. */

/* Dashboard card type words (LEAD, SERVICE TICKET, PAPERWORK) are spelled out, so they need no colour of their own:
   neutral ink keeps red for "selected / action" (with a wash or fill) and "urgent" (with a word). */
.od-card__type:is(.od-card__type--service, .od-card__type--paperwork, .od-card__type--leads),
:root:not([data-theme="light"]) .od-card__type:is(.od-card__type--service, .od-card__type--paperwork, .od-card__type--leads) { color: var(--ui-text-3); }

/* ---- 8. Header-strip text that kept page ink (audit Nov 2 2026, F-06) ------------------------------------- */
/* Counts and sort lines in a dark section header are excluded from the strip's text rule (surfaces.css), so they
   kept their page-grey ink on the dark strip. Chips use their own word colour on a panel fill (see "chip-*"). */
:is(#main, .cp-main, main) :is([class$="-panel__head"], [class*="-panel__head "], .ws-panel__head) .tk-count { color: var(--ui-head-quiet); }
/* Phone: theme-brand.css switches these headers' words to page ink below 768px, but the strip stays dark
   (--ui-head), so in Light the titles were black on black (1.06:1; phone sweep Nov 2 2026). Strip ink instead. */
@media (max-width: 767.98px) {
  #main[id] :is(.ld-panel__head, .lo-panel__head, .us-panel__head, .rq-panel__head, .tk-panel__head) :is(h2, h3, [class$="-panel__title"]) { color: var(--ui-head-ink) !important; }
  #main[id] :is(.ld-panel__head, .lo-panel__head, .us-panel__head, .rq-panel__head, .tk-panel__head) :is([class$="-muted"], [class$="-count"], [class$="-meta"], .text-muted, small) { color: var(--ui-head-quiet) !important; }
}


/* Links in the staff app: older pages hover to --gold-champagne, a pale gold made for dark surfaces (1.2:1 on Light).
   Scoped to #main: sign-in pages use it with their own tokens. */
#main, dialog { --gold-champagne: var(--ui-accent-text); --atm-accent: var(--ui-accent-text); --atm-focus: var(--ui-focus); }

/* ---- Paperwork: agreements stay neutral (no purple) ---- */
:root, :root:not([data-theme="light"]) { --pw-agreement: #E4E4EA; --pw-agreement-bg: rgb(255 255 255 / 0.07); --pw-agreement-line: #8A8A96; }
:root[data-theme="light"] { --pw-agreement: #1C1F24; --pw-agreement-bg: #F1F1F4; --pw-agreement-line: #6A6A76; }
.status-badge:is(.imageDone, .videoDone) { background: var(--ui-raised); color: var(--ui-text-2); }
#main .m-filt-n { color: var(--ui-on-accent) !important; }

/* Focus: one ring in the text colour, 2 px, 2 px offset — content, dialogs, menu (Dark and Light), phone bar. Replaces
   the pink outline + gold halo (theme-brand.css) and the pale-yellow menu ring. */
#main :is(a, button, input, select, textarea, summary, [tabindex]):not(.mlx-shell *):focus-visible,
dialog :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ui-focus) !important; outline-offset: 2px; box-shadow: none !important; }
/* Financial-exception chip: red with its glyph and word. */
#main .chip.chip--err { background: var(--ui-danger-bg) !important; color: var(--ui-danger) !important; border-color: var(--ui-danger) !important; font-weight: 700; }
/* Routine "missing paperwork" is a to-do, not an alarm (re-audit R-01/R-02): the paperwork "problem" status (used only
   for Missing / ACH form missing) is an ink outline with its words; overdue work keeps red (list-ui.css, --pw-ruby). */
#main .pw-sdot { background: transparent; box-shadow: 0 0 0 2px var(--ui-text-3); }
#main .pw-key__dots--status { color: var(--ui-text); }
#main .lx-card[data-issue="problem"] { --issue: var(--ui-text-3); }
#main .dw-card[data-stage="problem"] { box-shadow: inset 0 0 0 1px var(--ui-line); }
/* Settlement direction: CREDIT ● / DEBIT ▲ in ink; only a debit on a daily row (an exception) is red. */
#main .pr__dir .lx-dir.lx-dir--credit, #main .pr__dir .lx-dir.lx-dir--debit { background: transparent; color: var(--ui-text); border: 1px solid var(--ui-text-3); }
#main .pr__dir .lx-dir.lx-dir--debit.lx-dir--exception { background: var(--ui-danger-bg); color: var(--ui-danger); border-color: var(--ui-danger); }
#main .lx-dir__g { font-size: 0.7em; margin-left: 2px; letter-spacing: 0; }
/* Sweep fixes for the ink roles (R1 sweep, Nov 3 2026): */
/* Customer-portal tabs are underline tabs like the CRM's (the old filled tab became near-white text on near-white). */
#main .cp-tabs a[aria-current="true"] { background: transparent !important; }
:is(#main, body) .cp-panel__head .cp-tabs a[aria-current="true"] { background: transparent !important; color: var(--ui-head-ink, #FFFFFF) !important;
  border-bottom-color: var(--ui-head-ink, #FFFFFF) !important; box-shadow: inset 0 -3px 0 var(--ui-head-ink, #FFFFFF) !important; }
/* Live Ops / TV terminal (always a dark panel): its "SYS" label read the accent ink, now black in Light. */
#main .fx-term-type { color: #E4E4EA; }
/* Live Ops / TV money exceptions (refunds, failed payments) used the old neon pink (2.69:1 on white): the danger token. */
:root, :root[data-theme="light"] { --fx-red: var(--ui-danger); }
/* Nova's floating button sat over the last row's ⋯ menu (re-audit R-14): room under the content on desktop so the last
   row can scroll clear of it. Phones place Nova in the top bar (mobile-ui.css). */
@media (min-width: 768px) { #main::after { content: ""; display: block; height: 88px; } }

/* Light hierarchy for Settlement Accounts (Justin, Nov 3 2026: sections and rows read white-on-white). Light only: a firmer
   section edge, a neutral header band with a charcoal left edge, a tinted column-header row and alternating row shading —
   the same zebra / head tokens as the other lists (theme-brand.css). Row height and the five columns are unchanged. */
:root[data-theme="light"] #main #settlement .sc { border-color: #C3C8D0; }
:root[data-theme="light"] #main #settlement .sc__head { background: var(--br-head); border-bottom: 1px solid #C3C8D0; box-shadow: inset 4px 0 0 var(--ui-head); }
:root[data-theme="light"] #main #settlement .prhead { background: #F1F3F6; }
:root[data-theme="light"] #main #settlement .prs > .pr:nth-child(even) { background: var(--br-zebra); }
:root[data-theme="light"] #main #settlement .prs > .pr { border-top-color: #DDE1E6; }
:root[data-theme="light"] #main #settlement .pr__main:not(.prhead):hover { background: var(--br-hover); }
:root[data-theme="light"] #main #settlement .lx-todo, :root[data-theme="light"] #main #settlement .sc__checks { background: #F4F5F7; }
