: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;
    }
}

/* =========================================================
   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 {
        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 > * {
        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;
    }

.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;
    }

/* 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 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 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 {
    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);
    }

    .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;
    }
}
