﻿/*
 ==============================================================================
 Project Name    : Esyasoft.AMI.Unified.Web
 File Name       : demand.css
 File Purpose    : Demand tab look, taken from the sample page (unified-utility-command 13.html, v32 "ADDC demand" and
                   v45 "Demand on All"): the app's own fonts, the page's colour tokens (light + dark), cards, number tiles,
                   segmented toggles, legends, bars, the hour x day heatmap. Everything is scoped under .dmt, and the
                   BlazorKit components inside (Card, KpiCard, Table, LineChart, ColumnChart, ButtonGroup, Button)
                   are restyled through their own tokens and classes so they read like the sample page.
 ==============================================================================
*/

/* ---------------------------------------------------------------- tokens (sample page :root, v12 light palette) */
.dmt {
    --bg: #eef1f5;
    --surface: #ffffff;
    --surface2: #f6f8fb;
    --line: #dce2e9;
    --line2: #e9edf2;
    --fg: #0f172a;
    --fg2: #334155;
    --muted: #5b6678;
    --primary: #1e3a8a;
    --primary-fg: #ffffff;
    --sel: #e1e9f8;
    --hover: #f2f5fa;
    --ok: #0F766E;
    --ok-bg: #E1F1EE;
    --warn: #975006;
    --warn-bg: #FCEFD9;
    --bad: #B42318;
    --bad-bg: #FBE7E5;
    --info: #1F3A5F;
    --info-bg: #e6ecf8;
    --elec: #6D28D9;
    --gas: #C2410C;
    --water: #0369A1;
    --violet: #7c3aed;
    --amber: #d97706;
    --slate: #64748b;
    /* the app's own fonts (app.css / Home.razor: Inter, and --uuc-font-mono for numbers), no extra font */
    --font: var(--uuc-font-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    --cond: var(--font);
    --mono: var(--uuc-font-mono, ui-monospace, Consolas, monospace);
    /* heatmap levels (light → dark blue) */
    --hm0: #dbeafe;
    --hm1: #bfdbfe;
    --hm2: #93c5fd;
    --hm3: #60a5fa;
    --hm4: #2563eb;
    --hm5: #1e3a8a;
    /* BlazorKit tokens follow the page */
    --uuc-color-primary: var(--primary);
    --uuc-chart-font: var(--font);
    --uuc-chart-text: var(--fg);
    --uuc-chart-text-secondary: var(--muted);
    --uuc-chart-axis-label: var(--muted);
    --uuc-chart-axis-line: var(--line);
    --uuc-chart-grid: var(--line2);
    --uuc-chart-crosshair: var(--muted);
    --uuc-chart-bg: var(--surface);
    --uuc-chart-border: var(--line);
    --uuc-chart-primary: var(--primary);
    --uuc-table-font-family: var(--font);
    --uuc-table-header-bg: var(--surface2);
    --uuc-table-header-color: var(--muted);
    --uuc-table-header-sort-bg: var(--hover);
    --uuc-table-header-sort-active-bg: var(--sel);
    --uuc-table-body-bg: var(--surface);
    --uuc-table-row-hover-bg: var(--hover);
    --uuc-table-border-color: var(--line2);
    --uuc-table-text-color: var(--fg);
    --uuc-table-text-secondary: var(--muted);
    --uuc-table-primary-color: var(--primary);
    --uuc-kpi-font-family: var(--font);
    --uuc-kpi-bg: var(--surface);
    --uuc-kpi-border: var(--line);
    --uuc-kpi-radius: 8px;
    --uuc-kpi-padding: 8px 10px;
    --uuc-kpi-shadow: none;
    --uuc-kpi-shadow-hover: none;
    --card-bg: var(--surface);
    --text-pri: var(--fg);
    --text-sec: var(--muted);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.4;
    color: var(--fg);
}

/* Demand tab open: no padding on the portal tabs' content holder (BlazorKit tabs.css gives it padding: 16px 0) */
.uuc-portal-tabs .uuc-tabs-content-holder:has(> .uuc-tabs-content > .uuc-tabs-tabpane-active .dmt) {
    padding: 0;
}

html[data-theme="dark"] .dmt {
    --bg: #0E1318;
    --surface: #151C23;
    --surface2: #1A222A;
    --line: #2B353F;
    --line2: #222B34;
    --fg: #E6EAEE;
    --fg2: #C4CCD4;
    --muted: #95A1AD;
    --primary: #93B5E6;
    --primary-fg: #0E1318;
    --sel: #21324A;
    --hover: #1D2731;
    --ok: #4CC9AE;
    --ok-bg: #11302A;
    --warn: #F0B159;
    --warn-bg: #33260F;
    --bad: #F38B83;
    --bad-bg: #3A1917;
    --info: #93B5E6;
    --info-bg: #1E2A3B;
    --elec: #B69CF6;
    --gas: #F59C62;
    --water: #5DB7EC;
    --violet: #a78bfa;
    --amber: #f0b159;
    --slate: #94a3b8;
    --hm0: #172a46;
    --hm1: #1d3a63;
    --hm2: #22508a;
    --hm3: #2f6bb3;
    --hm4: #4f8ad6;
    --hm5: #93b5e6;
}

/* ---------------------------------------------------------------- page */
.dmt.dempage {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.dmt .num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

.dmt .muted {
    color: var(--muted);
}

    .dmt .muted.sm,
    .dmt .sm.muted {
        font-size: 11.5px;
    }

.dmt .sm {
    font-size: 11.5px;
}

/* heading row: ‹ All utilities · Demand · node · utility pill · period chip · (period toggle) */
.dmt .ch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

    .dmt .ch h3 {
        margin: 0;
        font-size: 12.5px;
        font-weight: 650;
        letter-spacing: .1px;
        color: var(--fg);
    }

    .dmt .ch.big h3 {
        font-size: 14px;
    }

    .dmt .ch .actions {
        margin-left: auto;
    }

.dmt .pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

.dmt .p-ok {
    color: var(--ok);
    background: var(--ok-bg);
}

.dmt .p-warn {
    color: var(--warn);
    background: var(--warn-bg);
}

.dmt .p-bad {
    color: var(--bad);
    background: var(--bad-bg);
}

.dmt .p-info {
    color: var(--info);
    background: var(--info-bg);
}

.dmt .periodchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sel);
    color: var(--primary);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

.dmt .dqnote {
    margin: 0;
    font-size: 11.5px;
    color: var(--warn);
    background: var(--warn-bg);
    border-radius: 6px;
    padding: 5px 9px;
    line-height: 1.45;
}

.dmt .dpill {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg2);
    white-space: nowrap;
}

    .dmt .dpill.up {
        color: var(--bad);
    }

    .dmt .dpill.down {
        color: var(--ok);
    }

