/*
    Portal themes a user picks in the Account menu (Theme). Loaded after css/ecanteen-apple.css on every page that has
    the menu and on the sign-in page. The page carries the choice on <html data-theme="...">, written by the server
    from the ecTheme cookie (ThemeChoice.cs), so it shows from the first paint; Glass Dark also gets CoreUI's own
    dark-theme class. The default theme is css/ecanteen-apple.css alone: nothing here applies to it.

    Most of each theme is the colours ecanteen-apple.css takes from its variables (:root there lists them). The two
    glass themes add see-through, blurred panels over a soft coloured page. Text colours keep WCAG AA (4.5:1).
*/

/* ---------- 1 · Sage Mist ---------- */

html[data-theme="sage"] {
    --ec-blue: #5e7057;
    --ec-blue-hover: #53644d;
    --ec-blue-active: #475740;
    --ec-focus: #5e7057;
    --ec-link: #55664f;
    --ec-link-hover: #475740;
    --ec-ink: #2b2f2a;
    --ec-muted: #5f675c;
    --ec-text-2: #3e443c;
    --ec-page: #eceee8;
    --ec-pearl: #f2f3ee;
    --ec-hover: #dfe3d8;
    --ec-line: #dadcd3;
    --ec-line-soft: #e7eae1;
    --ec-hair: rgba(43, 47, 42, 0.10);
    --ec-field: rgba(43, 47, 42, 0.22);
    --ec-surface: #f8f8f5;
    --ec-select: #e3e9de;
    --ec-select-strong: #d3decb;
    --ec-ring: rgba(94, 112, 87, 0.28);
    --ec-second: #6f6455;
    --ec-bar: #3f4a3f;
    --ec-bar-ink: #f1f3ee;
    --ec-bar-hover: rgba(241, 243, 238, 0.14);
    --ec-busy: #b3cca9;
    --ec-side: #e4e8de;
    --ec-side-active: #f8f8f5;
    --ec-blue-soft: #aab9a4;
    --ec-blue-tint: rgba(94, 112, 87, 0.14);
    --ec-blue-rgb: 94, 112, 87;
    --ec-info-bg: #e3e9de; --ec-info: #3d5638;
    --cui-primary: #5e7057;
    --cui-primary-rgb: 94, 112, 87;
    --cui-link-color: #55664f;
    --cui-link-hover-color: #475740;
    --cui-body-color: #2b2f2a;
    --cui-body-bg: #eceee8;
    --cui-border-color: #dadcd3;
}

/* ---------- 3 · Fog Blue ---------- */

html[data-theme="fog"] {
    --ec-blue: #557083;
    --ec-blue-hover: #4a6475;
    --ec-blue-active: #3f5666;
    --ec-focus: #557083;
    --ec-link: #4d6678;
    --ec-link-hover: #3f5666;
    --ec-ink: #262c31;
    --ec-muted: #5b656d;
    --ec-text-2: #3a434a;
    --ec-page: #ebeef0;
    --ec-pearl: #f1f3f5;
    --ec-hover: #dce2e7;
    --ec-line: #d8dee3;
    --ec-line-soft: #e5e9ec;
    --ec-hair: rgba(38, 44, 49, 0.10);
    --ec-field: rgba(38, 44, 49, 0.22);
    --ec-surface: #f8f9fa;
    --ec-select: #dfe7ec;
    --ec-select-strong: #cfdce4;
    --ec-ring: rgba(85, 112, 131, 0.28);
    --ec-second: #7c635b;
    --ec-bar: #3b4650;
    --ec-bar-ink: #eef2f5;
    --ec-bar-hover: rgba(238, 242, 245, 0.14);
    --ec-busy: #a5c3d9;
    --ec-side: #e1e6ea;
    --ec-side-active: #f8f9fa;
    --ec-blue-soft: #a5b6c3;
    --ec-blue-tint: rgba(85, 112, 131, 0.14);
    --ec-blue-rgb: 85, 112, 131;
    --ec-info-bg: #dfe7ec; --ec-info: #34505f;
    --cui-primary: #557083;
    --cui-primary-rgb: 85, 112, 131;
    --cui-link-color: #4d6678;
    --cui-link-hover-color: #3f5666;
    --cui-body-color: #262c31;
    --cui-body-bg: #ebeef0;
    --cui-border-color: #d8dee3;
}

