/* ── Dark mode — scoped to html.dark ─────────────────────────────────────
   Toggle via [data-theme-toggle]. Preference: localStorage 'atomcare-theme',
   server-synced to users.dark_mode for web-guard users (best effort).
   Charts/calendar libs read light colors at init; they re-render on the
   `atom:theme-changed` window event where supported. */

html.dark {
    color-scheme: dark;
    --dm-bg: #212121;
    --dm-bg-soft: #171717;
    --dm-surface: #2f2f2f;
    --dm-surface-2: #383838;
    --dm-surface-3: #424242;
    --dm-border: #424242;
    --dm-border-soft: #353535;
    --dm-text: #ececec;
    --dm-text-soft: #d1d1d1;
    --dm-muted: #b4b4b4;
    --dm-faint: #8e8e8e;
    --dm-primary: #4f8ef7;
    --dm-primary-soft: rgba(79, 142, 247, .14);
    --dm-input-bg: #212121;
    --dm-hover: rgba(255, 255, 255, .07);
    --dm-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

/* ── App shell ── */
html.dark body {
    background-color: var(--dm-bg) !important;
    color: var(--dm-text) !important;
}
html.dark .content-wrapper,
html.dark .layout-page,
html.dark .layout-container {
    background-color: var(--dm-bg) !important;
}
html.dark .app-page-loader { background: var(--dm-bg) !important; }
html.dark .app-page-loader__mark { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; box-shadow: none !important; }
html.dark .app-page-loader__logo { filter: grayscale(1) contrast(2.5) invert(1); }
html.dark .app-page-loader__bar { background: rgba(255,255,255,.12) !important; }
html.dark .app-page-loader__bar > span { background: #e5e5e5 !important; }

/* Sidebar brand logo — show the workspace logo as-is (no invert filter),
   with rounded corners to sit cleanly on the dark sidebar */
html.dark #layout-menu .app-brand-logo img { filter: none !important; border-radius: 0 !important; }
/* Sidebar "Powered by" Atom logo — same invert treatment as the page loader */
html.dark .app-brand-powered img { filter: grayscale(1) contrast(2.5) invert(1); }
html.dark .app-brand-powered,
html.dark .app-brand-powered strong { color: var(--dm-muted) !important; }
html.dark .text-muted { color: var(--dm-muted) !important; }
/* text-dark must go light in dark mode — except on elements that keep
   saturated Bootstrap fills (e.g. bg-warning / bg-info badges), where
   dark text is still correct. (bg-white / bg-light are remapped to dark
   surfaces elsewhere, so the base rule is right for those.) */
html.dark .text-dark { color: var(--dm-text) !important; }
html.dark .bg-warning.text-dark,
html.dark .bg-info.text-dark,
html.dark .bg-danger.text-dark,
html.dark .bg-success.text-dark,
html.dark .bg-primary.text-dark { color: #212529 !important; }
html.dark h1, html.dark h2, html.dark h3, html.dark h4,
html.dark h5, html.dark h6, html.dark .h1, html.dark .h2,
html.dark .h3, html.dark .h4, html.dark .h5, html.dark .h6 {
    color: var(--dm-text) !important;
}
html.dark hr { border-color: var(--dm-border) !important; }

/* ── Sidebar menu ── */
html.dark .bg-menu-theme {
    background-color: var(--dm-bg-soft) !important;
    color: var(--dm-muted) !important;
}
html.dark #layout-menu .menu-inner .menu-item > .menu-link { color: var(--dm-muted) !important; }
html.dark #layout-menu .menu-inner .menu-item > .menu-link:hover {
    background: var(--dm-hover) !important;
    color: var(--dm-text) !important;
}
html.dark #layout-menu .menu-inner .menu-item > .menu-link .menu-icon { color: var(--dm-faint) !important; }
html.dark #layout-menu .menu-inner .menu-item > .menu-link:hover .menu-icon,
html.dark #layout-menu .menu-inner .menu-item.open > .menu-link .menu-icon { color: var(--dm-text) !important; }
html.dark #layout-menu .menu-inner .menu-item.active > .menu-link {
    background: var(--dm-surface-2) !important;
    color: #fff !important;
    box-shadow: none !important;
}
html.dark #layout-menu .menu-inner .menu-item.active > .menu-link .menu-icon { color: #fff !important; }
html.dark #layout-menu .menu-inner .menu-sub .menu-item > .menu-link { color: var(--dm-muted) !important; }
html.dark #layout-menu .menu-inner .menu-sub .menu-item > .menu-link:hover {
    background: var(--dm-hover) !important;
    color: var(--dm-text) !important;
}
html.dark #layout-menu .menu-inner .menu-sub .menu-item.active > .menu-link {
    background: var(--dm-hover) !important;
    color: #fff !important;
}
html.dark #layout-menu .menu-inner .menu-item.open > .menu-link { color: var(--dm-text) !important; }
html.dark #layout-menu .menu-inner .menu-header { color: var(--dm-faint) !important; }
html.dark .workspace-switcher {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .workspace-switcher:hover { background: var(--dm-surface-2) !important; }
html.dark .workspace-switcher ~ .dropdown-menu .dropdown-item { color: var(--dm-text-soft) !important; }
html.dark .workspace-switcher ~ .dropdown-menu .dropdown-item:hover {
    background: var(--dm-hover) !important;
    color: var(--dm-text) !important;
}
html.dark .workspace-switcher ~ .dropdown-menu .dropdown-item:hover .menu-icon { color: var(--dm-text) !important; }
html.dark .workspace-switcher ~ .dropdown-menu .dropdown-item.is-active {
    background: var(--dm-surface-2) !important;
    color: #fff !important;
}
html.dark .workspace-switcher ~ .dropdown-menu .dropdown-item.is-active .menu-icon,
html.dark .workspace-switcher ~ .dropdown-menu .dropdown-item.is-active .menu-icon.text-primary { color: #fff !important; }
html.dark .menu-search-input {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .menu-search-input::placeholder { color: var(--dm-faint) !important; }
html.dark .menu-search-input:focus { background: var(--dm-surface-2) !important; }
html.dark .app-brand .layout-menu-toggle { box-shadow: 0 2px 6px rgba(0,0,0,.5) !important; }

/* Collapsed fly-out submenu */
html.dark.layout-menu-collapsed .layout-menu .menu-inner .menu-item:hover .menu-sub {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

/* ── Navbar ── */
html.dark #layout-navbar {
    background: var(--dm-bg-soft) !important;
    border-color: var(--dm-border-soft) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.4) !important;
}
html.dark #layout-navbar .navbar-nav .nav-item .nav-link { color: var(--dm-muted) !important; }
html.dark #layout-navbar .navbar-nav .nav-item .nav-link:hover {
    background: var(--dm-hover) !important;
    color: var(--dm-text) !important;
}
html.dark .nav-icon-badge {
    background: linear-gradient(135deg, #333333, #424242) !important;
    box-shadow: none !important;
}
html.dark .nav-icon-badge i.bx { color: var(--dm-text) !important; }
html.dark #tt-clocked-since { color: var(--dm-muted) !important; }
html.dark #tt-clock-btn {
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
    background: transparent !important;
}
html.dark #tt-clock-btn:hover {
    border-color: var(--dm-faint) !important;
    color: var(--dm-text) !important;
    background: var(--dm-hover) !important;
}
html.dark #layout-navbar #tt-clock-btn > i.bx {
    color: #8e8e8e !important;
}
html.dark #layout-navbar #tt-clock-btn:hover > i.bx,
html.dark #layout-navbar #tt-clock-btn:focus-visible > i.bx {
    color: var(--dm-text) !important;
}

/* Theme toggle button reset */
.theme-toggle {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    cursor: pointer;
}
.theme-toggle .nav-icon-badge { transition: transform .15s ease; }
.theme-toggle:hover .nav-icon-badge { transform: translateY(-1px); }

/* Floating fallback toggle (guest pages / occupant layout) */
.theme-toggle-floating {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--dm-border, #e2e8f0);
    background: #fff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(15,23,42,.18);
    transition: transform .15s ease;
}
.theme-toggle-floating:hover { transform: scale(1.07); }
html.dark .theme-toggle-floating {
    background: var(--dm-surface-2);
    color: var(--dm-text);
}

/* ── Cards & surfaces ── */
html.dark .card,
html.dark .page-actions,
html.dark .pro-profile-hero {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    color: var(--dm-text) !important;
}
html.dark .card .card-header,
html.dark .card-header {
    background: transparent !important;
    border-color: var(--dm-border-soft) !important;
    color: var(--dm-text) !important;
}
html.dark .card-footer { background: transparent !important; border-color: var(--dm-border-soft) !important; }
html.dark .card .card-body { color: var(--dm-text-soft) !important; }
html.dark .bg-footer-theme { background-color: var(--dm-bg-soft) !important; color: var(--dm-muted) !important; }
html.dark .bg-footer-theme .footer-link { color: var(--dm-muted) !important; }
html.dark .bg-footer-theme .footer-text { color: var(--dm-text-soft) !important; }

/* ── Dropdowns / popovers / tooltips ── */
html.dark .dropdown-menu {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    box-shadow: var(--dm-shadow) !important;
}
html.dark .dropdown-item { color: var(--dm-text-soft) !important; }
html.dark .dropdown-item:hover, html.dark .dropdown-item:focus {
    background: var(--dm-hover) !important;
    color: var(--dm-text) !important;
}
html.dark .dropdown-divider { border-color: var(--dm-border-soft) !important; }
html.dark .dropdown-header { color: var(--dm-muted) !important; }
html.dark .popover, html.dark .tooltip-inner {
    background: var(--dm-surface-2) !important;
    color: var(--dm-text) !important;
    border-color: var(--dm-border) !important;
}
html.dark .bs-popover-auto[data-popper-placement^="top"] > .popover-arrow::after { border-top-color: var(--dm-surface-2) !important; }
html.dark .user-dropdown { border-color: var(--dm-border) !important; }
html.dark .user-dropdown .ud-head { background: linear-gradient(135deg,#12345f 0%,#3d2470 100%) !important; }
html.dark .user-dropdown .ud-body { background: var(--dm-surface) !important; }
html.dark .user-dropdown .ud-item { color: var(--dm-text-soft) !important; }
html.dark .user-dropdown .ud-item:hover { background: var(--dm-hover) !important; color: var(--dm-primary) !important; }
html.dark .user-dropdown .ud-ic-profile { background: rgba(79,142,247,.15) !important; color: #93c5fd !important; }
html.dark .user-dropdown .ud-ic-sub { background: rgba(245,158,11,.15) !important; color: #fcd34d !important; }
html.dark .user-dropdown .ud-item:hover .ud-ic-profile { background: #4f8ef7 !important; color: #fff !important; }
html.dark .user-dropdown .ud-item:hover .ud-ic-sub { background: #d97706 !important; color: #fff !important; }
html.dark .user-dropdown .ud-foot { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .user-dropdown .ud-logout {
    background: rgba(220,38,38,.12) !important;
    border-color: rgba(248,113,113,.4) !important;
    color: #fca5a5 !important;
}
html.dark .st-dd-menu { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; }
html.dark .st-dd-menu__item { color: var(--dm-text-soft) !important; }
html.dark .st-dd-menu__item:hover, html.dark .st-dd-menu__item.is-current { background: var(--dm-hover) !important; }
html.dark .st-dd-menu__head, html.dark .st-dd-menu__foot { color: var(--dm-faint) !important; }

/* ── Modals / offcanvas ── */
html.dark .modal .modal-content {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .modal .modal-header {
    background: linear-gradient(180deg, var(--dm-surface-2), var(--dm-surface)) !important;
    border-color: var(--dm-border-soft) !important;
}
html.dark .modal .modal-title { color: var(--dm-text) !important; }
html.dark .modal .modal-body { color: var(--dm-text-soft) !important; }
html.dark .modal .modal-footer {
    background: var(--dm-bg-soft) !important;
    border-color: var(--dm-border-soft) !important;
}
html.dark .modal .form-label { color: var(--dm-muted) !important; }
html.dark .modal .btn-close { filter: none !important; opacity: .75 !important; }
html.dark .offcanvas { background: var(--dm-surface) !important; color: var(--dm-text) !important; }
html.dark #clientOverviewDrawer .offcanvas-body { background: var(--dm-bg) !important; }
html.dark #clientOverviewDrawer .card,
html.dark #clientOverviewDrawer #clientOverviewAddress,
html.dark #clientOverviewDrawer #clientOverviewFlats > div {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    color: var(--dm-text) !important;
}

/* ── Tables ── */
html.dark .table { color: var(--dm-text-soft) !important; border-color: var(--dm-border-soft) !important; }
html.dark .table thead th {
    background: var(--dm-surface-2) !important;
    color: var(--dm-muted) !important;
    border-color: var(--dm-border-soft) !important;
}
/* Plain card tables: rounded outer corners (match light mode —
   the collapse model kills radius, so keep it separate). */
html.dark .card .table-responsive > .table{border-collapse:separate !important;border-spacing:0 !important;}
html.dark .card .table-responsive > .table thead th:first-child{border-top-left-radius:.5rem !important;}
html.dark .card .table-responsive > .table thead th:last-child{border-top-right-radius:.5rem !important;}
html.dark .card .table-responsive > .table tbody tr:last-child td:first-child{border-bottom-left-radius:.5rem !important;}
html.dark .card .table-responsive > .table tbody tr:last-child td:last-child{border-bottom-right-radius:.5rem !important;}
html.dark .table tbody td, html.dark .table tbody th { border-color: var(--dm-border-soft) !important; }
/* Bordered grid lines keep Bootstrap's light --bs-table-border-color unless
   overridden here (vertical dividers render white in dark mode otherwise). */
html.dark .table, html.dark .table-bordered { --bs-table-border-color: var(--dm-border-soft); }
html.dark .table-bordered > :not(caption) > * > * { border-color: var(--dm-border-soft) !important; }
/* Some list pages pin #table grid colors with (2,2,2)-specificity !important
   rules — beat them explicitly with literal dark colors (no var() chain). */
html.dark .bootstrap-table .fixed-table-container:has(#table) {
    background: transparent !important;
    border-color: var(--dm-border-soft) !important;
}
html.dark .bootstrap-table .fixed-table-container:has(#table) #table thead th,
html.dark .bootstrap-table .fixed-table-container:has(#table) #table tbody td {
    border-top-color: var(--dm-border-soft) !important;
    border-bottom-color: var(--dm-border-soft) !important;
    border-right-color: var(--dm-border-soft) !important;
}
html.dark .bootstrap-table .fixed-table-container:has(#table) #table thead th {
    border-bottom: 2px solid var(--dm-border) !important;
}
html.dark .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: rgba(255,255,255,.02); color: var(--dm-text-soft); }
html.dark .table-hover > tbody > tr:hover > * { --bs-table-accent-bg: var(--dm-hover); color: var(--dm-text); }
html.dark .bootstrap-table .fixed-table-container,
html.dark .bootstrap-table .fixed-table-toolbar,
html.dark .fixed-table-pagination {
    background: transparent !important;
    border-color: var(--dm-border-soft) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .fixed-table-toolbar .btn,
html.dark .fixed-table-pagination .btn,
html.dark .fixed-table-pagination .page-link {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .fixed-table-pagination .page-item.active .page-link {
    background: var(--dm-primary) !important;
    border-color: var(--dm-primary) !important;
    color: #fff !important;
}
html.dark .fixed-table-toolbar .form-control,
html.dark .fixed-table-pagination .form-control {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

/* ── Forms ── */
html.dark .form-control, html.dark .form-select {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .form-control::placeholder { color: var(--dm-faint) !important; }
html.dark .form-control:focus, html.dark .form-select:focus {
    background: var(--dm-surface) !important;
    border-color: var(--dm-primary) !important;
    color: var(--dm-text) !important;
}
html.dark .form-control:disabled, html.dark .form-select:disabled {
    background: var(--dm-bg-soft) !important;
    color: var(--dm-faint) !important;
}
html.dark .input-group-text {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-muted) !important;
}
html.dark .form-label, html.dark label.form-label, html.dark .col-form-label { color: var(--dm-text-soft) !important; }
html.dark .form-check-label { color: var(--dm-text-soft) !important; }
html.dark .form-check-input { background-color: var(--dm-surface-3) !important; border-color: var(--dm-border) !important; }
html.dark .form-check-input:checked { background-color: var(--dm-primary) !important; border-color: var(--dm-primary) !important; }
/* bootstrap-table renders bare inputs (no .form-check-input class), which
   stay native-white in dark mode — paint them explicitly. */
html.dark .bootstrap-table input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 1.15em !important;
    height: 1.15em !important;
    margin: 0 !important;
    vertical-align: middle !important;
    flex: none !important;
    cursor: pointer !important;
    background: var(--dm-surface-3) !important;
    border: 1px solid var(--dm-border) !important;
    border-radius: 4px !important;
    position: relative !important;
}
html.dark .bootstrap-table input[type="checkbox"]:checked,
html.dark .bootstrap-table input[type="checkbox"]:indeterminate {
    background: var(--dm-primary) !important;
    border-color: var(--dm-primary) !important;
}
html.dark .bootstrap-table input[type="checkbox"]:checked::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: .32em !important;
    height: .6em !important;
    border: solid #fff !important;
    border-width: 0 .16em .16em 0 !important;
    transform: translate(-50%,-60%) rotate(45deg) !important;
}
html.dark .bootstrap-table input[type="checkbox"]:indeterminate::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: .55em !important;
    height: .14em !important;
    background: #fff !important;
    border-radius: 2px !important;
    transform: translate(-50%,-50%) !important;
}
/* Switches read as status fills — keep them gray in dark mode (no blue fill/glow) */
html.dark .form-switch .form-check-input:checked { background-color: #737373 !important; border-color: #737373 !important; }
html.dark .form-switch .form-check-input:focus { border-color: var(--dm-faint) !important; box-shadow: 0 0 0 .25rem rgba(255, 255, 255, .08) !important; }
html.dark .form-select option { background: var(--dm-surface-2) !important; color: var(--dm-text) !important; }

/* File inputs — Bootstrap pins a light ::file-selector-button (white "Choose
   File" pill glares on dark inputs). Retint globally, both engines. */
html.dark .form-control[type="file"] {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .form-control[type="file"]::file-selector-button,
html.dark .form-control[type="file"]::-webkit-file-upload-button {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .form-control[type="file"]:hover::file-selector-button,
html.dark .form-control[type="file"]:hover::-webkit-file-upload-button {
    background: var(--dm-surface-3) !important;
    color: var(--dm-text) !important;
}

/* Select2 */
html.dark .select2.select2-container.select2-container--default:not(#global-search + .select2-container) {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .select2-container--default .select2-selection--single .select2-selection__rendered,
html.dark .select2-container--default .select2-selection--multiple .select2-selection__choice {
    color: var(--dm-text) !important;
}
/* The visible box is the inner .select2-selection, not the container —
   it keeps select2.css's #fff fill unless overridden here. */
html.dark .select2-container--default .select2-selection--single,
html.dark .select2-container--default .select2-selection--multiple {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
}
html.dark .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--dm-faint) !important;
}
html.dark .select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--dm-muted) !important;
}
html.dark .select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #fca5a5 !important;
}
html.dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--dm-muted) transparent transparent transparent !important;
}
html.dark .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--dm-muted) transparent !important;
}
html.dark .select2-container--default.select2-container--focus .select2-selection--single,
html.dark .select2-container--default.select2-container--focus .select2-selection--multiple,
html.dark .select2-container--default.select2-container--open .select2-selection--single,
html.dark .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--dm-primary) !important;
    box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important;
}
html.dark .select2-container--default .select2-results__option[aria-disabled="true"],
html.dark .select2-container--default .select2-results__option--disabled {
    color: var(--dm-faint) !important;
}
html.dark .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--dm-muted) !important;
}
html.dark .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
html.dark .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
    background: var(--dm-hover) !important;
    color: #fca5a5 !important;
}
html.dark .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-border) !important;
}
html.dark .select2-dropdown {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
}
html.dark .select2-container--default .select2-results__option { color: var(--dm-text-soft) !important; }
html.dark .select2-container--default .select2-results__option--highlighted { background: var(--dm-hover) !important; color: var(--dm-primary) !important; }
html.dark .select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark #global-search + .select2-container .select2-selection--single .select2-selection__rendered { color: var(--dm-muted) !important; }
html.dark #global-search + .select2-container--focus .select2-selection--single,
html.dark #global-search + .select2-container--open .select2-selection--single { background-color: var(--dm-surface-2) !important; }

