/* E-17: dark theme. One override sheet, loaded LAST in _AdminLayout2 and _LoginLayout,
   fully scoped to html[data-theme="dark"] - with the attribute absent nothing here applies,
   so the light theme stays byte-identical to today. The attribute is stamped in <head>
   BEFORE the stylesheets paint (no flash) from localStorage key "sevenTheme".
   Semantic tokens first (the work-order contract); every rule below uses them.
   Known leftovers are reported in the task notes: Stimulsoft viewer content, echarts
   canvases, and deep Kendo popups keep their own colours. */

html[data-theme="dark"] {
    --sv-bg-app: #141922;
    --sv-bg-panel: #1b212c;
    --sv-bg-card: #202836;
    --sv-bg-input: #161d28;
    --sv-bg-hover: #232d3c;
    --sv-bg-active: #26436b;
    --sv-text: #d6dde8;
    --sv-text-2: #96a1b1;
    --sv-text-3: #6d7889;
    --sv-border: #253044;
    --sv-border-strong: #35425a;
    --sv-brand: #1f7ddb;
    --sv-brand-hover: #3399ff;
    color-scheme: dark;
}

/* ---------- base ---------- */
html[data-theme="dark"] body {
    background: var(--sv-bg-app) !important;
    color: var(--sv-text);
}

html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--sv-bg-panel); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--sv-border-strong); border-radius: 5px; }

html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="dark"] p, html[data-theme="dark"] label, html[data-theme="dark"] span,
html[data-theme="dark"] td, html[data-theme="dark"] th, html[data-theme="dark"] li {
    color: inherit;
}

html[data-theme="dark"] a { color: var(--sv-brand-hover); }
html[data-theme="dark"] hr { border-color: var(--sv-border); }

/* ---------- app shell: header, sidebar, content ---------- */
html[data-theme="dark"] .headerbar,
html[data-theme="dark"] .headermenu,
html[data-theme="dark"] .header-left,
html[data-theme="dark"] .header-right {
    background: var(--sv-bg-panel) !important;
    color: var(--sv-text);
}

html[data-theme="dark"] .headermenu .btn-default.tp-icon,
html[data-theme="dark"] .headermenu .btn-default {
    background: transparent !important;
    color: var(--sv-text-2) !important;
    border-color: transparent;
}

    html[data-theme="dark"] .headermenu .btn-default.tp-icon:hover {
        color: var(--sv-brand-hover) !important;
    }

html[data-theme="dark"] .leftpanel,
html[data-theme="dark"] .leftpanelinner,
html[data-theme="dark"] .nav-bracket {
    background: var(--sv-bg-panel) !important;
}

html[data-theme="dark"] .nav-bracket.menu a,
html[data-theme="dark"] .nav-bracket a.sidebarMenuItem,
html[data-theme="dark"] .leftpanel a {
    color: var(--sv-text-2) !important;
}

    html[data-theme="dark"] .nav-bracket.menu a:hover,
    html[data-theme="dark"] .nav-bracket.menu .active > a,
    html[data-theme="dark"] .leftpanel a:hover {
        color: var(--sv-brand-hover) !important;
        background: var(--sv-bg-hover) !important;
    }

html[data-theme="dark"] .sidebartitle {
    color: var(--sv-text-3) !important;
    background: transparent !important;
}

html[data-theme="dark"] .mainpanel,
html[data-theme="dark"] .contentpanel,
html[data-theme="dark"] .pageheader {
    background: var(--sv-bg-app) !important;
    color: var(--sv-text);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .panel-body,
html[data-theme="dark"] .well,
html[data-theme="dark"] .tileBox,
html[data-theme="dark"] .tileBoxReception,
html[data-theme="dark"] .list-wrapper {
    background: var(--sv-bg-card) !important;
    border-color: var(--sv-border) !important;
    color: var(--sv-text);
}

html[data-theme="dark"] .panel-heading {
    background: var(--sv-bg-panel) !important;
    border-color: var(--sv-border) !important;
    color: var(--sv-text);
}

/* ---------- workspace tabs ---------- */
html[data-theme="dark"] .nav-tabs {
    border-color: var(--sv-border) !important;
    background: transparent;
}

    html[data-theme="dark"] .nav-tabs > li > a {
        background: var(--sv-bg-panel) !important;
        color: var(--sv-text-2) !important;
        border-color: var(--sv-border) !important;
    }

    html[data-theme="dark"] .nav-tabs > li.active > a,
    html[data-theme="dark"] .nav-tabs > li.active > a:focus,
    html[data-theme="dark"] .nav-tabs > li.active > a:hover {
        background: var(--sv-bg-card) !important;
        color: var(--sv-text) !important;
        border-color: var(--sv-border) var(--sv-border) transparent !important;
    }

html[data-theme="dark"] .tab-content,
html[data-theme="dark"] .tab-pane {
    background: transparent;
    color: var(--sv-text);
}

/* the ACTIVE workspace tab must be unmistakable: brand top rule + lifted surface + bold */
html[data-theme="dark"] #tab-list > li > a {
    border-top: 2px solid transparent !important;
}

html[data-theme="dark"] #tab-list > li.active > a,
html[data-theme="dark"] #tab-list > li.active > a:hover,
html[data-theme="dark"] #tab-list > li.active > a:focus {
    background: #27334a !important;
    color: #ffffff !important;
    border-top: 2px solid var(--sv-brand) !important;
    font-weight: bold !important;
}

html[data-theme="dark"] #tabList-contextMenu {
    background: var(--sv-bg-card);
    border: 1px solid var(--sv-border-strong);
    color: var(--sv-text);
}

    html[data-theme="dark"] #tabList-contextMenu li:hover {
        background: var(--sv-bg-hover);
        color: var(--sv-brand-hover);
    }

