/* ============================================================================
   theme-dark-guard.css - the "smart dark mode" normalisation layer.
   [2026-09-11]   LOAD LAST, after every other theme file.

   ---------------------------------------------------------------------------
   WHY DARK LOOKED BUGGY
   ---------------------------------------------------------------------------
   The dark palette itself was never the problem - the tokens in
   design-system.css are sound. What broke it is that a token only reaches an
   element that ASKS for the token. This codebase is 20 years of WebForms and
   MVC, and it hardcodes colour in two places a stylesheet cannot reach by
   inheritance:

       inline style="" attributes        measured in MyShopProject markup:
           background:#fff                   542
           background:white                  187
           background-color:#fff              29
           color:#333                         85
           color:#111                         60
           color:#000000                      39
           color:#000                         27

       a handful of the portal's own classes that paint white:
           .widgBox .searchFocused .profDrop .hoverMenu
           .content-wraper .bdPad .party-list-buttons .bz-page-loader

   An inline style beats every stylesheet rule except an !important one, so on
   a dark ground those elements stayed white with near-black text, or kept dark
   text on a now-dark surface. That is the "all text needs to be reversed"
   report - it is not the text colour that is wrong, it is that several hundred
   elements never listened to the theme at all.

   ---------------------------------------------------------------------------
   HOW GOOGLE AND MICROSOFT ACTUALLY DO THIS
   ---------------------------------------------------------------------------
   Not with filter: invert(). Inversion is what produces the classic broken
   dark mode: it flips photographs into negatives, turns brand logos into
   colour-shifted mush, and inverts already-dark surfaces back to white. Real
   implementations normalise SEMANTICALLY - they find the elements that declare
   a light surface or a dark ink and restate those two things, leaving imagery,
   brand fills and status colours untouched.

   That is what this file does. Three passes, in order:
       1. surfaces  - anything declaring a light background gets the dark one
       2. ink       - anything declaring a dark text colour gets the light one
       3. chrome    - scrollbars, autofill, selection, placeholders

   ---------------------------------------------------------------------------
   WHY THE ` i` FLAG ON EVERY ATTRIBUTE SELECTOR
   ---------------------------------------------------------------------------
   Attribute substring matching is case-SENSITIVE by default, and this markup
   contains #fff, #FFF, #Fff and #FFFFFF in roughly equal measure. Without the
   flag each spelling needs its own selector and the ones nobody thought of are
   missed silently. The case-insensitive flag is Chrome 49+, comfortably inside
   the Chrome 59 floor.

   ---------------------------------------------------------------------------
   SCOPE
   ---------------------------------------------------------------------------
   Every selector is under [data-bz-theme="dark"]. Standard and Modern are not
   touched by a single rule in this file. Modern needs no equivalent: it is a
   light theme, so hardcoded white surfaces and dark ink are already correct
   there - which is exactly why this file is dark-only and not a shared guard.

   ASCII-only. Chrome 59 floor.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1. SURFACES - inline light backgrounds
   Covers the shorthand (background:) and the longhand (background-color:),
   with and without the space after the colon, in any case.
--------------------------------------------------------------------------- */
[data-bz-theme="dark"] [style*="background:#fff" i],
[data-bz-theme="dark"] [style*="background: #fff" i],
[data-bz-theme="dark"] [style*="background:#FFF" i],
[data-bz-theme="dark"] [style*="background:white" i],
[data-bz-theme="dark"] [style*="background: white" i],
[data-bz-theme="dark"] [style*="background-color:#fff" i],
[data-bz-theme="dark"] [style*="background-color: #fff" i],
[data-bz-theme="dark"] [style*="background-color:white" i],
[data-bz-theme="dark"] [style*="background-color: white" i],
[data-bz-theme="dark"] [style*="background:#efef" i],
[data-bz-theme="dark"] [style*="background:#f5f5" i],
[data-bz-theme="dark"] [style*="background:#eee" i],
[data-bz-theme="dark"] [style*="background-color:#eee" i],
[data-bz-theme="dark"] [style*="background-color:#f5f5" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
    color: var(--bz-text) !important;
    border-color: var(--bz-border) !important;
}