/* ── Buttons / badges / alerts ── */
html.dark .btn-outline-secondary, html.dark a.btn-outline-secondary {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .btn-outline-secondary:hover { background: var(--dm-surface-3) !important; color: var(--dm-text) !important; }
html.dark .btn-outline-primary { background: transparent !important; border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; }
html.dark .btn-outline-primary:hover { background: var(--dm-hover) !important; border-color: var(--dm-faint) !important; color: var(--dm-text) !important; box-shadow: none !important; }
/* Status radio toggle (suppliers/clients #statusDiv) — gray selected state in dark mode.
   custom.css pins blue with #statusDiv specificity, so these match it. */
html.dark #statusDiv .btn-check:checked + .btn-outline-primary {
    background: #737373 !important;
    border-color: #737373 !important;
    color: #fff !important;
    box-shadow: none !important;
}
html.dark #statusDiv .btn-check:checked + .btn-outline-primary:hover {
    background: #8a8a8a !important;
    border-color: #8a8a8a !important;
    color: #fff !important;
    box-shadow: none !important;
    transform: none !important;
}
html.dark #statusDiv .btn-check:not(:checked) + .btn-outline-primary {
    background: transparent !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
}
html.dark #statusDiv .btn-check:not(:checked) + .btn-outline-primary:hover {
    background: var(--dm-hover) !important;
    border-color: var(--dm-faint) !important;
    color: var(--dm-text) !important;
    box-shadow: none !important;
    transform: none !important;
}
/* Page header action buttons: gray is the primary color in dark mode.
   (custom.css pins blue fills with !important, so these need it too.) */
html.dark .page-actions .page-btn-solid {
    background: #737373 !important;
    border-color: #737373 !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.4) !important;
}
html.dark .page-actions .page-btn-solid span,
html.dark .page-actions .page-btn-solid i { color: #fff !important; }
html.dark .page-actions .page-btn-solid .page-btn-plus { background: rgba(255,255,255,.22) !important; }
html.dark .page-actions .page-btn-solid:hover {
    background: #8a8a8a !important;
    border-color: #8a8a8a !important;
    color: #fff !important;
    transform: translateY(-1px);
}
html.dark .page-actions .page-btn-solid:hover span,
html.dark .page-actions .page-btn-solid:hover i { color: #fff !important; }
html.dark .page-actions .page-btn-soft {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,.35) !important;
    color: #fff !important;
}
html.dark .page-actions .page-btn-soft i { color: #fff !important; }
html.dark .page-actions .page-btn-soft:hover {
    background: rgba(255,255,255,.12) !important;
    border-color: #fff !important;
    color: #fff !important;
    box-shadow: none !important;
    transform: translateY(-1px);
}
html.dark .page-actions .page-btn-soft:hover i { color: #fff !important; }
html.dark .page-actions .page-sep { background: var(--dm-border) !important; }
/* ── Primary buttons app-wide: gray background in dark mode.
   custom.css pins blue fills with !important, so these need it too. ── */
html.dark .btn-primary {
    background-color: #737373 !important;border-color: #737373 !important;color: #fff !important;
}
html.dark .btn-primary:hover {
    background-color: #8a8a8a !important;border-color: #8a8a8a !important;color: #fff !important;
}
html.dark .btn-primary:focus {
    background-color: #8a8a8a !important;border-color: #8a8a8a !important;color: #fff !important;
    box-shadow: 0 0 0 .25rem rgba(160,160,160,.35) !important;
}
html.dark .btn-primary:active,
html.dark .show > .btn-primary.dropdown-toggle {
    background-color: #5f5f5f !important;border-color: #5f5f5f !important;color: #fff !important;
}
html.dark .btn-primary:disabled,
html.dark .btn-primary.disabled {
    background-color: #4a4a4a !important;border-color: #4a4a4a !important;color: #8e8e8e !important;
}
/* Form submit variant (higher-specificity selectors in custom.css) */
html.dark form.form-submit-event button[type="submit"].btn-primary,
html.dark form button[type="submit"].btn-primary#submit_btn {
    background: #737373 !important;border-color: #737373 !important;color: #fff !important;
}
html.dark form.form-submit-event button[type="submit"].btn-primary:hover,
html.dark form button[type="submit"].btn-primary#submit_btn:hover {
    background: #8a8a8a !important;border-color: #8a8a8a !important;color: #fff !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.4) !important;
}
/* Breadcrumb-header variant (custom.css :has() selector) */
html.dark .container-fluid .d-flex:has(> div > nav[aria-label="breadcrumb"]) .btn-primary {
    background: #737373 !important;border-color: #737373 !important;color: #fff !important;
}
html.dark .container-fluid .d-flex:has(> div > nav[aria-label="breadcrumb"]) .btn-primary:hover {
    background: #8a8a8a !important;border-color: #8a8a8a !important;color: #fff !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.4) !important;
}
/* ── Circular primary buttons: gray with white icons in dark mode ── */
html.dark .app-brand .layout-menu-toggle {
    background: #737373 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.5) !important;
}
html.dark .app-brand .layout-menu-toggle:hover { background: #8a8a8a !important; }
html.dark .app-brand .layout-menu-toggle i { color: #fff !important; }
html.dark #floating-chat-btn {
    background: #737373 !important;
    color: #fff !important;
    box-shadow: 0 6px 24px rgba(0,0,0,.5) !important;
}
html.dark #floating-chat-btn:hover {
    color: #fff !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.6) !important;
}
html.dark #floating-chat-btn .chat-icon { color: #fff !important; }
html.dark #floating-chat-badge { border-color: var(--dm-surface) !important; }
html.dark .btn-light { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
html.dark .alert-light { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; }
html.dark .list-group-item { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .nav-pills .nav-link:not(.active) { color: var(--dm-muted) !important; }
html.dark .nav-tabs { border-color: var(--dm-border-soft) !important; }
html.dark .nav-tabs .nav-link:not(.active) { background: transparent !important; border-color: transparent !important; color: var(--dm-muted) !important; }
html.dark .nav-tabs .nav-link:not(.active):hover { background: var(--dm-hover) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text) !important; }
html.dark .nav-tabs .nav-link.active { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text) !important; }
/* core.css paints aligned tab panes #fff — keep the card visible in dark mode */
html.dark .nav-align-top > .tab-content,
html.dark .nav-align-right > .tab-content,
html.dark .nav-align-bottom > .tab-content,
html.dark .nav-align-left > .tab-content {
    background: var(--dm-surface) !important;
    border: 1px solid var(--dm-border-soft) !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.4) !important;
}
html.dark .accordion-item { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .accordion-button { background: var(--dm-surface) !important; color: var(--dm-text) !important; }
html.dark .accordion-button:not(.collapsed) { background: var(--dm-surface-2) !important; color: var(--dm-primary) !important; }
html.dark .accordion-body { color: var(--dm-text-soft) !important; }
html.dark .progress { background: var(--dm-surface-3) !important; }
html.dark .breadcrumb { background: transparent !important; }
html.dark .breadcrumb-item, html.dark .breadcrumb-item a { color: var(--dm-muted) !important; }
html.dark .breadcrumb-item.active { color: var(--dm-text-soft) !important; }
html.dark .toast { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
html.dark .toast-header { background: var(--dm-surface-3) !important; color: var(--dm-text) !important; border-color: var(--dm-border-soft) !important; }
html.dark .toast-header .btn-close { filter: none !important; opacity: .75 !important; }

/* ── Toastr notifications — enterprise minimal (dark) ── */
html.dark #toast-container > div {
    background-color: var(--dm-surface-2) !important;background-image:none !important;
    border:1px solid var(--dm-border) !important;border-left-width:3px !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .55) !important;
    opacity: 1 !important;
    border-radius: 12px !important;
    color: var(--dm-text) !important;
}
html.dark #toast-container > .toast-success { border-left-color: #22c55e !important; }
html.dark #toast-container > .toast-error { border-left-color: #ef4444 !important; }
html.dark #toast-container > .toast-info { border-left-color: #38bdf8 !important; }
html.dark #toast-container > .toast-warning { border-left-color: #f59e0b !important; }
html.dark #toast-container .toast-title { color: var(--dm-text) !important; }
html.dark #toast-container .toast-message { color: var(--dm-text-soft) !important; }
html.dark #toast-container .toast-message a, html.dark #toast-container .toast-message label { color: #fff !important; }
html.dark #toast-container .toast-progress { background-color: rgba(255, 255, 255, .25) !important; }
html.dark #toast-container > .toast-success .toast-progress { background-color: #22c55e !important; }
html.dark #toast-container > .toast-error .toast-progress { background-color: #ef4444 !important; }
html.dark #toast-container > .toast-info .toast-progress { background-color: #38bdf8 !important; }
html.dark #toast-container > .toast-warning .toast-progress { background-color: #f59e0b !important; }
html.dark #toast-container .toast-close-button { color: var(--dm-muted) !important; text-shadow: none !important; opacity: 1 !important; }
html.dark #toast-container .toast-close-button:hover,
html.dark #toast-container .toast-close-button:focus { color: #fff !important; opacity: 1 !important; }