.dmt .warn {
    color: var(--warn);
    font-weight: 600;
}

.dmt .ok {
    color: var(--ok);
}

.dmt .chev {
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
}

.dmt .linkbtn {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: 12.5px;
    padding: 4px 0;
    text-align: left;
    min-height: 28px;
    cursor: pointer;
    font-family: inherit;
}

    .dmt .linkbtn:hover {
        text-decoration: underline;
    }

/* ---------------------------------------------------------------- buttons (BlazorKit Button = .btn.sm) */
.dmt .uuc-btn {
    font-family: var(--font);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--fg);
    border-radius: 7px;
    min-height: 30px;
    height: auto;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: none;
}

    .dmt .uuc-btn:hover {
        background: var(--hover);
        color: var(--fg);
        border-color: var(--line);
    }

    /* a picked BlazorKit Button (Type="Primary") outside the toggles stays navy; the rule above would turn it white */
    .dmt .uuc-btn.uuc-btn--variant-solid,
    .dmt .uuc-btn.uuc-btn--variant-solid:hover {
        background: var(--primary);
        border-color: var(--primary);
        color: var(--primary-fg);
    }

/* segmented toggle (sample .tog): Total / By category / By …, 7 d / 30 d / 90 d.
   Selected on ".tog" alone: BlazorKit's ButtonGroup splats its extra attributes after its own class, so a
   class="tog" passed to it REPLACES "uuc-btn-group" (the rendered div is class="tog"). One box, 1px dividers,
   the picked button (Type="Primary" -> uuc-btn--color-primary) filled navy, as on the sample page. */
