/*
 ==============================================================================
 Project Name    : Esyasoft.AMI.Unified.Web
 File Name       : operations.css
 File Purpose    : ADDC Operations tab (AddcOpsTab). Every element is a BlazorKit component (KpiCard, KeyValueList /
                   KeyValueItem, Card, Table, Progress, Button, Checkbox, SearchInput, Title, Text, StatusBadge,
                   TypographyLink, Modal, charts); this file only restyles them through their own classes so they
                   read like the sample page (unified-utility-command 16 SLA Tab.html: .owcard / .owgrid / .hb /
                   .facets / .acmini). Colour tokens are the sample page's light palette from demand.css (.dmt):
                   primary #1e3a8a, ok #0F766E, warn #975006, bad #B42318, muted #5b6678, elec #6D28D9,
                   water #0369A1; dark mode follows .dmt. Card figures are black (var(--fg)), as on the sample.
                   Fonts: the kit's own (--uuc-font-primary, --uuc-font-mono for figures). Load after demand.css.
 Created By      : Shivani R
 Created Date    : 2026-11-17
 ==============================================================================
*/

/* Operations tab open: no padding on the portal tabs' content holder (same as the Demand tab) */
.uuc-portal-tabs .uuc-tabs-content-holder:has(> .uuc-tabs-content > .uuc-tabs-tabpane-active .opx) {
    padding: 0;
}

