/* Keep the existing gray window color. White/black modes are unaffected.
   Body-level selectors also cover dialogs hoisted out of .main-wrap. */
html:root[data-wms-display-mode="gray"] {
    --wms-gray-window: #6e6d6d;
    background: var(--wms-gray-window);
}
html:root[data-wms-display-mode="gray"] :is(
    body, .nav-bar-main, .platform-public-footer,
    .nav-card, .dropdown-menu, .wms-page-navigation,
    .main-wrap .card, .main-wrap .card-header, .main-wrap .card-body,
    .main-wrap .card-footer, .main-wrap .list-group-item,
    .main-wrap .bg-white, .main-wrap .bg-light, .main-wrap .table-responsive,
    .main-wrap table, .main-wrap thead th, .main-wrap .nav-tabs .nav-link,
    .modal-content, .modal-header, .modal-body, .modal-footer,
    .support-chat-window, .support-chat-window-header, .support-chat-frame,
    .edc-floating-window, .edc-floating-header,
    .security-module-heading, .security-role-toolbar, .security-role-count,
    .permission-editor-toolbar, .security-permission-card, .wms-module-layout-toolbar
) {
    background: var(--wms-gray-window) !important;
    color: #fff;
}

html:root[data-wms-display-mode="gray"] {
 --dev-surface:#6e6d6d; --dev-panel:#6e6d6d; --dev-ink:#fff; --dev-muted:#f0f0f0;
 --ce-bg:#6e6d6d; --ce-surface:#6e6d6d;
}
html:root[data-wms-display-mode="gray"] :is(.main-wrap,.dev-shell,.ce-page) :is(h1,h2,h3,h4,h5,h6,.text-muted,.text-dark,.form-label,.card-title,.nav-link,th,td) {color:#fff!important}
html:root[data-wms-display-mode="gray"] :is(.main-wrap,.dev-shell,.ce-page) :is(input,select,textarea,option) {color:#212529!important}
html:root[data-wms-display-mode="gray"] :is(.dev-card,.dev-stat,.ce-card,.referral-card,.referral-panel,.coin-kpi,.printer-device-panel,.printer-connection-fields) {background:#6e6d6d!important;color:#fff}
html:root[data-wms-display-mode="gray"] :is(.nav-card,.nav-card-label,.wms-page-navigation-brand,.wms-page-navigation-context,.security-module-heading p,.security-section-title,.wms-module-layout-toolbar,.form-text) {color:#fff!important}
html:root[data-wms-display-mode="gray"] .security-center-page .nav-tabs .nav-link.active {background:#6e6d6d!important;color:#c1ffdb!important;border-top-color:#c1ffdb}
html:root[data-wms-display-mode="gray"] {--ce-text:#fff;--ce-muted:#eee}
html:root[data-wms-display-mode="black"] :is(body.dev-body,body.ce-body) {background:#1e1e1e;color:#fff;--dev-ink:#fff;--dev-muted:#ddd;--dev-panel:#252526;--ce-text:#fff;--ce-muted:#ddd;--ce-bg:#1e1e1e;--ce-surface:#252526}
html:root[data-wms-display-mode="black"] :is(.dev-card,.dev-stat,.ce-card,.ce-dialog) {background:#252526;color:#fff}
