/* ============================================================
   Last War Alliance Manager — Design System
   Dark, tactical, post-apocalyptic.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
    /* Palette */
    --bg-deep: #07090d;
    --bg-base: #0d1118;
    --bg-raised: #141923;
    --bg-elevated: #1a2030;
    --bg-hover: #232a3d;
    --bg-active: #2a3247;

    --border: rgba(255, 235, 200, 0.07);
    --border-strong: rgba(255, 235, 200, 0.14);
    --border-bright: rgba(255, 235, 200, 0.24);

    --text-1: #ecedf2;
    --text-2: #a9b1c2;
    --text-3: #6b7488;
    --text-4: #4a5267;

    --accent: #ff8a3d;
    --accent-hover: #ff9b56;
    --accent-bg: rgba(255, 138, 61, 0.12);
    --accent-bg-strong: rgba(255, 138, 61, 0.22);
    --accent-border: rgba(255, 138, 61, 0.35);

    --info: #60a5fa;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.12);
    --success-bg: rgba(52, 211, 153, 0.12);

    --gold: #fbbf24;
    --silver: #cbd5e1;
    --bronze: #f59e0b;

    --rank-r5: #fcd34d;
    --rank-r4: #fb923c;
    --rank-r3: #c4b5fd;
    --rank-r2: #94a3b8;
    --rank-r1: #64748b;

    /* Sizing */
    --sidebar-w: 240px;
    --topbar-h: 60px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.02), 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-2: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 0 1px var(--accent-border), 0 8px 32px rgba(255, 138, 61, 0.15);

    /* Type */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-1);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(255, 138, 61, 0.06), transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(96, 165, 250, 0.04), transparent 50%);
    background-attachment: fixed;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 4px);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--accent); color: #000; padding: 8px 16px;
    z-index: 999;
}
.skip-link:focus { top: 0; }

/* ============================================================
   App shell
   ============================================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--bg-base), var(--bg-deep));
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--border);
}
.brand-mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    color: var(--accent);
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: 9px;
    box-shadow: inset 0 0 24px rgba(255, 138, 61, 0.15);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { flex: 1; min-width: 0; }
.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 14px;
}
.brand-sub {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.sidebar-close {
    display: none;
    background: none; border: none;
    color: var(--text-2);
    font-size: 26px;
    cursor: pointer;
    padding: 0 6px;
}

.nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-4);
    font-weight: 600;
    padding: 14px 10px 6px;
}
.nav-section:first-child { padding-top: 4px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.18s var(--ease-out);
    border: 1px solid transparent;
    position: relative;
}
.nav-item:hover {
    background: var(--bg-raised);
    color: var(--text-1);
}
.nav-item.active {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent-border);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}
.nav-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 10px 12px;
    display: flex;
    gap: 6px;
    align-items: center;
}
.user-chip {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    min-width: 0;
}
.user-chip:hover { background: var(--bg-raised); }
.user-chip.active { background: var(--bg-raised); border-color: var(--border-strong); }
.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #c84a14);
    color: #1a0a02;
    display: grid; place-items: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name {
    font-size: 13px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
    font-size: 10.5px; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.logout-btn {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 8px;
    color: var(--text-3);
    transition: all 0.18s var(--ease-out);
}
.logout-btn:hover { background: var(--bg-raised); color: var(--danger); }
.logout-btn svg { width: 16px; height: 16px; }

.content-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    background: rgba(13, 17, 24, 0.7);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.menu-btn {
    display: none;
    background: none; border: none;
    color: var(--text-1);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.menu-btn svg { width: 22px; height: 22px; }
.topbar-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.01em;
    flex: 1;
    color: var(--text-1);
}
.env-pill {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid rgba(52, 211, 153, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.env-pill::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite ease-in-out;
}
@keyframes pulse {
    50% { opacity: 0.5; }
}

.main {
    padding: 28px 32px 60px;
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   Page headers
   ============================================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.page-title-block { min-width: 0; }
.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.eyebrow::before {
    content: '';
    width: 18px; height: 1px;
    background: var(--accent);
}
.page-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
    line-height: 1.1;
}
.page-subtitle {
    color: var(--text-2);
    font-size: 14.5px;
    margin: 0;
    max-width: 60ch;
}
.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-1);
    position: relative;
}
.card-pad-lg { padding: 28px 30px; }
.card-flush { padding: 0; }
.card-flush > .card-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.card-flush > .card-body { padding: 8px 0; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}
.card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.005em;
}
.card-sub { color: var(--text-3); font-size: 12.5px; }

.grid {
    display: grid;
    gap: 18px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Stat tiles */
