:root {
  --bg: #070a12;
  --panel: rgba(16, 22, 35, .94);
  --panel2: rgba(26, 34, 52, .94);
  --text: #eef4ff;
  --muted: #98a4ba;
  --border: rgba(255,255,255,.10);
  --blue: #5b8cff;
  --green: #32d583;
  --red: #ff5c73;
  --yellow: #ffd166;
  --purple: #8b5cf6;
  --shadow: 0 20px 70px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(91,140,255,.22), transparent 30rem),
    radial-gradient(circle at 100% 0, rgba(50,213,131,.12), transparent 28rem),
    radial-gradient(circle at 50% 100%, rgba(139,92,246,.12), transparent 32rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: #a9c4ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 1.35rem;
  background: rgba(5, 8, 15, .72);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.03em;
}

.brand-sub {
  color: var(--muted);
  font-size: .86rem;
  margin: .3rem 0 1.3rem;
}

.nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .78rem .85rem;
  color: var(--text);
  border-radius: 14px;
  margin-bottom: .35rem;
}

.nav a:hover {
  background: rgba(255,255,255,.075);
  text-decoration: none;
}

.main {
  width: 100%;
  max-width: 1600px;
  padding: 1.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

h1, h2, h3 { margin-top: 0; }
h1 { letter-spacing: -.04em; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.card {
  grid-column: span 12;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.card.half { grid-column: span 6; }
.card.third { grid-column: span 4; }
.card.quarter { grid-column: span 3; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }

.stat {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -.05em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .58rem;
  border-radius: 999px;
  font-size: .82rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge.ok { color: #b7ffd8; background: rgba(50,213,131,.13); }
.badge.bad { color: #ffd0d6; background: rgba(255,92,115,.13); }
.badge.warn { color: #ffe7a8; background: rgba(255,209,102,.13); }
.badge.info { color: #d4e2ff; background: rgba(91,140,255,.13); }

code, pre {
  background: rgba(0,0,0,.38);
  border: 1px solid var(--border);
  border-radius: 12px;
}

code { padding: .16rem .38rem; }
pre {
  padding: 1rem;
  overflow: auto;
  color: #dbe7ff;
  max-height: 580px;
  white-space: pre-wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  color: var(--muted);
  font-size: .84rem;
  text-align: left;
  font-weight: 700;
}

td, th {
  padding: .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:hover td { background: rgba(255,255,255,.025); }

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  margin: .25rem 0 .75rem;
  padding: .76rem .82rem;
  border-radius: 13px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(0,0,0,.28);
  outline: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(91,140,255,.72);
}

label {
  color: var(--muted);
  font-size: .9rem;
}

.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .72rem .95rem;
  border-radius: 13px;
  border: 0;
  color: white;
  background: linear-gradient(135deg, #477dff, #7c5cff);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.btn:hover { text-decoration: none; filter: brightness(1.08); }

.btn.secondary, button.secondary {
  background: rgba(255,255,255,.09);
  border: 1px solid var(--border);
}

.btn.danger, button.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.btn.warn, button.warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.btn.ok, button.ok { background: linear-gradient(135deg, #10b981, #059669); }

.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; }

.notice {
  background: rgba(91,140,255,.12);
  border: 1px solid rgba(91,140,255,.25);
  padding: .85rem;
  border-radius: 15px;
  margin-bottom: 1rem;
}

.notice.danger {
  background: rgba(255,92,115,.12);
  border-color: rgba(255,92,115,.25);
}

.notice.warn {
  background: rgba(255,209,102,.12);
  border-color: rgba(255,209,102,.25);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.console {
  min-height: 520px;
  max-height: 720px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem;
}

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .card.half, .card.third, .card.quarter { grid-column: span 12; }
  .topbar { flex-direction: column; }
  table { display: block; overflow-x: auto; }
}
