:root {
    --bg: #081019;
    --panel: #111a23;
    --panel2: #141f2a;
    --line: #263541;
    --text: #f1f5f8;
    --muted: #9eabb6;
    --blue: #1598ff;
    --green: #00c45a;
    --yellow: #ffd15c;
    --orange: #ff542b;
    --red: #ff2d2d;
    --auth-glass: 30%; /* how much --bg tints the card; lower = more transparent */
    --auth-blur: 2px;
    --auth-shade-in: 0%; /* page darkening, centre */
    --auth-shade-out: 0%; /* page darkening, edges */
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-width: 0;
}

h1:focus,
h2:focus,
h3:focus,
h1:focus-visible,
h2:focus-visible,
h3:focus-visible {
    outline: none;
}

a {
    color: var(--blue);
    text-decoration: none;
}
    a.btn {
        text-decoration: none;
        text-align: center;
    }
button,
input,
select,
textarea {
    font: inherit;
}

.success-text {
    color: var(--green);
}

.warning-text {
    color: var(--yellow);
}

.danger-text {
    color: var(--red);
}

.users-page,
.groups-page {
    min-width: 0;
}

.page-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

    .page-title h1 {
        margin: 0;
        font-size: 26px;
        font-weight: 600;
    }

.crumbs {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.page-note {
    margin-top: 4px;
    max-width: 620px;
    font-size: 13px;
    color: var(--muted);
}

.danger-button {
    border-color: var(--red) !important;
    color: var(--red) !important;
}

.empty-state,
.table-empty {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 240px;
}

/* =========================================================
   PAGE LAYOUT PRIMITIVES
   ========================================================= */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 14px;
}

@media (max-width: 1400px) {
    .kpi-grid,
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .page-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .kpi-grid,
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* A couple of headline numbers above a list. Wider than .kpi-grid's six, so two or
   three cards fill the row instead of huddling at the left. */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

/* Search box plus a few dropdowns above a list. auto-fit means no breakpoints:
   the controls wrap on their own. */
/* Flex, not grid: a grid track would stretch the Reset button to the width of a
   dropdown. The flex basis values keep the old proportions - search twice the width of
   a select, selects no narrower than 160px, wrapping when the row runs out of room. */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 12px;
}

    .filter-bar input {
        flex: 2 1 220px;
    }

    .filter-bar select {
        flex: 1 1 160px;
    }

    /* Content width, and pushed to the far end of the row so it never sits tight
       against the last dropdown. */
    .filter-bar .btn {
        flex: none;
        margin-left: auto;
    }

    .filter-bar input,
    .filter-bar select {
        min-width: 0;
        padding: 9px 10px;
        border: 1px solid var(--line);
        border-radius: 6px;
        outline: none;
        background: #0d151d;
        color: var(--text);
    }

        .filter-bar input:focus,
        .filter-bar select:focus {
            border-color: var(--blue);
        }

