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

/* ============================================================
   ROI-Shield Panel — Premium UI
   Dark (Black & Blue) + Light (White & Blue) themes
   ============================================================ */

:root {
    /* Surfaces (dark, default) */
    --bg:        #06080c;
    --bg-2:      #0e1117;
    --bg-3:      #161b22;
    --bg-4:      #1f2633;

    /* Borders */
    --border:        #21262d;
    --border-soft:   #1a1f27;

    /* Text */
    --text:        #f0f6fc;
    --text-soft:   #8b949e;
    --text-dim:    #565e6a;

    /* Accent — cyan-blue for ROI-Shield identity */
    --accent:        #0ea5e9;
    --accent-hover:  #0284c7;
    --accent-soft:   rgba(14, 165, 233, 0.12);
    --accent-text:   #ffffff;
    --accent-on-bg:  #38bdf8;
    --accent-glow:   rgba(14, 165, 233, 0.25);

    /* Secondary accent for gradients */
    --accent-2:      #6366f1;
    --accent-2-soft: rgba(99, 102, 241, 0.10);

    /* Status (kept neutral, low saturation) */
    --green:  #16a34a;
    --green-soft: rgba(22, 163, 74, 0.12);
    --green-text: #4ade80;
    --red:    #dc2626;
    --red-soft: rgba(220, 38, 38, 0.12);
    --red-text: #f87171;
    --yellow: #ca8a04;
    --yellow-soft: rgba(202, 138, 4, 0.12);
    --yellow-text: #facc15;

    /* Shadows — subtle glow on accent elements */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow:    0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 4px 24px rgba(14, 165, 233, 0.15);

    /* Radii — prominent, soft, modern */
    --radius-sm: 10px;
    --radius:    14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 999px;
}

/* Light theme override */
[data-theme="light"] {
    --bg:        #f4f6f9;
    --bg-2:      #ffffff;
    --bg-3:      #f8f9fb;
    --bg-4:      #eef0f4;

    --border:        #dde1e7;
    --border-soft:   #eaecf0;

    --text:        #0a0f1a;
    --text-soft:   #475569;
    --text-dim:    #8896a8;

    --accent:        #0284c7;
    --accent-hover:  #0369a1;
    --accent-soft:   rgba(14, 165, 233, 0.08);
    --accent-text:   #ffffff;
    --accent-on-bg:  #0369a1;
    --accent-glow:   rgba(14, 165, 233, 0.12);

    --accent-2:      #4f46e5;
    --accent-2-soft: rgba(79, 70, 229, 0.06);

    --green-text: #15803d;
    --red-text:   #b91c1c;
    --yellow-text:#a16207;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow:    0 2px 12px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.10);
    --shadow-accent: 0 4px 16px rgba(14, 165, 233, 0.10);
}

* { 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;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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

::selection { background: var(--accent); color: var(--accent-text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--bg-4);
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border); }

.ic-svg {
    display: inline-block;
    vertical-align: -2px;
    flex-shrink: 0;
}

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

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.auth-body::before {
    content: '';
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.12), transparent 45%),
        radial-gradient(circle at 75% 75%, rgba(99, 102, 241, 0.10), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.04), transparent 60%);
    animation: auth-bg-drift 18s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes auth-bg-drift {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to   { transform: translate3d(2%, 1%, 0) scale(1.04); }
}

.auth-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(14, 165, 233, 0.06);
    text-align: center;
    position: relative;
    z-index: 1;
}
.auth-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), transparent 40%, transparent 60%, rgba(99, 102, 241, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.auth-brand { margin-bottom: 28px; }
.auth-logo {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    background: var(--bg-3);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 22px; color: var(--text);
    margin: 0 auto 14px;
}
.auth-logo-img {
    display: block;
    width: 64px; height: 64px;
    object-fit: contain;
    margin: 0 auto 16px;
    border-radius: var(--radius);
    background: var(--bg-3);
    border: 1px solid var(--border);
    padding: 8px;
}
.auth-brand h1 {
    font-size: 24px; font-weight: 800; letter-spacing: -0.4px;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent-on-bg) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-brand p { color: var(--text-dim); font-size: 13px; margin-top: 6px; letter-spacing: 0.5px; }

.auth-error {
    background: var(--red-soft);
    border: 1px solid transparent;
    color: var(--red-text);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.btn-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: var(--accent-text);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn-discord:hover { transform: translateY(-2px); box-shadow: var(--shadow-accent); filter: brightness(1.1); }
.btn-discord:active { transform: translateY(0); filter: brightness(0.95); }

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

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

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

.sidebar {
    width: 260px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 22px 14px;
    flex-shrink: 0;
    position: relative;
}
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; right: -1px;
    width: 2px; height: 100%;
    background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent 85%);
    opacity: 0.5;
}

