/* ============================================================================
   LIGHT THEME LAYER  (prototype)
   Activated by `data-theme="light"` on <html> (set pre-paint from
   localStorage; see layouts/default.html). The dark theme is the default and
   is untouched — every rule below is scoped under html[data-theme="light"].
   Must load AFTER theme-override.css: it redefines that file's tokens and
   out-specifies its stragglers, relying on source order for equal-specificity
   wins.

   Strategy: (1) redefine the semantic tokens for light so the ~860 var(--…)
   references flip automatically; (2) override the stragglers that hard-code
   translucent-white / dark-hex surfaces directly. Chrome (body/navbar/logo/
   sidebar) is flipped to the vendor "white" data-background-color variants by
   JS, so vendor chrome handles the nav; the rules here are the flash-free
   safety net + content-area overrides.
   ============================================================================ */

html[data-theme="light"] {
    color-scheme: light;

    /* Accent palette: the dark theme uses the pastel -400 tier (tuned for
       dark backgrounds); on white those read washed-out. Drop every accent
       to the deeper -600 tier — same hues, more ink. The rgba(var(--*-rgb))
       tints follow via the -rgb twins below. */
    --color-blue: #2563eb;
    --color-blue-hover: #1d4ed8;
    --color-green: #059669;
    --color-orange: #d97706;
    --color-red: #dc2626;
    --color-purple: #9333ea;
    --color-gray: #64748b;
    --color-yellow: #ca8a04;
    --color-teal: #0d9488;
    --color-pink: #db2777;
    --color-rose: #e11d48;
    --color-lime: #65a30d;
    --color-indigo: #4f46e5;
    --color-cyan: #0891b2;
    --color-brown: #9c7a52;
    --bs-primary-rgb: 37, 99, 235;
    --bs-success-rgb: 5, 150, 105;
    --bs-warning-rgb: 217, 119, 6;
    --bs-danger-rgb: 220, 38, 38;
    --bs-info-rgb: 147, 51, 234;
    --bs-secondary-rgb: 100, 116, 139;

    /* Subtle black-on-white tints replace the white-on-dark tints */
    --surface-0: linear-gradient(135deg, #ffffff 0%, #fbfcfe 100%);
    --surface-1: rgba(0, 0, 0, 0.025);
    --surface-2: rgba(0, 0, 0, 0.045);
    --surface-3: rgba(0, 0, 0, 0.07);

    --border-subtle: rgba(0, 0, 0, 0.07);
    --border-normal: rgba(0, 0, 0, 0.12);
    --border-emphasis: rgba(0, 0, 0, 0.18);

    /* Dark text on light. Near-black (#1c1f27) read harsh against the bright
       white cards. The WHOLE ramp is lifted into grey-slate territory — most
       content text inherits --text-primary via .main-panel, so this is the real
       lever. Still monotonic (primary darkest → muted lightest) and each tier
       clears AA on white (primary ~7.7:1 … muted ~4.6:1). */
    --text-primary: #434b59;
    --text-secondary: #565e6d;
    --text-tertiary: #656c7a;
    --text-tertiary-rgb: 101, 108, 122;
    --text-muted: #7c8291;
    --text-muted-rgb: 124, 130, 145;

    /* Alerts: faint tint over a light base */
    --alert-base: #f4f6f9;
    --alert-tint-strong: 0.07;
    --alert-tint-faint: 0.03;

    /* Form controls */
    --input-bg: #ffffff;
    --input-bg-focus: #ffffff;
    --input-bg-disabled: #eef0f3;
    --input-border: rgba(0, 0, 0, 0.18);
    --input-border-hover: rgba(0, 0, 0, 0.3);
    --input-border-focus: rgba(var(--bs-primary-rgb), 0.55);

    /* Selects */
    --select-dropdown-bg: #ffffff;
    --select-option-bg: #ffffff;
    --select-option-bg-hover: #eef3fb;
    --select-option-bg-active: #dde8fa;
    --select-option-border-active: rgba(var(--bs-primary-rgb), 0.45);
    --select-arrow-color: rgba(0, 0, 0, 0.5);

    /* Bootstrap light/dark helper tokens flip meaning on a light page */
    --bs-light: rgba(0, 0, 0, 0.05);
    --bs-light-rgb: 0, 0, 0;
    --bs-dark: rgba(0, 0, 0, 0.78);
    --bs-dark-rgb: 0, 0, 0;

    /* Tokens defined in per-app/extra stylesheets */
    --chrome-seam: rgba(0, 0, 0, 0.1);
    --pop-bg: #ffffff;
    --routing-base: #f1f3f6;
}

/* Page background + base text */
html[data-theme="light"] body,
html[data-theme="light"] .main-panel {
    background-color: #eef1f5 !important;
    color: var(--text-primary);
}

/* --- "beta" badge next to the theme toggle: only meaningful while the (still
   in-progress) light theme is active, so it's hidden by default and revealed
   under the light data-theme. --- */
.theme-beta-badge {
    display: none;
}
html[data-theme="light"] .theme-beta-badge {
    display: inline-flex;
    align-items: center;
    margin-right: 0.4rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid rgba(126, 34, 206, 0.38);
    border-radius: 999px;
    background: rgba(126, 34, 206, 0.12);
    color: #7e22ce;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
}

/* Wider cap for the beta explainer tooltip (default .tooltip-inner is 200px). */
.theme-beta-tooltip .tooltip-inner {
    max-width: 320px !important;
}

/* --- Chrome: tinted left panel + crisp seams (JS also swaps to vendor "white").
   The sidebar column reads as a distinct near-white panel against the #eef1f5
   content canvas; firm #dde2ea seams keep the top bar and rail from bleeding
   into the white cards. --- */
html[data-theme="light"] .navbar-header {
    background: #f8fafc !important;
}
/* Seam lives only on the outer wrapper — .navbar-header and .logo-header nest
   inside it, so bordering all three stacked a doubled line. */
html[data-theme="light"] .main-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #dde2ea !important;
}
html[data-theme="light"] .logo-header {
    background: #f8fafc !important;
    border-right: 1px solid #dde2ea !important;
}
html[data-theme="light"] .sidebar,
html[data-theme="light"] .sidebar[data-background-color="dark2"] {
    background: #f8fafc !important;
    border-right: 1px solid #dde2ea !important;
}
/* Sidebar nav: the vendor "white" skin paints link text a muddy #575962 and
   icons a washed #8d9498. Pull both to our tokens for firmer contrast; the
   blue active state (higher specificity) is untouched. */