.dmt .tog {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    gap: 0;
    background: var(--surface);
}

    .dmt .tog > .uuc-btn {
        margin: 0;
        border: 0;
        border-right: 1px solid var(--line);
        border-radius: 0;
        box-shadow: none;
        background: var(--surface);
        padding: 6px 13px;
        min-height: 34px;
        height: auto;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--fg2);
    }

        .dmt .tog > .uuc-btn:last-child {
            border-right: 0;
        }

        .dmt .tog > .uuc-btn:hover {
            background: var(--hover);
            color: var(--fg2);
            border-color: var(--line);
        }

        .dmt .tog > .uuc-btn.uuc-btn--color-primary,
        .dmt .tog > .uuc-btn.uuc-btn--color-primary:hover,
        .dmt .tog > .uuc-btn.uuc-btn--color-primary:focus {
            background: var(--primary);
            border-color: var(--line);
            color: var(--primary-fg);
        }

        .dmt .tog > .uuc-btn:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: -2px;
        }

.dmt .tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

/* ---------------------------------------------------------------- cards (BlazorKit Card = sample .card) */
.dmt .uuc-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
    gap: 8px;
    min-width: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.dmt .uuc-card-header {
    margin: 0;
    align-items: center;
    gap: 4px 10px;
}

.dmt .uuc-card-title-group {
    align-items: center;
    gap: 4px 10px;
}

.dmt .uuc-card-title {
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: .1px;
    color: var(--fg);
}

.dmt .uuc-card-subtitle {
    font-size: 11.5px;
    color: var(--muted);
}

.dmt .uuc-card-body {
    gap: 8px;
}

/* ---------------------------------------------------------------- number tiles (BlazorKit KpiCard = sample .statb) */
/* six tiles spread over the full width in equal columns (sample page); 3 + 3 on mid screens, 2 per row on phones */
.dmt .statgrid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(0, 1fr)); /* 5: the latest-day tile is hidden */
}

@media (max-width: 1100px) {
    .dmt .statgrid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .dmt .statgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dmt .statgrid > * {
    min-width: 0;
    width: 100%;
}

.dmt .statgrid .uuc-kpi-card {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 8px 10px;
    min-height: 0;
    gap: 2px;
    justify-content: flex-start;
    box-shadow: none;
    transform: none;
}

    .dmt .statgrid .uuc-kpi-card:hover {
        border-color: var(--primary);
        box-shadow: none;
        transform: none;
    }

.dmt .statgrid .uuc-kpi-header {
    margin: 0 0 2px;
}

.dmt .statgrid .uuc-kpi-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--muted);
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
}

    /* the coloured dot of the sample's tile label: p-info by default, p-warn when a tile needs a look */
    .dmt .statgrid .uuc-kpi-title::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--primary);
        opacity: .45;
        flex: none;
    }

.dmt .statgrid .tile-warn .uuc-kpi-title::before {
    background: var(--warn);
    opacity: 1;
}

.dmt .statgrid .uuc-kpi-body {
    margin: 0;
}

.dmt .statgrid .uuc-kpi-value {
    font-family: var(--mono);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -.3px;
    line-height: 1.2;
    color: var(--fg);
}

.dmt .statgrid .uuc-kpi-meta,
.dmt .statgrid .uuc-kpi-footer-meta {
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
    color: var(--muted);
}

