/* ==============================================================================
   Project Name    : Esyasoft.AMI.Unified.Web
   File Name       : dark-mode.css
   File Purpose    : Every dark-mode style of the application, in one place.
                     Active when <html data-theme="dark"> (set by wwwroot/js/theme.js from the user menu:
                     System / Light / Dark). Bootstrap 5.3 follows through data-bs-theme="dark".
   Created By      : RAJSREE S
   Created Date    : 2026-11-09
   Reviewed By     :
   Recent Updated by  : RAJSREE S
   ==============================================================================

   HOW IT IS BUILT
   1. Palette (--dm-*)          one set of dark colours everything below uses
   2. Design tokens             BlazorKit variables (tokens, table, chart, tabs) and the app's own variables
   3. BlazorKit components      the parts of BlazorKit that use fixed light colours
   4. App shell                 body, layout, side menu, header pop-ups, date picker, hierarchy tree, page top bar
   5. Pages                     Demand, Operations, SLA, Alarms, Commands, Revenue, Loss & balance, Devices, Summary,
                                Master info, GIS / map, Login, the older ADDC / Gas operations pages
   6. Shared helpers            semantic pills and text (green / amber / red / blue) used by many pages
   7. VEE                       Rule Library + Validation Rule drawer

   Adding a page? Give its cards var(--dm-surface), borders var(--dm-border) and text var(--dm-text),
   or reuse the BlazorKit Card / Table / KpiCard, which are already themed here.
   ============================================================================== */


/* ==============================================================================
   1. PALETTE
   ============================================================================== */
html[data-theme="dark"] {
    color-scheme: dark;

    --dm-bg: #0e1318;            /* page */
    --dm-surface: #151c23;       /* cards, panels, pop-ups */
    --dm-surface-2: #1a222a;     /* table headers, inputs, hover */
    --dm-surface-3: #21324a;     /* pressed / selected */
    --dm-border: #2b353f;
    --dm-border-soft: #222b34;
    --dm-text: #e6eaee;          /* primary text */
    --dm-text-2: #c4ccd4;
    --dm-text-sec: #95a1ad;      /* secondary text */
    --dm-text-mut: #7d8995;      /* muted text, axis labels */
    --dm-primary: #93b5e6;
    --dm-primary-hover: #abc7ed;
    --dm-link: #a8c7ef;

    /* tinted backgrounds + readable text for semantic pills */
    --dm-primary-bg: #21324a;
    --dm-primary-text: #b6d0f3;
    --dm-success-bg: #11302a;
    --dm-success-text: #4cc9ae;
    --dm-warning-bg: #33260f;
    --dm-warning-text: #f0b159;
    --dm-danger-bg: #3a1917;
    --dm-danger-text: #f38b83;
    --dm-info-bg: #1e2a3b;
    --dm-info-text: #93b5e6;
    --dm-purple-bg: rgba(163, 113, 247, 0.15);
    --dm-purple-text: #d2a8ff;

    --dm-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --dm-shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.5);
}


/* ==============================================================================
   2. DESIGN TOKENS
   ============================================================================== */
html[data-theme="dark"] {
    /* ---- BlazorKit: tokens.css ---- */
    --uuc-color-text-primary: var(--dm-text);
    --uuc-color-text-secondary: var(--dm-text-sec);
    --uuc-color-text-disabled: #6e7681;
    --uuc-color-text: var(--dm-text);
    --uuc-color-primary: var(--dm-primary);
    --uuc-color-primary-hover: var(--dm-primary-hover);
    --uuc-color-primary-bg: var(--dm-primary-bg);
    --uuc-color-primary-bg-hover: rgba(56, 139, 253, 0.25);
    --uuc-color-success-bg: var(--dm-success-bg);
    --uuc-color-success-bg-hover: rgba(46, 160, 67, 0.25);
    --uuc-color-success-active: var(--dm-success-text);
    --uuc-color-warning-bg: var(--dm-warning-bg);
    --uuc-color-warning-bg-hover: rgba(210, 153, 34, 0.25);
    --uuc-color-warning-active: var(--dm-warning-text);
    --uuc-color-danger-bg: var(--dm-danger-bg);
    --uuc-color-danger-bg-hover: rgba(248, 81, 73, 0.25);
    --uuc-color-danger-active: var(--dm-danger-text);
    --uuc-color-link: var(--dm-link);
    --uuc-color-link-hover: var(--dm-primary-hover);
    --uuc-code-bg: var(--dm-surface-2);
    --uuc-code-border: var(--dm-border);
    --uuc-kbd-bg: var(--dm-surface-2);
    --uuc-kbd-border: var(--dm-border);
    --uuc-mark-bg: rgba(210, 153, 34, 0.35);

    --uuc-btn-default-bg: var(--dm-surface-2);
    --uuc-btn-default-color: var(--dm-text);
    --uuc-btn-default-border: var(--dm-border);
    --uuc-btn-filled-bg: rgba(255, 255, 255, 0.06);
    --uuc-btn-filled-bg-hover: rgba(255, 255, 255, 0.1);
    --uuc-btn-filled-bg-active: rgba(255, 255, 255, 0.16);
    --uuc-btn-disabled-bg: rgba(255, 255, 255, 0.04);
    --uuc-btn-disabled-border: var(--dm-border);

    --uuc-input-bg: var(--dm-surface-2);
    --uuc-input-color: var(--dm-text);
    --uuc-input-placeholder: var(--dm-text-mut);
    --uuc-input-border: var(--dm-border);
    --uuc-input-border-hover: var(--dm-primary);
    --uuc-input-border-focus: var(--dm-primary);
    --uuc-input-disabled-bg: var(--dm-surface);
    --uuc-input-disabled-border: var(--dm-border-soft);
    --uuc-input-disabled-color: var(--dm-text-mut);
    --uuc-input-addon-bg: var(--dm-surface-3);
    --uuc-input-addon-border: var(--dm-border);
    --uuc-input-addon-color: var(--dm-text-sec);

    --uuc-kpi-bg: var(--dm-surface);
    --uuc-kpi-border: var(--dm-border);
    --uuc-kpi-shadow: none;

    --uuc-drawer-bg: var(--dm-surface);
    --uuc-drawer-border-color: var(--dm-border);
    --uuc-drawer-mask-bg: rgba(0, 0, 0, 0.6);
    --uuc-modal-bg: var(--dm-surface);
    --uuc-modal-border-color: var(--dm-border);
    --uuc-modal-footer-bg: var(--dm-surface-2);
    --uuc-modal-mask-bg: rgba(0, 0, 0, 0.6);

    --uuc-breadcrumb-text-color: var(--dm-text-sec);
    --uuc-breadcrumb-active-color: var(--dm-text);
    --uuc-breadcrumb-separator-color: var(--dm-text-mut);
    --uuc-breadcrumb-collapse-bg: var(--dm-surface-2);
    --uuc-breadcrumb-collapse-hover-bg: var(--dm-surface-3);
    --uuc-menu-dark-bg: var(--dm-surface);

    /* ---- BlazorKit: table.css ---- */
    --uuc-table-header-bg: var(--dm-surface-2);
    --uuc-table-header-color: var(--dm-text);
    --uuc-table-header-sort-bg: var(--dm-surface-3);
    --uuc-table-header-sort-active-bg: var(--dm-surface-3);
    --uuc-table-body-bg: var(--dm-surface);
    --uuc-table-row-hover-bg: var(--dm-surface-2);
    --uuc-table-row-selected-bg: var(--dm-primary-bg);
    --uuc-table-row-selected-hover-bg: rgba(56, 139, 253, 0.25);
    --uuc-table-border-color: var(--dm-border-soft);
    --uuc-table-text-color: var(--dm-text);
    --uuc-table-text-secondary: var(--dm-text-sec);

    /* ---- BlazorKit: charts.css ---- */
    --uuc-chart-text: var(--dm-text);
    --uuc-chart-text-secondary: var(--dm-text-sec);
    --uuc-chart-axis-label: var(--dm-text-mut);
    --uuc-chart-axis-line: rgba(255, 255, 255, 0.18);
    --uuc-chart-grid: rgba(255, 255, 255, 0.07);
    --uuc-chart-band-hover: rgba(255, 255, 255, 0.05);
    --uuc-chart-crosshair: rgba(255, 255, 255, 0.3);
    --uuc-chart-bg: var(--dm-surface);
    --uuc-chart-border: var(--dm-border);
    --uuc-chart-tooltip-bg: var(--dm-surface-2);
    --uuc-chart-tooltip-shadow: var(--dm-shadow-lg);

    /* ---- BlazorKit: tabs.css ---- */
    --uuc-tabs-color: var(--dm-text-sec);
    --uuc-tabs-color-hover: var(--dm-text);
    --uuc-tabs-color-active: var(--dm-text);
    --uuc-tabs-border-color: var(--dm-border);
    --uuc-tabs-indicator-color: var(--dm-primary);
    --uuc-tabs-card-border: var(--dm-border);
    --uuc-tabs-card-bg: var(--dm-surface-2);
    --uuc-tabs-card-active-bg: var(--dm-surface);

    /* ---- the app's own variables (Home.razor, Card) ---- */
    --text-pri: var(--dm-text);
    --text-sec: var(--dm-text-sec);
    --text-mut: var(--dm-text-mut);
    --line-col: var(--dm-border);
    --line-subtle: var(--dm-border-soft);
    --line: var(--dm-border);
    --line2: var(--dm-border-soft);
    --card-bg: var(--dm-surface);
    --bg-portal: var(--dm-bg);
    --teal-pri: #2dd4bf;
    --teal-hover: #5eead4;
    --teal-light: var(--dm-info-bg);
    --warn-col: var(--dm-warning-text);
    --bad-col: var(--dm-danger-text);

    /* ---- Bootstrap (on top of data-bs-theme="dark") ---- */
    --bs-body-bg: var(--dm-bg);
    --bs-body-color: var(--dm-text);
    --bs-border-color: var(--dm-border);
    --bs-emphasis-color: var(--dm-text);
    --bs-secondary-color: var(--dm-text-sec);
    --bs-secondary-bg: var(--dm-surface-2);
    --bs-tertiary-bg: var(--dm-surface);
    --bs-link-color: var(--dm-link);
    --bs-link-hover-color: var(--dm-primary-hover);
    --bs-form-control-bg: var(--dm-surface-2);
    --bs-form-control-color: var(--dm-text);
    --bs-form-control-border-color: var(--dm-border);
    --bs-table-bg: var(--dm-surface);
    --bs-table-color: var(--dm-text);
    --bs-table-border-color: var(--dm-border-soft);
}