/* ---------- 9 · Glass Light and 10 · Glass Dark: what both share ---------- */

/* The page shows through: a soft coloured background, fixed while the page scrolls */
html[data-theme^="glass"] body { background-attachment: fixed; }
html[data-theme^="glass"] .wrapper { background: transparent; }
/* (the master's wrapper also carries bg-light, which ecanteen-apple.css paints with !important) */
html[data-theme^="glass"] .wrapper.bg-light { background-color: transparent !important; }
/* The page's header (top bar, breadcrumb and title) stays at the top while the page scrolls (header-sticky): one
   frosted panel, so what scrolls under it is blurred away rather than showing through the title */
html[data-theme^="glass"] .wrapper > .header {
    background: var(--ec-head-glass);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--ec-hair);
}

/* See-through panels, blurred: the menu, cards, drop-down menus and the (i) panels */
html[data-theme^="glass"] #sidebar.sidebar,
html[data-theme^="glass"] .card,
html[data-theme^="glass"] .dropdown-menu,
html[data-theme^="glass"] .ec-info-pop {
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
}
html[data-theme^="glass"] .wrapper > .header > .container-fluid:first-of-type { border-bottom: 1px solid var(--ec-hair); }
html[data-theme^="glass"] .card { border-color: var(--ec-glass-edge); box-shadow: var(--ec-glass-shadow); }
html[data-theme^="glass"] #sidebar.sidebar { border-right-color: var(--ec-glass-edge); }
/* The menu's title continues the top bar */
html[data-theme^="glass"] #sidebar .sidebar-brand { background: transparent; border-bottom: 1px solid var(--ec-hair); }
/* The main button glows a little, as on Apple's glass */
html[data-theme^="glass"] .btn-warning,
html[data-theme^="glass"] .btn-primary { box-shadow: 0 4px 14px rgba(0, 113, 227, 0.28); }
html[data-theme^="glass"] .btn-warning:focus-visible,
html[data-theme^="glass"] .btn-primary:focus-visible { box-shadow: 0 0 0 3px var(--ec-ring); }

/* The blur makes each card one layer, drawn in page order: a calendar or drop-down list opening out of a card went under
   the card after it (Sales Report's From Date under the report viewer). The card being worked in comes forward. */
html[data-theme^="glass"] .card:focus-within { position: relative; z-index: 5; }

/* The mockup's layout. Every width: a small breadcrumb instead of the big page title, and each card's own title
   (js/page-info.js hides a title that repeats the page's; here it shows, with the page's (i) beside it). */
html[data-theme^="glass"] .wrapper > .header > .container-fluid:last-of-type:not(:first-of-type) { padding-top: 14px; padding-bottom: 6px; }
html[data-theme^="glass"] .wrapper > .header .breadcrumb { font-size: 13px; align-items: center; }
html[data-theme^="glass"] .wrapper > .header .breadcrumb-item.active {
    flex: 0 1 auto; padding-left: .5rem; margin-top: 0; font-size: 13px; font-weight: 500; line-height: inherit; letter-spacing: 0; color: var(--ec-ink);
}
html[data-theme^="glass"] .wrapper > .header .breadcrumb-item.active::before { display: inline-block; }
html[data-theme^="glass"] .wrapper > .header .breadcrumb-item.ec-crumb-same { display: none; }
html[data-theme^="glass"] .wrapper > .header .breadcrumb-item.ec-crumb-same + .breadcrumb-item.active { padding-left: 0; }
html[data-theme^="glass"] .wrapper > .header .breadcrumb-item.ec-crumb-same + .breadcrumb-item.active::before { display: none; }
html[data-theme^="glass"] .card-header .ec-title-text { display: inline !important; }
html[data-theme^="glass"] .card-header.ec-title-empty { display: block !important; }
html[data-theme^="glass"] .card-header.ec-title-empty.d-flex { display: flex !important; }
html[data-theme^="glass"] .card-header.ec-title-repeat.d-flex { justify-content: space-between !important; }
html[data-theme^="glass"] .card > .card-header { padding: 18px 24px 16px; border-bottom: 1px solid var(--ec-line-soft); }

