:root {
  --bg: #0b1020;
  --panel: #131a2e;
  --panel-2: #1a2340;
  --line: #2a3760;
  --text: #e6ecff;
  --dim: #8b96b8;
  --accent: #5b8cff;
  --green: #2fbf71;
  --amber: #f2b53e;
  --red: #e5484d;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #101731, #0d1326);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: 2px; }
.brand p { margin: 0; font-size: 12px; color: var(--dim); }
.logo {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #8a5bff);
  color: #fff; font-weight: 800; font-size: 20px;
}

.health-tile {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.warn { background: var(--amber); }
.dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }

main { max-width: 1080px; margin: 0 auto; padding: 18px 22px 40px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--dim); }
.card .empty { color: var(--dim); font-style: italic; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.statusline {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.statusline-left, .statusline-right { display: flex; align-items: center; gap: 10px; }
.pill {
  border: 1px solid var(--line); color: var(--dim);
  border-radius: 999px; padding: 2px 10px; font-size: 12px;
}

.toolbar { display: flex; align-items: center; gap: 12px; }
select {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: 13px;
}
.dim { color: var(--dim); font-size: 12px; }
canvas { width: 100%; border-radius: 8px; margin-top: 8px; background: var(--panel-2); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-size: 12px; font-weight: 600; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; }
.badge.ok   { background: rgba(47,191,113,.16); color: var(--green); }
.badge.warn { background: rgba(242,181,62,.16);  color: var(--amber); }
.badge.bad  { background: rgba(229,72,77,.16);   color: var(--red); }
.badge.neutral { background: rgba(139,150,184,.14); color: var(--dim); }

footer {
  max-width: 1080px; margin: 0 auto; padding: 16px 22px 30px;
  display: flex; justify-content: space-between;
  color: var(--dim); font-size: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
}

/* Stale / unavailable marker (honest states). */
.stale-mark { color: var(--amber); }
.unavail-mark { color: var(--red); }
.ok-mark { color: var(--green); }