/* ---------------------------------------------------------------------------
   2. SURFACES - the portal's own white-painting classes
   This list is not guesswork: it is every class in ftsNewScreen.css, bds.css,
   responsive.css and dashboard.css whose rule sets a white or near-white
   background. Re-derive it with:

     grep -h -B1 'background[-a-z]*:\s*\(#[fF]\{3,6\}\|white\)' <those files> \
       | grep -o '^\.[a-zA-Z][a-zA-Z0-9_-]*' | sort -u
--------------------------------------------------------------------------- */
/* [2026-09-11] .bz-page-loader REMOVED from this list.

   It is not a light surface. ftsNewScreen.css already paints it
       background: rgba(15, 23, 42, .55)
   which is a TRANSLUCENT DARK SCRIM - correct in every appearance. Giving it
   `background-color: var(--bz-surface)` turned the scrim into an opaque panel
   that covered the page while loading, which is what made the loading state
   look broken rather than dimmed.

   It was swept in because the grep that built this list looks for a rule
   declaring a light colour, and .bz-page-loader has a child rule with white
   text. "Declares a light colour" is not the same as "is wrong in dark mode" -
   check what the element IS before adding it here. */
[data-bz-theme="dark"] .widgBox,
[data-bz-theme="dark"] .hoverMenu,
[data-bz-theme="dark"] .bdPad,
[data-bz-theme="dark"] .party-list-buttons,
[data-bz-theme="dark"] .searchFocused {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
    color: var(--bz-text) !important;
    border-color: var(--bz-border) !important;
}

/* ---------------------------------------------------------------------------
   3. INK - inline dark text
   Deliberately NOT a blanket rule. Only the spellings that actually appear as
   a near-black ink are listed, because a blanket
       [data-bz-theme="dark"] [style*="color"] { color: ... }
   would also repaint the 2242 elements that correctly declare color:#fff, and
   every element that sets a deliberate status colour - which is how a dark
   mode ends up with a grey "Overdue" label.
--------------------------------------------------------------------------- */
[data-bz-theme="dark"] [style*="color:#000" i],
[data-bz-theme="dark"] [style*="color: #000" i],
[data-bz-theme="dark"] [style*="color:black" i],
[data-bz-theme="dark"] [style*="color: black" i],
[data-bz-theme="dark"] [style*="color:#111" i],
[data-bz-theme="dark"] [style*="color: #111" i],
[data-bz-theme="dark"] [style*="color:#222" i],
[data-bz-theme="dark"] [style*="color:#333" i],
[data-bz-theme="dark"] [style*="color: #333" i],
[data-bz-theme="dark"] [style*="color:#444" i],
[data-bz-theme="dark"] [style*="color:#555" i] {
    color: var(--bz-text) !important;
}

/* The dark brand blues used as TEXT in this markup (#175396, #185598,
   #094e8c). At 4.5:1 against #131C2E these fail badly - they read as almost
   black. Lifted to the dark-theme brand tint, which passes. */
[data-bz-theme="dark"] [style*="color:#175396" i],
[data-bz-theme="dark"] [style*="color:#185598" i],
[data-bz-theme="dark"] [style*="color:#094e8c" i],
[data-bz-theme="dark"] [style*="color:#0c78b1" i] {
    color: var(--bz-primary) !important;
}

/* Headings and generic text nodes that inherit from a legacy container.
   Bounded to structural text elements so it cannot reach a styled badge. */
[data-bz-theme="dark"] h1,
[data-bz-theme="dark"] h2,
[data-bz-theme="dark"] h3,
[data-bz-theme="dark"] h4,
[data-bz-theme="dark"] h5,
[data-bz-theme="dark"] h6,
[data-bz-theme="dark"] label,
[data-bz-theme="dark"] legend,
[data-bz-theme="dark"] dt,
[data-bz-theme="dark"] dd,
[data-bz-theme="dark"] th,
[data-bz-theme="dark"] caption {
    color: var(--bz-heading);
}

/* [2026-09-11] REMOVED - and deliberately left documented, because it looks
   harmless and someone will be tempted to add it back:

       [data-bz-theme="dark"] p, li, td, span, div { color: inherit; }

   The comment it shipped with claimed "no !important, so any element with its
   own colour keeps it". That reasoning is wrong. Specificity:

       [data-bz-theme="dark"] div   attribute + element  = (0,1,1)
       .status-overdue              class                = (0,1,0)

   (0,1,1) beats (0,1,0), so the rule won against every single-class colour in
   the portal stylesheets - 253 of them - and flattened status pills, brand
   links and severity text to the body ink. Exactly the "grey Overdue label"
   failure the section above warns about, introduced two rules later.

   It was also redundant: `body { color: var(--bz-text) }` below already
   supplies the inherited ink for any element that does not set its own. The
   rule could only ever subtract. */

