/* ============================================================
   HYPERAC Panel styles
   ============================================================ */

:root {
    --bg: #0b0d12;
    --bg-2: #12151f;
    --bg-3: #1a1f2c;
    --border: #262c3d;
    --border-soft: #1d2232;
    --text: #e6e9f2;
    --text-dim: #8b92a7;
    --text-soft: #b8bdcc;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-hover: #5458d8;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --orange: #f97316;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.55);
    --radius: 10px;
    --radius-lg: 14px;
}

body {
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(99,102,241,0.08), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(139,92,246,0.06), transparent 55%),
        var(--bg);
    background-attachment: fixed;
}

/* Global SVG icon normalizer — keeps inline SVG icons baseline-aligned
   inside buttons, labels and chips, and lets them inherit currentColor. */
.ic-svg {
    display: inline-block;
    vertical-align: -2px;
    flex-shrink: 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---- Auth / Login ------------------------------------------------------- */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 0%, #1b2030 0%, #0d0f14 55%);
    padding: 20px;
}

.auth-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
    text-align: center;
}

.auth-brand { margin-bottom: 28px; }
.auth-logo {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 22px; color: white;
    margin: 0 auto 14px;
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.35);
}
.auth-logo-img {
    display: block;
    width: 72px; height: 72px;
    object-fit: contain;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(88,101,242,0.18), rgba(139,92,246,0.18));
    padding: 8px;
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.28), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.auth-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.auth-brand p { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.btn-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.15s;
}
.btn-discord:hover { background: var(--accent-hover); }

.auth-hint {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-dim);
}

/* ---- Layout ------------------------------------------------------------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    flex-shrink: 0;
}

.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 8px 20px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}
.brand-logo {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; font-size: 14px;
}
.brand-logo-img {
    width: 40px; height: 40px;
    object-fit: contain;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(88,101,242,0.18), rgba(139,92,246,0.18));
    padding: 4px;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25), inset 0 0 0 1px rgba(255,255,255,0.04);
    flex-shrink: 0;
}
.brand-title { font-weight: 700; font-size: 15px; }
.brand-sub { color: var(--text-dim); font-size: 11px; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--bg-3); color: var(--text); }
.nav-ic {
    width: 18px; text-align: center;
    font-size: 14px; color: var(--text-dim);
}
.nav-item.active .nav-ic { color: var(--accent); }

.user-box {
    display: flex; align-items: center; gap: 10px;
    padding: 10px;
    background: var(--bg-3);
    border-radius: 10px;
    margin-top: 16px;
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
}
.user-avatar.placeholder {
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: white; font-weight: 700;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text-dim); text-transform: capitalize; }
.btn-icon {
    width: 30px; height: 30px;
    border-radius: 7px;
    color: var(--text-dim);
    font-size: 16px;
    transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { background: var(--bg-2); color: var(--text); }

.main {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    min-width: 0;
}

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    animation: fade-in-up 0.32s ease-out both;
}
#page-root > *:not(.page-header) {
    animation: fade-in-up 0.36s ease-out both;
    animation-delay: 60ms;
}
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; }

/* ---- Buttons ------------------------------------------------------------ */

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.12s;
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn:hover:not(:disabled) { background: var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--accent); border-color: var(--accent); color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ---- Cards -------------------------------------------------------------- */

.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 18px; }

/* ---- Dashboard stats ---------------------------------------------------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-label {
    color: var(--text-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}
.stat-hint { font-size: 12px; color: var(--text-dim); }

.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-pill.on { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.status-pill.off { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.status-pill::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

.server-banner {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 20px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.server-banner-icon {
    width: 58px; height: 58px; border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: white; font-weight: 700;
    flex-shrink: 0;
}
.server-banner-name { font-size: 17px; font-weight: 700; }
.server-banner-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---- Config page -------------------------------------------------------- */

.config-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, var(--bg) 70%, rgba(13,15,20,0));
    padding: 4px 0 8px;
    z-index: 5;
}
.cfg-search { margin-bottom: 0; }

.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.section-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    transition: all 0.12s;
}
.section-tab:hover { color: var(--text); border-color: var(--border); }
.section-tab.active {
    color: white;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}
.section-tab .tab-ic { font-size: 13px; opacity: 0.9; }

.config-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 90px;
}

.config-card {
    padding: 0;
    transition: border-color 0.15s;
}
.config-card:hover { border-color: var(--border); }