.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 8px 22px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}
.brand-logo {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-3);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--text); font-size: 14px;
}
.brand-logo-img {
    width: 40px; height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--bg-3);
    border: 1px solid var(--border);
    padding: 4px;
    flex-shrink: 0;
}
.brand-title {
    font-weight: 800; font-size: 16px; letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--accent-on-bg) 0%, var(--accent) 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-sub { color: var(--text-dim); font-size: 11px; margin-top: 2px; letter-spacing: 0.3px; text-transform: uppercase; font-weight: 600; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; position: relative; }
.nav-indicator {
    position: absolute;
    left: 0; right: 0;
    top: 0;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
    border: 1px solid rgba(14, 165, 233, 0.18);
    border-radius: var(--radius-sm);
    opacity: 0;
    transform: translateY(0);
    transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), height 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
    pointer-events: none;
    z-index: 0;
}
.nav-item {
    position: relative;
    z-index: 1;
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active {
    background: transparent;
    color: var(--text);
    font-weight: 600;
}
.nav-ic {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
    transition: color 0.15s ease;
}
.nav-item:hover .nav-ic,
.nav-item.active .nav-ic { color: var(--accent-on-bg); }

/* Theme toggle (sidebar) */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    margin: 8px 0;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { background: var(--bg-4); color: var(--text); }
.theme-toggle .theme-toggle-icon {
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-dim);
}
.theme-toggle .theme-toggle-track {
    position: relative;
    width: 36px; height: 20px;
    background: var(--bg-4);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: background-color 0.18s ease;
}
.theme-toggle .theme-toggle-track::after {
    content: '';
    position: absolute;
    top: 1px; left: 1px;
    width: 16px; height: 16px;
    background: var(--text-soft);
    border-radius: 50%;
    transition: left 0.18s ease, background-color 0.18s ease;
}
[data-theme="light"] .theme-toggle .theme-toggle-track::after { left: 17px; background: var(--text); }

.user-box {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 10px;
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover;
    background: var(--bg-4);
    flex-shrink: 0;
}
.user-avatar.placeholder {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-4);
    color: var(--text);
    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: 32px; height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-icon:hover { background: var(--bg-4); color: var(--text); }

.main {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    min-width: 0;
    scroll-behavior: smooth;
    position: relative;
}
.main::before {
    content: '';
    position: fixed;
    inset: 0;
    left: 260px;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 50% at 5% -15%, rgba(14, 165, 233, 0.08), transparent 55%),
        radial-gradient(ellipse 50% 40% at 95% 95%, rgba(99, 102, 241, 0.05), transparent 50%);
}
#page-root { position: relative; z-index: 1; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; }
.page-subtitle { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

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

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn:hover:not(:disabled) {
    background: var(--bg-4);
    border-color: var(--border);
}
.btn:active:not(:disabled) { background: var(--bg-3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .ic { font-size: 13px; line-height: 1; }
.btn .ic-svg { vertical-align: -2px; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border-color: transparent;
    color: var(--accent-text);
}
.btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: var(--shadow-accent);
}
.btn-primary:active:not(:disabled) { filter: brightness(0.95); }

.btn-danger {
    background: var(--red-soft);
    border-color: transparent;
    color: var(--red-text);
}
.btn-danger:hover:not(:disabled) {
    background: var(--red);
    color: #ffffff;
}

.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-ghost {
    background: var(--bg-3);
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-4);
    border-color: var(--accent);
    color: var(--text);
}

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

.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    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: 20px; }

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    position: relative;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    animation: fade-in-up 0.35s ease-out both;
}
.stat-card:nth-child(1) { animation-delay: 40ms; }
.stat-card:nth-child(2) { animation-delay: 80ms; }
.stat-card:nth-child(3) { animation-delay: 120ms; }
.stat-card:nth-child(4) { animation-delay: 160ms; }
.stat-card:hover {
    border-color: rgba(14, 165, 233, 0.4);
    box-shadow: var(--shadow-accent);
}

.stat-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}
.stat-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.6px;
}
.stat-hint { font-size: 12px; color: var(--text-dim); }