.stat {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    background: radial-gradient(circle at top right, var(--accent-bg), transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    font-weight: 600;
    margin-bottom: 8px;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    line-height: 1;
}
.stat-meta {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-3);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s var(--ease-out);
    border: 1px solid var(--border-strong);
    background: var(--bg-raised);
    color: var(--text-1);
    white-space: nowrap;
}
.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-bright);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(180deg, var(--accent) 0%, #e57427 100%);
    color: #14060a;
    border-color: transparent;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 4px 14px rgba(255, 138, 61, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(180deg, var(--accent-hover) 0%, #ed7e2e 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 18px rgba(255, 138, 61, 0.45);
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-raised); color: var(--text-1); }

.btn-danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.25); }
.btn-danger:hover { background: var(--danger-bg); border-color: rgba(248, 113, 113, 0.5); color: var(--danger); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-icon { padding: 8px; border-radius: 7px; }
.btn-icon svg { width: 16px; height: 16px; }

.btn svg { width: 15px; height: 15px; }

/* ============================================================
   Inputs
   ============================================================ */

.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; gap: 14px; }
.field-row.cols-2 { grid-template-columns: 1fr 1fr; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

label {
    font-size: 12px;
    color: var(--text-2);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.input, .select, .textarea {
    background: var(--bg-base);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 10px 13px;
    color: var(--text-1);
    font-size: 14px;
    transition: all 0.16s var(--ease-out);
    width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-bg);
    background: var(--bg-raised);
}
.input::placeholder { color: var(--text-4); }
.textarea {
    min-height: 90px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}
.select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23a9b1c2' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.checkbox-row {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    color: var(--text-2);
    font-size: 13.5px;
    padding: 4px 0;
}
.checkbox-row input[type=checkbox] {
    appearance: none;
    width: 17px; height: 17px;
    border-radius: 5px;
    background: var(--bg-base);
    border: 1px solid var(--border-strong);
    cursor: pointer;
    position: relative;
    transition: all 0.16s;
}
.checkbox-row input[type=checkbox]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.checkbox-row input[type=checkbox]:checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 2px;
    width: 5px; height: 9px;
    border: 2px solid #14060a;
    border-top: 0; border-left: 0;
    transform: rotate(45deg);
}

.search-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7488' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 38px;
}

/* ============================================================
   Tables
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-raised);
}
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.data th, table.data td {
    text-align: left;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    font-weight: 600;
    background: var(--bg-base);
    position: sticky; top: 0;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--bg-elevated); }
table.data td.num { font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions .btn { margin-left: 4px; }

.empty {
    padding: 50px 24px;
    text-align: center;
    color: var(--text-3);
}
.empty-title {
    font-size: 16px; color: var(--text-2); margin-bottom: 4px;
    font-weight: 600;
}

/* ============================================================
   Badges & rank pills
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid var(--border-strong);
    background: var(--bg-base);
    color: var(--text-2);
}
.badge-accent { color: var(--accent); border-color: var(--accent-border); background: var(--accent-bg); }
.badge-success { color: var(--success); border-color: rgba(52,211,153,0.3); background: var(--success-bg); }
.badge-danger { color: var(--danger); border-color: rgba(248,113,113,0.3); background: var(--danger-bg); }
.badge-muted { color: var(--text-3); }

.rank {
    display: inline-flex;
    width: 30px;
    height: 22px;
    align-items: center; justify-content: center;
    border-radius: 5px;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.rank-R5 { color: #1a0d00; background: var(--rank-r5); }
.rank-R4 { color: #1a0a00; background: var(--rank-r4); }
.rank-R3 { color: #14091a; background: var(--rank-r3); }
.rank-R2 { color: var(--text-1); background: var(--rank-r2); }
.rank-R1 { color: var(--text-1); background: var(--rank-r1); }

.place {
    display: inline-grid; place-items: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border-strong);
}
.place-1 { background: linear-gradient(180deg, var(--gold), #c8980d); color: #1a0d00; border-color: transparent; box-shadow: 0 4px 12px rgba(251,191,36,0.25); }
.place-2 { background: linear-gradient(180deg, var(--silver), #94a3b8); color: #14181f; border-color: transparent; }
.place-3 { background: linear-gradient(180deg, var(--bronze), #b45309); color: #1a0d00; border-color: transparent; }

/* ============================================================
   Modals
   ============================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 13, 0.7);
    backdrop-filter: blur(4px);
    display: grid; place-items: center;
    padding: 24px;
    z-index: 100;
    animation: fadeIn 0.18s var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow: auto;
    box-shadow: var(--shadow-2);
    animation: slideUp 0.22s var(--ease-out);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
.modal-lg { max-width: 720px; }
.modal-header {
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}
.modal-close {
    background: none; border: none;
    color: var(--text-3);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-close:hover { color: var(--text-1); }
.modal-body { padding: 18px 24px; }
.modal-footer {
    padding: 14px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   Toasts
   ============================================================ */

