:root {
  --bg: #0c1222;
  --panel: #141c2f;
  --panel2: #1a2438;
  --text: #e8eefc;
  --muted: #93a0bc;
  --line: #2a3650;
  --accent: #3d8bfd;
  --ok: #3dd68c;
  --warn: #f5a524;
  --err: #f07178;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 0% -10%, #1a2f5c 0%, transparent 55%),
    radial-gradient(700px 400px at 100% 0%, #123528 0%, transparent 50%),
    var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(10, 16, 28, .85);
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; margin: .25rem .5rem 1.5rem; }
.brand span { color: var(--muted); font-weight: 500; font-size: .8rem; display: block; margin-top: .2rem; }
.nav a {
  display: block;
  color: var(--muted);
  padding: .65rem .75rem;
  border-radius: 10px;
  margin-bottom: .2rem;
  text-decoration: none;
}
.nav a:hover, .nav a.active { background: var(--panel2); color: var(--text); text-decoration: none; }
.main { padding: 1.5rem 1.75rem 3rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.card h2, .card h3 { margin: 0 0 .75rem; font-size: 1rem; }
.stat { font-size: 1.6rem; font-weight: 700; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px;
}
.badge.ok { background: rgba(61,214,140,.12); color: var(--ok); border: 1px solid rgba(61,214,140,.35); }
.badge.err { background: rgba(240,113,120,.12); color: var(--err); border: 1px solid rgba(240,113,120,.35); }
.badge.warn { background: rgba(245,165,36,.12); color: var(--warn); border: 1px solid rgba(245,165,36,.35); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .7rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  border-radius: 10px; padding: .45rem .8rem; font-weight: 600; font-size: .85rem;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.danger { background: rgba(240,113,120,.15); border-color: rgba(240,113,120,.4); color: var(--err); }
.btn.small { padding: .3rem .55rem; font-size: .78rem; }
form.inline { display: inline; }
.form-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
label { display: grid; gap: .35rem; font-size: .85rem; color: var(--muted); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: #0d1526; color: var(--text);
  border-radius: 10px; padding: .55rem .7rem; font: inherit;
}
textarea.log {
  width: 100%; min-height: 420px; font-family: var(--mono); font-size: .8rem;
  line-height: 1.45; white-space: pre; overflow: auto;
}
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: .85rem; font-size: .92rem; }
.flash.ok { background: rgba(61,214,140,.12); border: 1px solid rgba(61,214,140,.35); }
.flash.error { background: rgba(240,113,120,.12); border: 1px solid rgba(240,113,120,.35); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(400px, 100%); }
.hint { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.code { font-family: var(--mono); background: #0d1526; padding: .1rem .35rem; border-radius: 4px; }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
}
