:root {
  color-scheme: dark;
  --bg: #050816;
  --surface: #10182a;
  --surface-2: #172033;
  --line: rgba(182, 194, 217, 0.16);
  --text: #ffffff;
  --muted: #8d9bb5;
  --blue: #0a84ff;
  --blue-2: #a5d8ff;
  --green: #22c55e;
  --red: #ef4444;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(10, 132, 255, 0.24), transparent 34%),
    radial-gradient(circle at 100% 20%, rgba(165, 216, 255, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#app { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(5, 8, 22, 0.76);
  backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 34px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 16px;
  display: grid; place-items: center; font-weight: 900;
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  box-shadow: 0 18px 40px rgba(10, 132, 255, 0.32);
}
.brand span, .muted { color: var(--muted); }
nav { display: grid; gap: 8px; }
.nav-btn {
  width: 100%; border: 1px solid transparent; color: var(--muted);
  background: transparent; border-radius: 14px; padding: 12px 14px;
  text-align: left; font-weight: 800; cursor: pointer;
}
.nav-btn.active, .nav-btn:hover {
  color: var(--text); border-color: var(--line);
  background: rgba(255,255,255,0.06);
}
.main { padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.eyebrow {
  margin: 0 0 6px; color: var(--blue-2); text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 12px; font-weight: 900;
}
h1, h2 { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: 22px; }
.status-pill {
  border: 1px solid var(--line); background: rgba(255,255,255,0.06);
  border-radius: 999px; padding: 9px 12px; color: var(--muted); font-weight: 800;
}
.status-pill.ok { color: var(--green); border-color: rgba(34,197,94,0.25); }
.status-pill.bad { color: var(--red); border-color: rgba(239,68,68,0.25); }
button, input {
  font: inherit;
}
.primary, .ghost, .mini {
  border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 900; cursor: pointer;
}
.primary { color: white; background: linear-gradient(135deg, var(--blue), #3b82f6); }
.ghost { color: var(--blue-2); background: rgba(255,255,255,0.07); border: 1px solid var(--line); }
.mini { padding: 8px 10px; color: var(--text); background: rgba(10,132,255,0.12); border: 1px solid rgba(10,132,255,0.28); font-size: 12px; }
.login-card, .panel {
  max-width: 520px; border: 1px solid var(--line); border-radius: 24px;
  padding: 24px; background: rgba(16, 24, 42, 0.82);
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
}
.login-card { display: grid; gap: 12px; }
label { color: var(--muted); font-size: 13px; font-weight: 800; }
input {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255,255,255,0.06); color: var(--text); padding: 0 14px;
}
.error { color: var(--red); min-height: 20px; }
.content { display: grid; gap: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric {
  border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  background: rgba(16, 24, 42, 0.74);
}
.metric span { color: var(--muted); font-weight: 800; font-size: 12px; text-transform: uppercase; }
.metric strong { display: block; margin-top: 10px; font-size: 28px; }
.panel { max-width: none; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.section-controls input { width: min(220px, 100%); min-height: 42px; }
.table-wrap { overflow: auto; border-radius: 16px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.07); text-align: left; vertical-align: top; }
th { color: var(--blue-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
td { color: #dce6f8; font-size: 13px; }
.tag { display: inline-block; padding: 4px 8px; border-radius: 999px; background: rgba(10,132,255,0.14); color: var(--blue-2); font-weight: 900; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