/* ==============================================================================
   3. BLAZORKIT COMPONENTS (fixed light colours in the package CSS)
   ============================================================================== */

/* ---- Button: outlined and dashed buttons have a fixed white background (e.g. every "Refresh") ---- */
html[data-theme="dark"] .uuc-btn--variant-outlined,
html[data-theme="dark"] .uuc-btn--variant-dashed {
    --btn-bg: var(--dm-surface-2);
    --btn-hover-bg: var(--dm-surface-3);
    --btn-active-bg: var(--dm-surface-3);
}

html[data-theme="dark"] .uuc-btn--color-default.uuc-btn--variant-outlined,
html[data-theme="dark"] .uuc-btn--color-default.uuc-btn--variant-dashed {
    --btn-color: var(--dm-text);
}

/* ---- Card ---- */
html[data-theme="dark"] .uuc-card {
    box-shadow: none;
}

html[data-theme="dark"] .uuc-card-hover:hover {
    border-color: #3d444d;
    box-shadow: var(--dm-shadow);
}

/* ---- KPI card: every variant ---- */
html[data-theme="dark"] .uuc-kpi-card,
html[data-theme="dark"] .uuc-kpi-card--standard,
html[data-theme="dark"] .uuc-kpi-card--elevated,
html[data-theme="dark"] .uuc-kpi-card--bordered,
html[data-theme="dark"] .uuc-kpi-card--accent-left,
html[data-theme="dark"] .uuc-kpi-card--accent-top {
    background-color: var(--dm-surface);
    border-color: var(--dm-border);
    box-shadow: none;
}

html[data-theme="dark"] .uuc-kpi-card--standard:hover {
    border-color: #3d444d;
    box-shadow: var(--dm-shadow);
}

html[data-theme="dark"] .uuc-kpi-card--filled,
html[data-theme="dark"] .uuc-kpi-card--gradient {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
}

html[data-theme="dark"] .uuc-kpi-card--filled.uuc-kpi--color-primary,
html[data-theme="dark"] .uuc-kpi-card--gradient.uuc-kpi--color-primary { background: var(--dm-primary-bg); }
html[data-theme="dark"] .uuc-kpi-card--filled.uuc-kpi--color-success,
html[data-theme="dark"] .uuc-kpi-card--gradient.uuc-kpi--color-success { background: var(--dm-success-bg); }
html[data-theme="dark"] .uuc-kpi-card--filled.uuc-kpi--color-warning,
html[data-theme="dark"] .uuc-kpi-card--gradient.uuc-kpi--color-warning { background: var(--dm-warning-bg); }
html[data-theme="dark"] .uuc-kpi-card--filled.uuc-kpi--color-danger,
html[data-theme="dark"] .uuc-kpi-card--gradient.uuc-kpi--color-danger { background: var(--dm-danger-bg); }
html[data-theme="dark"] .uuc-kpi-card--filled.uuc-kpi--color-info,
html[data-theme="dark"] .uuc-kpi-card--gradient.uuc-kpi--color-info { background: var(--dm-info-bg); }
html[data-theme="dark"] .uuc-kpi-card--filled.uuc-kpi--color-purple,
html[data-theme="dark"] .uuc-kpi-card--gradient.uuc-kpi--color-purple { background: var(--dm-purple-bg); }

html[data-theme="dark"] .uuc-kpi-title,
html[data-theme="dark"] .uuc-kpi-subtitle,
html[data-theme="dark"] .uuc-kpi-trend-label {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .uuc-kpi-value-wrap {
    color: var(--dm-text);
}

html[data-theme="dark"] .uuc-kpi-trend--positive { background-color: var(--dm-success-bg); color: var(--dm-success-text); }
html[data-theme="dark"] .uuc-kpi-trend--negative { background-color: var(--dm-danger-bg); color: var(--dm-danger-text); }
html[data-theme="dark"] .uuc-kpi-trend--neutral { background-color: var(--dm-surface-3); color: var(--dm-text-sec); }

/* ---- Table ---- */
html[data-theme="dark"] .uuc-table-container,
html[data-theme="dark"] .uuc-table-export-menu,
html[data-theme="dark"] .uuc-customizer-modal,
html[data-theme="dark"] .uuc-customizer-item {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .uuc-table-search-input,
html[data-theme="dark"] .uuc-table-btn-outline,
html[data-theme="dark"] .uuc-pagination-item,
html[data-theme="dark"] .uuc-pagination-btn,
html[data-theme="dark"] .uuc-table-pagesize-select {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .uuc-pagination-item.active {
    background: var(--dm-primary);
    border-color: var(--dm-primary);
    color: #fff;
}

html[data-theme="dark"] .uuc-pagination-btn:disabled {
    background: var(--dm-surface);
    border-color: var(--dm-border-soft);
    color: #484f58;
}

html[data-theme="dark"] .uuc-table-striped .uuc-table-tbody > tr:nth-child(even) > td,
html[data-theme="dark"] .uuc-table-tfoot > tr > td,
html[data-theme="dark"] .uuc-customizer-box,
html[data-theme="dark"] .uuc-customizer-box-title,
html[data-theme="dark"] .uuc-table-modal-footer {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text-2);
}

html[data-theme="dark"] .uuc-table-loading-mask {
    background: rgba(13, 17, 23, 0.65);
}

html[data-theme="dark"] .uuc-table-search-icon,
html[data-theme="dark"] .uuc-table-search-clear,
html[data-theme="dark"] .uuc-table-empty,
html[data-theme="dark"] .uuc-pagination-ellipsis,
html[data-theme="dark"] .uuc-sort-neutral,
html[data-theme="dark"] .uuc-table-modal-close,
html[data-theme="dark"] .uuc-customizer-empty,
html[data-theme="dark"] .uuc-customizer-item-btn {
    color: var(--dm-text-mut);
}

html[data-theme="dark"] .uuc-customizer-item-btn:hover:not(:disabled),
html[data-theme="dark"] .uuc-table-btn-outline:hover {
    background: var(--dm-surface-3);
}

html[data-theme="dark"] .uuc-table-tbody > tr > td.uuc-table-cell-fixed-right,
html[data-theme="dark"] .uuc-table-tbody > tr > td.uuc-table-cell-fixed-left {
    background: var(--dm-surface);
}

html[data-theme="dark"] .uuc-table-title {
    color: var(--dm-text);
}

/* ---- Charts ---- */
html[data-theme="dark"] .uuc-chart-legend-item.is-inactive,
html[data-theme="dark"] .uuc-treemap-crumb-sep,
html[data-theme="dark"] .uuc-chart-empty {
    color: rgba(255, 255, 255, 0.3);
}

html[data-theme="dark"] .uuc-pie-slice,
html[data-theme="dark"] .uuc-treemap-tile rect {
    stroke: var(--dm-surface);
}

html[data-theme="dark"] .uuc-chart-loading {
    background: rgba(13, 17, 23, 0.6);
}

/* ---- Tabs ---- */
html[data-theme="dark"] .uuc-tabs-card .uuc-tabs-tab:hover:not(.uuc-tabs-tab-disabled),
html[data-theme="dark"] .uuc-tabs-nav-add:hover {
    background: var(--dm-surface-2);
}

html[data-theme="dark"] .uuc-tabs-tab.uuc-tabs-tab-disabled .uuc-tabs-badge {
    background: var(--dm-surface-2);
}

html[data-theme="dark"] .uuc-tabs-tab-remove,
html[data-theme="dark"] .uuc-tabs-nav-add {
    color: var(--dm-text-mut);
}

/* ---- Forms ---- */
html[data-theme="dark"] .uuc-input-field:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--dm-surface-2) inset !important;
    -webkit-text-fill-color: var(--dm-text);
}