.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-3);
    color: var(--text-soft);
}
.status-pill.on  { background: var(--green-soft); color: var(--green-text); }
.status-pill.off { background: var(--red-soft);   color: var(--red-text);   }
.status-pill::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.server-banner {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 22px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.server-banner-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    background: var(--bg-3);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: var(--text);
    font-weight: 700;
    flex-shrink: 0;
}
.server-banner-name { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.server-banner-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

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

.config-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--bg) 72%, transparent);
    padding: 4px 0 14px;
    z-index: 5;
    animation: config-toolbar-in 0.4s ease-out both;
}
@keyframes config-toolbar-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.cfg-search { margin-bottom: 0; }

.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.section-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.section-tab:hover {
    color: var(--text);
    border-color: var(--bg-4);
    box-shadow: var(--shadow-sm);
}
.section-tab.active {
    color: var(--accent-text);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.section-tab .tab-ic { font-size: 13px; opacity: 0.9; transition: opacity 0.2s ease; }
.section-tab.active .tab-ic { opacity: 1; }

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

.config-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
    animation: config-card-in 0.45s ease-out both;
}
.config-card:nth-child(1) { animation-delay: 40ms; }
.config-card:nth-child(2) { animation-delay: 70ms; }
.config-card:nth-child(3) { animation-delay: 100ms; }
.config-card:nth-child(4) { animation-delay: 130ms; }
.config-card:nth-child(5) { animation-delay: 160ms; }
.config-card:nth-child(6) { animation-delay: 190ms; }
.config-card:nth-child(7) { animation-delay: 220ms; }
.config-card:nth-child(8) { animation-delay: 250ms; }
@keyframes config-card-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.config-card:hover {
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: var(--shadow-accent);
}

.config-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
}
.config-card-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid rgba(14, 165, 233, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: var(--accent-on-bg);
    flex-shrink: 0;
    transition: background-color 0.22s ease, border-color 0.22s ease;
}
.config-card:hover .config-card-icon {
    background: rgba(14, 165, 233, 0.18);
    border-color: rgba(14, 165, 233, 0.35);
}
.config-card-head > div:nth-child(2) { flex: 1; min-width: 0; }
.config-card-title { font-size: 16px; font-weight: 700; letter-spacing: -0.25px; }
.config-card-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.45; }
.config-card-count {
    font-size: 11px;
    color: var(--text-dim);
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg-3);
    transition: border-color 0.2s ease, color 0.2s ease;
}
.config-card-count span { color: var(--text); font-weight: 700; }

/* Sub-section panels (Discord, Logging, …) */
.kv-group {
    border-bottom: 1px solid var(--border-soft);
}
.kv-group:last-child { border-bottom: none; }

.kv-group-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 22px;
    background: var(--bg-3);
    border-bottom: 1px solid var(--border-soft);
    border-left: 3px solid var(--border);
    transition: border-left-color 0.25s ease, background-color 0.25s ease;
}
.kv-group:hover .kv-group-head { border-left-color: var(--accent); }

.kv-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.65px;
    font-weight: 700;
    color: var(--text);
}
.kv-group-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--accent-on-bg);
    flex-shrink: 0;
}
.kv-group-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.45;
    padding-left: 38px;
}

/* Logging — card grid */
.kv-group-logging .kv-group-head {
    border-left-color: var(--accent);
    background: linear-gradient(90deg, var(--accent-soft) 0%, var(--bg-3) 42%);
}
.kv-group-logging .kv-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    padding: 18px 20px 20px;
    background: var(--bg);
}
.kv-group-logging .kv-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-height: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    border-right: 1px solid var(--border);
    background: var(--bg-2);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.kv-group-logging .kv-row:hover {
    background: var(--bg-3);
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: var(--shadow-sm);
}
.kv-group-logging .kv-control {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--border-soft);
}
.kv-group-logging .kv-label-wrap { flex: 1; min-width: 0; }
.kv-group-logging .kv-row:nth-child(1) { animation-delay: 50ms; }
.kv-group-logging .kv-row:nth-child(2) { animation-delay: 80ms; }
.kv-group-logging .kv-row:nth-child(3) { animation-delay: 110ms; }
.kv-group-logging .kv-row:nth-child(4) { animation-delay: 140ms; }
.kv-group-logging .kv-row:nth-child(5) { animation-delay: 170ms; }
.kv-group-logging .kv-row:nth-child(6) { animation-delay: 200ms; }
.kv-group-logging .kv-row:nth-child(7) { animation-delay: 230ms; }

