/* Agency Admin Web (Beta) — Designsprache Agency-Housing */

@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 300 900; font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 300 900; font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --accent-rgb:      226, 182, 73;
    --accent-deep-rgb: 168, 128, 31;
    --accent-ink-rgb:  23, 18, 10;

    --accent:      rgb(var(--accent-rgb));
    --accent-deep: rgb(var(--accent-deep-rgb));
    --accent-ink:  rgb(var(--accent-ink-rgb));
    --accent-dim:  rgba(var(--accent-rgb), 0.32);
    --green:       #35d6a6;
    --error:       #ff4949;
    --warn:        #f0a33a;

    --page:        #141417;
    --bg-dark:     rgba(28, 28, 33, 0.98);
    --surface-1:   #1c1c21;
    --surface-2:   #26262c;
    --surface-3:   #303039;
    --border:      rgba(242, 243, 245, 0.07);
    --border-top:  rgba(242, 243, 245, 0.12);

    --lift-1: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 6px rgba(0, 0, 0, 0.28);
    --lift-2: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 6px 18px rgba(0, 0, 0, 0.34);
    --lift-3: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 70px rgba(0, 0, 0, 0.58);
    --well:   inset 0 2px 5px rgba(0, 0, 0, 0.36);

    --ring:   0 0 0 2px var(--accent);
    --text:   #f4f5f7;
    --text-2: #c9ced6;
    --muted:  #9aa2ae;

    --radius: 18px;
    --sidebar: 252px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, sans-serif; }