/* chart colours the sample page uses, mapped to the tokens so dark mode follows */
.dmt [stroke="#B42318"] { stroke: var(--bad); }
.dmt [fill="#B42318"] { fill: var(--bad); }
.dmt [fill="#975006"] { fill: var(--warn); }
.dmt [fill="#5b6678"] { fill: var(--muted); }
.dmt [fill="#0891b2"], .dmt [stroke="#0891b2"] { --c: #0891b2; }

.opx {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 0 0 12px;
}

/* figures in the kit mono font (sample page .num); body cells only, headers stay in the text font */
.opx .ox-mono,
.ox-dlg .ox-mono,
.opx .uuc-kpi-value,
.opx .uuc-kv-num,
.ox-dlg .uuc-kv-num,
.opx td.uuc-cell-num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

.opx th,
.opx th.uuc-cell-num {
    font-family: var(--font);
}

/* section headings: "Meters · 811,136" (kit Title; sample page .owov .ahh) */
.opx .ox-h.uuc-typography,
.opx .ox-h {
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    color: var(--fg);
}

/* kit Card at the sample page's density (.card: padding 9px 11px, gap 6px; no extra header space) */
.opx .uuc-card {
    padding: 9px 11px;
    gap: 6px;
}

.opx .uuc-card-header {
    margin: 0 0 6px;
    padding: 0;
    min-height: 0;
    border: 0;
}

.opx .uuc-card-body {
    padding: 0;
}

/* sample page .go: the diagnosis name, meter / gateway number — bold navy text, not a link (the row is what you click) */
.dmt .ox-go.ox-go,
.ox-dlg .ox-go.ox-go {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

/* diagnosis share bar (sample page .shr: 60px, primary at 70% on a light track) */
.opx .ox-shr .uuc-progress-bg {
    opacity: .7;
}

/* overview: sections one under the other with the sample page's 10px gap (.owov); the top has no extra padding */
.opx .owov {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* the Gateways heading after the meters charts: a little more room above, as on the sample page */
.opx .owov > .ox-h:not(:first-child) {
    margin-top: 6px;
}

/* ---------------------------------------------------------------- overview cards (kit KpiCard) */
.opx .owcards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.opx .owcard.uuc-kpi-card {
    height: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
    gap: 4px;
    justify-content: flex-start;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    transform: none;
}

.opx .owcard .uuc-kpi-header {
    margin: 0;
    align-items: center;
}

.opx .owcard .uuc-kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
    text-transform: none;
    letter-spacing: 0;
}

.opx .owcard .uuc-kpi-extra .ox-chev {
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.opx .owcard .uuc-kpi-body {
    margin: 4px 0 0;
}

/* the big figure: black, as on the sample page */
.opx .owcard .uuc-kpi-value-wrap,
.opx .owcard .uuc-kpi-value {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.3px;
    color: var(--fg);
    white-space: nowrap;
}

/* sample page .owcb: the big figure, then its muted line beside it; it wraps under the figure when the card is narrow */
.opx .owcard .uuc-kpi-value-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 4px;
    white-space: normal;
}

.opx .owcard .uuc-kpi-value {
    white-space: nowrap;
}

.opx .owcard .uuc-kpi-suffix {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.35;
    color: var(--muted);
    margin: 0;
    white-space: normal;
}

.opx .owcard .uuc-kpi-footer-meta,
.opx .owcard .uuc-kpi-subtitle,
.opx .owcard .uuc-kpi-description {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.opx .owcard .uuc-kpi-child-content {
    margin-top: 6px;
    border-top: 1px solid var(--line2);
    padding-top: 6px;
}

.opx .owcard .uuc-kv-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.opx .owcard .uuc-kv-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    border: 0;
    font-size: 12.5px;
}

.opx .owcard .uuc-kv-label {
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opx .owcard .uuc-kv-val {
    font-weight: 600;
    color: var(--fg);
}

.opx .ox-link {
    cursor: pointer;
}

    .opx .ox-link:hover {
        border-color: var(--primary);
    }

    .opx .ox-link:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

.opx .owstat:hover {
    border-color: var(--line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

/* network strength: label · share, bar under it (sample page .owsig .hb) */
.opx .owsig {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .opx .owsig .owsig-kv {
        margin-top: 4px;
        font-size: 12px;
    }

    .opx .owsig .owsig-kv .uuc-kv-label {
        color: var(--fg);
    }

    .opx .owsig .owsig-kv .uuc-kv-val {
        font-weight: 500;
        color: var(--fg2);
    }

/* kit Progress as the sample page's 8px bar on a light track */
.opx .uuc-progress,
.ox-dlg .uuc-progress {
    --uuc-progress-trail: var(--line2);
}

.opx .owsig-bar .uuc-progress-outer,
.opx .hm .uuc-progress-outer,
.opx .fbar .uuc-progress-outer,
.opx .ox-shr .uuc-progress-outer {
    padding: 0;
    margin: 0;
}

.opx .owsig-bar .uuc-progress-inner,
.opx .hm .uuc-progress-inner {
    height: 8px;
    border-radius: 4px;
    background: var(--line2);
}

.opx .ox-shr {
    width: 60px;
}

    .opx .ox-shr .uuc-progress-inner {
        height: 6px;
        background: var(--line2);
    }

    .opx .ox-shr .uuc-progress-bg {
        opacity: .7;
    }

/* ---------------------------------------------------------------- cards in two columns */
.opx .owgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

    .opx .owgrid > * {
        min-width: 0;
        margin: 0;
    }

    .opx .owgrid > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

@media (max-width: 900px) {
    .opx .owgrid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.opx .ox-card {
    margin: 0;
    height: 100%;
}

/* reporting facts (kit KpiCard, sample page .acmini) */
.opx .ox-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 6px;
}

.opx .ox-fact.uuc-kpi-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 10px;
    min-height: 0;
    gap: 2px;
    box-shadow: none;
    background: var(--surface);
}

.opx .ox-fact .uuc-kpi-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
}

.opx .ox-fact .uuc-kpi-value-wrap,
.opx .ox-fact .uuc-kpi-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--fg);
}

.opx .ox-foot {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
}

/* reporting charts' legend (sample page .legend): "▬ All meters ▬ Electricity ▬ Water · days the status job missed…" */
.opx .ox-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin-top: 4px;
    font-size: 12px;
}

    .opx .ox-legend .uuc-typography,
    .opx .ox-legend span {
        font-size: 12px;
    }

.opx .ox-leg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg);
}

    .opx .ox-leg i {
        display: inline-block;
        width: 16px;
        height: 4px;
        border-radius: 2px;
        flex: none;
    }

.opx .ox-row-click {
    cursor: pointer;
}