[data-bz-theme="dark"] body {
    color: var(--bz-text);
}

/* Links - but NOT a link that is a button.  [2026-09-13]
   ---------------------------------------------------------------------
   `a` at (0,0,1,1) outranks any single-class rule like
   `.btn-show { color:#fff }` at (0,0,1,0), so without the exclusion every
   <a class="btn ..."> label went brand-blue. The patch for that used to be
   `a.btn { color: inherit }` below - which at (0,0,2,1) then outranked the
   buttons' OWN ink too, and 15 button classes lost their label colour.
   Excluding buttons here removes the cause, so each button simply keeps
   the colour its own rule gives it. */
[data-bz-theme="dark"] a:not(.btn) {
    color: var(--bz-primary);
}

[data-bz-theme="dark"] a:hover,
[data-bz-theme="dark"] a:focus {
    color: var(--bz-accent);
}

/* A link inside a filled brand surface must stay white - the rule above would
   otherwise turn it brand-blue on brand-blue. */
[data-bz-theme="dark"] .btn a,
[data-bz-theme="dark"] [class*="dxgvSelectedRow"] a,
[data-bz-theme="dark"] .sideNavigation a {
    color: inherit;
}

/* ...but `inherit` takes the PARENT's colour, not the button's, and
   `a.btn` (0,0,2,1) outranks `.btn-success` (0,0,2,0) - so an
   <a class="btn btn-success"> drew its label in the page ink, which on a
   green fill reads as washed-out grey. Reported as "Add New" looking dimmed
   next to the crisp white of Standard, and it was exactly that.

   These restate the contextual ink at the same specificity. They sit in
   THIS file, immediately after the rule above, because components.css loads
   earlier and would lose the tie. */
[data-bz-theme="dark"] a.btn-primary,
[data-bz-theme="dark"] a.btn-success,
[data-bz-theme="dark"] a.btn-info,
[data-bz-theme="dark"] a.btn-warning,
[data-bz-theme="dark"] a.btn-danger {
    color: #fff;
}

/* ---------------------------------------------------------------------------
   4. BROWSER CHROME
   design-system.css already sets color-scheme:dark, which gives dark
   scrollbars and dark default form controls for free. These are the pieces
   color-scheme does NOT cover.
--------------------------------------------------------------------------- */

/* Chrome autofill. Chrome paints autofilled inputs with a hardcoded light
   yellow that no background rule can override - the only lever is an inset
   shadow large enough to cover the field, plus -webkit-text-fill-color for
   the ink. This is the single most-reported dark-mode defect on login forms. */
[data-bz-theme="dark"] input:-webkit-autofill,
[data-bz-theme="dark"] input:-webkit-autofill:hover,
[data-bz-theme="dark"] input:-webkit-autofill:focus,
[data-bz-theme="dark"] textarea:-webkit-autofill,
[data-bz-theme="dark"] select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bz-surface-2) inset !important;
    box-shadow: 0 0 0 1000px var(--bz-surface-2) inset !important;
    -webkit-text-fill-color: var(--bz-text) !important;
    caret-color: var(--bz-text);
    border-color: var(--bz-border-2) !important;
}

[data-bz-theme="dark"] ::-webkit-input-placeholder { color: var(--bz-muted); }
[data-bz-theme="dark"] :-ms-input-placeholder      { color: var(--bz-muted); }
[data-bz-theme="dark"] ::placeholder               { color: var(--bz-muted); }

/* Firefox needs its own pseudo; a browser that does not know one of these
   drops that selector only, so they are written as SEPARATE rules - in one
   list the unknown selector would invalidate the whole thing. */
