:root {
  --bg: #070a10;
  --panel: #0d1117;
  --surface: #161b25;
  --border: rgba(255,255,255,.07);
  --text: #e2e8f0;
  --sub: #64748b;
  --violet: #7c3aed;
  --violet-soft: rgba(124,58,237,.18);
  --cyan: #22d3ee;
  --green: #22c55e;
  --green-soft: rgba(34,197,94,.16);
  --red: #ef4444;
  --red-soft: rgba(239,68,68,.15);
  --yellow: #f59e0b;
  --yellow-soft: rgba(245,158,11,.14);
  --indigo: #818cf8;
  --indigo-soft: rgba(129,140,248,.16);
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}

/* ── Auth ── */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(124,58,237,.18) 0%, transparent 55%),
              radial-gradient(ellipse at 80% 80%, rgba(34,211,238,.1) 0%, transparent 50%),
              var(--bg);
}
.auth-card {
  width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.auth-logo h1 { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; }
.auth-logo p { font-size: 12px; color: var(--sub); margin-top: 2px; }
.auth-card h2 { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.auth-card > p { color: var(--sub); font-size: 13px; margin-bottom: 28px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; }
.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: rgba(124,58,237,.6); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, filter .15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { opacity: .85; }
.btn-primary { background: var(--violet); color: #fff; width: 100%; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-green { background: var(--green); color: #fff; }
.auth-error {
  background: var(--red-soft);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 8px;
  color: #fca5a5;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Layout ── */
#admin-app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-logo span { font-size: 15px; font-weight: 800; }
.sidebar-logo small { display: block; font-size: 10px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .08em; margin-top: 1px; }
.sidebar-nav { padding: 12px 10px; flex: 1; }
.nav-section { margin-bottom: 20px; }
.nav-label { font-size: 10px; font-weight: 800; color: var(--sub); text-transform: uppercase; letter-spacing: .1em; padding: 0 8px; margin-bottom: 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 600;
  transition: background .12s, color .12s;
  user-select: none;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--violet-soft); color: #c4b5fd; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info small { color: var(--sub); font-size: 11px; }
.sidebar-logout { background: none; border: none; color: var(--sub); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; place-items: center; transition: color .12s; }
.sidebar-logout:hover { color: var(--red); }

/* ── Main ── */
.main { flex: 1; min-width: 0; padding: 32px 36px; max-width: 1100px; }
.page { display: none; }
.page.active { display: block; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 26px; font-weight: 900; margin-bottom: 4px; }
.page-header p { color: var(--sub); font-size: 13px; }

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
}
.stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.stat-card .stat-icon svg { width: 20px; height: 20px; }
.stat-card .stat-value { font-size: 28px; font-weight: 900; line-height: 1; margin-bottom: 5px; }
.stat-card .stat-label { font-size: 12px; color: var(--sub); font-weight: 600; }
.stat-users .stat-icon { background: var(--violet-soft); color: #c4b5fd; }
.stat-servers .stat-icon { background: var(--indigo-soft); color: var(--indigo); }
.stat-bots .stat-icon { background: var(--yellow-soft); color: var(--yellow); }
.stat-pending .stat-icon { background: var(--red-soft); color: #fca5a5; }
.stat-verified .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-banned .stat-icon { background: rgba(239,68,68,.12); color: #f87171; }

/* ── Table / List ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-header h2 { font-size: 16px; font-weight: 800; }
.search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 220px;
  transition: border-color .15s;
}
.search-box:focus { border-color: rgba(124,58,237,.55); }
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.025); }
td { padding: 13px 18px; vertical-align: middle; }
.cell-main { font-weight: 600; font-size: 13.5px; }
.cell-sub { color: var(--sub); font-size: 12px; margin-top: 2px; }
.cell-actions { display: flex; gap: 7px; align-items: center; justify-content: flex-end; }
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: inline-grid;
  place-items: center;
  font-weight: 900;
  font-size: 11px;
  flex-shrink: 0;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 10px;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sq { border-radius: 8px; }
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-verified { background: var(--green-soft); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.badge-unverified { background: var(--yellow-soft); color: var(--yellow); border: 1px solid rgba(245,158,11,.3); }
.badge-banned { background: var(--red-soft); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.badge-admin { background: var(--violet-soft); color: #c4b5fd; border: 1px solid rgba(124,58,237,.3); }
.badge-dev { background: var(--indigo-soft); color: var(--indigo); border: 1px solid rgba(129,140,248,.3); }
.badge-official { background: rgba(34,211,238,.12); color: var(--cyan); border: 1px solid rgba(34,211,238,.3); }
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--sub);
}
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: .35; }
.empty-state p { font-size: 13px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: 420px;
  box-shadow: 0 40px 100px rgba(0,0,0,.7);
}
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.modal > p { color: var(--sub); font-size: 13px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a2233;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  white-space: nowrap;
}
#toast.show { opacity: 1; }
#toast.ok { border-color: rgba(34,197,94,.4); color: var(--green); }
#toast.err { border-color: rgba(239,68,68,.4); color: #fca5a5; }

/* ── Loading ── */
.loader { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--violet); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ── */
.id-code { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--sub); background: var(--surface); padding: 2px 7px; border-radius: 5px; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.inline-flex { display: inline-flex; align-items: center; gap: 8px; }