/* Discord / secrets — full-width inputs */
.kv-group--discord .kv-row:not(.kv-row-full) {
    grid-column: 1 / -1;
}
.kv-group--discord .cfg-input-wide { width: min(100%, 420px); }

/* Other boolean-heavy groups — 2-col toggle cards */
.kv-group-toggles:not(.kv-group-logging) .kv-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0;
}
.kv-group-toggles:not(.kv-group-logging) .kv-row-toggle {
    border-right: 1px solid var(--border-soft);
}

.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: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    min-height: 56px;
    transition: background-color 0.18s ease, opacity 0.22s ease;
    animation: kv-row-in 0.32s ease-out both;
}
@keyframes kv-row-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.kv-row.kv-hidden {
    display: none;
}
.kv-row:hover { background: var(--bg-3); }

.kv-label-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.kv-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 8px;
}
.kv-label-text { line-height: 1.35; }
.kv-key-hint {
    font-size: 11.5px;
    color: var(--text-dim);
    line-height: 1.4;
    max-width: 42ch;
}
.kv-key-id {
    font-size: 10px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    color: var(--text-dim);
    opacity: 0.75;
}

.kv-row-full {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 18px 22px;
    background: var(--bg-3);
}
.kv-row-full .kv-label-wrap { align-self: flex-start; }
.kv-row-full .kv-control { width: 100%; }

.kv-row-toggle .kv-label { font-weight: 600; }

.kv-badge-list {
    background: var(--bg-4);
    color: var(--text-soft);
}
.kv-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 7px;
    border-radius: var(--radius-pill);
    background: var(--yellow-soft);
    color: var(--yellow-text);
}
.kv-control { flex-shrink: 0; }

.cfg-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    width: 180px;
    max-width: 100%;
    text-align: right;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.cfg-input-wide { width: min(100%, 320px); }
.cfg-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-2);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 44px; height: 26px;
    background: var(--bg-4);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease, box-shadow 0.22s ease;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.toggle::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: var(--text-soft);
    border-radius: 50%;
    transition: left 0.22s cubic-bezier(0.34, 1.2, 0.64, 1), background-color 0.22s ease, box-shadow 0.22s ease;
    box-shadow: var(--shadow-sm);
}
.toggle:hover { border-color: var(--text-dim); }
.toggle.on {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.toggle.on::after { left: 20px; background: #ffffff; }
.kv-group-logging .toggle.on { box-shadow: 0 0 0 4px var(--accent-soft); }

.config-sticky-bar {
    position: fixed;
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    left: calc(260px + 40px);
    right: 40px;
    padding: 14px 20px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
    animation: sticky-bar-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) 0.15s both;
    pointer-events: auto;
}
@keyframes sticky-bar-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.config-sticky-bar.has-changes {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg), var(--shadow-accent);
}
.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-soft);
    font-weight: 500;
    transition: color 0.2s ease;
}
.config-sticky-bar .changes strong { color: var(--accent-on-bg); }
.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;
}

@media (max-width: 720px) {
    .kv-group-logging .kv-list {
        grid-template-columns: 1fr;
    }
    .kv-group-desc { padding-left: 0; }
}

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

/* ---- Bans / search bar -------------------------------------------------- */

.search-bar {
    display: flex; align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
    gap: 10px;
    transition: border-color 0.15s ease;
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.config-toolbar .search-bar {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.search-bar input::placeholder { color: var(--text-dim); }

.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: 12px 16px;
    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: 14px 16px;
    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: var(--bg-3); }
td.mono {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-soft);
}
td.reason { max-width: 320px; }

table.data tbody tr.ban-row { cursor: pointer; }
table.data tbody tr.ban-row:hover { background: var(--bg-3); }

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

.empty {
    padding: 48px 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: 14px 18px;
    background: var(--red-soft);
    border: 1px solid transparent;
    color: var(--red-text);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}

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

#toast-stack {
    position: fixed;
    bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 1000;
}
.toast {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    padding: 12px 18px;
    border-radius: var(--radius);
    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(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: overlay-in 0.18s ease-out both;
}
[data-theme="light"] .modal-overlay { background: rgba(15, 15, 15, 0.4); }
.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: var(--radius-lg);
    padding: 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.05) both;
}
.modal-lg { max-width: 860px; }
.modal h3 { margin-bottom: 8px; font-size: 17px; letter-spacing: -0.2px; }
.modal p { color: var(--text-soft); font-size: 13px; margin-bottom: 16px; }
.modal-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}

