:root {
  color-scheme: dark;
  --bg: #0f1216;
  --panel: #171c22;
  --panel-2: #202730;
  --text: #eef3f8;
  --muted: #9aa7b4;
  --line: #2b3440;
  --accent: #2dd4bf;
  --accent-2: #60a5fa;
  --danger: #fb7185;
  --shadow: 0 18px 48px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, .12), transparent 34rem),
    radial-gradient(circle at top right, rgba(96, 165, 250, .12), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(15, 18, 22, .84);
  backdrop-filter: blur(18px);
}
.eyebrow { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(24px, 4vw, 38px); }
h2 { font-size: 20px; }
.logout {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--panel);
}

.layout {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 28px) 56px;
}
.hero-panel, .panel, .stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)), var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}
.hero-panel p, .panel-head p { color: var(--muted); margin-top: 6px; }
.hero-status {
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  background: rgba(45, 212, 191, .1);
  border: 1px solid rgba(45, 212, 191, .25);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 13px;
}
.hero-status span {
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 18px 0;
}
.stat-card { padding: 18px; }
.stat-card span { color: var(--muted); }
.stat-card strong { display: block; margin-top: 10px; font-size: 34px; }
.panel { padding: 20px; margin-top: 18px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 16px;
}
.inline-form { margin: 0; }
.inline-form button {
  min-width: 170px;
}
.settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
label { color: var(--muted); font-size: 13px; }
input {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: #06221e;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.form-actions button { min-width: 190px; }
.switch {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch span {
  width: 48px;
  height: 28px;
  position: relative;
  display: inline-block;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  transition: .18s ease;
}
.switch span::after {
  content: "";
  width: 20px;
  height: 20px;
  position: absolute;
  top: 3px;
  left: 4px;
  border-radius: 50%;
  background: var(--muted);
  transition: .18s ease;
}
.switch input:checked + span {
  background: rgba(45, 212, 191, .18);
  border-color: rgba(45, 212, 191, .6);
}
.switch input:checked + span::after {
  left: 22px;
  background: var(--accent);
}
.switch input:disabled + span {
  opacity: .45;
  cursor: not-allowed;
}
.split {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
}
.total-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.total-strip div {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.total-strip span, .activity-item span { color: var(--muted); display: block; }
.total-strip strong { font-size: 24px; margin-top: 4px; display: block; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
.compact table { min-width: 420px; }
th, td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.status {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(251, 113, 133, .14);
  color: var(--danger);
}
.status.online { background: rgba(45, 212, 191, .12); color: var(--accent); }
.activity-list { display: grid; gap: 10px; }
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061018;
  font-weight: 900;
  margin-bottom: 18px;
}
.login-card p { color: var(--muted); margin: 8px 0 20px; }
.login-card button { width: 100%; margin-top: 14px; }
.alert {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(251,113,133,.12);
  color: #fecdd3;
  margin-bottom: 12px;
}
.flash {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.flash.ok {
  color: var(--accent);
  background: rgba(45, 212, 191, .08);
  border-color: rgba(45, 212, 191, .35);
}
.flash.err {
  color: #fecdd3;
  background: rgba(251,113,133,.12);
  border-color: rgba(251,113,133,.35);
}
.danger-panel {
  border-color: rgba(251,113,133,.45);
  background: linear-gradient(180deg, rgba(251,113,133,.06), rgba(255,255,255,.015)), var(--panel);
}
.danger-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.danger-grid form { margin: 0; }
.danger-btn {
  width: 100%;
  background: rgba(251,113,133,.2);
  color: #ffe4e8;
  border: 1px solid rgba(251,113,133,.4);
}
.danger-btn.hard {
  background: rgba(251,113,133,.32);
  color: #fff;
}
.wipe-form {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

@media (max-width: 860px) {
  .hero-panel, .topbar { align-items: stretch; flex-direction: column; }
  .stats-grid, .split, .settings-form { grid-template-columns: 1fr; }
  .danger-grid, .wipe-form { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .stat-card strong { font-size: 28px; }
  table { min-width: 620px; }
}
