:root {
    --bg-root: #06060e;
    --glass-bg: rgba(15, 15, 30, 0.75);
    --glass-border: rgba(130, 90, 220, 0.25);
    --glass-hover: rgba(130, 90, 220, 0.15);
    --purple-400: #a78bfa;
    --purple-500: #8b5cf6;
    --purple-600: #7c3aed;
    --purple-700: #6d28d9;
    --purple-glow: rgba(139, 92, 246, 0.4);
    --text-main: #e2e2f0;
    --text-muted: #9ca3af;
    --text-faded: #6b7280;
    --red: #f87171;
    --green: #4ade80;
    --amber: #fbbf24;
    --blue: #60a5fa;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --sidebar-w: 250px;
    --transition: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-body);
    background: var(--bg-root);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(100, 40, 200, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 60%, rgba(60, 20, 180, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 80%, rgba(80, 30, 160, 0.06) 0%, transparent 55%);
}

/* ── Particles ── */
.bg-particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.particle {
    position: absolute; border-radius: 50%; background: var(--purple-500);
    animation: driftUp linear infinite; opacity: 0;
}
@keyframes driftUp {
    0%   { transform: translateY(105vh) scale(0); opacity: 0; }
    10%  { opacity: 0.5; }
    85%  { opacity: 0.1; }
    100% { transform: translateY(-10vh) scale(2); opacity: 0; }
}

