/* Elite admin surfaces. Light and dark share the same shapes; --mx-* supplies the color. ESS stays on its own chrome. */

html[data-mx-theme="light"] {
    --mx-nav-accent: #f7a833;
}

html[data-mx-theme="dark"] {
    --mx-nav-accent: #6d83ff;
}

html[data-mx-theme="dark"] body:not(.ess-page) {
    background: var(--mx-bg);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body.popup:not(.ess-page) {
    background: var(--mx-surface);
}

/* Page card. Home and the bare login layout keep their own canvas. */
html[data-mx-theme] body:not(.ess-page):not(.popup):not(.minimal-admin):not(:has(#admin-home)) #content {
    background-color: var(--mx-surface);
    border: 1px solid var(--mx-hair);
    border-radius: 16px;
    box-shadow: var(--mx-shadow);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(.popup):not(.minimal-admin):not(:has(#admin-home)) #content {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body.popup:not(.ess-page) #content {
    background-color: var(--mx-surface);
    color: var(--mx-text);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page):not(.popup) .section-header.sticky {
    background: var(--mx-glass-strong);
    border-bottom: 1px solid var(--mx-hair);
    box-shadow: none;
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
}

html[data-mx-theme="dark"] body:not(.ess-page) .section-header,
html[data-mx-theme="dark"] body:not(.ess-page) .section-header .title,
html[data-mx-theme="dark"] body:not(.ess-page) .section-header .title a:not(.btn):not(.k-button) {
    color: var(--mx-text);
}

/* Employee summary rail: one continuous bg-side stack (no mid-column cut). */
html[data-mx-theme] body:not(.ess-page) .detailed-sidebar {
    position: relative;
    --bg-side-x: -720px;
    --bg-side-y: -70px;
    background-color: var(--mx-sidebar-bg);
    background-image: url(/images/bg-side.jpg);
    background-repeat: repeat;
    background-size: auto;
    background-attachment: fixed;
    background-position: var(--bg-side-x) var(--bg-side-y);
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left,
html[data-mx-theme="dark"] body:not(.ess-page) .detailed-sidebar {
    color: var(--mx-text);
}

/* Aside is grid-row 2; left menu wash starts at row 3 — delay wash one header band (DevTools ~72px). */
html[data-mx-theme] body:not(.ess-page) .detailed-sidebar::after {
    content: "";
    position: absolute;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .detailed-sidebar::after {
    background: rgba(6, 10, 24, .7);
}

html[data-mx-theme="light"] body:not(.ess-page) .detailed-sidebar::after {
    background: rgba(12, 36, 88, .7);
}

html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.empty,
html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.spinner.active {
    position: relative;
    z-index: 1;
}

html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.dcw,
html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.dcw .entity {
    background: transparent;
}

html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.dcw .entity::before,
html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.empty,
html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.spinner.active {
    background: var(--mx-surface);
}

html[data-mx-theme="dark"] body.has-left-sidebar:not(.ess-page) .sidebar-left {
    position: relative;
    background-position: -720px -70px;
}

html[data-mx-theme="dark"] body.has-left-sidebar:not(.ess-page) .sidebar-left::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: rgba(6, 10, 24, .7);
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left>.menu.tabbable {
    position: relative;
    z-index: 1;
    background: var(--mx-surface);
    border: 1px solid var(--mx-hair);
    border-top-left-radius: 0.3rem;
    border-bottom-left-radius: 0.3rem;
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left>.menu.tabbable,
html[data-mx-theme="dark"] body:not(.ess-page) .detailed-sidebar>.dcw,
html[data-mx-theme="dark"] body:not(.ess-page) .detailed-sidebar>.dcw .entity,
html[data-mx-theme="dark"] body:not(.ess-page) .detailed-sidebar>.empty {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.dcw {
    border: 1px solid var(--mx-hair);
    border-radius: 16px;
    /* Override detailed-layout.css margin: var(--dcw-m) — no top inset on themed admin. */
    margin: 0 var(--dcw-m) var(--dcw-m) var(--dcw-m);
    --dcw-h: calc(100vh - var(--dcw-top) - var(--dcw-m));
}

/* Rail sits on blue wash: light theme needs a light hairline (same idea as dark --mx-hair). */
html[data-mx-theme="light"] body:not(.ess-page) .detailed-sidebar>.dcw {
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.dcw .entity-header .card {
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left .nav-tabs-line {
    border-right-color: var(--mx-hair-strong);
}

/* Skip detailed-layout empty-effect.png; column wallpaper only. */
html[data-mx-theme] body:not(.ess-page) .detailed-sidebar>.dcw::after {
    display: none;
}

html[data-mx-theme="light"] body:not(.ess-page) .detailed-sidebar>.dcw .employee .employee-img {
    border-color: var(--mx-surface);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

html[data-mx-theme="light"] body:not(.ess-page) .detailed-sidebar>.dcw .employee .employee-img::after {
    display: none;
    margin: 0;
}

html[data-mx-theme="dark"] body:not(.ess-page) .detailed-sidebar>.dcw .employee .employee-img {
    border-color: var(--mx-surface);
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .detailed-sidebar>.dcw .employee .employee-img::after {
    display: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left .nav-item {
    width: auto;
    margin-inline: 6px;
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left .nav-link,
html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-link {
    border-radius: 12px;
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left .nav-link,
html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-link {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left .form-control,
html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left input[type="search"],
html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left input[type="text"] {
    background-color: var(--mx-input-bg);
    color: var(--mx-input-text);
    border-color: var(--mx-input-border);
}

html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-link.active,
html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-link.active:focus,
html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-item.open .nav-link,
html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left .nav-link.active {
    background: var(--mx-chip-strong);
    border-color: transparent;
    border-inline-start: 2px solid var(--mx-nav-accent);
    border-radius: 12px;
}

/* Same horizontal crop as the header, plus the header's bottom wash, so the photo in the margin meets the header as one color. Square the menu corner so it stays the menu background. */
html[data-mx-theme="light"] body.has-left-sidebar:not(.ess-page) .sidebar-left {
    position: relative;
    background-position: -720px -70px;
}

html[data-mx-theme="light"] body.has-left-sidebar:not(.ess-page) .sidebar-left::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: rgba(12, 36, 88, .7);
}

html[data-mx-theme="light"] body:not(.ess-page) .sidebar-left>.menu.tabbable {
    position: relative;
    z-index: 1;
    border-top-left-radius: 0.3rem;
    border-bottom-left-radius: 0;
}

html[data-mx-theme="light"] body:not(.ess-page) .sidebar-left .nav-item {
    width: 101%;
    margin-inline: 0;
}

html[data-mx-theme="light"] body:not(.ess-page) .sidebar-left .nav-link {
    border-radius: 0;
    background-color: transparent;
}

html[data-mx-theme="light"] body:not(.ess-page) .sidebar-left .nav-link.active,
html[data-mx-theme="light"] body:not(.ess-page) .sidebar-left .nav-link.active:focus {
    background: transparent;
    border-color: transparent;
    border-top-color: #e1e4e8;
    border-bottom-color: #e1e4e8;
    border-inline-start: 2px solid #f7a833;
    border-radius: 0;
    color: #22262a;
}

html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-link.active,
html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-link.active:focus,
html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-item.open .nav-link,
html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left .nav-link.active {
    color: var(--mx-text);
}

/* Sidebar category headers — readable text + accent underline in dark. */
html[data-mx-theme="dark"] body:not(.ess-page) .nav-item-category>.category-name {
    background-color: transparent;
    color: #c5cee3;
}

html[data-mx-theme="dark"] body:not(.ess-page) .nav-item-category>.category-name>.category-border {
    border-top-color: var(--mx-nav-accent);
}

/* Dark dialogs, menus, and leftover light panels */
html[data-mx-theme="dark"] body:not(.ess-page) .card,
html[data-mx-theme="dark"] body:not(.ess-page) .card-header,
html[data-mx-theme="dark"] body:not(.ess-page) .card-footer,
html[data-mx-theme="dark"] body:not(.ess-page) .card-body,
html[data-mx-theme="dark"] body:not(.ess-page) .list-group-item,
html[data-mx-theme="dark"] body:not(.ess-page) .panel,
html[data-mx-theme="dark"] body:not(.ess-page) .panel-body,
html[data-mx-theme="dark"] body:not(.ess-page) .panel-heading,
html[data-mx-theme="dark"] body:not(.ess-page) .well {
    background-color: var(--mx-surface);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .admin-config-group .title,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-config-group .small-title,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-config-group .head {
    border-bottom-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .job-timeline .job-activity .step .seq,
html[data-mx-theme="dark"] body:not(.ess-page) .action-timeline .row section .step {
    background-color: #243056;
    color: #9eb6ff;
    box-shadow: 0 0 0 4px var(--mx-surface), inset 0 1px 0 rgba(255, 255, 255, .08);
}

html[data-mx-theme="dark"] body:not(.ess-page) .job-activity .card-header.rounded-xl {
    background-color: var(--mx-surface-2);
    border: 1px solid var(--mx-hair-strong);
    border-bottom: 0;
    border-radius: 10px 10px 0 0 !important;
    margin-inline: 15px;
    width: calc(100% - 30px);
    max-width: calc(100% - 30px);
}

html[data-mx-theme="dark"] body:not(.ess-page) .job-activity .border.rounded-bottom {
    background-color: var(--mx-surface);
    border-color: var(--mx-hair-strong);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

html[data-mx-theme="dark"] body:not(.ess-page) .badge {
    border-color: transparent;
}

html[data-mx-theme="dark"] body:not(.ess-page) .badge-warning {
    color: #1a1408;
}

html[data-mx-theme="dark"] body:not(.ess-page) .action-timeline .row section,
html[data-mx-theme="dark"] body:not(.ess-page) .action-timeline .row section::before {
    background: var(--mx-surface);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .action-timeline .row section::before {
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme] body:not(.ess-page) .modal-content {
    background-color: var(--mx-modal-bg);
    border: 1px solid var(--mx-hair);
    border-radius: 18px;
    overflow: hidden;
}

html[data-mx-theme="dark"] body:not(.ess-page) .modal-content {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .modal-header,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-footer,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-body,
html[data-mx-theme="dark"] body:not(.ess-page) .offcanvas,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu {
    background-color: transparent;
    color: var(--mx-text);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .modal .modal-header {
    background-color: var(--mx-surface-2) !important;
    border-bottom: 1px solid var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .modal-header .close,
html[data-mx-theme="dark"] body:not(.ess-page) .modal button.close {
    color: var(--mx-muted);
    text-shadow: none;
    opacity: 1;
}

html[data-mx-theme="dark"] body:not(.ess-page) .modal-header .close:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-header .close:focus,
html[data-mx-theme="dark"] body:not(.ess-page) .modal button.close:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .modal button.close:focus {
    color: var(--mx-text);
    opacity: 1;
}

html[data-mx-theme="dark"] body:not(.ess-page) .offcanvas,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu {
    background-color: var(--mx-surface);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .layer,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .offcanvas-content,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .tab-content,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .tab-pane {
    background: var(--mx-surface);
    color: var(--mx-text);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .offcanvas-tabs,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-nav .navigate-back {
    background: var(--mx-surface-2);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .offcanvas-tabs .nav-link {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .offcanvas-tabs .nav-link.active {
    background: var(--mx-surface);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-item,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .menubar-link {
    border-bottom-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-link,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-tab-service .menubar-link,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-item.selected .ocm-link,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-item.expanded .ocm-link,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-tab-service .dropdown.show>.menubar-link,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-tab-service .dropdown-item {
    background: transparent;
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-item.has-children:after,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .menubar-link.has-children:after,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-link>i,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-tab-service .menubar-icon {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-link:hover,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-menu .ocm-link:focus,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-tab-service .menubar-link:hover,
html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-tab-service .dropdown-item:hover {
    background: var(--mx-chip-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) #offcanvas-tab-service .dropdown-menu {
    background: transparent;
    border-bottom-color: var(--mx-hair);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .dropdown-menu {
    background-color: var(--mx-menu);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .dropdown-item {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .dropdown-item:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .dropdown-item:focus {
    background-color: var(--mx-chip-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .bg-white,
html[data-mx-theme="dark"] body:not(.ess-page) .bg-light {
    background-color: var(--mx-surface-2) !important;
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .text-muted,
html[data-mx-theme="dark"] body:not(.ess-page) .text-secondary {
    color: var(--mx-muted) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .text-dark,
html[data-mx-theme="dark"] body:not(.ess-page) .text-body {
    color: var(--mx-text) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) hr,
html[data-mx-theme="dark"] body:not(.ess-page) .border,
html[data-mx-theme="dark"] body:not(.ess-page) .border-top,
html[data-mx-theme="dark"] body:not(.ess-page) .border-bottom {
    border-color: var(--mx-hair-strong) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .nav-tabs {
    border-bottom-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .nav-tabs .nav-link {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .nav-tabs .nav-link.active {
    background-color: var(--mx-surface);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong) var(--mx-hair-strong) var(--mx-surface);
}

html[data-mx-theme="dark"] body:not(.ess-page) .sidebar-left .nav-tabs .nav-link.active,
html[data-mx-theme="dark"] body:not(.ess-page) .tabs-left>.nav-aside>.nav-tabs-line .nav-link.active {
    background: var(--mx-chip-strong);
    color: var(--mx-text);
    border-color: transparent;
    border-inline-start: 2px solid var(--mx-nav-accent);
}

html[data-mx-theme="dark"] body:not(.ess-page) .table,
html[data-mx-theme="dark"] body:not(.ess-page) .table> :not(caption)>*>* {
    background-color: var(--mx-surface);
    color: var(--mx-text);
    border-color: var(--mx-table-border);
}

html[data-mx-theme="dark"] body:not(.ess-page) .table thead th {
    background-color: var(--mx-table-header);
    color: var(--mx-muted);
}

/* Fields */
html[data-mx-theme] body:not(.ess-page) .form-control,
html[data-mx-theme] body:not(.ess-page) .custom-select,
html[data-mx-theme] body:not(.ess-page) textarea,
html[data-mx-theme] body:not(.ess-page) select,
html[data-mx-theme] body:not(.ess-page) .select2-container--default .select2-selection--single,
html[data-mx-theme] body:not(.ess-page) .select2-container--default .select2-selection--multiple {
    background-color: var(--mx-input-bg);
    border-color: var(--mx-input-border);
    border-radius: 10px;
}

html[data-mx-theme="dark"] body:not(.ess-page) .form-control,
html[data-mx-theme="dark"] body:not(.ess-page) .custom-select,
html[data-mx-theme="dark"] body:not(.ess-page) textarea,
html[data-mx-theme="dark"] body:not(.ess-page) select,
html[data-mx-theme="dark"] body:not(.ess-page) .select2-container--default .select2-selection--single,
html[data-mx-theme="dark"] body:not(.ess-page) .select2-container--default .select2-selection--multiple {
    color: var(--mx-input-text);
}

html[data-mx-theme] body:not(.ess-page) .form-control:focus,
html[data-mx-theme] body:not(.ess-page) .custom-select:focus,
html[data-mx-theme] body:not(.ess-page) select:focus,
html[data-mx-theme] body:not(.ess-page) textarea:focus,
html[data-mx-theme] body:not(.ess-page) .dg-toolbar-contextual .dg-quick-search-input:focus,
html[data-mx-theme] body:not(.ess-page) .dg-page-size-chooser:focus,
html[data-mx-theme] body:not(.ess-page) .select2-container--default.select2-container--focus .select2-selection,
html[data-mx-theme] body:not(.ess-page) .select2-container--default.select2-container--open .select2-selection {
    border-color: #8b98e8;
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .form-control:focus,
html[data-mx-theme="dark"] body:not(.ess-page) .custom-select:focus,
html[data-mx-theme="dark"] body:not(.ess-page) select:focus,
html[data-mx-theme="dark"] body:not(.ess-page) textarea:focus,
html[data-mx-theme="dark"] body:not(.ess-page) .dg-toolbar-contextual .dg-quick-search-input:focus,
html[data-mx-theme="dark"] body:not(.ess-page) .dg-page-size-chooser:focus {
    background-color: var(--mx-input-bg);
    color: var(--mx-input-text);
}

html[data-mx-theme="light"] body:not(.ess-page) .form-control:disabled,
html[data-mx-theme="light"] body:not(.ess-page) input:disabled:not([type=checkbox]):not([type=radio]):not(.select2-search__field),
html[data-mx-theme="light"] body:not(.ess-page) textarea:disabled,
html[data-mx-theme="light"] body:not(.ess-page) select:disabled {
    background-color: #e7ebf2 !important;
    color: #5b6889 !important;
    border: 1px dashed #b7c0d4 !important;
    cursor: not-allowed;
    box-shadow: none;
}

html[data-mx-theme="light"] body:not(.ess-page) .select2.select2-container--disabled {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none;
    cursor: not-allowed;
}

html[data-mx-theme="light"] body:not(.ess-page) .select2.select2-container--disabled .select2-selection {
    background-color: #e7ebf2 !important;
    color: #5b6889 !important;
    border: 1px solid #c5cedd !important;
    cursor: not-allowed;
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .form-control:disabled,
html[data-mx-theme="dark"] body:not(.ess-page) input:disabled:not([type=checkbox]):not([type=radio]):not(.select2-search__field),
html[data-mx-theme="dark"] body:not(.ess-page) textarea:disabled,
html[data-mx-theme="dark"] body:not(.ess-page) select:disabled {
    background-color: #1c243f !important;
    color: var(--mx-muted) !important;
    border: 1px dashed #4c5878 !important;
    cursor: not-allowed;
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .select2.select2-container--disabled {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none;
    cursor: not-allowed;
}

html[data-mx-theme="dark"] body:not(.ess-page) .select2.select2-container--disabled .select2-selection {
    background-color: #1c243f !important;
    color: var(--mx-muted) !important;
    border: 1px solid #4c5878 !important;
    cursor: not-allowed;
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .form-control[readonly] {
    background-color: var(--mx-surface-2);
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .form-control::placeholder {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) label,
html[data-mx-theme="dark"] body:not(.ess-page) .control-label,
html[data-mx-theme="dark"] body:not(.ess-page) .col-form-label {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .input-group-text {
    background-color: var(--mx-surface-2);
    color: var(--mx-muted);
    border-color: var(--mx-input-border);
}

html[data-mx-theme] body:not(.ess-page) .form-check-input:not(:checked):not(:indeterminate),
html[data-mx-theme] body:not(.ess-page) .dg-cell-selector-checkbox:not(:checked) {
    background-color: var(--mx-input-bg);
    border-color: var(--mx-hair-strong);
}

/* Off switches need a grey track so the white knob reads on dark surfaces. On stays orange. */
html[data-mx-theme="dark"] body:not(.ess-page) .switch>input[type="checkbox"]:not(:checked)~.switch-toggle {
    background-color: #8d96ad;
    border-color: #6e778f;
}

html[data-mx-theme="dark"] body:not(.ess-page) .switch>input[type="checkbox"]:is(:disabled, [readonly]):not(:checked)~.switch-toggle {
    background-color: #8d96ad;
    border-color: #6e778f;
    opacity: 0.72;
}

html[data-mx-theme="dark"] body:not(.ess-page) .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--mx-input-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .select2-search__field {
    background-color: var(--mx-input-bg);
    color: var(--mx-input-text);
    border-color: var(--mx-input-border);
}

html[data-mx-theme="dark"] body:not(.ess-page) .select2-dropdown {
    background-color: var(--mx-menu);
}

html[data-mx-theme="dark"] body:not(.ess-page) .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-mx-theme="dark"] body:not(.ess-page) .select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--mx-chip-strong);
    color: var(--mx-text);
}

/* Name parts stay separate fields. The preview line under them is the only group. */
html[data-mx-theme] #employee-name-fields .employee-name-inputs,
html[data-mx-theme] body:not(.ess-page) .composite-name .input-group.wide {
    display: flex;
    gap: 8px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

html[data-mx-theme] #employee-name-fields .employee-name-inputs:focus-within {
    border-color: transparent;
    box-shadow: none;
}

html[data-mx-theme] #employee-name-fields .employee-name-inputs>.form-control,
html[data-mx-theme] #employee-name-fields .employee-name-inputs>.form-control:first-child,
html[data-mx-theme] #employee-name-fields .employee-name-inputs>.form-control:last-child,
html[data-mx-theme] #employee-name-fields .employee-name-inputs>.form-control:focus,
html[data-mx-theme] body:not(.ess-page) .composite-name .input-group.wide .form-control {
    margin: 0 !important;
    background-color: var(--mx-input-bg);
    border: 1px solid var(--mx-input-border);
    border-radius: 10px !important;
    box-shadow: none;
}

html[data-mx-theme="dark"] #employee-name-fields .employee-name-inputs>.form-control {
    color: var(--mx-input-text);
}

html[data-mx-theme] #employee-name-fields .employee-name-preview {
    background: var(--mx-surface-2) !important;
    border: 1px solid var(--mx-hair);
}

html[data-mx-theme="dark"] #employee-name-fields .employee-name-preview {
    color: var(--mx-text);
}

/* Uploads. The photo is not recolored. */
html[data-mx-theme] body:not(.ess-page) .fileupload-container {
    background: var(--mx-surface-2) !important;
    border: 1px dashed var(--mx-hair-strong) !important;
    border-radius: 14px;
}

html[data-mx-theme="dark"] body:not(.ess-page) .fileupload-container {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page) .fileupload-container .fileupload-thumb-wrapper {
    border-color: var(--mx-hair-strong) !important;
    background: transparent;
}

html[data-mx-theme="dark"] body:not(.ess-page) .fileupload-container .file-icon {
    color: color-mix(in srgb, var(--mx-muted) 70%, transparent);
}

html[data-mx-theme] body:not(.ess-page) .fileupload-container img {
    filter: none;
}

/* Datagrid */
html[data-mx-theme] .datagrid-root {
    --dg-border-radius: 12px;
}

html[data-mx-theme="light"] .datagrid-root {
    --dg-border-color: var(--mx-hair-strong);
    --dg-header-bg: #f7f8fb;
    --dg-footer-bg: var(--mx-surface);
    --dg-pager-bg: var(--mx-surface);
    --dg-toolbar-bg: var(--mx-surface);
    --dg-row-bg: var(--mx-surface);
    --dg-row-even-bg: #f7f8fb;
    --dg-row-hover-color: #eef2f8;
    --dg-row-active-color: #e7eef8;
    --dg-row-inactive-color: #fbfcfd;
}

html[data-mx-theme="dark"] .datagrid-root {
    --dg-border-color: var(--mx-hair-strong);
    --dg-header-bg: var(--mx-surface-2);
    --dg-footer-bg: var(--mx-surface);
    --dg-pager-bg: var(--mx-surface);
    --dg-toolbar-bg: var(--mx-surface);
    --dg-toolbar-accent: #7ea2ff;
    --dg-toolbar-accent-hover: var(--mx-text);
    --dg-toolbar-accent-soft: rgba(109, 131, 255, .22);
    --dg-row-bg: var(--mx-surface);
    --dg-row-even-bg: color-mix(in srgb, #fff 4%, var(--mx-surface));
    --dg-row-hover-color: var(--mx-chip-strong);
    /* Edit row plate must be opaque (not rgba chip). */
    --dg-row-active-color: color-mix(in srgb, #6d83ff 16%, var(--mx-surface));
    --dg-row-inactive-color: color-mix(in srgb, #fff 2%, var(--mx-surface));
    --dg-toolbar-muted: var(--mx-muted);
    color: var(--mx-text);
    background: var(--mx-surface);
}

html[data-mx-theme="light"] .dg-striped {
    --dg-row-even-bg: #f7f8fb;
}

html[data-mx-theme="dark"] .dg-striped {
    --dg-row-even-bg: color-mix(in srgb, #fff 4%, var(--mx-surface));
}

html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual,
html[data-mx-theme] .datagrid.datagrid-editing>.dg-grid>.dg-toolbar.dg-toolbar-contextual {
    background: var(--mx-surface);
    box-shadow: none;
}

html[data-mx-theme="dark"] .datagrid-root .dg-table .dg-tr.dg-edit-row .dg-col-pinned.omega::before,
html[data-mx-theme="dark"] .datagrid-root .dg-table .dg-tr.dg-edit-row .dg-col-pinned.alpha::before {
  opacity: 0;
}

html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-filter-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-filter-reset-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-import-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-import-menu-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-export-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-cancel,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-delete-selection-menu-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-filter-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-import-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-import-menu-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-export-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-cancel:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete:not(:disabled):focus-visible {
    min-height: 36px;
    background: var(--mx-chip);
    border-color: var(--mx-hair-strong);
    border-radius: 999px !important;
}

html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-filter-trigger,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-filter-reset-trigger,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-import-trigger,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-import-menu-trigger,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-export-trigger,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-tool-cancel,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-delete-selection-menu-trigger,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-filter-trigger:not(:disabled):hover,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-import-trigger:not(:disabled):hover,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-export-trigger:not(:disabled):hover,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-tool-cancel:not(:disabled):hover,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete:not(:disabled):hover,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete:not(:disabled):focus-visible {
    color: var(--mx-text);
}

html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-filter-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-import-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-export-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-cancel:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete:not(:disabled):hover {
    background: var(--mx-chip-strong);
}

html[data-mx-theme="light"] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete:not(:disabled),
html[data-mx-theme="light"] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete:not(:disabled):hover,
html[data-mx-theme="light"] .dg-toolbar.dg-toolbar-contextual .dg-tool-delete:not(:disabled):focus-visible {
    color: #b42318;
}

html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-filter-trigger.active,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-filter-trigger:has(.dg-toolbar-badge) {
    color: var(--dg-toolbar-accent-hover);
    background: var(--dg-toolbar-accent-soft);
    border-color: transparent;
    border-radius: 999px !important;
}

html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-add,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .dg-tool-save,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn.btn-primary {
    min-height: 36px;
    border-radius: 999px !important;
}

html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-tool-primary:not(:disabled):hover,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-tool-add:not(:disabled):hover,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .dg-tool-save:not(:disabled):hover,
html[data-mx-theme="dark"] .dg-toolbar.dg-toolbar-contextual .btn.btn-primary:not(:disabled):hover {
    --btn-hover-bg: var(--dg-toolbar-accent, #7ea2ff);
    --btn-state-color: #fff;
    color: #fff;
    background-color: var(--dg-toolbar-accent, #7ea2ff);
    border-color: var(--dg-toolbar-accent, #7ea2ff);
}

html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn:focus-visible,
html[data-mx-theme] .dg-pager-action.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(109, 131, 255, .35);
}

html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-import-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-import-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-tool-delete:first-child,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-tool-delete:first-child:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-tool-delete:first-child:focus-visible {
    border-start-start-radius: 999px !important;
    border-end-start-radius: 999px !important;
    border-start-end-radius: 0 !important;
    border-end-end-radius: 0 !important;
}

html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-import-menu-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-import-menu-trigger:not(:disabled):hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-delete-selection-menu-trigger,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-delete-selection-menu-trigger:hover,
html[data-mx-theme] .dg-toolbar.dg-toolbar-contextual .btn-group>.dg-delete-selection-menu-trigger:focus-visible {
    border-start-start-radius: 0 !important;
    border-end-start-radius: 0 !important;
    border-start-end-radius: 999px !important;
    border-end-end-radius: 999px !important;
}

html[data-mx-theme] .dg-toolbar-import-group .btn-group:focus-within,
html[data-mx-theme] .dg-toolbar-delete-selection .btn-group:focus-within {
    border-radius: 999px;
    box-shadow: 0 0 0 3px rgba(109, 131, 255, .35);
}

html[data-mx-theme] .dg-toolbar-import-group .btn-group>.btn:focus-visible,
html[data-mx-theme] .dg-toolbar-delete-selection .btn-group>.btn:focus-visible {
    box-shadow: none;
}

html[data-mx-theme] .dg-toolbar-contextual .dg-quick-search-input,
html[data-mx-theme] .dg-page-size-chooser.form-control {
    background-color: var(--mx-input-bg);
    border-color: var(--mx-input-border);
    border-radius: 10px;
}

html[data-mx-theme="dark"] .dg-toolbar-contextual .dg-quick-search-input,
html[data-mx-theme="dark"] .dg-page-size-chooser.form-control {
    color: var(--mx-input-text);
}

html[data-mx-theme] .dg-pager-action.btn {
    border-radius: 999px;
}

html[data-mx-theme="dark"] .dg-quick-search-icon,
html[data-mx-theme="dark"] .dg-sizechooser-label {
    color: var(--mx-muted);
}

html[data-mx-theme] .dg-table-wrapper,
html[data-mx-theme] .dg-table,
html[data-mx-theme] .dg-no-data>.dg-td {
    background-color: var(--mx-surface);
}

html[data-mx-theme="dark"] .dg-table-wrapper,
html[data-mx-theme="dark"] .dg-table,
html[data-mx-theme="dark"] .dg-no-data>.dg-td {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] .datagrid-loader {
    background-color: var(--mx-surface);
}

html[data-mx-theme="dark"] .dg-table .dg-th,
html[data-mx-theme="dark"] .dg-table .dg-th .dg-cell {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] .dg-table .dg-td,
html[data-mx-theme="dark"] .dg-table .dg-td .dg-cell {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] .dg-table .dg-td a {
    color: #7eb6ff;
}

html[data-mx-theme] .dg-table .dg-td img,
html[data-mx-theme] .dg-table .dg-td .fi {
    filter: none;
}

html[data-mx-theme="dark"] .dg-table .dg-tr-foot>td {
    background-color: var(--mx-surface-2);
    color: var(--mx-text);
}

html[data-mx-theme="light"] .dg-empty-state {
    border-color: var(--mx-hair);
    border-radius: 12px;
}

html[data-mx-theme="dark"] .dg-empty-state {
    background: var(--mx-surface);
    border-color: var(--mx-hair);
    border-radius: 12px;
    color: var(--mx-text);
}

html[data-mx-theme="dark"] .dg-empty-state-title {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] .dg-empty-state-surface {
    fill: var(--mx-surface-2);
}

html[data-mx-theme="dark"] .dg-empty-state-line,
html[data-mx-theme="dark"] .dg-empty-state-database,
html[data-mx-theme="dark"] .dg-empty-state-spark {
    stroke: var(--mx-muted);
}

/* Grid settings */
html[data-mx-theme] .dg-tools-modal .modal-content {
    border-radius: 18px;
}

html[data-mx-theme="dark"] .dg-tools-modal {
    --dg-toolbar-accent-soft: rgba(109, 131, 255, .16);
}

html[data-mx-theme] .dg-tools-tabs .btn {
    border-radius: 999px;
}

html[data-mx-theme] .dg-tools-tabs .btn:not(.active) {
    background: var(--mx-chip);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] .dg-tools-tabs .btn:not(.active) {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] .dg-tools-tab-count {
    color: var(--mx-text);
    background: var(--mx-chip-strong);
}

html[data-mx-theme="dark"] .dg-tools-tabs .btn.active .dg-tools-tab-count {
    color: #307abe;
    background: #fff;
}

html[data-mx-theme] .dg-tools-pager-setting,
html[data-mx-theme] .dg-columns-toolbar,
html[data-mx-theme] .dg-columns-sticky-stack,
html[data-mx-theme] .dg-column-inspector {
    background-color: var(--mx-surface-2);
    border-color: var(--mx-hair);
    box-shadow: none;
}

html[data-mx-theme="dark"] .dg-tools-pager-setting,
html[data-mx-theme="dark"] .dg-columns-toolbar,
html[data-mx-theme="dark"] .dg-columns-sticky-stack,
html[data-mx-theme="dark"] .dg-column-inspector {
    color: var(--mx-text);
}

html[data-mx-theme] .dg-column-list-item {
    border-bottom-color: var(--mx-hair);
}

html[data-mx-theme] .dg-column-list-item:hover,
html[data-mx-theme] .dg-column-drag-handle:hover:not(:disabled) {
    background-color: var(--mx-chip);
}

html[data-mx-theme="dark"] .dg-column-list-item:hover,
html[data-mx-theme="dark"] .dg-column-drag-handle:hover:not(:disabled) {
    color: var(--mx-text);
}

html[data-mx-theme] .dg-column-list-item.is-selected {
    background-color: var(--mx-chip-strong);
}

html[data-mx-theme] .dg-tools-modal-icon,
html[data-mx-theme] .dg-tools-section-icon,
html[data-mx-theme] .dg-tools-option-icon {
    background-color: var(--mx-chip-strong);
}

html[data-mx-theme="dark"] .dg-tools-option-text strong,
html[data-mx-theme="dark"] .dg-tools-modal .modal-title,
html[data-mx-theme="dark"] .dg-columns-title {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] .dg-tools-option-text small,
html[data-mx-theme="dark"] .dg-columns-count,
html[data-mx-theme="dark"] .dg-column-list-item.is-hidden .dg-column-list-name {
    color: var(--mx-muted);
}

/* Quick Access */
html[data-mx-theme] body:not(.ess-page) .home-quick-access-rail-tab,
html[data-mx-theme] body:not(.ess-page) .home-quick-access-rail-tab:hover {
    background: var(--mx-glass-strong);
    border: 1px solid var(--mx-hair-strong);
    box-shadow: var(--mx-shadow);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-quick-access-rail-tab,
html[data-mx-theme="dark"] body:not(.ess-page) .home-quick-access-rail-tab:hover {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget {
    background-color: var(--mx-menu);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget table th,
html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget table td {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget table td.day:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget table td span:hover {
    background: var(--mx-chip-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget table thead tr:first-child th:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget table th.picker-switch:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget table th.prev:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .bootstrap-datetimepicker-widget table th.next:hover {
    background: var(--mx-chip-strong) !important;
    color: var(--mx-text) !important;
}

/* Fullscreen MystroX loader. Light preloader.css stays the white wash and charcoal wordmark. */
html[data-mx-theme="dark"] body:not(.ess-page) .preloader {
    background-color: #0a0f24;
    background-image: var(--mx-bg);
}

html[data-mx-theme="dark"] body:not(.ess-page) .preloader::after {
    background-image: url("/images/logo-animated-on-dark.svg");
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .45));
}

/* Numeric fields. Same shape in both themes; --mx-* picks the surface. */
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox.k-input,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-numeric-wrap,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-numeric-wrap.k-state-focused {
    background-color: var(--mx-input-bg);
    color: var(--mx-input-text);
    border-color: var(--mx-input-border);
    border-radius: 10px;
    overflow: hidden;
}

html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-input-inner {
    background-color: transparent;
    color: var(--mx-input-text);
    border-radius: 0;
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page) .k-numerictextbox.k-input:focus-within,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox.k-input.k-focus,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-numeric-wrap.k-state-focused {
    border-color: #8b98e8;
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-input-spinner,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-select,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-spinner-increase,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-spinner-decrease,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-input-spinner .k-button,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-input-spinner .k-button:hover,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-select .k-link,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-select .k-link:hover {
    background: var(--mx-surface-2) !important;
    background-color: var(--mx-surface-2) !important;
    color: var(--mx-muted) !important;
    border-color: var(--mx-hair) !important;
    box-shadow: none !important;
}

html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-input-spinner .k-button .k-icon,
html[data-mx-theme] body:not(.ess-page) .k-numerictextbox .k-select .k-icon {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

html[data-mx-theme="dark"] body:not(.ess-page) input[type="number"]::-webkit-inner-spin-button,
html[data-mx-theme="dark"] body:not(.ess-page) input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

html[data-mx-theme="dark"] body:not(.ess-page) .numberinput-default::after {
    background: var(--mx-surface-2);
    border-color: var(--mx-hair);
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .numberinput-stepper,
html[data-mx-theme="dark"] body:not(.ess-page) .numberinput-stepper>i {
    color: var(--mx-muted);
}

/* Mystro Select2. The skin is .select2, not .select2-container--default. */
html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection,
html[data-mx-theme] body:not(.ess-page) .select2.select2-container--open .select2-selection--single,
html[data-mx-theme] body:not(.ess-page) .select2.select2-container--focus .select2-selection--single {
    background-color: var(--mx-input-bg);
    color: var(--mx-input-text);
    border-color: var(--mx-input-border);
    border-radius: 10px;
}

html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection .select2-selection__rendered {
    color: var(--mx-input-text);
}

html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection--single .select2-selection__arrow {
    background-color: transparent !important;
    border-inline-end: 0;
    border-inline-start: 1px solid var(--mx-input-border);
    box-shadow: none;
}

/* Home company / period filters use the same pill as the date filter, not the square select arrow. */
html[data-mx-theme] body:not(.ess-page) .admin-home .home-notification-company-wrap .select2 .select2-selection,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-period-wrap .select2 .select2-selection {
    height: 36px;
    padding-inline: 14px 0;
    border: 1px solid var(--h-hair-strong, var(--mx-hair-strong));
    border-radius: 999px;
    background: var(--h-chip, var(--mx-chip));
    box-shadow: none;
    overflow: hidden;
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-notification-company-wrap .select2.select2-container--focus .select2-selection--single,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-notification-company-wrap .select2.select2-container--open .select2-selection--single,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-period-wrap .select2.select2-container--focus .select2-selection--single,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-period-wrap .select2.select2-container--open .select2-selection--single {
    border-color: var(--h-hair-strong, var(--mx-hair-strong));
    background: var(--h-glass-strong, var(--mx-glass-strong));
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-notification-company-wrap .select2 .select2-selection__rendered,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-notification-company-wrap .select2 .select2-selection__placeholder,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-period-wrap .select2 .select2-selection__rendered,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-period-wrap .select2 .select2-selection__placeholder {
    color: var(--h-text, var(--mx-text));
    font-size: 13px;
    font-weight: 600;
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-notification-company-wrap .select2 .select2-selection__arrow,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-period-wrap .select2 .select2-selection__arrow {
    min-width: 32px;
    background: transparent;
    border: 0;
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-notification-company-wrap .select2 .select2-selection__arrow>b,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-period-wrap .select2 .select2-selection__arrow>b {
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border: 0;
    border-right: 1.5px solid var(--h-muted, var(--mx-muted));
    border-bottom: 1.5px solid var(--h-muted, var(--mx-muted));
    transform: rotate(45deg);
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-card__filter--yearly .select2 .select2-selection {
    height: 36px;
    padding-inline: 14px 0;
    border: 1px solid var(--h-hair-strong, var(--mx-hair-strong));
    border-radius: 999px;
    background: var(--h-chip, var(--mx-chip));
    box-shadow: none;
    overflow: hidden;
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-card__filter--yearly .select2.select2-container--focus .select2-selection--single,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-card__filter--yearly .select2.select2-container--open .select2-selection--single {
    border-color: var(--h-hair-strong, var(--mx-hair-strong));
    background: var(--h-glass-strong, var(--mx-glass-strong));
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-card__filter--yearly .select2 .select2-selection__rendered,
html[data-mx-theme] body:not(.ess-page) .admin-home .home-card__filter--yearly .select2 .select2-selection__placeholder {
    color: var(--h-text, var(--mx-text));
    font-size: 13px;
    font-weight: 600;
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-card__filter--yearly .select2 .select2-selection__arrow {
    min-width: 32px;
    background: transparent;
    border: 0;
}

html[data-mx-theme] body:not(.ess-page) .admin-home .home-card__filter--yearly .select2 .select2-selection__arrow>b {
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border: 0;
    border-right: 1.5px solid var(--h-muted, var(--mx-muted));
    border-bottom: 1.5px solid var(--h-muted, var(--mx-muted));
    transform: rotate(45deg);
}

html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection--single .select2-selection__arrow>b {
    position: static;
    width: 7px;
    height: 7px;
    margin: -4px 0 0;
    border: 0;
    border-right: 1.5px solid var(--mx-muted);
    border-bottom: 1.5px solid var(--mx-muted);
    border-radius: 0;
    transform: rotate(45deg);
}

html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection__clear,
html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection__choice__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-width: 0;
    margin: 0;
    padding: 0 0.35rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--mx-muted);
    line-height: 1;
}

html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection__clear::before,
html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection__clear::after,
html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection__choice__remove::before,
html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection__choice__remove::after {
    content: none;
}

html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection--multiple .select2-selection__clear,
html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection__choice:has(> .select2-option:empty) {
    display: none !important;
}

html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection--multiple .select2-search__field {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection--multiple .select2-search__field::-webkit-search-cancel-button,
html[data-mx-theme] body:not(.ess-page) .select2 .select2-selection--multiple .select2-search__field::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

html[data-mx-theme] body:not(.ess-page) .select2.select2-container--disabled .select2-selection__choice__remove {
    display: none !important;
}

html[data-mx-theme="light"] body:not(.ess-page) .select2.select2-container--disabled .select2-selection--multiple .select2-selection__choice {
    padding-inline: 0.65rem;
    background: #fff;
    border: 1px solid #d5dce8;
    border-radius: 8px;
    color: #2f3d59;
}

html[data-mx-theme="dark"] body:not(.ess-page) .select2.select2-container--disabled .select2-selection--multiple .select2-selection__choice {
    padding-inline: 0.65rem;
    background: var(--mx-chip-strong);
    border: 1px solid var(--mx-hair-strong);
    border-radius: 8px;
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page) .select2.select2-container--open .select2-selection--single .select2-selection__arrow>b {
    margin-top: 2px;
    border: 0;
    border-right: 1.5px solid var(--mx-muted);
    border-bottom: 1.5px solid var(--mx-muted);
    transform: rotate(-135deg);
}

html[data-mx-theme] body:not(.ess-page) .select2.select2-container--focus .select2-selection,
html[data-mx-theme] body:not(.ess-page) .select2.select2-container--open .select2-selection {
    border-color: #8b98e8;
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page) .select2-container .select2-dropdown {
    background-color: var(--mx-menu);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme] body:not(.ess-page) .select2-container .select2-search--dropdown {
    background-color: var(--mx-input-bg);
    border-bottom-color: var(--mx-hair);
}

html[data-mx-theme] body:not(.ess-page) .select2-container .select2-search .select2-search__field {
    background-color: var(--mx-input-bg);
    color: var(--mx-input-text);
}

html[data-mx-theme] body:not(.ess-page) .select2-container .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--mx-input-border);
    border-radius: 10px;
}

html[data-mx-theme] body:not(.ess-page) .select2-container .select2-search--dropdown .select2-search__field:focus {
    border-color: #8b98e8;
    box-shadow: none;
    outline: none;
}

html[data-mx-theme] body:not(.ess-page) .select2-container .select2-results__option {
    color: var(--mx-text);
    border-bottom-color: var(--mx-hair);
}

html[data-mx-theme] body:not(.ess-page) .select2-container .select2-results__option--highlighted,
html[data-mx-theme] body:not(.ess-page) .select2-container .select2-results__option[aria-selected="true"] {
    background-color: var(--mx-chip-strong);
    color: var(--mx-text);
}

/* Grid Settings light buttons. Tabs and primary stay pills; orange toggles stay orange. */
html[data-mx-theme] body:not(.ess-page) .dg-tools-modal .btn-light:not(.dg-tools-tabs .btn) {
    --btn-base-text: var(--mx-text);
    --btn-base-bg: var(--mx-chip);
    --btn-base-border: var(--mx-hair-strong);
    --btn-hover-bg: var(--mx-chip-strong);
    --btn-hover-border: var(--mx-hair-strong);
    --btn-active-bg: var(--mx-chip-strong);
    --btn-active-border: var(--mx-hair-strong);
    --btn-state-color: var(--mx-text);
    color: var(--mx-text);
    background-color: var(--mx-chip);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme] body:not(.ess-page) .dg-tools-modal .btn-light:not(.dg-tools-tabs .btn):disabled,
html[data-mx-theme] body:not(.ess-page) .dg-tools-modal .btn-light:not(.dg-tools-tabs .btn).disabled {
    --btn-base-text: var(--mx-muted);
    --btn-base-bg: var(--mx-chip);
    color: var(--mx-muted);
    background-color: var(--mx-chip);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] .dg-column-list-name {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] .dg-column-list-item.is-hidden .dg-column-list-name,
html[data-mx-theme="dark"] .dg-column-drag-handle {
    color: var(--mx-muted);
}

/* Shared widgets. Home keeps its own skin. Loaded last so these beat later widget files. */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=file]):not([type=image]):not([type=range]):not(.select2-search__field),
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) select:not(.select2-hidden-accessible),
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) textarea,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-input,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-input-solid,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-input-solid:focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-input-solid:focus-within,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-input-solid.k-focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-picker,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-dropdown,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-combobox,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-multiselect,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-datepicker,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-timepicker,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-datetimepicker,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-autocomplete {
    background-color: var(--mx-input-bg);
    border-color: var(--mx-input-border);
    border-radius: 10px;
}

/* Same quiet active border as an open select. The shared rule above resets the resting border. */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) textarea:focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .form-control:focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) input:focus:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=file]):not([type=image]):not([type=range]):not(.select2-search__field):not(.k-input-inner),
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-input-solid.k-focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-input-solid:focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-numerictextbox.k-input:focus-within,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-numerictextbox .k-numeric-wrap.k-state-focused,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-picker.k-focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-dropdown.k-focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-combobox.k-focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-multiselect.k-focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-datepicker.k-focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-datetimepicker.k-focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-autocomplete.k-focus {
    border-color: #8b98e8;
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-numerictextbox input:focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-input-inner:focus {
    border-color: transparent;
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=file]):not([type=image]):not([type=range]):not(.select2-search__field),
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) select:not(.select2-hidden-accessible),
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) textarea,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-input,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-input-solid,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-picker,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-dropdown,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-combobox,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-multiselect,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-datepicker,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-timepicker,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-datetimepicker,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-autocomplete {
    color: var(--mx-input-text);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) input[readonly],
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) textarea[readonly],
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .form-control[readonly] {
    background-color: var(--mx-surface-2) !important;
}

html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) .form-control:disabled,
html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) input:disabled:not([type=checkbox]):not([type=radio]):not(.select2-search__field),
html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) textarea:disabled {
    background-color: #e7ebf2 !important;
    border: 1px dashed #b7c0d4 !important;
    cursor: not-allowed;
}

html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) .select2.select2-container--disabled .select2-selection {
    background-color: #e7ebf2 !important;
    border: 1px solid #c5cedd !important;
    cursor: not-allowed;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .form-control:disabled,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) input:disabled:not([type=checkbox]):not([type=radio]):not(.select2-search__field),
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) textarea:disabled {
    background-color: #1c243f !important;
    border: 1px dashed #4c5878 !important;
    cursor: not-allowed;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .select2.select2-container--disabled .select2-selection {
    background-color: #1c243f !important;
    border: 1px solid #4c5878 !important;
    cursor: not-allowed;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) input[readonly],
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) textarea[readonly],
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .form-control[readonly],
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .form-control:disabled,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) input:disabled:not([type=checkbox]):not([type=radio]) {
    color: var(--mx-muted) !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-timepicker {
    border: 1px solid var(--mx-input-border);
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--mx-input-bg);
}

/* Whole composite gets the Company-style focus ring (avoids left-edge-only glow on os-picker). */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control:focus-within,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group:focus-within,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-timepicker:focus-within {
    border-color: #8b98e8;
    box-shadow: none;
    overflow: visible;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .select2-selection,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .form-control,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group .form-control,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-timepicker>.k-input-inner {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group>input.form-control:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=file]):not([type=image]):not([type=range]):not(.select2-search__field),
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group>input.form-control:focus:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=file]):not([type=image]):not([type=range]):not(.select2-search__field) {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
    overflow: hidden;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group {
    align-items: stretch;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group>.input-group-append {
    align-self: stretch;
    display: flex;
    height: auto;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group .input-group-text {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    height: auto;
    border-inline-start: 1px solid var(--mx-input-border) !important;
    background-color: transparent !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .select2.select2-container--focus .select2-selection--single,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .select2.select2-container--open .select2-selection--single,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .form-control:focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group .form-control:focus,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-timepicker.k-focus>.k-input-inner,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-timepicker:focus-within>.k-input-inner {
    border: 0;
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .select2.select2-container--disabled {
    background: var(--mx-surface-2);
    color: var(--mx-muted);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control>.select2,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control>.select2.select2-container--disabled {
    background: transparent;
    align-self: stretch;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group .input-group-text,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group [data-toggle="datetimepicker"] {
    background-color: var(--mx-input-bg) !important;
    color: var(--mx-text) !important;
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .select2-selection__arrow,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group .input-group-text,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-timepicker>.k-input-button,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-add-new-option],
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-target="#organization-structure-selection"],
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .btn-os-picker {
    --btn-base-bg: var(--mx-chip);
    --btn-base-text: var(--mx-text);
    --btn-base-border: transparent;
    --btn-hover-bg: var(--mx-chip-strong);
    --btn-hover-border: transparent;
    --btn-active-bg: var(--mx-chip-strong);
    --btn-state-color: var(--mx-text);
    background-color: var(--mx-chip);
    color: var(--mx-text);
    border-color: transparent;
    border-inline-start: 1px solid var(--mx-input-border);
    border-start-start-radius: 0 !important;
    border-end-start-radius: 0 !important;
    border-start-end-radius: 10px !important;
    border-end-end-radius: 10px !important;
    box-shadow: none;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group:focus-within {
    overflow: hidden;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.datetimepicker-group .input-group-text {
    border-radius: 0 !important;
}

/* Override styles.css dimming .btn-light > i to #5e6773 while idle. */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-add-new-option]:not(:disabled)>i,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-target="#organization-structure-selection"]:not(:disabled)>i,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .btn-os-picker:not(:disabled)>i,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .btn-os-picker:not(:disabled):not(:hover):not(:active):not(:focus)>i {
    color: #9eb0ff;
    opacity: 1;
}

html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-add-new-option]:not(:disabled)>i,
html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-target="#organization-structure-selection"]:not(:disabled)>i,
html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .btn-os-picker:not(:disabled)>i,
html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .btn-os-picker:not(:disabled):not(:hover):not(:active):not(:focus)>i {
    color: #4f6ef7;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-add-new-option]:disabled,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-target="#organization-structure-selection"]:disabled,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .btn-os-picker:disabled {
    --btn-base-bg: transparent;
    --btn-base-text: var(--mx-muted);
    background-color: transparent;
    color: var(--mx-muted);
    opacity: .7;
    cursor: not-allowed;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-add-new-option]:disabled>i,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group-append>button[data-target="#organization-structure-selection"]:disabled>i,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .btn-os-picker:disabled>i {
    color: var(--mx-muted);
    opacity: 1;
}

/* Disabled os-picker: style the outer shell only — inner select2 border caused the left-edge glow. */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control:has(> .select2.select2-container--disabled),
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control:has(.select2-container--disabled) {
    cursor: not-allowed;
    box-shadow: none;
}

html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control:has(> .select2.select2-container--disabled),
html[data-mx-theme="light"] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control:has(.select2-container--disabled) {
    background-color: #e7ebf2;
    border: 1px dashed #b7c0d4;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control:has(> .select2.select2-container--disabled),
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control:has(.select2-container--disabled) {
    background-color: #1c243f;
    border: 1px dashed #4c5878;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .select2.select2-container--disabled,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .select2-container--disabled {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .select2.select2-container--disabled .select2-selection,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .input-group.edit-control .select2-container--disabled .select2-selection {
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--mx-muted) !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-popup,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-list-container,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-calendar {
    background-color: var(--mx-menu);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-header,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-calendar-header,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-calendar-navigation {
    background-color: var(--mx-surface-2);
    color: var(--mx-text);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-nav-prev,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-nav-next,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-nav-fast,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-calendar-title,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-title,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-header .k-link {
    color: var(--mx-text);
    background-color: transparent;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-link,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-calendar-td .k-link,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar td .k-link {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar th,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-calendar-th,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-other-month,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-other-month .k-link {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-calendar-td:hover .k-link,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar td:hover .k-link,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-nav-prev:hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-nav-next:hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-nav-fast:hover {
    background-color: var(--mx-chip-strong);
    color: var(--mx-text);
    border-color: transparent;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-footer,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-calendar-footer,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-nav-today,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-footer .k-link {
    color: #9eb6ff;
    background-color: transparent;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-selected .k-link,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-state-selected .k-link,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-calendar .k-calendar-td.k-selected .k-link {
    background-color: #307abe;
    color: #fff;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-list .k-item:hover,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-list .k-item.k-state-selected,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-list-item:hover,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-list-item.k-selected {
    background-color: var(--mx-chip-strong);
    color: var(--mx-text);
}

/* Kendo grids and pivot tables. */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid {
    background-color: var(--mx-surface);
    border-color: var(--mx-hair);
    border-radius: 12px;
    overflow: hidden;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid-header,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid-header-wrap,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid th,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid-footer,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-pager-wrap,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid-pager {
    background-color: var(--mx-surface-2);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid th,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-header {
    color: var(--mx-muted);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid td,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid tr {
    background-color: var(--mx-surface);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid td {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid .k-alt,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid .k-alt>td {
    background-color: var(--mx-table-row-alt);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr:hover,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr:hover>td,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr.k-hover>td {
    background-color: var(--mx-chip);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid .k-state-hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr:hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr:hover>td,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr.k-hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr.k-hover>td,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr.k-state-hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr.k-state-hover>td,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid .k-detail-row .k-grid tbody>tr:hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid .k-detail-row .k-grid tbody>tr:hover>td {
    color: var(--mx-text) !important;
    background-color: var(--mx-chip) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid .k-state-selected,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tr.k-state-selected>td {
    color: var(--mx-text) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid.k-widget,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-detail-row .k-grid,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-detail-row .k-grid>table {
    background-color: var(--mx-surface) !important;
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr:hover .form-control,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr:hover .k-input,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody>tr:hover .k-input-inner {
    background-color: var(--mx-input-bg) !important;
    color: var(--mx-text) !important;
}

/* Daily Activity — system / done row tints (light + dark); classes set in onDataBoundDetail */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--system>td {
    background-color: #ffcccc !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--done>td {
    background-color: #add8e6 !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--system:hover>td,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--system.k-hover>td,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--system.k-state-hover>td {
    background-color: #f5b8b8 !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--done:hover>td,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--done.k-hover>td,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--done.k-state-hover>td {
    background-color: #9ecee6 !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--system>td {
    background-color: rgba(220, 96, 96, 0.28) !important;
    color: var(--mx-text) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--done>td {
    background-color: rgba(96, 156, 220, 0.28) !important;
    color: var(--mx-text) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--system:hover>td,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--system.k-hover>td,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--system.k-state-hover>td {
    background-color: rgba(220, 96, 96, 0.4) !important;
    color: var(--mx-text) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--done:hover>td,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--done.k-hover>td,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) #EmployeeActivityDistributions-grid tbody>tr.mx-activity-row--done.k-state-hover>td {
    background-color: rgba(96, 156, 220, 0.4) !important;
    color: var(--mx-text) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid a:not(.btn):not(.k-button) {
    color: #7eb6ff;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-pager-sizes .k-dropdown,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-pager-wrap select,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-pager-numbers-wrap select {
    background-color: var(--mx-input-bg);
    border-color: var(--mx-input-border);
    border-radius: 10px;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-pager-sizes .k-dropdown,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-pager-wrap,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-pager {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table {
    --pivot-border: var(--mx-hair-strong);
    --pivot-header: var(--mx-surface-2);
    --pivot-group: var(--mx-chip);
    --pivot-empty: var(--mx-muted);
    background: var(--mx-surface);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .pivot-table {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__table th,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__table td,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__head th,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__column-toggle,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__row-label {
    background: var(--mx-surface);
    border-color: var(--mx-hair);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__head th,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__row-label,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__section-title-cell,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__group-summary th,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__group-summary td {
    background: var(--mx-surface-2) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__table th,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__table td,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__row-label,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__column-toggle {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .pivot-table__summary-cell .pivot-table__value {
    background: var(--mx-chip);
    border-color: var(--mx-hair);
}

/* Pickers and editor. */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entpicker-filter,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entpicker .modal-header,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entpicker-item,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .typeahead-drop,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entitychooser-item .card,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entitychooser-item .card .card-header,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .note-editor.note-frame,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .note-toolbar,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .note-editable {
    background-color: var(--mx-surface);
    border-color: var(--mx-hair-strong) !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entpicker .modal-header,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entpicker-filter,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .note-toolbar {
    background-color: var(--mx-surface-2) !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .note-editable {
    background-color: var(--mx-input-bg);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .entpicker-item,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .typeahead-drop,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .typeahead-item,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .entitychooser-item .card,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .note-editable,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-treeview {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entpicker-item:hover,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entpicker-item.selected,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .typeahead-item:hover,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-treeview .k-hover,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-treeview .k-state-hover,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .k-treeview .k-state-hover:hover {
    background-color: var(--mx-chip-strong) !important;
    border-color: var(--mx-hair) !important;
    color: var(--mx-text) !important;
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entpicker-item img,
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .entitychooser-item img {
    filter: none;
}

/* Popup frame. The iframe page uses the same widget rules. */
html[data-mx-theme] body:not(.ess-page) .modal-dialog-app>.modal-content,
html[data-mx-theme] body:not(.ess-page) .modal-dialog-app .modal-body,
html[data-mx-theme] body:not(.ess-page) .modal-flex-fill-area {
    background-color: var(--mx-modal-bg);
}

html[data-mx-theme="dark"] body:not(.ess-page) .modal-closer {
    color: var(--mx-muted);
    text-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page) .modal-closer:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-closer:focus {
    color: var(--mx-text);
}

html[data-mx-theme] body.popup:not(.ess-page) #content .section-header,
html[data-mx-theme] body.popup:not(.ess-page) #content .section-header.sticky {
    background: var(--mx-glass-strong);
    background-color: var(--mx-glass-strong);
    border-bottom: 1px solid var(--mx-hair);
    box-shadow: none;
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
}

/* Language name block and audit menu. Flags and the green marker stay as they are. */
html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .locale-editor {
    background-color: var(--mx-surface);
    border-color: var(--mx-hair-strong);
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .locale-editor .nav-locales>.nav {
    background-color: var(--mx-surface-2);
    border-bottom-color: var(--mx-hair);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .locale-editor .nav-locales>.nav .nav-link {
    color: var(--mx-muted);
}

html[data-mx-theme] body:not(.ess-page):not(:has(#admin-home)) .locale-editor .nav-locales>.nav .nav-link.active {
    background-color: var(--mx-surface);
    border-color: var(--mx-hair-strong);
    border-bottom-color: var(--mx-surface);
    color: var(--mx-text);
}

/* Audit log dropdown: dev timeline in light; dark tokens only where contrast needs help. */
html[data-mx-theme] body:not(.ess-page) .entity-audit-log .entity-audit-log-menu {
    border: 1px solid var(--mx-hair);
    box-shadow: var(--mx-shadow);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-menu {
    background-color: var(--mx-menu);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-event-heading strong {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-event-heading time {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-marker {
    border-color: var(--mx-menu);
    box-shadow: 0 0 0 1px var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-actor {
    background-color: var(--mx-chip-strong);
    border: 1px solid var(--mx-hair-strong);
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-actor > i,
html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-actor-label {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-actor-name {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-footer {
    background-color: var(--mx-menu);
    border-top-color: var(--mx-hair);
    color: var(--primary);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-footer:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-footer:focus {
    background-color: var(--mx-surface-2);
    color: var(--primary-dark);
}

html[data-mx-theme="dark"] body:not(.ess-page) .entity-audit-log .entity-audit-log-event:not(:last-child)::before {
    background-color: var(--mx-hair-strong);
}

/* Neutral buttons. Primary, danger, and warning keep their colors. Hover tokens on btn-to-* stay. */
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-light:not(.btn-to-primary):not(.btn-to-danger):not(.btn-to-warning):not(.btn-to-success):not(.btn-to-info),
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-secondary:not(.btn-to-primary):not(.btn-to-danger):not(.btn-to-warning):not(.btn-to-success):not(.btn-to-info),
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid tbody .k-command-cell .k-button:not(.btn):not(.k-grid-delete):not(.k-grid-danger) {
    --btn-base-text: var(--mx-text);
    --btn-base-bg: var(--mx-surface-2);
    --btn-base-border: var(--mx-hair-strong);
    --btn-hover-bg: var(--mx-chip-strong);
    --btn-hover-border: var(--mx-hair-strong);
    --btn-active-bg: var(--mx-chip-strong);
    --btn-active-border: var(--mx-hair-strong);
    --btn-state-color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-light.btn-to-danger,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-light.btn-to-warning,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-light.btn-to-primary,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-secondary.btn-to-danger {
    --btn-base-text: var(--mx-text);
    --btn-base-bg: var(--mx-surface-2);
    --btn-base-border: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-outline-light,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-outline-secondary {
    --btn-base-text: var(--mx-text);
    --btn-base-bg: transparent;
    --btn-base-border: var(--mx-hair-strong);
    --btn-hover-bg: var(--mx-chip);
    --btn-hover-border: var(--mx-hair-strong);
    --btn-active-bg: var(--mx-chip-strong);
    --btn-active-border: var(--mx-hair-strong);
    --btn-state-color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-group>.btn-light.active,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .btn-group-toggle>.btn-light.active,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) label.btn-light.active {
    --btn-base-bg: var(--mx-chip-strong);
    --btn-active-bg: var(--mx-chip-strong);
    box-shadow: inset 0 0 0 1px var(--mx-hair-strong);
}

/* Pager page chip. Icon font on the arrows stays. */
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-pager .k-link,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-pager-nav {
    color: var(--mx-text);
    background-color: transparent;
    border-color: transparent;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-pager .k-link:hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-pager-nav:hover {
    color: var(--mx-text);
    background-color: var(--mx-chip);
    border-color: transparent;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-pager .k-pager-numbers .k-link.k-selected,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-pager .k-pager-numbers .k-link.k-selected:hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-pager-numbers .k-link.k-state-selected,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-pager-numbers .k-link.k-state-selected:hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-pager .k-state-selected {
    color: var(--mx-text);
    background-color: var(--mx-chip-strong);
    border-color: var(--mx-hair-strong);
    box-shadow: none;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-pager .k-pager-sizes {
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-toolbar {
    background: var(--mx-surface-2);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-toolbar .btn,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-toolbar .k-button {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-toolbar .btn:hover,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-grid-toolbar .k-button:hover {
    color: var(--mx-text);
    background-color: transparent;
}

/* Role chips, type badges, and the organization tree. */
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .select2 .select2-selection--multiple .select2-selection__choice {
    color: var(--mx-text);
    background: var(--mx-chip);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .select2 .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .badge-secondary,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .badge-light,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .badge.badge-light.text-muted {
    color: var(--mx-text) !important;
    background-color: var(--mx-chip-strong) !important;
    border: 1px solid var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-treeview,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .tree,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-content,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-editable-area,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-group,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .rulegroup {
    background-color: var(--mx-surface);
    color: var(--mx-text);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-treeview .k-treeview-leaf,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-treeview .k-in {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-treeview .k-treeview-leaf.k-selected,
html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .k-treeview .k-in.k-state-selected {
    background-color: var(--mx-chip-strong) !important;
    color: var(--mx-text) !important;
    border-color: transparent !important;
}

html[data-mx-theme="dark"] body:not(.ess-page):not(:has(#admin-home)) .rulegroup .rulegroup {
    background-color: var(--mx-surface-2);
}

/* Report accordions and other gray labels were #596167, which disappears on the dark surface. */
html[data-mx-theme="dark"] body:not(.ess-page) .text-gray,
html[data-mx-theme="dark"] body:not(.ess-page) a.text-gray,
html[data-mx-theme="dark"] body:not(.ess-page) a.text-gray:hover,
html[data-mx-theme="dark"] body:not(.ess-page) a.text-gray:focus,
html[data-mx-theme="dark"] body:not(.ess-page) .report-page .card-header,
html[data-mx-theme="dark"] body:not(.ess-page) .report-page .card-header h4,
html[data-mx-theme="dark"] body:not(.ess-page) .report-page .card-link,
html[data-mx-theme="dark"] body:not(.ess-page) .report-page label,
html[data-mx-theme="dark"] body:not(.ess-page) .report-page .control-label {
    color: var(--mx-text) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .report-page .card-header.bg-white,
html[data-mx-theme="dark"] body:not(.ess-page) .report-page a.card-header {
    background-color: var(--mx-surface-2) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .modal-title,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-header,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-header h1,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-header h2,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-header h3,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-header h4,
html[data-mx-theme="dark"] body:not(.ess-page) .modal-header h5,
html[data-mx-theme="dark"] body:not(.ess-page) .k-window-title,
html[data-mx-theme="dark"] body:not(.ess-page) .k-window-titlebar,
html[data-mx-theme="dark"] body.popup:not(.ess-page) .section-header .title {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] .dg-page,
html[data-mx-theme="dark"] .dg-page-range,
html[data-mx-theme="dark"] .dg-pager-action,
html[data-mx-theme="dark"] .dg-pager-action.btn,
html[data-mx-theme="dark"] .dg-sizechooser-label,
html[data-mx-theme="dark"] .dg-page-ellipsis {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] button.dg-page.dg-page-number.btn.btn-light.active,
html[data-mx-theme="dark"] button.dg-page.dg-page-number.btn.btn-light.active:hover {
    color: #fff !important;
    background: #3451b2 !important;
    border-color: #3451b2 !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .tree-state::before {
    border-color: var(--mx-hair-strong);
    background-color: var(--mx-input-bg);
}

html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .on:before,
html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .on:after,
html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .in-on:before,
html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .in-on:after {
    border-color: #3dcb9a;
}

html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .in-on:before,
html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .in-on:after,
html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .in-off:before,
html[data-mx-theme="dark"] body:not(.ess-page) .custom-tree .in-off:after {
    opacity: 0.3;
}

html[data-mx-theme="dark"] body:not(.ess-page) .alert-success,
html[data-mx-theme="dark"] body:not(.ess-page) .validation-summary-valid {
    color: #d8f8ec;
    background-color: #12382c;
    border-color: #1d5c46;
}

html[data-mx-theme="dark"] body:not(.ess-page) .alert-info {
    color: #d6e4ff;
    background-color: #1a2d5c;
    border-color: #2c4a8a;
}

html[data-mx-theme="dark"] body:not(.ess-page) .alert-light {
    color: var(--mx-text);
    background-color: var(--mx-surface-2);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .alert-warning {
    color: #ffe7c2;
    background-color: #3d2c12;
    border-color: #6b4b1c;
}

html[data-mx-theme="dark"] body:not(.ess-page) .alert-danger,
html[data-mx-theme="dark"] body:not(.ess-page) .validation-summary-errors {
    color: #ffd7cc;
    background-color: #3d1810;
    border-color: #6b2c1c;
}

html[data-mx-theme="dark"] body:not(.ess-page) .alert-success .alert-link,
html[data-mx-theme="dark"] body:not(.ess-page) .alert-info .alert-link,
html[data-mx-theme="dark"] body:not(.ess-page) .alert-warning .alert-link,
html[data-mx-theme="dark"] body:not(.ess-page) .alert-danger .alert-link {
    color: inherit;
    text-decoration: underline;
}

html[data-mx-theme="dark"] body:not(.ess-page) .performanceAppraisalSection>.card-header {
    background-color: var(--mx-surface-2) !important;
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performanceAppraisalSection>.card-header a {
    color: var(--mx-text);
}

html[data-mx-theme] body:not(.ess-page) .btn:not(.input-group .btn):not(.k-input-button) {
    border-radius: 10px;
}

html[data-mx-theme] body:not(.ess-page) .btn-group>.btn,
html[data-mx-theme] body:not(.ess-page) .btn-group-toggle>.btn {
    border-radius: 0;
}

html[data-mx-theme] body:not(.ess-page) .btn-group>.btn:first-child,
html[data-mx-theme] body:not(.ess-page) .btn-group-toggle>.btn:first-child {
    border-start-start-radius: 10px;
    border-end-start-radius: 10px;
}

html[data-mx-theme] body:not(.ess-page) .btn-group>.btn:last-child,
html[data-mx-theme] body:not(.ess-page) .btn-group-toggle>.btn:last-child {
    border-start-end-radius: 10px;
    border-end-end-radius: 10px;
}

html[data-mx-theme="dark"] body:not(.ess-page) .btn-warning {
    --btn-base-text: #fff8ee;
    --btn-base-bg: #b86a12;
    --btn-base-border: #b86a12;
    --btn-hover-bg: #9a5810;
    --btn-hover-border: #9a5810;
    --btn-active-bg: #8a4e0e;
    --btn-active-border: #8a4e0e;
    --btn-state-color: #fff8ee;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout__inner,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout-dash,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout-header,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout-search {
    background: var(--mx-surface);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout-title,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-input,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .qa-suggest-parent {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .widget {
    background: var(--mx-surface-2);
    border-color: var(--mx-hair-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-header-btn--edit,
html[data-mx-theme="dark"] body:not(.ess-page) .ess-dashboard-2 button.widget-control-toggle.home-qa-rail-header-btn {
    background: var(--mx-chip-strong) !important;
    border-color: var(--mx-hair-strong) !important;
    color: var(--mx-text) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout-divider {
    background: var(--mx-hair-strong);
}

html[data-mx-theme] body:not(.ess-page) .home-qa-rail-flyout__inner {
    overflow: hidden;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout__inner {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.45);
}

html[data-mx-theme] body:not(.ess-page) .home-qa-rail-flyout .home-qa-rail-flyout-dash.ess-dashboard-2 {
    border-radius: 0 !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout-title {
    color: #9ab4ff;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .ess-dashboard-2.quick-access-dashboard,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout-dash.ess-dashboard-2 {
    background: transparent !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-input {
    background-color: var(--mx-input-bg);
    border: 1px solid var(--mx-input-border);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-input::placeholder {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-btn.btn-outline-light {
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
    background-color: var(--mx-chip);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-btn.btn-outline-light:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-btn.btn-outline-light:focus {
    background-color: var(--mx-chip-strong);
    border-color: var(--mx-hair-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-suggest {
    background-color: var(--mx-menu);
    border: 1px solid var(--mx-hair-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-suggest .dropdown-item {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-suggest .dropdown-item:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-suggest .dropdown-item:focus,
html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-search-suggest .dropdown-item.active {
    background-color: var(--mx-chip-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .qa-suggest-parent {
    color: var(--mx-muted) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .widget {
    background: var(--mx-surface-2) !important;
    border-color: var(--mx-hair-strong) !important;
    color: var(--mx-text);
    box-shadow: none !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .widget:hover {
    border-color: var(--mx-nav-accent) !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .qa-breadcrumb {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .widget:hover .qa-breadcrumb {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .qa-title {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .widget:hover .quick-access-card-inner {
    background: var(--mx-chip-strong) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-dashboard.widget-control-enabled .widget .widget-header .btn.icon-only {
    background: var(--mx-surface) !important;
    border-color: var(--mx-hair-strong) !important;
    color: var(--mx-text) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .quick-access-dashboard.widget-control-enabled .widget .widget-header .btn.icon-only:hover {
    background: var(--mx-chip-strong) !important;
    border-color: var(--mx-hair-strong) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .home-qa-rail-flyout .qa-empty-hint .alert.alert-light {
    background-color: var(--mx-chip);
    border-color: var(--mx-hair-strong) !important;
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .app-details,
html[data-mx-theme="dark"] body:not(.ess-page) .bg-secondary:not(.badge):not(.btn) {
    background-color: var(--mx-surface) !important;
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .app-details .border-bottom {
    border-color: var(--mx-hair-strong) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .k-tabstrip,
html[data-mx-theme="dark"] body:not(.ess-page) .k-tabstrip>.k-tabstrip-items,
html[data-mx-theme="dark"] body:not(.ess-page) .k-tabstrip-content,
html[data-mx-theme="dark"] body:not(.ess-page) .k-tabstrip .k-content {
    background-color: var(--mx-surface);
    color: var(--mx-text);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .k-tabstrip .k-item .k-link {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .k-tabstrip .k-item.k-active,
html[data-mx-theme="dark"] body:not(.ess-page) .k-tabstrip .k-item.k-state-active {
    background-color: var(--mx-chip-strong);
}

html[data-mx-theme] body:not(.ess-page) .cancelled-lbl {
    border-width: 1px;
    border-radius: 10px;
    background: rgba(220, 48, 0, .12);
}

html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__table th,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__table td,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__column-card,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__column-toggle,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__row-label,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__group-body tr:nth-child(even) td,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__group-body tr:nth-child(even) .pivot-table__row-label {
    background: var(--mx-surface) !important;
    color: var(--mx-text) !important;
    border-color: var(--mx-hair) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__head th,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__section-title-cell,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__group-summary th,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__group-summary td,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__group-toggle,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__summary-cell .pivot-table__value {
    background: var(--mx-surface-2) !important;
    color: var(--mx-text) !important;
    border-color: var(--mx-hair) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__group-body tr:hover td,
html[data-mx-theme="dark"] body:not(.ess-page) .pivot-table__group-body tr:hover .pivot-table__row-label {
    background: var(--mx-chip) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) #performanceAppraisalSections,
html[data-mx-theme="dark"] body:not(.ess-page) #performanceAppraisalSections .card,
html[data-mx-theme="dark"] body:not(.ess-page) #performanceAppraisalSections .card-header,
html[data-mx-theme="dark"] body:not(.ess-page) #performanceAppraisalSections .card-body,
html[data-mx-theme="dark"] body:not(.ess-page) .performanceAppraisalSection,
html[data-mx-theme="dark"] body:not(.ess-page) .performanceAppraisalSection>.card-header,
html[data-mx-theme="dark"] body:not(.ess-page) .performanceAppraisalSection .card-body {
    background-color: var(--mx-surface) !important;
    color: var(--mx-text) !important;
    border-color: var(--mx-hair) !important;
}

/* Report design tiles. */
html[data-mx-theme="dark"] body:not(.ess-page) .report-design {
    background-color: var(--mx-surface-2);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .report-design .report-name {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .report-design .report-image i {
    color: #7ea2ff;
}

html[data-mx-theme="dark"] body:not(.ess-page) .report-designs>.add-design {
    background-color: var(--mx-surface);
    color: #9eb6ff;
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .report-designs>.add-design:hover {
    background-color: var(--mx-chip-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .report-design:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .report-design.selected {
    border-color: #6d83ff;
    box-shadow: 0 0 0.625rem 0 rgba(109, 131, 255, .35);
}

/* Salary and other grid section titles. The short orange rule stays. */
html[data-mx-theme="dark"] body:not(.ess-page) .mystro-title,
html[data-mx-theme="dark"] body:not(.ess-page) .dg-header {
    background-color: transparent;
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .mystro-title hr {
    border-top-color: #f7a833 !important;
}

/* Admin scrollbars. Home widgets keep the bars they already set. */
/* Popups and full-page scroll often use html / #content (Windows paints a light track on html). */
html[data-mx-theme="dark"]:has(body:not(.ess-page)),
html[data-mx-theme="dark"] body:not(.ess-page) {
    scrollbar-color: #4c5878 #10162f;
}

html[data-mx-theme="dark"] body:not(.ess-page) #content,
html[data-mx-theme="dark"] body:not(.ess-page) #page,
html[data-mx-theme="dark"] body:not(.ess-page) .cph {
    scrollbar-color: #4c5878 #10162f;
}

html[data-mx-theme="dark"] body:not(.ess-page) .admin-home {
    scrollbar-color: auto;
}

html[data-mx-theme="dark"] body:not(.ess-page) .k-grid-content,
html[data-mx-theme="dark"] body:not(.ess-page) .k-grid,
html[data-mx-theme="dark"] body:not(.ess-page) .datagrid-root,
html[data-mx-theme="dark"] body:not(.ess-page) .k-auto-scrollable {
    scrollbar-color: #4c5878 #10162f;
}

html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-grid,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-grid-content,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-auto-scrollable {
    scrollbar-color: auto;
}

html[data-mx-theme="dark"]:has(body:not(.ess-page))::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page)::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) #content::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) #page::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .cph::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .k-grid-content::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .k-grid::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .datagrid-root::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .k-auto-scrollable::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

html[data-mx-theme="dark"]:has(body:not(.ess-page))::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page)::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) #content::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) #page::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) .cph::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) .k-grid-content::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) .k-grid::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) .datagrid-root::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) .k-auto-scrollable::-webkit-scrollbar-track {
    background: #10162f;
}

html[data-mx-theme="dark"]:has(body:not(.ess-page))::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page)::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) #content::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) #page::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .cph::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .k-grid-content::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .k-grid::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .datagrid-root::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .k-auto-scrollable::-webkit-scrollbar-thumb {
    background: #4c5878;
    border-radius: 8px;
    border: 2px solid #10162f;
}

html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-grid-content::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-grid::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-auto-scrollable::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-grid-content::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-grid::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-auto-scrollable::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-grid-content::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-grid::-webkit-scrollbar-track,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home .k-auto-scrollable::-webkit-scrollbar-track {
    all: revert;
}

/* Side panels and menus still used the light system bar. Home widgets keep the bars they set. */
html[data-mx-theme="dark"] body:not(.ess-page) :is(.nav-offcanvas,
    .offcanvas,
    .offcanvas-nav,
    .modal-body,
    .k-drawer,
    .k-drawer-wrapper,
    .k-list-scroller,
    .k-list-content,
    .select2-results__options,
    .dropdown-menu) {
    scrollbar-color: #4c5878 #10162f;
}

html[data-mx-theme="dark"] body:not(.ess-page) .admin-home :is(.nav-offcanvas,
    .offcanvas,
    .offcanvas-nav,
    .modal-body,
    .k-drawer,
    .k-drawer-wrapper,
    .k-list-scroller,
    .k-list-content,
    .select2-results__options,
    .dropdown-menu) {
    scrollbar-color: auto;
}

html[data-mx-theme="dark"] body:not(.ess-page) :is(.nav-offcanvas,
    .offcanvas,
    .offcanvas-nav,
    .modal-body,
    .k-drawer,
    .k-drawer-wrapper,
    .k-list-scroller,
    .k-list-content,
    .select2-results__options,
    .dropdown-menu)::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

html[data-mx-theme="dark"] body:not(.ess-page) :is(.nav-offcanvas,
    .offcanvas,
    .offcanvas-nav,
    .modal-body,
    .k-drawer,
    .k-drawer-wrapper,
    .k-list-scroller,
    .k-list-content,
    .select2-results__options,
    .dropdown-menu)::-webkit-scrollbar-track {
    background: #10162f;
}

html[data-mx-theme="dark"] body:not(.ess-page) :is(.nav-offcanvas,
    .offcanvas,
    .offcanvas-nav,
    .modal-body,
    .k-drawer,
    .k-drawer-wrapper,
    .k-list-scroller,
    .k-list-content,
    .select2-results__options,
    .dropdown-menu)::-webkit-scrollbar-thumb {
    background: #4c5878;
    border-radius: 8px;
    border: 2px solid #10162f;
}

html[data-mx-theme="dark"] body:not(.ess-page) .admin-home :is(.nav-offcanvas,
    .offcanvas,
    .offcanvas-nav,
    .modal-body,
    .k-drawer,
    .k-drawer-wrapper,
    .k-list-scroller,
    .k-list-content,
    .select2-results__options,
    .dropdown-menu)::-webkit-scrollbar,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home :is(.nav-offcanvas,
    .offcanvas,
    .offcanvas-nav,
    .modal-body,
    .k-drawer,
    .k-drawer-wrapper,
    .k-list-scroller,
    .k-list-content,
    .select2-results__options,
    .dropdown-menu)::-webkit-scrollbar-thumb,
html[data-mx-theme="dark"] body:not(.ess-page) .admin-home :is(.nav-offcanvas,
    .offcanvas,
    .offcanvas-nav,
    .modal-body,
    .k-drawer,
    .k-drawer-wrapper,
    .k-list-scroller,
    .k-list-content,
    .select2-results__options,
    .dropdown-menu)::-webkit-scrollbar-track {
    all: revert;
}

/* Appraisal option boxes and the rating form. */
html[data-mx-theme="dark"] body:not(.ess-page) .performanceAppraisalItem>.card-body>.card,
html[data-mx-theme="dark"] body:not(.ess-page) .q-option {
    background-color: var(--mx-surface-2) !important;
    border-color: var(--mx-hair-strong) !important;
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performanceAppraisalItem>.card-header .q-header>a,
html[data-mx-theme="dark"] body:not(.ess-page) .q-option,
html[data-mx-theme="dark"] body:not(.ess-page) .q-option a,
html[data-mx-theme="dark"] body:not(.ess-page) .q-option div,
html[data-mx-theme="dark"] body:not(.ess-page) .performanceAppraisalItem>.card-body>.card a {
    color: #fff !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .appraisal-rating-form .question,
html[data-mx-theme="dark"] body:not(.ess-page) #appraisaltransaction-edit .question,
html[data-mx-theme="dark"] body:not(.ess-page) .appraisal-rating-form .answers .rating>div .form-check-label,
html[data-mx-theme="dark"] body:not(.ess-page) #appraisaltransaction-edit .answers .rating>div .form-check-label {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .appraisal-rating-form .answers .rating>div .form-check-label .number,
html[data-mx-theme="dark"] body:not(.ess-page) #appraisaltransaction-edit .answers .rating>div .form-check-label .number {
    color: var(--mx-text);
    background: var(--mx-surface-2);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .appraisal-rating-form .answers .rating>div input:checked+.form-check-label .number,
html[data-mx-theme="dark"] body:not(.ess-page) .appraisal-rating-form .answers .rating>div .form-check-input:checked+.form-check-label .number,
html[data-mx-theme="dark"] body:not(.ess-page) #appraisaltransaction-edit .answers .rating>div input:checked+.form-check-label .number,
html[data-mx-theme="dark"] body:not(.ess-page) #appraisaltransaction-edit .answers .rating>div .form-check-input:checked+.form-check-label .number {
    color: #fff;
    border-color: #fff;
    background: linear-gradient(35deg, rgb(2, 0, 36) 0%, rgb(15, 67, 151) 100%);
}

html[data-mx-theme="dark"] body:not(.ess-page) .appraisal-rating-form .answers .appraisal-comment,
html[data-mx-theme="dark"] body:not(.ess-page) #appraisaltransaction-edit .answers .appraisal-comment {
    background: var(--mx-input-bg);
    color: var(--mx-text);
    border: 1px solid var(--mx-input-border);
    box-shadow: none;
}

/* Activity log payload panel. */
html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger {
    background: var(--mx-surface);
    border-color: var(--mx-hair-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__header {
    background: var(--mx-surface-2);
    border-bottom-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__title,
html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__name,
html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__value {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__count {
    background: var(--mx-chip);
    border-color: var(--mx-hair-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__reference,
html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__arrow {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__field {
    border-bottom-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .activity-log-ledger__raw {
    background: transparent;
    color: var(--mx-text);
}

/* Entity log dropdown, system log details, and audit grids use plaintext + pre. */
html[data-mx-theme="dark"] body:not(.ess-page) .form-control-plaintext,
html[data-mx-theme="dark"] body:not(.ess-page) .dropdown-menu .form-control-plaintext {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .form-control-plaintext textarea,
html[data-mx-theme="dark"] body:not(.ess-page) table.adminContent .adminData .form-control-plaintext textarea {
    color: var(--mx-text);
    background-color: var(--mx-input-bg);
    border: 1px solid var(--mx-input-border);
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
}

html[data-mx-theme="dark"] body:not(.ess-page) table.adminContent .adminTitle .ctl-label label,
html[data-mx-theme="dark"] body:not(.ess-page) table.adminContent .adminTitle .control-label {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) table.adminContent .adminData .form-control-plaintext,
html[data-mx-theme="dark"] body:not(.ess-page) table.adminContent .adminData .form-control-plaintext.overflow-wrap-break {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) table.adminContent .adminData a:not(.btn):not(.k-button) {
    color: var(--primary);
}

html[data-mx-theme="dark"] body:not(.ess-page) pre:not(.mx-readplate-light),
html[data-mx-theme="dark"] body:not(.ess-page) pre.prettyprint:not(.mx-readplate-light),
html[data-mx-theme="dark"] body:not(.ess-page) #entitylog-modal pre,
html[data-mx-theme="dark"] body:not(.ess-page) #entitylog-modal pre.prettyprint,
html[data-mx-theme="dark"] body:not(.ess-page) .k-grid td pre.prettyprint {
    background: var(--mx-surface-2);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

/* Stack traces / prettyprint: keep a light plate in dark admin (syntax colors stay readable). */
html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light,
html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light.prettyprint {
    background: #f8f9fa !important;
    color: #393f46;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .pln,
html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .pun {
    color: #393f46;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .kwd {
    color: #1e347b;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .str {
    color: #484;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .com {
    color: #666;
    font-style: italic;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .typ {
    color: #606;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .lit {
    color: #066;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .tag {
    color: #170;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .atn {
    color: #170;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .atv {
    color: #170;
}

html[data-mx-theme="dark"] body:not(.ess-page) pre.mx-readplate-light .dec {
    color: #606;
}

html[data-mx-theme="dark"] body:not(.ess-page) .k-tooltip,
html[data-mx-theme="dark"] body:not(.ess-page) .k-widget.k-tooltip,
html[data-mx-theme="dark"] body:not(.ess-page) .k-callout {
    background-color: var(--mx-menu);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

/* Application notes. The avatar photo is left alone. */
html[data-mx-theme="dark"] body:not(.ess-page) .note-list-item {
    background: var(--mx-surface-2) !important;
    background-color: var(--mx-surface-2) !important;
    color: var(--mx-text);
    border-color: var(--mx-hair-strong) !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .note-list-item .note-body {
    background: var(--mx-surface);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .note-list-item .note-title,
html[data-mx-theme="dark"] body:not(.ess-page) .note-list-item h6 {
    color: var(--mx-text);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .note-list-item .note-date {
    color: var(--mx-muted) !important;
}

/* Scorecard stars. The rating widget otherwise keeps a white plate. */
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .k-rating,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .k-rating.k-widget,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .k-rating-container,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .k-rating-item,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .k-rating,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .k-rating.k-widget,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .k-rating-container,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .k-rating-item {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .k-rating-item>.k-icon,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .k-rating-item>.k-icon {
    background-color: transparent !important;
}

html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .k-rating-item:not(.k-selected):not(.k-state-selected)>.k-icon,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .k-rating-item:not(.k-selected):not(.k-state-selected)>.k-icon {
    color: #c9d2e4;
    -webkit-text-fill-color: #c9d2e4;
}

html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .k-rating .k-selected>.k-icon::before,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .k-rating .k-hover>.k-icon::before,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .k-rating .k-selected>.k-icon::before,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .k-rating .k-hover>.k-icon::before {
    background: linear-gradient(0deg, #ffa41c 0%, #f5961d 50%, #de7921 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard h4,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard h5,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .rating-detail .stars,
html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .percentage {
    color: var(--mx-text);
    border-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .teamscorecard .progress {
    background-color: var(--mx-surface-2);
    box-shadow: none;
}

html[data-mx-theme="dark"] #mcv {
    color: #9aa6c8;
}

/* Signature ink stays on white in both themes. Other uploads are unchanged. */
html[data-mx-theme] body:not(.ess-page) .fileupload-container:has(input[name*="SignaturePicture"]) .fileupload-thumb-wrapper,
html[data-mx-theme] body:not(.ess-page) .fileupload-container:has(input[name*="SignaturePicture"]) .fileupload-thumb,
html[data-mx-theme] body:not(.ess-page) .fileupload-container:has(input[name*="SignaturePicture"]) .fileupload-thumb img,
html[data-mx-theme] body:not(.ess-page) .fileupload-container[data-hdn-name*="SignaturePicture"] .fileupload-thumb-wrapper,
html[data-mx-theme] body:not(.ess-page) .fileupload-container[data-hdn-name*="SignaturePicture"] .fileupload-thumb,
html[data-mx-theme] body:not(.ess-page) .fileupload-container[data-hdn-name*="SignaturePicture"] .fileupload-thumb img {
    background: #fff !important;
    background-color: #fff !important;
}

/* Performance grids on admin pages. The stylesheet paints light cards; dark tokens replace those fills. */
html[data-mx-theme="dark"] body:not(.ess-page) .performance-section {
    --performance-border: var(--mx-hair-strong);
    --performance-muted: var(--mx-muted);
    --performance-accent: #8eb4ff;
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-section-summary {
    background: var(--mx-surface-2);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-section-summary-title,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-section-summary-title strong,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-section-summary-metric strong {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-section-summary-icon {
    color: #9eb6ff;
    background: transparent;
    border-color: #6d83ff;
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-section-summary-metric {
    border-inline-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-section-summary-metric span {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-grid .dg-th[data-member="MeasureCount"],
html[data-mx-theme="dark"] body:not(.ess-page) .performance-grid .dg-tbody > .dg-tr > .performance-subdata-measure-cell,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-grid .dg-tbody .dg-tr:hover > .performance-subdata-measure-cell,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-grid .dg-tbody .dg-tr.active > .performance-subdata-measure-cell {
    color: #c5d8ff;
    background-color: rgba(80, 120, 220, .18);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-grid .dg-th[data-member="KpiCount"],
html[data-mx-theme="dark"] body:not(.ess-page) .performance-grid .dg-tbody > .dg-tr > .performance-subdata-kpi-cell,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-grid .dg-tbody .dg-tr:hover > .performance-subdata-kpi-cell,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-grid .dg-tbody .dg-tr.active > .performance-subdata-kpi-cell {
    color: #ddd6fe;
    background-color: rgba(139, 92, 246, .2);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-detail {
    background: transparent;
    border-top-color: var(--mx-hair);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-detail-section,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-child-row,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-rating-comment,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-kpi-heading,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-goal-assessment .performance-kpi-fields,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-goal-assessment .performance-kpi-assessment,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-rating-option label {
    background: var(--mx-surface-2);
    border-color: var(--mx-hair-strong);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-detail-title,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-detail-section .ess-display-field__label,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-detail-section .ess-display-field__value,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-kpi-heading,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-rating-comment-heading,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-rating-option label {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-empty,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-rating-comment-heading span,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-kpi-rating-result-label {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-rating-option input:checked + label {
    color: #fff;
    background: var(--performance-accent, #307abe);
    border-color: var(--performance-accent, #307abe);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-request-heading h1 {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-request-heading p {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-rating-history-row {
    background: var(--mx-surface);
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-goal-score-value,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-goal-rating-badge {
    background: rgba(80, 120, 220, .18);
    border-color: transparent;
    color: #c5d8ff;
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-goal-rating-summary-manager .performance-goal-rating-badge {
    background: rgba(36, 150, 110, .2);
    color: #b7f0d8;
}

html[data-mx-theme="dark"] body:not(.ess-page) .performance-goal-rating-evaluator,
html[data-mx-theme="dark"] body:not(.ess-page) .performance-goal-rating-empty {
    color: var(--mx-muted);
}

/* Goal sections on the transaction edit use the ESS request card without the ESS stylesheet. */
html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section > .ess-request-section--approval {
    background: var(--mx-surface-2);
    border: 1px solid var(--mx-hair-strong);
    border-radius: 12px;
    overflow: hidden;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-section__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    background: rgba(80, 120, 220, .12);
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__section-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    margin: 0;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__section-icon {
    display: flex;
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__section-icon img {
    width: 2.5rem;
    height: 2.5rem;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__section-heading {
    margin: 0;
    color: var(--mx-text);
    font-size: 1.15rem;
    font-weight: 700;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-section__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__fields--4,
html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__fields--3 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__fields--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-display-field__label,
html[data-mx-theme="dark"] body:not(.ess-page) .ess-weight-meter__target {
    color: var(--mx-muted);
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-display-field__value,
html[data-mx-theme="dark"] body:not(.ess-page) .ess-weight-meter__current {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-weight-meter__chart {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-weight-meter__scale {
    display: flex;
    justify-content: space-between;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-weight-meter__track {
    display: flex;
    height: .4rem;
    border-radius: 99px;
    background: var(--mx-chip-strong);
    overflow: hidden;
}

html[data-mx-theme="dark"] body:not(.ess-page) .ess-weight-meter__fill {
    display: block;
    height: 100%;
    flex: 0 0 var(--ess-weight-pct, 0%);
    max-width: 100%;
    border-radius: inherit;
    background: #3dceb0;
}

@media (max-width: 991.98px) {
    html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__fields--4,
    html[data-mx-theme="dark"] body:not(.ess-page) .ess-performance-section .ess-request-form__fields--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Questionnaire and scorecard builders: section titles, questions, and options. */
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .section,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .section > .card-header,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .section > .card-body,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .question,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .question > .card-header,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .question > .card-body,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .q-option,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .q-option > .card-body,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .section,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .section > .card-header,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .section > .card-body,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .question,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .question > .card-header,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .question > .card-body {
    background-color: var(--mx-surface);
    color: var(--mx-text);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .q-header,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .q-header a,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .q-header a:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .q-header i,
html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .empty,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .q-header,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .q-header a,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .q-header a:hover,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .q-header i,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .empty {
    color: var(--mx-text);
}

html[data-mx-theme="dark"] body:not(.ess-page) .questionnaire .question > .card-body > .card,
html[data-mx-theme="dark"] body:not(.ess-page) .scorecard .question > .card-body > .card {
    background-color: var(--mx-surface-2);
    border-color: var(--mx-hair-strong);
}

html[data-mx-theme="dark"] body:not(.ess-page) .sortable-ghost,
html[data-mx-theme="dark"] body:not(.ess-page) .sortable-ghost .card-body {
    background-color: var(--mx-chip-strong) !important;
    color: var(--mx-text);
}