.toast-host {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--info);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-2);
    font-size: 13.5px;
    color: var(--text-1);
    max-width: 360px;
    pointer-events: auto;
    animation: slideInRight 0.2s var(--ease-out);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } }

/* ============================================================
   Login
   ============================================================ */

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}
.auth-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 30% 20%, rgba(255, 138, 61, 0.10), transparent 40%),
        radial-gradient(circle at 70% 80%, rgba(96, 165, 250, 0.06), transparent 40%);
    z-index: -1;
}
.auth-card {
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: 38px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-2);
    position: relative;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.auth-brand .brand-mark { width: 44px; height: 44px; }
.auth-brand .brand-mark svg { width: 26px; height: 26px; }
.auth-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}
.auth-sub {
    color: var(--text-3);
    font-size: 13.5px;
    margin: 0 0 26px;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { padding: 12px 16px; justify-content: center; font-size: 14px; }
.auth-hint {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-3);
}
.auth-hint code {
    background: var(--bg-base);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: var(--accent);
}
.auth-error {
    background: var(--danger-bg);
    border: 1px solid rgba(248,113,113,0.3);
    border-radius: 8px;
    padding: 9px 14px;
    color: var(--danger);
    font-size: 13px;
    display: none;
}
.auth-error.visible { display: block; }

.auth-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-card-wide { max-width: 480px; }

.member-pick {
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-base);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 4px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.member-pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-2);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    width: 100%;
    transition: all 0.14s;
}
.member-pick-row:hover { background: var(--bg-raised); color: var(--text-1); }
.member-pick-row.active {
    background: var(--accent-bg);
    border-color: var(--accent-border);
    color: var(--accent);
}
.member-pick-name { flex: 1; font-weight: 500; }

/* ============================================================
   Train schedule
   ============================================================ */

.week-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.week-nav-btn {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 7px;
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.16s;
}
.week-nav-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.week-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    padding: 0 8px;
}

.train-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}
.train-day {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    transition: all 0.18s var(--ease-out);
}
.train-day:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.train-day.today {
    border-color: var(--accent-border);
    background: linear-gradient(180deg, rgba(255,138,61,0.05), var(--bg-raised));
}
.train-day-date {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.train-day-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.train-day-num {
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.train-slot {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 9px 11px;
    cursor: pointer;
    transition: all 0.16s;
}
.train-slot:hover { border-color: var(--accent-border); }
.train-slot-role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 2px;
}
.train-slot-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-1);
}
.train-slot-empty { color: var(--text-4); font-style: italic; font-size: 12.5px; }
.train-day-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: 11px;
    color: var(--text-3);
}

/* ============================================================
   Awards
   ============================================================ */

.awards-week {
    display: grid;
    gap: 12px;
}
.award-row {
    display: grid;
    grid-template-columns: 200px repeat(3, 1fr);
    gap: 10px;
    align-items: center;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}
.award-row-type {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
}
.award-cell {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.16s;
    min-height: 44px;
}
.award-cell:hover { border-color: var(--accent-border); }
.award-cell .place { width: 22px; height: 22px; font-size: 10px; }
.award-cell-name { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.award-cell-empty { color: var(--text-4); font-style: italic; font-size: 12.5px; }

/* ============================================================
   Rankings
   ============================================================ */

.podium {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
    align-items: end;
}
.podium-spot {
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.podium-spot.first {
    background: linear-gradient(180deg, rgba(251,191,36,0.10), var(--bg-raised));
    border-color: rgba(251,191,36,0.35);
}
.podium-spot.first::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at center top, rgba(251,191,36,0.18), transparent 60%);
    pointer-events: none;
}
.podium-spot.second {
    background: linear-gradient(180deg, rgba(203,213,225,0.08), var(--bg-raised));
}
.podium-spot.third {
    background: linear-gradient(180deg, rgba(245,158,11,0.08), var(--bg-raised));
}
.podium-spot .place { width: 36px; height: 36px; font-size: 14px; margin: 0 auto 12px; }
.podium-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}
.podium-score {
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
}

/* ============================================================
   Desert Storm
   ============================================================ */