/* Desktop: the menu is a card floating under a top bar that runs the full width, with eCanteen in the bar.
   (Tablets and phones keep the menu that slides in.) CoreUI keeps room for the menu with --cui-sidebar-occupy-start,
   0 while the menu is closed with the bar's menu button. */
@media (min-width: 992px) {
    html[data-theme^="glass"] #sidebar.sidebar {
        --cui-sidebar-width: 15rem;
        /* level with the page's first card: the header (52px bar + breadcrumb row) ends at 93px, then its 24px gap */
        top: 117px; left: 16px; bottom: auto;
        max-height: calc(100vh - 133px);
        border: 1px solid var(--ec-glass-edge);
        border-radius: 20px;
        box-shadow: var(--ec-glass-shadow);
        overflow: hidden;
    }
    html[data-theme^="glass"] #sidebar.sidebar.hide { margin-left: calc(-1 * var(--cui-sidebar-width) - 32px); }
    html[data-theme^="glass"] #sidebar .sidebar-brand { display: none !important; }
    html[data-theme^="glass"] #sidebar .sidebar-nav { padding: 10px; min-height: 0; }
    html[data-theme^="glass"] .sidebar:not(.sidebar-end):not(.hide) ~ * { --cui-sidebar-occupy-start: calc(15rem + 40px); }
    html[data-theme^="glass"] .wrapper > .header { margin-left: calc(-1 * var(--cui-sidebar-occupy-start, 0px)); }
    html[data-theme^="glass"] .wrapper > .header > .container-fluid:last-of-type:not(:first-of-type) { padding-left: calc(var(--cui-sidebar-occupy-start, 0px) + 24px); }
    html[data-theme^="glass"] .wrapper > .header .header-brand { display: inline-flex !important; align-items: center; margin-left: 6px; }
}

/* Larger, softer corners */
html[data-theme^="glass"] .card { border-radius: 22px; }
html[data-theme^="glass"] .card-header:first-child { border-radius: 22px 22px 0 0; }

/* ---------- 9 · Glass Light ---------- */

html[data-theme="glass"] {
    --ec-blue: #0071e3;
    --ec-blue-hover: #0077ed;
    --ec-blue-active: #0062c4;
    --ec-focus: #0071e3;
    --ec-link: #0066cc;
    --ec-link-hover: #0058b0;
    --ec-muted: #5e5e63;
    --ec-page: #eef1f8;
    --ec-pearl: rgba(255, 255, 255, 0.5);
    --ec-hover: rgba(0, 0, 0, 0.05);
    --ec-line: rgba(0, 0, 0, 0.10);
    --ec-line-soft: rgba(0, 0, 0, 0.06);
    --ec-surface: rgba(255, 255, 255, 0.86);
    --ec-card: rgba(255, 255, 255, 0.52);
    --ec-select: rgba(0, 113, 227, 0.12);
    --ec-select-strong: rgba(0, 113, 227, 0.20);
    --ec-second-bg: rgba(255, 255, 255, 0.7);
    --ec-bar: rgba(255, 255, 255, 0.72);
    --ec-bar-ink: #1d1d1f;
    --ec-bar-hover: rgba(0, 0, 0, 0.06);
    --ec-busy: #0071e3;
    --ec-side: rgba(255, 255, 255, 0.42);
    --ec-side-active: rgba(255, 255, 255, 0.92);
    --ec-blue-soft: #8cbcf0;
    --ec-blue-rgb: 0, 113, 227;
    --ec-glass-edge: rgba(255, 255, 255, 0.75);
    --ec-glass-shadow: 0 10px 40px rgba(31, 38, 64, 0.10);
    --ec-head-glass: rgba(246, 247, 252, 0.62);
    --cui-primary: #0071e3;
    --cui-primary-rgb: 0, 113, 227;
}
/* Four soft colours, as in the mockup: pink top left, blue top right, mint bottom left, lilac lower right. Each
   reaches far across the page, so the colour still shows through the full-height menu and the large cards. */