@keyframes modal-in {
    from { transform: translateY(10px) scale(0.98); 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: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { font-size: 18px; margin-bottom: 2px; letter-spacing: -0.2px; }
.modal-eyebrow {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.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: 22px;
}
@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: var(--radius);
    overflow: hidden;
    background: var(--bg);
    transition: border-color 0.18s ease;
}
.ban-screenshot-frame:hover { border-color: var(--accent); }
.ban-screenshot-frame img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 440px;
    object-fit: contain;
    background: #000;
}
.ban-screenshot-hint {
    position: absolute;
    bottom: 10px; right: 10px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 11px;
    border-radius: var(--radius-pill);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.ban-screenshot-frame:hover .ban-screenshot-hint { opacity: 1; }
.ban-screenshot-empty {
    padding: 40px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-3);
    text-align: center;
    color: var(--text-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.ban-screenshot-empty code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    background: var(--bg);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

.ban-detail-meta { min-width: 0; }
.kv-def {
    display: grid;
    grid-template-columns: 110px 1fr;
    column-gap: 14px;
    row-gap: 10px;
    margin-bottom: 18px;
}
.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: 16px 0 10px;
}
.ban-details-pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    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 badges -------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: var(--bg-3);
    color: var(--text-soft);
    border: 1px solid var(--border);
}
.badge.perm     { background: var(--red-soft);    color: var(--red-text);    border-color: transparent; }
.badge.temp     { background: var(--yellow-soft); color: var(--yellow-text); border-color: transparent; }
.badge.evidence { background: var(--green-soft);  color: var(--green-text);  border-color: transparent; }
.badge.none     { background: var(--bg-3); color: var(--text-dim); font-style: italic; }

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

.pg-editor { padding: 20px; }
.pg-editor .kv-group-title {
    padding: 0 0 12px;
    background: transparent;
}
.pg-meta {
    font-size: 12px;
    color: var(--text-soft);
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.pg-meta code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    padding: 2px 7px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
}

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

.pg-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-dim);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-3);
}
.pg-empty strong { color: var(--text); }

.pg-row {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.pg-row:hover { border-color: var(--accent); }

.pg-row-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-3);
    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: 4px 10px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.pg-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: border-color 0.15s ease;
    min-width: 0;
}
.pg-input:focus {
    outline: none;
    border-color: var(--accent);
}
.pg-input:disabled { opacity: 0.55; cursor: not-allowed; }

.pg-job { flex: 1; min-width: 120px; font-weight: 600; }
.pg-role { flex: 1.2; min-width: 160px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }
.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: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.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: 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 44px;
    align-items: center;
}
.pg-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 5px 5px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    color: var(--text);
    font-weight: 600;
    animation: pg-chip-in 0.18s ease-out both;
}
@keyframes pg-chip-in {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.pg-chip-x {
    width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    padding: 0;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.pg-chip-x:hover:not(:disabled) {
    background: var(--red-soft);
    color: var(--red-text);
}
.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: 5px 12px;
    font-size: 11.5px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-dim);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.pg-suggest:hover:not(:disabled) {
    border-color: var(--accent);
    border-style: solid;
    color: var(--accent-on-bg);
    background: var(--accent-soft);
}
.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: 200px; justify-content: center; }

/* ---- Truncate helper --------------------------------------------------- */

.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: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 48px;
    max-height: 280px;
    overflow-y: auto;
}
.cfg-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 5px 5px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    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: 20px; height: 20px;
    line-height: 1;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    font-size: 14px;
    padding: 0;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.cfg-chip-x:hover:not(:disabled) {
    background: var(--red-soft);
    color: var(--red-text);
}
.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: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    transition: border-color 0.15s ease;
    resize: vertical;
    min-height: 64px;
    line-height: 1.5;
}
.cfg-list-input:focus {
    outline: none;
    border-color: var(--accent);
}
.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: 7px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    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: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.15s ease;
}
.player-card:hover { border-color: var(--bg-4); }

.player-card-head {
    display: flex; align-items: center; gap: 12px;
}
.player-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--bg-3);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--text); 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;
    letter-spacing: -0.2px;
}
.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: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    flex-shrink: 0;
    background: var(--bg-3);
    color: var(--text-soft);
}
.ping-pill .ping-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.ping-pill.ok   { background: var(--green-soft);  color: var(--green-text); }
.ping-pill.warn { background: var(--yellow-soft); color: var(--yellow-text); }
.ping-pill.bad  { background: var(--red-soft);    color: var(--red-text); }
.ping-pill.off  { background: var(--bg-3);        color: var(--text-dim); }

