/* ==========================================================================
   Admin area (adm-*)

   One visual language for every management page: the frame from AdminShell
   (tabs + heading), toolbars, tables, KPI tiles, forms and the dialogs those
   pages open. It lives in a stylesheet rather than in AdminShell's <style>
   because the terminology and withdraw forms also render inside MudBlazor
   dialogs, where AdminShell is not on the page.

   Classes are adm- prefixed for the same reason the top bar's are nv-
   prefixed - the site template defines plenty of generic names that would
   otherwise leak in. Colours come from the --sq-* tokens in theme.css.
   ========================================================================== */

.adm,
.adm-dialog {
    --adm-surface: rgba(255, 255, 255, .03);
    --adm-surface-2: rgba(255, 255, 255, .05);
    --adm-line: rgba(255, 255, 255, .07);
    --adm-frame: rgba(139, 92, 246, .22);
    --adm-head: #a78bfa;
    --adm-text: #e2e8f0;
    --adm-dim: #a79ee0;
    --adm-mute: #7d7aa0;
    --adm-radius: 16px;
    color: var(--adm-text);
}

.adm {
    padding-top: 96px;
    padding-bottom: 60px;
}

    .adm .container {
        max-width: 1320px;
    }

    .adm svg,
    .adm-dialog svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

/* The template styles bare elements page-wide: nav { height: 0 } (mobile),
   header { position: absolute; background }, section { padding: 120px 0 },
   h1 { font-size: 72px }, h3 { font-size: 26px }. The admin markup uses divs
   for its heading and cards, and these resets catch anything that slips. */
.adm nav,
.adm-dialog nav {
    height: auto;
}

.adm-head,
.adm-panel,
.adm-card {
    position: static;
    width: auto;
    padding: 0;
    background-image: none;
}

.adm h1,
.adm h3,
.adm-dialog h3 {
    letter-spacing: 0;
}

/* ---------- tabs ---------- */
.adm-tabs {
    height: auto;
    display: flex;
    gap: 4px;
    padding: 5px;
    margin-bottom: 28px;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: 999px;
    background: var(--sq-glass);
    border: 1px solid var(--sq-glass-border);
}

    .adm-tabs::-webkit-scrollbar {
        display: none;
    }

.adm-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--sq-text-dim);
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

    .adm-tab:hover {
        color: #fff;
        background: rgba(255, 255, 255, .07);
    }

    .adm-tab.adm-on {
        color: #fff;
        background: var(--sq-on-bg);
        border-color: var(--sq-on-border);
        box-shadow: none;
    }

/* ---------- heading ---------- */
.adm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--adm-line);
}

.adm-head-txt {
    min-width: 0;
}

.adm-head h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
}

.adm-head p {
    margin: 6px 0 0;
    font-size: .9rem;
    color: var(--adm-dim);
}

.adm-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- buttons ---------- */
.adm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid var(--sq-glass-border);
    background: var(--sq-glass);
    color: var(--sq-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, filter .2s ease;
}

    .adm-btn:hover {
        color: #fff;
        background: var(--sq-glass-hover);
        border-color: var(--sq-on-border);
    }

    .adm-btn:focus-visible {
        outline: 2px solid rgba(var(--sq-accent-rgb), .7);
        outline-offset: 2px;
    }

    .adm-btn:disabled,
    .adm-btn[disabled] {
        opacity: .55;
        cursor: not-allowed;
        pointer-events: none;
    }

.adm-btn-primary {
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
    background: var(--sq-accent-grad);
    box-shadow: var(--sq-accent-glow);
}

    .adm-btn-primary:hover {
        border-color: rgba(255, 255, 255, .16);
        background: var(--sq-accent-grad);
        box-shadow: var(--sq-accent-glow-hover);
        filter: brightness(1.06);
    }

.adm-btn-ok {
    border-color: rgba(255, 255, 255, .14);
    color: #fff;
    background: var(--sq-ok-grad);
}

    .adm-btn-ok:hover {
        border-color: rgba(255, 255, 255, .14);
        background: var(--sq-ok-grad);
        filter: brightness(1.08);
    }

