:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --muted: #64748b;
  --line: #e2e8f0;
  --text: #0f172a;
  --brand: #2563eb;
  --bad: #dc2626;
  --good: #16a34a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: #f8fafc; }
button, input, textarea, select { font: inherit; }
.admin-shell { min-height: 100vh; }
.login-card {
  width: min(420px, calc(100% - 32px));
  margin: 8vh auto 0;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(15,23,42,.12);
}
.mark { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 12px; background: var(--bg); color: #fff; margin-bottom: 18px; }
.mark i { font-size: 30px; }
h1, h2, p { margin-top: 0; }
.login-card h1 { margin-bottom: 6px; }
.login-card p, aside p, header p { color: var(--muted); }
label { display: block; margin: 14px 0; font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
input, textarea, select { width: 100%; margin-top: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
button, .login-card a, header a {
  min-height: 42px;
  border-radius: 8px;
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.login-card button { width: 100%; margin-top: 4px; }
.login-card a { margin-top: 14px; background: transparent; color: var(--muted); width: 100%; }
.error { padding: 10px 12px; background: #fef2f2; color: var(--bad); border-radius: 8px; font-weight: 700; }
.panel { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; }
aside { background: var(--bg); color: #fff; padding: 24px; display: flex; flex-direction: column; }
aside h1 { margin-bottom: 4px; }
aside nav { display: grid; gap: 8px; margin: 24px 0; }
aside nav button, .logout {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: #cbd5e1;
}
aside nav button.active { background: rgba(255,255,255,.1); color: #fff; }
.logout { margin-top: auto; border: 1px solid rgba(255,255,255,.14); }
.workspace { min-width: 0; }
header { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; background: #fff; border-bottom: 1px solid var(--line); }
header h2 { margin-bottom: 0; }
header p { margin-bottom: 2px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
header a { background: #f1f5f9; color: var(--text); }
#admin-body { padding: 28px; display: grid; gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 14px; }
.stat, .row, .editor { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.stat strong { display: block; font-size: 30px; margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.row p { margin: 2px 0 0; color: var(--muted); }
.row-actions { display: flex; gap: 8px; }
.row-actions button { background: #f1f5f9; color: var(--text); }
.row-actions button.danger { background: #fef2f2; color: var(--bad); }
.badge { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.badge.admin { background: #dcfce7; color: var(--good); }
.badge.banned { background: #fee2e2; color: var(--bad); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toolbar button { background: var(--bg); }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px; }
.grid-form label.wide { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .panel { grid-template-columns: 1fr; }
  aside { position: static; }
  .stats, .grid-form { grid-template-columns: 1fr; }
}