.config-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(to right, var(--bg-3), var(--bg-2));
}
.config-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(88,101,242,0.22), rgba(139,92,246,0.22));
    border: 1px solid rgba(88,101,242,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #c7cdff;
    flex-shrink: 0;
}
.config-card-head > div:nth-child(2) { flex: 1; min-width: 0; }
.config-card-title { font-size: 15px; font-weight: 700; }
.config-card-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.config-card-count {
    font-size: 11px;
    color: var(--text-dim);
    padding: 4px 10px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: var(--bg-3);
}
.config-card-count span { color: var(--text); font-weight: 700; }

.kv-group {
    border-bottom: 1px solid var(--border-soft);
}
.kv-group:last-child { border-bottom: none; }
.kv-group-title {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    color: var(--text-dim);
    background: rgba(255,255,255,0.015);
}

.kv-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.kv-list-compact {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.kv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    min-height: 48px;
    transition: background 0.1s;
}
.kv-row-full {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(88, 101, 242, 0.025);
}
.kv-row-full .kv-label { align-self: flex-start; }
.kv-row-full .kv-control { width: 100%; }
.kv-badge-list { background: rgba(88,101,242,0.18); color: #c7cdff; }
.kv-row:hover { background: rgba(88, 101, 242, 0.04); }
.kv-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-soft);
    word-break: break-word;
    display: flex; align-items: center; gap: 8px;
}
.kv-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
}
.kv-control { flex-shrink: 0; }
.cfg-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    width: 180px;
    text-align: right;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.cfg-input-wide { width: 240px; }
.cfg-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,101,242,0.18);
}

/* toggle switch */
.toggle {
    position: relative;
    width: 40px; height: 22px;
    background: var(--bg-3);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    border: 1px solid var(--border);
}
.toggle::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--text-soft);
    border-radius: 50%;
    transition: left 0.18s, background 0.18s;
}
.toggle:hover { border-color: var(--text-dim); }
.toggle.on {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,101,242,0.12);
}
.toggle.on::after { left: 20px; background: white; }

.config-sticky-bar {
    position: fixed;
    bottom: 18px;
    left: calc(240px + 40px);
    right: 40px;
    padding: 12px 18px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    z-index: 10;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.config-sticky-bar.has-changes {
    border-color: rgba(234, 179, 8, 0.55);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(234, 179, 8, 0.08);
}
.sticky-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sticky-right { display: flex; gap: 8px; flex-shrink: 0; }
.config-sticky-bar .changes {
    font-size: 13px; color: var(--text-dim);
    font-weight: 500;
}
.config-sticky-bar .changes strong { color: var(--yellow); }
.sticky-hint {
    font-size: 11px;
    color: var(--text-dim);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 420px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
}

.spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn .ic { font-size: 13px; line-height: 1; }

/* ---- Bans page ---------------------------------------------------------- */

.search-bar {
    display: flex; align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
    gap: 8px;
}
.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.table-wrap {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.data thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--bg-3);
    border-bottom: 1px solid var(--border);
}
table.data tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td.mono { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; color: var(--text-soft); }
td.reason { max-width: 320px; }

.empty {
    padding: 40px 20px; text-align: center; color: var(--text-dim);
    font-size: 14px;
}

.loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

.error-banner {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* ---- Toasts ------------------------------------------------------------- */

#toast-stack {
    position: fixed;
    bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 1000;
}
.toast {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left-width: 3px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    min-width: 260px;
    max-width: 360px;
    box-shadow: var(--shadow);
    animation: toast-in 0.2s ease-out;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.info { border-left-color: var(--accent); }

@keyframes toast-in {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---- Modal -------------------------------------------------------------- */

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(4, 6, 12, 0.68);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
    padding: 20px;
    animation: overlay-in 0.18s ease-out both;
}
.modal-overlay.modal-fade { opacity: 0; transition: opacity 0.18s ease-out; }
.modal-overlay.modal-fade.shown { opacity: 1; }

@keyframes overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.modal-lg { max-width: 860px; }
.modal h3 { margin-bottom: 8px; font-size: 16px; }
.modal p { color: var(--text-soft); font-size: 13px; margin-bottom: 16px; }
.modal-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}

