:root {
  --bg: #0f1419;
  --panel: #171d25;
  --panel2: #1c2430;
  --line: #2a3444;
  --text: #e7ecf3;
  --muted: #8b97a8;
  --acc: #2f6fed;
  --acc2: #2458c4;
  --ok: #2f9e6b;
  --warn: #c9922e;
  --err: #d4534c;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box }
html, body { margin: 0; min-height: 100% }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--acc); text-decoration: none }
a:hover { text-decoration: underline }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { color: var(--text); font-weight: 700; letter-spacing: .02em; text-decoration: none }
.brand span { color: var(--muted); font-weight: 500; margin-left: 8px; font-size: .85rem }
.nav a { color: var(--muted); margin-left: 18px; font-size: .92rem; text-decoration: none }
.nav a:hover { color: var(--text) }
.wrap { width: min(1100px, calc(100% - 32px)); margin: 24px auto 48px }
.auth-wrap { width: min(400px, calc(100% - 32px)); margin: 72px auto }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
}
.card h1 { margin: 0 0 6px; font-size: 1.35rem; font-weight: 650 }
.card h2 { margin: 0 0 14px; font-size: 1.05rem; font-weight: 650 }
.sub { margin: 0 0 16px; color: var(--muted); font-size: .92rem }
label { display: block; color: var(--muted); font-size: .8rem; margin: 0 0 6px }
input, select, textarea {
  width: 100%; height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); padding: 0 12px; margin-bottom: 12px;
  font: inherit;
}
textarea { height: 72px; padding: 10px 12px; resize: vertical }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--acc); border-color: var(--acc) }
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border: 0; border-radius: 8px;
  background: var(--acc); color: #fff; font-weight: 600; font: inherit; cursor: pointer;
  text-decoration: none;
}
.btn:hover, button:hover { background: var(--acc2); text-decoration: none; color: #fff }
.btn.secondary, button.secondary { background: transparent; border: 1px solid var(--line); color: var(--text) }
.btn.secondary:hover, button.secondary:hover { border-color: var(--muted); background: var(--panel2) }
.btn.danger, button.danger { background: var(--err) }
.btn.sm, button.sm { height: 32px; padding: 0 10px; font-size: .85rem }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr 1fr } }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.stat .k { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em }
.stat .v { font-size: 1.5rem; font-weight: 700; margin-top: 4px }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
@media (max-width: 700px) { .row2 { grid-template-columns: 1fr } }
table { width: 100%; border-collapse: collapse; font-size: .9rem }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle }
.ok { color: var(--ok) } .err { color: var(--err) } .warn { color: var(--warn) } .muted { color: var(--muted) }
.banner {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .92rem;
  border: 1px solid var(--line);
}
.banner.ok { background: rgba(47,158,107,.12); border-color: rgba(47,158,107,.35); color: #b6e6cf }
.banner.err { background: rgba(212,83,76,.12); border-color: rgba(212,83,76,.35); color: #f0b4b0 }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem;
  border: 1px solid var(--line); color: var(--muted);
}
.pill.on { color: var(--ok); border-color: rgba(47,158,107,.45) }
.pill.off { color: var(--muted) }
.foot { text-align: center; color: #5d6a7c; font-size: .72rem; padding: 20px; margin-top: auto }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; margin-bottom: 10px }
.check input { width: auto; height: auto; margin: 0 }
.inline-form { display: inline-flex; gap: 6px; align-items: center }
.inline-form input { width: 130px; height: 32px; margin: 0 }
.section-note { font-size: .85rem; color: var(--muted); margin: -6px 0 14px }