html { color-scheme: dark; }
body {
    background: var(--page);
    background-image: radial-gradient(1200px 600px at 12% -10%, rgba(var(--accent-rgb), 0.07), transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(var(--accent-rgb), 0.35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.35); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: none; box-shadow: var(--ring); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

@keyframes panelEnter { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shimmerSweep {
    0%, 68% { transform: translateX(-140%) skewX(-20deg); opacity: 0; }
    76% { opacity: 1; }
    100% { transform: translateX(240%) skewX(-20deg); opacity: 0; }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.sm { width: 13px; height: 13px; border-width: 2px; flex: none; }
.btn.busy:disabled { opacity: 1; cursor: progress; color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Buttons, inputs, chips ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border: none; border-radius: 999px;
    background: var(--surface-3); color: var(--text);
    box-shadow: var(--lift-1);
    font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap;
    transition: transform .18s, box-shadow .25s, background .25s, opacity .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); background: #383842; }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, rgb(236, 196, 96), var(--accent-deep)); }
.btn-primary:disabled { background: var(--surface-3); color: var(--muted); }
.btn-danger { background: rgba(255, 73, 73, 0.14); color: #ff8a8a; }
.btn-danger:hover:not(:disabled) { background: rgba(255, 73, 73, 0.24); }
.btn-danger.solid { background: linear-gradient(180deg, #ff5d5d, #c93030); color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); }
.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn svg, .nav-item svg, .icon { width: 16px; height: 16px; flex: none; }

.input, .select, .textarea {
    width: 100%; padding: 11px 18px;
    background-color: rgba(0, 0, 0, 0.26);
    border: 1px solid transparent; border-radius: 999px;
    color: var(--text); font-size: 13px; outline: none;
    box-shadow: var(--well);
    transition: box-shadow .2s, background .2s, border-color .2s;
}
/* Fixed size on purpose: a draggable corner stretched every tile in the row. */
.textarea { border-radius: 18px; resize: none; height: 110px; min-height: 0; line-height: 1.5; }
.select { appearance: none; padding-right: 38px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa2ae' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; }
.select option { background: var(--surface-2); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.75; }
.input:focus, .select:focus, .textarea:focus { background-color: rgba(0, 0, 0, 0.34); border-color: var(--accent); box-shadow: var(--ring), var(--well); }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: none; border-radius: 999px;
    background: var(--surface-2); color: var(--text-2);
    box-shadow: var(--lift-1); font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: background .2s, color .2s, transform .18s;
}
.chip:hover { background: var(--surface-3); }
.chip:disabled { opacity: 0.4; cursor: default; }
.chip:disabled:hover { background: var(--surface-2); }
.chip.active { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: var(--accent-ink); }
.chip .count { opacity: 0.7; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    background: var(--surface-3); color: var(--text-2);
}
.badge.gold { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: var(--accent-ink); }
.badge.green { background: rgba(53, 214, 166, 0.14); color: var(--green); }
.badge.red { background: rgba(255, 73, 73, 0.14); color: #ff8a8a; }
.badge.warn { background: rgba(240, 163, 58, 0.14); color: var(--warn); }
.badge.muted { background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.green { background: var(--green); box-shadow: 0 0 0 3px rgba(53, 214, 166, 0.16); }
.dot.red { background: var(--error); box-shadow: 0 0 0 3px rgba(255, 73, 73, 0.16); }
.dot.warn { background: var(--warn); }
.dot.live { animation: pulse 2s infinite; }

/* ── Panels ─────────────────────────────────────────────────────────────── */
.panel {
    background: var(--bg-dark); border: none; border-radius: var(--radius);
    box-shadow: var(--lift-2); padding: 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.panel-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), 0.25); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.login-card {
    width: 100%; max-width: 460px; padding: 34px 32px 28px;
    background: var(--bg-dark); border-radius: 26px; box-shadow: var(--lift-3);
    animation: panelEnter .24s ease-out; position: relative; overflow: hidden;
}
.login-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.07), transparent);
    animation: shimmerSweep 7s ease-in-out infinite; pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: var(--lift-1); }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-sub { color: var(--muted); font-size: 12px; font-weight: 600; }
.login-card h1 { font-size: 22px; letter-spacing: -.02em; margin: 26px 0 6px; }
.login-card p.lead { color: var(--text-2); margin-bottom: 22px; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 18px; }
.code-boxes input {
    width: 100%; min-width: 0;
    height: 56px; text-align: center; font-size: 22px; font-weight: 750; padding: 0;
    background: rgba(0, 0, 0, 0.3); border: 1px solid transparent; border-radius: 16px;
    box-shadow: var(--well); outline: none; caret-color: var(--accent);
    transition: box-shadow .2s, border-color .2s;
}
.code-boxes input:focus { border-color: var(--accent); box-shadow: var(--ring), var(--well); }
.login-steps { list-style: none; counter-reset: s; margin: 22px 0 4px; display: grid; gap: 10px; }
.login-steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: 13px; }
.login-steps li::before {
    content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center; font-size: 11.5px; font-weight: 800;
    background: rgba(var(--accent-rgb), 0.14); color: var(--accent);
}
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.form-error { color: #ff8a8a; font-size: 13px; min-height: 18px; margin: -6px 0 12px; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 20px 14px; display: flex; flex-direction: column; gap: 18px;
    background: rgba(20, 20, 24, 0.9); box-shadow: 1px 0 0 var(--border);
}
.sidebar .brand { padding: 4px 8px; }
.sidebar .brand-name { font-size: 15.5px; white-space: nowrap; }
.sidebar .brand img { width: 38px; height: 38px; }
.brand-sub-beta { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.badge.beta-mini { padding: 2px 7px; font-size: 9.5px; letter-spacing: .08em; line-height: 1.3; }
.server-switch {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border: none; border-radius: 16px; cursor: pointer; text-align: left;
    background: var(--surface-2); box-shadow: var(--lift-1); transition: background .2s;
}
.server-switch:hover { background: var(--surface-3); }
.server-switch.is-static { cursor: default; }
.server-switch.is-static:hover { background: var(--surface-2); }
.server-switch.is-static > .icon { display: none; }
.server-switch .name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-switch .sub { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.nav { display: flex; flex-direction: column; gap: 3px; position: relative; user-select: none; }
.nav-label { font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; opacity: .8; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 14px; border-radius: 999px; border: none; background: none;
    color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
    transition: background .2s, color .2s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); text-decoration: none; }
.nav-item.active { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: var(--accent-ink); box-shadow: var(--lift-1); }
.nav-item .badge { margin-left: auto; }
.nav-item.active .badge { background: rgba(var(--accent-ink-rgb), 0.18); color: var(--accent-ink); }
.nav-item, .nav-label { position: relative; z-index: 1; }
.nav-item { -webkit-user-drag: none; }

/* Gliding pill (same motion as the Agency Admin panel in game) */
.nav-glider {
    position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 0;
    border-radius: 999px; pointer-events: none; opacity: 0; will-change: transform;
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 6px 16px rgba(0, 0, 0, 0.38);
    transition:
        transform 0.42s cubic-bezier(0.32, 1.32, 0.32, 1),
        width 0.42s cubic-bezier(0.32, 1.32, 0.32, 1),
        height 0.42s cubic-bezier(0.32, 1.32, 0.32, 1),
        opacity 0.2s ease;
}
.nav-glider.is-ready { opacity: 1; }
.nav-glider.no-transition { transition: none !important; }
.nav.has-glider .nav-item.active,
.nav.has-glider .nav-item.active:hover { background: transparent; box-shadow: none; color: var(--text-2); }
.nav.has-glider .nav-item.active .badge { background: var(--surface-3); color: var(--text-2); }
.nav.has-glider .nav-item.glider-target,
.nav.has-glider .nav-item.glider-target:hover,
.nav.has-glider .nav-item.glider-target:focus-visible { background: transparent; box-shadow: none; color: var(--accent-ink); }
.nav.has-glider .nav-item.glider-target .badge { background: rgba(var(--accent-ink-rgb), 0.18); color: var(--accent-ink); }
.nav.is-dragging .nav-item:hover { background: transparent; }
.nav.is-dragging, .nav.is-dragging .nav-item { cursor: grabbing; }
.nav-item:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .nav-glider { transition: opacity 0.2s ease; } }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.beta-card { padding: 14px; border-radius: 16px; background: rgba(var(--accent-rgb), 0.08); font-size: 12px; color: var(--text-2); }
.beta-card strong { color: var(--accent); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px; padding: 14px 28px;
    background: rgba(20, 20, 23, 0.94); box-shadow: 0 1px 0 var(--border);
}
.topbar h2 { font-size: 18px; letter-spacing: -.02em; }
.topbar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; border-radius: 999px; background: var(--surface-2); box-shadow: var(--lift-1); }
.me .who { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.me .where { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-weight: 800; font-size: 13px;
    background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.35), rgba(var(--accent-deep-rgb), 0.2)); color: var(--accent);
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.menu-btn { display: none; }
.content { padding: 26px 28px 60px; width: 100%; max-width: 1400px; animation: swapIn .22s ease-out; }
.banner {
    display: flex; align-items: center; gap: 10px; margin: 12px 28px 0; padding: 9px 14px;
    border-radius: 12px; font-size: 12.5px; line-height: 1.4;
    background: rgba(240, 163, 58, 0.1); color: #ffd19a;
}
.banner.red { background: rgba(255, 73, 73, 0.1); color: #ff9b9b; }
.banner .icon { width: 15px; height: 15px; }

/* Small inline notice, e.g. the missing command permission in the console */
.hint {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 10px; padding: 7px 12px;
    border-radius: 12px; font-size: 12px; line-height: 1.4;
    background: rgba(255, 73, 73, 0.1); color: #ff9b9b;
}
.hint .icon { width: 14px; height: 14px; }
.hint code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 11.5px; color: #ffc4c4; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.28); }
.hint-copy { display: inline-grid; place-items: center; width: 24px; height: 24px; border: none; border-radius: 999px; background: none; color: inherit; cursor: pointer; }
.hint-copy:hover { background: rgba(255, 73, 73, 0.16); }
.hint-copy .icon { width: 13px; height: 13px; }
.hint.info { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); margin-bottom: 14px; }
.modal.picker { max-width: 560px; }
.modal.add-server { max-width: 440px; }
.modal.add-server .login-steps { margin-top: 18px; }
.pick-list { max-height: min(420px, 55vh); overflow-y: auto; padding: 2px; }
.modal.picker .toolbar .input { max-width: none; flex: 1; min-width: 160px; }
.hint-link { border: none; background: none; color: inherit; font-weight: 700; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.hint-link:hover { color: #ffc4c4; }

/* Setup guide */
.modal.guide { max-width: 640px; }
.guide-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; border-radius: 16px; background: var(--surface-2); box-shadow: var(--lift-1); }
.guide-steps { margin: 0 0 8px; gap: 14px; }
.guide-steps li { font-size: 13.5px; line-height: 1.5; min-width: 0; }
.guide-steps { grid-template-columns: minmax(0, 1fr); }   /* long code lines must scroll, not widen the list */
.code-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 6px 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); box-shadow: var(--well); }
.code-line code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; color: var(--accent); }
.guide-notes { display: grid; gap: 8px; }
.guide-note { padding: 12px 16px; border-radius: 14px; background: var(--surface-2); }
.guide-note-title { font-size: 12px; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.guide-note p { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
/* Tiles keep their own height instead of stretching to the tallest one. */
.grid.grid-top { align-items: start; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 132px; }
.kpi-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 650; }
.kpi-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.kpi-value small { font-size: 14px; color: var(--muted); font-weight: 650; letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: var(--muted); margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); box-shadow: var(--well); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width .6s ease; }
.meter.warn > span { background: linear-gradient(90deg, #b8741c, var(--warn)); }
.meter.red > span { background: linear-gradient(90deg, #a52525, var(--error)); }
.meter.na { background: repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 6px, transparent 6px 12px); }

.hero {
    display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 16px; flex-wrap: wrap;
    background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.12), rgba(28, 28, 33, 0.98) 55%);
}
.hero-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Charts */
.chart-box { position: relative; }
.chart-plot { position: relative; height: 180px; margin-left: 40px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-yaxis { position: absolute; left: -40px; top: 0; bottom: 0; width: 34px; }
.chart-yaxis span { position: absolute; right: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-xaxis { display: flex; justify-content: space-between; margin: 8px 0 0 40px; font-size: 11px; color: var(--muted); }
.chart-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.28); pointer-events: none; }
.chart-marker { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface-1); transform: translate(-50%, -50%); pointer-events: none; }
.chart-tip {
    position: absolute; top: -8px; transform: translate(-50%, -100%); pointer-events: none; z-index: 3;
    padding: 8px 12px; border-radius: 12px; background: var(--surface-3); box-shadow: var(--lift-3);
    font-size: 12px; white-space: nowrap;
}
.chart-tip b { font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-hit { position: absolute; inset: -8px 0; cursor: crosshair; }
.chart-table { margin-top: 12px; }
.chart-table summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-table td, .chart-table th { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--border); }

/* ── Lists / rows ───────────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { max-width: 320px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.row {
    display: grid; align-items: center; gap: 14px;
    padding: 11px 16px; border-radius: 16px;
    background: var(--surface-2); box-shadow: var(--lift-1);
    transition: background .15s, transform .15s;
}
.row.click { cursor: pointer; }
.row.click:hover { background: var(--surface-3); }
.row .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-head { display: grid; gap: 14px; padding: 0 16px 6px; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.players-grid { grid-template-columns: 56px minmax(0, 1fr) 90px 110px 40px; }
.res-grid { grid-template-columns: 108px minmax(0, 1.4fr) minmax(0, 0.8fr) 176px; }
.bans-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 150px auto; }
.audit-grid { grid-template-columns: 150px 190px 190px minmax(0, 1fr); }
.idtag { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent); }
.ping { font-variant-numeric: tabular-nums; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Resource folders (like txAdmin) */
.res-group { border-radius: 18px; background: var(--bg-dark); box-shadow: var(--lift-1); overflow: hidden; }
.res-group + .res-group { margin-top: 8px; }
.res-group-head {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px;
    border: none; background: none; color: var(--text); cursor: pointer; text-align: left;
    font-size: 13.5px; font-weight: 700; border-radius: 18px;
}
.res-group-head:hover { background: rgba(255, 255, 255, 0.03); }
.res-group-head .chev { color: var(--muted); transition: transform .2s; }
.res-group.open .res-group-head .chev { transform: rotate(90deg); }
.res-group-head .icon:not(.chev) { color: var(--accent); }
.res-group-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-group-body { padding: 0 8px 8px; }

/* Console */
.console {
    height: calc(100vh - 290px); min-height: 360px; overflow-y: auto;
    padding: 16px 18px; border-radius: 18px;
    background: #0d0d10; box-shadow: var(--well);
    font-family: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; line-height: 1.6;
}
.console .line { white-space: pre-wrap; word-break: break-word; color: #c8ccd3; }
.console .line .ts { color: #5f6570; margin-right: 10px; }
.console .line.cmd { color: var(--accent); font-weight: 600; }
.console .line.warn { color: var(--warn); }
.console .line.error { color: #ff7b7b; }
.console-input { position: relative; display: flex; gap: 10px; margin-top: 12px; }
.console-input .input { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; padding-left: 36px; }
.console-input .prompt { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 800; pointer-events: none; }
.suggest {
    position: absolute; left: 0; bottom: calc(100% + 8px); width: min(460px, 100%); max-height: 260px; overflow-y: auto; z-index: 5;
    padding: 6px; border-radius: 16px; background: var(--surface-2); box-shadow: var(--lift-3);
}
.suggest button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 12px; border: none; background: none; border-radius: 999px; cursor: pointer; text-align: left; font-size: 12.5px; }
.suggest button.active, .suggest button:hover { background: rgba(var(--accent-rgb), 0.14); }
.suggest button span:last-child { color: var(--muted); font-size: 11.5px; }

/* Live view */
.live-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #0b0b0d; box-shadow: var(--well); }
.live-stage:fullscreen { border-radius: 0; aspect-ratio: auto; }
.live-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.live-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.live-badge {
    position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px; border-radius: 999px; background: rgba(12, 12, 14, 0.78); box-shadow: var(--lift-1);
    font-size: 11px; font-weight: 800; letter-spacing: .08em;
}
.live-badge.paused .dot { background: var(--muted); box-shadow: none; animation: none; }
.live-mode { font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: 2px; }
.live-mode:empty { display: none; }
video.live-img { background: #0b0b0d; }

/* Rank cards */
.rank-perms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rank-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* ── Modal / popup window ───────────────────────────────────────────────── */
.modal-layer {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
    background: rgba(8, 8, 10, 0.62); animation: swapIn .18s ease-out;
}
.modal {
    width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto;
    background: var(--surface-1); border-radius: 24px; box-shadow: var(--lift-3);
    padding: 24px; animation: panelEnter .22s ease-out;
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > label, .field-label { font-size: 12px; font-weight: 700; color: var(--text-2); padding-left: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.info-cell { padding: 10px 14px; border-radius: 14px; background: var(--surface-2); box-shadow: var(--lift-1); min-width: 0; }
.info-cell .k { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.info-cell .v { font-weight: 700; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.section-title { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 20px 0 10px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.action-grid .btn { justify-content: flex-start; }
.id-list { display: grid; gap: 6px; }
.id-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.id-row .k { width: 70px; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.id-row .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn-item { padding: 10px 14px; border-radius: 14px; background: rgba(240, 163, 58, 0.08); font-size: 13px; }
.warn-item .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.segmented { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(0,0,0,0.26); box-shadow: var(--well); gap: 4px; }
.segmented button { padding: 7px 14px; border: none; background: none; border-radius: 999px; font-size: 12.5px; font-weight: 650; cursor: pointer; color: var(--text-2); }
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: var(--lift-1); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
    display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 16px;
    background: var(--surface-2); box-shadow: var(--lift-3); font-size: 13px; animation: panelEnter .2s ease-out;
}
.toast .bar { width: 4px; align-self: stretch; border-radius: 999px; background: var(--accent); flex: none; }
.toast.error .bar { background: var(--error); }
.toast.success .bar { background: var(--green); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar); z-index: 60;
        transform: translateX(-105%); transition: transform .24s ease; background: #16161a; box-shadow: var(--lift-3);
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 12px 16px; }
    .content { padding: 18px 16px 48px; }
    .banner { margin: 12px 16px 0; }
    .grid.two { grid-template-columns: 1fr; }
    .me .who, .me .where { display: none; }
    .me { padding: 4px; }
}
@media (max-width: 640px) {
    .players-grid { grid-template-columns: 44px minmax(0, 1fr) 70px 36px; }
    .players-grid .hide-sm, .res-grid .hide-sm, .bans-grid .hide-sm, .audit-grid .hide-sm { display: none; }
    .res-grid { grid-template-columns: minmax(0, 1fr) auto; }
    .res-grid .row-actions { min-width: 0; }
    .bans-grid { grid-template-columns: minmax(0, 1fr) auto; }
    .audit-grid { grid-template-columns: 1fr; gap: 2px; }
    .row-head { display: none; }
    .field-row { grid-template-columns: 1fr; }
    .code-boxes input { height: 48px; font-size: 19px; }
    .login-card { padding: 26px 20px 22px; }
    .topbar h2 { font-size: 16px; }
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .toolbar .input { max-width: none; }
    .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 14px; min-height: 0; }
    .kpi-value { font-size: 21px; }
    .kpi-top span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .modal { padding: 18px; }
}

/* ── Restart & stop ─────────────────────────────────────────────────────── */
.banner.warn .grow { flex: 1; min-width: 0; }
.banner.warn b { font-variant-numeric: tabular-nums; color: #ffe2b8; }
.banner .btn-sm { padding: 5px 12px; }
.power-pending { display: flex; align-items: center; gap: 18px; padding: 14px 18px; margin-bottom: 14px; border-radius: 18px; background: var(--surface-2); box-shadow: var(--lift-1); }
.power-pending .name { font-weight: 750; }
.power-pending .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.power-count { font-size: 34px; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--accent); min-width: 110px; }
.hint-note { font-size: 12px; color: var(--muted); line-height: 1.45; }
.power-layer { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(8, 8, 10, 0.78); animation: swapIn .2s ease-out; }
.power-card { width: 100%; max-width: 420px; padding: 34px 28px; border-radius: 24px; text-align: center; background: var(--surface-1); box-shadow: var(--lift-3); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.power-card h2 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.power-card p { font-size: 13px; line-height: 1.5; }
.power-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 999px; background: rgba(255, 73, 73, 0.14); color: #ff8a8a; }
.power-icon .icon { width: 22px; height: 22px; }
.spinner.lg { width: 42px; height: 42px; border-width: 3px; }

/* ── File manager ───────────────────────────────────────────────────────── */
.fm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fm-head .spacer { flex: 1; }
.fm-search { max-width: 240px; }
.fm-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 7px; max-width: 260px; padding: 6px 11px; border: none; border-radius: 999px; background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb:hover { background: var(--surface-2); color: var(--text); }
.crumb.current { background: var(--surface-2); color: var(--text); box-shadow: var(--lift-1); cursor: default; }
.crumb .icon { width: 14px; height: 14px; color: var(--accent); }
.crumb-sep { color: var(--muted); opacity: .6; padding: 0 2px; }
.fm-grid { grid-template-columns: 30px minmax(0, 1fr) 96px 150px 84px; padding-top: 8px; padding-bottom: 8px; }
.fm-grid .name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.fm-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); color: var(--text-2); }
.fm-ico.dir { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.fm-ico .icon { width: 15px; height: 15px; }
.fm-size { text-align: right; font-variant-numeric: tabular-nums; }
.fm-tag { font-size: 10px; padding: 1px 7px; }
.fm-lock { display: inline-grid; color: var(--muted); }
.fm-lock .icon { width: 13px; height: 13px; }
.fm-up .name { color: var(--muted); }
.fm-grid .row-actions { opacity: .55; transition: opacity .15s; }
.fm-grid:hover .row-actions, .fm-grid:focus-within .row-actions { opacity: 1; }
.fm-del:hover:not(:disabled) { color: #ff8a8a; background: rgba(255, 73, 73, 0.12); }
.fm-nope { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.icon.big { width: 34px; height: 34px; color: var(--muted); margin-bottom: 6px; }

/* ── Editor ─────────────────────────────────────────────────────────────── */
.fm-editor { display: flex; flex-direction: column; gap: 12px; }
.fm-edbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-edbar .spacer { flex: 1; }
.fm-edtitle { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fm-edtitle .name { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-edtitle .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.fm-meta { gap: 8px; }
.dirty-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16); flex: none; }
.fm-edfoot { font-size: 11.5px; color: var(--muted); padding: 0 6px; font-variant-numeric: tabular-nums; }
.ed {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    height: max(360px, calc(100vh - 250px));
    border-radius: 16px; overflow: hidden;
    background: rgba(0, 0, 0, 0.3); box-shadow: var(--well);
    font: 13px/1.6 ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
}
.ed * { font-family: inherit; }   /* the global Inter rule would win inside */
.ed pre, .ed textarea { font: inherit; tab-size: 4; -moz-tab-size: 4; }
.ed-gutter { margin: 0; padding: 14px 12px 14px 16px; min-width: 52px; text-align: right; color: #565c67; background: rgba(0, 0, 0, 0.16); overflow: hidden; user-select: none; }
.ed-main { position: relative; min-width: 0; }
.ed-hl, .ed-ta { position: absolute; inset: 0; margin: 0; padding: 14px 18px; white-space: pre; overflow: auto; border: none; }
.ed-hl { color: #d6d9df; pointer-events: none; overflow: hidden; }
.ed-ta { width: 100%; height: 100%; resize: none; outline: none; background: transparent; color: transparent; caret-color: var(--accent); }
.ed-ta::selection { background: rgba(var(--accent-rgb), 0.3); }
.ed.plain .ed-hl { display: none; }
.ed.plain .ed-ta { color: #d6d9df; }
.ed:focus-within { box-shadow: var(--well), 0 0 0 2px rgba(var(--accent-rgb), 0.55); }
.tk-c { color: #6f7785; font-style: italic; }
.tk-s { color: #a8d8a0; }
.tk-n { color: #f0a33a; }
.tk-k { color: var(--accent); font-weight: 600; }
.tk-b { color: #82c4ff; }
.modal.name-dialog { max-width: 440px; }
@media (max-width: 640px) {
    .fm-grid { grid-template-columns: 30px minmax(0, 1fr) 84px; }
    .fm-grid .hide-sm { display: none; }
    .fm-grid .row-actions { opacity: 1; }
    .fm-search { max-width: none; flex: 1 1 100%; }
    .fm-head .spacer { display: none; }
    .power-pending { flex-direction: column; align-items: flex-start; gap: 6px; }
    .ed { height: max(320px, calc(100vh - 220px)); font-size: 12px; }
}
/* ── HTTPS guide ────────────────────────────────────────────────────────── */
.banner .grow { flex: 1; min-width: 0; }
.code-block { position: relative; margin-top: 8px; border-radius: 16px; background: rgba(0, 0, 0, 0.3); box-shadow: var(--well); }
.code-block pre { margin: 0; padding: 12px 96px 12px 16px; overflow-x: auto; font: 12.5px/1.6 ui-monospace, 'Cascadia Code', Consolas, monospace; color: var(--accent); white-space: pre; }
.code-block .btn { position: absolute; top: 8px; right: 8px; }