html[data-theme="light"] .sidebar .nav > .nav-item a {
    color: var(--text-secondary);
}
html[data-theme="light"] .sidebar .nav > .nav-item a i {
    color: var(--text-tertiary);
}
/* Sidebar seams/sections that hard-code translucent white */
html[data-theme="light"] .sidebar .nav-section,
html[data-theme="light"] .sidebar .nav-collapse {
    border-color: var(--border-subtle) !important;
}
html[data-theme="light"] .sidebar .nav-section h4.text-section {
    color: rgba(0, 0, 0, 0.45);
}
html[data-theme="light"] .sidebar .pl-2[style] {
    border-bottom-color: var(--border-subtle) !important;
}
/* Edge pull-tab: default tokens paint it a white gradient (--surface-0) with a
   darker rgba(0,0,0,0.1) seam, so it reads as a separate chip with a hard edge.
   Match the sidebar's own solid surface and border so the tab flows out of the
   sidebar's edge with no visible joint. */
html[data-theme="light"] .sidebar-collapse-toggle {
    background: #f8fafc;
    border-color: #dde2ea;
}

/* --- Fieldsets --- */
/* In dark, surface-1 (a white tint) sits *above* the page. On light that same
   token is a black tint, so the panel sank *below* the page — a muddy grey box
   under a lighter page. Flip top-level fieldsets to white so they read as
   raised like cards; nested fieldsets keep the tint to step inward. */
html[data-theme="light"] fieldset {
    background: #ffffff;
    /* Soft, faded edge instead of the hard 0.12 line. The panel reads as raised
       via the subtle shadow, so the border can drop to a whisper — which also
       makes the native legend notch's ragged ends effectively invisible. */
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] fieldset:hover {
    border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] fieldset fieldset {
    background: var(--surface-1);
    box-shadow: none;
}