.adm-btn-danger {
    color: var(--sq-danger-text);
    border-color: rgba(var(--sq-danger-rgb), .45);
    background: rgba(var(--sq-danger-rgb), .1);
}

    .adm-btn-danger:hover {
        color: #fff;
        border-color: rgba(255, 255, 255, .14);
        background: var(--sq-danger-grad);
    }

.adm-btn-sm {
    height: 30px;
    padding: 0 11px;
    font-size: 12px;
    border-radius: 8px;
}

/* Square icon-only button, e.g. the add / edit affordances beside a field. */
.adm-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid var(--sq-glass-border);
    background: var(--adm-surface-2);
    color: var(--adm-dim);
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

    .adm-icon-btn:hover {
        color: #fff;
        border-color: var(--sq-on-border);
        background: var(--sq-on-bg);
    }

    .adm-icon-btn svg {
        width: 14px;
        height: 14px;
    }

.adm-spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: adm-spin .7s linear infinite;
}

@keyframes adm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- toolbar (search / filters) ---------- */
.adm-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: var(--adm-radius);
    background: var(--adm-surface);
    border: 1px solid var(--adm-line);
}

.adm-toolbar-end {
    margin-inline-start: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.adm-search {
    position: relative;
    flex: 1 1 260px;
    min-width: 0;
}

    .adm-search svg {
        position: absolute;
        top: 50%;
        inset-inline-start: 12px;
        transform: translateY(-50%);
        color: var(--adm-mute);
        pointer-events: none;
    }

    .adm-search .adm-input {
        width: 100%;
        padding-inline-start: 36px;
    }

.adm-input,
.adm-select {
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font-size: 13.5px;
    outline: none;
    color-scheme: dark;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.adm-toolbar > .adm-input {
    flex: 1 1 240px;
    min-width: 0;
}

.adm-input::placeholder {
    color: var(--adm-mute);
}

.adm-input:focus,
.adm-select:focus {
    border-color: rgba(var(--sq-accent-rgb), .6);
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 0 0 3px rgba(var(--sq-accent-rgb), .12);
}

.adm-input[readonly] {
    background: rgba(255, 255, 255, .02);
    color: #cbd5e1;
    cursor: default;
}

textarea.adm-input {
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
    line-height: 1.7;
    resize: vertical;
}

.adm-select option {
    background: #16122a;
    color: #fff;
}

.adm-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cfc9f2;
    cursor: pointer;
    user-select: none;
}

    .adm-check input {
        accent-color: var(--sq-accent);
    }

/* Segmented filter (status and the like). */
.adm-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
}

    .adm-seg button {
        height: 30px;
        padding: 0 12px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: none;
        color: var(--sq-text-dim);
        font-size: 12.5px;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        transition: background .2s ease, color .2s ease, border-color .2s ease;
    }

        .adm-seg button:hover {
            color: #fff;
        }

        .adm-seg button.adm-on {
            color: #fff;
            background: var(--sq-on-bg);
            border-color: var(--sq-on-border);
        }

.adm-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--adm-mute);
}

    .adm-range .adm-input {
        width: 150px;
    }

/* ---------- states (loading / empty / error) ---------- */
.adm-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 56px 20px;
    text-align: center;
    color: var(--adm-mute);
    font-size: 14px;
    border-radius: var(--adm-radius);
    background: var(--adm-surface);
    border: 1px dashed rgba(255, 255, 255, .1);
}

    .adm-state svg {
        width: 34px;
        height: 34px;
        stroke-width: 1.4;
        color: var(--adm-dim);
        opacity: .7;
    }

    .adm-state .sqg-spinner {
        margin: 0;
    }

.adm-state-bad {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .06);
}

    .adm-state-bad svg {
        color: #fca5a5;
    }

/* ---------- KPI tiles ---------- */
.adm-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8f86c9;
}

    .adm-group-title::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--adm-line);
    }

    .adm-group-title:first-child {
        margin-top: 0;
    }

.adm-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.adm-kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border-radius: var(--adm-radius);
    background: var(--adm-surface);
    border: 1px solid var(--adm-line);
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

a.adm-kpi:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: var(--sq-on-border);
    background: var(--adm-surface-2);
}

