:root {
  color-scheme: dark;
  --bg: #070a0f;
  --panel: #111722;
  --panel-2: #151d2b;
  --line: #253044;
  --text: #edf3ff;
  --muted: #94a3b8;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --accent: #38bdf8;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: Inter, Segoe UI, Arial, sans-serif; background: radial-gradient(circle at 15% 0%, #132236 0, #070a0f 36rem); color: var(--text); letter-spacing: 0; }
a { color: inherit; }
.login-page { display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(440px, 100%); }
.login-panel { background: rgba(17, 23, 34, .92); border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; }
h1 { margin: 0; font-size: 30px; line-height: 1.1; }
.muted { color: var(--muted); line-height: 1.5; }
.alert { margin: 18px 0; padding: 12px; border: 1px solid rgba(239,68,68,.45); color: #fecaca; background: rgba(239,68,68,.12); border-radius: 6px; }
.login-form { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
input { width: 100%; border: 1px solid var(--line); background: #080d15; color: var(--text); border-radius: 6px; padding: 12px 14px; font-size: 16px; }
button { border: 0; border-radius: 6px; padding: 12px 16px; background: var(--accent); color: #041018; font-weight: 800; cursor: pointer; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px clamp(18px, 4vw, 48px); border-bottom: 1px solid var(--line); background: rgba(7,10,15,.78); position: sticky; top: 0; backdrop-filter: blur(12px); z-index: 2; }
.topbar nav { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; }
.topbar a { text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; color: var(--text); }

.topbar a.active { border-color: rgba(56,189,248,.55); color: var(--accent); background: rgba(56,189,248,.12); }
.dashboard { padding: 28px clamp(18px, 4vw, 48px) 48px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats article, .device-card { background: rgba(17, 23, 34, .86); border: 1px solid var(--line); border-radius: 8px; }
.stats article { padding: 18px; }
.stats span { display: block; color: var(--muted); font-size: 13px; }
.stats strong { display: block; margin-top: 6px; font-size: 28px; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.device-card { padding: 18px; min-height: 220px; display: grid; gap: 16px; }
.device-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.device-title h2 { margin: 0 0 4px; font-size: 18px; }
.device-title p { margin: 0; color: var(--muted); font-size: 13px; }
.badge { border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.badge.online { color: #bbf7d0; background: rgba(34,197,94,.16); }
.badge.degraded { color: #fde68a; background: rgba(245,158,11,.16); }
.badge.offline { color: #fecaca; background: rgba(239,68,68,.16); }
.meta { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.meta a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.services { display: grid; gap: 8px; }
.service { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--bad); box-shadow: 0 0 16px rgba(239,68,68,.45); }
.service.up .dot { background: var(--good); box-shadow: 0 0 16px rgba(34,197,94,.45); }
.service-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.service-left span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