@keyframes modal-in {
    from { transform: translateY(14px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { font-size: 18px; margin-bottom: 2px; }
.modal-eyebrow {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.modal-sub { font-size: 12px; color: var(--text-dim); }
.modal-body { font-size: 13px; }

/* Ban detail modal specifics */
.ban-detail-modal { display: flex; flex-direction: column; max-height: 90vh; }
.ban-detail-modal .modal-body { overflow-y: auto; flex: 1; }
.ban-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 20px;
}
@media (max-width: 820px) {
    .ban-detail-grid { grid-template-columns: 1fr; }
}
.ban-detail-screenshot { min-width: 0; }
.ban-screenshot-frame {
    display: block;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.ban-screenshot-frame:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.25);
}
.ban-screenshot-frame img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 440px;
    object-fit: contain;
    background: #000;
}
.ban-screenshot-hint {
    position: absolute;
    bottom: 8px; right: 8px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 9px;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 11px;
    border-radius: 999px;
    opacity: 0;
    transition: opacity 0.18s;
}
.ban-screenshot-frame:hover .ban-screenshot-hint { opacity: 1; }
.ban-screenshot-empty {
    padding: 36px 16px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.015);
    text-align: center;
    color: var(--text-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.ban-screenshot-empty code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-soft);
}

.ban-detail-meta { min-width: 0; }
.kv-def {
    display: grid;
    grid-template-columns: 110px 1fr;
    column-gap: 14px;
    row-gap: 8px;
    margin-bottom: 16px;
}
.kv-def dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-dim);
    align-self: center;
}
.kv-def dd { font-size: 13px; color: var(--text); word-break: break-word; }
.kv-def-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    margin: 14px 0 8px;
}
.ban-details-pre {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 12px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: var(--text-soft);
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---- Misc --------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    background: var(--bg-3);
    color: var(--text-soft);
}
.badge.perm { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.badge.temp { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.badge.evidence {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}
.badge.none {
    background: var(--bg-3);
    color: var(--text-dim);
    font-style: italic;
}

/* ---- Global animations ------------------------------------------------- */

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    animation: fade-in-up 0.32s ease-out both;
}

/* Buttons get a subtle lift on hover */
.btn:not(:disabled) {
    transform: translateY(0);
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }
.btn-primary:not(:disabled):hover {
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.32);
}

/* Nav items get the accent bar on active + smoother transition */
.nav-item {
    position: relative;
}
.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.18s;
}
.nav-item.active::before { background: var(--accent); }

/* Ban row hover lift */
table.data tbody tr.ban-row {
    cursor: pointer;
    transition: background 0.12s;
}
table.data tbody tr.ban-row:hover {
    background: rgba(88, 101, 242, 0.06);
}
.row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Stat cards: subtle gradient top-border shine */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}
.stat-card:hover {
    border-color: var(--border);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}
.stat-card:hover::before { opacity: 0.9; }

/* Player cards subtle translate on hover */
.player-card {
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

/* Section tabs: smoother active transition */
.section-tab {
    transition: all 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* Spinner refinement (already present) — keep */

/* Toast exit animation refinement handled in JS */

/* Login card: gentle entrance */
.auth-card {
    animation: fade-in-up 0.45s ease-out both;
}
.auth-logo-img {
    animation: logo-pulse 3.5s ease-in-out infinite;
}
@keyframes logo-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(88, 101, 242, 0.22), inset 0 0 0 1px rgba(255,255,255,0.04); }
    50%      { box-shadow: 0 14px 34px rgba(88, 101, 242, 0.40), inset 0 0 0 1px rgba(255,255,255,0.06); }
}

/* Table hover divider sheen */
.table-wrap { transition: border-color 0.18s; }
.table-wrap:hover { border-color: var(--border); }

/* Better focus ring on inputs */
.cfg-input:focus,
.cfg-list-input:focus,
.search-bar input:focus,
.search-bar:focus-within {
    outline: none;
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.14);
}

/* Icon in buttons — consistent alignment */
.btn .ic-svg { vertical-align: -2px; }

/* ---- Permission Groups editor ------------------------------------------ */

.pg-editor { padding: 16px 20px 20px; }
.pg-editor .kv-group-title {
    padding: 0 0 10px;
    background: transparent;
}
.pg-meta {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: rgba(88, 101, 242, 0.05);
    border: 1px solid rgba(88, 101, 242, 0.14);
    border-radius: 8px;
}
.pg-meta code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    padding: 1px 6px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    color: var(--text-soft);
}

.pg-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.pg-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-dim);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.015);
}
.pg-empty strong { color: var(--text); }

.pg-row {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pg-row:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(88, 101, 242, 0.12); }

.pg-row-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(to right, var(--bg-3), var(--bg-2));
    border-bottom: 1px solid var(--border-soft);
}
.pg-index {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 700;
    padding: 3px 8px;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.pg-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.12s, box-shadow 0.12s;
    min-width: 0;
}
.pg-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}
.pg-input:disabled { opacity: 0.55; cursor: not-allowed; }