html[data-theme="glass"] body {
    background-color: #eef1f8;
    background-image:
        radial-gradient(70vw 75vh at 0% 0%, #ffc2dc 0%, rgba(255, 194, 220, 0.55) 35%, rgba(255, 194, 220, 0) 75%),
        radial-gradient(75vw 80vh at 100% 5%, #b4d8ff 0%, rgba(180, 216, 255, 0.55) 35%, rgba(180, 216, 255, 0) 75%),
        radial-gradient(70vw 75vh at 10% 100%, #bdf0d4 0%, rgba(189, 240, 212, 0.55) 35%, rgba(189, 240, 212, 0) 75%),
        radial-gradient(60vw 65vh at 75% 85%, #dccbff 0%, rgba(220, 203, 255, 0.55) 35%, rgba(220, 203, 255, 0) 75%);
}
/* The light bar: the avatar keeps a hairline, the bell's count keeps its ring */
html[data-theme="glass"] .wrapper > .header .avatar-img { box-shadow: 0 0 0 1px var(--ec-hair); }
html[data-theme="glass"] .ec-bell-badge { box-shadow: 0 0 0 2px #ffffff; }

/* ---------- 10 · Glass Dark ---------- */

html[data-theme="glass-dark"] {
    color-scheme: dark;
    --ec-blue: #0071e3;              /* white on it: 4.6:1 */
    --ec-blue-hover: #0077ed;
    --ec-blue-active: #0062c4;
    --ec-focus: #4da3ff;
    --ec-link: #4da3ff;
    --ec-link-hover: #7cbcff;
    --ec-ink: #f5f5f7;
    --ec-muted: #a1a1a6;
    --ec-text-2: #d1d1d6;
    --ec-page: #0b0b10;
    --ec-pearl: #24242b;
    --ec-hover: #2c2c34;
    --ec-line: rgba(255, 255, 255, 0.12);
    --ec-line-soft: rgba(255, 255, 255, 0.07);
    --ec-hair: rgba(255, 255, 255, 0.10);
    --ec-field: rgba(255, 255, 255, 0.24);
    --ec-surface: #1c1c22;
    --ec-card: rgba(30, 30, 36, 0.62);
    --ec-select: rgba(10, 132, 255, 0.24);
    --ec-select-strong: rgba(10, 132, 255, 0.34);
    --ec-ring: rgba(77, 163, 255, 0.40);
    --ec-second: #4da3ff;
    --ec-second-bg: rgba(255, 255, 255, 0.06);
    --ec-bar: rgba(22, 22, 26, 0.72);
    --ec-bar-ink: #f5f5f7;
    --ec-bar-hover: rgba(255, 255, 255, 0.10);
    --ec-busy: #4da3ff;
    --ec-side: rgba(28, 28, 34, 0.60);
    --ec-side-active: rgba(255, 255, 255, 0.12);
    --ec-scroll: rgba(255, 255, 255, 0.28);
    --ec-pop-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    --ec-blue-soft: #3e6fa6;
    --ec-blue-tint: rgba(10, 132, 255, 0.20);
    --ec-blue-rgb: 10, 132, 255;
    --ec-ok-bg: rgba(48, 209, 88, 0.16);   --ec-ok: #7ee2a0;
    --ec-warn-bg: rgba(255, 159, 10, 0.18); --ec-warn: #ffc266;
    --ec-err-bg: rgba(255, 69, 58, 0.18);   --ec-err: #ff8a80;
    --ec-info-bg: rgba(10, 132, 255, 0.18); --ec-info: #9ccbff;
    --ec-glass-edge: rgba(255, 255, 255, 0.12);
    --ec-glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    --ec-head-glass: rgba(11, 11, 16, 0.78);
    --cui-primary: #0071e3;
    --cui-primary-rgb: 0, 113, 227;
    --cui-link-color: #4da3ff;
    --cui-link-hover-color: #7cbcff;
    --cui-body-color: #f5f5f7;
    --cui-body-bg: #0b0b10;
    --cui-border-color: rgba(255, 255, 255, 0.12);
    --cui-input-disabled-bg: #2a2a31;
    --cui-input-disabled-border-color: rgba(255, 255, 255, 0.16);
}
html[data-theme="glass-dark"] body {
    background-color: #0b0b10;
    background-image:
        radial-gradient(900px 700px at 0% 0%, rgba(75, 59, 207, 0.55) 0%, rgba(75, 59, 207, 0) 60%),
        radial-gradient(1000px 800px at 100% 6%, rgba(14, 124, 134, 0.50) 0%, rgba(14, 124, 134, 0) 60%),
        radial-gradient(900px 700px at 16% 100%, rgba(142, 42, 110, 0.45) 0%, rgba(142, 42, 110, 0) 60%),
        radial-gradient(800px 640px at 74% 74%, rgba(31, 79, 184, 0.50) 0%, rgba(31, 79, 184, 0) 60%);
}
html[data-theme="glass-dark"] .ec-bell-badge { box-shadow: 0 0 0 2px #16161a; }
/* The loading shimmer: a faint light, not a white flash */
html[data-theme="glass-dark"] .ec-sk { background-image: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.10) 50%, rgba(255, 255, 255, 0) 70%); }

/* CoreUI parts the light stylesheet leaves white (its dark-theme class covers the rest) */
html[data-theme="glass-dark"] .dropdown-menu { --cui-dropdown-bg: var(--ec-surface); --cui-dropdown-color: var(--ec-ink); --cui-dropdown-link-color: var(--ec-ink);
    --cui-dropdown-link-hover-bg: var(--ec-hover); --cui-dropdown-link-hover-color: var(--ec-ink); --cui-dropdown-border-color: var(--ec-line); --cui-dropdown-header-color: var(--ec-muted); }
html[data-theme="glass-dark"] .wrapper > .header .dropdown-item:hover { background: var(--ec-hover); }
html[data-theme="glass-dark"] .modal-content { background: var(--ec-surface); color: var(--ec-ink); border-color: var(--ec-line); }
html[data-theme="glass-dark"] .table { --cui-table-color: var(--ec-ink); --cui-table-bg: transparent; --cui-table-striped-color: var(--ec-ink); --cui-table-hover-color: var(--ec-ink); }
html[data-theme="glass-dark"] .form-control:disabled, html[data-theme="glass-dark"] .form-control[readonly] { background-color: #2a2a31; color: var(--ec-muted); }
html[data-theme="glass-dark"] .form-select { background-color: var(--ec-surface); color: var(--ec-ink); }
html[data-theme="glass-dark"] .text-dark, html[data-theme="glass-dark"] .text-black { color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] .bg-white { background-color: var(--ec-surface) !important; }
html[data-theme="glass-dark"] .alert-secondary { background: rgba(255, 255, 255, 0.06); color: var(--ec-ink); border-color: var(--ec-line); }

/* DevExpress: its themes draw grids, lists, calendars and pop-up forms white */
html[data-theme="glass-dark"] table[class*="dxgvControl"], html[data-theme="glass-dark"] div[class*="dxgvControl"],
html[data-theme="glass-dark"] [class*="dxgvTable"] { background-color: transparent !important; color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] tr[class*="dxgvDataRow"] > td { background-color: transparent; color: inherit; }
html[data-theme="glass-dark"] tr[class*="dxgvDataRowAlt"] > td { background-color: rgba(255, 255, 255, 0.03); }
html[data-theme="glass-dark"] [class*="dxgvEmptyDataRow"] > td, html[data-theme="glass-dark"] [class*="dxgvDetailRow"] > td,
html[data-theme="glass-dark"] [class*="dxgvPreviewRow"] > td { background-color: transparent !important; }
html[data-theme="glass-dark"] [class*="dxgvEditForm"], html[data-theme="glass-dark"] tr[class*="dxgvEditFormDisplayRow"] > td,
html[data-theme="glass-dark"] tr[class*="dxgvInlineEditRow"] > td { background: var(--ec-pearl) !important; color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] [class*="dxgvEditForm"] td, html[data-theme="glass-dark"] [class*="dxgvEditForm"] label,
html[data-theme="glass-dark"] [class*="dxeBase"], html[data-theme="glass-dark"] [class*="dxeCaption"] { color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] input[class*="dxeEditArea"], html[data-theme="glass-dark"] textarea[class*="dxeMemoEditArea"],
html[data-theme="glass-dark"] [class*="dxeEditArea"] { background-color: transparent !important; color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] table[class*="dxeListBox"], html[data-theme="glass-dark"] div[class*="dxeListBox"],
html[data-theme="glass-dark"] [class*="dxeListBox"] .dxlbd { background-color: var(--ec-surface) !important; }
html[data-theme="glass-dark"] [class*="dxeListBoxItemHover"] { background: var(--ec-hover) !important; }
html[data-theme="glass-dark"] [class*="dxeListBoxItemSelected"] { background: var(--ec-select) !important; }
html[data-theme="glass-dark"] [class*="dxpc-mainDiv"], html[data-theme="glass-dark"] [class*="dxpc-content"],
html[data-theme="glass-dark"] [class*="dxpc-header"], html[data-theme="glass-dark"] [class*="dxpc-footer"],
html[data-theme="glass-dark"] [class*="dxpcDropDown"], html[data-theme="glass-dark"] [class*="dxpcControl"] {
    background-color: var(--ec-surface) !important; color: var(--ec-ink) !important; border-color: var(--ec-line) !important;
}
html[data-theme="glass-dark"] [class*="dxeCalendar"], html[data-theme="glass-dark"] [class*="dxeCalendar"] td,
html[data-theme="glass-dark"] [class*="dxeCalendarHeader"] { background-color: var(--ec-surface) !important; color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] [class*="dxeCalendarOtherMonth"] { color: var(--ec-muted) !important; }
html[data-theme="glass-dark"] [class*="dxeCalendarDaySelected"] { background-color: var(--ec-blue) !important; color: #ffffff !important; }
html[data-theme="glass-dark"] [class*="dxeCalendarToday"] { color: var(--ec-link) !important; }
html[data-theme="glass-dark"] [class*="dxpLite"] .dxp-num:not(.dxp-current), html[data-theme="glass-dark"] [class*="dxpLite"] .dxp-button,
html[data-theme="glass-dark"] [class*="dxpLite"] .dxp-summary, html[data-theme="glass-dark"] [class*="dxpLite"] .dxp-ellip { color: var(--ec-ink) !important; background-color: transparent; }
html[data-theme="glass-dark"] [class*="dxtc"] { color: var(--ec-ink); }
html[data-theme="glass-dark"] [class*="dxtcTab"], html[data-theme="glass-dark"] [class*="dxtcPageContent"],
html[data-theme="glass-dark"] [class*="dxtcContent"] { background-color: transparent !important; color: var(--ec-ink) !important; border-color: var(--ec-line) !important; }
html[data-theme="glass-dark"] [class*="dxtcActiveTab"] { background-color: var(--ec-surface) !important; }
html[data-theme="glass-dark"] [class*="dxmControl"], html[data-theme="glass-dark"] [class*="dxmSubMenu"],
html[data-theme="glass-dark"] [class*="dxm-popup"] { background-color: var(--ec-surface) !important; color: var(--ec-ink) !important; border-color: var(--ec-line) !important; }
html[data-theme="glass-dark"] [class*="dxucControl"], html[data-theme="glass-dark"] [class*="dxucTextBox"] { background-color: transparent !important; color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] [class*="dxgvHeader"] { background: var(--ec-pearl) none !important; }
html[data-theme="glass-dark"] [class*="dxgvFilterBar"], html[data-theme="glass-dark"] [class*="dxgvStatusBar"],
html[data-theme="glass-dark"] [class*="dxgvTitlePanel"] { background: transparent !important; color: var(--ec-ink) !important; }
/* Text boxes, date and drop-down boxes, the grid search box: DevExpress paints them light grey while empty; read-only
   boxes keep their own grey (ecanteen-apple.css) */
html[data-theme="glass-dark"] table[class*="dxeTextBox"]:not(:has(input[readonly])), html[data-theme="glass-dark"] div[class*="dxeTextBox"]:not(:has(input[readonly])),
html[data-theme="glass-dark"] table[class*="dxeButtonEdit"]:not(:has(input[readonly])), html[data-theme="glass-dark"] div[class*="dxeButtonEdit"]:not(:has(input[readonly])),
html[data-theme="glass-dark"] table[class*="dxeMemo"]:not(:has(textarea[readonly])) { background-color: var(--ec-surface) !important; }
/* The pager's page-size box */
html[data-theme="glass-dark"] [class*="dxpLite"] .dxp-comboBox, html[data-theme="glass-dark"] [class*="dxpLite"] .dxp-dropDownButton,
html[data-theme="glass-dark"] [class*="dxpLite"] .dxp-comboBox input { background-color: var(--ec-surface) !important; color: var(--ec-ink) !important; border-color: var(--ec-field) !important; }
/* The cell around an edit form opened in a grid (Add New, Edit), totals rows, the header's empty corner, grid toolbars */
html[data-theme="glass-dark"] td[id$="_DXEFC"] { background: var(--ec-pearl) !important; }
html[data-theme="glass-dark"] tr[class*="dxgvFooter"], html[data-theme="glass-dark"] tr[class*="dxgvGroupFooter"] { background: transparent !important; }
html[data-theme="glass-dark"] td[class*="dxgvHEC"] { background: var(--ec-pearl) !important; }
html[data-theme="glass-dark"] [class*="dxctToolbar"], html[data-theme="glass-dark"] .dxm-main { background-color: var(--ec-surface) !important; border-color: var(--ec-line) !important; }
html[data-theme="glass-dark"] .dxm-main .dxm-contentText, html[data-theme="glass-dark"] .dxm-main .dxm-item { color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] .dxm-main .dxm-disabled .dxm-contentText { color: var(--ec-muted) !important; }
/* Tick boxes and switches while off (on, they are the theme's blue); the switch's knob light enough to see */
html[data-theme="glass-dark"] .form-check-input:not(:checked) { background-color: var(--ec-surface); border-color: var(--ec-field); }
html[data-theme="glass-dark"] .form-switch .form-check-input:not(:checked) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255,255,255,0.6%29'/%3e%3c/svg%3e");
}
/* Text the pages colour in code (ForeColor Black / Green / Blue, and a few exact reds and greens): readable on dark.
   Red is already the theme's red (ecanteen-apple.css). */
html[data-theme="glass-dark"] [style*="color:Black" i], html[data-theme="glass-dark"] [style*="color: black" i],
html[data-theme="glass-dark"] [style*="color:#000000" i] { color: var(--ec-ink) !important; }
html[data-theme="glass-dark"] [style*="color:Green" i], html[data-theme="glass-dark"] [style*="color: green" i],
html[data-theme="glass-dark"] [style*="color:#1D6B34" i], html[data-theme="glass-dark"] [class*="dxflRequired"] { color: var(--ec-ok) !important; }
html[data-theme="glass-dark"] [style*="color:Blue" i], html[data-theme="glass-dark"] [style*="color: blue" i] { color: var(--ec-link) !important; }
html[data-theme="glass-dark"] [style*="color:#D70015" i], html[data-theme="glass-dark"] [style*="color:#B3261E" i] { color: var(--ec-err) !important; }

/* Icons drawn as dark pictures (grid action icons, DevExpress glyphs) stay visible */
html[data-theme="glass-dark"] td[class*="dxgvCommandColumn"] img,
html[data-theme="glass-dark"] img[class*="dxEditors_"], html[data-theme="glass-dark"] img[class*="dxGridView_"],
html[data-theme="glass-dark"] img[class*="dxWeb_"] { filter: invert(0.9) hue-rotate(180deg); }

/* The sign-in page keeps its photo, the panel over it glassy */
html[data-theme^="glass"] body.ec-login { background: #272729 url("../images/background.jpg") center / cover no-repeat fixed; }
@media (max-width: 767.98px) {
    html[data-theme^="glass"] body.ec-login { background: var(--ec-surface); }
}

/* ---------- Every theme other than the default: the announcement menu in the top bar (MasterPageXHRMS.master) ---------- */

html[data-theme]:not([data-theme="default"]) .ec-ann-menu .ec-ann-head,
html[data-theme]:not([data-theme="default"]) .ec-ann-menu .ec-ann-foot { border-color: var(--ec-line); }
html[data-theme]:not([data-theme="default"]) .ec-ann-item { border-top-color: var(--ec-line-soft); }
html[data-theme]:not([data-theme="default"]) .ec-ann-link { color: var(--ec-link); }
html[data-theme]:not([data-theme="default"]) .ec-ann-item.ec-ann-unread .ec-ann-dot { background: var(--ec-link); }
html[data-theme]:not([data-theme="default"]) .ec-ann-item .ec-ann-when,
html[data-theme]:not([data-theme="default"]) .ec-ann-none { color: var(--ec-muted); }

/* ---------- The theme list in the Account menu ---------- */

.theme-swatch { flex: 0 0 auto; width: 20px; height: 14px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14); }