html[data-theme="dark"] .uuc-input-clear-btn,
html[data-theme="dark"] .uuc-input-action-btn,
html[data-theme="dark"] .uuc-input-stepper-btn {
    color: var(--dm-text-mut);
}

html[data-theme="dark"] .uuc-input-action-btn:hover,
html[data-theme="dark"] .uuc-input-clear-btn:hover {
    color: var(--dm-text);
}

html[data-theme="dark"] .uuc-input-stepper {
    background: var(--dm-surface-2);
}

html[data-theme="dark"] .uuc-input-stepper-btn:hover {
    background: var(--dm-surface-3);
}

/* ---- Badge ---- */
html[data-theme="dark"] .uuc-badge-subtle.uuc-badge-color-neutral { background-color: var(--dm-surface-3); color: var(--dm-text-sec); border-color: var(--dm-border); }
html[data-theme="dark"] .uuc-badge-subtle.uuc-badge-color-primary { background-color: var(--dm-primary-bg); color: var(--dm-primary-text); border-color: transparent; }
html[data-theme="dark"] .uuc-badge-subtle.uuc-badge-color-success { background-color: var(--dm-success-bg); color: var(--dm-success-text); border-color: transparent; }
html[data-theme="dark"] .uuc-badge-subtle.uuc-badge-color-warning { background-color: var(--dm-warning-bg); color: var(--dm-warning-text); border-color: transparent; }
html[data-theme="dark"] .uuc-badge-subtle.uuc-badge-color-danger { background-color: var(--dm-danger-bg); color: var(--dm-danger-text); border-color: transparent; }
html[data-theme="dark"] .uuc-badge-subtle.uuc-badge-color-info { background-color: var(--dm-info-bg); color: var(--dm-info-text); border-color: transparent; }
html[data-theme="dark"] .uuc-badge-outline.uuc-badge-color-neutral { color: var(--dm-text-sec); border-color: var(--dm-border); }
html[data-theme="dark"] .uuc-badge-outline.uuc-badge-color-primary { color: var(--dm-primary-text); }
html[data-theme="dark"] .uuc-badge-outline.uuc-badge-color-success { color: var(--dm-success-text); }
html[data-theme="dark"] .uuc-badge-outline.uuc-badge-color-warning { color: var(--dm-warning-text); }
html[data-theme="dark"] .uuc-badge-outline.uuc-badge-color-danger { color: var(--dm-danger-text); }
html[data-theme="dark"] .uuc-badge-outline.uuc-badge-color-info { color: var(--dm-info-text); }

/* ---- Alert / NoticeBanner ---- */
html[data-theme="dark"] .uuc-alert-severity-info { background-color: var(--dm-info-bg); border-color: rgba(45, 212, 191, 0.3); color: var(--dm-info-text); }
html[data-theme="dark"] .uuc-alert-severity-warning { background-color: var(--dm-warning-bg); border-color: rgba(210, 153, 34, 0.35); color: var(--dm-warning-text); }
html[data-theme="dark"] .uuc-alert-severity-success { background-color: var(--dm-success-bg); border-color: rgba(46, 160, 67, 0.35); color: var(--dm-success-text); }
html[data-theme="dark"] .uuc-alert-severity-danger { background-color: var(--dm-danger-bg); border-color: rgba(248, 81, 73, 0.35); color: var(--dm-danger-text); }
html[data-theme="dark"] .uuc-alert-severity-neutral { background-color: var(--dm-surface-2); border-color: var(--dm-border); color: var(--dm-text-2); }
html[data-theme="dark"] .uuc-alert-close:hover { background-color: rgba(255, 255, 255, 0.08); }

/* ---- Drawer / Modal ---- */
html[data-theme="dark"] .uuc-drawer-close-btn:hover,
html[data-theme="dark"] .uuc-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .uuc-drawer-panel--right,
html[data-theme="dark"] .uuc-drawer-panel--left,
html[data-theme="dark"] .uuc-drawer-panel--top,
html[data-theme="dark"] .uuc-drawer-panel--bottom,
html[data-theme="dark"] .uuc-modal {
    box-shadow: var(--dm-shadow-lg);
}

html[data-theme="dark"] .uuc-dialog-input {
    background: var(--dm-surface-2);
}

/* ---- Menu ---- */
html[data-theme="dark"] .uuc-menu--light,
html[data-theme="dark"] .uuc-menu-sub--popup {
    background-color: var(--dm-surface);
    color: var(--dm-text);
}