.player-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}
.id-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 5px 5px 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    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: var(--accent-on-bg); text-decoration: none; }
.id-chip-val a:hover { text-decoration: underline; }
.id-chip-copy {
    width: 22px; height: 22px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-dim);
    background: transparent;
    padding: 0;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.id-chip-copy:hover {
    background: var(--bg-4);
    color: var(--text);
}
.muted { color: var(--text-dim); font-style: italic; font-size: 12px; }

/* ---- Player allowlist (Players page) ----------------------------------- */

.player-allowlist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
}
.allow-role-hint {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    margin-right: 4px;
}
.allow-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    background: var(--green-soft);
    color: var(--green-text);
    border: 1px solid transparent;
    animation: pg-chip-in 0.18s ease-out both;
}
.allow-chip.bypass {
    background: var(--accent-soft);
    color: var(--accent-on-bg);
}
.allow-chip.pending {
    background: var(--yellow-soft);
    color: var(--yellow-text);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}
.allow-chip.none {
    background: var(--bg-4);
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-style: italic;
}

/* ============================================================
   Robbery Zones page
   ============================================================ */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}
.form-input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13.5px;
    padding: 10px 14px;
    transition: border-color 0.15s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
.form-hint {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 2px;
    line-height: 1.4;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text);
    font-weight: 500;
}
.toggle-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Modal box (zones page) */
.modal-box {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background-color 0.12s ease, color 0.12s ease;
}
.modal-close:hover { color: var(--text); background: var(--bg-3); }
.modal-body { padding: 22px 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-soft);
}

/* Data table (zones) */
.table-wrapper {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.data-table thead th {
    background: var(--bg-3);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}
.data-table tbody tr {
    border-bottom: 1px solid var(--border-soft);
    transition: background-color 0.12s ease;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-3); }
.data-table td {
    padding: 14px 16px;
    color: var(--text);
    vertical-align: middle;
}
.data-table .mono {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--text-soft);
}
.data-table .action-cell { text-align: right; white-space: nowrap; }

.btn-edit {
    background: var(--accent-soft);
    color: var(--accent-on-bg);
    border: 1px solid transparent;
    margin-right: 4px;
}
.btn-edit:hover { background: var(--accent); color: var(--accent-text); }

.zone-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
    color: var(--text);
}
.coord-cell { color: var(--text-soft) !important; }

.badge-green {
    background: var(--green-soft);
    color: var(--green-text);
    border: 1px solid transparent;
}
.badge-grey {
    background: var(--bg-3);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    gap: 10px;
}
.empty-icon { color: var(--text-dim); margin-bottom: 6px; opacity: 0.5; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.empty-subtitle {
    font-size: 13.5px;
    color: var(--text-dim);
    max-width: 380px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.error-box {
    background: var(--red-soft);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 16px 20px;
    color: var(--red-text);
    font-size: 13.5px;
}

/* ---- Animations -------------------------------------------------------- */

/* `transform: none` (not translateY(0)) at the end is intentional —
   any non-none transform on an ancestor creates a containing block,
   which breaks `position: fixed` on the sticky save bar. */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.fade-in-up { animation: fade-in-up 0.28s ease-out both; }

.page-header { animation: fade-in-up 0.28s ease-out both; }
.page-enter { animation: page-enter 0.38s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
#page-root > *:not(.page-header) {
    animation: fade-in-up 0.32s ease-out both;
    animation-delay: 50ms;
}
@keyframes page-enter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.auth-card { animation: fade-in-up 0.4s ease-out both; }

table.data tbody tr {
    animation: row-in 0.25s ease-out both;
}
table.data tbody tr:nth-child(1) { animation-delay: 20ms; }
table.data tbody tr:nth-child(2) { animation-delay: 35ms; }
table.data tbody tr:nth-child(3) { animation-delay: 50ms; }
table.data tbody tr:nth-child(4) { animation-delay: 65ms; }
table.data tbody tr:nth-child(5) { animation-delay: 80ms; }
@keyframes row-in {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: none; }
}

.player-card {
    animation: fade-in-up 0.32s ease-out both;
}
.players-grid .player-card:nth-child(1) { animation-delay: 30ms; }
.players-grid .player-card:nth-child(2) { animation-delay: 60ms; }
.players-grid .player-card:nth-child(3) { animation-delay: 90ms; }
.players-grid .player-card:nth-child(4) { animation-delay: 120ms; }

.btn:active:not(:disabled) { transform: scale(0.98); }

.loading {
    animation: pulse-soft 1.4s ease-in-out infinite;
}
@keyframes pulse-soft {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

/* ---- Unified page UI (Dashboard, Players, Bans) ------------------------- */

.page-content {
    animation: page-content-in 0.42s ease-out both;
    max-width: 1280px;
}
@keyframes page-content-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ui-header {
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}
.ui-header-text { flex: 1; min-width: 0; }

.ui-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
}
.ui-pill-live { border-color: rgba(22, 163, 74, 0.35); background: var(--green-soft); color: var(--green-text); }
.ui-pill-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(0.85); }
}