/* ── Glass base ── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* ── Sidebar ── */
.sidebar {
    position: fixed; top: 12px; left: 12px; bottom: 12px; width: var(--sidebar-w);
    z-index: 100; display: flex; flex-direction: column; padding: 20px 12px;
    overflow-y: auto;
    background: var(--glass-bg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
}
.sidebar-brand {
    text-align: center; padding-bottom: 18px; margin-bottom: 8px;
    border-bottom: 1px solid rgba(130,90,220,0.2);
}
.sidebar-logo {
    display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em;
    background: linear-gradient(135deg, #c4b5fd, #8b5cf6, #7c3aed);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.sidebar-version { font-size: 0.65rem; color: var(--purple-400); letter-spacing: 0.1em; font-weight: 600; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted);
    font-weight: 500; font-size: 0.88rem; transition: var(--transition);
    text-decoration: none; user-select: none; border: 1px solid transparent;
}
.nav-link:hover { background: var(--glass-hover); color: #fff; }
.nav-link.active {
    background: rgba(139,92,246,0.2); color: #fff;
    border-color: rgba(139,92,246,0.35);
    box-shadow: 0 0 12px rgba(139,92,246,0.1);
}
.nav-svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-user {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    margin-top: auto; border-radius: var(--radius-sm); cursor: pointer;
    transition: var(--transition); border-top: 1px solid rgba(130,90,220,0.2);
}
.sidebar-user:hover { background: var(--glass-hover); }
.sidebar-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; color: #fff; flex-shrink: 0;
}
.sidebar-userinfo { display: flex; flex-direction: column; min-width: 0; }
.sidebar-username {
    font-size: 0.82rem; color: var(--text-main); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-plan { font-size: 0.68rem; color: var(--purple-400); font-weight: 600; letter-spacing: 0.04em; }

/* ── Main ── */
.main {
    margin-left: calc(var(--sidebar-w) + 24px);
    padding: 28px;
    width: calc(100% - var(--sidebar-w) - 24px);
    min-height: 100vh;
    position: relative; z-index: 1;
}

/* ── Section headers ── */
.section-title {
    font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px;
    background: linear-gradient(135deg, #c4b5fd, #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.section-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.section-header { margin-bottom: 26px; }

/* ── Stats row ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px; margin-bottom: 28px;
}
.stat-card { padding: 18px 20px; display: flex; align-items: center; gap: 12px; }
.stat-dot {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0; font-weight: 700;
}
.stat-dot.purple { background: rgba(139,92,246,0.2); color: var(--purple-400); }
.stat-dot.green  { background: rgba(74,222,128,0.15); color: var(--green); }
.stat-dot.blue   { background: rgba(96,165,250,0.15); color: var(--blue); }
.stat-dot.amber  { background: rgba(251,191,36,0.15); color: var(--amber); }
.stat-label { font-size: 0.7rem; color: var(--text-faded); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: #fff; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
thead th {
    text-align: left; padding: 12px 16px;
    color: var(--text-faded); font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
    border-bottom: 1px solid rgba(130,90,220,0.15);
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); transition: background var(--transition); }
tbody tr:hover { background: rgba(139,92,246,0.05); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 12px 16px; color: var(--text-main); vertical-align: middle; }

/* ── Badges ── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
}
.badge-vip    { background: rgba(139,92,246,0.15); color: var(--purple-400); border: 1px solid rgba(139,92,246,0.3); }
.badge-owner  { background: rgba(251,191,36,0.12); color: var(--amber);      border: 1px solid rgba(251,191,36,0.3); }
.badge-player { background: rgba(96,165,250,0.12); color: var(--blue);       border: 1px solid rgba(96,165,250,0.3); }
.badge-online { background: rgba(74,222,128,0.12); color: var(--green);      border: 1px solid rgba(74,222,128,0.3); }
.badge-offline{ background: rgba(107,114,128,0.12); color: var(--text-faded); border: 1px solid rgba(107,114,128,0.3); }
.badge-banned { background: rgba(248,113,113,0.12); color: var(--red);       border: 1px solid rgba(248,113,113,0.3); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border: none; border-radius: 8px;
    font-weight: 600; font-size: 0.82rem; cursor: pointer;
    transition: var(--transition); font-family: var(--font-body); letter-spacing: 0.02em;
}
.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff;
    box-shadow: 0 4px 16px rgba(139,92,246,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(139,92,246,0.5); transform: translateY(-1px); }
.btn-outline {
    background: transparent; border: 1px solid rgba(130,90,220,0.35);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--purple-500); color: #fff; background: rgba(139,92,246,0.1); }
.btn-danger  {
    background: transparent; border: 1px solid rgba(248,113,113,0.3); color: var(--red);
}
.btn-danger:hover  { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.5); }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; border-radius: 6px; }

/* ── Command cards ── */
.commands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cmd-card { padding: 18px; }
.cmd-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.cmd-name { font-family: var(--font-code); font-size: 0.95rem; font-weight: 700; color: #fff; }
.cmd-desc { font-size: 0.78rem; color: var(--text-faded); line-height: 1.5; margin-bottom: 12px; }
.cmd-permissions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cmd-toggle-row { display: flex; justify-content: space-between; align-items: center; }
.cmd-toggle-label { font-size: 0.8rem; color: var(--text-muted); }

/* ── Toggle ── */
.toggle { position: relative; width: 42px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: rgba(255,255,255,0.08); border-radius: 22px; transition: var(--transition);
}
.toggle-slider::before {
    content: ''; position: absolute; height: 16px; width: 16px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--purple-500); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Logs ── */
.log-entry {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.82rem; transition: background var(--transition);
}
.log-entry:hover { background: rgba(139,92,246,0.04); }
.log-entry:last-child { border-bottom: none; }
.log-time { color: var(--text-faded); font-family: var(--font-code); font-size: 0.75rem; white-space: nowrap; padding-top: 1px; }
.log-msg { color: var(--text-main); flex: 1; line-height: 1.5; }
.log-tag { font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
.log-tag.info   { background: rgba(96,165,250,0.12);  color: var(--blue); }
.log-tag.warn   { background: rgba(251,191,36,0.12);  color: var(--amber); }
.log-tag.action { background: rgba(139,92,246,0.12); color: var(--purple-400); }
.log-tag.ban    { background: rgba(248,113,113,0.12); color: var(--red); }

/* ── Settings ── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.setting-card { padding: 20px; }
.setting-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; color: #fff; }
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; margin-bottom: 5px;
    font-size: 0.72rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.form-input {
    width: 100%; padding: 10px 12px;
    background: rgba(0,0,0,0.45); border: 1px solid rgba(130,90,220,0.3);
    border-radius: 6px; color: var(--text-main); font-size: 0.88rem;
    outline: none; transition: var(--transition); font-family: var(--font-body);
}
.form-input:focus { border-color: var(--purple-500); box-shadow: 0 0 14px rgba(139,92,246,0.15); }
.form-input::placeholder { color: #52527a; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.toggle-row:last-of-type { border-bottom: none; }
.toggle-label { font-size: 0.85rem; color: var(--text-main); }

/* ── Search bar ── */
.search-bar-wrap { margin-bottom: 18px; }
.search-bar {
    width: 100%; padding: 10px 16px; background: rgba(0,0,0,0.4);
    border: 1px solid rgba(130,90,220,0.25); border-radius: 8px;
    color: var(--text-main); font-size: 0.88rem; outline: none;
    transition: var(--transition); font-family: var(--font-body);
}
.search-bar:focus { border-color: var(--purple-500); }
.search-bar::placeholder { color: #52527a; }

/* ── Toast ── */
.toast-container {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; align-items: center;
    gap: 8px; pointer-events: none;
}
.toast {
    background: #1a1035; border: 1px solid var(--purple-500);
    padding: 12px 28px; border-radius: 28px; color: #fff;
    font-weight: 600; font-size: 0.84rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: toastIn 0.4s ease, toastOut 0.4s ease 2.2s forwards; pointer-events: auto;
}
@keyframes toastIn  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-12px); } }

/* ── Modal ── */
.modal-container { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
.modal-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px); display: flex; align-items: center;
    justify-content: center; pointer-events: auto;
}
.modal-box { width: 90%; max-width: 460px; padding: 24px; animation: modalPop 0.3s ease; }
@keyframes modalPop { from { opacity: 0; transform: scale(0.92) translateY(16px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-box h3 { font-size: 1.1rem; margin-bottom: 12px; color: #fff; }
.modal-box p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }

/* ── Security notice ── */
.security-notice {
    background: rgba(251,191,36,0.07); border: 1px solid rgba(251,191,36,0.25);
    border-radius: var(--radius-md); padding: 12px 16px;
    display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px;
    font-size: 0.8rem; color: var(--text-muted); line-height: 1.5;
}
.security-notice strong { color: var(--amber); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; bottom: 0; left: 0; right: 0; top: auto;
        width: 100%; flex-direction: row; padding: 6px 8px;
        border-radius: 16px 16px 0 0; gap: 0; overflow-x: auto;
    }
    .sidebar-brand, .sidebar-user { display: none; }
    .nav-link span { display: none; }
    .sidebar-nav { flex-direction: row; gap: 0; width: 100%; justify-content: space-around; }
    .nav-link { flex-direction: column; gap: 3px; padding: 6px 10px; font-size: 0.65rem; }
    .nav-svg { width: 16px; height: 16px; }
    .main { margin-left: 0; width: 100%; padding: 16px; padding-bottom: 90px; }
    .settings-grid, .commands-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}