/* --- Cards --- */
html[data-theme="light"] .card {
    border: 1px solid var(--border-normal);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
                0 1px 2px rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .card-light2 {
    background: #f7f8fa !important;
}
html[data-theme="light"] .card-dark {
    background: linear-gradient(135deg, #f7f8fa, #eef1f5) !important;
}
html[data-theme="light"] .bg-deep-dark,
html[data-theme="light"] .card-deep-dark {
    background: #f7f8fa !important;
    border-color: var(--border-normal) !important;
}
html[data-theme="light"] .card-deep-dark .card-header {
    background: var(--surface-2);
    border-bottom-color: var(--border-normal) !important;
}
html[data-theme="light"] .card-hover:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%,
                                rgba(0, 0, 0, 0.01) 100%) !important;
}

/* --- Modals --- */
html[data-theme="light"] .modal-content {
    background: #ffffff !important;
    border: 1px solid var(--border-emphasis) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18) !important;
}
html[data-theme="light"] .modal-header {
    background: #f7f8fa !important;
    border-bottom-color: var(--border-normal) !important;
}
html[data-theme="light"] .modal-footer {
    background: #f7f8fa !important;
    border-top-color: var(--border-normal) !important;
}

/* --- Dropdown menus --- */
html[data-theme="light"] .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid var(--border-normal) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
html[data-theme="light"] .dropdown-item {
    color: var(--text-secondary);
}
html[data-theme="light"] .dropdown-item:hover,
html[data-theme="light"] .dropdown-item:focus {
    background: var(--surface-2);
    color: var(--text-primary);
}

/* --- Chips --- */
html[data-theme="light"] .chip {
    color: #475569;
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] .chip-plain {
    color: #5f6472;
}
html[data-theme="light"] .chip-hover:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.16);
}

/* --- Breadcrumb (inline <style> in default.html uses translucent white) --- */
html[data-theme="light"] .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(0, 0, 0, 0.4);
}
html[data-theme="light"] .breadcrumb-item a {
    color: rgba(0, 0, 0, 0.6);
}
/* Home icon is a thin outline glyph — 0.6-alpha reads faint, so give it a firm
   token color to match the rest of the trail. */
html[data-theme="light"] .breadcrumb .nav-home a {
    color: var(--text-secondary);
}
html[data-theme="light"] .breadcrumb-item a:hover,
html[data-theme="light"] .breadcrumb-item.active a {
    color: var(--text-primary) !important;
}