a.adm-kpi::after {
    content: "";
    position: absolute;
    top: 18px;
    inset-inline-end: 16px;
    width: 7px;
    height: 7px;
    border-top: 1.6px solid var(--adm-mute);
    border-inline-start: 1.6px solid var(--adm-mute);
    transform: rotate(-45deg);
    opacity: .6;
    transition: opacity .2s ease;
}

[dir="rtl"] a.adm-kpi::after,
.righttoleft a.adm-kpi::after {
    transform: rotate(-45deg) scaleX(-1);
}

a.adm-kpi:hover::after {
    opacity: 1;
}

.adm-kpi-label {
    font-size: 12.5px;
    color: var(--adm-dim);
}

.adm-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.adm-kpi-sub {
    font-size: 11.5px;
    color: var(--adm-mute);
}

.adm-kpi-warn {
    border-color: rgba(245, 158, 11, .4);
    background: rgba(245, 158, 11, .07);
}

    .adm-kpi-warn .adm-kpi-value {
        color: #fbbf24;
    }

/* ---------- panels ---------- */
.adm-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.adm-panel,
.adm-card {
    border-radius: var(--adm-radius);
    background: var(--adm-surface);
    border: 1px solid var(--adm-frame);
    overflow: hidden;
    min-width: 0;
}

.adm-panel-head,
.adm-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--adm-line);
    background: rgba(139, 92, 246, .06);
}

    .adm-panel-head h3,
    .adm-card-head h3 {
        margin: 0;
        font-size: 14.5px;
        font-weight: 700;
        color: #fff;
    }

    .adm-card-head p {
        margin: 3px 0 0;
        font-size: 12px;
        color: var(--adm-mute);
    }

    .adm-panel-head a {
        font-size: 12.5px;
        color: #d3b8ff;
        text-decoration: none;
    }

        .adm-panel-head a:hover {
            color: #fff;
        }

.adm-card-body {
    padding: 18px;
}

.adm-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

    .adm-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 10px 18px;
        font-size: 13.5px;
    }

        .adm-list li + li {
            border-top: 1px solid rgba(255, 255, 255, .04);
        }

.adm-list-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .adm-list-main b {
        color: #fff;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .adm-list-main small {
        color: var(--adm-mute);
        font-size: 11.5px;
    }

.adm-list-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: end;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.adm-empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--adm-mute);
    font-size: 13px;
}

/* ---------- tables ---------- */
.adm-table-wrap {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, .45) transparent;
    border-radius: var(--adm-radius);
    background: var(--adm-surface);
    border: 1px solid var(--adm-frame);
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    color: var(--adm-text);
}

    .adm-table th {
        padding: 12px 14px;
        text-align: start;
        white-space: nowrap;
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--adm-head);
        background: rgba(139, 92, 246, .1);
        border-bottom: 1px solid rgba(139, 92, 246, .25);
    }

    .adm-table td {
        padding: 12px 14px;
        vertical-align: middle;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
    }

    .adm-table tbody tr:last-child td {
        border-bottom: none;
    }

    .adm-table tbody tr {
        transition: background .15s ease;
    }

        .adm-table tbody tr:hover {
            background: rgba(139, 92, 246, .07);
        }

/* Tables whose last column holds the row actions keep that column pinned to
   the end edge (the left in RTL), so the buttons stay in reach when a wide
   table scrolls sideways on a laptop-width window. Needs an opaque
   background, and a shadow on the side facing the scrolled content. */
.adm-table-sticky th:last-child,
.adm-table-sticky td:last-child {
    position: sticky;
    inset-inline-end: 0;
    z-index: 1;
    background: #150f29;
    box-shadow: -10px 0 14px -10px rgba(0, 0, 0, .7);
}

[dir="rtl"] .adm-table-sticky th:last-child,
[dir="rtl"] .adm-table-sticky td:last-child,
.righttoleft .adm-table-sticky th:last-child,
.righttoleft .adm-table-sticky td:last-child {
    box-shadow: 10px 0 14px -10px rgba(0, 0, 0, .7);
}