.team-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    background: var(--bg-base);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: fit-content;
}
.team-tab {
    background: none;
    border: 1px solid transparent;
    color: var(--text-2);
    padding: 9px 18px 9px 12px;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.18s;
}
.team-tab:hover { color: var(--text-1); }
.team-tab.active {
    background: var(--bg-raised);
    color: var(--text-1);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-1);
}
.team-tab-letter {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 6px;
    background: var(--accent-bg);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    border: 1px solid var(--accent-border);
}
.team-tab:not(.active) .team-tab-letter {
    background: var(--bg-raised);
    color: var(--text-3);
    border-color: var(--border-strong);
}
.team-tab-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13.5px;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,138,61,0.08), var(--bg-raised));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.team-header-left { display: flex; gap: 16px; align-items: center; min-width: 0; }
.team-badge {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #c84a14);
    color: #14060a;
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 26px;
    box-shadow: 0 6px 20px rgba(255,138,61,0.25);
}
.team-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.005em;
}
.team-meta {
    color: var(--text-2);
    font-size: 13px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.storm-stage { margin-bottom: 28px; }
.storm-stage-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.storm-stage-num {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: var(--accent-bg);
    color: var(--accent);
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    border: 1px solid var(--accent-border);
    flex-shrink: 0;
}
.storm-stage-title h2 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.storm-stage1 {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr) minmax(0, 280px);
    gap: 16px;
    align-items: start;
}
.storm-stage2 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.role-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
}
.role-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.role-card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-1);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.role-card-list { display: flex; flex-direction: column; gap: 5px; }

.slot-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13px;
    transition: all 0.14s;
}
.slot-row:hover { border-color: var(--accent-border); }
.slot-row.slot-row-empty {
    border-style: dashed;
    color: var(--text-4);
    font-style: italic;
}
.slot-row.slot-row-empty:hover { color: var(--accent); border-color: var(--accent-border); border-style: solid; }
.slot-name {
    font-weight: 500;
    color: var(--text-1);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.slot-row.slot-row-empty .slot-row-empty-text { flex: 1; }
.slot-power {
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.slot-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    font-weight: 600;
    min-width: 56px;
    flex-shrink: 0;
}
.slot-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: transparent;
    border: 1px dashed var(--border-strong);
    border-radius: 7px;
    color: var(--text-3);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.16s;
}
.slot-add:hover { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent); }

.hospitals-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.hospital-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}
.hospital-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(248,113,113,0.08), transparent 60%);
    pointer-events: none;
}
.hospital-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.hospital-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--danger);
}

.sub-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px minmax(0, 2fr);
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
    transition: background 0.14s;
}
.sub-row:hover { background: var(--bg-elevated); }
.sub-row:last-child { border-bottom: 0; }
.sub-name { display: flex; align-items: center; }
.sub-arrow {
    color: var(--text-4);
    text-align: center;
    font-size: 14px;
}
.sub-covers { display: flex; flex-wrap: wrap; gap: 6px; }
.covers-chip { background: var(--bg-base); }

/* ============================================================
   Rankings charts
   ============================================================ */

.charts-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}
.charts-grid .chart-power { grid-row: span 2; }
.charts-grid .chart-vs { grid-column: 1; }
.charts-grid .chart-squads { grid-column: 2; grid-row: 2; }

.chart-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.chart-head {
    padding: 18px 22px 12px;
    border-bottom: 1px solid var(--border);
}
.chart-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px;
    letter-spacing: 0.005em;
}
.chart-sub {
    font-size: 12px;
    color: var(--text-3);
}
.chart-body {
    padding: 14px 22px 18px;
    flex: 1;
    overflow: auto;
}
.chart-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
    font-style: italic;
}

/* Horizontal bars (used by Power / VS / Squads) */
.h-bars {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.h-bar {
    display: grid;
    grid-template-columns: 34px minmax(0, 110px) 1fr 60px;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
}
.h-bar-rank { display: flex; }
.h-bar-name {
    color: var(--text-1);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.h-bar-track {
    height: 14px;
    background: var(--bg-base);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    position: relative;
}
.h-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #ff6b1a 100%);
    border-radius: 4px;
    transition: width 0.4s var(--ease-out);
    box-shadow: 0 0 12px rgba(255, 138, 61, 0.25);
}
.h-bar-val {
    text-align: right;
    color: var(--text-2);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

/* VS multi-segment bars */
.vs-stack { gap: 1px; padding: 0; }
.vs-seg { display: block; height: 100%; opacity: 0.95; }
.vs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-3);
}
.vs-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.vs-dot {
    width: 10px; height: 10px;
    border-radius: 3px;
    display: inline-block;
}

/* Squad stacked bars */
.sq-stack { gap: 2px; }
.sq-seg { display: block; height: 100%; border-radius: 2px; }