/* --- Form labels / fieldset legends (hard-code translucent-white text) --- */
html[data-theme="light"] fieldset > legend,
html[data-theme="light"] fieldset fieldset > legend,
html[data-theme="light"] .form-group > .control-label:not(.col-form-label),
html[data-theme="light"] .form-group > label,
html[data-theme="light"] .collapsible-fieldset-collapsed-label,
html[data-theme="light"] .inline-statement-pill-switch .custom-control-label {
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .collapsible-fieldset-chevron,
html[data-theme="light"] .form-group .help-block {
    color: var(--text-tertiary) !important;
}

/* --- Tables --- */
html[data-theme="light"] .table {
    color: var(--text-secondary);
}
html[data-theme="light"] .table thead th {
    color: var(--text-tertiary);
    border-bottom-color: var(--border-normal);
}
html[data-theme="light"] .table td,
html[data-theme="light"] .table th {
    border-top-color: var(--border-subtle);
}
html[data-theme="light"] .table-hover tbody tr:hover {
    background-color: var(--surface-2);
}

/* --- Scrollbars: light-grey thumb already, give a darker hover on white --- */
html[data-theme="light"] ::-webkit-scrollbar-thumb {
    background-color: #c2cbd1;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background-color: #9aa6ad;
}

/* --- Native date/time pickers --- */
html[data-theme="light"] input[type="time"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="datetime-local"] {
    color-scheme: light;
}

/* --- Input placeholders (dark theme hard-codes white-alpha) --- */
html[data-theme="light"] .form-control::placeholder {
    color: rgba(0, 0, 0, 0.42) !important;
}

/* --- "White text" utilities: flip to dark ink so sortable table-header
   links, insight labels, and the topbar avatar initials stay readable --- */
html[data-theme="light"] .text-white-75 {
    color: rgba(0, 0, 0, 0.6) !important;
}
html[data-theme="light"] .text-white-85 {
    color: rgba(0, 0, 0, 0.72) !important;
}
html[data-theme="light"] .table thead th a:hover,
html[data-theme="light"] .table thead th a:focus {
    color: var(--text-primary) !important;
}

/* --- Labels: beat the app-wide `label { rgba(255,255,255,.95) !important }`
   and the higher-specificity uppercase form-group label rule --- */
html[data-theme="light"] label:not(.btn),
html[data-theme="light"] .form-label {
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .form-group > label:not(.col-form-label):not(.custom-control-label):not(.form-check-label),
html[data-theme="light"] .form-group > .control-label:not(.col-form-label) {
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .form-text,
html[data-theme="light"] .form-group .form-text,
html[data-theme="light"] .form-group small.form-text {
    color: var(--text-tertiary);
}

/* --- Segmented nav-tabs: on white cards a 0.03 track + white active pill both
   vanish. Give the track a clear recessed grey so the white active pill reads
   as raised out of it (iOS-style segmented control). --- */
html[data-theme="light"] .nav-tabs {
    background: #dbe0e8;
    border-color: rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] .nav-tabs .nav-link {
    color: var(--text-tertiary);
}
html[data-theme="light"] .nav-tabs .nav-link:hover {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .nav-tabs .nav-link.active {
    color: var(--text-primary);
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14),
                0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* --- nav-pills hard-code white-alpha text/fills --- */
html[data-theme="light"] .nav-pills .nav-link {
    color: var(--text-secondary) !important;
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
}
html[data-theme="light"] .nav-pills .nav-link:hover {
    background: rgba(0, 0, 0, 0.07) !important;
    border-color: rgba(0, 0, 0, 0.28) !important;
    color: var(--text-primary) !important;
}
html[data-theme="light"] .nav-pills .nav-link.active {
    color: var(--text-primary) !important;
}

/* --- Bootstrap tooltips: a dark slate panel stands out against the white cards
   and navbar (a white tooltip vanished into them); light text, arrow per
   placement. --- */
html[data-theme="light"] .tooltip-inner {
    background-color: #1c1f27;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
html[data-theme="light"] .bs-tooltip-top .arrow::before,
html[data-theme="light"] .bs-tooltip-auto[x-placement^="top"] .arrow::before {
    border-top-color: #1c1f27;
}
html[data-theme="light"] .bs-tooltip-bottom .arrow::before,
html[data-theme="light"] .bs-tooltip-auto[x-placement^="bottom"] .arrow::before {
    border-bottom-color: #1c1f27;
}
html[data-theme="light"] .bs-tooltip-left .arrow::before,
html[data-theme="light"] .bs-tooltip-auto[x-placement^="left"] .arrow::before {
    border-left-color: #1c1f27;
}
html[data-theme="light"] .bs-tooltip-right .arrow::before,
html[data-theme="light"] .bs-tooltip-auto[x-placement^="right"] .arrow::before {
    border-right-color: #1c1f27;
}
/* Fill layer (::after) too — it uses --pop-bg (#fff on light) by default,
   which showed a white arrow against the dark slate tooltip body. */
html[data-theme="light"] .bs-tooltip-top .arrow::after,
html[data-theme="light"] .bs-tooltip-auto[x-placement^="top"] .arrow::after {
    border-top-color: #1c1f27;
}
html[data-theme="light"] .bs-tooltip-bottom .arrow::after,
html[data-theme="light"] .bs-tooltip-auto[x-placement^="bottom"] .arrow::after {
    border-bottom-color: #1c1f27;
}
html[data-theme="light"] .bs-tooltip-left .arrow::after,
html[data-theme="light"] .bs-tooltip-auto[x-placement^="left"] .arrow::after {
    border-left-color: #1c1f27;
}
html[data-theme="light"] .bs-tooltip-right .arrow::after,
html[data-theme="light"] .bs-tooltip-auto[x-placement^="right"] .arrow::after {
    border-right-color: #1c1f27;
}

/* --- Modal backdrop stays a dark scrim on light --- */
html[data-theme="light"] .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.55);
}

/* --- Navbar dropdown panels (profile/user menu): make sure the panel is
   opaque even where vendor navbar rules outrank the generic rule above --- */
html[data-theme="light"] .navbar-header .dropdown-menu,
html[data-theme="light"] .dropdown-menu.dropdown-user {
    background: #ffffff !important;
}

/* --- select2: light skin (panel, placeholders, options, chips) --- */
html[data-theme="light"] .select2-dropdown {
    background: var(--select-dropdown-bg) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
}
html[data-theme="light"] .select2-container--default .select2-selection--single .select2-selection__placeholder,
html[data-theme="light"] .select2-container--bootstrap .select2-selection--single .select2-selection__placeholder,
html[data-theme="light"] .select2-container--default .select2-selection--multiple .select2-selection__placeholder,
html[data-theme="light"] .select2-container--bootstrap .select2-selection--multiple .select2-selection__placeholder,
html[data-theme="light"] .select2-container--default .select2-search--inline .select2-search__field::placeholder,
html[data-theme="light"] .select2-container--bootstrap .select2-search--inline .select2-search__field::placeholder {
    color: rgba(0, 0, 0, 0.42);
}
html[data-theme="light"] .select2-container--default .select2-search--dropdown .select2-search__field::placeholder,
html[data-theme="light"] .select2-container--bootstrap .select2-search--dropdown .select2-search__field::placeholder {
    color: rgba(0, 0, 0, 0.42) !important;
}
html[data-theme="light"] .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-theme="light"] .select2-container--bootstrap .select2-results__option--highlighted[aria-selected] {
    background-color: var(--select-option-bg-hover) !important;
}
html[data-theme="light"] .select2-container--default .select2-results__option[aria-selected=true],
html[data-theme="light"] .select2-container--bootstrap .select2-results__option[aria-selected=true],
html[data-theme="light"] .select2-container--default .select2-results__option.select2-results__option--selected,
html[data-theme="light"] .select2-container--bootstrap .select2-results__option.select2-results__option--selected {
    background-color: var(--select-option-bg-active) !important;
}
html[data-theme="light"] .select2-container--default .select2-selection--multiple .select2-selection__choice,
html[data-theme="light"] .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice {
    color: #1a6fd4;
}
html[data-theme="light"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
html[data-theme="light"] .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(26, 111, 212, 0.85);
}
html[data-theme="light"] .select2-dropdown .select2-results__options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
}

/* --- Badge/chip variants: the dark-tuned pastel accents wash out on the
   pale tint fills over white — swap in darker shades of the same hues --- */
html[data-theme="light"] .badge-primary,
html[data-theme="light"] .chip-primary {
    color: #1a6fd4 !important;
}
html[data-theme="light"] .badge-success,
html[data-theme="light"] .chip-success {
    color: #059669 !important;
}
html[data-theme="light"] .badge-warning,
html[data-theme="light"] .chip-warning {
    color: #c2410c !important;
}
html[data-theme="light"] .badge-danger,
html[data-theme="light"] .chip-danger {
    color: #dc2626 !important;
}
html[data-theme="light"] .badge-info,
html[data-theme="light"] .chip-info {
    color: #7e22ce !important;
}
html[data-theme="light"] .badge-secondary,
html[data-theme="light"] .chip-secondary {
    color: #475569 !important;
}
html[data-theme="light"] .badge-light,
html[data-theme="light"] .chip-light {
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .chip-dark {
    color: #f0f0f5 !important;
}
html[data-theme="light"] .badge-pink {
    color: #db2777 !important;
}
html[data-theme="light"] .badge-rose {
    color: #e11d48 !important;
}
html[data-theme="light"] .badge-lime {
    color: #4d7c0f !important;
}
html[data-theme="light"] .badge-indigo {
    color: #4f46e5 !important;
}
html[data-theme="light"] .badge-cyan {
    color: #0e7490 !important;
}
html[data-theme="light"] .badge-brown {
    color: #8b5e3c !important;
}

/* --- Buttons: two tiers, mirroring the dark theme's own semantics -----------
   .btn-<color>          -> TINT   : ~12% coloured fill + coloured label (this is
                                     what the base theme already renders, just
                                     tuned to read on white instead of washing
                                     out) — a defined ~38% border keeps the edge
                                     crisp; hover deepens the fill.
   .btn-outline-<color>  -> HOLLOW : transparent + firm coloured border & label.
   No opaque solids and no third tier: dark and light agree on what each class
   means; light only makes the fill legible against a white background. */

html[data-theme="light"] .btn-ghost:hover,
html[data-theme="light"] .btn-ghost:focus {
    background: rgba(0, 0, 0, 0.05);
}

/* Tint tier */
html[data-theme="light"] .btn-primary {
    background: rgba(37, 99, 235, 0.12) !important;
    border-color: rgba(37, 99, 235, 0.38) !important;
    color: #1d4ed8 !important;
}
html[data-theme="light"] .btn-primary:hover:not(:disabled),
html[data-theme="light"] .btn-primary:focus {
    background: rgba(37, 99, 235, 0.20) !important;
    border-color: rgba(37, 99, 235, 0.55) !important;
    color: #1d4ed8 !important;
}
html[data-theme="light"] .btn-success {
    background: rgba(22, 163, 74, 0.12) !important;
    border-color: rgba(22, 163, 74, 0.38) !important;
    color: #15803d !important;
}
html[data-theme="light"] .btn-success:hover:not(:disabled),
html[data-theme="light"] .btn-success:focus {
    background: rgba(22, 163, 74, 0.20) !important;
    border-color: rgba(22, 163, 74, 0.55) !important;
    color: #15803d !important;
}
html[data-theme="light"] .btn-danger {
    background: rgba(220, 38, 38, 0.12) !important;
    border-color: rgba(220, 38, 38, 0.38) !important;
    color: #b91c1c !important;
}
html[data-theme="light"] .btn-danger:hover:not(:disabled),
html[data-theme="light"] .btn-danger:focus {
    background: rgba(220, 38, 38, 0.20) !important;
    border-color: rgba(220, 38, 38, 0.55) !important;
    color: #b91c1c !important;
}
html[data-theme="light"] .btn-info {
    background: rgba(147, 51, 234, 0.12) !important;
    border-color: rgba(147, 51, 234, 0.38) !important;
    color: #7e22ce !important;
}
html[data-theme="light"] .btn-info:hover:not(:disabled),
html[data-theme="light"] .btn-info:focus {
    background: rgba(147, 51, 234, 0.20) !important;
    border-color: rgba(147, 51, 234, 0.55) !important;
    color: #7e22ce !important;
}
html[data-theme="light"] .btn-secondary {
    background: rgba(100, 116, 139, 0.14) !important;
    border-color: rgba(100, 116, 139, 0.38) !important;
    color: #475569 !important;
}
html[data-theme="light"] .btn-secondary:hover:not(:disabled),
html[data-theme="light"] .btn-secondary:focus {
    background: rgba(100, 116, 139, 0.22) !important;
    border-color: rgba(100, 116, 139, 0.55) !important;
    color: #475569 !important;
}
html[data-theme="light"] .btn-warning {
    background: rgba(217, 119, 6, 0.14) !important;
    border-color: rgba(217, 119, 6, 0.40) !important;
    color: #b45309 !important;
}
html[data-theme="light"] .btn-warning:hover:not(:disabled),
html[data-theme="light"] .btn-warning:focus {
    background: rgba(217, 119, 6, 0.22) !important;
    border-color: rgba(217, 119, 6, 0.58) !important;
    color: #b45309 !important;
}
html[data-theme="light"] .btn-dark {
    background: rgba(31, 41, 55, 0.10) !important;
    border-color: rgba(31, 41, 55, 0.35) !important;
    color: #1f2937 !important;
}
html[data-theme="light"] .btn-dark:hover:not(:disabled),
html[data-theme="light"] .btn-dark:focus {
    background: rgba(31, 41, 55, 0.18) !important;
    border-color: rgba(31, 41, 55, 0.50) !important;
    color: #1f2937 !important;
}
html[data-theme="light"] .btn-light {
    background: #f1f4f8 !important;
    border-color: #dde2ea !important;
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .btn-light:hover:not(:disabled),
html[data-theme="light"] .btn-light:focus {
    background: #e5e9f0 !important;
    border-color: #cbd3de !important;
    color: var(--text-secondary) !important;
}

/* Hollow tier — transparent, firm coloured border & text, faint fill on hover */
html[data-theme="light"] .btn-outline-primary {
    background: transparent !important;
    border-color: #2563eb !important;
    color: #2563eb !important;
}
html[data-theme="light"] .btn-outline-primary:hover:not(:disabled),
html[data-theme="light"] .btn-outline-primary:focus {
    background: rgba(37, 99, 235, 0.10) !important;
    border-color: #2563eb !important;
    color: #2563eb !important;
}
html[data-theme="light"] .btn-outline-success {
    background: transparent !important;
    border-color: #16a34a !important;
    color: #16a34a !important;
}
html[data-theme="light"] .btn-outline-success:hover:not(:disabled),
html[data-theme="light"] .btn-outline-success:focus {
    background: rgba(22, 163, 74, 0.10) !important;
    border-color: #16a34a !important;
    color: #16a34a !important;
}
html[data-theme="light"] .btn-outline-danger {
    background: transparent !important;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
}
html[data-theme="light"] .btn-outline-danger:hover:not(:disabled),
html[data-theme="light"] .btn-outline-danger:focus {
    background: rgba(220, 38, 38, 0.10) !important;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
}
html[data-theme="light"] .btn-outline-info {
    background: transparent !important;
    border-color: #9333ea !important;
    color: #9333ea !important;
}
html[data-theme="light"] .btn-outline-info:hover:not(:disabled),
html[data-theme="light"] .btn-outline-info:focus {
    background: rgba(147, 51, 234, 0.10) !important;
    border-color: #9333ea !important;
    color: #9333ea !important;
}
html[data-theme="light"] .btn-outline-secondary {
    background: transparent !important;
    border-color: #94a3b8 !important;
    color: #475569 !important;
}
html[data-theme="light"] .btn-outline-secondary:hover:not(:disabled),
html[data-theme="light"] .btn-outline-secondary:focus {
    background: rgba(100, 116, 139, 0.10) !important;
    border-color: #64748b !important;
    color: #475569 !important;
}
html[data-theme="light"] .btn-outline-warning {
    background: transparent !important;
    border-color: #d97706 !important;
    color: #b45309 !important;
}
html[data-theme="light"] .btn-outline-warning:hover:not(:disabled),
html[data-theme="light"] .btn-outline-warning:focus {
    background: rgba(217, 119, 6, 0.10) !important;
    border-color: #d97706 !important;
    color: #b45309 !important;
}
html[data-theme="light"] .btn-outline-dark {
    background: transparent !important;
    border-color: #1f2937 !important;
    color: #1f2937 !important;
}
html[data-theme="light"] .btn-outline-dark:hover:not(:disabled),
html[data-theme="light"] .btn-outline-dark:focus {
    background: rgba(31, 41, 55, 0.08) !important;
    border-color: #1f2937 !important;
    color: #1f2937 !important;
}
html[data-theme="light"] .btn-outline-light {
    background: transparent !important;
    border-color: #cbd3de !important;
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .btn-outline-light:hover:not(:disabled),
html[data-theme="light"] .btn-outline-light:focus {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: #b7c0cd !important;
    color: var(--text-secondary) !important;
}

/* --- Custom-switch/checkbox track: bootstrap's default is white-on-white --- */
html[data-theme="light"] .custom-control-label::before {
    background-color: #dfe4ea;
    border-color: rgba(0, 0, 0, 0.25);
}
/* bootstrap-toggle off-half hard-codes white text */
html[data-theme="light"] .toggle-off {
    color: var(--text-secondary) !important;
}

/* --- Topbar nav links: the vendor "white" navbar paints them #8d9498 --- */
html[data-theme="light"] .main-header .navbar-header .navbar-nav .nav-item .nav-link {
    color: var(--text-secondary) !important;
}

/* --- Sidebar search: firmer border on the white sidebar --- */
html[data-theme="light"] .sidebar .form-control {
    border-color: rgba(0, 0, 0, 0.22) !important;
}
/* The vendor kbd badge is white-on-white at opacity .35 (built for the dark
   search box); on white it reads as an empty faint box. Give it a legible
   muted fill/label and drop the global dimming. */
html[data-theme="light"] .input-kbd-hint {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.18);
    color: var(--text-tertiary);
    opacity: 1;
}

/* --- Avatar initials: white text on the pale .bg-* tint circles --- */
html[data-theme="light"] .bg-primary.text-white,
html[data-theme="light"] .bg-info.text-white,
html[data-theme="light"] .bg-danger.text-white {
    color: var(--text-primary) !important;
}