/* ---------------------------------------------------------------- drill-in view */
.opx .owv {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opx .owhead {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

    .opx .owhead .ox-title {
        margin: 0;
        font-size: 16px;
        font-weight: 650;
        color: var(--fg);
    }

.opx .ox-info.uuc-btn {
    color: var(--muted);
    cursor: help;
}

.opx .ox-src {
    font-size: 11.5px;
}

/* Drill-in tiles on one line: demand.css fixes .dmt .statgrid at 5 columns (Demand has 5 tiles), but a drill-in
   has 4–6, so the 6th wrapped. One equal column per tile instead; small screens keep demand.css's wrapping. */
@media (min-width: 1101px) {
    .opx .statgrid.ox-tiles {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
    }
}

/* tile dot colour by kind (demand.css draws the dot) */
.opx .statgrid .tile-bad .uuc-kpi-title::before { background: var(--bad); opacity: 1; }
.opx .statgrid .tile-warn .uuc-kpi-title::before { background: var(--warn); opacity: 1; }
.opx .statgrid .tile-ok .uuc-kpi-title::before { background: var(--ok); opacity: 1; }

.opx .actb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.opx .acq {
    width: 260px;
    max-width: 100%;
}

.opx .ox-chip.uuc-btn {
    border-radius: 99px;
    background: var(--sel);
    border-color: var(--sel);
    color: var(--primary);
    font-weight: 600;
}

.opx .dbody2 {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

    .opx .dbody2.nofac {
        grid-template-columns: minmax(0, 1fr);
    }

@media (max-width: 900px) {
    .opx .dbody2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.opx .dmain {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* facets (kit Checkbox + Progress + Text + Button link) */
.opx .facets {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px;
    position: sticky;
    top: 8px;
    max-height: calc(100vh - 140px);
    overflow: auto;
}

.opx .fac {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.opx .fach {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

    .opx .fach .fach-l {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .4px;
        text-transform: uppercase;
        color: var(--muted);
    }

.opx .facv {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px auto;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 12.5px;
}

    .opx .facv:hover {
        background: var(--hover);
    }

    .opx .facv.on {
        background: var(--sel);
    }

    .opx .facv .fcb {
        min-width: 0;
        overflow: hidden;
    }

        .opx .facv .fcb,
        .opx .facv .fcb * {
            white-space: nowrap;
            text-overflow: ellipsis;
        }

    .opx .facv .fbar .uuc-progress-inner {
        height: 4px;
        background: var(--line2);
    }

    .opx .facv .fbar .uuc-progress-bg {
        opacity: .55;
    }

    .opx .facv .facn {
        font-family: var(--mono);
        font-size: 12px;
        color: var(--fg2);
        text-align: right;
    }

/* "Show all 64" / "Show fewer" / "Clear" (sample page .linkbtn): bold navy text, no button look, underline on hover */
.opx .ox-linkbtn.uuc-btn,
.opx .ox-linkbtn.uuc-btn:hover,
.opx .ox-linkbtn.uuc-btn:focus {
    padding: 4px 0;
    height: auto;
    min-height: 28px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    align-self: flex-start;
}

    .opx .ox-linkbtn.uuc-btn:hover {
        text-decoration: underline;
    }

/* share bars (kit Button rows; sample page .hb: label | value, bar under them) */
.opx .hbars {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.opx .hb.uuc-btn {
    display: block;
    width: 100%;
    height: auto;
    padding: 4px 6px;
    border-radius: 5px;
    text-align: left;
    font-weight: 400;
    color: var(--fg);
}

    /* the kit wraps a button's content in an inline-block span that shrinks to the text: stretch it to the full row,
       so the bar under the label runs the whole card width (sample page .hb .hm: width = value / largest) */
    .opx .hb.uuc-btn > .uuc-btn__content {
        display: block;
        width: 100%;
    }

    .opx .hb.uuc-btn:hover {
        background: var(--hover);
    }

    .opx .hb.uuc-btn.on {
        background: var(--sel);
        font-weight: 600;
    }

.opx .hb-in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'n v' 'm m';
    align-items: center;
    gap: 2px 8px;
    width: 100%;
    font-size: 12px;
}

    .opx .hb-in .hn {
        grid-area: n;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .opx .hb-in .hv {
        grid-area: v;
        font-family: var(--mono);
        font-size: 12px;
        color: var(--fg2);
        white-space: nowrap;
    }

    .opx .hb-in .hm {
        grid-area: m;
    }

.opx .owrank .hbars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0 18px;
}

.opx .ox-clickable rect {
    cursor: pointer;
}

.opx .ox-empty {
    display: block;
    padding: 16px;
    text-align: center;
}

/* ---------------------------------------------------------------- meter / gateway popup (kit Modal) */
.ox-dlg .acdh {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

    .ox-dlg .acdh .uuc-typography,
    .ox-dlg .acdh h5 {
        margin: 0;
        font-size: 16px;
        font-weight: 650;
        color: var(--fg);
    }

.ox-dlg .ox-dlg-body {
    max-height: 70vh;
    overflow: auto;
}

.ox-dlg .ox-dgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 24px;
}

@media (max-width: 760px) {
    .ox-dlg .ox-dgrid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ox-dlg .ox-sec {
    margin: 10px 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--muted);
}

.ox-dlg .uuc-kv-row {
    display: grid;
    grid-template-columns: minmax(120px, 40%) minmax(0, 1fr);
    gap: 4px 12px;
    padding: 2px 0;
    border: 0;
    font-size: 12.5px;
}

.ox-dlg .uuc-kv-label {
    color: var(--muted);
}

.ox-dlg .uuc-kv-val {
    font-weight: 500;
    color: var(--fg);
    overflow-wrap: anywhere;
    text-align: left;
}

.ox-dlg .ox-remote {
    margin-top: 6px;
    border-top: 1px solid var(--line2);
}

.ox-dlg .ox-remote-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