/* ---------- forms ---------- */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control {
    background: var(--sv-bg-input) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

    html[data-theme="dark"] .form-control:focus,
    html[data-theme="dark"] input:focus,
    html[data-theme="dark"] textarea:focus {
        border-color: var(--sv-brand) !important;
        box-shadow: none !important;
    }

html[data-theme="dark"] ::placeholder { color: var(--sv-text-3) !important; }

html[data-theme="dark"] .btn-default {
    background: var(--sv-bg-card);
    color: var(--sv-text);
    border-color: var(--sv-border-strong);
}

    html[data-theme="dark"] .btn-default:hover,
    html[data-theme="dark"] .btn-default:focus {
        background: var(--sv-bg-hover);
        color: var(--sv-text);
        border-color: var(--sv-border-strong);
    }

html[data-theme="dark"] legend,
html[data-theme="dark"] fieldset {
    border-color: var(--sv-border);
    color: var(--sv-text);
}

/* ---------- kendo: grid, inputs, popups, windows ---------- */
html[data-theme="dark"] .k-grid,
html[data-theme="dark"] .k-widget.k-grid,
html[data-theme="dark"] .k-grid-content,
html[data-theme="dark"] .k-grid table {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .k-grid-header,
html[data-theme="dark"] .k-grid-header-wrap,
html[data-theme="dark"] .k-header,
html[data-theme="dark"] .k-grid .k-grid-toolbar,
html[data-theme="dark"] .k-grouping-header {
    background: var(--sv-bg-panel) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .k-grid th,
html[data-theme="dark"] .k-grid td {
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .k-grid tr.k-alt {
    background: var(--sv-bg-panel) !important;
}

html[data-theme="dark"] .k-grid tbody tr:hover {
    background: var(--sv-bg-hover) !important;
}

html[data-theme="dark"] .k-grid tr.k-state-selected,
html[data-theme="dark"] .k-state-selected {
    background: var(--sv-bg-active) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .k-pager-wrap,
html[data-theme="dark"] .k-pager-numbers .k-link,
html[data-theme="dark"] .k-filter-row th {
    background: var(--sv-bg-panel) !important;
    color: var(--sv-text-2) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .k-pager-numbers .k-state-selected {
    background: var(--sv-brand) !important;
    color: #fff !important;
}

html[data-theme="dark"] .k-input,
html[data-theme="dark"] .k-textbox,
html[data-theme="dark"] .k-picker-wrap,
html[data-theme="dark"] .k-dropdown-wrap,
html[data-theme="dark"] .k-numeric-wrap,
html[data-theme="dark"] .k-multiselect-wrap {
    background: var(--sv-bg-input) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .k-list-container,
html[data-theme="dark"] .k-list,
html[data-theme="dark"] .k-popup,
html[data-theme="dark"] .k-animation-container .k-popup {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border-strong) !important;
}

html[data-theme="dark"] .k-list .k-item:hover,
html[data-theme="dark"] .k-list .k-state-focused {
    background: var(--sv-bg-hover) !important;
    color: var(--sv-brand-hover) !important;
}

html[data-theme="dark"] .k-window,
html[data-theme="dark"] .k-window-content {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border-strong) !important;
}

html[data-theme="dark"] .k-window-titlebar {
    background: var(--sv-bg-panel) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .k-tooltip {
    background: var(--sv-bg-panel);
    color: var(--sv-text);
    border-color: var(--sv-border-strong);
}

/* E-00 status tints, re-derived for the dark surface (ink stays readable, rule keeps hue) */
html[data-theme="dark"] .k-state-selected-failed { background-color: #43301a !important; color: #f5c08a !important; border-color: #f7931e !important; }
html[data-theme="dark"] .k-state-selected-failed td,
html[data-theme="dark"] .k-state-selected-failed td *:not(input):not(select):not(textarea) {
    background-color: transparent;
    color: #f5c08a !important;
    -webkit-text-fill-color: #f5c08a !important;
}
html[data-theme="dark"] .k-state-selected-error { background-color: #46212a !important; color: #f7a3b1 !important; border-color: #e11d48 !important; }
html[data-theme="dark"] .k-state-selected-info { background-color: #17324a !important; color: #9ccdff !important; border-color: #3399ff !important; }
html[data-theme="dark"] .k-state-selected-success { background-color: #17362a !important; color: #86e0b8 !important; border-color: #059669 !important; }

/* ---------- seven components ---------- */
html[data-theme="dark"] .SevenGrid a { color: var(--sv-text-2); }
html[data-theme="dark"] .SevenGrid a:hover { color: var(--sv-brand-hover); }

html[data-theme="dark"] .seven-empty { color: var(--sv-text-2); }
html[data-theme="dark"] .seven-empty .seven-empty-title { color: var(--sv-text); }
html[data-theme="dark"] .seven-empty .seven-empty-icon { color: var(--sv-border-strong); }

html[data-theme="dark"] .seven-filter-chips { background: transparent; }
html[data-theme="dark"] .seven-filter-chips .seven-filter-chip {
    background: var(--sv-bg-card);
    border-color: var(--sv-border-strong);
    color: var(--sv-brand-hover);
}

html[data-theme="dark"] .toolbar {
    background: var(--sv-bg-panel);
    border-color: var(--sv-border);
}

    html[data-theme="dark"] .toolbar .icon,
    html[data-theme="dark"] .toolbar a {
        color: var(--sv-text-2);
    }

html[data-theme="dark"] .seven-skeleton-bar {
    background: var(--sv-bg-hover);
}

html[data-theme="dark"] .seven-draft-bar {
    background: #3a2f14 !important;
    border-color: #f7931e !important;
    color: #f5d9a8 !important;
}

html[data-theme="dark"] .seven-validation-summary {
    background: #46212a;
    border-color: #e11d48;
    color: #f7a3b1;
}

/* global search palette */
html[data-theme="dark"] .seven-gs-panel {
    background: var(--sv-bg-card) !important;
    border-color: var(--sv-border-strong) !important;
    color: var(--sv-text);
}

html[data-theme="dark"] .seven-gs-panel input {
    background: var(--sv-bg-input) !important;
    color: var(--sv-text) !important;
}

html[data-theme="dark"] .seven-gs-result:hover,
html[data-theme="dark"] .seven-gs-result.active {
    background: var(--sv-bg-hover) !important;
}

html[data-theme="dark"] .seven-gs-footer { color: var(--sv-text-3); border-color: var(--sv-border); }

/* E-13 grouped reception menus + generic dropdowns + launcher */
html[data-theme="dark"] .dropdown-menu {
    background: var(--sv-bg-card) !important;
    border-color: var(--sv-border-strong) !important;
    color: var(--sv-text);
}

    html[data-theme="dark"] .dropdown-menu > li > a {
        color: var(--sv-text-2) !important;
    }

        html[data-theme="dark"] .dropdown-menu > li > a:hover {
            background: var(--sv-bg-hover) !important;
            color: var(--sv-brand-hover) !important;
        }

html[data-theme="dark"] .ReceptionDetail .receptionRelatedProcessMenu li.seven-menu-group,
html[data-theme="dark"] .ReceptionDetail .receptionPrintMenu li.seven-menu-group {
    color: var(--sv-brand-hover);
    border-color: var(--sv-border);
    background: transparent;
}

html[data-theme="dark"] #sevenRecentList .seven-recent-item { color: var(--sv-text-2) !important; }
html[data-theme="dark"] #sevenRecentList .seven-recent-item:hover { background: var(--sv-bg-hover); color: var(--sv-brand-hover) !important; }

/* first-run hint bubble */
html[data-theme="dark"] #sevenHintBubble {
    background: #332d16 !important;
    border-color: #8a6d1f !important;
    color: #efe0a8 !important;
}

    html[data-theme="dark"] #sevenHintBubble .seven-hint-arrow { border-bottom-color: #8a6d1f !important; }
    html[data-theme="dark"] #sevenHintBubble .seven-hint-off { color: #c9b36a !important; }

/* ---------- modals, popups, toasts ---------- */
html[data-theme="dark"] .modal-content {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text);
    border: 1px solid var(--sv-border-strong);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    background: var(--sv-bg-panel) !important;
    border-color: var(--sv-border) !important;
    color: var(--sv-text);
}

html[data-theme="dark"] .popup,
html[data-theme="dark"] .popupContent {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text);
}

html[data-theme="dark"] .close { color: var(--sv-text-2); opacity: 1; text-shadow: none; }

html[data-theme="dark"] .lobibox-notify {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text) !important;
    border: 1px solid var(--sv-border-strong);
}

    html[data-theme="dark"] .lobibox-notify .lobibox-notify-msg,
    html[data-theme="dark"] .lobibox-notify .lobibox-notify-title {
        color: var(--sv-text) !important;
    }

html[data-theme="dark"] .lobibox {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text) !important;
}

    html[data-theme="dark"] .lobibox .lobibox-header {
        background: var(--sv-bg-panel) !important;
        color: var(--sv-text) !important;
    }

    html[data-theme="dark"] .lobibox .lobibox-body {
        background: var(--sv-bg-card) !important;
        color: var(--sv-text) !important;
    }

/* ---------- smartwizard (reception steps) - keep server-state colors readable ---------- */
html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li > a,
html[data-theme="dark"] .smartwizardcustom .nav > li > a {
    background: var(--sv-bg-panel) !important;
    color: var(--sv-text-2) !important;
}

html[data-theme="dark"] .smartwizardcustom .nav > li.active > a,
html[data-theme="dark"] .smartwizardcustom .nav > li.active.open > a {
    color: #fff !important;
}

/* ---------- select2 / datepicker / jstree ---------- */
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .select2-dropdown {
    background: var(--sv-bg-input) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--sv-text); }
html[data-theme="dark"] .select2-results__option--highlighted { background: var(--sv-bg-hover) !important; color: var(--sv-brand-hover) !important; }

html[data-theme="dark"] .datepicker-plot-area,
html[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td span {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text) !important;
}

html[data-theme="dark"] .jstree-default .jstree-anchor { color: var(--sv-text-2); }
html[data-theme="dark"] .jstree-default .jstree-hovered { background: var(--sv-bg-hover); }
html[data-theme="dark"] .jstree-default .jstree-clicked { background: var(--sv-bg-active); }

/* ---------- login page ----------
   The left side is a full-bleed photo: NOTHING there may carry a surface, or it reads as
   black/white boxes over the picture (user report). Everything in the promo column is
   transparent with white ink, exactly like the light theme. Only the form column follows
   the dark tokens. */
html[data-theme="dark"] .login-promo,
html[data-theme="dark"] .login-promo *,
html[data-theme="dark"] .login-message,
html[data-theme="dark"] .login-message *,
html[data-theme="dark"] .logosevensoft,
html[data-theme="dark"] .logosevensoft *,
html[data-theme="dark"] .logosevensoft .logopanel,
html[data-theme="dark"] .login-message .logopanel,
html[data-theme="dark"] .login-message .customertitle,
html[data-theme="dark"] .login-message #customerlogo,
html[data-theme="dark"] .customerserialnumbercontainer,
html[data-theme="dark"] .customerserialnumbercontainer * {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

    html[data-theme="dark"] .login-promo,
    html[data-theme="dark"] .login-promo span,
    html[data-theme="dark"] .login-promo label,
    html[data-theme="dark"] .login-message span,
    html[data-theme="dark"] .login-message label {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

html[data-theme="dark"] .loginpanel,
html[data-theme="dark"] .signin-form,
html[data-theme="dark"] .panel-signin {
    background: transparent !important;
    color: var(--sv-text);
}

html[data-theme="dark"] .loginpanel .form-control,
html[data-theme="dark"] .signin-form .form-control {
    background: var(--sv-bg-input) !important;
    color: var(--sv-text) !important;
}

/* the sign-in button keeps the brand fill so the primary action still reads as primary */
html[data-theme="dark"] .signin-form .btn-primary,
html[data-theme="dark"] .loginpanel .btn-primary,
html[data-theme="dark"] .panel-signin .btn-primary {
    background: var(--sv-brand) !important;
    border-color: var(--sv-brand) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* ---------- header strip: white children of the headerbar (user-reported round 2) ----------
   every selector here is scoped to the ADMIN shell (.leftpanel / .headerbar / header menus).
   The login page reuses the same class names on top of a photo, where any surface shows up
   as a black box - it must stay transparent (see the login section). */
html[data-theme="dark"] .leftpanel .logopanel,
html[data-theme="dark"] .headerbar .logopanel,
html[data-theme="dark"] .headerbar .customertitle,
html[data-theme="dark"] .headerbar .topnav,
html[data-theme="dark"] .topnav,
html[data-theme="dark"] .sevendesktopmenu,
html[data-theme="dark"] .sevenmobilemenu,
html[data-theme="dark"] .headermenu > li,
html[data-theme="dark"] .headermenu .btn-group > .btn,
html[data-theme="dark"] .menutoggle {
    background: var(--sv-bg-panel) !important;
    border-color: var(--sv-border) !important;
    color: var(--sv-text-2) !important;
}

    /* the brand logo is dark-on-transparent - keep a small white plate behind it,
       but only inside the app shell */
    html[data-theme="dark"] .leftpanel .logopanel img,
    html[data-theme="dark"] .headerbar .logopanel img {
        background: #ffffff;
        border-radius: 4px;
        padding: 3px;
    }

html[data-theme="dark"] .headerbar { border-color: var(--sv-border) !important; }
html[data-theme="dark"] .headerbar::after { border-bottom-color: var(--sv-border) !important; }

html[data-theme="dark"] .customertitle a,
html[data-theme="dark"] .customertitle span {
    color: var(--sv-brand-hover) !important;
}

/* grid header links keep the template gold otherwise - normalize to token ink */
html[data-theme="dark"] .k-grid-header th,
html[data-theme="dark"] .k-grid-header th .k-link,
html[data-theme="dark"] .k-grid-header th a,
html[data-theme="dark"] .k-grid-header .k-header {
    color: var(--sv-text) !important;
}

/* form labels read token-grey on the dark panels, not the template gold */
html[data-theme="dark"] .contentpanel label,
html[data-theme="dark"] .tab-content label,
html[data-theme="dark"] .modal-content label {
    color: var(--sv-text-2) !important;
}

/* ---------- round 3: the milky patches (source-swept from forms-style/SevenStyle/
   GridsCustomStyle/Reception.css - every light hardcoded container, normalized) ---------- */

/* the white sheet behind open workspaces + white utility panels */
html[data-theme="dark"] .tileBoxPanel { background: var(--sv-bg-app) !important; }
html[data-theme="dark"] .tileBox2 { background: var(--sv-bg-card) !important; border-color: var(--sv-border) !important; }
html[data-theme="dark"] .white-back { background: var(--sv-bg-card) !important; }
html[data-theme="dark"] #loadingDivDynamic .circleLoadeContainer { background: var(--sv-bg-card) !important; color: var(--sv-text); }

/* reception form chrome: #eae8e8 !important in Reception.css */
html[data-theme="dark"] .ReceptionDetail,
html[data-theme="dark"] .ReceptionForm,
html[data-theme="dark"] .iconDetailBar,
html[data-theme="dark"] .labelDetailBar,
html[data-theme="dark"] #ReceptionGeneralInformationDiv,
html[data-theme="dark"] .ReceptionInformation {
    background: var(--sv-bg-panel) !important;
    color: var(--sv-text);
}

html[data-theme="dark"] #receptionDropDownMenuDivId > li > a:hover { background-color: var(--sv-bg-hover); }

/* smartwizard section strip: future steps were #f5f5f5 with #bbb ink; state colors stay */
html[data-theme="dark"] .sw-main,
html[data-theme="dark"] .sw-container,
html[data-theme="dark"] .smartwizardcustom {
    background: transparent !important;
}

html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li > a {
    background: var(--sv-bg-panel);
    color: var(--sv-text-3);
}

html[data-theme="dark"] .receptionStateOrder .badge { background: var(--sv-bg-card); color: var(--sv-text); }

/* section tab strip inside forms: light fills live on the ::after tab shapes too */
html[data-theme="dark"] #tab-list > li > a::after { background: var(--sv-bg-panel) !important; }
html[data-theme="dark"] #tab-list > li.active > a::after { background: var(--sv-bg-card) !important; }
html[data-theme="dark"] .nav-tabs > li.active > a::after { background: var(--sv-bg-card) !important; }

/* hand-built detail tables (QC checklist, info bands) - Kendo keeps its own covered rules.
   the table's own light background used to leak through cell gaps as bright grid lines */
html[data-theme="dark"] .tab-pane table {
    background: var(--sv-bg-card) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .tab-pane table th {
    background: var(--sv-bg-panel) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .tab-pane table td {
    border-color: var(--sv-border) !important;
}

/* structural hairlines inside form panes (wizard container edges, separators) */
html[data-theme="dark"] .sw-container,
html[data-theme="dark"] .sw-theme-arrows,
html[data-theme="dark"] .sw-theme-arrows .step-content,
html[data-theme="dark"] .tab-pane fieldset,
html[data-theme="dark"] .tab-pane hr {
    border-color: var(--sv-border) !important;
}

/* grid hovers were light blue (#e5f5fa !important) - unreadable on dark */
html[data-theme="dark"] .k-grid tr:hover:not(.k-state-selected):not(.k-state-selected-failed):not(.k-state-selected-error):not(.k-state-selected-info):not(.k-state-selected-success) {
    background-color: var(--sv-bg-hover) !important;
}

html[data-theme="dark"] .SevenEditableGrid tr:hover td { background: var(--sv-bg-hover) !important; }

/* editable-cell tint (SevenEditabletd, #ddeeff/#a9d4ff in the light sheet): the same
   "this cell is editable" signal as a dark blue tint with readable ink */
html[data-theme="dark"] .SevenEditableGrid .SevenEditabletd {
    background: #1d3a5c !important;
    color: var(--sv-text) !important;
    -webkit-text-fill-color: var(--sv-text) !important;
}

html[data-theme="dark"] .SevenEditableGrid .k-alt .SevenEditabletd {
    background: #234a75 !important;
    color: var(--sv-text) !important;
    -webkit-text-fill-color: var(--sv-text) !important;
}

/* hovering a SELECTED row: light-blue surface with DARK navy ink so the text never
   drowns (user request). text-fill-color beats every deeper white !important rule. */
html[data-theme="dark"] .k-grid tr.k-state-selected:hover,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover td,
html[data-theme="dark"] .SevenEditableGrid tr.k-state-selected:hover td {
    background: #cfe4fa !important;
    color: #0b3f6b !important;
    -webkit-text-fill-color: #0b3f6b !important;
}

    html[data-theme="dark"] .k-grid tr.k-state-selected:hover *:not(input):not(select):not(textarea),
    html[data-theme="dark"] .SevenEditableGrid tr.k-state-selected:hover td *:not(input):not(select):not(textarea) {
        color: #0b3f6b !important;
        -webkit-text-fill-color: #0b3f6b !important;
    }
html[data-theme="dark"] .btn-edit:hover { background-color: var(--sv-bg-hover) !important; }

/* row operation popup menu */
html[data-theme="dark"] #OperationMainPopup .OperationMenuList,
html[data-theme="dark"] #operationPopup {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text);
}

    /* the item anchors are .btn.operationmain nested under div - not direct li children,
       so the generic dropdown/link ink reached them and painted them brand blue. Grid menu
       text is PLAIN WHITE, never coloured (user request); only the hovered row's
       background changes. Descendants included so icons and spans follow the label. */
    html[data-theme="dark"] #OperationMainPopup .OperationMenuList a,
    html[data-theme="dark"] #OperationMainPopup .OperationMenuList a *,
    html[data-theme="dark"] .OperationMenu a,
    html[data-theme="dark"] .OperationMenu a *,
    html[data-theme="dark"] .OperationMenu li,
    html[data-theme="dark"] .OperationMenuList li,
    html[data-theme="dark"] .OperationMenuList .operationmain,
    html[data-theme="dark"] .OperationMenuList .operationmain *,
    html[data-theme="dark"] .dropdown-menu .operationmain,
    html[data-theme="dark"] .dropdown-menu .operationmain *,
    html[data-theme="dark"] .SevenGrid .dropdown-menu a,
    html[data-theme="dark"] .SevenGrid .dropdown-menu a * {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        background: transparent !important;
    }

    html[data-theme="dark"] #OperationMainPopup .OperationMenuList > li:hover {
        background-color: var(--sv-bg-hover) !important;
    }

        html[data-theme="dark"] #OperationMainPopup .OperationMenuList > li:hover a,
        html[data-theme="dark"] #OperationMainPopup .OperationMenuList > li:hover a *,
        html[data-theme="dark"] .OperationMenu > li:hover a,
        html[data-theme="dark"] .OperationMenu > li:hover a *,
        html[data-theme="dark"] .OperationMenu > li:hover .operationmain,
        html[data-theme="dark"] .SevenGrid .dropdown-menu > li:hover a,
        html[data-theme="dark"] .SevenGrid .dropdown-menu > li:hover a * {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
        }

/* the grid menu's own section labels stay quiet grey - they are headings, not actions */
html[data-theme="dark"] .OperationMenuList > li.divider,
html[data-theme="dark"] .OperationMenu > li.divider {
    background-color: var(--sv-border) !important;
}

/* selected + status combined first-cell overrides carry !important in the light sheet */
html[data-theme="dark"] .k-state-selected.k-state-selected-failed td:first-child { background-color: #43301a !important; }
html[data-theme="dark"] .k-state-selected.k-state-selected-error td:first-child { background-color: #46212a !important; }
html[data-theme="dark"] .k-state-selected.k-state-selected-info td:first-child { background-color: #17324a !important; }
html[data-theme="dark"] .k-state-selected.k-state-selected-success td:first-child { background-color: #17362a !important; }

/* "optional field" cream tint (#fdeee5 !important) keeps its meaning as a warm dark tint */
html[data-theme="dark"] .optional,
html[data-theme="dark"] input.optional,
html[data-theme="dark"] select.optional,
html[data-theme="dark"] textarea.optional {
    background-color: #2b2320 !important;
}

html[data-theme="dark"] .partialdrpdwn.optional + span .select2-selection { background-color: #2b2320 !important; }

/* global search palette internals that stayed light */
html[data-theme="dark"] .seven-gs-item { background: transparent; }
html[data-theme="dark"] .seven-gs-item.active { background: var(--sv-bg-hover) !important; }
html[data-theme="dark"] .seven-gs-hint { background: var(--sv-bg-panel); color: var(--sv-text-3); }
html[data-theme="dark"] .seven-gs-results { background: var(--sv-bg-card); }
html[data-theme="dark"] .seven-gs-footer { background: var(--sv-bg-panel) !important; }

/* filter chip hover was a light rose - dark rose keeps the "remove" signal */
html[data-theme="dark"] .seven-filter-chips .seven-filter-chip:hover { background: #4a2028 !important; color: #f7a3b1 !important; }

html[data-theme="dark"] .select2-drop-active { background: var(--sv-bg-card) !important; }

/* ---------- round 4 (user sweep): dashboard filters, general-info band, FAQ, wizard states ---------- */

/* the milky gradient behind every dashboard filter block */
html[data-theme="dark"] .gradiant-container,
html[data-theme="dark"] .dashboardFilterForm,
html[data-theme="dark"] .mainform {
    background: var(--sv-bg-panel) !important;
    background-image: none !important;
    color: var(--sv-text);
    border-color: var(--sv-border) !important;
}

/* the shared "general information" band gets a proper panel treatment */
html[data-theme="dark"] .general-information {
    background: var(--sv-bg-panel) !important;
    background-image: none !important;
    border: 1px solid var(--sv-border) !important;
    color: var(--sv-text);
}

    html[data-theme="dark"] .general-information label { color: var(--sv-text-3) !important; }

    html[data-theme="dark"] .general-information span,
    html[data-theme="dark"] .general-information b,
    html[data-theme="dark"] .general-information strong { color: var(--sv-text) !important; }

/* FAQ accordion (QuestionCategory/List + FAQItems): readable cards, tinted answers */
html[data-theme="dark"] #faqAccordion .item,
html[data-theme="dark"] #faqAccordion .header,
html[data-theme="dark"] .question-title,
html[data-theme="dark"] #rightPanel .alert,
html[data-theme="dark"] #leftPanel .alert {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

    html[data-theme="dark"] #faqAccordion .header,
    html[data-theme="dark"] #faqAccordion .header span,
    html[data-theme="dark"] #faqAccordion .header a,
    html[data-theme="dark"] .question-title { color: var(--sv-text) !important; }

html[data-theme="dark"] #faqAccordion .answer,
html[data-theme="dark"] .answer {
    background: #17324a !important;
    color: #c9defa !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] #faqAccordion .item.active .header { background: var(--sv-bg-hover) !important; }

/* some FAQ answers carry their own muted ink - force readable text on EVERYTHING inside an item */
html[data-theme="dark"] #faqAccordion .item *,
html[data-theme="dark"] #leftPanel .item *,
html[data-theme="dark"] #leftPanel .answer * {
    color: var(--sv-text) !important;
}

/* reception state-order wizard: every state as loud as the light theme.
   locked = darkest app tone, open = lifted blue, submit = the house navy #004a80,
   active = the house orange. Chevron fills follow their step; both border sides are
   set so the RTL build (border-right arrows) gets the same treatment. */
html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor {
    background: transparent !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li > a {
    background: var(--sv-bg-app) !important;
    color: var(--sv-text-2) !important;
}

    html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li > a::after {
        border-left-color: var(--sv-bg-app) !important;
        border-right-color: var(--sv-bg-app) !important;
    }

    /* the ::before wedge is the SEPARATION notch - it must match the surface behind the
       strip (not a grey line), exactly like the white notch does in the light theme */
    html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li > a::before {
        border-left-color: var(--sv-bg-app) !important;
        border-right-color: var(--sv-bg-app) !important;
    }

html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li.open > a {
    background: #14395e !important;
    color: #cfe1f5 !important;
}

    html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li.open > a::after {
        border-left-color: #14395e !important;
        border-right-color: #14395e !important;
    }

html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li.submit > a {
    background: #004a80 !important;
    color: #ffffff !important;
}

    html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li.submit > a::after {
        border-left-color: #004a80 !important;
        border-right-color: #004a80 !important;
    }

html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li.active > a,
html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li.active.open > a {
    background: #f7931e !important;
    color: #ffffff !important;
}

    html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li.active > a::after,
    html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li.active.open > a::after {
        border-left-color: #f7931e !important;
        border-right-color: #f7931e !important;
    }

/* slanted section tabs that are plain nav-tabs (e.g. QC inner strip) */
html[data-theme="dark"] .tab-pane .nav-tabs > li > a::after { background: var(--sv-bg-panel) !important; }
html[data-theme="dark"] .tab-pane .nav-tabs > li.active > a::after { background: var(--sv-bg-card) !important; }

/* the light frame around grids: removed OUTRIGHT (user decision) - no outer border,
   no padding gap, no shadow; inner separators stay on header/cells */
html[data-theme="dark"] .SevenGrid,
html[data-theme="dark"] .SevenGrid > .k-grid,
html[data-theme="dark"] .k-widget.k-grid,
html[data-theme="dark"] .k-grid {
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

html[data-theme="dark"] .k-grid-header,
html[data-theme="dark"] .k-grid-footer,
html[data-theme="dark"] .k-pager-wrap,
html[data-theme="dark"] .k-grid .k-grid-toolbar {
    border-color: var(--sv-border) !important;
    outline-color: var(--sv-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .SevenGrid { background: transparent !important; }
html[data-theme="dark"] .k-widget { background-color: var(--sv-bg-card); }

html[data-theme="dark"] .k-pager-wrap .k-link,
html[data-theme="dark"] .k-pager-wrap .k-pager-nav {
    background: var(--sv-bg-card) !important;
    border-color: var(--sv-border-strong) !important;
    color: var(--sv-text-2) !important;
}

/* warranty box (vehicle status tab): saturated orange !important in the light sheet -
   re-derived as the dark warning tint, same family as the E-00 status rows */
html[data-theme="dark"] .warning-background {
    background: #43301a !important;
    border: 1px solid #f7931e !important;
    color: #f5c08a !important;
}

    html[data-theme="dark"] .warning-background label,
    html[data-theme="dark"] .warning-background span,
    html[data-theme="dark"] .warning-background b,
    html[data-theme="dark"] .warning-background strong,
    html[data-theme="dark"] .warning-background a {
        color: #f5c08a !important;
    }

/* ---------- round 6: the systemic sweep - no milky background survives ---------- */

/* every modal body, everywhere */
html[data-theme="dark"] .modal-body {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text);
}

/* bootstrap .table cells everywhere (cheat sheet, detail modals, hand views) */
html[data-theme="dark"] .table > thead > tr > th,
html[data-theme="dark"] .table > tbody > tr > th,
html[data-theme="dark"] .table > thead > tr > td,
html[data-theme="dark"] .table > tbody > tr > td {
    border-color: var(--sv-border) !important;
    background-color: transparent;
    color: var(--sv-text);
}

html[data-theme="dark"] .table > thead > tr > th { background: var(--sv-bg-panel) !important; }

/* inline light backgrounds anywhere in the app - mapped to tokens by attribute match */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background-color:#ffffff"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:white"],
html[data-theme="dark"] [style*="background-color: white"],
html[data-theme="dark"] [style*="background:#f5f5f5"],
html[data-theme="dark"] [style*="background-color:#f5f5f5"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background:#fafafa"],
html[data-theme="dark"] [style*="background:#f9f9f9"],
html[data-theme="dark"] [style*="background:#eee"],
html[data-theme="dark"] [style*="background-color:#eee"],
html[data-theme="dark"] [style*="background:#eaeaea"] {
    background: var(--sv-bg-card) !important;
    color: var(--sv-text) !important;
}

/* the big errors dialog (_Notifications.cshtml inline peach !important styles): same warm
   semantic as the light theme, dark surface, amber ink that no deeper rule can wash out */
html[data-theme="dark"] .popUpErrorNotification td {
    background-color: #43301a !important;
    color: #f5c08a !important;
    -webkit-text-fill-color: #f5c08a !important;
}

html[data-theme="dark"] .popUpErrorNotification th {
    background-color: #5a3f1e !important;
    color: #f8d3a6 !important;
    -webkit-text-fill-color: #f8d3a6 !important;
    border-color: #6b4c22 !important;
}

html[data-theme="dark"] .popUpErrorNotification td { border-color: #6b4c22 !important; }

html[data-theme="dark"] .popUpErrorNotification tr:hover td {
    background-color: #5c452a !important;
    color: #ffe2b8 !important;
    -webkit-text-fill-color: #ffe2b8 !important;
}

html[data-theme="dark"] .ErrorNotificationToolbar {
    border-color: var(--sv-border) !important;
    background: var(--sv-bg-panel) !important;
}

/* inline warm tints (error/failed lists painted #fdebd7/#fdeee5/#fff7ed inline) become the
   dark warning tint with amber ink - text-fill so no deeper rule can wash it out */
html[data-theme="dark"] [style*="#fdebd7"],
html[data-theme="dark"] [style*="#fdeee5"],
html[data-theme="dark"] [style*="#fff7ed"],
html[data-theme="dark"] [style*="#FDEBD7"] {
    background: #43301a !important;
    color: #f5c08a !important;
    -webkit-text-fill-color: #f5c08a !important;
}

    html[data-theme="dark"] [style*="#fdebd7"] *:not(input):not(select):not(textarea),
    html[data-theme="dark"] [style*="#fdeee5"] *:not(input):not(select):not(textarea),
    html[data-theme="dark"] [style*="#fff7ed"] *:not(input):not(select):not(textarea) {
        color: #f5c08a !important;
        -webkit-text-fill-color: #f5c08a !important;
    }

/* inline state greens (warranty active) become the dark success tint - counterpart of the
   orange .warning-background; whichever element carries the state carries the whole tint */
html[data-theme="dark"] [style*="lightgreen"],
html[data-theme="dark"] [style*="LightGreen"],
html[data-theme="dark"] [style*="#90EE90"],
html[data-theme="dark"] [style*="#90ee90"],
html[data-theme="dark"] .success-background {
    background: #17362a !important;
    border-color: #059669 !important;
    color: #86e0b8 !important;
}

    html[data-theme="dark"] [style*="lightgreen"] *,
    html[data-theme="dark"] [style*="#90EE90"] *,
    html[data-theme="dark"] .success-background * {
        color: #86e0b8 !important;
    }

/* the customer-title area is transparent (the login band looked alien as a dark slab);
   the admin header company box is handled by the #customerlogo rules instead */
html[data-theme="dark"] .customertitle {
    background: transparent !important;
}

    html[data-theme="dark"] .customertitle a,
    html[data-theme="dark"] .customertitle span {
        background: transparent !important;
        color: var(--sv-brand-hover) !important;
    }

    /* admin header only: the transparent brand logo needs a plate on the dark bar */
    html[data-theme="dark"] .headerbar .customertitle img {
        background: #ffffff !important;
        padding: 3px;
        border-radius: 4px;
    }

/* chrome autofill paints its own silver fill - repaint it with the dark input tokens */
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus,
html[data-theme="dark"] textarea:-webkit-autofill,
html[data-theme="dark"] select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--sv-bg-input) inset !important;
    box-shadow: 0 0 0 1000px var(--sv-bg-input) inset !important;
    -webkit-text-fill-color: var(--sv-text) !important;
    caret-color: var(--sv-text);
    border-color: var(--sv-border) !important;
    transition: background-color 99999s ease-in-out 0s;
}

/* the structural set, mirrored into modal scope (detail views open in #MainModal) */
html[data-theme="dark"] .modal-content table {
    background: var(--sv-bg-card) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .modal-content table th {
    background: var(--sv-bg-panel) !important;
    color: var(--sv-text) !important;
    border-color: var(--sv-border) !important;
}

html[data-theme="dark"] .modal-content table td { border-color: var(--sv-border) !important; }

html[data-theme="dark"] .modal-content fieldset,
html[data-theme="dark"] .modal-content hr,
html[data-theme="dark"] .tab-pane legend,
html[data-theme="dark"] .modal-content legend {
    border-color: var(--sv-border) !important;
    color: var(--sv-text-2);
    background: transparent !important;
}

/* ---------- round 7: the light-border sweep (source-enumerated) ---------- */

/* the rounded frame around form panels (#e5e5e5 in Reception.css / forms-style) */
html[data-theme="dark"] .tileBoxReception { border-color: var(--sv-border) !important; }
html[data-theme="dark"] .modal-body .panel-info { border-color: var(--sv-border) !important; }
html[data-theme="dark"] .partInventory { border-color: var(--sv-border) !important; }

/* the #ddd !important hairlines above/below every wizard step + the wedge underline */
html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li > a {
    border-top-color: var(--sv-border) !important;
    border-bottom-color: var(--sv-border) !important;
}

html[data-theme="dark"] .sw-theme-arrows > ul.step-anchor > li > a::before {
    border-bottom-color: transparent !important;
}

/* no remaining inner ring on the grid body */
html[data-theme="dark"] .k-grid-content { border: 0 !important; }
html[data-theme="dark"] .k-grid table,
html[data-theme="dark"] .k-grid-header-wrap,
html[data-theme="dark"] .k-grid-footer-wrap {
    border-color: var(--sv-border) !important;
}

/* the company-name box in the ADMIN HEADER only - the login page carries the same
   #customerlogo id on top of a photo, where any surface reads as an ugly black box */
html[data-theme="dark"] .headerbar #customerlogo,
html[data-theme="dark"] .headermenu > li > a.tp-icon,
html[data-theme="dark"] .headermenu .chat-icon {
    background: var(--sv-bg-panel) !important;
}

    html[data-theme="dark"] .headerbar #customerlogo span {
        background: transparent !important;
        color: var(--sv-brand-hover) !important;
    }

/* The row-menu lives INSIDE the row's operation cell, so the "selected row + hover"
   navy-ink rule above (and the .SevenGrid a:hover brand colour) reached its items and
   turned them blue. The menu is a popup, not row content: it keeps its own dark surface
   and plain white ink in every row state. Specificity here deliberately exceeds the
   row rules (5 classes) so no row state can repaint the menu. */
html[data-theme="dark"] .k-grid tr:hover .dropdown-menu,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .dropdown-menu,
html[data-theme="dark"] .k-grid tr:hover .OperationMenuList,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .OperationMenuList,
html[data-theme="dark"] .SevenGrid tr:hover .dropdown-menu,
html[data-theme="dark"] .SevenGrid tr.k-state-selected:hover .dropdown-menu {
    background: var(--sv-bg-card) !important;
}

html[data-theme="dark"] .k-grid tr:hover .dropdown-menu a,
html[data-theme="dark"] .k-grid tr:hover .dropdown-menu a *,
html[data-theme="dark"] .k-grid tr:hover .dropdown-menu a:hover,
html[data-theme="dark"] .k-grid tr:hover .dropdown-menu a:hover *,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .dropdown-menu a,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .dropdown-menu a *,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .dropdown-menu a:hover,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .dropdown-menu a:hover *,
html[data-theme="dark"] .k-grid tr:hover .OperationMenuList a,
html[data-theme="dark"] .k-grid tr:hover .OperationMenuList a *,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .OperationMenuList a,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .OperationMenuList a *,
html[data-theme="dark"] .SevenGrid tr:hover .dropdown-menu a,
html[data-theme="dark"] .SevenGrid tr:hover .dropdown-menu a *,
html[data-theme="dark"] .SevenGrid .dropdown-menu a:hover,
html[data-theme="dark"] .SevenGrid .dropdown-menu a:hover *,
html[data-theme="dark"] .OperationMenu a:hover,
html[data-theme="dark"] .OperationMenu a:hover *,
html[data-theme="dark"] .OperationMenuList a:hover,
html[data-theme="dark"] .OperationMenuList a:hover * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: transparent !important;
}

/* the menu rows themselves must not inherit the row tint */
html[data-theme="dark"] .k-grid tr:hover .dropdown-menu > li,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .dropdown-menu > li,
html[data-theme="dark"] .k-grid tr:hover .OperationMenuList > li,
html[data-theme="dark"] .k-grid tr.k-state-selected:hover .OperationMenuList > li {
    background: transparent !important;
}

    html[data-theme="dark"] .k-grid tr:hover .dropdown-menu > li:hover,
    html[data-theme="dark"] .k-grid tr.k-state-selected:hover .dropdown-menu > li:hover,
    html[data-theme="dark"] .k-grid tr:hover .OperationMenuList > li:hover,
    html[data-theme="dark"] .k-grid tr.k-state-selected:hover .OperationMenuList > li:hover {
        background: var(--sv-bg-hover) !important;
    }

/* ---------- print documents stay PAPER, on screen and on paper ---------- */
/* the print tabs host the Stimulsoft viewer output; a printed document is white paper
   with dark ink regardless of the app theme - the whole viewer subtree is exempted */
/* this app renders reports with the JS viewer (stiJsViewer* classes - see
   forms-style.css .stiJsViewerReportPanel and AdminLayout.js .stiJsViewerToolBarTable),
   not the MVC one; its toolbar menus are appended to body, so they are matched
   as roots too rather than only as descendants of the panel */
html[data-theme="dark"] .stiMvcViewerReportPanel,
html[data-theme="dark"] [class*="stiMvcViewer"],
html[data-theme="dark"] [class*="stiJsViewer"],
html[data-theme="dark"] [class*="stiViewer"],
html[data-theme="dark"] [id*="StiViewer"],
html[data-theme="dark"] [id*="stiViewer"],
html[data-theme="dark"] [id*="StiJsViewer"] {
    background: #ffffff !important;
    background-image: none !important;
    filter: none !important;
}

    html[data-theme="dark"] .stiMvcViewerReportPanel *,
    html[data-theme="dark"] [class*="stiMvcViewer"] *,
    html[data-theme="dark"] [class*="stiJsViewer"] *,
    html[data-theme="dark"] [class*="stiViewer"] *,
    html[data-theme="dark"] [id*="StiViewer"] *,
    html[data-theme="dark"] [id*="stiViewer"] *,
    html[data-theme="dark"] [id*="StiJsViewer"] * {
        background-color: #ffffff !important;
        color: #1a1a1a !important;
        -webkit-text-fill-color: #1a1a1a !important;
        border-color: #555 !important;
        filter: none !important;
    }

    /* toolbar icons are dark sprites on a light strip - keep the strip light grey
       so the buttons stay legible instead of white-on-white */
    html[data-theme="dark"] [class*="stiJsViewerToolBar"],
    html[data-theme="dark"] [class*="stiJsViewerToolBar"] * {
        background-color: #f0f0f0 !important;
    }

    /* the paper sits on the viewer surface; a light grey surround separates the page */
    html[data-theme="dark"] [class*="stiJsViewerReportPanel"] {
        background-color: #e9e9e9 !important;
    }

/* every print TAB by naming convention (pane id carries "Print_") - paper, whatever engine */
html[data-theme="dark"] .tab-pane[id*="Print_"] {
    background: #ffffff !important;
}

    html[data-theme="dark"] .tab-pane[id*="Print_"] * {
        background-color: #ffffff !important;
        color: #1a1a1a !important;
        -webkit-text-fill-color: #1a1a1a !important;
        border-color: #555 !important;
    }

        /* keep the section bands grey like the light theme, so the document reads as the
           same paper instead of a flat white sheet */
        html[data-theme="dark"] .tab-pane[id*="Print_"] th,
        html[data-theme="dark"] .tab-pane[id*="Print_"] thead td,
        html[data-theme="dark"] .tab-pane[id*="Print_"] .k-header {
            background-color: #e4e4e4 !important;
        }

@media print {
    html[data-theme="dark"] body {
        background: #fff !important;
        color: #000 !important;
    }

    html[data-theme="dark"] * {
        background: #fff !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }
}