.dmt .statgrid .uuc-kpi-subtitle,
.dmt .statgrid .uuc-kpi-description {
    font-size: 11px;
    color: var(--muted);
}

/* v45 "All" cards (owcard owstat inside .dmxcards): title row, big value with a small unit, a muted line */
.dmt .dmxcards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
}

    .dmt .dmxcards .uuc-kpi-card {
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        padding: 10px 12px;
        gap: 4px;
        min-height: 0;
        justify-content: flex-start;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
        transform: none;
    }

        .dmt .dmxcards .uuc-kpi-card:hover {
            border-color: var(--line);
            box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
            transform: none;
        }

    .dmt .dmxcards .uuc-kpi-header {
        margin: 0;
    }

    .dmt .dmxcards .uuc-kpi-title {
        font-weight: 600;
        font-size: 13px;
        color: var(--fg);
        text-transform: none;
        letter-spacing: 0;
    }

    .dmt .dmxcards .uuc-kpi-body {
        margin: 0;
    }

    .dmt .dmxcards .uuc-kpi-value {
        font-family: var(--mono);
        font-size: 20px;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        color: var(--fg);
    }

        .dmt .dmxcards .uuc-kpi-value small,
        .dmt .dmxcards .uuc-kpi-value .unit {
            font-size: 12px;
            font-weight: 500;
            color: var(--muted);
        }

    /* values stay in the normal text colour on every card, percentages included (sample page) */
    .dmt .dmxcards .tile-warn .uuc-kpi-value {
        color: var(--fg);
    }

    .dmt .dmxcards .uuc-kpi-meta,
    .dmt .dmxcards .uuc-kpi-footer-meta {
        margin: 0;
        font-size: 11.5px;
        color: var(--muted);
    }

/* ---------------------------------------------------------------- grids */
.dmt .dgrid {
    display: grid;
    gap: 8px;
    align-items: start;
    min-width: 0;
}

    .dmt .dgrid > * {
        min-width: 0;
    }

    .dmt .dgrid.dx3 {
        grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
        align-items: stretch;
    }

    /* two equal halves (Hourly profile | Day of week, By meter make | About this data); one column on narrow screens */
    .dmt .dgrid.dx2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