/* Donut chart */
.donut-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}
.donut-svg {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}
.donut-svg .donut-total {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    fill: var(--text-1);
}
.donut-svg .donut-sub {
    font-size: 10px;
    fill: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.donut-legend {
    display: grid;
    gap: 8px;
    min-width: 90px;
}
.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-2);
}
.donut-dot {
    width: 12px; height: 12px;
    border-radius: 4px;
    display: inline-block;
    flex-shrink: 0;
}

/* Breakdown modal squad viz */
.breakdown-squads {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}
.breakdown-squad {
    display: grid;
    grid-template-columns: 28px 1fr 50px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.breakdown-squad-label {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-3);
    font-size: 11px;
}
.breakdown-squad-bar {
    height: 10px;
    background: var(--bg-base);
    border-radius: 3px;
    overflow: hidden;
}
.breakdown-squad-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s var(--ease-out);
}
.breakdown-squad-value {
    text-align: right;
    color: var(--text-2);
    font-weight: 500;
}

/* ============================================================
   Squad pills (members table)
   ============================================================ */

.squad-input-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.squad-input-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.squad-input-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
}
.squad-input {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.self-edit-banner {
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-1);
}

.row-self td {
    background: linear-gradient(90deg, var(--accent-bg) 0%, transparent 100%) !important;
    position: relative;
}
.row-self td:first-child::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
}

.squad-readout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.squad-readout-cell {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}
.squad-readout-label {
    font-family: var(--font-display);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    margin-bottom: 4px;
    font-weight: 600;
}
.squad-readout-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
}

@media (max-width: 540px) {
    .squad-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .squad-input-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.squad-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.squad-pill {
    --p: 0.6;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, var(--accent) calc(var(--p) * 50%), var(--bg-base));
    color: var(--text-1);
    border: 1px solid color-mix(in srgb, var(--accent) calc(var(--p) * 40%), var(--border));
    min-width: 38px;
    text-align: center;
}

/* ============================================================
   Tooltip & misc
   ============================================================ */

.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-base);
    padding: 4px;
    border-radius: 9px;
    border: 1px solid var(--border);
    width: fit-content;
    margin-bottom: 22px;
}
.tab-btn {
    background: none;
    border: none;
    color: var(--text-2);
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}
.tab-btn:hover { color: var(--text-1); }
.tab-btn.active { background: var(--bg-raised); color: var(--text-1); box-shadow: var(--shadow-1); }

.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }

.message-box {
    background: var(--bg-base);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 16px 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-2);
    white-space: pre-wrap;
    line-height: 1.6;
}

.kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--bg-base);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--text-2);
}

/* ============================================================
   Responsive
   ============================================================ */

.scrim {
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 13, 0.6);
    z-index: 40;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.18s;
}

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .train-grid { grid-template-columns: repeat(4, 1fr); }
    .train-grid > .train-day:nth-child(n+5) { /* keep */ }
}

@media (max-width: 1200px) {
    .storm-stage1 { grid-template-columns: 1fr; }
    .storm-stage2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .charts-grid .chart-power,
    .charts-grid .chart-vs,
    .charts-grid .chart-squads,
    .charts-grid .chart-ranks { grid-column: auto; grid-row: auto; }
}

@media (max-width: 880px) {
    .storm-stage2 { grid-template-columns: 1fr; }
    .hospitals-grid { grid-template-columns: 1fr; }
    .sub-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 18px; }
    .sub-arrow { display: none; }
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.24s var(--ease);
        width: 280px;
        box-shadow: var(--shadow-2);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .menu-btn { display: grid; place-items: center; }
    .main { padding: 22px 18px 50px; }
    .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
    .train-grid { grid-template-columns: repeat(2, 1fr); }
    .award-row { grid-template-columns: 1fr; gap: 8px; }
    .award-row-type { padding-bottom: 4px; border-bottom: 1px solid var(--border); }
    .podium { grid-template-columns: 1fr; gap: 10px; }
    .field-row.cols-2, .field-row.cols-3 { grid-template-columns: 1fr; }
    .page-header { align-items: flex-start; }
    .topbar { padding: 0 16px; }
}

@media (max-width: 540px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .train-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 24px; }
    .h-bar { grid-template-columns: 28px minmax(0, 80px) 1fr 50px; gap: 6px; }
    .chart-body { padding: 12px 16px 16px; }
    .donut-wrap { flex-direction: column; }
}

/* ============================================================
   Utility
   ============================================================ */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }
.no-shrink { flex-shrink: 0; }
.hidden { display: none !important; }