.pg-job { flex: 1; min-width: 140px; font-weight: 600; }
.pg-grade-wrap, .pg-action-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.pg-grade { width: 70px; font-family: 'SF Mono', Menlo, Consolas, monospace; text-align: right; }
.pg-action { width: 160px; font-size: 12px; cursor: pointer; }
.pg-action option { background: var(--bg-2); color: var(--text); }

.pg-del {
    margin-left: auto;
}

.pg-row-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pg-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
}
.pg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    min-height: 40px;
    align-items: center;
}
.pg-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 4px 10px;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.35);
    border-radius: 999px;
    font-size: 12px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    color: #c7cdff;
    font-weight: 600;
    animation: pg-chip-in 0.18s ease-out both;
}
@keyframes pg-chip-in {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.pg-chip-x {
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: transparent;
    color: #c7cdff;
    padding: 0;
    transition: background 0.12s, color 0.12s;
}
.pg-chip-x:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}
.pg-empty-inline {
    color: var(--text-dim);
    font-size: 12px;
    font-style: italic;
}

.pg-add-key {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.pg-add-key-input {
    flex: 1;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12.5px;
}
.pg-add-key-btn { flex-shrink: 0; }

.pg-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.pg-sug-label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}
.pg-suggest {
    padding: 4px 10px;
    font-size: 11.5px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-dim);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.12s;
}
.pg-suggest:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(88, 101, 242, 0.12);
    color: #c7cdff;
    border-style: solid;
}
.pg-suggest:disabled { opacity: 0.5; cursor: not-allowed; }

.pg-actions {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}
.pg-actions .btn-primary { min-width: 180px; justify-content: center; }

/* Smooth sidebar nav transitions */
.sidebar { transition: background 0.25s; }

/* Page main: soft scroll */
.main { scroll-behavior: smooth; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ---- Array / list editor (config page) --------------------------------- */

.cfg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.cfg-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    min-height: 44px;
    max-height: 260px;
    overflow-y: auto;
}
.cfg-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 4px 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    color: var(--text);
    max-width: 100%;
}
.cfg-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}
.cfg-chip-x {
    width: 18px; height: 18px;
    line-height: 1;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    font-size: 14px;
    padding: 0;
    transition: background 0.12s, color 0.12s;
}
.cfg-chip-x:hover:not(:disabled) {
    background: rgba(239,68,68,0.18);
    color: #fca5a5;
}
.cfg-empty {
    color: var(--text-dim);
    font-size: 12px;
    font-style: italic;
    padding: 4px 2px;
}
.cfg-list-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: -4px;
}
.cfg-list-add {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.cfg-list-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    transition: border-color 0.12s, box-shadow 0.12s;
    resize: vertical;
    min-height: 64px;
    line-height: 1.45;
}
.cfg-list-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,101,242,0.18);
}
.cfg-list-add-btn { flex-shrink: 0; align-self: stretch; }
.cfg-list-meta {
    font-size: 11px;
    color: var(--text-dim);
}
.cfg-list-count { color: var(--text); font-weight: 700; }

/* ---- Players page ------------------------------------------------------- */

.player-count-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 600;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 14px;
    padding-bottom: 40px;
}

.player-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s, transform 0.15s;
}
.player-card:hover { border-color: var(--accent); }

.player-card-head {
    display: flex; align-items: center; gap: 12px;
}
.player-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; font-size: 16px;
    flex-shrink: 0;
}
.player-head-text { flex: 1; min-width: 0; }
.player-name {
    font-size: 15px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-sub {
    font-size: 12px; color: var(--text-dim);
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-sub .mono { font-family: 'SF Mono', Menlo, Consolas, monospace; }

.ping-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    flex-shrink: 0;
}
.ping-pill .ping-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.ping-pill.ok   { background: rgba(34,197,94,0.12); color: #86efac; }
.ping-pill.warn { background: rgba(234,179,8,0.15); color: #fde047; }
.ping-pill.bad  { background: rgba(239,68,68,0.15); color: #fca5a5; }
.ping-pill.off  { background: var(--bg-3); color: var(--text-dim); }

.player-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
}
.id-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 8px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    font-size: 11.5px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    max-width: 100%;
}
.id-chip-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
}
.id-chip-val {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}
.id-chip-val a { color: #a5b4fc; text-decoration: none; }
.id-chip-val a:hover { text-decoration: underline; }
.id-chip-copy {
    width: 20px; height: 20px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-dim);
    background: transparent;
    padding: 0;
    transition: background 0.12s, color 0.12s;
}
.id-chip-copy:hover {
    background: var(--bg-3);
    color: var(--text);
}
.muted { color: var(--text-dim); font-style: italic; font-size: 12px; }