@media (max-width: 900px) {
    .dmt .dgrid.dx2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------------------------------------------------------------- charts (BlazorKit LineChart / ColumnChart inside a card) */
.dmt .uuc-chart--bordered {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.dmt .uuc-chart-header {
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dmt .uuc-chart-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    min-width: 0;
}

.dmt .uuc-chart-title {
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: .1px;
    line-height: 1.4;
    color: var(--fg);
}

.dmt .uuc-chart-subtitle {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.4;
}

.dmt .uuc-chart-extra {
    margin-left: auto;
    flex-shrink: 1;
}

.dmt .uuc-chart-axis-label {
    font-family: var(--mono);
    font-size: 10.5px;
    fill: var(--muted);
}

.dmt .uuc-chart-grid {
    stroke: var(--line2);
}

.dmt .uuc-chart-axis-line {
    stroke: var(--line);
}

/* legend under the plot, as the sample's .legend: short coloured line, 12px, fg2 */
.dmt .uuc-chart-legend {
    gap: 4px 12px;
    font-size: 12px;
    color: var(--fg2);
}

.dmt .uuc-chart-legend-item {
    color: var(--fg2);
}

.dmt .uuc-chart-legend-marker {
    width: 14px;
    height: 3px;
    border-radius: 2px;
}

.dmt .bars-legend .uuc-chart-legend-marker {
    width: 10px;
    height: 10px;
}

/* line styles the sample page gives each series. BlazorKit draws every series the same way, so a series is picked by
   its gradient id (areas: only the main series is filled) or by its exact colour (dashed lines). */
.dmt .fill-first .uuc-chart-area:not([fill$="-g0)"]) {
    display: none;
}

.dmt .uuc-chart-line[stroke="#5b6678"],
.dmt .uuc-chart-line[stroke="#F0B159"] {
    stroke-dasharray: .006 .005;
}

/* thinner secondary lines; the brown line is left out so its own width (below) applies */
.dmt .fill-first .uuc-chart-line:not([stroke="#1e3a8a"]):not([stroke="#6D28D9"]):not([stroke="#0369A1"]):not([stroke="#C2410C"]):not([stroke="#975006"]) {
    stroke-width: 1.5px;
}

/* 14-day sparkline in the children table, as the sample page's spark(): 72x18, navy line 1.6px, a light fill
   under it (.12), one dot (r 2.6) on the last day only, no white ring */
.dmt .dm-spark { display: block; overflow: visible; }
.dmt .dm-spark .uuc-sparkline-area { fill-opacity: .12; }
.dmt .dm-spark .uuc-sparkline-dot { display: none; }
.dmt .dm-spark .uuc-sparkline-dot:last-of-type { display: inline; stroke: none; }

/* the brown (warn) lines, as the sample page draws them: stroke-dasharray="5 4", round caps.
   Daily consumption "7-day average" 2px; Hourly profile latest day 1.5px (weekend average there is 2px).
   js/demandCharts.js removes BlazorKit's pathLength="1" from these lines so the dash is in pixels. */
.dmt .uuc-chart-line[stroke="#975006"] {
    stroke-dasharray: 5 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2px;
}

.dmt .dm-hourly .uuc-chart-line[stroke="#975006"] {
    stroke-width: 1.5px;
}

.dmt .dm-hourly .uuc-chart-line[stroke="#7c3aed"] {
    stroke-width: 2px;
}

/* the charts get the light palette as plain colours (SVG attributes cannot hold var()); CSS maps them to the
   page tokens, so the lines, areas and bars follow the dark theme too */
.dmt [stroke="#1e3a8a"] {
    stroke: var(--primary);
}

.dmt [stroke="#7c3aed"] {
    stroke: var(--violet);
}

.dmt [stroke="#975006"] {
    stroke: var(--warn);
}

.dmt [stroke="#5b6678"] {
    stroke: var(--muted);
}

.dmt [stroke="#6D28D9"] {
    stroke: var(--elec);
}

.dmt [stroke="#0369A1"] {
    stroke: var(--water);
}

.dmt [stroke="#d97706"] {
    stroke: var(--amber);
}

.dmt [stroke="#64748b"] {
    stroke: var(--slate);
}

.dmt [fill="#1e3a8a"] {
    fill: var(--primary);
}

.dmt [fill="#7c3aed"] {
    fill: var(--violet);
}

.dmt [fill="#d97706"] {
    fill: var(--amber);
}

.dmt [fill="#64748b"] {
    fill: var(--slate);
}

.dmt [stop-color="#1e3a8a"] {
    stop-color: var(--primary);
}

.dmt [stop-color="#6D28D9"] {
    stop-color: var(--elec);
}

.dmt [stop-color="#0369A1"] {
    stop-color: var(--water);
}

/* ---------------------------------------------------------------- What stands out */
.dmt .insights .ins {
    font-size: 12.5px;
    line-height: 1.45;
    padding: 4px 0;
    border-top: 1px solid var(--line2);
}

    .dmt .insights .ins:first-child {
        border-top: 0;
    }

.dmt .insights .dxins {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-top: 1px solid var(--line2);
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

    .dmt .insights .dxins:first-child {
        border-top: 0;
    }

    .dmt .insights .dxins:hover {
        color: var(--primary);
    }

    .dmt .insights .dxins .chev {
        flex: none;
    }

/* ---------------------------------------------------------------- tables (BlazorKit Table = sample table.tight in a flat wrap) */
.dmt .uuc-table-wrapper {
    font-family: var(--font);
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.dmt .uuc-table-toolbar:empty {
    display: none;
}

.dmt .uuc-table-container {
    border: 0;
    border-radius: 0;
}

.dmt .uuc-table {
    font-size: 13px;
    color: var(--fg);
}

.dmt .uuc-table-thead > tr > th,
.dmt .uuc-table-small .uuc-table-thead > tr > th {
    background: var(--surface2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 8px;
    border-bottom: 1px solid var(--line);
}

.dmt .uuc-table-tbody > tr > td,
.dmt .uuc-table-small .uuc-table-tbody > tr > td {
    padding: 5px 8px;
    border-bottom: 0;
    border-top: 1px solid var(--line2);
    white-space: nowrap;
    background: var(--surface);
}

.dmt .uuc-table-tbody > tr:hover > td {
    background: var(--hover);
}

.dmt .uuc-table td.uuc-cell-num,
.dmt .uuc-table .uuc-cell-num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.dmt .row-click {
    cursor: pointer;
}

.dmt .go {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

/* share bar in a table cell (sample .shr) */
.dmt .shr {
    display: inline-block;
    width: 40px;
    height: 6px;
    background: var(--line2);
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}

    .dmt .shr i {
        display: block;
        height: 100%;
        background: var(--primary);
        opacity: .7;
    }

/* category name with a coloured square (sample .sevb) */
.dmt .sevb {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
}

    .dmt .sevb::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 2px;
        background: var(--sc);
    }

/* pagination: small, wraps in narrow cards. BlazorKit gives the three footer zones flex: 1 1 0 with min-width 0, so in a
   narrow card (Largest consumers) "Showing 1 to 10 of N entries" ran under the page buttons. Here each zone keeps its
   own width and the row wraps: the "Showing…" text on one line, the page buttons on the next when they do not fit. */
.dmt .uuc-table-pagination {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px 2px 0;
    font-size: 12px;
    color: var(--muted);
}

    .dmt .uuc-table-pagination .uuc-pagination-zone {
        flex: 0 1 auto;
        min-width: auto;
        gap: 8px;
    }

        .dmt .uuc-table-pagination .uuc-pagination-zone:empty {
            display: none;
        }

    .dmt .uuc-table-pagination .uuc-pagination-zone-right {
        margin-left: auto;
    }

.dmt .uuc-table-pagination-total {
    font-size: 12px;
    color: var(--muted);
}

.dmt .uuc-table-pagination-controls {
    flex-wrap: wrap;
    gap: 4px;
}

.dmt .uuc-pagination-btn,
.dmt .uuc-pagination-item {
    min-width: 26px;
    height: 26px;
    padding: 0 5px;
    font-size: 12px;
    border-radius: 6px;
    border-color: var(--line);
    background: var(--surface);
    color: var(--fg);
}

    .dmt .uuc-pagination-item.active,
    .dmt .uuc-pagination-item.uuc-active {
        background: var(--primary);
        border-color: var(--primary);
        color: var(--primary-fg);
    }

/* ---------------------------------------------------------------- Meters by daily use (sample .dist) */
.dmt .dist {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dmt .dr {
    display: grid;
    grid-template-columns: 82px 1fr 1fr 96px;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}

.dmt .db {
    height: 8px;
    background: var(--line2);
    border-radius: 4px;
    overflow: hidden;
}

    .dmt .db i {
        display: block;
        height: 100%;
        border-radius: 4px;
    }

        .dmt .db i.m {
            background: var(--primary);
        }

        .dmt .db i.g {
            background: var(--gas);
        }

.dmt .dv {
    text-align: right;
    font-size: 11px;
    color: var(--fg2);
}

/* hand-made legend (dist, heatmap) */
.dmt .legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--fg2);
}

    .dmt .legend span {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .dmt .legend i {
        width: 14px;
        height: 3px;
        border-radius: 2px;
        display: inline-block;
        vertical-align: middle;
    }

/* ---------------------------------------------------------------- Hour x day heatmap (sample .heat.dxhm) */
.dmt .dxfacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.dmt .acmini {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .dmt .acmini span {
        font-size: 11px;
        color: var(--muted);
    }

    .dmt .acmini b {
        font-size: 13.5px;
        font-weight: 600;
    }

.dmt .heat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.dmt .hrow {
    display: grid;
    grid-template-columns: 76px repeat(24, minmax(6px, 1fr)) 70px;
    gap: 2px;
    align-items: center;
}

    .dmt .hrow .r {
        text-align: right;
    }

.dmt .hhead .hx {
    font-size: 9.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: visible;
}

.dmt .hdl {
    font-size: 11px;
    white-space: nowrap;
}

    .dmt .hdl small {
        color: var(--muted);
    }

.dmt .hrow.we .hdl {
    color: var(--muted);
}

.dmt .hcl {
    height: 14px;
    border-radius: 2px;
    background: var(--line2);
}

    .dmt .hcl.l0 {
        background: var(--hm0);
    }

    .dmt .hcl.l1 {
        background: var(--hm1);
    }

    .dmt .hcl.l2 {
        background: var(--hm2);
    }

    .dmt .hcl.l3 {
        background: var(--hm3);
    }

    .dmt .hcl.l4 {
        background: var(--hm4);
    }

    .dmt .hcl.l5 {
        background: var(--hm5);
    }

    .dmt .hcl.pk {
        outline: 2px solid var(--bad);
        outline-offset: -1px;
    }

.dmt .legend .hcl {
    width: 18px;
    height: 10px;
    display: inline-block;
}

/* ---------------------------------------------------------------- Demand on "All": one section per utility (v45) */
.dmt .dmxsec {
    margin: 14px 0 4px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

    .dmt .dmxsec:first-of-type {
        border-top: 0;
        padding-top: 0;
    }

.dmt .dmxh {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}

    .dmt .dmxh .hh {
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        font-weight: 700;
    }

    .dmt .dmxh .uuc-btn {
        margin-left: auto;
    }

.dmt .dmxdot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dmt .dmxgrid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 12px;
    align-items: stretch;
}

    .dmt .dmxgrid > * {
        min-width: 0;
    }

@media (max-width: 900px) {
    .dmt .dmxgrid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.dmt .dmxrank {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 8px;
}

.dmt .dmxr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "n v" "b s";
    column-gap: 10px;
    row-gap: 3px;
    padding: 7px 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

    .dmt .dmxr:hover:not(:disabled),
    .dmt .dmxr:focus-visible {
        background: var(--hover);
    }

    .dmt .dmxr:disabled {
        cursor: default;
    }

.dmt .dmxn {
    grid-area: n;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dmt .dmxv {
    grid-area: v;
    text-align: right;
    font-weight: 600;
}

.dmt .dmxb {
    grid-area: b;
    height: 5px;
    border-radius: 3px;
    background: var(--line);
    align-self: center;
    overflow: hidden;
}

    .dmt .dmxb > i {
        display: block;
        height: 100%;
        border-radius: 3px;
    }

.dmt .dmxs {
    grid-area: s;
    text-align: right;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- About this data (sample .kv rows with a status dot) */
.dmt .kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid var(--line2);
    font-size: 13px;
}

    .dmt .kv:first-child {
        border-top: 0;
    }

    .dmt .kv .kl {
        display: flex;
        align-items: center;
        gap: 7px;
    }

        .dmt .kv .kl > span:last-child {
            white-space: normal;
            line-height: 1.35;
        }

.dmt .hdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.dmt .d-ok {
    background: var(--ok);
}

.dmt .d-warn {
    background: var(--warn);
}

.dmt .d-bad {
    background: var(--bad);
}

/* ---------------------------------------------------------------- loading */
.dmt .dm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
    font-size: 12px;
    color: var(--muted);
}
