:root {
  --bg: #0b1220; --panel: #121c2e; --panel2: #18253b; --line: #24334d; --text: #e8eef9; --dim: #8fa0ba; --faint: #5d6e88;
  --accent: #00e5ff; --good: #3ddc84; --warn: #ffb300; --bad: #ff5252;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
header.top { display: flex; align-items: center; gap: 18px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #0d1628; position: sticky; top: 0; z-index: 1000; }
header.top .brand { font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: .3px; }
header.top .brand b { color: var(--accent); }
header.top nav { display: flex; gap: 14px; flex: 1; }
header.top nav a { color: var(--dim); padding: 4px 2px; }
header.top nav a.on { color: var(--text); border-bottom: 2px solid var(--accent); }
header.top .who { color: var(--dim); font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 12px; letter-spacing: 1.6px; color: var(--dim); margin: 28px 0 10px; font-weight: 600; }
.sub { color: var(--dim); font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: block; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card .name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card .meta { color: var(--dim); font-size: 13px; margin-top: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line); color: var(--dim); }
.pill.owner { color: var(--accent); border-color: #0b4a55; }
.pill.admin { color: var(--warn); border-color: #5a4300; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat .k { font-size: 10px; letter-spacing: 1.3px; color: var(--dim); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat .v small { font-size: 12px; color: var(--dim); font-weight: 400; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: 1px; color: var(--dim); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #1a2840; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #00222a; border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
input[type=text], input[type=email], input[type=password] { background: #0c1627; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
input:focus { outline: 2px solid #0b4a55; border-color: var(--accent); }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.note { color: var(--faint); font-size: 12px; margin-top: 6px; }
.login { max-width: 380px; margin: 9vh auto 0; }
.login .panel { display: grid; gap: 12px; }
.divider { text-align: center; color: var(--faint); font-size: 12px; }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid var(--line); padding: 8px; color: var(--dim); cursor: pointer; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.map { height: 360px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #1a2230; }
.chart { margin-bottom: 12px; }
.chart .ct { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.chart .ct span:first-child { font-weight: 600; }
.chart .ct span:last-child { color: var(--accent); }
.chart svg { width: 100%; height: 130px; display: block; background: #0c1627; border-radius: 10px; cursor: crosshair; }
.live { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .live.withmap { grid-template-columns: 1.1fr 1fr; } }
.legend { height: 6px; border-radius: 3px; margin-top: 8px; background: linear-gradient(90deg, #4fc3f7, #3ddc84, #ffb300, #ff5252); }
.empty { color: var(--dim); padding: 18px; text-align: center; }
.crumbs { font-size: 13px; color: var(--dim); margin-bottom: 10px; }
@media (max-width: 600px) { header.top { padding: 10px 12px; gap: 10px; } header.top .who { display: none; } main { padding: 16px 12px 50px; } }