.adm-table-sticky th:last-child {
    background: #1b1336;
}

.adm-table-sticky tbody tr:hover td:last-child {
    background: #1c1535;
}

.adm-table-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.adm-count {
    font-size: 12.5px;
    color: var(--adm-mute);
}

.adm-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.adm-muted {
    color: var(--adm-mute);
    font-size: 12px;
}

.adm-strong {
    color: #fff;
    font-weight: 600;
}

.adm-nowrap {
    white-space: nowrap;
}

.adm-ellipsis {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adm-unit {
    margin-inline-start: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--adm-mute);
}

.adm-row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* ---------- chips ---------- */
.adm-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    background: rgba(255, 255, 255, .07);
    color: #cfc9f2;
}

    .adm-chip::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        opacity: .85;
    }

.adm-chip-plain::before {
    display: none;
}

.adm-chip-ok {
    background: rgba(34, 197, 94, .15);
    color: #6ee7a8;
}

.adm-chip-warn {
    background: rgba(245, 158, 11, .15);
    color: #fbbf24;
}

.adm-chip-bad {
    background: rgba(239, 68, 68, .15);
    color: #fca5a5;
}

.adm-chip-info {
    background: rgba(var(--secondary-color-rgb), .2);
    color: #dca6f5;
}

.adm-chip-admin {
    background: rgba(var(--tertiary-color-rgb), .2);
    color: #ff9ade;
}

.adm-bar {
    display: block;
    width: 64px;
    height: 4px;
    margin-top: 5px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
}

    .adm-bar i {
        display: block;
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    }

/* ---------- forms ---------- */
.adm-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.adm-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

    .adm-form-layout > aside {
        position: sticky;
        top: 96px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

.adm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.adm-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adm-wide {
    grid-column: 1 / -1;
}

.adm-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

    .adm-field .adm-input,
    .adm-field .adm-select {
        width: 100%;
    }

.adm-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #cfc9f2;
}

    .adm-label .adm-label-tools {
        order: 2;
        display: inline-flex;
        gap: 4px;
        margin-inline-start: auto;
    }

    .adm-label .adm-lang {
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .04em;
        padding: 1px 6px;
        border-radius: 5px;
        color: var(--adm-dim);
        background: rgba(255, 255, 255, .06);
    }

.adm-req::after {
    content: "*";
    margin-inline-start: -2px;
    color: var(--sq-accent);
}

.adm-hint {
    font-size: 11.5px;
    color: var(--adm-mute);
}

.adm-field .validation-message,
.adm-form .validation-errors {
    margin: 0;
    font-size: 12px;
    color: #fca5a5;
}

.adm-form .validation-errors {
    padding: 10px 14px 10px 30px;
    border-radius: 10px;
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .3);
}

.adm-field .invalid {
    border-color: rgba(239, 68, 68, .6);
}

.adm-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.adm-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .04);
    color: var(--adm-text);
}

    .adm-alert svg {
        margin-top: 2px;
    }

.adm-alert-ok {
    color: #a7f3d0;
    border-color: rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .08);
}

.adm-alert-bad {
    color: #fecaca;
    border-color: rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .08);
}

/* Key/value summary (withdraw detail, challenge summary). */
.adm-dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--adm-line);
}

    .adm-dl dt,
    .adm-dl dd {
        margin: 0;
        padding: 10px 14px;
        font-size: 13px;
        border-bottom: 1px solid var(--adm-line);
    }

    .adm-dl dt {
        font-weight: 600;
        color: var(--adm-dim);
        background: rgba(255, 255, 255, .025);
        white-space: nowrap;
    }

    .adm-dl dd {
        color: #fff;
        overflow-wrap: anywhere;
    }

        .adm-dl dt:nth-last-of-type(1),
        .adm-dl dd:last-child {
            border-bottom: none;
        }

.adm-image {
    display: flex;
    align-items: center;
    gap: 14px;
}

    .adm-image img {
        width: 96px;
        height: 96px;
        object-fit: cover;
        border-radius: 12px;
        border: 1px solid var(--adm-frame);
        flex-shrink: 0;
    }