.ui-search {
    margin-bottom: 18px;
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ui-search-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    padding-left: 8px;
}

.ui-loading {
    padding: 72px 24px;
    text-align: center;
    color: var(--text-dim);
    animation: pulse-soft 1.4s ease-in-out infinite;
}

.ui-empty {
    padding: 56px 28px;
    text-align: center;
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    animation: page-content-in 0.35s ease-out both;
}
.ui-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.ui-empty-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.ui-empty-sub { font-size: 13px; color: var(--text-dim); max-width: 360px; margin: 0 auto; line-height: 1.5; }

/* Avatars (Discord) */
.ui-avatar {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-3);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.ui-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.ui-avatar-fallback,
.ui-avatar--fallback {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text);
    background: linear-gradient(145deg, var(--bg-4), var(--bg-3));
}
.player-card:hover .ui-avatar,
.ban-row:hover .ui-avatar {
    border-color: rgba(14, 165, 233, 0.5);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Dashboard v2 */
.dash-page .server-banner.ui-hero {
    border-radius: var(--radius-lg);
    margin-bottom: 22px;
    background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
    border: 1px solid var(--border);
    padding: 22px 26px;
    animation: page-content-in 0.4s ease-out both;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.dash-page .server-banner.ui-hero:hover {
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: var(--shadow-accent);
}
.ui-hero-icon {
    background: var(--accent-soft) !important;
    border-color: rgba(14, 165, 233, 0.25) !important;
    color: var(--accent-on-bg) !important;
    font-size: 24px !important;
    width: 60px !important;
    height: 60px !important;
}
.ui-hero-body { flex: 1; min-width: 0; }
.ui-hero-aside { flex-shrink: 0; }
.server-banner-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.server-banner-sub .ic-svg { color: var(--accent-on-bg); opacity: 0.85; }

.ui-stat {
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-3) 100%);
}
.ui-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ui-stat-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid rgba(14, 165, 233, 0.15);
    color: var(--accent-on-bg);
}
.stat-value-sub {
    color: var(--text-dim);
    font-size: 18px;
    font-weight: 600;
}
.stat-value-sm { font-size: 15px !important; font-weight: 600 !important; letter-spacing: -0.2px; }

.ui-panel { border-radius: var(--radius-lg); animation: page-content-in 0.45s ease-out 0.12s both; }
.ui-panel-head .card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ui-panel-head .card-title .ic-svg { color: var(--accent-on-bg); }