/* Status pills keep their hue, slightly deepened for contrast */
html.dark div.select-bg-label-success { background: linear-gradient(180deg,#14532d,#166534) !important; color: #bbf7d0 !important; }
html.dark div.select-bg-label-primary { background: linear-gradient(180deg,#1e3a8a,#1e40af) !important; color: #c7d2fe !important; }
html.dark div.select-bg-label-secondary { background: linear-gradient(180deg,#3a3a3a,#525252) !important; color: #ececec !important; }
html.dark div.select-bg-label-danger { background: linear-gradient(180deg,#7f1d1d,#991b1b) !important; color: #fecaca !important; }
html.dark div.select-bg-label-warning { background: linear-gradient(180deg,#78350f,#92400e) !important; color: #fde68a !important; }
html.dark div.select-bg-label-info { background: linear-gradient(180deg,#0c4a6e,#075985) !important; color: #bae6fd !important; }

/* ── Supplier-style panel pages (site-inspections, incident-reports, tenders…)
   Per-page <style> blocks load after this file, but html.dark (0,2,1) beats
   their plain class selectors (0,1,0). ── */

/* ── Reports hub (reports/index.blade.php) ── */
html.dark .report-section { box-shadow: 0 10px 26px rgba(0,0,0,.4) !important; }
html.dark .report-section .card-header {
    background: linear-gradient(180deg, var(--dm-surface-2), var(--dm-surface)) !important;
    border-bottom-color: var(--dm-border-soft) !important;
}
html.dark .section-icon { color: #a5b4fc !important; background: rgba(129,140,248,.14) !important; border-color: rgba(129,140,248,.35) !important; }
html.dark .section-icon.green { color: #6ee7b7 !important; background: rgba(52,211,153,.14) !important; border-color: rgba(52,211,153,.35) !important; }
html.dark .section-icon.amber { color: #fcd34d !important; background: rgba(251,191,36,.14) !important; border-color: rgba(251,191,36,.35) !important; }
html.dark .section-icon.violet { color: #c4b5fd !important; background: rgba(167,139,250,.14) !important; border-color: rgba(167,139,250,.35) !important; }
html.dark .section-title { color: var(--dm-text) !important; }
html.dark .section-sub { color: var(--dm-muted) !important; }
html.dark .phase-pill { background: rgba(52,211,153,.14) !important; color: #6ee7b7 !important; border-color: rgba(52,211,153,.35) !important; }
html.dark .phase-pill::before { background: #34d399 !important; box-shadow: 0 0 0 3px rgba(52,211,153,.2) !important; }
html.dark .report-item { border-color: var(--dm-border-soft) !important; background: var(--dm-surface) !important; }
html.dark .report-item:hover { box-shadow: 0 12px 24px rgba(0,0,0,.45) !important; border-color: var(--dm-border) !important; }
html.dark .report-item .title { color: var(--dm-text) !important; }
html.dark .report-icon { background: rgba(129,140,248,.14) !important; color: #a5b4fc !important; border-color: rgba(129,140,248,.35) !important; }
html.dark .report-link { color: #a5b4fc !important; }

/* ── Roles / permission settings ── */
html.dark .role-name { color: var(--dm-text) !important; }
html.dark .role-badge--global { background: linear-gradient(135deg, rgba(37,99,235,.25), rgba(79,70,229,.2)) !important; color: #93c5fd !important; border-color: rgba(79,142,247,.4) !important; box-shadow: none !important; }
html.dark .role-badge--locked { background: linear-gradient(135deg, rgba(217,119,6,.22), rgba(217,119,6,.12)) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.4) !important; box-shadow: none !important; }
html.dark .role-badge--system { background: rgba(22,163,74,.18) !important; color: #86efac !important; border-color: rgba(34,197,94,.4) !important; }
html.dark .locked-hint { background: linear-gradient(135deg, rgba(217,119,6,.16), rgba(217,119,6,.07)) !important; border-color: rgba(245,158,11,.4) !important; }
html.dark .locked-hint__title { color: #fcd34d !important; }
html.dark .locked-hint__desc { color: #e7c873 !important; }
html.dark .locked-hint__desc b { color: #fcd34d !important; }

/* ── Shared fr-head-ico pastel chips (finance, notes, roles…) — inline
   pastel backgrounds glow on dark surfaces; retint per hue family ── */
html.dark .fr-head-ico[style*="background:#fff"] { background: var(--dm-surface-3) !important; color: var(--dm-primary) !important; }
html.dark .fr-head-ico[style*="background:#dcfce7"] { background: rgba(22,163,74,.2) !important; color: #86efac !important; }
html.dark .fr-head-ico[style*="background:#e0f2fe"],
html.dark .fr-head-ico[style*="background:#eaf2ff"] { background: var(--dm-primary-soft) !important; color: #93c5fd !important; }
html.dark .fr-head-ico[style*="background:#f5f3ff"],
html.dark .fr-head-ico[style*="background:#eef2ff"] { background: rgba(139,92,246,.18) !important; color: #a78bfa !important; }
html.dark .fr-head-ico[style*="background:#fef9c3"],
html.dark .fr-head-ico[style*="background:#fef3c7"] { background: rgba(217,119,6,.2) !important; color: #fcd34d !important; }
html.dark .fr-head-ico[style*="background:#fee2e2"],
html.dark .fr-head-ico[style*="background:#fef2f2"] { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
   Per-page <style> blocks load after this file, but html.dark (0,2,1) beats
   their plain class selectors (0,1,0). */

/* pro-tables design tokens remap */
html.dark {
    --pro-primary-soft: rgba(79, 142, 247, .14);
    --pro-ink: #ececec;
    --pro-muted: #b4b4b4;
    --pro-faint: #8e8e8e;
    --pro-line: #424242;
    --pro-line-soft: #353535;
    --pro-head-bg: #2f2f2f;
    --pro-card-shadow: 0 14px 30px rgba(0, 0, 0, .45);
}

/* Panel hero: gray-based gradient in dark mode */
html.dark .supplier-panel-hero {
    background: linear-gradient(135deg, rgba(148,163,184,.16), rgba(148,163,184,.04)) !important;
    border-color: var(--dm-border-soft) !important;
    box-shadow: 0 18px 35px rgba(0,0,0,.35) !important;
}
html.dark .supplier-panel-hero .hero-icon { background: rgba(148,163,184,.18) !important; color: #cbd5e1 !important; }
html.dark .supplier-panel-hero .hero-title { color: var(--dm-text) !important; }
html.dark .supplier-panel-hero .hero-subtitle { color: var(--dm-muted) !important; }
html.dark .supplier-panel-chip {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .supplier-panel-chip--btn:hover {
    border-color: var(--dm-primary) !important;
    color: var(--dm-primary) !important;
    box-shadow: 0 6px 14px rgba(0,0,0,.4) !important;
}

/* Stat summary cards */
html.dark .supplier-stat-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.4) !important;
}
html.dark .supplier-stat-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.5) !important; }
html.dark .supplier-stat-card--total,
html.dark .supplier-stat-card--violet { background: linear-gradient(135deg, rgba(79,80,246,.22) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--upcoming,
html.dark .supplier-stat-card--green { background: linear-gradient(135deg, rgba(5,150,105,.20) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--overdue,
html.dark .supplier-stat-card--red { background: linear-gradient(135deg, rgba(220,38,38,.20) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--amber { background: linear-gradient(135deg, rgba(217,119,6,.20) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--sky { background: linear-gradient(135deg, rgba(14,165,233,.20) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--slate { background: linear-gradient(135deg, rgba(100,116,139,.22) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--open { background: linear-gradient(135deg, rgba(2,132,199,.20) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-label { color: var(--dm-muted) !important; }
html.dark .supplier-stat-value { color: var(--dm-text) !important; }
html.dark .supplier-stat-sub { color: var(--dm-muted) !important; }
/* Inline near-black values (e.g. overdue=0 state) would vanish on dark cards */
html.dark .supplier-stat-value[style*="#0f172a"] { color: var(--dm-text) !important; }
/* Light accent icon chip (inline #eef2ff) retinted; solid color chips untouched */
html.dark .supplier-stat-icon[style*="#eef2ff"] { background: rgba(79,142,247,.20) !important; color: #93c5fd !important; }

/* Chart cards */
html.dark .si-chart-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    box-shadow: 0 4px 28px rgba(0,0,0,.4) !important;
}
html.dark .si-chart-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.5) !important; }
html.dark .si-chart-head { background: transparent !important; }
html.dark .si-chart-title { color: var(--dm-text) !important; }
html.dark .si-chart-sub { color: var(--dm-muted) !important; }
html.dark .si-chart-badge { background: var(--dm-surface-3) !important; color: var(--dm-text-soft) !important; }
html.dark .si-chart-badge--alert { background: rgba(220,38,38,.18) !important; color: #fca5a5 !important; }
html.dark .si-chart-icon--sky { background: rgba(14,165,233,.16) !important; color: #38bdf8 !important; }
html.dark .si-chart-icon--violet { background: rgba(139,92,246,.16) !important; color: #a78bfa !important; }

/* Table card shell (uses .card + .pro-table-head tokens, remapped above) */
html.dark .supplier-table-card { background: var(--dm-surface) !important; }
html.dark .pro-table-count { background: var(--dm-surface-3) !important; color: var(--dm-text) !important; }

/* ── bootstrap-table toolbar — pro-tables.css hardcodes #fff surfaces with
   high-specificity selectors, so these html.dark overrides match/exceed them ── */
html.dark .bootstrap-table .fixed-table-toolbar .columns-right > button.btn,
html.dark .bootstrap-table .fixed-table-toolbar .columns-right > div.btn-group:not(.keep-open) > button.btn,
html.dark .bootstrap-table .fixed-table-toolbar button[name="refresh"] {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-muted) !important;
}
html.dark .bootstrap-table .fixed-table-toolbar .columns-right .keep-open.btn-group > .btn.dropdown-toggle {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .bootstrap-table .fixed-table-toolbar .columns-right .btn:hover,
html.dark .bootstrap-table .fixed-table-toolbar button[name="refresh"]:hover {
    border-color: var(--dm-primary) !important;
    color: var(--dm-primary) !important;
    background: var(--dm-primary-soft) !important;
    box-shadow: none !important;
}
html.dark .bootstrap-table .btn.delete-selected,
html.dark .bootstrap-table .action_delete_site_inspection .btn {
    background: rgba(220, 38, 38, .12) !important;
    border-color: rgba(248, 113, 113, .5) !important;
    color: #fca5a5 !important;
}
html.dark .bootstrap-table .btn.delete-selected:hover,
html.dark .bootstrap-table .action_delete_site_inspection .btn:hover {
    background: rgba(220, 38, 38, .22) !important;
    border-color: #f87171 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4) !important;
}
html.dark .bootstrap-table .btn.save-column-visibility,
html.dark .bootstrap-table .fixed-table-toolbar .columns-left .btn-outline-primary {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .bootstrap-table .btn.save-column-visibility:hover,
html.dark .bootstrap-table .fixed-table-toolbar .columns-left .btn-outline-primary:hover {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-faint) !important;
    color: var(--dm-text) !important;
}
html.dark .bootstrap-table .fixed-table-toolbar .columns-left .btn-outline-secondary {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .bootstrap-table .fixed-table-toolbar .columns-left .btn-outline-secondary:hover {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-faint) !important;
    color: var(--dm-text) !important;
}
html.dark .bootstrap-table .fixed-table-toolbar .search input,
html.dark .bootstrap-table .search-input {
    background-color: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .bootstrap-table .fixed-table-toolbar .search input:focus {
    background-color: var(--dm-surface) !important;
    border-color: var(--dm-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 142, 247, .18) !important;
}
html.dark .bootstrap-table .columns .dropdown-menu {
    box-shadow: var(--dm-shadow) !important;
}
html.dark .bootstrap-table .columns .dropdown-menu label { color: var(--dm-text-soft) !important; }
html.dark .bootstrap-table .columns .dropdown-menu label:hover { background: var(--dm-hover) !important; }
html.dark .bootstrap-table .fixed-table-container {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
}

/* ── bootstrap-table head + body cells — pro-tables.css hardcodes #fff
   with higher specificity than generic table rules ── */
html.dark .bootstrap-table .fixed-table-container .table {
    color: var(--dm-text-soft) !important;
}
html.dark .bootstrap-table .fixed-table-container .table thead th {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border-soft) !important;
    color: var(--dm-muted) !important;
}
html.dark .bootstrap-table .fixed-table-container .table thead th .th-inner.sortable:hover {
    color: var(--dm-text) !important;
}
html.dark .bootstrap-table .fixed-table-container .table tbody td {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .bootstrap-table .fixed-table-container .table tbody tr:hover td {
    background: var(--dm-surface-2) !important;
}
/* ── Supplier schedules table (.sched-table hardcodes light cells + pills) ── */
html.dark .sched-table { color: var(--dm-text-soft) !important; }
html.dark .sched-table thead th {
    background: var(--dm-surface-2) !important;
    border-bottom-color: var(--dm-border-soft) !important;
    color: var(--dm-muted) !important;
}
html.dark .sched-table tbody td {
    background: var(--dm-surface) !important;
    border-bottom-color: var(--dm-border-soft) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .sched-table tbody tr:hover td { background: var(--dm-surface-2) !important; }
html.dark .sched-avatar { background: rgba(79,142,247,.15) !important; color: #93c5fd !important; }
html.dark .sched-id { background: rgba(99,102,241,.15) !important; color: #a5b4fc !important; border-color: rgba(99,102,241,.35) !important; }
html.dark .sched-type { background: rgba(56,189,248,.12) !important; color: #7dd3fc !important; border-color: rgba(56,189,248,.35) !important; }
html.dark .sched-date { background: var(--dm-surface-2) !important; color: var(--dm-text-soft) !important; border-color: var(--dm-border) !important; }
html.dark .sched-time { color: var(--dm-muted) !important; }
html.dark .sched-slot b { color: var(--dm-text) !important; }
html.dark .sched-active-on { background: rgba(34,197,94,.15) !important; color: #86efac !important; border-color: rgba(34,197,94,.35) !important; }
html.dark .sched-active-off { background: var(--dm-surface-2) !important; color: var(--dm-muted) !important; border-color: var(--dm-border) !important; }
html.dark .pro-action-view { background: var(--dm-surface-2) !important; color: var(--dm-text-soft) !important; }
html.dark .pro-action-view:hover {
    background: #737373 !important;border-color: #737373 !important;color: #fff !important;
    transform: translateY(-1px);box-shadow: 0 6px 14px rgba(0,0,0,.4) !important;
}
/* Row action pills + icon buttons (pro-tables.css hardcodes light fills) */
html.dark .pro-actions { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; }
html.dark .pro-action-edit { background: rgba(79,142,247,.15) !important; color: #93c5fd !important; }
html.dark .pro-action-delete { background: rgba(220,38,38,.14) !important; color: #fca5a5 !important; }
html.dark .pro-action:focus-visible { box-shadow: 0 0 0 3px rgba(79,142,247,.35) !important; }
html.dark .bootstrap-table tbody td:last-child a { background: rgba(79,142,247,.15) !important; color: #93c5fd !important; }
html.dark .bootstrap-table tbody td:last-child button.delete { background: rgba(220,38,38,.14) !important; }
html.dark .bootstrap-table tbody td:last-child .pro-actions button:not(.delete) { color: var(--dm-text-soft) !important; }
html.dark .bootstrap-table tbody td:last-child .pro-actions button:not(.delete):hover {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,.4) !important;
}
html.dark .bootstrap-table tbody td:last-child button.delete i { color: #f87171 !important; }
html.dark .bootstrap-table td[data-field="id"],
html.dark .bootstrap-table th:first-child .th-inner {
    color: var(--dm-text) !important;
}
/* Sort chips — dark variants of the pro-tables data-URI icons */
html.dark .bootstrap-table .fixed-table-container thead th .both {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 22 22' fill='none'%3E%3Crect x='0.75' y='0.75' width='20.5' height='20.5' rx='6.5' fill='%23383838' stroke='%234a4a4a'/%3E%3Cpath d='M8 14.5v-7M5.8 9.7L8 7.5l2.2 2.2' stroke='%238e8e8e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 7.5v7M11.8 12.3l2.2 2.2 2.2-2.2' stroke='%238e8e8e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
html.dark .bootstrap-table .fixed-table-container thead th .asc {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 22 22' fill='none'%3E%3Crect x='0.75' y='0.75' width='20.5' height='20.5' rx='6.5' fill='%23383838' stroke='%234a4a4a'/%3E%3Cpath d='M8 14.5v-7M5.8 9.7L8 7.5l2.2 2.2' stroke='%234f8ef7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 7.5v7M11.8 12.3l2.2 2.2 2.2-2.2' stroke='%23525252' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
html.dark .bootstrap-table .fixed-table-container thead th .desc {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 22 22' fill='none'%3E%3Crect x='0.75' y='0.75' width='20.5' height='20.5' rx='6.5' fill='%23383838' stroke='%234a4a4a'/%3E%3Cpath d='M8 14.5v-7M5.8 9.7L8 7.5l2.2 2.2' stroke='%23525252' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 7.5v7M11.8 12.3l2.2 2.2 2.2-2.2' stroke='%234f8ef7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
html.dark div.select-bg-label-dark { background: linear-gradient(180deg,#020617,#0f172a) !important; color: #ececec !important; }

/* ── Kanban / notes / misc widgets ── */
html.dark .kanban-column .card { background: var(--dm-bg-soft) !important; }
html.dark .sticky-notes .sticky-note .sticky-content { box-shadow: 5px 5px 7px rgba(0,0,0,.5) !important; }
html.dark .fc { color: var(--dm-text-soft) !important; }
html.dark .fc .fc-col-header-cell, html.dark .fc .fc-daygrid-day, html.dark .fc-theme-standard td, html.dark .fc-theme-standard th { border-color: var(--dm-border-soft) !important; }
html.dark .fc .fc-daygrid-day-number { color: var(--dm-text-soft) !important; }
html.dark .fc .fc-toolbar-title { color: var(--dm-text) !important; }
html.dark .daterangepicker, html.dark .datetimepicker {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .daterangepicker .calendar-table { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; }
html.dark .daterangepicker td.available:hover, html.dark .daterangepicker th.available:hover { background: var(--dm-hover) !important; }
html.dark .daterangepicker td.off { background: transparent !important; color: var(--dm-faint) !important; }
html.dark .dropzone { background: var(--dm-input-bg) !important; border-color: var(--dm-border) !important; color: var(--dm-muted) !important; }
html.dark pre, html.dark code { color: var(--dm-text-soft) !important; }
html.dark .border, html.dark .border-top, html.dark .border-bottom,
html.dark .border-start, html.dark .border-end { border-color: var(--dm-border-soft) !important; }
html.dark .bg-white { background-color: var(--dm-surface) !important; }
html.dark .bg-light { background-color: var(--dm-surface-2) !important; }
html.dark ::-webkit-scrollbar { width: 10px; height: 10px; }
html.dark ::-webkit-scrollbar-track { background: var(--dm-bg); }
html.dark ::-webkit-scrollbar-thumb { background: var(--dm-surface-3); border-radius: 8px; }

/* ── Table scrollbars (bootstrap-table .fixed-table-body + .table-responsive):
   the global 10px #424242 thumb is too faint to find/grab at the bottom of
   wide tables, so tables get a thicker thumb with a hover state. ── */
html.dark .fixed-table-body,
html.dark .table-responsive {
    scrollbar-color: #5c5c5c var(--dm-bg-soft);
}
html.dark .fixed-table-body::-webkit-scrollbar,
html.dark .table-responsive::-webkit-scrollbar { height: 12px; width: 10px; }
html.dark .fixed-table-body::-webkit-scrollbar-track,
html.dark .table-responsive::-webkit-scrollbar-track { background: var(--dm-bg-soft); }
html.dark .fixed-table-body::-webkit-scrollbar-thumb,
html.dark .table-responsive::-webkit-scrollbar-thumb {
    background: #5c5c5c;
    border-radius: 8px;
    border: 2px solid var(--dm-bg-soft);
}
html.dark .fixed-table-body::-webkit-scrollbar-thumb:hover,
html.dark .table-responsive::-webkit-scrollbar-thumb:hover { background: #8e8e8e; }
html.dark .fixed-table-body::-webkit-scrollbar-corner,
html.dark .table-responsive::-webkit-scrollbar-corner { background: var(--dm-bg-soft); }

/* ── Auth / guest pages ── */
html.dark .login-hero, html.dark .login-right { background: var(--dm-bg) !important; }
html.dark .login-left { background: var(--dm-bg-soft) !important; }
html.dark .left-logo-wrap { background: var(--dm-surface) !important; box-shadow: 0 8px 24px rgba(0,0,0,.4) !important; }
html.dark .left-logo { filter: grayscale(1) contrast(2.5) invert(1); }
html.dark .login-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    color: var(--dm-text) !important;
}
html.dark .left-content, html.dark .left-title, html.dark .login-title, html.dark .login-brand-name { color: var(--dm-text) !important; }
html.dark .left-title {
    background: linear-gradient(135deg, #93c5fd, #4f8ef7) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
html.dark .left-sub, html.dark .login-sub { color: var(--dm-muted) !important; }
html.dark .login-label { color: var(--dm-text) !important; }
html.dark .feature-list li { color: var(--dm-text-soft) !important; }
html.dark .login-input {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .login-input:focus { background: var(--dm-surface) !important; }
html.dark .login-brand img { filter: grayscale(1) contrast(2.5) invert(1) !important; }
html.dark .authentication-wrapper .authentication-inner { color: var(--dm-text) !important; }

/* ── Admin dashboard (dashboard_admin.blade.php: no outer card; rules below
   cover the inner cards/tiles only) ── */
html.dark .admin-dashboard .modern-card {
    border-color: var(--dm-border-soft) !important;
    box-shadow: 0 12px 26px rgba(0,0,0,.35) !important;
}
html.dark .dashboard-tiles .tile-label,
html.dark .task-overview-card .metric-label { color: var(--dm-muted) !important; }

/* Overview cards */
html.dark .ov-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    box-shadow: 0 4px 28px rgba(0,0,0,.4) !important;
}
html.dark .ov-header { background: var(--dm-surface) !important; }
html.dark .ov-header-title { color: var(--dm-text) !important; }
html.dark .ov-header-sub { color: var(--dm-muted) !important; }
html.dark .ov-header-badge { background: var(--dm-surface-2) !important; color: var(--dm-text-soft) !important; }
html.dark .ov-header-icon { background: var(--dm-surface-2) !important; }
html.dark .ov-header-icon i { color: var(--dm-muted) !important; }
html.dark .ov-footer { border-color: var(--dm-border-soft) !important; }
html.dark .ov-stat-item { background: var(--dm-surface-2) !important; }
html.dark .ov-stat-label,
html.dark .ov-mini-item-meta,
html.dark .ov-progress-label,
html.dark .ov-priority-name,
html.dark .ov-kpi-label,
html.dark .ov-kpi-strip-label { color: var(--dm-muted) !important; }
html.dark .ov-stat-value,
html.dark .ov-mini-item-title,
html.dark .ov-priority-count,
html.dark .ov-kpi-value,
html.dark .ov-supplier-name,
html.dark .ov-kpi-strip-value { color: var(--dm-text) !important; }
html.dark .ov-stat-item.is-blue .ov-stat-value { color: #60a5fa !important; }
html.dark .ov-stat-item.is-green .ov-stat-value { color: #34d399 !important; }
html.dark .ov-stat-item.is-orange .ov-stat-value { color: #fb923c !important; }
html.dark .ov-stat-item.is-pink .ov-stat-value { color: #f472b6 !important; }
html.dark .ov-stat-item.is-slate .ov-stat-value { color: var(--dm-muted) !important; }
html.dark .ov-stat-item.is-red .ov-stat-value { color: #f87171 !important; }
html.dark .ov-kpi-value.is-amber { color: #fbbf24 !important; }
html.dark .ov-kpi-value.is-sky { color: #38bdf8 !important; }
html.dark .ov-mini-item { background: var(--dm-surface-2) !important; border-left-color: var(--dm-border) !important; }
html.dark .ov-inspection-row { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; }
html.dark .ov-inspection-row-title { color: var(--dm-text) !important; }
html.dark .ov-inspection-row-meta { color: var(--dm-muted) !important; }
html.dark .ov-inspection-row-id { color: #2dd4bf !important; background: rgba(45,212,191,.12) !important; }
html.dark .ov-priority-track,
html.dark .ov-progress-track { background: var(--dm-surface-3) !important; }
html.dark .ov-priority-pct { color: var(--dm-faint) !important; }
html.dark .ov-supplier-table th { color: var(--dm-muted) !important; border-color: var(--dm-border-soft) !important; }
html.dark .ov-supplier-table td { border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .ov-supplier-payable { color: #f87171 !important; }
html.dark .ov-supplier-paid { color: #34d399 !important; }
html.dark .ov-kpi-strip { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; }
html.dark .ov-kpi-strip-item { border-color: var(--dm-border) !important; }
html.dark .supplier-total-badge { background: var(--dm-surface-2) !important; color: var(--dm-text-soft) !important; }
html.dark .supplier-total-badge.due { background: rgba(248,113,113,.18) !important; color: #fca5a5 !important; }
html.dark .supplier-total-badge.paid { background: rgba(34,197,94,.18) !important; color: #86efac !important; }

/* Charge / complaint / inspection overview panels */
html.dark .groundcharge-overview,
html.dark .servicecharge-overview,
html.dark .complaints-overview {
    background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01)) !important;
    border-color: var(--dm-border-soft) !important;
}
html.dark .groundcharge-overview .overview-label,
html.dark .servicecharge-overview .overview-label,
html.dark .complaints-overview .overview-label,
html.dark .inspection-overview .overview-label,
html.dark .overview-mini-card .overview-label { color: var(--dm-muted) !important; }
html.dark .groundcharge-overview .overview-value,
html.dark .servicecharge-overview .overview-value,
html.dark .complaints-overview .overview-value,
html.dark .overview-mini-card .overview-value { color: var(--dm-text) !important; }
html.dark .groundcharge-chip,
html.dark .servicecharge-chip,
html.dark .complaint-chip,
html.dark .complaint-priority-chip {
    background: var(--dm-surface-2) !important;
    color: var(--dm-text-soft) !important;
    box-shadow: 0 8px 18px rgba(0,0,0,.4) !important;
}
html.dark .inspection-overview,
html.dark .overview-mini-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    box-shadow: 0 12px 24px rgba(0,0,0,.35) !important;
}
html.dark .inspection-item,
html.dark .overview-mini-item { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; }
html.dark .overview-mini-item .item-title { color: var(--dm-text) !important; }
html.dark .overview-mini-item .item-meta,
html.dark .inspection-date { color: var(--dm-muted) !important; }

/* Yapily balance card */
html.dark .yapily-header { background: var(--dm-surface) !important; }
html.dark .yapily-body,
html.dark .yapily-error-body { background: var(--dm-surface) !important; }
html.dark .yapily-chip { background: var(--dm-surface-2) !important; color: var(--dm-text-soft) !important; }
html.dark .yapily-chip i { color: var(--dm-faint) !important; }
html.dark .yapily-amount,
html.dark .yapily-account-card-name { color: var(--dm-text) !important; }
html.dark .yapily-as-of,
html.dark .yapily-account-card-meta,
html.dark .yapily-multi-label { color: var(--dm-muted) !important; }
html.dark .yapily-account-card { background: var(--dm-surface-2) !important; }
html.dark .yapily-account-card-balance { color: #38bdf8 !important; }
html.dark .yapily-error-title { color: var(--dm-text-soft) !important; }
html.dark .yapily-error-sub { color: var(--dm-muted) !important; }
html.dark .yapily-refresh-hint { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-muted) !important; }
html.dark .yapily-consent-badge.is-unknown { background: var(--dm-surface-2) !important; color: var(--dm-muted) !important; border-color: var(--dm-border) !important; }
html.dark .yapily-consent-badge.is-valid { background: rgba(34,197,94,.15) !important; color: #86efac !important; border-color: rgba(34,197,94,.35) !important; }
html.dark .yapily-consent-badge.is-warning { background: rgba(245,158,11,.15) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.35) !important; }
html.dark .yapily-consent-badge.is-danger { background: rgba(248,113,113,.15) !important; color: #fca5a5 !important; border-color: rgba(248,113,113,.35) !important; }

/* Income overview card */
html.dark .io-card {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
    box-shadow: 0 4px 32px rgba(0,0,0,.4) !important;
}
html.dark .io-header { background: var(--dm-surface) !important; }
html.dark .io-header-title { color: var(--dm-text) !important; }
html.dark .io-header-sub { color: var(--dm-muted) !important; }
html.dark .io-donut-hole { background: var(--dm-surface) !important; box-shadow: inset 0 2px 8px rgba(0,0,0,.4) !important; }
html.dark .io-donut-hole-amount,
html.dark .io-legend-val,
html.dark .io-cat-amount { color: var(--dm-text) !important; }
html.dark .io-donut-hole-label,
html.dark .io-legend-pct,
html.dark .io-section-label,
html.dark .io-cat-pct { color: var(--dm-muted) !important; }
html.dark .io-legend-name { color: var(--dm-text-soft) !important; }
html.dark .io-cat-card.io-received { background: var(--dm-surface-2) !important; }
html.dark .io-cat-card.io-outstanding { background: rgba(245,158,11,.08) !important; }
html.dark .io-cat-name { color: var(--dm-muted) !important; }

/* Summary stat cards + action buttons */
html.dark .stat-card { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .stat-card-value { color: var(--dm-text) !important; }
html.dark .stat-card-label,
html.dark .stat-card-sub { color: var(--dm-muted) !important; }
html.dark .dashboard-actions { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: none !important; }
html.dark .dashboard-actions .btn-outline-primary { border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; }
html.dark .dashboard-actions .btn-outline-primary:hover { background: var(--dm-hover) !important; border-color: var(--dm-faint) !important; color: var(--dm-text) !important; box-shadow: none !important; }
html.dark .dashboard-actions .btn-outline-secondary { border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; }
html.dark .dashboard-actions .btn-outline-secondary:hover { background: var(--dm-hover) !important; color: var(--dm-text) !important; }
html.dark .dashboard-actions .btn-outline-info { border-color: rgba(56,189,248,.4) !important; color: #38bdf8 !important; }
html.dark .dashboard-actions .btn-outline-info:hover { background: rgba(56,189,248,.12) !important; color: #7dd3fc !important; }
/* Account type segmented control (auth pages): light track/pill would glare on dark card */
html.dark .account-toggle { background: var(--dm-surface-2) !important; }
html.dark .account-toggle label { color: var(--dm-muted) !important; }
html.dark .account-toggle input:checked + label {
    background: var(--dm-surface-3) !important;
    color: #93c5fd !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.4) !important;
}

/* ── Charts ── */
html.dark .apexcharts-tooltip { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
html.dark .apexcharts-tooltip-title { background: var(--dm-surface-3) !important; border-color: var(--dm-border-soft) !important; }
html.dark .apexcharts-legend-text { color: var(--dm-muted) !important; }

/* ═══════════════════════════════════════════════════════════════════
   Global catch-alls + shared patterns (filter panels, settings,
   compliance cards, pilot inspection). Per-page <style> blocks load
   after this file — html.dark prefix out-specifies their selectors.
   ═══════════════════════════════════════════════════════════════════ */

/* Inline near-black text (headings/titles) would vanish on dark cards */
html.dark [style*="color:#0f172a"] { color: var(--dm-text) !important; }
/* Inline pale card-body fills (pilot question/history/metrics panels) */
html.dark #questions_container { background: transparent !important; }
html.dark .card-body[style*="background:#f8fafc"] { background: transparent !important; }

html.dark .form-text { color: var(--dm-muted) !important; }

/* ── Alert variants (core.css hardcodes pastel fills) ── */
html.dark .alert-secondary { background-color: #333333 !important; border-color: #424242 !important; color: #ececec !important; }
html.dark .alert-success { background-color: rgba(22,163,74,.16) !important; border-color: rgba(34,197,94,.35) !important; color: #86efac !important; }
html.dark .alert-info { background-color: rgba(3,195,236,.12) !important; border-color: rgba(34,211,238,.35) !important; color: #67e8f9 !important; }
html.dark .alert-warning { background-color: rgba(217,119,6,.14) !important; border-color: rgba(245,158,11,.35) !important; color: #fcd34d !important; }
html.dark .alert-danger { background-color: rgba(220,38,38,.14) !important; border-color: rgba(248,113,113,.4) !important; color: #fca5a5 !important; }
html.dark .alert-primary { background-color: var(--dm-primary-soft) !important; border-color: rgba(79,142,247,.4) !important; color: #93c5fd !important; }
html.dark .alert-dark { background-color: #020617 !important; border-color: #333333 !important; color: #ececec !important; }
html.dark .alert .alert-link { color: inherit !important; }
html.dark .alert .btn-close { filter: none !important; opacity: .75 !important; }

/* ── Filter panel (clients + shared .filter-panel) ── */
html.dark .filter-panel { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .filter-panel .filter-label { color: var(--dm-muted) !important; }
html.dark .filter-panel .filter-ico-status { background: var(--dm-primary-soft) !important; color: var(--dm-primary) !important; }
html.dark .filter-panel .filter-ico-type,
html.dark .filter-panel .filter-ico-from { background: rgba(217,119,6,.18) !important; color: #fbbf24 !important; }
html.dark .filter-panel .filter-ico-block,
html.dark .filter-panel .filter-ico-to { background: rgba(14,165,233,.16) !important; color: #38bdf8 !important; }
html.dark .filter-panel .form-control {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .filter-panel .form-control:focus { border-color: var(--dm-primary) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important; }
html.dark .filter-panel .select2.select2-container.select2-container--default {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
}
html.dark .filter-panel .select2-container--default.select2-container--focus { border-color: var(--dm-primary) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important; }

/* ── In-card filter rows — pro-tables.css paints
   `.card.pro-table-card .card-body > .row .form-control/.form-select` and
   select2 selections #fff with (0,5,0); out-specify it here ── */
html.dark .card.pro-table-card .card-body > .row .form-control,
html.dark .card.pro-table-card .card-body > .row .form-select,
html.dark .card.supplier-table-card .card-body > .row .form-control,
html.dark .card.supplier-table-card .card-body > .row .form-select {
    background-color: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .card.pro-table-card .card-body > .row .form-control:focus,
html.dark .card.pro-table-card .card-body > .row .form-select:focus,
html.dark .card.supplier-table-card .card-body > .row .form-control:focus,
html.dark .card.supplier-table-card .card-body > .row .form-select:focus {
    border-color: var(--dm-primary) !important;
    box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important;
    outline: none !important;
}
html.dark .card.pro-table-card .card-body > .row .form-select option,
html.dark .card.supplier-table-card .card-body > .row .form-select option {
    background: var(--dm-surface-2) !important;
    color: var(--dm-text) !important;
}
html.dark .card.pro-table-card .card-body > .row .select2-selection--single,
html.dark .card.pro-table-card .card-body > .row .select2-selection--multiple,
html.dark .card.supplier-table-card .card-body > .row .select2-selection--single,
html.dark .card.supplier-table-card .card-body > .row .select2-selection--multiple {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
}

/* ── Complaints filter panel (.cmp-filters hardcodes #f8fafc/#fff light surfaces) ── */
html.dark .cmp-filters { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .cmp-filters .input-group-merge .input-group-text {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-muted) !important;
}
html.dark .cmp-filters .form-control {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .cmp-filters .form-control:focus { border-color: var(--dm-primary) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important; }
html.dark .cmp-filters .select2.select2-container.select2-container--default {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
}
html.dark .cmp-filter-label { color: var(--dm-muted) !important; }
html.dark .cmp-filter-label i { color: var(--dm-muted) !important; }

/* ── Service charges filter panels (.sc-filter-panel hardcodes #f8fafc light) ── */
html.dark .sc-filter-panel { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .sc-filter-label { color: var(--dm-muted) !important; }
html.dark .sc-filter-panel .form-select,
html.dark .sc-filter-panel .form-control { background-color: var(--dm-input-bg) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
html.dark .sc-filter-panel .form-select:focus,
html.dark .sc-filter-panel .form-control:focus { border-color: var(--dm-primary) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important; }
html.dark .sc-filter-panel .form-select option { background: var(--dm-surface-2) !important; color: var(--dm-text) !important; }
html.dark .sc-filter-panel .btn-outline-dark { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; }
html.dark .sc-filter-panel .btn-outline-dark:hover { background: var(--dm-surface-3) !important; color: var(--dm-text) !important; }
html.dark .sc-filter-panel .btn-outline-success { background: rgba(22,163,74,.15) !important; border-color: rgba(34,197,94,.4) !important; color: #86efac !important; }
html.dark .sc-filter-panel .btn-outline-warning { background: rgba(217,119,6,.15) !important; border-color: rgba(245,158,11,.4) !important; color: #fcd34d !important; }
html.dark .sc-filter-panel .btn-outline-danger { background: rgba(220,38,38,.15) !important; border-color: rgba(248,113,113,.4) !important; color: #fca5a5 !important; }
html.dark .sc-filter-panel .btn-outline-info { background: rgba(14,165,233,.15) !important; border-color: rgba(56,189,248,.4) !important; color: #7dd3fc !important; }
html.dark .sc-filter-panel .badge.bg-white { background: transparent !important; color: inherit !important; box-shadow: none !important; display: inline-flex; align-items: center; line-height: 1; }

/* ── Clients assigned mini stat cards (.assign-stat hardcodes #f8fafc light) ── */
html.dark .assign-stat { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; }
html.dark .assign-stat:hover { background: var(--dm-surface-3) !important; box-shadow: 0 6px 14px rgba(0,0,0,.4) !important; }
html.dark .assign-stat:hover .assign-count { color: var(--dm-text) !important; }
html.dark .assign-parcel .assign-ico { background: rgba(79,142,247,.2) !important; color: #93c5fd !important; }
html.dark .assign-key .assign-ico { background: rgba(217,119,6,.2) !important; color: #fcd34d !important; }
html.dark .assign-complaint .assign-ico { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .assign-count { color: var(--dm-text) !important; }
html.dark .assign-label { color: var(--dm-muted) !important; }

/* ── Settings panels (shared settings-polish.css) ── */
html.dark .settings-panel { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .settings-panel--amber { background: linear-gradient(180deg, rgba(217,119,6,.14), var(--dm-surface)) !important; border-color: rgba(245,158,11,.35) !important; }
html.dark .settings-panel--blue { background: linear-gradient(180deg, rgba(37,99,235,.14), var(--dm-surface)) !important; border-color: rgba(79,142,247,.35) !important; }
html.dark .settings-panel--violet { background: linear-gradient(180deg, rgba(79,70,229,.16), var(--dm-surface)) !important; border-color: rgba(129,140,248,.35) !important; }
html.dark .settings-panel--teal { background: linear-gradient(180deg, rgba(14,165,233,.14), var(--dm-surface)) !important; border-color: rgba(34,211,238,.3) !important; }
html.dark .settings-panel--rose { background: linear-gradient(180deg, rgba(244,63,94,.14), var(--dm-surface)) !important; border-color: rgba(251,113,133,.35) !important; }
html.dark .settings-panel .form-label { color: var(--dm-text-soft) !important; }
html.dark .settings-info {
    border-color: rgba(34,211,238,.35) !important;
    background: linear-gradient(180deg, rgba(3,195,236,.12), var(--dm-surface)) !important;
    color: var(--dm-text-soft) !important;
}
html.dark .settings-intro h5 { color: var(--dm-text) !important; }
html.dark .settings-intro p { color: var(--dm-muted) !important; }
html.dark .settings-intro-ico--slate { color: var(--dm-text-soft) !important; background: var(--dm-surface-3) !important; }
html.dark .settings-steps li { color: var(--dm-text-soft) !important; }
html.dark .email-chip { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; box-shadow: none !important; }
html.dark .email-chip .email-chip-x { background: var(--dm-surface-3) !important; color: var(--dm-muted) !important; }
html.dark .email-chip .email-chip-x:hover { background: rgba(220,38,38,.22) !important; color: #fca5a5 !important; }
html.dark .email-chip--invalid { border-color: rgba(248,113,113,.5) !important; background: rgba(220,38,38,.14) !important; color: #fca5a5 !important; }
/* Reply-To behaviour card (workspace_email_settings.blade.php) */
html.dark .replyto-wrap { background: linear-gradient(135deg, rgba(14,165,233,.10), rgba(14,165,233,.04), var(--dm-surface)) !important; }
html.dark .replyto-badge { background: rgba(34,211,238,.12) !important; color: #67e8f9 !important; border-color: rgba(34,211,238,.35) !important; }
html.dark .replyto-step { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 2px 8px rgba(0,0,0,.35) !important; }
html.dark .replyto-step--accent-cyan { border-color: rgba(34,211,238,.4) !important; }
html.dark .replyto-step--accent-green { border-color: rgba(34,197,94,.4) !important; }
html.dark .replyto-step b { color: var(--dm-text) !important; }
html.dark .replyto-step span { color: var(--dm-muted) !important; }
html.dark .replyto-arrow { color: var(--dm-faint) !important; }
html.dark .replyto-step .step-ico--blue { background: rgba(79,142,247,.15) !important; color: #93c5fd !important; }
html.dark .replyto-step .step-ico--green { background: rgba(34,197,94,.15) !important; color: #86efac !important; }
/* Shared settings intro icon tiles: brighten hues that go muddy on dark */
html.dark .settings-intro-ico--amber { color: #fbbf24 !important; }
html.dark .settings-intro-ico--blue { color: #60a5fa !important; background: rgba(79,142,247,.15) !important; }
html.dark .settings-intro-ico--violet { color: #a5b4fc !important; }
html.dark .settings-intro-ico--teal { color: #2dd4bf !important; }
html.dark .settings-intro-ico--rose { color: #fb7185 !important; }

/* ── Compliance certificates ── */
html.dark .cc-hero {
    background: linear-gradient(135deg, rgba(16,185,129,.14), rgba(5,150,105,.08), var(--dm-surface)) !important;
    border-color: rgba(16,185,129,.3) !important;
    box-shadow: 0 18px 35px rgba(0,0,0,.4) !important;
}
html.dark .cc-stat-card { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 4px 18px rgba(0,0,0,.4) !important; }
html.dark .cc-stat-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.5) !important; }
html.dark .cc-stat-card--expired { background: linear-gradient(135deg, rgba(220,38,38,.22) 0%, var(--dm-surface) 65%) !important; }
html.dark .cc-stat-card--exp30 { background: linear-gradient(135deg, rgba(217,119,6,.20) 0%, var(--dm-surface) 65%) !important; }
html.dark .cc-stat-card--exp90 { background: linear-gradient(135deg, rgba(234,88,12,.20) 0%, var(--dm-surface) 65%) !important; }
html.dark .cc-stat-card--active { background: linear-gradient(135deg, rgba(5,150,105,.20) 0%, var(--dm-surface) 65%) !important; }
html.dark .cc-stat-label { color: var(--dm-muted) !important; }
html.dark .cc-stat-value { color: var(--dm-text) !important; }
html.dark .cc-stat-value[style*="#dc2626"] { color: #f87171 !important; }
html.dark .cc-stat-sub { color: var(--dm-muted) !important; }
html.dark .cc-filter-card { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 14px 28px rgba(0,0,0,.4) !important; }
html.dark .cc-filter-title { color: var(--dm-text) !important; }
html.dark .cc-filter-sub { color: var(--dm-muted) !important; }
html.dark .cc-field label { color: var(--dm-muted) !important; }
html.dark .cc-field .form-select { background-color: var(--dm-input-bg) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
html.dark .cc-field .form-select:hover { border-color: var(--dm-primary) !important; background-color: var(--dm-surface-2) !important; }
html.dark .cc-field .form-select:focus { border-color: var(--dm-primary) !important; background-color: var(--dm-surface-2) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important; }
html.dark .cc-field .form-select.is-set { border-color: rgba(52,211,153,.5) !important; background-color: rgba(5,150,105,.18) !important; color: #6ee7b7 !important; }
html.dark .cc-result-badge { background: rgba(5,150,105,.16) !important; color: #6ee7b7 !important; border-color: rgba(52,211,153,.4) !important; }
html.dark .cc-table-card { border-color: var(--dm-border-soft) !important; box-shadow: 0 14px 28px rgba(0,0,0,.4) !important; }

/* ══ Pilot daily inspection ══ */
html.dark .cat-search-wrap { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; }
html.dark .cat-search-wrap:focus-within { background: var(--dm-surface) !important; border-color: var(--dm-primary) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important; }
html.dark #inspection_date,
html.dark #inspection_date:focus,
html.dark #inspection_date[readonly],
html.dark #inspection_date.flatpickr-input.active {
    background: var(--dm-input-bg) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
    box-shadow: none !important;
}
html.dark #pdi_date_icon { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; }

/* flatpickr popup */
html.dark .flatpickr-calendar { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; box-shadow: 0 20px 50px rgba(0,0,0,.6) !important; }
html.dark .flatpickr-months { background: var(--dm-surface-3) !important; border-color: var(--dm-border-soft) !important; }
html.dark .flatpickr-current-month .flatpickr-monthDropdown-months,
html.dark .flatpickr-current-month .pdi-year-select {
    background-color: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}
html.dark .flatpickr-current-month .flatpickr-monthDropdown-months option,
html.dark .flatpickr-current-month .pdi-year-select option,
html.dark .flatpickr-current-month .flatpickr-monthDropdown-months optgroup { background: var(--dm-surface-2) !important; color: var(--dm-text) !important; }
html.dark .flatpickr-current-month input.cur-year { color: var(--dm-text) !important; }
html.dark .flatpickr-months .flatpickr-prev-month,
html.dark .flatpickr-months .flatpickr-next-month { background: var(--dm-surface) !important; border-color: var(--dm-border) !important; color: var(--dm-muted) !important; }
html.dark .flatpickr-months .flatpickr-prev-month svg,
html.dark .flatpickr-months .flatpickr-next-month svg { fill: var(--dm-muted) !important; }
html.dark .flatpickr-weekdays { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; }
html.dark span.flatpickr-weekday { color: var(--dm-faint) !important; }
html.dark .flatpickr-day { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .flatpickr-day:hover { background: var(--dm-hover) !important; border-color: var(--dm-primary) !important; color: var(--dm-primary) !important; }
html.dark .flatpickr-day.prevMonthDay,
html.dark .flatpickr-day.nextMonthDay { background: transparent !important; border-color: transparent !important; color: var(--dm-faint) !important; }
html.dark .flatpickr-day.today { background: var(--dm-primary-soft) !important; border-color: var(--dm-primary) !important; color: var(--dm-primary) !important; box-shadow: inset 0 0 0 1px var(--dm-primary) !important; }
html.dark .flatpickr-day.pdi-day-done { background: rgba(22,163,74,.22) !important; border-color: rgba(34,197,94,.45) !important; color: #86efac !important; }
html.dark .flatpickr-day.pdi-day-done:hover { background: rgba(22,163,74,.32) !important; border-color: #22c55e !important; color: #86efac !important; }
html.dark .flatpickr-day.pdi-day-draft { background: rgba(217,119,6,.22) !important; border-color: rgba(245,158,11,.5) !important; color: #fcd34d !important; }
html.dark .flatpickr-day.pdi-day-draft:hover { background: rgba(217,119,6,.32) !important; border-color: #f59e0b !important; }
html.dark .flatpickr-day.pdi-day-pending { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .flatpickr-day.pdi-day-pending:hover { background: var(--dm-hover) !important; border-color: var(--dm-primary) !important; color: var(--dm-primary) !important; }
html.dark .pdi-cal-legend { background: var(--dm-surface-3) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-muted) !important; }
html.dark .pdi-cal-legend span { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; }

/* Tabs + stat pills */
html.dark #pdi-tabs { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 2px 8px rgba(0,0,0,.4) !important; }
html.dark #pdi-tabs .nav-link { color: var(--dm-muted) !important; background: transparent !important; }
html.dark #pdi-tabs .nav-link:hover { color: var(--dm-text) !important; background: var(--dm-hover) !important; }
html.dark #pdi-tabs .nav-link.active { background: var(--dm-surface-3) !important; color: var(--dm-primary) !important; box-shadow: inset 0 0 0 1px var(--dm-border) !important; }
html.dark .pdi-stat--yes { background: rgba(22,163,74,.18) !important; color: #86efac !important; }
html.dark .pdi-stat--no { background: rgba(220,38,38,.18) !important; color: #fca5a5 !important; }
html.dark .pdi-stat--skip { background: var(--dm-surface-3) !important; color: var(--dm-muted) !important; }
html.dark .pdi-status-pill.is-pending { background: rgba(217,119,6,.18) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.4) !important; }
html.dark .pdi-status-pill.is-failed { background: rgba(220,38,38,.18) !important; color: #fca5a5 !important; border-color: rgba(248,113,113,.45) !important; }
html.dark .pdi-status-pill.is-passed { background: rgba(22,163,74,.18) !important; color: #86efac !important; border-color: rgba(34,197,94,.4) !important; }
html.dark .pdi-status-draft { background: rgba(217,119,6,.18) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.4) !important; }
html.dark .pdi-status-finalized { background: rgba(22,163,74,.18) !important; color: #86efac !important; border-color: rgba(34,197,94,.4) !important; }
html.dark .pdi-dist { background: var(--dm-surface-3) !important; }
html.dark .pdi-dist--skip { background: var(--dm-faint) !important; }

/* Question cards */
html.dark .question-item { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 2px 8px rgba(0,0,0,.4) !important; }
html.dark .question-item:hover { box-shadow: 0 6px 18px rgba(0,0,0,.5) !important; }
html.dark .question-item[data-answer="yes"] { background: rgba(22,163,74,.07) !important; }
html.dark .question-item[data-answer="no"] { background: rgba(220,38,38,.07) !important; }
html.dark .question-item[data-answer="skip"] { background: var(--dm-bg-soft) !important; }
html.dark .question-item.prev-failed { background: rgba(220,38,38,.08) !important; }
html.dark .question-item .q-title { color: var(--dm-text) !important; }
html.dark .q-code { color: var(--dm-muted) !important; background: var(--dm-surface-3) !important; }
html.dark .question-priority-badge.bg-danger { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .question-priority-badge.bg-warning { background: rgba(217,119,6,.2) !important; color: #fcd34d !important; }
html.dark .question-priority-badge.bg-success { background: rgba(22,163,74,.2) !important; color: #86efac !important; }
html.dark .pdi-answers { background: var(--dm-bg) !important; border-color: var(--dm-border-soft) !important; }
html.dark .pdi-answers .btn { color: var(--dm-muted) !important; background: transparent !important; }
html.dark .pdi-answers .btn:hover { color: var(--dm-text) !important; background: var(--dm-surface-3) !important; }
html.dark .pdi-cat-group {
    color: var(--dm-primary) !important;
    background: linear-gradient(90deg, var(--dm-primary-soft), var(--dm-surface)) !important;
    border-color: var(--dm-border) !important;
    border-left-color: var(--dm-primary) !important;
}

/* Previously-failed evidence block */
html.dark .pdi-prevfail { border-color: rgba(248,113,113,.4) !important; background: linear-gradient(180deg, rgba(220,38,38,.12), var(--dm-surface)) !important; }
html.dark .pdi-prevfail-ic { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .pdi-prevfail-title { color: #fca5a5 !important; }
html.dark .pdi-prevfail-date { color: var(--dm-text-soft) !important; background: var(--dm-surface-3) !important; }
html.dark .pdi-prevfail-note { color: #fca5a5 !important; background: rgba(220,38,38,.12) !important; }
html.dark .pdi-prevfail-files-label { color: #fca5a5 !important; }
html.dark .pdi-prevfail-files a img { border-color: rgba(248,113,113,.4) !important; }

/* Filter chips + hint */
html.dark .pdi-filters .btn { border-color: var(--dm-border) !important; background: var(--dm-surface-2) !important; color: var(--dm-muted) !important; }
html.dark .pdi-filters .btn i { background: var(--dm-faint) !important; }
html.dark .pdi-filters .btn[data-filter="priority_high"].active { background: rgba(220,38,38,.18) !important; border-color: rgba(248,113,113,.5) !important; color: #fca5a5 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.14) !important; }
html.dark .pdi-filters .btn[data-filter="priority_medium"].active { background: rgba(217,119,6,.18) !important; border-color: rgba(245,158,11,.45) !important; color: #fcd34d !important; box-shadow: 0 0 0 3px rgba(217,119,6,.14) !important; }
html.dark .pdi-filters .btn[data-filter="priority_low"].active { background: rgba(22,163,74,.18) !important; border-color: rgba(34,197,94,.45) !important; color: #86efac !important; box-shadow: 0 0 0 3px rgba(22,163,74,.14) !important; }
html.dark .pdi-filters .btn[data-filter="prev_failed"].active,
html.dark .pdi-filters .btn[data-filter="answered_no"].active { background: rgba(220,38,38,.2) !important; border-color: #f87171 !important; color: #fca5a5 !important; }
html.dark .pdi-filters .btn[data-filter="skipped"].active { background: var(--dm-surface-3) !important; border-color: var(--dm-faint) !important; color: var(--dm-text) !important; }
html.dark .pdi-filters .btn[data-filter="unanswered"].active { background: rgba(245,158,11,.18) !important; border-color: #f59e0b !important; color: #fcd34d !important; }
html.dark .pdi-hint { color: var(--dm-text-soft) !important; background: var(--dm-primary-soft) !important; border-color: rgba(79,142,247,.35) !important; }
html.dark .pdi-hint b { color: var(--dm-text) !important; }
html.dark .pdi-cat-pill { color: var(--dm-primary) !important; background: var(--dm-primary-soft) !important; border-color: rgba(79,142,247,.4) !important; }
html.dark .pdi-count-pill { color: var(--dm-text-soft) !important; background: var(--dm-surface-3) !important; border-color: var(--dm-border) !important; }

/* History accordion */
html.dark .pdi-hist .accordion-item { border-color: var(--dm-border-soft) !important; background: var(--dm-surface) !important; }
html.dark .pdi-hist .accordion-button { background: var(--dm-surface) !important; box-shadow: none !important; }
html.dark .pdi-hist .accordion-button:not(.collapsed) { background: var(--dm-surface-2) !important; }
html.dark .pdi-hist .accordion-button::after { background-color: var(--dm-surface-3) !important; }
html.dark .pdi-hist-date { color: var(--dm-text) !important; }
html.dark .pdi-hist-mini--y { background: rgba(22,163,74,.18) !important; color: #86efac !important; }
html.dark .pdi-hist-mini--n { background: rgba(220,38,38,.18) !important; color: #fca5a5 !important; }
html.dark .pdi-hist-mini--s { background: var(--dm-surface-3) !important; color: var(--dm-muted) !important; }

/* Category list */
html.dark .category-item { border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; background: var(--dm-surface) !important; }
html.dark .category-item:hover { border-color: var(--dm-primary) !important; background: var(--dm-hover) !important; box-shadow: 0 3px 10px rgba(0,0,0,.4) !important; }
html.dark .category-item.active { background: linear-gradient(135deg,#0065da,#1a8cff) !important; border-color: #4f8ef7 !important; color: #fff !important; box-shadow: 0 6px 16px rgba(0,101,218,.5), 0 0 0 2px rgba(79,142,247,.35) !important; }
html.dark .category-item.active .cat-title { color: #fff !important; }
html.dark .category-item.active .cat-avatar { background: rgba(255,255,255,.22) !important; color: #fff !important; }
html.dark .category-item.active .drag-handle { color: rgba(255,255,255,.7) !important; }

/* Overview table + priority tiles */
html.dark .pdi-ov-wrap { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .pdi-ov-table thead th { color: var(--dm-muted) !important; background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; }
html.dark .pdi-ov-table tbody td { border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .pdi-ov-table tbody tr:hover td { background: var(--dm-hover) !important; }
html.dark .pdi-ov-num--h { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .pdi-ov-num--m { background: rgba(217,119,6,.2) !important; color: #fcd34d !important; }
html.dark .pdi-ov-num--l { background: rgba(22,163,74,.2) !important; color: #86efac !important; }
html.dark .pdi-ov-age { color: var(--dm-text-soft) !important; background: var(--dm-surface-3) !important; }
html.dark .pdi-ov-age--hot { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .pdi-sum--h { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .pdi-sum--m { background: rgba(217,119,6,.2) !important; color: #fcd34d !important; }
html.dark .pdi-sum--l { background: rgba(22,163,74,.2) !important; color: #86efac !important; }
html.dark .pdi-prio-box { border-color: rgba(245,158,11,.4) !important; background: rgba(217,119,6,.1) !important; }
html.dark .pdi-prio { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .pdi-prio:hover { box-shadow: 0 5px 14px rgba(0,0,0,.45) !important; }
html.dark .pdi-prio--h .pdi-prio-ic { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .pdi-prio--m .pdi-prio-ic { background: rgba(217,119,6,.2) !important; color: #fcd34d !important; }
html.dark .pdi-prio--l .pdi-prio-ic { background: rgba(22,163,74,.2) !important; color: #86efac !important; }
html.dark .pdi-prio-lbl { color: var(--dm-muted) !important; }
html.dark .pdi-prio-num { color: var(--dm-text) !important; }
html.dark .pdi-prio-age.is-hot { color: #fca5a5 !important; }

/* Metrics + misc widgets */
html.dark .pdi-mfield label { color: var(--dm-muted) !important; }
html.dark .pdi-mfield select { background-color: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
html.dark .pdi-mfield select:hover { border-color: var(--dm-primary) !important; background-color: var(--dm-surface-3) !important; }
html.dark .pdi-mfield select:focus { border-color: var(--dm-primary) !important; background-color: var(--dm-surface-3) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important; }
html.dark .pdi-mfield select option { background: var(--dm-surface-2) !important; color: var(--dm-text) !important; }
html.dark .pdi-chart-box { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .pdi-actionbar { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 4px 16px rgba(0,0,0,.4) !important; }
html.dark .pdi-act-save,
html.dark .pdi-act-save:disabled {
    background: #737373 !important;
    background-image: none !important;
    border-color: #737373 !important;
    color: #fff !important;
    box-shadow: none !important;
    opacity: 1 !important;
}
html.dark .pdi-act-save:hover:not(:disabled) {
    background: #8a8a8a !important;
    border-color: #8a8a8a !important;
    color: #fff !important;
}
html.dark .pdi-act-sep { background: var(--dm-border-soft) !important; }
html.dark .pdi-save-state { color: var(--dm-muted) !important; background: var(--dm-surface-3) !important; border-color: var(--dm-border) !important; }
html.dark .pdi-save-state.is-saving { color: var(--dm-primary) !important; background: var(--dm-primary-soft) !important; border-color: rgba(79,142,247,.4) !important; }
html.dark .pdi-save-state.is-success { color: #86efac !important; background: rgba(22,163,74,.18) !important; border-color: rgba(34,197,94,.4) !important; }
html.dark .pdi-save-state.is-error { color: #fca5a5 !important; background: rgba(220,38,38,.18) !important; border-color: rgba(248,113,113,.45) !important; }
html.dark .pdi-field label { color: var(--dm-muted) !important; }
html.dark .pdi-field label small { color: var(--dm-faint) !important; }
html.dark .pdi-noextra { background: var(--dm-bg-soft) !important; border-color: var(--dm-border) !important; }
html.dark .pdi-noextra-lbl { color: var(--dm-muted) !important; }
html.dark .pdi-noextra-lbl span { color: var(--dm-faint) !important; }
html.dark .pdi-noextra textarea.form-control { border-color: var(--dm-border) !important; background: var(--dm-input-bg) !important; color: var(--dm-text) !important; }
html.dark .pdi-noextra textarea.form-control:focus { border-color: var(--dm-primary) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.18) !important; }
html.dark .pdi-noextra .pdi-file.form-control { border-color: rgba(79,142,247,.5) !important; background: var(--dm-primary-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .pdi-noextra .pdi-file.form-control:hover { border-color: var(--dm-primary) !important; background: rgba(79,142,247,.22) !important; color: var(--dm-text) !important; }
html.dark .pdi-ev { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; }
html.dark .pdi-skel { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .pdi-skel-line { background: linear-gradient(90deg, var(--dm-surface-3) 25%, var(--dm-surface-2) 50%, var(--dm-surface-3) 75%) !important; background-size: 200% 100% !important; }
html.dark .carry-forward-chip-badge { color: #fcd34d !important; background: rgba(217,119,6,.2) !important; }

/* ── Profile pages (account, clients, suppliers, work-orders share these
   patterns; page <style> blocks use plain class selectors) ── */
html.dark .profile-head { background: linear-gradient(135deg, var(--dm-primary-soft), var(--dm-surface)) !important; border-color: var(--dm-border-soft) !important; }
html.dark .profile-head-title { color: var(--dm-text) !important; }
html.dark .profile-head-sub { color: var(--dm-muted) !important; }
html.dark .profile-role-badge { background: var(--dm-surface-3) !important; border-color: var(--dm-border) !important; color: var(--dm-primary) !important; }
html.dark .avatar-ring img,
html.dark .cli-avatar-ring img,
html.dark .pro-avatar-ring img { border-color: var(--dm-surface-3) !important; box-shadow: 0 8px 20px rgba(0,0,0,.5) !important; }
html.dark .avatar-ring::after,
html.dark .cli-online-dot,
html.dark .pro-online-dot { border-color: var(--dm-surface-2) !important; }
html.dark .photo-panel { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .photo-panel .text-dark { color: var(--dm-text) !important; }
html.dark .profile-section { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .profile-section-title { color: var(--dm-muted) !important; }
html.dark .profile-section-title--personal i { background: var(--dm-primary-soft) !important; color: var(--dm-primary) !important; }
html.dark .profile-section-title--contact i { background: rgba(217,119,6,.2) !important; color: #fcd34d !important; }
html.dark .profile-section-title--security i { background: rgba(244,63,94,.16) !important; color: #fda4af !important; }
html.dark .profile-section-title--address i { background: rgba(22,163,74,.18) !important; color: #86efac !important; }
html.dark .cli-profile-name { color: var(--dm-text) !important; }
html.dark .cli-status-active { background: rgba(22,163,74,.18) !important; color: #86efac !important; border-color: rgba(34,197,94,.4) !important; }
html.dark .cli-status-inactive { background: rgba(220,38,38,.18) !important; color: #fca5a5 !important; border-color: rgba(248,113,113,.45) !important; }
html.dark .cli-profile-card .form-label { color: var(--dm-muted) !important; }
html.dark .cli-profile-card .form-control[readonly] { background: var(--dm-bg-soft) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .cli-tl-item::before { background: var(--dm-border-soft) !important; }
html.dark .cli-tl-dot { background: var(--dm-primary-soft) !important; color: var(--dm-primary) !important; border-color: rgba(79,142,247,.35) !important; box-shadow: 0 4px 10px rgba(0,0,0,.4) !important; }
html.dark .recent-log-ico { background: var(--dm-surface-3) !important; color: var(--dm-muted) !important; }
html.dark .recent-log-dot { box-shadow: 0 0 0 4px var(--dm-primary-soft) !important; }

/* ── bg-label badges (pastel fills glow on dark; keep hues, deepen) ── */
html.dark .bg-label-secondary { background-color: var(--dm-surface-3) !important; color: var(--dm-text-soft) !important; }
html.dark .bg-label-primary { background-color: var(--dm-primary-soft) !important; color: #93c5fd !important; }
html.dark .bg-label-success { background-color: rgba(22,163,74,.18) !important; color: #86efac !important; }
html.dark .bg-label-info { background-color: rgba(3,195,236,.14) !important; color: #67e8f9 !important; }
html.dark .bg-label-warning { background-color: rgba(217,119,6,.18) !important; color: #fcd34d !important; }
html.dark .bg-label-danger { background-color: rgba(220,38,38,.18) !important; color: #fca5a5 !important; }

/* ── Buttons: drop blue glow shadows in dark mode (keep neutral focus ring) ── */
html.dark .btn-primary,
html.dark .btn-primary:hover,
html.dark .btn-primary:active,
html.dark .btn-primary.active,
html.dark .show > .btn-primary.dropdown-toggle,
html.dark .btn-solid-shine,
html.dark .btn-solid-shine:hover,
html.dark form.form-submit-event button[type="submit"].btn-primary,
html.dark form.form-submit-event button[type="submit"].btn-primary:hover,
html.dark form button[type="submit"].btn-primary#submit_btn,
html.dark form button[type="submit"].btn-primary#submit_btn:hover,
html.dark .page-actions .page-btn-solid,
html.dark .page-actions .page-btn-solid:hover,
html.dark .btn-outline-primary:hover,
html.dark .btn-outline-primary:active,
html.dark .btn-outline-primary.active {
    box-shadow: none !important;
}
html.dark .btn-primary:focus,
html.dark .btn-check:focus + .btn-primary,
html.dark .btn-outline-primary:focus {
    box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .12) !important;
}

/* ── Compliance certificate show page (shared cc-show/cc-detail patterns) ── */
html.dark .cc-show-hero { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 14px 28px rgba(0,0,0,.4) !important; }
html.dark .cc-show-hero h4[style*="#0f172a"] { color: var(--dm-text) !important; }
html.dark .cc-detail-card { border-color: var(--dm-border-soft) !important; box-shadow: 0 10px 24px rgba(0,0,0,.4) !important; }
html.dark .cc-detail-label { color: var(--dm-muted) !important; }
html.dark .cc-detail-value { color: var(--dm-text) !important; }
html.dark .cc-tile { background: var(--dm-bg-soft) !important; border-color: var(--dm-border-soft) !important; }
html.dark .cc-tile:hover { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; box-shadow: 0 4px 12px rgba(0,0,0,.4) !important; }
html.dark .cc-meta-ico { background: var(--dm-primary-soft) !important; color: var(--dm-primary) !important; }
html.dark .cc-hero-dl { box-shadow: none !important; }
html.dark .cc-hero-dl:hover { box-shadow: none !important; }
html.dark .cc-file-card { border-color: rgba(52,211,153,.4) !important; background: rgba(5,150,105,.08) !important; }
html.dark .days-chip[style*="background:#fee2e2"] { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .days-chip[style*="background:#fef9c3"],
html.dark .days-chip[style*="background:#fef3c7"] { background: rgba(217,119,6,.2) !important; color: #fcd34d !important; }
html.dark .days-chip[style*="background:#dcfce7"] { background: rgba(22,163,74,.2) !important; color: #86efac !important; }
html.dark .cc-pdf-frame { border-color: var(--dm-border-soft) !important; }
html.dark .cc-img-preview { border-color: var(--dm-border-soft) !important; box-shadow: 0 8px 20px rgba(0,0,0,.5) !important; }

/* ── CCTV status filter bar (inactive pills hardcode light fills; active pills keep hues) ── */
html.dark .cctv-filter-bar { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: none !important; }
html.dark .cctv-pill { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .cctv-pill:hover { background: var(--dm-surface-3) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; box-shadow: none !important; }
html.dark .cctv-pill .pill-count { background: rgba(255,255,255,.1) !important; color: var(--dm-text-soft) !important; }
html.dark .cctv-pill--active { box-shadow: none !important; }

/* ── Support tickets — reply box, section headers and chips hardcode light fills ── */
html.dark .reply-box { border-color: var(--dm-border) !important; }
html.dark .reply-box-footer { background: var(--dm-surface-2) !important; border-top-color: var(--dm-border-soft) !important; }
html.dark .session-pill { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .info-label { color: var(--dm-muted) !important; }
html.dark .info-value { color: var(--dm-text-soft) !important; }
html.dark [style*="background:#fafbfc"] { background: var(--dm-surface-2) !important; }
html.dark [style*="background:#f0f2f5"] { background: var(--dm-surface-3) !important; color: var(--dm-text-soft) !important; }
html.dark .card-header[style*="background:#fff"] { background: transparent !important; border-bottom-color: var(--dm-border-soft) !important; }

/* ── Report nav bar (finance reports share .report-nav; hardcoded light fills) ── */
html.dark .report-nav { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: none !important; }
html.dark .report-nav .btn-outline-secondary { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; }
html.dark .report-nav .btn-outline-secondary:hover { background: var(--dm-surface-3) !important; border-color: var(--dm-faint) !important; color: var(--dm-text) !important; box-shadow: none !important; }
html.dark .report-nav .btn-outline-primary { background: transparent !important; border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; }
html.dark .report-nav .btn-outline-primary:hover { background: var(--dm-hover) !important; border-color: var(--dm-faint) !important; color: var(--dm-text) !important; box-shadow: none !important; }
html.dark .report-nav .btn-outline-success { background: rgba(22,163,74,.15) !important; border-color: rgba(34,197,94,.4) !important; color: #86efac !important; }
html.dark .report-nav .btn-outline-success:hover { background: rgba(22,163,74,.28) !important; border-color: #4ade80 !important; color: #bbf7d0 !important; box-shadow: none !important; }

/* ── Facility bookings admin (hardcoded light table + chips) ── */
html.dark .fb-table-card { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: none !important; }
html.dark table#adminBookingsTable thead th { background: var(--dm-surface-2) !important; border-bottom-color: var(--dm-border-soft) !important; color: var(--dm-muted) !important; }
html.dark table#adminBookingsTable tbody td { border-bottom-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark table#adminBookingsTable tbody tr:hover td { background: var(--dm-surface-2) !important; }
html.dark .fb-date { background: var(--dm-surface-3) !important; border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; }
html.dark .fb-date i { color: var(--dm-faint) !important; }
html.dark .fb-time { color: var(--dm-muted) !important; }
html.dark .fb-client-name { color: var(--dm-text) !important; }
html.dark .fb-empty { color: var(--dm-muted) !important; }
html.dark .fb-tile, html.dark .fb-f-title-ico { background: var(--dm-primary-soft) !important; border-color: rgba(79,142,247,.35) !important; color: #93c5fd !important; }
html.dark .fb-filters-title { color: var(--dm-text) !important; }
html.dark .fb-active-count { background: var(--dm-surface-3) !important; color: var(--dm-text) !important; }
html.dark .fb-filters .filter-ico.is-set { background: #737373 !important; border-color: #737373 !important; color: #fff !important; box-shadow: none !important; }
html.dark .skeleton { background: linear-gradient(90deg, #383838, #424242, #383838) !important; }

/* ── Section 20 settings (tinted panels hardcode light gradients) ── */
html.dark .s20-panel { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; }
html.dark .s20-panel--single { background: linear-gradient(180deg, rgba(99,102,241,.16), var(--dm-surface-2)) !important; border-color: rgba(99,102,241,.35) !important; }
html.dark .s20-panel--qlta { background: linear-gradient(180deg, rgba(14,165,233,.14), var(--dm-surface-2)) !important; border-color: rgba(14,165,233,.35) !important; }
html.dark .s20-title-ico { background: rgba(129,140,248,.14) !important; color: #a5b4fc !important; }
html.dark .s20-info { border-color: rgba(14,165,233,.35) !important; }
html.dark .s20-save { box-shadow: none !important; }

/* ── Notices quick-filter bar ── */
html.dark .notice-filter { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .notice-filter .filter-label { color: var(--dm-muted) !important; }
html.dark .notice-filter .filter-ico { background: rgba(220,38,38,.2) !important; color: #fca5a5 !important; }
html.dark .notice-filter .form-check-label { color: var(--dm-text-soft) !important; }

/* ── Site inspection planner (planner.blade.php: white stat/panel/cal cards) ── */
html.dark .planner-stat-card { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 4px 18px rgba(0,0,0,.4) !important; }
html.dark .planner-stat-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.5) !important; }
html.dark .planner-stat-card--total { background: linear-gradient(135deg, rgba(99,102,241,.18), var(--dm-surface) 65%) !important; }
html.dark .planner-stat-card--week { background: linear-gradient(135deg, rgba(16,185,129,.14), var(--dm-surface) 65%) !important; }
html.dark .planner-stat-card--overdue { background: linear-gradient(135deg, rgba(220,38,38,.14), var(--dm-surface) 65%) !important; }
html.dark .planner-stat-card--unsched { background: linear-gradient(135deg, rgba(100,116,139,.16), var(--dm-surface) 65%) !important; }
html.dark .planner-stat-label { color: var(--dm-muted) !important; }
html.dark .planner-stat-value { color: var(--dm-text) !important; }
html.dark .planner-stat-sub { color: var(--dm-muted) !important; }
html.dark .planner-stat-icon--total { background: rgba(99,102,241,.18) !important; color: #a5b4fc !important; }
html.dark .planner-stat-icon--week { background: rgba(16,185,129,.2) !important; color: #6ee7b7 !important; }
html.dark .planner-stat-icon--overdue { background: rgba(220,38,38,.22) !important; color: #fca5a5 !important; }
html.dark .planner-stat-icon--unsched { background: var(--dm-surface-3) !important; color: var(--dm-muted) !important; }
html.dark .planner-stat-value--green { color: #34d399 !important; }
html.dark .planner-stat-value--red { color: #f87171 !important; }
html.dark .planner-stat-value--slate { color: var(--dm-muted) !important; }
html.dark .planner-stat-sub--red { color: #fca5a5 !important; }
html.dark .planner-stat-sub--green { color: #6ee7b7 !important; }
html.dark .planner-panel { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 4px 18px rgba(0,0,0,.4) !important; }
html.dark .planner-panel-hdr { border-bottom-color: var(--dm-border-soft) !important; }
html.dark .planner-panel-title { color: var(--dm-muted) !important; }
html.dark .planner-panel-title .pi-teal { color: #2dd4bf !important; }
html.dark .planner-panel-title .pi-red { color: #f87171 !important; }
html.dark .insp-row { background: var(--dm-surface-2) !important; border-left-color: var(--dm-border) !important; }
html.dark .insp-row:hover { background: var(--dm-surface-3) !important; }
html.dark .insp-row.is-overdue { border-left-color: #ef4444 !important; }
html.dark .insp-row.is-soon { border-left-color: #f59e0b !important; }
html.dark .insp-row.is-upcoming { border-left-color: #14b8a6 !important; }
html.dark .insp-row.is-none { border-left-color: var(--dm-faint) !important; }
html.dark .insp-row-icon--soon { background: rgba(245,158,11,.16) !important; color: #fcd34d !important; }
html.dark .insp-row-icon--upcoming { background: rgba(16,185,129,.16) !important; color: #6ee7b7 !important; }
html.dark .insp-row-icon--overdue { background: rgba(220,38,38,.16) !important; color: #fca5a5 !important; }
html.dark .insp-row-title { color: var(--dm-text) !important; }
html.dark .insp-row-meta { color: var(--dm-muted) !important; }
html.dark .insp-pill-overdue { background: rgba(220,38,38,.18) !important; color: #fca5a5 !important; }
html.dark .insp-pill-soon { background: rgba(245,158,11,.18) !important; color: #fcd34d !important; }
html.dark .insp-pill-upcoming { background: rgba(16,185,129,.18) !important; color: #6ee7b7 !important; }
html.dark .insp-empty { color: var(--dm-muted) !important; }
html.dark .legend-item { color: var(--dm-muted) !important; }
html.dark .planner-cal-card { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 4px 18px rgba(0,0,0,.4) !important; }
html.dark .planner-cal-hdr { border-bottom-color: var(--dm-border-soft) !important; }
html.dark .planner-cal-title { color: var(--dm-text) !important; }
/* FullCalendar v4 chrome (.fc-unthemed base pins #ddd borders, #fff popovers) */
html.dark .planner-cal-card .fc-unthemed th,
html.dark .planner-cal-card .fc-unthemed td,
html.dark .planner-cal-card .fc-unthemed thead,
html.dark .planner-cal-card .fc-unthemed tbody,
html.dark .planner-cal-card .fc-unthemed .fc-divider,
html.dark .planner-cal-card .fc-unthemed .fc-row,
html.dark .planner-cal-card .fc-unthemed .fc-content,
html.dark .planner-cal-card .fc-unthemed .fc-popover,
html.dark .planner-cal-card .fc-unthemed .fc-list-view,
html.dark .planner-cal-card .fc-unthemed .fc-list-heading td { border-color: var(--dm-border-soft) !important; }
html.dark .planner-cal-card .fc-unthemed td.fc-today { background: rgba(79,142,247,.1) !important; }
html.dark .planner-cal-card .fc-unthemed .fc-popover { background-color: var(--dm-surface-2) !important; }
html.dark .planner-cal-card .fc-unthemed .fc-divider,
html.dark .planner-cal-card .fc-unthemed .fc-popover .fc-header,
html.dark .planner-cal-card .fc-unthemed .fc-list-heading td { background: var(--dm-surface-3) !important; }
html.dark .planner-cal-card .fc-toolbar-title { color: var(--dm-text) !important; }
html.dark .planner-cal-card .fc-col-header-cell-cushion { color: var(--dm-muted) !important; }
html.dark .planner-cal-card .fc-daygrid-day-number { color: var(--dm-text-soft) !important; }
html.dark .planner-cal-card .fc-day-top.fc-other-month { opacity: .35; }
html.dark .planner-cal-card .fc-list-event-title a { color: var(--dm-text) !important; }
html.dark .planner-cal-card .fc-highlight { background: rgba(79,142,247,.25) !important; }
html.dark .planner-cal-card .fc-nonbusiness { background: var(--dm-surface-3) !important; }
html.dark .planner-cal-card .fc-popover .fc-close { color: var(--dm-muted) !important; }
html.dark .planner-cal-card .badge-soft { background: rgba(255,255,255,.16) !important; color: #fff !important; border-color: rgba(255,255,255,.3) !important; }
html.dark .planner-cal-card .badge-policy { background: rgba(56,189,248,.14) !important; color: #7dd3fc !important; border-color: rgba(56,189,248,.35) !important; }
html.dark .planner-cal-card .badge-success { background: rgba(34,197,94,.16) !important; color: #86efac !important; border-color: rgba(34,197,94,.35) !important; }
html.dark .planner-cal-card .badge-warning { background: rgba(245,158,11,.16) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.35) !important; }
html.dark .planner-cal-card .badge-danger { background: rgba(248,113,113,.16) !important; color: #fca5a5 !important; border-color: rgba(248,113,113,.35) !important; }
html.dark .planner-cal-card .badge-info { background: rgba(56,189,248,.14) !important; color: #7dd3fc !important; border-color: rgba(56,189,248,.35) !important; }
html.dark #site-inspections-status-filters-container .form-check-label { color: var(--dm-text-soft) !important; }

/* ── Messages (chat layout, bubbles, modals) ── */
html.dark .msg-wrapper { background: var(--dm-surface) !important; box-shadow: 0 2px 20px rgba(0,0,0,.5) !important; }
html.dark .msg-sidebar { background: var(--dm-bg-soft) !important; border-color: var(--dm-border-soft) !important; }
html.dark .msg-search input { background: var(--dm-input-bg) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
html.dark .msg-search input:focus { border-color: var(--dm-primary) !important; box-shadow: 0 0 0 3px rgba(79,142,247,.2) !important; }
html.dark .msg-search input::placeholder { color: var(--dm-faint) !important; }
html.dark .msg-search .bx { color: var(--dm-faint) !important; }
html.dark .conv-item { border-color: var(--dm-border-soft) !important; }
html.dark .conv-item:hover, html.dark .conv-item.active { background: var(--dm-primary-soft) !important; }
html.dark .conv-preview { color: var(--dm-muted) !important; }
html.dark .conv-time { color: var(--dm-faint) !important; }
html.dark .msg-main-header { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .msg-main-sub { color: var(--dm-muted) !important; }
html.dark .msg-body { background-color: var(--dm-bg) !important; background-image: radial-gradient(rgba(255,255,255,.05) 1.2px, transparent 1.2px) !important; }
html.dark .msg-empty { color: var(--dm-faint) !important; }
html.dark .bubble.theirs { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; color: var(--dm-text-soft) !important; box-shadow: 0 2px 8px rgba(0,0,0,.4) !important; }
html.dark .bubble.theirs:hover { box-shadow: 0 4px 14px rgba(0,0,0,.5) !important; }
html.dark .bubble-avatar { border-color: var(--dm-surface) !important; }
html.dark .bubble-time { color: var(--dm-faint) !important; }
html.dark .date-divider { color: var(--dm-muted) !important; }
html.dark .date-divider span { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; box-shadow: 0 1px 4px rgba(0,0,0,.4) !important; }
html.dark .date-divider::before, html.dark .date-divider::after { background: var(--dm-border-soft) !important; }
html.dark .msg-footer { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .msg-footer textarea { background: var(--dm-input-bg) !important; border-color: var(--dm-border) !important; color: var(--dm-text) !important; }
html.dark .msg-footer textarea:focus { border-color: var(--dm-primary) !important; }
html.dark .msg-footer textarea::placeholder { color: var(--dm-faint) !important; }
html.dark .msg-footer .btn-attach { color: var(--dm-muted) !important; border-color: var(--dm-border) !important; }
html.dark .msg-footer .btn-attach:hover { color: var(--dm-primary) !important; border-color: var(--dm-primary) !important; }
html.dark #attachPreview { background: var(--dm-surface-2) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .msg-placeholder { color: var(--dm-faint) !important; }
html.dark #newMsgModal .modal-content { box-shadow: 0 20px 60px rgba(0,0,0,.6) !important; }
html.dark #newMsgModal .modal-footer.new-msg-footer { background: linear-gradient(180deg, var(--dm-surface-2), var(--dm-surface)) !important; border-color: var(--dm-border-soft) !important; }
html.dark .new-msg-selection { color: var(--dm-muted) !important; }
html.dark .new-msg-selection .bx { color: var(--dm-faint) !important; }
html.dark .new-msg-selection.has-selection { color: var(--dm-text) !important; }
html.dark .new-msg-selection.has-selection .bx { color: var(--dm-primary) !important; }
html.dark .new-msg-selection .sel-pill { background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; box-shadow: none !important; }
html.dark .btn-cancel-ghost { border-color: var(--dm-border) !important; background: var(--dm-surface-2) !important; color: var(--dm-text-soft) !important; }
html.dark .btn-cancel-ghost:hover { border-color: var(--dm-faint) !important; color: var(--dm-text) !important; background: var(--dm-surface-3) !important; }
html.dark #startChatBtn { box-shadow: none !important; }
html.dark #startChatBtn:not(:disabled):hover { box-shadow: none !important; }
html.dark #startChatBtn:disabled { background: var(--dm-surface-3) !important; color: var(--dm-faint) !important; }

/* ── PEEP forms (plain pro-style table + mirrored stat variants) ── */
html.dark .supplier-stat-card--approved { background: linear-gradient(135deg, rgba(5,150,105,.20) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--pending { background: linear-gradient(135deg, rgba(14,165,233,.20) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--review { background: linear-gradient(135deg, rgba(217,119,6,.20) 0%, var(--dm-surface) 70%) !important; }
html.dark .supplier-stat-card--cancelled { background: linear-gradient(135deg, rgba(100,116,139,.22) 0%, var(--dm-surface) 70%) !important; }
html.dark .peep-table { color: var(--dm-text-soft) !important; }
html.dark .peep-table thead th { background: var(--dm-surface-2) !important; border-bottom-color: var(--dm-border-soft) !important; color: var(--dm-muted) !important; }
html.dark .peep-table tbody td { background: var(--dm-surface) !important; border-bottom-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .peep-table tbody tr:not(.table-warning):hover td { background: var(--dm-surface-2) !important; }
html.dark .peep-id { color: var(--dm-muted) !important; }
html.dark .peep-avatar { background: var(--dm-primary-soft) !important; color: var(--dm-primary) !important; }
html.dark .peep-loc i { color: var(--dm-faint) !important; }
html.dark .peep-date { background: var(--dm-surface-3) !important; color: var(--dm-text-soft) !important; border-color: var(--dm-border) !important; }
html.dark .peep-updated { color: var(--dm-muted) !important; }
html.dark .peep-empty { color: var(--dm-muted) !important; }
html.dark .peep-empty-ico { background: var(--dm-surface-3) !important; color: var(--dm-faint) !important; }

/* ── Plain in-card filter rows (same pro-tables panel, no .filter-panel class) ── */
html.dark .card.pro-table-card .card-body > .row,
html.dark .card.supplier-table-card .card-body > .row {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border-soft) !important;
}

/* ── Financial report tables (service-charges/reports/*) ── */
html.dark .report-tablewrap { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .report-table { color: var(--dm-text-soft) !important; }
html.dark .report-table thead th { background: var(--dm-surface-2) !important; border-bottom-color: var(--dm-border-soft) !important; color: var(--dm-muted) !important; }
html.dark .report-table tbody td { background: var(--dm-surface) !important; border-bottom-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .report-table tbody tr:hover td { background: var(--dm-surface-2) !important; }
html.dark .report-table tfoot td { background: var(--dm-bg-soft) !important; border-color: var(--dm-border-soft) !important; color: var(--dm-text) !important; }
html.dark .report-cat { color: var(--dm-text) !important; }
html.dark .report-zero { color: var(--dm-faint) !important; }
html.dark .report-mini { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; box-shadow: 0 2px 8px rgba(0,0,0,.4) !important; }

/* ── Table empty-state artwork (.tes, shared) ── */
html.dark .tes__orb { background: linear-gradient(135deg, rgba(79,142,247,.25), rgba(124,58,237,.18)) !important; border-color: rgba(79,142,247,.4) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 20px rgba(0,0,0,.45) !important; }
html.dark .tes__orb::after { background: rgba(0,0,0,.45) !important; }
html.dark .tes__icon { color: var(--dm-primary) !important; }
html.dark .tes__title { color: var(--dm-text) !important; }
html.dark .tes__sub { color: var(--dm-muted) !important; }
html.dark .tes__hint { color: var(--dm-text-soft) !important; background: var(--dm-surface-2) !important; border-color: var(--dm-border) !important; }
html.dark .tes__hint i { color: var(--dm-primary) !important; }

/* ── Auth pages: white submit button in dark mode (login, forgot, reset) ── */
html.dark .btn-login { background: #fff !important; color: #1d4ed8 !important; box-shadow: none !important; }
html.dark .btn-login:hover { background: #e2e8f0 !important; box-shadow: none !important; }
/* ── Auth pages: terms link uses H1 title blue in dark mode ── */
html.dark .login-terms a { color: #5395ff !important; }
/* ── Auth pages: terms label readable in dark mode ── */
html.dark .login-terms { color: var(--dm-text) !important; }
html.dark .login-terms label { color: var(--dm-text) !important; }

/* ── Sidebar collapse toggle: gray instead of brand blue in dark mode ── */
html.dark .app-brand .layout-menu-toggle { background: #424242 !important; box-shadow: 0 2px 6px rgba(0, 0, 0, .5) !important; }
html.dark .app-brand .layout-menu-toggle:hover { background: #525252 !important; box-shadow: 0 2px 8px rgba(0, 0, 0, .55) !important; }
html.dark .app-brand .layout-menu-toggle i,
html.dark .app-brand .layout-menu-toggle .menu-icon { color: #ececec !important; }
html.dark.layout-menu-collapsed .layout-menu .app-brand .layout-menu-toggle,
html.dark.layout-menu-collapsed.layout-menu .app-brand .layout-menu-toggle,
html.dark.layout-menu-collapsed:not(.layout-menu-hover):not(.layout-menu-offcanvas):not(.layout-menu-fixed-offcanvas) .layout-menu .app-brand .layout-menu-toggle {
    background: #424242 !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .5) !important;
}
html.dark.layout-menu-collapsed .layout-menu .app-brand .layout-menu-toggle:hover { background: #525252 !important; }
html.dark.layout-menu-collapsed .layout-menu .app-brand .layout-menu-toggle i,
html.dark.layout-menu-collapsed .layout-menu .app-brand .layout-menu-toggle .menu-icon { color: #ececec !important; }

/* ── Navbar dropdowns: dark sticky header/footer + rounded menu ── */
html.dark .fixed-header,
html.dark .fixed-footer {
    background: var(--dm-surface) !important;
}
html.dark .fixed-header { border-bottom: 1px solid var(--dm-border-soft) !important; }
html.dark .fixed-footer { border-top: 1px solid var(--dm-border-soft) !important; }
html.dark .navbar-nav .navbar-dropdown .dropdown-menu {
    border-radius: 14px !important;
    overflow: hidden !important;
    border-color: var(--dm-border) !important;
}

/* ── Utility meter readings bulk table ── */
html.dark .mr-table { color: var(--dm-text-soft) !important; }
html.dark .mr-table thead th { background: var(--dm-surface-2) !important; border-bottom-color: var(--dm-border-soft) !important; color: var(--dm-muted) !important; }
html.dark .mr-table tbody td { background: var(--dm-surface) !important; border-bottom-color: var(--dm-border-soft) !important; color: var(--dm-text-soft) !important; }
html.dark .mr-table tbody tr:hover td { background: var(--dm-surface-2) !important; }
html.dark .mr-mono { color: var(--dm-text-soft) !important; }
html.dark .mr-type { background: var(--dm-primary-soft) !important; color: #93c5fd !important; border-color: rgba(79,142,247,.4) !important; }
html.dark .mr-flat small { color: var(--dm-faint) !important; }
html.dark .mr-prev { background: var(--dm-surface-3) !important; color: var(--dm-text-soft) !important; border-color: var(--dm-border) !important; }
html.dark .mr-thumb { border-color: var(--dm-surface-3) !important; box-shadow: 0 2px 8px rgba(0,0,0,.5) !important; }

/* ── Property owners toolbar ── */
html.dark .owner-toolbar { background: var(--dm-surface) !important; border-color: var(--dm-border-soft) !important; }
html.dark .owner-search-wrap > i { color: var(--dm-faint) !important; }

/* ── Print: always render light ── */
@media print {
    html.dark body, html.dark .content-wrapper, html.dark .card {
        background: #fff !important;
        color: #000 !important;
    }
}