/* Row count on the right of a panel header. */
.panel-count {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

/* Two panels side by side. Pages that need an uneven split override
   grid-template-columns from their own sheet. */
.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

@media (max-width: 1050px) {
    .two-column {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================================================
   ZENTNL - GLOBAL SYNCFUSION GRID OVERRIDES
   ========================================================= */

.e-grid {
    background: var(--panel) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: none !important;
}

    /* Grid header */
    .e-grid .e-gridheader,
    .e-grid .e-headercontent,
    .e-grid .e-columnheader {
        background: #101923 !important;
        border-color: var(--line) !important;
    }

    .e-grid .e-headercell,
    .e-grid .e-headercelldiv {
        background: #101923 !important;
        color: #dfe7ec !important;
        border-color: var(--line) !important;
    }

    .e-grid .e-headercell {
        font-size: 12px;
        font-weight: 600;
    }

    .e-grid .e-gridcontent {
        background: var(--panel) !important;
        color: var(--text) !important;
        border-color: var(--line) !important;
    }

    /* Normal rows */
    .e-grid .e-row,
    .e-grid .e-rowcell {
        background: var(--panel) !important;
        color: var(--text) !important;
        border-color: var(--line) !important;
    }

    .e-grid .e-rowcell {
        font-size: 12px;
    }

    /* Alternate row */
    .e-grid .e-altrow .e-rowcell {
        background: #0f1821 !important;
    }

    /* Hover */
    .e-grid .e-row:hover .e-rowcell {
        background: #15212b !important;
        color: var(--text) !important;
    }

    /* Selected row */
    .e-grid .e-selectionbackground,
    .e-grid .e-row.e-selectionbackground .e-rowcell,
    .e-grid .e-row[aria-selected="true"] .e-rowcell {
        background: #17314a !important;
        color: #ffffff !important;
    }

    /* Focused cell */
    .e-grid .e-focused,
    .e-grid .e-focus {
        box-shadow: inset 0 0 0 1px var(--blue) !important;
    }

    /* Empty grid */
    .e-grid .e-emptyrow td {
        background: var(--panel) !important;
        color: var(--muted) !important;
    }

    /* Toolbar */
    .e-grid .e-toolbar {
        background: #101923 !important;
        border-color: var(--line) !important;
    }

        .e-grid .e-toolbar .e-toolbar-item,
        .e-grid .e-toolbar .e-tbar-btn,
        .e-grid .e-toolbar .e-btn {
            background: transparent !important;
            color: var(--text) !important;
        }

            .e-grid .e-toolbar .e-tbar-btn:hover,
            .e-grid .e-toolbar .e-btn:hover {
                background: #17314a !important;
                color: #ffffff !important;
            }

        /* Search */
        .e-grid .e-toolbar .e-search,
        .e-grid .e-toolbar .e-input-group,
        .e-grid .e-search-wrapper {
            background: #0d151d !important;
            border-color: var(--line) !important;
        }

        .e-grid .e-toolbar input,
        .e-grid .e-search input {
            background: #0d151d !important;
            color: var(--text) !important;
        }

    /* Filter row */
    .e-grid .e-filterbarcell {
        background: #101923 !important;
        border-color: var(--line) !important;
    }

        .e-grid .e-filterbarcell .e-input-group,
        .e-grid .e-filterbarcell input {
            background: #0d151d !important;
            color: var(--text) !important;
            border-color: var(--line) !important;
        }

    /* Sort and filter icons */
    .e-grid .e-icon-ascending,
    .e-grid .e-icon-descending,
    .e-grid .e-filtermenudiv,
    .e-grid .e-filtericon {
        color: var(--muted) !important;
    }

    .e-grid .e-headercell:hover .e-filtermenudiv,
    .e-grid .e-headercell:hover .e-filtericon {
        color: var(--blue) !important;
    }

    /* Pager */
    .e-grid .e-gridpager,
    .e-grid .e-pager {
        background: #101923 !important;
        color: var(--muted) !important;
        border-color: var(--line) !important;
    }

        .e-grid .e-pager .e-pagercontainer {
            background: transparent !important;
        }

        .e-grid .e-pager .e-numericitem,
        .e-grid .e-pager .e-firstpage,
        .e-grid .e-pager .e-prevpage,
        .e-grid .e-pager .e-nextpage,
        .e-grid .e-pager .e-lastpage {
            background: transparent !important;
            color: var(--muted) !important;
            border-color: transparent !important;
        }

            .e-grid .e-pager .e-numericitem:hover,
            .e-grid .e-pager .e-firstpage:hover,
            .e-grid .e-pager .e-prevpage:hover,
            .e-grid .e-pager .e-nextpage:hover,
            .e-grid .e-pager .e-lastpage:hover {
                background: #17314a !important;
                color: #ffffff !important;
            }

        .e-grid .e-pager .e-currentitem {
            background: #17314a !important;
            color: #ffffff !important;
            border-color: var(--blue) !important;
        }

        /* Dropdowns and page-size controls inside pager */
        .e-grid .e-pager .e-dropdownlist,
        .e-grid .e-pager .e-input-group {
            background: #0d151d !important;
            color: var(--text) !important;
            border-color: var(--line) !important;
        }

    /* Checkbox selection */
    .e-grid .e-checkbox-wrapper .e-frame,
    .e-grid .e-css.e-checkbox-wrapper .e-frame {
        background: #0d151d !important;
        border-color: #50606d !important;
    }

        .e-grid .e-checkbox-wrapper .e-frame.e-check,
        .e-grid .e-css.e-checkbox-wrapper .e-frame.e-check {
            background: var(--blue) !important;
            border-color: var(--blue) !important;
        }

    /* Grouping area */
    .e-grid .e-groupdroparea {
        background: #101923 !important;
        color: var(--muted) !important;
        border-color: var(--line) !important;
    }

    .e-grid .e-groupcaption,
    .e-grid .e-groupcaptionrow .e-recordplusexpand,
    .e-grid .e-groupcaptionrow .e-recordpluscollapse {
        background: #101923 !important;
        color: var(--text) !important;
    }

    /* Detail rows */
    .e-grid .e-detailrow .e-detailcell {
        background: #0d151d !important;
        color: var(--text) !important;
        border-color: var(--line) !important;
    }

    /* Edit mode */
    .e-grid .e-editedrow .e-rowcell,
    .e-grid .e-addedrow .e-rowcell {
        background: #13263a !important;
    }

    .e-grid .e-editcell .e-input-group,
    .e-grid .e-editcell input {
        background: #0d151d !important;
        color: var(--text) !important;
        border-color: var(--blue) !important;
    }

/* =========================================================
   SYNCFUSION POPUPS USED BY GRID FILTERING
   These render outside the grid itself, so they need global
   overrides too.
   ========================================================= */

.e-popup,
.e-popup.e-popup-open,
.e-dropdown-popup,
.e-filter-popup,
.e-checkboxfilter,
.e-excelfilter,
.e-contextmenu-wrapper ul,
.e-menu-wrapper ul {
    background: #101923 !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
}

    .e-popup .e-list-item,
    .e-dropdown-popup .e-list-item,
    .e-checkboxfilter .e-list-item {
        background: #101923 !important;
        color: var(--text) !important;
    }

        .e-popup .e-list-item:hover,
        .e-dropdown-popup .e-list-item:hover,
        .e-checkboxfilter .e-list-item:hover {
            background: #17314a !important;
            color: #ffffff !important;
        }

    .e-popup .e-active,
    .e-dropdown-popup .e-active {
        background: #17314a !important;
        color: #ffffff !important;
    }

    .e-checkboxfilter .e-input-group,
    .e-excelfilter .e-input-group,
    .e-filter-popup .e-input-group {
        background: #0d151d !important;
        color: var(--text) !important;
        border-color: var(--line) !important;
    }

    .e-checkboxfilter input,
    .e-excelfilter input,
    .e-filter-popup input {
        color: var(--text) !important;
    }

    /* Filter buttons */
    .e-filter-popup .e-btn,
    .e-excelfilter .e-btn,
    .e-checkboxfilter .e-btn {
        background: #101923 !important;
        color: var(--text) !important;
        border-color: var(--line) !important;
    }

    .e-filter-popup .e-primary,
    .e-excelfilter .e-primary,
    .e-checkboxfilter .e-primary {
        background: #17314a !important;
        color: #ffffff !important;
        border-color: var(--blue) !important;
    }

    /* Scrollbars */
    .e-grid ::-webkit-scrollbar,
    .e-popup ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    .e-grid ::-webkit-scrollbar-track,
    .e-popup ::-webkit-scrollbar-track {
        background: #0b1219;
    }

    .e-grid ::-webkit-scrollbar-thumb,
    .e-popup ::-webkit-scrollbar-thumb {
        background: #334553;
        border-radius: 5px;
    }

        .e-grid ::-webkit-scrollbar-thumb:hover,
        .e-popup ::-webkit-scrollbar-thumb:hover {
            background: #41596b;
        }

.e-toolbar .e-toolbar-items,
.e-grid .e-toolbar .e-toolbar-items {
    background: var(--panel) !important;
}

.e-grid .e-table {
    border-spacing: 0 !important;
}

/* =========================================================
   CARD GRID
   Put .card-grid on the element wrapping an SfGrid: below 760px
   each row becomes a two-column card. Cell order, full-width
   spans and ::before labels are column-specific and stay in the
   page stylesheet.
   ========================================================= */

@media (max-width: 760px) {
    .card-grid .e-grid .e-gridcontent,
    .card-grid .e-grid .e-content {
        overflow-x: hidden !important;
    }

    .card-grid .e-grid .e-table {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
    }

    .card-grid .e-grid .e-gridheader {
        display: none;
    }

    .card-grid .e-grid tbody {
        display: block;
        width: 100%;
    }

    .card-grid .e-grid .e-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin-bottom: 10px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    .card-grid .e-grid .e-rowcell {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        min-width: 0;
        padding: 10px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--line) !important;
        white-space: normal !important;
    }

        .card-grid .e-grid .e-rowcell::before {
            display: block;
            margin-bottom: 4px;
            color: var(--muted);
            font-size: 10px;
            font-weight: 500;
            text-transform: uppercase;
        }

    .card-grid .e-grid .name-cell,
    .card-grid .e-grid .role-pills {
        width: 100%;
    }

    /* Desktop centering uses auto margins, which would override align-items in a card. */
    .card-grid .e-grid .icon-button {
        margin-inline: 0;
    }

    .card-grid .e-grid .e-gridpager {
        min-width: 0;
        overflow-x: auto;
    }
}

/* =========================================================
   ADMIN PRIMITIVES (users, groups, locations)
   Global on purpose: SfDialog renders at the body level, so an
   isolated sheet would not reach dialog headers and footers.
   Every page now inherits the :root palette — there is no
   per-page token override.
   ========================================================= */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

    .panel-header h2 {
        display: flex;
        align-items: center;
        gap: 9px;
        margin: 0;
        font-size: 15px;
        font-weight: 600;
    }

    .panel-header .page-note {
        margin-top: 0;
    }

.panel-body {
    padding: 14px;
}

.panel-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
}

.status-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}

    .status-inline i {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--green);
    }

    .status-inline.off {
        color: var(--muted);
    }

        .status-inline.off i {
            background: #6b7783;
        }

