:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --border: #2d3a4f;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #6366f1;
  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.nav-meta { color: var(--muted); font-size: 0.9rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

h1 { margin: 0 0 0.25rem; font-size: 1.75rem; }
h2 { margin: 0 0 1rem; font-size: 1.15rem; }
h3.device-title { margin: 0 0 0.75rem; font-size: 1rem; color: var(--muted); }
.subtitle { margin: 0; color: var(--muted); font-size: 0.9rem; }

.status-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #374151;
  white-space: nowrap;
}
.status-pill.ok { background: rgba(34, 197, 94, 0.2); color: var(--ok); }
.status-pill.bad { background: rgba(239, 68, 68, 0.2); color: var(--bad); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.stat-card.highlight { border-color: var(--accent); }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.count {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: normal;
}

.device-block { margin-bottom: 1rem; }
.device-block:last-child { margin-bottom: 0; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-warn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}