/* [2026-09-14] --bz-primary-700, NOT --bz-primary. Dark LIGHTENS the brand
   blue to #60A5FA so it passes as INK on a dark ground (6.71:1) - but this
   is the other direction: a FILL with white text on it, where #60A5FA gives
   2.54:1 and fails. Worse, a light-blue plate on a #0B1220 page reads as a
   white patch, which is how it was reported: selected text in a DevExpress
   masked date field (UseMaskBehavior selects the content on focus) and a
   selected grid message both showed as bright marks. #2563EB is the same
   brand blue at fill weight and carries white at 5.17:1.

   The pattern to copy is .introjs-helperNumberLayer, which keeps #60A5FA
   and puts DARK ink on it (7.18:1). Either is fine; white on #60A5FA is not. */
[data-bz-theme="dark"] ::-moz-selection {
    background: var(--bz-primary-700);
    color: #FFFFFF;
}

[data-bz-theme="dark"] ::selection {
    background: var(--bz-primary-700);
    color: #FFFFFF;
}

[data-bz-theme="dark"] hr {
    border-color: var(--bz-border);
}

/* iframes and embedded report viewers render their own document, which this
   stylesheet cannot reach. Give them an explicit light ground rather than
   letting a white page sit on a dark surface with no frame - a bare white
   rectangle reads as a rendering fault. */
[data-bz-theme="dark"] iframe {
    background-color: var(--bz-surface);
    border-radius: var(--bz-r-sm);
}

/* ---------------------------------------------------------------------------
   5. IMAGERY
   Photographs, avatars and brand logos are NEVER filtered - see the note at
   the top on why inversion is the wrong tool. The one accommodation is for
   line-art icons shipped as a dark PNG/SVG with a transparent ground, which
   genuinely do vanish. Opt-in by class, so nothing is touched unless it is
   marked - there is no reliable way to detect this case automatically, and
   guessing would damage real images.
--------------------------------------------------------------------------- */
[data-bz-theme="dark"] .bz-dark-invert {
    -webkit-filter: invert(1) hue-rotate(180deg);
    filter: invert(1) hue-rotate(180deg);
}

/* ---------------------------------------------------------------------------
   INLINE INK WRITTEN INTO HTML STRINGS BY JAVASCRIPT   [2026-09-11]
   ---------------------------------------------------------------------------
   The route/visit pages build their summary panel as markup in a string:

       summaryPanel.innerHTML += '<p style="color:#1f941f;font-family:...">'

   Because the colour is a LITERAL in the emitted attribute, an attribute
   selector does reach it - unlike a jQuery .css() call, where the browser
   re-serialises the value to rgb() and the literal never appears. That
   difference is why the two cases are fixed in two different places.

   #1f941f is 4.31:1 on the dark page - just under AA, and the panel is a
   status readout. Mapped to the theme's own success ink so it reads as the
   same "good" green the rest of the product uses.
--------------------------------------------------------------------------- */
[data-bz-theme="dark"] [style*="color:#1f941f" i],
[data-bz-theme="dark"] [style*="color: #1f941f" i] {
    color: var(--bz-success) !important;
}

/* ==========================================================================
   GENERATED - inline style="" colour cover.  DO NOT HAND-EDIT.
   Regenerate: python Tools/theme-gen-inline-guard.py out.css

   An inline style attribute outranks every stylesheet rule that is not
   !important, so each of these actively defeats the theme until covered.
   Values are MEASURED, never listed - see the module docstring for why.
   ========================================================================== */

/* ---- light backgrounds -------------------------------------------------- */