.icon-btn {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}

    .icon-btn:hover {
        border-color: var(--line);
        background: #1d2833;
        color: var(--text);
    }

    /* Never disabled: pressing it is how the operator finds out what is blocking. */
    .icon-btn.danger:hover {
        border-color: rgba(255, 92, 92, .38);
        background: #3a2124;
        color: #ffb4b4;
    }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.req {
    color: var(--orange);
}

.field-error {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--red);
}

.field-note {
    margin-top: 5px;
    font-size: 12px;
    color: var(--muted);
}

.char-count {
    float: right;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

    .char-count.over {
        color: var(--red);
    }

.form-status {
    font-size: 12px;
    color: var(--muted);
}

    .form-status.bad {
        color: var(--red);
    }

.switch-row {
    display: flex;
    align-items: flex-start;
    max-width: 640px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    cursor: pointer;
}

    .switch-row input {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        margin: 1px 12px 0 0;
        accent-color: var(--blue);
        cursor: pointer;
    }

.sr-name {
    display: block;
    font-size: 13px;
}

.sr-desc {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

.role-pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

    .role-pills > * {
        /* One line per pill: a label that wrapped inside its pill would make that row
           taller than every other row. The container still wraps between pills, so a
           list of roles is unaffected. Columns are sized to fit, so nothing is cut. */
        white-space: nowrap;
        padding: 2px 8px;
        border-radius: 5px;
        background: #303c47;
        color: #dce5eb;
        font-size: 11px;
        white-space: nowrap;
    }

    .role-pills > .privileged {
        background: rgba(255, 209, 26, .16);
        color: #ffdf7a;
    }

/* A garment size is a short, fixed token - XS to XXL - so it is set in tabular figures
   at a fixed minimum width. Every pill in the column is then the same size whatever it
   says, and the column reads as one stack rather than as ragged lozenges. */
.size-pill {
    display: inline-block;
    min-width: 38px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
    text-align: center;
    white-space: nowrap;
}

    .size-pill.set {
        background: #303c47;
        color: #dce5eb;
    }

    /* No size recorded. Outlined rather than filled, so an empty answer does not carry
       the same weight on the page as a real one. */
    .size-pill.unset {
        border: 1px solid var(--line);
        padding: 1px 7px;
        color: var(--muted);
        font-weight: 500;
    }

.table-empty {
    padding: 22px 16px;
}

.name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar,
.avatar-row {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #2c68d8;
    font-size: 11px;
    font-weight: 600;
}

.cell-sub,
.subtext {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

/* Open-record button in list grids. */
.icon-button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin-inline: auto;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #172431;
    color: #d9e1e7;
    cursor: pointer;
}

    .icon-button:hover {
        border-color: var(--blue);
        background: #183a62;
        color: #fff;
    }

    /* Destructive row action. Neutral at rest so it reads as a sibling of the view
       button rather than a warning on every row, and red only under the pointer. */
    .icon-button.danger:hover {
        border-color: rgba(255, 92, 92, .38);
        background: #3a2124;
        color: #ffb4b4;
    }

    /* Bigger and heavier than a body icon: this is the row's only affordance. */
    .icon-button .icon {
        width: 22px;
        height: 22px;
        stroke-width: 1.8;
    }

    /* With a word beside the eye. The square grows sideways rather than becoming a
       different component, so hover, focus and the danger variant still apply.

       fit-content, not auto: this is a block-level grid, so auto fills the cell, the
       two tracks split that width and place-items centres the eye and the word in
       their own halves - a finger-wide gap that follows the column. */
    .icon-button.labelled {
        width: fit-content;
        grid-auto-flow: column;
        gap: 6px;
        padding: 0 10px 0 8px;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        text-decoration: none;
    }

    /* Smaller here than in the icon-only button: at 22px the eye outweighs 13px text. */
    .icon-button.labelled .icon {
        width: 18px;
        height: 18px;
    }

/* Dialog chrome for LocationDeleteGuard and GroupRemoveGuard. Global for the reason at the top of this file. */
.dlg-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.dlg-title {
    font-size: 16px;
    font-weight: 500;
}

.dlg-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

.dlg-x {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 15px;
}

    .dlg-x:hover {
        color: var(--text);
    }

.dlg-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.dlg-actions {
    display: flex;
    gap: 8px;
}

.confirm-body,
.blocked-body p {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.6;
}

.confirm-why,
.blocked-why {
    color: var(--muted);
}

.blocked-note {
    padding: 10px 12px;
    border: 1px solid rgba(255, 209, 26, .32);
    border-radius: 7px;
    background: rgba(255, 209, 26, .08);
    color: #e8d79a;
    font-size: 12px !important;
}

.e-dialog.admin-dialog {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}

    .e-dialog.admin-dialog .e-dlg-header-content,
    .e-dialog.admin-dialog .e-footer-content {
        background: var(--panel);
        border-color: var(--line);
    }

/* UserCreate garment picker. Markup: CssClass="admin-dialog user-create-garment-dialog". */
.e-dialog.user-create-garment-dialog {
    color: var(--text);
}

    .e-dialog.user-create-garment-dialog .e-dlg-content {
        padding: 18px;
        background: var(--panel);
        color: var(--text);
    }

    .e-dialog.user-create-garment-dialog .e-dlg-header,
    .e-dialog.user-create-garment-dialog .e-dlg-closeicon-btn {
        color: var(--text);
    }

.e-input-group,
.e-input-group.e-control-wrapper {
    background: #0d151d;
    border-color: var(--line);
    border-radius: 6px;
}

    .e-input-group:focus-within {
        border-color: var(--blue);
    }

/* =========================================================
   FORM PAGES (user create, group create)
   Moved from UserCreate.razor.css: shared by every create page.
   ========================================================= */

.form-page {
    padding: 18px;
}

    .form-page .page-title {
        max-width: 1080px;
    }

.create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 16px;
    max-width: 1080px;
}

.loading-panel,
.load-error {
    max-width: 1080px;
    padding: 24px;
    color: var(--muted);
}

    .load-error h2 {
        margin: 0 0 8px;
        color: var(--text);
        font-size: 18px;
    }

    .load-error p {
        margin: 0 0 16px;
    }

.form-section {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

    .form-section h3 {
        margin: 0 0 4px;
        font-size: 15px;
        font-weight: 600;
    }

    .form-section .hint {
        margin: 0 0 16px;
        color: var(--muted);
        font-size: 12px;
    }

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

    .field-grid.one {
        grid-template-columns: minmax(0, 1fr);
    }

        .field-grid.one .field {
            max-width: 640px;
        }

/* :not(.e-input) keeps these off the inputs Syncfusion renders inside its own wrappers. */
.field input:not(.e-input),
.field select:not(.e-input),
.field textarea:not(.e-input) {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: none;
    background: #0d151d;
    color: var(--text);
}

    .field input:not(.e-input):focus,
    .field select:not(.e-input):focus,
    .field textarea:not(.e-input):focus {
        border-color: var(--blue);
    }

.field textarea:not(.e-input) {
    min-height: 70px;
    resize: vertical;
}

/* Classes doubled to keep the specificity these rules had as ::deep scoped rules. */
.field .e-input-group.e-input-group,
.field .e-input-group.e-control-wrapper.e-control-wrapper {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0d151d;
    box-shadow: none !important;
}

    .field .e-input-group.e-input-group input.e-input {
        color: var(--text);
    }

.field .e-input-group-icon.e-input-group-icon {
    color: var(--muted);
}

.field.invalid input:not(.e-input),
.field.invalid textarea:not(.e-input),
.field.invalid .e-input-group.e-input-group {
    border-color: var(--red) !important;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
}

.shell-actions,
.header-actions,
.form-actions,
.created-actions,
.picker-trigger,
.chip-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.side-panel {
    position: sticky;
    top: 70px;
    padding: 16px 18px;
}

    .side-panel h3 {
        margin: 0 0 12px;
        font-size: 14px;
        font-weight: 600;
    }

.preview-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.preview-avatar {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #4b545b;
    border-radius: 8px;
    background: #30363b;
    color: #cfd6db;
    font-size: 15px;
}

    .preview-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.preview-name {
    font-size: 15px;
}

.preview-mail {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 12px;
}

.preview-rows {
    display: grid;
    gap: 9px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.preview-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
}

    .preview-row span:first-child {
        color: var(--muted);
    }

    .preview-row span:last-child {
        overflow-wrap: anywhere;
        text-align: right;
    }

.next-heading {
    margin-top: 18px !important;
}

.next-list {
    margin: 10px 0 0;
    padding-left: 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.defer-note {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
}

.created-panel {
    padding: 26px 20px;
    text-align: center;
}

    .created-panel h2 {
        margin: 8px 0 4px;
        font-size: 19px;
        font-weight: 600;
    }

    .created-panel p {
        margin: 0 0 18px;
        color: var(--muted);
        font-size: 13px;
    }

.created-mark {
    color: var(--green);
    font-size: 26px;
}

.created-actions {
    justify-content: center;
}

.chip-tray {
    margin-top: 12px;
    gap: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 9px;
    border-radius: 6px;
    background: rgb(47 140 255 / 18%);
    color: #9ec7ff;
    font-size: 12px;
}

    .chip button {
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        font-size: 11px;
        line-height: 1;
        cursor: pointer;
        opacity: .75;
    }

        .chip button:hover {
            opacity: 1;
        }

.chip-empty {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1050px) {
    .create-layout,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .side-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .form-page {
        padding: 14px;
    }

    .form-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
   CARD PAGES
   Sections space themselves through the page grid, not their
   own margins.
   ========================================================= */

.card-page {
    display: grid;
    gap: 14px;
    min-width: 0;
}

    .card-page .page-title {
        margin-bottom: 0;
    }

.identity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

    .identity-row .avatar-row {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }

    .identity-row strong {
        display: block;
        font-size: 16px;
        font-weight: 600;
    }

/* Member tables on card pages share one column set:
   1 View, 2 User, 3 Roles, 4 Remove. */
.member-grid .e-grid .icon-btn.danger {
    margin-inline: auto;
}

@media (max-width: 760px) {
    .member-grid .e-grid .e-rowcell:nth-child(2) {
        order: 1;
        grid-column: 1 / -1;
    }

    .member-grid .e-grid .e-rowcell:nth-child(3) {
        order: 2;
        grid-column: 1 / -1;
    }

    .member-grid .e-grid .e-rowcell:nth-child(1) {
        order: 3;
    }

    .member-grid .e-grid .e-rowcell:nth-child(4) {
        order: 4;
        align-items: flex-end;
    }

    .member-grid .e-grid .e-rowcell:nth-child(1)::before {
        content: "View";
    }

    .member-grid .e-grid .e-rowcell:nth-child(2)::before {
        content: "User";
    }

    .member-grid .e-grid .e-rowcell:nth-child(3)::before {
        content: "Roles";
    }

    .member-grid .e-grid .e-rowcell:nth-child(4)::before {
        content: "Remove";
    }

    .member-grid .e-grid .icon-btn.danger {
        margin-inline: 0;
    }
}

/* Detail rows with per-field inline editing. */

.detail-row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

    .detail-row:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

.detail-label {
    padding-top: 7px;
    color: var(--muted);
    font-size: 12px;
}

.detail-value {
    padding-top: 6px;
    font-size: 13px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

    .detail-value.empty {
        color: var(--muted);
        font-style: italic;
    }

.inline-edit {
    grid-column: 2 / -1;
    display: grid;
    gap: 8px;
}

.inline-actions {
    display: flex;
    gap: 8px;
}

/* =========================================================
   OVERVIEW DONUTS (user card, group card)
   ========================================================= */

.overview-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.overview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 14px 8px;
}

    .overview-card h3 {
        margin: 0;
        color: var(--muted);
        font-size: 12px;
        font-weight: 500;
        text-align: center;
    }

.overview-chart {
    display: grid;
    width: 120px;
    height: 120px;
    place-items: center;
}

.overview-empty {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.legend-marker {
    display: block;
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    flex: 0 0 12px;
    border: 3px solid;
    border-radius: 50%;
    background: transparent;
}

    .legend-marker.blue {
        border-color: var(--blue);
    }

    .legend-marker.green {
        border-color: var(--green);
    }

    .legend-marker.yellow {
        border-color: var(--yellow);
    }

    .legend-marker.orange {
        border-color: var(--orange);
    }

    .legend-marker.red {
        border-color: var(--red);
    }

@media (max-width: 1050px) {
    .overview-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .overview-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   BUTTONS
   Syncfusion selectors are doubled (.e-btn.e-btn) on purpose: the
   theme uses the same specificity, so doubling wins regardless of
   stylesheet order without !important.
   ========================================================= */

.e-btn.e-btn,
.e-css.e-btn {
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    background: #1d2833;
    color: #fff;
    box-shadow: none;
    text-transform: none;
    transition: background .12s ease, border-color .12s ease;
}

    .e-btn.e-btn:hover,
    .e-css.e-btn:hover {
        background: #26333f;
        border-color: rgba(255, 255, 255, .18);
        color: #fff;
    }

    .e-btn.e-btn:active,
    .e-btn.e-btn.e-active {
        background: #1a242e;
        box-shadow: none;
    }

    .e-btn.e-btn:focus-visible {
        outline: 2px solid var(--blue);
        outline-offset: 2px;
        box-shadow: none;
    }

    .e-btn.e-btn:disabled,
    .e-btn.e-btn.e-disabled {
        opacity: .45;
        cursor: default;
    }

        .e-btn.e-btn:disabled:hover,
        .e-btn.e-btn.e-disabled:hover {
            background: #1d2833;
            border-color: rgba(255, 255, 255, .09);
        }

    .e-btn.e-btn.e-primary {
        background: var(--blue);
        border-color: var(--blue);
        color: #fff;
    }

        .e-btn.e-btn.e-primary:hover {
            background: color-mix(in srgb, var(--blue) 82%, #fff);
            border-color: color-mix(in srgb, var(--blue) 82%, #fff);
        }

        .e-btn.e-btn.e-primary:disabled:hover,
        .e-btn.e-btn.e-primary.e-disabled:hover {
            background: var(--blue);
            border-color: var(--blue);
        }

    /* Secondary: same fill as the base button. Replaces e-outline, which reads as
   an unstyled ghost against the new solid style. */
    .e-btn.e-btn.btn-secondary {
        background: #1d2833;
        border-color: rgba(255, 255, 255, .09);
    }

    .e-btn.e-btn.btn-danger {
        background: #3a2124;
        border-color: rgba(255, 92, 92, .38);
        color: #ffb4b4;
    }

        .e-btn.e-btn.btn-danger:hover {
            background: #4a272b;
            border-color: rgba(255, 92, 92, .55);
            color: #ffb4b4;
        }

    .e-btn.e-btn.btn-tiny {
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 8px;
    }

/* Plain HTML buttons (non-Syncfusion). */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

    .btn.primary {
        border-color: var(--blue);
        background: var(--blue);
    }

    /* Tinted rather than solid: an accent action that is not the page's main one. Same
       16% wash the status pills and badges use, so it reads as part of the palette. */
    .btn.accent {
        border-color: color-mix(in srgb, var(--blue) 45%, transparent);
        background: color-mix(in srgb, var(--blue) 16%, transparent);
        color: var(--blue);
    }

    .btn.danger {
        border-color: rgba(255, 92, 92, .38);
        background: #3a2124;
        color: #ffb4b4;
    }

    .btn:hover:not(:disabled) {
        filter: brightness(1.12);
    }

    .btn:disabled {
        cursor: default;
        opacity: .55;
    }

/* =========================================================
   AUTH PAGES (login, password reset)
   Background comes from --auth-bg, set inline per page so the
   image stays configuration-driven.
   ========================================================= */

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background-color: var(--bg);
    background-image: var(--auth-bg, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

    .auth-page::before {
        content: "";
        position: fixed;
        inset: 0;
        background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bg) var(--auth-shade-in), transparent), color-mix(in srgb, var(--bg) var(--auth-shade-out), transparent));
    }

.auth-card {
    position: relative;
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 34px 32px;
    border: 1px solid rgb(255 255 255 / 14%);
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg) var(--auth-glass), transparent);
    backdrop-filter: blur(var(--auth-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--auth-blur)) saturate(140%);
    box-shadow: 0 24px 60px rgb(0 0 0 / 50%), inset 0 1px 0 rgb(255 255 255 / 8%);
}

.auth-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

    .auth-head h1 {
        margin: 0;
        font-size: 22px;
        font-weight: 600;
    }

.auth-logo {
    width: 72px;
    height: 72px;
}

.auth-lead {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.auth-form {
    display: grid;
    gap: 14px;
}

    .auth-form .btn {
        width: 100%;
        padding: 11px 14px;
        text-align: center;
    }

.auth-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

    .auth-remember input {
        width: 16px;
        height: 16px;
        accent-color: var(--blue);
        cursor: pointer;
    }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

    .auth-divider::before,
    .auth-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--line);
    }

.auth-links {
    display: grid;
    gap: 9px;
    font-size: 13px;
    text-align: center;
}

.auth-external {
    display: grid;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.auth-summary {
    color: var(--red);
    font-size: 12px;
}

    .auth-summary ul {
        margin: 0;
        padding-left: 18px;
    }

    .auth-summary:empty {
        display: none;
    }

@media (max-width: 480px) {
    .auth-card {
        padding: 26px 20px;
    }
}

/* =========================================================
   APP SHELL AND SIDEBAR
   The collapsed class lives on .app-shell, so these can't be
   scoped to NavMenu.
   ========================================================= */

.app-shell {
    --sidebar-width: 200px;
    --sidebar-collapsed-width: 60px;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

    .app-shell.sidebar-collapsed {
        grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
    }

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden auto;
    padding: 0 0 18px;
    border-right: 1px solid var(--line);
    background: #0b131b;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 128px;
    padding: 0 16px;
}

/* One file per display size rather than one file scaled twice.
   alt="" on both: the logo is decorative next to the nav it labels. */
.sidebar-logo {
    width: 96px;
    height: 96px;
}

.sidebar-logo-rail {
    display: none;
    width: 28px;
    height: 28px;
}

.sidebar-section {
    margin: 14px 0 3px;
    padding: 0 20px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 34px;
    margin: 0 10px;
    padding: 0 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

    .nav-item:hover {
        background: #16212c;
        color: var(--text);
    }

    .nav-item.active {
        background: color-mix(in srgb, var(--blue) 16%, transparent);
        color: var(--text);
    }

.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
}

    .nav-icon svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Collapsed: icons only, section labels become spacing. */
.sidebar-collapsed .sidebar-section,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-logo {
    display: none;
}

.sidebar-collapsed .sidebar-logo-rail {
    display: block;
}

.sidebar-collapsed .sidebar-brand {
    height: 64px;
    padding: 0;
}

.sidebar-collapsed .nav-item {
    justify-content: center;
    margin: 0 8px;
    padding: 0;
}

.sidebar-collapsed .sidebar-section + .nav-item {
    margin-top: 14px;
}

/* min-width: 0 stops wide grids from forcing the shell wider than the viewport. */
.content-shell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.topbar-title {
    font-size: 14px;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    font-size: 13px;
}

.menu-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

    .menu-button:hover {
        border-color: var(--line);
        background: #1d2833;
        color: var(--text);
    }

.page-content {
    min-width: 0;
    padding: 18px;
}

@media (max-width: 900px) {
    .app-shell,
    .app-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }
}

/* ── Icons ──────────────────────────────────────────────────────────────── */

.icon {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Tinted disc behind a KPI icon. Set --icon-accent to recolour. */
.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--icon-accent, var(--blue));
    background: color-mix(in srgb, var(--icon-accent, var(--blue)) 16%, transparent);
}

    .icon-badge .icon {
        width: 22px;
        height: 22px;
    }

    .icon-badge.ok {
        --icon-accent: #34d399;
    }

    .icon-badge.info {
        --icon-accent: #60a5fa;
    }

    .icon-badge.stream {
        --icon-accent: #a78bfa;
    }

    .icon-badge.warn {
        --icon-accent: #fbbf24;
    }

    .icon-badge.danger {
        --icon-accent: #f87171;
    }

    /* Added for the group tiles, which had an orange of their own before they moved
       onto KpiCard. */
    .icon-badge.orange {
        --icon-accent: var(--orange);
    }

/* Icons beside a panel heading are quieter and smaller. The heading icon sits
   inside the h2, which is not otherwise a flex box. */
.panel-header .icon {
    width: 18px;
    height: 18px;
    color: var(--muted);
}

/* ── KPI card ───────────────────────────────────────────────────────────── */

.kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kpi-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kpi-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.kpi-value {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.1;
}

.kpi-caption {
    font-size: 12px;
    color: var(--muted);
}

/* ── Status dots ────────────────────────────────────────────────────────── */

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

    .status::before {
        content: "";
        flex: none;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: currentColor;
    }


    .status.ok {
        color: #34d399;
    }

    .status.live,
    .status.armed {
        color: #60a5fa;
    }

    .status.off,
    .status.idle {
        color: var(--muted);
    }

    /* Garment states. */
    .status.streaming,
    .status.ready {
        color: var(--green);
    }

    .status.powered,
    .status.warn {
        color: var(--yellow);
    }

    .status.inactive {
        color: var(--muted);
    }

    /* Alert severities. Yellow for medium rather than orange: --orange is #ff542b and
       --red is #ff2d2d, so High and Medium were all but the same colour in a list where
       telling them apart at a glance is the only reason the pill is coloured at all.
       Yellow is also what .status.warn, the meter rows and the arm panel already use for
       the middle of three. */
    .status.high,
    .status.danger {
        color: var(--red);
    }

    .status.medium {
        color: var(--yellow);
    }

    .status.info {
        color: var(--blue);
    }

/* ── Status pill ────────────────────────────────────────────────────────── */

/* Same geometry as the pills in .role-pills, tinted from the palette instead of the
   flat grey, so a state reads at a glance without a second element for the dot. */
.status-pill {
    display: inline-flex;
    align-items: center;
    /* The dot is the first flex item and has no baseline, so the pill would otherwise
       hang its bottom edge off the row's text baseline and ride high. */
    vertical-align: middle;
    gap: 6px;
    padding: 2px 9px 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    white-space: nowrap;
    --pill-color: var(--muted);
    color: var(--pill-color);
    background: color-mix(in srgb, var(--pill-color) 18%, transparent);
}

    .status-pill::before {
        content: "";
        flex: none;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

    .status-pill.ok {
        --pill-color: var(--green);
    }

    .status-pill.warn {
        --pill-color: var(--yellow);
    }

    .status-pill.danger {
        --pill-color: var(--red);
    }

    .status-pill.info {
        --pill-color: var(--blue);
    }

/* ── Battery ────────────────────────────────────────────────────────────── */

.battery-ok {
    color: #34d399;
}

.battery-low {
    color: #fbbf24;
}

.battery-critical {
    color: #f87171;
}

/* ── Health ─────────────────────────────────────────────────────────────── */

/* The same three colours as the battery column, and deliberately not the brighter
   lawngreen and yellow the old site used: health and battery sit side by side in the
   wearer list, so two scales reading high-is-good in different greens would look like
   two different kinds of measurement.

   Bands are set in HealthLevel.CssClass - above 50, above 10, then critical - and are
   the old site's. Colour only, no weight: a bolder figure in the middle of three numeric
   columns reads as a layout fault rather than as a warning. */
.health-ok {
    color: #34d399;
}

.health-low {
    color: #fbbf24;
}

.health-critical {
    color: #f87171;
}

.cell-muted {
    color: var(--muted);
}

/* ── Two-line grid cell ─────────────────────────────────────────────────── */

.cell-stack {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

    .cell-stack strong {
        font-weight: 600;
    }

/* ── Alerts and events list ─────────────────────────────────────────────── */

/* Mirrors the Syncfusion grid chrome, so a panel holding this list and a panel
   holding a grid read as siblings: same border, header strip, alternating rows
   and hover. */
.event-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.event-head,
.event-list li {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
}

.event-head {
    border-bottom: 1px solid var(--line);
    background: #101923;
    color: #dfe7ec;
    font-size: 12px;
    font-weight: 600;
}

.event-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .event-list li {
        border-bottom: 1px solid var(--line);
        font-size: 12px;
    }

        .event-list li:nth-child(even) {
            background: #0f1821;
        }

        .event-list li:hover {
            background: #15212b;
        }

        .event-list li:last-child {
            border-bottom: 0;
        }

.event-text {
    overflow-wrap: anywhere;
}

.event-time {
    text-align: right;
    white-space: nowrap;
}

/* =========================================================
   PROFILE CARD
   A person as a record: portrait, name, then labelled rows. Shared, because two pages
   show the same card - the user card, where the rows are editable, and the live
   monitor, where they are not. Everything is under .profile-card rather than loose in
   this file: .label and .value are names any page might reach for, and they should not
   mean this outside the card.

   The row components (UserProfileTextboxRow, UserProfileDropdownRow) still carry their
   own copies of these rules. Theirs win on source order, so they are untouched by this
   and could be deleted once someone checks them against it.
   ========================================================= */

.profile-card {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(145deg, var(--panel), var(--panel2));
}

.profile-heading {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 16px;
}

    .profile-heading h2 {
        margin: 0 0 6px;
        font-size: 22px;
        font-weight: 500;
    }

    .profile-heading p {
        margin: 0;
        color: var(--muted);
        font-size: 13px;
    }

/* The silhouette is the empty state, so a card with no picture still reads as a
   portrait rather than as a hole. */
.avatar-placeholder {
    width: 112px;
    height: 112px;
    border: 1px solid #41505c;
    border-radius: 8px;
    background: radial-gradient(circle at 50% 35%, #aeb5ba 0 18%, transparent 19%), radial-gradient(ellipse at 50% 82%, #aeb5ba 0 38%, transparent 39%), #30363b;
}

/* The picture without a drop target around it, for a reader who cannot change it.

   Opaque, and that matters: the placeholder under it is a silhouette drawn in CSS, so
   a picture with any transparency in it - a logo on a clear background, say - shows
   that silhouette through itself. The editable card never had the problem because its
   drop target sits between the two and paints over it. */
.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: #0d151d;
    object-fit: cover;
}

.profile-card .profile-section,
.profile-card .assignments {
    padding: 4px 16px;
    border-top: 1px solid rgba(255, 255, 255, .04);
}

/* Four columns, and the last one stays empty on a row with no button. That gutter is
   what keeps every value on the same left edge whether or not it can be edited. */
.profile-card .profile-row {
    display: grid;
    grid-template-columns: 18px 100px minmax(0, 1fr) 65px;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 5px 0;
}

.profile-card .assignments .profile-row {
    grid-template-columns: 18px 116px minmax(0, 1fr) 65px;
}

.profile-card .row-icon {
    color: var(--text);
    font-size: 14px;
    text-align: center;
}

.profile-card .label {
    color: var(--text);
    font-size: 12px;
    line-height: 1.3;
}

.profile-card .value {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.profile-card .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.profile-card .tag {
    padding: 3px 7px;
    border-radius: 4px;
    background: #3b4650;
    color: var(--text);
    font-size: 10px;
    line-height: 1.25;
}

    .profile-card .tag.accent {
        background: var(--blue);
        color: #fff;
    }

@media (max-width: 700px) {
    .profile-heading {
        grid-template-columns: 1fr;
    }
}