.ui-dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px 20px;
    font-size: 13px;
}
.ui-dl dt {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ui-dl dd { color: var(--text); word-break: break-word; }
.ui-dl .mono { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; color: var(--text-soft); }

/* Bans table v2 */
.bans-page .ui-table-wrap {
    border-radius: var(--radius-lg);
    overflow-x: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: page-content-in 0.38s ease-out 0.08s both;
}
.bans-page .ui-table {
    width: 100%;
    min-width: 1040px;
    table-layout: fixed;
}
.bans-page .ui-table thead th {
    padding: 14px 16px;
    background: var(--bg-3);
}
.bans-page .ui-table tbody td {
    padding: 14px 16px;
    transition: background-color 0.15s ease;
    overflow: hidden;
    vertical-align: middle;
}
.bans-page .ui-table .col-player { width: 22%; }
.bans-page .ui-table th:nth-child(2),
.bans-page .ui-table td:nth-child(2) { width: 11%; }
.bans-page .ui-table th:nth-child(3),
.bans-page .ui-table td:nth-child(3) { width: 18%; }
.bans-page .ui-table th:nth-child(4),
.bans-page .ui-table td:nth-child(4) { width: 9%; }
.bans-page .ui-table th:nth-child(5),
.bans-page .ui-table td:nth-child(5) { width: 9%; }
.bans-page .ui-table th:nth-child(6),
.bans-page .ui-table td:nth-child(6) { width: 11%; }
.bans-page .ui-table .col-expires { width: 10%; }
.bans-page .ui-table .col-actions { width: 150px; }
.bans-page .ui-table tbody tr.ban-row {
    animation: kv-row-in 0.28s ease-out both;
}
.bans-page .ui-table tbody tr.ban-row:nth-child(1) { animation-delay: 30ms; }
.bans-page .ui-table tbody tr.ban-row:nth-child(2) { animation-delay: 50ms; }
.bans-page .ui-table tbody tr.ban-row:nth-child(3) { animation-delay: 70ms; }
.bans-page .ui-table tbody tr.ban-row:nth-child(4) { animation-delay: 90ms; }
.bans-page .ui-table tbody tr.ban-row:nth-child(5) { animation-delay: 110ms; }

.ban-player-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.ban-player-name {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.15px;
}
.ban-license {
    font-size: 10.5px;
    color: var(--text-dim);
    margin-top: 2px;
    max-width: 200px;
}
.ban-id-cell { font-size: 11px; word-break: break-all; }
.ban-when { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.ban-expires-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.bans-page .col-expires { white-space: nowrap; }
.bans-page .col-actions {
    text-align: right;
    padding-right: 12px !important;
}
.ban-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    max-width: 130px;
    margin-left: auto;
}
.ban-actions .btn {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
}
.ban-actions .btn-danger {
    padding-left: 10px;
    padding-right: 10px;
}
.bans-page .ban-row-avatar.ui-avatar {
    width: 40px !important;
    height: 40px !important;
    border-color: rgba(88, 101, 242, 0.35);
}
.bans-page .reason {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ban-modal-head { align-items: flex-start !important; }
.ban-modal-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bans-page .badge.evidence {
    background: var(--accent-soft);
    color: var(--accent-on-bg);
}

/* Players v2 */
.players-page .players-grid {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}
.players-page .player-card {
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
    background: var(--bg-2);
    border: 1px solid var(--border);
    animation: kv-row-in 0.35s ease-out both;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.players-page .player-card:hover {
    border-color: rgba(14, 165, 233, 0.4);
    box-shadow: var(--shadow-accent);
}
.players-page .player-card-head {
    padding: 18px 18px 14px;
    gap: 14px;
    background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
    border-bottom: 1px solid var(--border-soft);
}
.players-page .player-avatar.ui-avatar {
    width: 52px !important;
    height: 52px !important;
}
.player-discord-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    color: #5865f2;
    margin-top: 4px;
}
[data-theme="light"] .player-discord-tag { color: #4752c4; }

.players-page .player-allowlist {
    margin: 0 16px;
    border-radius: var(--radius-sm);
}
.player-ids-label {
    padding: 10px 18px 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    color: var(--text-dim);
}
.players-page .player-ids {
    padding: 10px 16px 16px;
    border-top: none;
}
.id-chip--discord {
    border-color: rgba(88, 101, 242, 0.35);
    background: rgba(88, 101, 242, 0.08);
}
.id-chip--discord .id-chip-type { color: #5865f2; }

.allow-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Sidebar polish */
.sidebar {
    transition: border-color 0.2s ease;
}
.nav-item {
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.nav-item:hover { padding-left: 16px; }
.user-avatar {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.user-box:hover .user-avatar {
    box-shadow: 0 0 0 2px var(--accent-soft);
    border-color: rgba(14, 165, 233, 0.35);
}

.btn {
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover:not(:disabled) { box-shadow: var(--shadow-sm); }

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 880px) {
    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .layout { flex-direction: column; }
    .nav { flex-direction: row; overflow-x: auto; gap: 4px; }
    .nav-item { padding: 8px 12px; }
    .nav-item span:not(.nav-ic) { display: none; }
    .brand { padding: 0; margin: 0; border: none; }
    .brand > div { display: none; }
    .user-box { margin-top: 0; padding: 6px 8px; }
    .user-info { display: none; }
    .theme-toggle { padding: 8px 10px; }
    .theme-toggle span:not(.theme-toggle-icon) { display: none; }
    .main { padding: 20px; }
    .main::before { left: 0; }
    .config-sticky-bar { left: 16px; right: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .players-page .players-grid { grid-template-columns: 1fr; }
    .ui-dl { grid-template-columns: 1fr; gap: 4px 0; }
    .ui-dl dt { margin-top: 10px; }
    .bans-page .ui-table-wrap { overflow-x: auto; }
    .bans-page .ui-table { min-width: 720px; }
}