/* InputFiles renders Bootstrap 4's .custom-file markup, which Bootstrap 5
   no longer styles - show the native input as a drop area instead. */
.adm-upload .custom-file {
    position: static;
    height: auto;
}

.adm-upload .custom-file-label {
    display: none;
}

.adm-upload input[type="file"] {
    position: static;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 14px;
    opacity: 1;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .025);
    color: var(--adm-mute);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

    .adm-upload input[type="file"]:hover {
        border-color: var(--sq-on-border);
        background: rgba(255, 255, 255, .04);
    }

    .adm-upload input[type="file"]::file-selector-button {
        margin-inline-end: 12px;
        height: 32px;
        padding: 0 12px;
        border-radius: 8px;
        border: 1px solid var(--sq-glass-border);
        background: var(--sq-glass);
        color: var(--sq-text);
        font: inherit;
        font-weight: 600;
        cursor: pointer;
    }

.adm-upload .text-info {
    margin-top: 6px;
    font-size: 12px;
    color: #fca5a5 !important;
}

.adm-form-layout aside .adm-btn-primary {
    width: 100%;
    height: 44px;
    font-size: 14px;
}

/* ---------- dialogs ---------- */
.adm-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #1c1236 0%, #140d28 100%);
    border: 1px solid rgba(139, 92, 246, .3);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.adm-dialog-sm {
    width: min(520px, calc(100vw - 32px));
}

.adm-dialog-head {
    padding: 18px 22px;
    padding-inline-end: 56px;
    border-bottom: 1px solid var(--adm-line);
    background: rgba(139, 92, 246, .08);
}

    .adm-dialog-head h3 {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 800;
        color: #fff;
    }

    .adm-dialog-head p {
        margin: 4px 0 0;
        font-size: 12.5px;
        color: var(--adm-mute);
    }

/* EditForm renders a <form> between the dialog and its body/footer. */
.adm-dialog-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin: 0;
}

.adm-dialog-body {
    padding: 20px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.adm-dialog-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--adm-line);
    background: rgba(0, 0, 0, .15);
}

/* ---------- pagination ---------- */
.adm .sqg-pagination-wrapper {
    margin-top: 16px !important;
}

/* ---------- season settings ---------- */
/* A disabled fieldset is what makes a published season read-only; strip the
   browser's default frame so it lays out like the plain form it replaces. */
.adm-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.adm-alert-warn {
    color: #fde68a;
    border-color: rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .08);
}

.adm-sticky {
    position: sticky;
    top: 96px;
}

.adm-kpis-sm {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

    .adm-kpis-sm .adm-kpi-value {
        font-size: 1.25rem;
    }

/* Timetable generator: first slot, slots per day, gap, tiebreak, button. */
.adm-gen {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 14px;
    padding: 14px;
    border-radius: 12px;
    background: var(--adm-surface);
    border: 1px dashed var(--adm-line);
}

    .adm-gen .adm-field {
        flex: 0 1 auto;
    }

        .adm-gen .adm-field .adm-input[type=number] {
            width: 90px;
        }

    .adm-gen .adm-check {
        height: 38px;
    }

/* Solar date: day, month, year, time on one line. Two classes deep so the
   widths beat ".adm-field .adm-select { width: 100% }". */
.adm-jdt {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .adm-jdt .adm-select {
        padding-inline: 8px;
    }

    .adm-jdt .adm-jdt-d {
        width: 64px;
    }

    .adm-jdt .adm-jdt-m {
        width: 110px;
    }

    .adm-jdt .adm-jdt-y {
        width: 84px;
    }

    .adm-jdt .adm-jdt-t {
        width: 104px;
    }

.adm-issues {
    list-style: none;
    margin: 0;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--adm-line);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
}

    .adm-issues li {
        position: relative;
        padding-inline-start: 16px;
    }

        .adm-issues li::before {
            content: "";
            position: absolute;
            inset-inline-start: 0;
            top: .55em;
            width: 7px;
            height: 7px;
            border-radius: 50%;
        }

.adm-issue-bad {
    color: #fecaca;
}

    .adm-issue-bad::before {
        background: #ef4444;
    }

.adm-issue-warn {
    color: #fde68a;
}

    .adm-issue-warn::before {
        background: #f59e0b;
    }

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
    .adm-table th,
    .adm-table td {
        padding-inline: 10px;
    }
}