/* 53 uses */
[data-bz-theme="dark"] [style*="background:white" i],
[data-bz-theme="dark"] [style*="background: white" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 14 uses */
[data-bz-theme="dark"] [style*="background:#FF0" i],
[data-bz-theme="dark"] [style*="background: #FF0" i] {
    background-color: rgba(251, 191, 36, .14) !important;
    color: var(--bz-warning) !important;
    background-image: none !important;
}

/* 12 uses */
[data-bz-theme="dark"] [style*="background:#FFFFFF" i],
[data-bz-theme="dark"] [style*="background: #FFFFFF" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 10 uses */
[data-bz-theme="dark"] [style*="background:rgb(237,243,244)" i],
[data-bz-theme="dark"] [style*="background: rgb(237,243,244)" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 9 uses */
[data-bz-theme="dark"] [style*="background:#fff" i],
[data-bz-theme="dark"] [style*="background: #fff" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 5 uses */
[data-bz-theme="dark"] [style*="background:#f5f4f3" i],
[data-bz-theme="dark"] [style*="background: #f5f4f3" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="background:#f9f9f9" i],
[data-bz-theme="dark"] [style*="background: #f9f9f9" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="background:#e9e9e9" i],
[data-bz-theme="dark"] [style*="background: #e9e9e9" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="background:rgba(255, 255, 255, 0.8)" i],
[data-bz-theme="dark"] [style*="background: rgba(255, 255, 255, 0.8)" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="background:#FEF2F2" i],
[data-bz-theme="dark"] [style*="background: #FEF2F2" i] {
    background-color: rgba(248, 113, 113, .14) !important;
    color: var(--bz-danger) !important;
    background-image: none !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="background:#DDECFE" i],
[data-bz-theme="dark"] [style*="background: #DDECFE" i] {
    background-color: rgba(96, 165, 250, .14) !important;
    color: var(--bz-primary) !important;
    background-image: none !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="background:#FAFAFA" i],
[data-bz-theme="dark"] [style*="background: #FAFAFA" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="background:#FFEE77" i],
[data-bz-theme="dark"] [style*="background: #FFEE77" i] {
    background-color: rgba(251, 191, 36, .14) !important;
    color: var(--bz-warning) !important;
    background-image: none !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="background:#fffad3" i],
[data-bz-theme="dark"] [style*="background: #fffad3" i] {
    background-color: rgba(251, 191, 36, .14) !important;
    color: var(--bz-warning) !important;
    background-image: none !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="background:#F8FAFC" i],
[data-bz-theme="dark"] [style*="background: #F8FAFC" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#fff3cd" i],
[data-bz-theme="dark"] [style*="background: #fff3cd" i] {
    background-color: rgba(251, 191, 36, .14) !important;
    color: var(--bz-warning) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#a9d4fa" i],
[data-bz-theme="dark"] [style*="background: #a9d4fa" i] {
    background-color: rgba(96, 165, 250, .14) !important;
    color: var(--bz-primary) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#A9D4FA" i],
[data-bz-theme="dark"] [style*="background: #A9D4FA" i] {
    background-color: rgba(96, 165, 250, .14) !important;
    color: var(--bz-primary) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#ccc" i],
[data-bz-theme="dark"] [style*="background: #ccc" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#AFDCEC" i],
[data-bz-theme="dark"] [style*="background: #AFDCEC" i] {
    background-color: rgba(96, 165, 250, .14) !important;
    color: var(--bz-primary) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#FFF8C6" i],
[data-bz-theme="dark"] [style*="background: #FFF8C6" i] {
    background-color: rgba(251, 191, 36, .14) !important;
    color: var(--bz-warning) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#E3E4FA" i],
[data-bz-theme="dark"] [style*="background: #E3E4FA" i] {
    background-color: rgba(96, 165, 250, .14) !important;
    color: var(--bz-primary) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#f8f9fa" i],
[data-bz-theme="dark"] [style*="background: #f8f9fa" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:#ddd" i],
[data-bz-theme="dark"] [style*="background: #ddd" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background:rgb(239,246,255)" i],
[data-bz-theme="dark"] [style*="background: rgb(239,246,255)" i] {
    background-color: rgba(96, 165, 250, .14) !important;
    color: var(--bz-primary) !important;
    background-image: none !important;
}

/* ---- dark inks ---------------------------------------------------------- */

/* 329 uses */
[data-bz-theme="dark"] [style*="color:red" i],
[data-bz-theme="dark"] [style*="color: red" i] {
    color: var(--bz-danger) !important;
}

/* 170 uses */
[data-bz-theme="dark"] [style*="color:#1f941f" i],
[data-bz-theme="dark"] [style*="color: #1f941f" i] {
    color: var(--bz-success) !important;
}

/* 91 uses */
[data-bz-theme="dark"] [style*="color:Red" i],
[data-bz-theme="dark"] [style*="color: Red" i] {
    color: var(--bz-danger) !important;
}

/* 66 uses */
[data-bz-theme="dark"] [style*="color:#d33" i],
[data-bz-theme="dark"] [style*="color: #d33" i] {
    color: var(--bz-danger) !important;
}

/* 39 uses */
[data-bz-theme="dark"] [style*="color:#000099" i],
[data-bz-theme="dark"] [style*="color: #000099" i] {
    color: var(--bz-primary) !important;
}

/* 35 uses */
[data-bz-theme="dark"] [style*="color:Black" i],
[data-bz-theme="dark"] [style*="color: Black" i] {
    color: var(--bz-text) !important;
}

/* 33 uses */
[data-bz-theme="dark"] [style*="color:#3085d6" i],
[data-bz-theme="dark"] [style*="color: #3085d6" i] {
    color: var(--bz-primary) !important;
}

/* 24 uses */
[data-bz-theme="dark"] [style*="color:#007bff" i],
[data-bz-theme="dark"] [style*="color: #007bff" i] {
    color: var(--bz-primary) !important;
}

/* 20 uses */
[data-bz-theme="dark"] [style*="color:#000" i],
[data-bz-theme="dark"] [style*="color: #000" i] {
    color: var(--bz-text) !important;
}

/* 10 uses */
[data-bz-theme="dark"] [style*="color:#006ac5" i],
[data-bz-theme="dark"] [style*="color: #006ac5" i] {
    color: var(--bz-primary) !important;
}

/* 9 uses */
[data-bz-theme="dark"] [style*="color:#7C3AED" i],
[data-bz-theme="dark"] [style*="color: #7C3AED" i] {
    color: var(--bz-primary) !important;
}

/* 8 uses */
[data-bz-theme="dark"] [style*="color:#000000" i],
[data-bz-theme="dark"] [style*="color: #000000" i] {
    color: var(--bz-text) !important;
}

/* 8 uses */
[data-bz-theme="dark"] [style*="color:black" i],
[data-bz-theme="dark"] [style*="color: black" i] {
    color: var(--bz-text) !important;
}

/* 7 uses */
[data-bz-theme="dark"] [style*="color:#333" i],
[data-bz-theme="dark"] [style*="color: #333" i] {
    color: var(--bz-text) !important;
}

/* 6 uses */
[data-bz-theme="dark"] [style*="color:#64748B" i],
[data-bz-theme="dark"] [style*="color: #64748B" i] {
    color: var(--bz-muted) !important;
}

/* 5 uses */
[data-bz-theme="dark"] [style*="color:#3737bb" i],
[data-bz-theme="dark"] [style*="color: #3737bb" i] {
    color: var(--bz-primary) !important;
}

/* 5 uses */
[data-bz-theme="dark"] [style*="color:#4a4a4a" i],
[data-bz-theme="dark"] [style*="color: #4a4a4a" i] {
    color: var(--bz-text) !important;
}

/* 4 uses */
[data-bz-theme="dark"] [style*="color:#cc3300" i],
[data-bz-theme="dark"] [style*="color: #cc3300" i] {
    color: var(--bz-warning) !important;
}

/* 4 uses */
[data-bz-theme="dark"] [style*="color:#334155" i],
[data-bz-theme="dark"] [style*="color: #334155" i] {
    color: var(--bz-text) !important;
}

/* 4 uses */
[data-bz-theme="dark"] [style*="color:#2563EB" i],
[data-bz-theme="dark"] [style*="color: #2563EB" i] {
    color: var(--bz-primary) !important;
}

/* 4 uses */
[data-bz-theme="dark"] [style*="color:#134480" i],
[data-bz-theme="dark"] [style*="color: #134480" i] {
    color: var(--bz-primary) !important;
}

/* 4 uses */
[data-bz-theme="dark"] [style*="color:#B45309" i],
[data-bz-theme="dark"] [style*="color: #B45309" i] {
    color: var(--bz-warning) !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="color:#010101" i],
[data-bz-theme="dark"] [style*="color: #010101" i] {
    color: var(--bz-text) !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="color:#90621d" i],
[data-bz-theme="dark"] [style*="color: #90621d" i] {
    color: var(--bz-warning) !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="color:#0F172A" i],
[data-bz-theme="dark"] [style*="color: #0F172A" i] {
    color: var(--bz-text) !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="color:#DC2626" i],
[data-bz-theme="dark"] [style*="color: #DC2626" i] {
    color: var(--bz-danger) !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="color:#1D4ED8" i],
[data-bz-theme="dark"] [style*="color: #1D4ED8" i] {
    color: var(--bz-primary) !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="color:#991B1B" i],
[data-bz-theme="dark"] [style*="color: #991B1B" i] {
    color: var(--bz-danger) !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="color:#475569" i],
[data-bz-theme="dark"] [style*="color: #475569" i] {
    color: var(--bz-text) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color:#c0392b" i],
[data-bz-theme="dark"] [style*="color: #c0392b" i] {
    color: var(--bz-warning) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color:#0000FF" i],
[data-bz-theme="dark"] [style*="color: #0000FF" i] {
    color: var(--bz-primary) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color:rgb(144, 98, 29)" i],
[data-bz-theme="dark"] [style*="color: rgb(144, 98, 29)" i] {
    color: var(--bz-warning) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color:#986014" i],
[data-bz-theme="dark"] [style*="color: #986014" i] {
    color: var(--bz-warning) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color:#15803D" i],
[data-bz-theme="dark"] [style*="color: #15803D" i] {
    color: var(--bz-success) !important;
}

/* ---- light borders ------------------------------------------------------- */
/* Keyed on the VERBATIM declaration - see the scan loop for why. The side
   is read back off the property so `border-right:1px solid #ccc` recolours
   the right edge only and does not paint three edges that were never there. */

/* 18 uses */
[data-bz-theme="dark"] [style*="border: 3px solid #dedede" i] {
    border-color: var(--bz-border) !important;
}

/* 12 uses */
[data-bz-theme="dark"] [style*="border: 1px solid #ccc" i] {
    border-color: var(--bz-border) !important;
}

/* 7 uses */
[data-bz-theme="dark"] [style*="border-right:1px solid #ccc" i] {
    border-right-color: var(--bz-border) !important;
}

/* 2 uses */
[data-bz-theme="dark"] [style*="border:1px solid #ccc" i] {
    border-color: var(--bz-border) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="border: 1px solid #f5c518" i] {
    border-color: rgba(251, 191, 36, .34) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="border-bottom:1px solid #eee" i] {
    border-bottom-color: var(--bz-border) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="border:1px solid #FECACA" i] {
    border-color: rgba(248, 113, 113, .34) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="border:1px solid #E2E8F0" i] {
    border-color: var(--bz-border) !important;
}

/* ---- bgcolor attributes -------------------------------------------------- */

/* 50 uses */
[data-bz-theme="dark"] [bgcolor="#FFFFFF" i] {
    background-color: var(--bz-surface) !important;
}

/* 7 uses */
[data-bz-theme="dark"] [bgcolor="#E2EBED" i] {
    background-color: rgba(96, 165, 250, .14) !important;
}

/* 7 uses */
[data-bz-theme="dark"] [bgcolor="#e6ecff" i] {
    background-color: rgba(96, 165, 250, .14) !important;
}

/* ---- colours assigned at RUNTIME ---------------------------------------- */
/* The browser re-serialises a JS-assigned colour as rgb(), so these
   match the rgb() form and not the hex the author typed. */

/* 26 uses */
[data-bz-theme="dark"] [style*="color: rgb(36, 67, 170)" i],
[data-bz-theme="dark"] [style*="color:rgb(36,67,170)" i] {
    color: var(--bz-primary) !important;
}

/* 4 uses */
[data-bz-theme="dark"] [style*="color: rgb(0, 0, 0)" i],
[data-bz-theme="dark"] [style*="color:rgb(0,0,0)" i] {
    color: var(--bz-text) !important;
}

/* 4 uses */
[data-bz-theme="dark"] [style*="background-color: rgb(248, 248, 248)" i],
[data-bz-theme="dark"] [style*="background-color:rgb(248,248,248)" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 3 uses */
[data-bz-theme="dark"] [style*="background-color: rgb(255, 255, 255)" i],
[data-bz-theme="dark"] [style*="background-color:rgb(255,255,255)" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background-color: rgb(245, 188, 169)" i],
[data-bz-theme="dark"] [style*="background-color:rgb(245,188,169)" i] {
    background-color: rgba(251, 191, 36, .14) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background-color: rgb(245, 245, 245)" i],
[data-bz-theme="dark"] [style*="background-color:rgb(245,245,245)" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background-color: rgb(255, 187, 170)" i],
[data-bz-theme="dark"] [style*="background-color:rgb(255,187,170)" i] {
    background-color: rgba(251, 191, 36, .14) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color: rgb(29, 78, 216)" i],
[data-bz-theme="dark"] [style*="color:rgb(29,78,216)" i] {
    color: var(--bz-primary) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background-color: rgb(248, 250, 252)" i],
[data-bz-theme="dark"] [style*="background-color:rgb(248,250,252)" i] {
    background-color: var(--bz-surface) !important;
    background-image: none !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color: rgb(220, 38, 38)" i],
[data-bz-theme="dark"] [style*="color:rgb(220,38,38)" i] {
    color: var(--bz-danger) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color: rgb(37, 99, 235)" i],
[data-bz-theme="dark"] [style*="color:rgb(37,99,235)" i] {
    color: var(--bz-primary) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="color: rgb(21, 128, 61)" i],
[data-bz-theme="dark"] [style*="color:rgb(21,128,61)" i] {
    color: var(--bz-success) !important;
}

/* 1 use */
[data-bz-theme="dark"] [style*="background-color: rgb(254, 242, 242)" i],
[data-bz-theme="dark"] [style*="background-color:rgb(254,242,242)" i] {
    background-color: rgba(248, 113, 113, .14) !important;
    background-image: none !important;
}

/* ===========================================================================
   JS-APPLIED COLOURS ARRIVE AS rgb(), NEVER AS HEX   [2026-09-12]
   ---------------------------------------------------------------------------
   The generated block above covers every colour written as a literal in the
   MARKUP. It cannot cover a colour applied at RUNTIME, because the browser
   re-serialises it:

       $(tr).css('background', '#fff')   ->  style="background-color: rgb(255, 255, 255)"
       el.style.background = '#FFF'      ->  style="background-color: rgb(255, 255, 255)"

   So `[style*="background:#fff"]` never matches a row a script painted, and
   the value is not in any stylesheet either - it exists only in the live DOM.
   That is how the Employee Search popup kept white rows on a dark modal: the
   table, the cells and the modal were all themed correctly; the ROWS were
   painted by the script that builds them.

   Chrome writes `rgb(r, g, b)` with a space after each comma. Both spacings
   are matched anyway, because a style attribute assembled as a STRING in JS
   keeps whatever the author typed.

   These win because an inline style loses to a stylesheet rule that carries
   !important - which is the whole reason this file exists.
   =========================================================================== */
/* [2026-09-12] THE FIFTEEN HAND-LISTED rgb() VALUES THAT STOOD HERE ARE GONE.

   They were the enumeration mistake in the one place that covers colours no
   stylesheet contains - a list is only as complete as the person who read the
   scripts, and it was not complete. `$("...").css({'color':'#2443AA'})` on the
   DevExpress footer rows is 26 uses and was not on it.

   Tools/theme-gen-inline-guard.py now scans the JavaScript for

       $(x).css('prop', '#hex')      $(x).css({ prop: '#hex' })
       el.style.prop = '#hex'        el.style['prop'] = '#hex'

   and emits both rgb() spacings in the GENERATED block above. The reasoning
   in the comment above still applies in full - only the values moved. */

/* ---------------------------------------------------------------------------
   THE SEARCH POPUP TABLE - used by 123 pages
   ---------------------------------------------------------------------------
   Belt and braces for the same bug, at the element rather than the value: the
   rows of .dynamicPopupTbl are built and painted by script, so rather than
   chase whatever colour it chooses, the cells are made TRANSPARENT and left to
   show the table's own themed surface. A stylesheet rule with !important beats
   a plain inline style, so this holds whatever the script writes.

   Deliberately NOT applied to the header (.HeaderStyle keeps its own fill) or
   to the highlighted row, so selection stays visible.
--------------------------------------------------------------------------- */
[data-bz-theme="dark"] .dynamicPopupTbl > tbody > tr:not(.HeaderStyle) > td,
[data-bz-theme="dark"] .dynamicPopupTbl > tbody > tr:not(.HeaderStyle) {
    background-color: transparent !important;
    background-image: none !important;
    color: var(--bz-text) !important;
    border-color: var(--bz-border) !important;
}

[data-bz-theme="dark"] .dynamicPopupTbl > tbody > tr:not(.HeaderStyle):hover > td {
    background-color: var(--bz-surface-2) !important;
}