html[data-theme="dark"] .uuc-menu--light .uuc-menu-submenu-title:hover:not([aria-disabled="true"]),
html[data-theme="dark"] .uuc-menu--light .uuc-menu-sub--inline {
    background-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .uuc-menu-item-divider { background-color: var(--dm-border); }
html[data-theme="dark"] .uuc-menu-item-divider--dashed { border-top-color: var(--dm-border); }
html[data-theme="dark"] .uuc-menu--horizontal { border-bottom-color: var(--dm-border); }

/* ---- Typography ---- */
html[data-theme="dark"] .uuc-typography-code { color: var(--dm-danger-text); }
html[data-theme="dark"] .uuc-typography-copy-btn:hover { background-color: var(--dm-surface-3); }

/* ---- TreeTable ---- */
html[data-theme="dark"] .uuc-treetable-wrap { background: var(--dm-surface); border-color: var(--dm-border); }
html[data-theme="dark"] .uuc-treetable th { background: var(--dm-surface-2); color: var(--dm-text-sec); border-bottom-color: var(--dm-border); }
html[data-theme="dark"] .uuc-treetable td { color: var(--dm-text); border-bottom-color: var(--dm-border-soft); }
html[data-theme="dark"] .uuc-treetable-row:hover { background-color: var(--dm-surface-2); }
html[data-theme="dark"] .uuc-treetable-row.selected { background-color: var(--dm-primary-bg); }
html[data-theme="dark"] .btn-tree-toggle { color: var(--dm-text-mut); }
html[data-theme="dark"] .btn-tree-toggle:hover { background-color: var(--dm-surface-3); color: var(--dm-text); }

/* ---- Pipeline ---- */
html[data-theme="dark"] .uuc-pipeline-step:hover:not(:disabled),
html[data-theme="dark"] .uuc-pipeline-step.uuc-pipeb:hover:not(:disabled) { background-color: var(--dm-surface-2); }
html[data-theme="dark"] .uuc-pipeline-step.active,
html[data-theme="dark"] .uuc-pipeline-step.uuc-pipeb { background-color: var(--dm-surface); border-color: var(--dm-border); box-shadow: none; }
html[data-theme="dark"] .uuc-pipeline-step.uuc-pipeb.active { background-color: var(--dm-primary-bg); border-color: var(--dm-primary); box-shadow: inset 0 0 0 1px var(--dm-primary); }
html[data-theme="dark"] .uuc-pipeline-step.uuc-pipeb .num { color: var(--dm-text); }
html[data-theme="dark"] .uuc-pipeline-step.uuc-pipeb.active .num { color: var(--dm-primary-text); }
html[data-theme="dark"] .uuc-pipeline-pill .step-count { background-color: rgba(255, 255, 255, 0.1); }
html[data-theme="dark"] .uuc-pipe-variant-neutral { background-color: var(--dm-surface-3); color: var(--dm-text-2); border-color: var(--dm-border); }
html[data-theme="dark"] .uuc-pipe-variant-primary { background-color: var(--dm-primary-bg); color: var(--dm-primary-text); border-color: transparent; }
html[data-theme="dark"] .uuc-pipe-variant-success { background-color: var(--dm-success-bg); color: var(--dm-success-text); border-color: transparent; }
html[data-theme="dark"] .uuc-pipe-variant-warning { background-color: var(--dm-warning-bg); color: var(--dm-warning-text); border-color: transparent; }
html[data-theme="dark"] .uuc-pipe-variant-danger { background-color: var(--dm-danger-bg); color: var(--dm-danger-text); border-color: transparent; }
html[data-theme="dark"] .uuc-pipe-variant-info { background-color: var(--dm-info-bg); color: var(--dm-info-text); border-color: transparent; }


/* ==============================================================================
   4. APP SHELL
   ============================================================================== */

/* ---- page, layout ---- */
html[data-theme="dark"] body,
html[data-theme="dark"] .portal-wrapper,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .app-body,
html[data-theme="dark"] .app-main {
    background: var(--dm-bg);
    color: var(--dm-text);
}

html[data-theme="dark"] a:not(.uuc-btn):not([class*="btn"]) {
    color: var(--dm-link);
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3d444d;
}

/* ---- top header: sits on the same surface tokens as the rest of the dark theme.
        Header.razor hard-codes its own near-black colours, a pure-white active segment and
        un-bordered pills, which read as a different, harsher palette than the page below. ---- */
html[data-theme="dark"] .app-header {
    background: var(--dm-surface);
    color: var(--dm-text);
    border-bottom: 1px solid var(--dm-border);
}

html[data-theme="dark"] .app-header .icon-btn {
    color: var(--dm-text-2);
}

html[data-theme="dark"] .app-header .icon-btn:hover,
html[data-theme="dark"] .app-header .icon-btn.boxed {
    background: var(--dm-surface-3);
    color: var(--dm-text);
}

html[data-theme="dark"] .app-header .mode-group,
html[data-theme="dark"] .app-header .pill {
    background: var(--dm-surface-2);
    border: 1px solid var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .app-header .pill:hover {
    background: var(--dm-surface-3);
}

/* a lighter chip instead of a pure-white block for the selected utility */
html[data-theme="dark"] .app-header .seg {
    color: var(--dm-text-2);
}

html[data-theme="dark"] .app-header .seg:hover {
    background: var(--dm-surface-3);
    color: var(--dm-text);
}

html[data-theme="dark"] .app-header .seg.active {
    background: var(--dm-primary-bg);
    color: var(--dm-primary-text);
    box-shadow: inset 0 0 0 1px var(--dm-primary);
}

html[data-theme="dark"] .app-header .muted,
html[data-theme="dark"] .app-header .pill.search span {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .app-header .badge-orange {
    background: var(--dm-warning-bg);
    color: var(--dm-warning-text);
    box-shadow: inset 0 0 0 1px var(--dm-warning-text);
}

html[data-theme="dark"] .app-header .badge-red {
    background: var(--dm-danger-bg);
    color: var(--dm-danger-text);
    box-shadow: 0 0 0 2px var(--dm-surface), inset 0 0 0 1px var(--dm-danger-text);
}

html[data-theme="dark"] .app-header .role-select {
    background: var(--dm-surface-2);
    border: 1px solid var(--dm-border);
}

html[data-theme="dark"] .app-header .role-select:hover {
    background: var(--dm-surface-3);
}

html[data-theme="dark"] .app-header .role-select select,
html[data-theme="dark"] .app-header .role-select i {
    color: var(--dm-text);
}

html[data-theme="dark"] .app-header .role-select select option {
    background: var(--dm-surface);
    color: var(--dm-text);
}

html[data-theme="dark"] .app-header .avatar {
    background: var(--dm-primary-bg);
    color: var(--dm-primary-text);
    border: 1px solid var(--dm-primary);
}

/* ---- side menu (NavMenu rail) ---- */
html[data-theme="dark"] .app-sidebar {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}

html[data-theme="dark"] .rail .rail-item {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .rail .rail-item:hover {
    background: var(--dm-surface-2);
    color: var(--dm-text);
}

html[data-theme="dark"] .rail .rail-item.active,
html[data-theme="dark"] .focus-bottom-nav .rail .rail-item.active:hover {
    background: var(--dm-primary-bg);
    color: var(--dm-primary-text);
}

/* ---- focus-mode bottom bar ---- */
html[data-theme="dark"] .focus-bottom-nav {
    background: #010409;
    border: 1px solid var(--dm-border);
}

html[data-theme="dark"] .focus-bottom-nav .focus-nav-item.active {
    background: var(--dm-surface-3);
    color: var(--dm-text);
}

/* ---- header pop-ups: search, date, my work, user menu ---- */
html[data-theme="dark"] .search-top,
html[data-theme="dark"] .search-tabs,
html[data-theme="dark"] .search-footer,
html[data-theme="dark"] .date-popup,
html[data-theme="dark"] .my-work__header,
html[data-theme="dark"] .my-work__tabs,
html[data-theme="dark"] .my-work__titlebar,
html[data-theme="dark"] .my-work__body,
html[data-theme="dark"] .my-work__card,
html[data-theme="dark"] .work-head,
html[data-theme="dark"] .work-body,
html[data-theme="dark"] .user-menu,
html[data-theme="dark"] .popup-container {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .search-top input,
html[data-theme="dark"] .date-popup input,
html[data-theme="dark"] .user-menu__select {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .search-tab,
html[data-theme="dark"] .esc-button,
html[data-theme="dark"] .search-footer kbd,
html[data-theme="dark"] .date-presets button,
html[data-theme="dark"] .popup-actions button,
html[data-theme="dark"] .my-work__tab,
html[data-theme="dark"] .my-work__btn--secondary,
html[data-theme="dark"] .user-menu__chip,
html[data-theme="dark"] .user-menu__segmented,
html[data-theme="dark"] .user-menu__segmented button,
html[data-theme="dark"] .user-menu__signout {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text-2);
}

html[data-theme="dark"] .result-row {
    background: transparent;
    color: var(--dm-text);
}

html[data-theme="dark"] .result-row:hover,
html[data-theme="dark"] .user-menu__signout:hover,
html[data-theme="dark"] .date-presets button:hover,
html[data-theme="dark"] .popup-actions button:hover {
    background: var(--dm-surface-3);
}

html[data-theme="dark"] .section-label,
html[data-theme="dark"] .my-work__window-btn,
html[data-theme="dark"] .user-menu__label,
html[data-theme="dark"] .user-menu__sub,
html[data-theme="dark"] .user-menu__hint {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .user-menu__name {
    color: var(--dm-text);
}

/* the selected chip / segment / tab stays clearly marked */
html[data-theme="dark"] .user-menu__chip--on,
html[data-theme="dark"] .user-menu__seg--on,
html[data-theme="dark"] .user-menu__segmented button.user-menu__seg--on,
html[data-theme="dark"] .search-tab.active,
html[data-theme="dark"] .my-work__tab--active,
html[data-theme="dark"] .my-work__tab.active {
    background: var(--dm-primary-bg);
    border-color: var(--dm-primary);
    color: var(--dm-primary-text);
}

html[data-theme="dark"] .my-work__badge { background: var(--dm-primary-bg); color: var(--dm-primary-text); }
html[data-theme="dark"] .my-work__badge--approval { background: var(--dm-warning-bg); color: var(--dm-warning-text); }
html[data-theme="dark"] .my-work__badge--alarm { background: var(--dm-danger-bg); color: var(--dm-danger-text); }

/* ---- date range picker ---- */
html[data-theme="dark"] .date-picker,
html[data-theme="dark"] .date-presets,
html[data-theme="dark"] .date-bottom {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .date-option,
html[data-theme="dark"] .calendar-head h3,
html[data-theme="dark"] .nav-button,
html[data-theme="dark"] .day {
    color: var(--dm-text);
}

html[data-theme="dark"] .date-option:hover,
html[data-theme="dark"] .nav-button:hover:not(:disabled),
html[data-theme="dark"] .cancel-btn:hover {
    background: var(--dm-surface-2);
}

html[data-theme="dark"] .date-option.active,
html[data-theme="dark"] .day.in-range {
    background: var(--dm-primary-bg);
    color: var(--dm-primary-text);
}

html[data-theme="dark"] .apply-btn {
    background: var(--dm-primary);
    border-color: var(--dm-primary);
    color: #fff;
}

/* ---- hierarchy tree (Home) ---- */
html[data-theme="dark"] .hierarchy-sidebar {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    box-shadow: none;
}

html[data-theme="dark"] .hierarchy-search-input {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

    html[data-theme="dark"] .hierarchy-search-input:focus {
        background: var(--dm-surface-2);
        border-color: var(--teal-pri);
        box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.2);
    }

html[data-theme="dark"] .tree-seg {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
}

    html[data-theme="dark"] .tree-seg button {
        color: var(--dm-text);
    }

        html[data-theme="dark"] .tree-seg button:hover {
            background: var(--dm-surface);
        }

        html[data-theme="dark"] .tree-seg button.active {
            background: var(--dm-primary);
            color: #fff;
            box-shadow: none;
        }

html[data-theme="dark"] .tree-node-item {
    color: var(--dm-text);
}

    html[data-theme="dark"] .tree-node-item:hover {
        background: var(--dm-surface-2);
    }

    html[data-theme="dark"] .tree-node-item.selected {
        background: var(--dm-surface-3);
    }

html[data-theme="dark"] .node-name.tree-match { color: var(--teal-pri); }
html[data-theme="dark"] .tree-meta.error { color: var(--dm-danger-text); }

/* ---- page top bar (node name + Meters / Communicating …) and the tab strip ---- */
html[data-theme="dark"] .portal-topbar,
html[data-theme="dark"] .uuc-portal-tabs,
html[data-theme="dark"] .overview-control-strip,
html[data-theme="dark"] .tab-placeholder-card,
html[data-theme="dark"] .tabmenu {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .node-heading-title,
html[data-theme="dark"] .node-title-inner,
html[data-theme="dark"] .metric-stat-val,
html[data-theme="dark"] .uuc-portal-tabs .uuc-tabs-tab.uuc-tabs-tab-active {
    color: var(--dm-text);
}

html[data-theme="dark"] .metric-stat-label {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .head-office-tag {
    color: #fb923c;
}

html[data-theme="dark"] .watch-btn {
    background: var(--dm-warning-bg);
    border-color: rgba(210, 153, 34, 0.4);
    color: var(--dm-warning-text);
}

html[data-theme="dark"] .star-icon-btn {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .tabmenu button {
    color: var(--dm-text);
}

    html[data-theme="dark"] .tabmenu button:hover,
    html[data-theme="dark"] .tabtog:hover,
    html[data-theme="dark"] .tabtog.pressed {
        background: var(--dm-surface-2);
    }

html[data-theme="dark"] .tabtog {
    color: var(--dm-text-sec);
}

/* ---- Overview tab (agent ring, findings, activity) ---- */
html[data-theme="dark"] .date-badge-pill,
html[data-theme="dark"] .decisions-badge-pill,
html[data-theme="dark"] .btn-compact,
html[data-theme="dark"] .btn-expand-icon,
html[data-theme="dark"] .ovav,
html[data-theme="dark"] .ovval,
html[data-theme="dark"] .ovcard,
html[data-theme="dark"] .network-graph-canvas {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .btn-compact:hover,
html[data-theme="dark"] .btn-expand-icon:hover {
    background: var(--dm-surface-3);
}

html[data-theme="dark"] .ovnm,
html[data-theme="dark"] .ovft,
html[data-theme="dark"] .findings-big-num,
html[data-theme="dark"] .activity-log-list span {
    color: var(--dm-text);
}

html[data-theme="dark"] .ovag.s-bad .ovval { color: var(--dm-danger-text); }

html[data-theme="dark"] .badge-today {
    color: var(--dm-primary-text);
}

/* the robot avatars draw a white disc; keep it a little lighter than the card */
html[data-theme="dark"] .ccbot > circle:first-of-type {
    fill: #2d333b;
}

/* ---- "Ask" button ---- */
html[data-theme="dark"] .floating-ask-fab {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    box-shadow: var(--dm-shadow-lg);
}

html[data-theme="dark"] .fab-text {
    color: var(--dm-text);
}

/* ---- Blazor reconnect dialog ---- */
html[data-theme="dark"] #components-reconnect-modal {
    background: var(--dm-surface);
    color: var(--dm-text);
    border-color: var(--dm-border);
}


/* ==============================================================================
   5. PAGES
   ============================================================================== */

/* ---- shared: "Regions under …" table card (HierarchyChildScopeTableCard) ---- */
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .scope-loading-state,
html[data-theme="dark"] .master-loading-state,
html[data-theme="dark"] .sla-loading-state {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text-sec);
}

/* ---- ADDC Master info ---- */
html[data-theme="dark"] .mx {
    --mx-primary: var(--dm-primary);
    --mx-line: var(--dm-border);
    --mx-line2: var(--dm-border-soft);
    --mx-bg: var(--dm-surface);
    --mx-fg: var(--dm-text);
    --mx-muted: var(--dm-text-sec);
}

html[data-theme="dark"] .mx-tile,
html[data-theme="dark"] .mx-card,
html[data-theme="dark"] .mx-load {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .mx-tl.warn i { background: var(--dm-warning-text); }
html[data-theme="dark"] .mx-tl.bad i { background: var(--dm-danger-text); }
html[data-theme="dark"] .mx-tl.ok i { background: var(--dm-success-text); }

html[data-theme="dark"] .table-title { color: var(--dm-text); }

html[data-theme="dark"] .table-search-input,
html[data-theme="dark"] .btn-action-export {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .btn-action-export:hover { background: var(--dm-surface-3); }
html[data-theme="dark"] .chk-attention { color: var(--dm-text-sec); }
html[data-theme="dark"] .btn-node-link,
html[data-theme="dark"] .btn-node-link:hover { color: var(--dm-link); }

/* ---- Demand (DemandTab, DemandTabPro) ---- */
html[data-theme="dark"] .dm-scope-path,
html[data-theme="dark"] .op-scope-path,
html[data-theme="dark"] .op-h4,
html[data-theme="dark"] .op-grid2 h4 {
    color: var(--dm-text);
}

html[data-theme="dark"] .dm-insight {
    background: var(--dm-surface-2);
    color: var(--dm-text);
}

    html[data-theme="dark"] .dm-insight.dm-click:hover {
        background: var(--dm-surface-3);
    }

html[data-theme="dark"] .dm-insight-kind {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .dm-heat-cell[style*="#eef2f6"] {
    background: var(--dm-surface-2) !important; /* hours with no reads */
}

html[data-theme="dark"] .dm-heat-day { color: var(--dm-text-sec); }
html[data-theme="dark"] .dm-heat-hour { color: var(--dm-text-mut); }

/* DemandTabPro: its own colour variables (dark indigo text, lavender lines) switched for dark ones */
html[data-theme="dark"] .dm-pro {
    --pro-ink: var(--dm-text);              /* KPI values, card titles */
    --pro-line: var(--dm-border);           /* card / tile / insight borders */
    --pro-indigo: #818cf8;
}

html[data-theme="dark"] .dm-pro .dm-scope-path {
    color: var(--dm-text);
}

html[data-theme="dark"] .dm-pro .dm-scope-range {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .dm-pro .dm-kpis-5 .uuc-kpi-title,
html[data-theme="dark"] .dm-pro .dm-kpis-5 .uuc-kpi-header {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .dm-pro .dm-kpis-5 .uuc-kpi-card:hover {
    box-shadow: var(--dm-shadow);
}

html[data-theme="dark"] .dm-pro .dm-heat-hour,
html[data-theme="dark"] .dm-pro .dm-heat-day {
    color: #a5b4fc;
}

/* DemandTabPro's own surfaces */
html[data-theme="dark"] .dm-pro .dm-scopebar,
html[data-theme="dark"] .dm-pro .uuc-card-header {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}

html[data-theme="dark"] .dm-pro .dm-insight {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}

    html[data-theme="dark"] .dm-pro .dm-insight.dm-click:hover {
        background: var(--dm-surface-2);
    }

html[data-theme="dark"] .dm-pro .dm-insight-kind {
    background: var(--dm-purple-bg);
    color: var(--dm-purple-text);
}

html[data-theme="dark"] .dm-pro .dm-kpis-5 .uuc-kpi-card {
    background: var(--dm-surface);
}

html[data-theme="dark"] .dm-pro .uuc-table thead th {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .dm-pro .uuc-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .dm-pro .uuc-table tbody tr:hover td,
html[data-theme="dark"] .dm-pro .dm-row-click:hover td {
    background: var(--dm-surface-2);
}

/* ---- Operations (OperationsTab) ---- */
html[data-theme="dark"] .op-root .op-row-selected > td {
    background: var(--dm-primary-bg) !important;
}

html[data-theme="dark"] .op-filter select {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .op-root .op-kpi-bad .uuc-kpi-value-wrap,
html[data-theme="dark"] .op-alert {
    color: var(--dm-danger-text);
}

/* ---- older Operations pages (AddcOperationsPage, Gas OperationsPage) ---- */
html[data-theme="dark"] .uuc-ops-container,
html[data-theme="dark"] .ops-main-title,
html[data-theme="dark"] .kpi-top-row,
html[data-theme="dark"] .kpi-value-row,
html[data-theme="dark"] .series-name,
html[data-theme="dark"] .series-val b,
html[data-theme="dark"] .ops-breakout-card .card-title,
html[data-theme="dark"] .addc-commodity-stats b,
html[data-theme="dark"] .breakdown-row .label-col,
html[data-theme="dark"] .label-col,
html[data-theme="dark"] .val-col,
html[data-theme="dark"] .title-bold,
html[data-theme="dark"] .banner-item .item-text,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .rule-code-name .code,
html[data-theme="dark"] .rule-code-name .name,
html[data-theme="dark"] .workspace-title,
html[data-theme="dark"] .mini-kpi-card .val-line,
html[data-theme="dark"] .standout-item,
html[data-theme="dark"] .addc-section-h,
html[data-theme="dark"] .addc-bigv {
    color: var(--dm-text);
}

html[data-theme="dark"] .title-sub,
html[data-theme="dark"] .badge-legend,
html[data-theme="dark"] .meta-row,
html[data-theme="dark"] .workspace-eyebrow,
html[data-theme="dark"] .mini-kpi-card .label-line,
html[data-theme="dark"] .ops-breakout-card .card-action {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .ops-kpi-card,
html[data-theme="dark"] .ops-breakout-card,
html[data-theme="dark"] .ops-attention-banner,
html[data-theme="dark"] .ops-section-table-card,
html[data-theme="dark"] .ops-definition-box,
html[data-theme="dark"] .addc-info-note,
html[data-theme="dark"] .mini-kpi-card,
html[data-theme="dark"] .ops-stands-out-card,
html[data-theme="dark"] .ops-filters-card,
html[data-theme="dark"] .addc-samplebar,
html[data-theme="dark"] .svg-trend-wrap,
html[data-theme="dark"] .svg-histogram-wrap,
html[data-theme="dark"] .trend-series-row {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
    box-shadow: none;
}

html[data-theme="dark"] .ops-kpi-card:hover { border-color: #3d444d; }

html[data-theme="dark"] .banner-item,
html[data-theme="dark"] .bar-track,
html[data-theme="dark"] .addc-stacked-bar,
html[data-theme="dark"] .category-pill,
html[data-theme="dark"] .ops-data-table thead th,
html[data-theme="dark"] .ops-data-table th,
html[data-theme="dark"] .ops-search-box input,
html[data-theme="dark"] .ops-workspace-search input {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .ops-data-table tbody td,
html[data-theme="dark"] .ops-data-table td {
    border-color: var(--dm-border-soft);
    color: var(--dm-text);
}

html[data-theme="dark"] .banner-item:hover,
html[data-theme="dark"] .breakdown-row:hover,
html[data-theme="dark"] .category-pill:hover,
html[data-theme="dark"] .clickable-row:hover,
html[data-theme="dark"] .clickable-row:hover td {
    background: var(--dm-surface-3);
}

html[data-theme="dark"] .tag-mdm,
html[data-theme="dark"] .tag-period { background: var(--dm-surface-3); border-color: var(--dm-border); color: var(--dm-text-2); }
html[data-theme="dark"] .tag-elec,
html[data-theme="dark"] .addc-commodity-tag.is-elec { background: var(--dm-warning-bg); border-color: transparent; color: var(--dm-warning-text); }
html[data-theme="dark"] .tag-water,
html[data-theme="dark"] .addc-commodity-tag.is-water { background: var(--dm-info-bg); border-color: transparent; color: var(--dm-info-text); }
html[data-theme="dark"] .addc-commodity-tag.is-both { background: var(--dm-primary-bg); color: var(--dm-primary-text); }
html[data-theme="dark"] .tag-pink { background: var(--dm-purple-bg); border-color: transparent; color: var(--dm-purple-text); }
html[data-theme="dark"] .addc-link { color: var(--dm-link); }
html[data-theme="dark"] .addc-pill-info { background: var(--dm-primary-bg); border-color: transparent; color: var(--dm-primary-text); }

/* ---- SLA ---- */
html[data-theme="dark"] .asla-source-card,
html[data-theme="dark"] .must-have-card,
html[data-theme="dark"] .asla-table-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .pipeline-card,
html[data-theme="dark"] .custom-acceptance-pipeline,
html[data-theme="dark"] .cluster-portfolio-card,
html[data-theme="dark"] .regional-summary-card,
html[data-theme="dark"] .sla-banner-period,
html[data-theme="dark"] .sla-banner-gate,
html[data-theme="dark"] .asla-footnote-box,
html[data-theme="dark"] .evidence-panel {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
    box-shadow: none;
}

html[data-theme="dark"] .asrc-pill,
html[data-theme="dark"] .stat-btn,
html[data-theme="dark"] .auc-card-btn,
html[data-theme="dark"] .btn-must-toggle,
html[data-theme="dark"] .btn-clear-filters,
html[data-theme="dark"] .kpi-search-input,
html[data-theme="dark"] .btn-export-kpi,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .btn-open-sm,
html[data-theme="dark"] .active-pipeline-badge,
html[data-theme="dark"] .asla-table th,
html[data-theme="dark"] .asla-group-row td,
html[data-theme="dark"] .asla-evidence-row td,
html[data-theme="dark"] .progress-bar-track,
html[data-theme="dark"] .auc-progress-track {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .asrc-pill:hover,
html[data-theme="dark"] .stat-btn:hover,
html[data-theme="dark"] .auc-card-btn:hover,
html[data-theme="dark"] .btn-must-toggle:hover,
html[data-theme="dark"] .btn-clear-filters:hover,
html[data-theme="dark"] .btn-export-kpi:hover,
html[data-theme="dark"] .filter-chip:hover,
html[data-theme="dark"] .asla-kpi-row:hover,
html[data-theme="dark"] .regional-row:hover {
    background: var(--dm-surface-3);
}

html[data-theme="dark"] .asrc-pill.selected,
html[data-theme="dark"] .stat-btn.selected,
html[data-theme="dark"] .auc-card-btn.selected,
html[data-theme="dark"] .asla-kpi-row.expanded {
    background: var(--dm-primary-bg);
    border-color: var(--dm-primary);
}

html[data-theme="dark"] .asla-kpi-row,
html[data-theme="dark"] .asla-table td {
    border-color: var(--dm-border-soft);
}

html[data-theme="dark"] .source-name,
html[data-theme="dark"] .source-count,
html[data-theme="dark"] .num-bold,
html[data-theme="dark"] .stat-count,
html[data-theme="dark"] .group-title,
html[data-theme="dark"] .kpi-title-text,
html[data-theme="dark"] .kpi-target-val,
html[data-theme="dark"] .evidence-lead,
html[data-theme="dark"] .auc-title,
html[data-theme="dark"] .auc-met-num,
html[data-theme="dark"] .auc-worst-name,
html[data-theme="dark"] .acceptance-title,
html[data-theme="dark"] .kpi-num,
html[data-theme="dark"] .pipeline-heading,
html[data-theme="dark"] .banner-highlight,
html[data-theme="dark"] .btn-th-sort.active .th-label,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .node-name {
    color: var(--dm-text);
}

html[data-theme="dark"] .btn-region-link,
html[data-theme="dark"] .btn-cluster-link,
html[data-theme="dark"] .btn-action-link,
html[data-theme="dark"] .btn-clear-badge,
html[data-theme="dark"] .btn-reset-filters:hover {
    color: var(--dm-link);
}

/* SLA non-compliance drawer */
html[data-theme="dark"] .drawer-container,
html[data-theme="dark"] .drawer-header,
html[data-theme="dark"] .drawer-footer,
html[data-theme="dark"] .drawer-summary-card,
html[data-theme="dark"] .drawer-table-wrap {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .uuc-drawer-table thead th {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .uuc-drawer-table tbody td { border-color: var(--dm-border-soft); }
html[data-theme="dark"] .uuc-drawer-table tbody tr:hover,
html[data-theme="dark"] .btn-close-drawer:hover { background: var(--dm-surface-2); }

html[data-theme="dark"] .drawer-title,
html[data-theme="dark"] .summary-val,
html[data-theme="dark"] .msn-num,
html[data-theme="dark"] .cluster-cell {
    color: var(--dm-text);
}

html[data-theme="dark"] .drawer-alert { background: var(--dm-danger-bg); border-color: rgba(248, 81, 73, 0.35); color: var(--dm-danger-text); }
html[data-theme="dark"] .diag-action-recommendation { background: var(--dm-primary-bg); color: var(--dm-primary-text); }
html[data-theme="dark"] .btn-action-sm { background: var(--dm-surface-2); border-color: var(--dm-border); color: var(--dm-text); }
html[data-theme="dark"] .btn-ping:hover,
html[data-theme="dark"] .btn-wo:hover { background: var(--dm-surface-3); color: var(--dm-text); }

/* ---- Alarms & events ---- */
html[data-theme="dark"] .ae {
    --ae-primary: var(--dm-primary);
    --ae-line: var(--dm-border);
    --ae-line2: var(--dm-border-soft);
    --ae-bg: var(--dm-surface);
    --ae-bg2: var(--dm-surface-2);
    --ae-fg: var(--dm-text);
    --ae-muted: var(--dm-text-sec);
    --ae-spark: #93b5e6;
    --ae-bad: var(--dm-danger-text);
    --ae-warn: var(--dm-warning-text);
    --ae-ok: var(--dm-success-text);
}

html[data-theme="dark"] .ae-tile.uuc-kpi-card,
html[data-theme="dark"] .ae-panel.uuc-card,
html[data-theme="dark"] .ae-rail-item.uuc-card,
html[data-theme="dark"] .ae-group,
html[data-theme="dark"] .ae-sample-bar {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .ae-chip,
html[data-theme="dark"] .ae-pg,
html[data-theme="dark"] .ae-sample-badge {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .ae-group:hover { background: var(--dm-surface-2); }
html[data-theme="dark"] .ae-group.is-active { background: var(--dm-primary-bg); border-color: var(--dm-primary); color: var(--dm-text); }

html[data-theme="dark"] .ae-heading,
html[data-theme="dark"] .ae-tile .uuc-kpi-title,
html[data-theme="dark"] .ae-tile .uuc-kpi-value,
html[data-theme="dark"] .ae-tile .uuc-kv-label,
html[data-theme="dark"] .ae-tile .uuc-kv-val,
html[data-theme="dark"] .ae-panel .uuc-card-title,
html[data-theme="dark"] .ae-finding,
html[data-theme="dark"] .ae-device,
html[data-theme="dark"] .ae-mini .uuc-kpi-title-text,
html[data-theme="dark"] .ae-mini .uuc-kpi-value,
html[data-theme="dark"] .ae-rail-text {
    color: var(--dm-text);
}

html[data-theme="dark"] .ae-link { color: var(--dm-link); }

/* ---- Commands ---- */
html[data-theme="dark"] .cmd-container,
html[data-theme="dark"] .acm {
    --cmd-brand: var(--dm-primary);
    --cmd-link: var(--dm-link);
    --cmd-line: var(--dm-border);
    --cmd-muted: var(--dm-text-sec);
    --cmd-ink: var(--dm-text);
    --acm-ok: var(--dm-success-text);
    --acm-warn: var(--dm-warning-text);
    --acm-bad: var(--dm-danger-text);
    --acm-link: var(--dm-link);
    --acm-brand: var(--dm-primary);
    --acm-line: var(--dm-border);
    --acm-muted: var(--dm-text-sec);
    --acm-ink: var(--dm-text);
}

html[data-theme="dark"] .cmd-loading,
html[data-theme="dark"] .cmd-card.uuc-card,
html[data-theme="dark"] .cmd-chip,
html[data-theme="dark"] .acm-loading,
html[data-theme="dark"] .acm-card.uuc-card,
html[data-theme="dark"] .acm-chip,
html[data-theme="dark"] .acm-opt,
html[data-theme="dark"] .acm-mini {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
    box-shadow: none;
}

html[data-theme="dark"] .cmd-flow span,
html[data-theme="dark"] .acm-chip-x,
html[data-theme="dark"] .acm-hbar {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text-2);
}

html[data-theme="dark"] .cmd-statgrid .uuc-pipeline-pill,
html[data-theme="dark"] .acm-stats .uuc-pipeline-pill {
    color: var(--dm-text-2) !important;
}

html[data-theme="dark"] .cmd-statgrid .uuc-pipeline-step.uuc-pipeb.active,
html[data-theme="dark"] .acm-stats .uuc-pipeline-step.uuc-pipeb.active,
html[data-theme="dark"] .acm-chip[aria-pressed="true"],
html[data-theme="dark"] .acm-opt[aria-pressed="true"],
html[data-theme="dark"] .acm-dbody .acm-chip[aria-pressed="true"] {
    background: var(--dm-primary-bg);
    border-color: var(--dm-primary);
    color: var(--dm-primary-text);
}

html[data-theme="dark"] .cmd-tl li::before {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
}

html[data-theme="dark"] .cmd-tl li.tl-cur::before {
    background: var(--dm-primary-bg);
    border-color: var(--dm-primary);
}

html[data-theme="dark"] .acm-chip[aria-pressed="true"],
html[data-theme="dark"] .acm-opt[aria-pressed="true"],
html[data-theme="dark"] .acm-dbody .acm-chip[aria-pressed="true"] {
    background: var(--dm-primary-bg);
    border-color: var(--dm-primary);
    color: var(--dm-primary-text);
}

html[data-theme="dark"] .acm-chip-x { background: var(--dm-surface-3); }

/* ---- Revenue ---- */
html[data-theme="dark"] .rv-banner,
html[data-theme="dark"] .rv-sample-bar,
html[data-theme="dark"] .rv-card {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .rv-row { border-color: var(--dm-border-soft); }
html[data-theme="dark"] .rv-row-click:hover { background: var(--dm-surface-2); }
html[data-theme="dark"] .rv-chip,
html[data-theme="dark"] .rv-sample-tag { background: var(--dm-surface-2); color: var(--dm-text-2); }

html[data-theme="dark"] .rv-banner-text,
html[data-theme="dark"] .rv-card-title,
html[data-theme="dark"] .rv-caret { color: var(--dm-text); }
html[data-theme="dark"] .rv-note { color: var(--dm-text-sec); }

/* ---- Loss & balance ---- */
html[data-theme="dark"] .lb-card,
html[data-theme="dark"] .lb-note,
html[data-theme="dark"] .uuc-btn.lb-samplebar {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .uuc-btn.lb-samplebar:hover { background: var(--dm-surface-2); }

html[data-theme="dark"] .lb-pager-btn {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

    html[data-theme="dark"] .lb-pager-btn:hover:not(:disabled) { background: var(--dm-surface-3); }
    html[data-theme="dark"] .lb-pager-btn:disabled { background: var(--dm-surface); color: #484f58; }

html[data-theme="dark"] .lb-samplebar-title,
html[data-theme="dark"] .lb-legend b,
html[data-theme="dark"] .lb-pager-info { color: var(--dm-text); }
html[data-theme="dark"] .lb-samplebar-hint,
html[data-theme="dark"] .lb-legend,
html[data-theme="dark"] .lb-util--energy .lb-util-label,
html[data-theme="dark"] .lb-util--water .lb-util-label { color: var(--dm-text-sec); }
html[data-theme="dark"] .lb-link { color: var(--dm-link); }
html[data-theme="dark"] .lb-pill-info { background: var(--dm-primary-bg); color: var(--dm-primary-text); }
html[data-theme="dark"] .lb-pill-watch { background: var(--dm-warning-bg); color: var(--dm-warning-text); }
html[data-theme="dark"] .lb-pill-critical { background: var(--dm-danger-bg); color: var(--dm-danger-text); }

/* ---- Devices & assets ---- */
html[data-theme="dark"] .da-card,
html[data-theme="dark"] .da-table-card {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .da-card-label,
html[data-theme="dark"] .da-card-sub,
html[data-theme="dark"] .da-note,
html[data-theme="dark"] .da-table-card .uuc-table-subtitle { color: var(--dm-text-sec); }
html[data-theme="dark"] .da-link { color: var(--dm-link); }
html[data-theme="dark"] .da-card-value.da-warn,
html[data-theme="dark"] .da-cell-warn { color: var(--dm-warning-text); }
html[data-theme="dark"] .da-card-value.da-bad,
html[data-theme="dark"] .da-cell-bad { color: var(--dm-danger-text); }

/* ---- Summary ---- */
html[data-theme="dark"] .sum-card,
html[data-theme="dark"] .sum-panel {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .sum-kpi .uuc-kpi-value { color: var(--dm-text); }
html[data-theme="dark"] .sum-link { color: var(--dm-link); }
html[data-theme="dark"] .sum-badge.healthy { background: var(--dm-success-bg); color: var(--dm-success-text); }
html[data-theme="dark"] .sum-badge.watch { background: var(--dm-warning-bg); color: var(--dm-warning-text); }
html[data-theme="dark"] .sum-badge.critical { background: var(--dm-danger-bg); color: var(--dm-danger-text); }

/* ---- GIS / SLD and the map page (GeoMap has its own [data-theme="dark"] map rules) ---- */
html[data-theme="dark"] .gis-card,
html[data-theme="dark"] .gis-map,
html[data-theme="dark"] .gm-cluster-card,
html[data-theme="dark"] .gm-layers-panel,
html[data-theme="dark"] .gm-basemap-panel,
html[data-theme="dark"] .gm-display-control,
html[data-theme="dark"] .gm-cluster-number-control,
html[data-theme="dark"] .gm-insights-panel,
html[data-theme="dark"] .gm-tx-panel,
html[data-theme="dark"] .gm-tx-card,
html[data-theme="dark"] .gm-sa-panel,
html[data-theme="dark"] .gm-sa-footer {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .gm-layers-header,
html[data-theme="dark"] .gm-layers-group,
html[data-theme="dark"] .gm-ins-header,
html[data-theme="dark"] .gm-tx-header,
html[data-theme="dark"] .gm-sa-header {
    border-color: var(--dm-border);
}

html[data-theme="dark"] .gm-sel-table th,
html[data-theme="dark"] .gm-count-badge,
html[data-theme="dark"] .gm-tx-btn,
html[data-theme="dark"] .gm-sa-stat,
html[data-theme="dark"] .gm-tx-status,
html[data-theme="dark"] .gm-segment-option {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html[data-theme="dark"] .gm-layer-item:hover,
html[data-theme="dark"] .gm-layer-overlay:hover,
html[data-theme="dark"] .gm-basemap-option:hover,
html[data-theme="dark"] .gm-tx-btn:hover:not(:disabled),
html[data-theme="dark"] .gm-layers-close:hover,
html[data-theme="dark"] .gm-basemap-close:hover,
html[data-theme="dark"] .gm-ins-close:hover,
html[data-theme="dark"] .gm-tx-close:hover,
html[data-theme="dark"] .gm-sa-close:hover {
    background: var(--dm-surface-2);
}

html[data-theme="dark"] .gm-tools button.active,
html[data-theme="dark"] .gm-layer-item.active,
html[data-theme="dark"] .gm-basemap-option.active {
    background: var(--dm-primary-bg);
    color: var(--dm-primary-text);
}

html[data-theme="dark"] .gm-layers-section-title,
html[data-theme="dark"] .gm-layer-item,
html[data-theme="dark"] .gm-layer-name,
html[data-theme="dark"] .gm-layer-overlay,
html[data-theme="dark"] .gm-basemap-title,
html[data-theme="dark"] .gm-basemap-option,
html[data-theme="dark"] .gm-boundary-name,
html[data-theme="dark"] .gm-tx-card-title {
    color: var(--dm-text);
}

html[data-theme="dark"] .gm-tx-status.error { background: var(--dm-danger-bg); color: var(--dm-danger-text); }

/* ---- Login: the form side (the illustration keeps its own colours) ---- */
html[data-theme="dark"] .login,
html[data-theme="dark"] .login__panel {
    background: var(--dm-bg);
    color: var(--dm-text);
}

html[data-theme="dark"] .login__panel {
    background: radial-gradient(ellipse at 0% 0%, rgba(56, 139, 253, .12), transparent 48%), var(--dm-bg);
}

/* the sign-in card: frosted dark glass instead of frosted white */
html[data-theme="dark"] .login__card {
    background: rgba(22, 27, 34, 0.85);
    border-color: var(--dm-border);
    box-shadow: var(--dm-shadow-lg);
}

html[data-theme="dark"] .login__subtitle {
    color: var(--dm-text-sec);
}

html[data-theme="dark"] .login__field .login__input {
    background: var(--dm-surface-2);
    border-color: var(--dm-border);
    color: var(--dm-text);
}

    html[data-theme="dark"] .login__field .login__input:focus {
        background: var(--dm-surface-2);
        border-color: var(--dm-primary);
    }

html[data-theme="dark"] .login__title,
html[data-theme="dark"] .login__label,
html[data-theme="dark"] .login__remember { color: var(--dm-text); }
html[data-theme="dark"] .login__toggle,
html[data-theme="dark"] .login__footer { color: var(--dm-text-sec); }
html[data-theme="dark"] .login__toggle:hover { background: var(--dm-surface-3); }
html[data-theme="dark"] .login__link,
html[data-theme="dark"] .login__link:hover { color: var(--dm-link); }
html[data-theme="dark"] .login__alert { background: var(--dm-danger-bg); border-color: rgba(248, 81, 73, 0.35); color: var(--dm-danger-text); }
html[data-theme="dark"] .login__group .login__field-error { color: var(--dm-danger-text); }


/* ==============================================================================
   6. SHARED SEMANTIC PILLS AND TEXT (used by SLA, Operations, Alarms, Commands …)
   ============================================================================== */
html[data-theme="dark"] .pill-green,
html[data-theme="dark"] .pill-ok,
html[data-theme="dark"] .pill-met,
html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .health-healthy,
html[data-theme="dark"] .asrc-live,
html[data-theme="dark"] .utility-badge.gas {
    background: var(--dm-success-bg) !important;
    border-color: transparent !important;
    color: var(--dm-success-text) !important;
}

html[data-theme="dark"] .pill-amber,
html[data-theme="dark"] .pill-warn,
html[data-theme="dark"] .pill-risk,
html[data-theme="dark"] .health-watch,
html[data-theme="dark"] .asrc-proxy,
html[data-theme="dark"] .actual-util-badge,
html[data-theme="dark"] .utility-badge.electricity,
html[data-theme="dark"] .code-timeout,
html[data-theme="dark"] .code-gap {
    background: var(--dm-warning-bg) !important;
    border-color: transparent !important;
    color: var(--dm-warning-text) !important;
}

html[data-theme="dark"] .pill-red,
html[data-theme="dark"] .pill-miss,
html[data-theme="dark"] .badge-fail,
html[data-theme="dark"] .health-critical,
html[data-theme="dark"] .code-tamper,
html[data-theme="dark"] .code-rssi {
    background: var(--dm-danger-bg) !important;
    border-color: transparent !important;
    color: var(--dm-danger-text) !important;
}

html[data-theme="dark"] .pill-blue,
html[data-theme="dark"] .asrc-sample,
html[data-theme="dark"] .utility-badge.water,
html[data-theme="dark"] .drawer-badge {
    background: var(--dm-primary-bg) !important;
    border-color: transparent !important;
    color: var(--dm-primary-text) !important;
}

html[data-theme="dark"] .val-ok,
html[data-theme="dark"] .rate-normal { color: var(--dm-success-text); }
html[data-theme="dark"] .val-warn,
html[data-theme="dark"] .rate-warning,
html[data-theme="dark"] .lb-trend { color: var(--dm-warning-text); }
html[data-theme="dark"] .val-bad,
html[data-theme="dark"] .rssi-bad { color: var(--dm-danger-text); }

/* Bootstrap helpers some pages use for light boxes */
html[data-theme="dark"] .bg-light {
    background-color: var(--dm-surface-2) !important;
}

html[data-theme="dark"] .bg-white {
    background-color: var(--dm-surface) !important;
}

/* Explore overview: keep the full-screen action at the far edge, matching HES. */
.overview-workspace .ov-strip .ov-expand-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

html[data-theme="dark"] .text-dark {
    color: var(--dm-text) !important;
}

html[data-theme="dark"] .border {
    border-color: var(--dm-border) !important;
}

/* ---- side menu: white labels and icons (the global dark link rule above would make them blue) ---- */
html[data-theme="dark"] a.rail-item,
html[data-theme="dark"] a.rail-item .bi,
html[data-theme="dark"] a.rail-item .rail-label,
html[data-theme="dark"] a.rail-item:hover,
html[data-theme="dark"] a.rail-item.active {
    color: #fff !important;
}

html[data-theme="dark"] a.rail-item.active {
    background: rgba(255, 255, 255, 0.12);
}

/* ==============================================================================
   7. VEE (Rule Library + Validation Rule drawer)
      One block: vee.css reads every colour from --vee-*, so no page needs changing.
   ============================================================================== */
html[data-theme="dark"] {
    --vee-primary: var(--dm-primary);
    --vee-primary-hover: var(--dm-primary-hover);
    --vee-primary-soft: var(--dm-primary-bg);
    --vee-primary-fg: #ffffff;
    --vee-text: var(--dm-text);
    --vee-muted: var(--dm-text-sec);
    --vee-label: var(--dm-text-2);
    --vee-border: var(--dm-border);
    --vee-input-border: var(--dm-border);
    --vee-surface: var(--dm-surface-2); /* inputs, cards, tables */
    --vee-surface-alt: var(--dm-surface-3); /* table headers, chips */
    --vee-disabled-bg: var(--dm-bg); /* disabled boxes look recessed */
    --vee-note-bg: var(--dm-surface);
    --vee-header-bg: var(--dm-surface-3); /* drawer title bar */
    --vee-ok-bg: var(--dm-success-bg);
    --vee-ok-fg: var(--dm-success-text);
    --vee-warn-bg: var(--dm-warning-bg);
    --vee-warn-fg: var(--dm-warning-text);
    --vee-warn-border: rgba(210, 153, 34, 0.35);
    --vee-bad-bg: var(--dm-danger-bg);
    --vee-bad-fg: var(--dm-danger-text);
    --vee-close-hover: #da3633;
    --vee-neutral-bg: var(--dm-surface-3);
    --vee-neutral-fg: var(--dm-text-2);
    --vee-medium-bg: var(--dm-primary-bg);
    --vee-medium-fg: var(--dm-primary-text);
    --vee-ring: 0 0 0 1px var(--dm-primary), 0 0 0 3px rgba(68, 147, 248, 0.3);
}

    /* drawer title text */
    html[data-theme="dark"] [class*="drawer"] [class*="header"] {
        color: var(--dm-text);
    }

    /* Autocomplete box (vee.css hard-codes #d1d5db for the idle border) */
    html[data-theme="dark"] .vee-ac > * {
        background: var(--dm-surface-2) !important;
        color: var(--dm-text);
    }

        html[data-theme="dark"] .vee-ac > *:not(:focus-within) {
            border-color: var(--dm-border) !important;
        }

    html[data-theme="dark"] .vee-ac input {
        background: transparent !important;
        color: inherit;
    }

    /* Dropdown popup (vee.css hard-codes white / black / grey with !important) */
    html[data-theme="dark"] [role="listbox"],
    html[data-theme="dark"] .uuc-dropdown-popup,
    html[data-theme="dark"] [class*="dropdown-popup"],
    html[data-theme="dark"] [class*="autocomplete-dropdown"],
    html[data-theme="dark"] .ant-select-dropdown {
        background: var(--dm-surface-2) !important;
        border: 1px solid #4a525c !important;
        box-shadow: var(--dm-shadow-lg) !important;
    }

        html[data-theme="dark"] [role="listbox"] [role="option"],
        html[data-theme="dark"] [class*="dropdown-option"],
        html[data-theme="dark"] [class*="autocomplete-option"] {
            color: var(--dm-text) !important;
            background: var(--dm-surface-2) !important;
        }

            html[data-theme="dark"] [role="listbox"] [role="option"]:hover,
            html[data-theme="dark"] [role="listbox"] [role="option"][aria-selected="true"],
            html[data-theme="dark"] [class*="dropdown-option"]:hover,
            html[data-theme="dark"] [class*="dropdown-option"][class*="selected"],
            html[data-theme="dark"] [class*="dropdown-option"][class*="active"],
            html[data-theme="dark"] [class*="autocomplete-option"]:hover,
            html[data-theme="dark"] [class*="autocomplete-option"][class*="selected"],
            html[data-theme="dark"] [class*="autocomplete-option"][class*="active"] {
                color: var(--dm-primary-text) !important;
                background: var(--dm-primary-bg) !important;
            }

/* ==============================================================================
   BlazorKit Autocomplete / Select: the clear (x) and arrow icons are black at 25-45%
   (autocomplete.css), which disappears on a dark field. Light them up.
   ============================================================================== */
html[data-theme="dark"] .uuc-autocomplete-clear,
html[data-theme="dark"] .uuc-select-clear {
    color: rgba(255, 255, 255, .55);
}

html[data-theme="dark"] .uuc-autocomplete-arrow,
html[data-theme="dark"] .uuc-select-arrow {
    color: rgba(255, 255, 255, .75);
}

    html[data-theme="dark"] .uuc-autocomplete-clear:hover,
    html[data-theme="dark"] .uuc-select-clear:hover,
    html[data-theme="dark"] .uuc-autocomplete-arrow:hover,
    html[data-theme="dark"] .uuc-select-arrow:hover {
        color: #ffffff;
    }