@media (max-width: 991px) {
    .adm-form-layout {
        grid-template-columns: minmax(0, 1fr);
    }

        .adm-form-layout > aside {
            position: static;
        }

    .adm-sticky {
        position: static;
    }
}

@media (max-width: 767px) {
    .adm-grid,
    .adm-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .adm-toolbar-end {
        margin-inline-start: 0;
        width: 100%;
    }

    .adm-toolbar > .adm-btn {
        flex: 1;
    }

    .adm-range {
        width: 100%;
    }

        .adm-range .adm-input {
            flex: 1;
            width: auto;
            min-width: 0;
        }

    .adm-seg {
        width: 100%;
        overflow-x: auto;
    }

        .adm-seg button {
            flex: 1;
        }
}

@media (max-width: 680px) {
    .adm {
        padding-top: 84px;
    }

    .adm-head h1 {
        font-size: 1.3rem;
    }

    .adm-head-actions {
        width: 100%;
    }

        .adm-head-actions .adm-btn {
            flex: 1;
        }

    .adm-panels {
        grid-template-columns: 1fr;
    }

    .adm-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .adm-kpi-value {
        font-size: 1.25rem;
    }

    .adm-dl {
        grid-template-columns: minmax(0, 1fr);
    }

        .adm-dl dt {
            border-bottom: none;
            padding-bottom: 2px;
        }

        .adm-dl dd {
            padding-top: 2px;
        }
}

/* Admin activity alerts switch on the dashboard. */
.adm-alerts {
    margin-bottom: 22px;
}

.adm-alerts-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}

/* Control room (/admin/live) and room observer (/admin/rooms/{id}). */
.adm-live-stamp {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
}

.adm-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--adm-mute);
    vertical-align: middle;
    flex: none;
}

.adm-dot-on {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}

.adm-live-panels {
    grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr);
}

.adm-live-feed-head {
    flex-wrap: wrap;
}

.adm-live-search {
    padding: 10px 18px 0;
}

    .adm-live-search .adm-search {
        width: 100%;
    }

.adm-live-rooms a {
    margin-inline-start: 6px;
    color: #d3b8ff;
    text-decoration: none;
}

.adm-live-online,
.adm-feed {
    max-height: 620px;
    overflow-y: auto;
}

.adm-feed {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

    .adm-feed li {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 9px 18px;
        font-size: 13px;
        border-inline-start: 3px solid transparent;
    }

        .adm-feed li + li {
            border-top: 1px solid rgba(255, 255, 255, .04);
        }

    .adm-feed .adm-feed-rooms { border-inline-start-color: rgba(139, 92, 246, .55); }
    .adm-feed .adm-feed-duels { border-inline-start-color: rgba(245, 158, 11, .55); }
    .adm-feed .adm-feed-chat { border-inline-start-color: rgba(220, 166, 245, .45); }
    .adm-feed .adm-feed-money { border-inline-start-color: rgba(34, 197, 94, .55); }
    .adm-feed .adm-feed-signups { border-inline-start-color: rgba(255, 90, 158, .6); }

.adm-feed-time {
    flex: none;
    min-width: 62px;
    color: var(--adm-mute);
    font-size: 12px;
    direction: ltr;
}

.adm-feed-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.adm-feed-text {
    color: var(--adm-text);
    overflow-wrap: anywhere;
}

.adm-feed-room {
    font-size: 11.5px;
    color: #d3b8ff;
    text-decoration: none;
}

    .adm-feed-room:hover {
        color: #fff;
    }

.adm-feed-amount {
    flex: none;
    font-weight: 700;
    white-space: nowrap;
}

.adm-pos {
    color: #6ee7a8;
}

.adm-neg {
    color: #fca5a5;
}

.adm-feed-deleted .adm-feed-text {
    color: var(--adm-mute);
    text-decoration: line-through;
}

@media (max-width: 991px) {
    .adm-live-panels {
        grid-template-columns: minmax(0, 1fr);
    }
}
