:root {
  --bg: #0b0e14;
  --bg2: #11161f;
  --panel: #141a24;
  --line: #232c3a;
  --text: #e8edf5;
  --muted: #8b98ab;
  --accent: #ffb02e;
  --accent2: #4cc9f0;
  --good: #3ddc97;
  --bad: #ff5d5d;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }

.login { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(900px 500px at 20% 0%, rgba(255,176,46,.10), transparent 60%),
  radial-gradient(700px 500px at 90% 100%, rgba(76,201,240,.08), transparent 60%), var(--bg); }
.login-card { width: 320px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.login-logo { font-size: 34px; font-weight: 800; letter-spacing: 1px; color: var(--accent); }
.login-sub { color: var(--muted); margin: 4px 0 22px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.login-card input { width: 100%; margin-top: 6px; padding: 11px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 15px; }
.login-card button { width: 100%; padding: 11px; background: var(--accent); color: #1a1200; font-weight: 700; border: 0; border-radius: 10px; cursor: pointer; font-size: 15px; }
.login-card button:hover { filter: brightness(1.06); }
.login-error { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 10px; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: rgba(17,22,31,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-size: 22px; font-weight: 800; color: var(--accent); }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: .4px; }
.tabs { display: flex; gap: 4px; }
.tab { background: transparent; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.tab:hover { color: var(--text); background: var(--bg2); }
.tab.active { color: var(--text); background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.ghost:hover { color: var(--text); }

main { width: min(1180px, 100%); margin: 0 auto; padding: 24px 22px 40px; flex: 1; }
.page { display: flex; flex-direction: column; gap: 20px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.card-value { font-size: 28px; font-weight: 700; margin-top: 8px; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 650; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 220px 1fr 90px; align-items: center; gap: 12px; }
.bar-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: #0d1219; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #ffd166); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 500; text-align: left; font-size: 12px; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.legend { margin-top: 12px; }

.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.node { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; }
.node-top { display: flex; align-items: center; gap: 8px; }
.node-name { font-weight: 600; font-size: 14px; }
.node-meta { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.45; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--muted); }
.dot.on { background: var(--good); box-shadow: 0 0 10px rgba(61,220,151,.7); }
.dot.off { background: var(--bad); }

.footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 140px 1fr 80px; }
  .tab { padding: 7px 10px; font-size: 13px; }
  .brand-sub { display: none; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .topbar { gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
  main { padding: 16px 14px 30px; }
  .bar-row { grid-template-columns: 110px 1fr 70px; }
}
