* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #060b14;
  --bg2: #0d1424;
  --glass: rgba(30, 41, 59, 0.85);
  --stroke: rgba(148, 163, 184, 0.3);
  --text: #f8fafc;
  --muted: #94a3b8;
  --ok: #4ade80;
  --warn: #facc15;
  --bad: #f87171;
  --off: #64748b;
}

body {
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, #1a2640 0%, transparent 45%),
    radial-gradient(circle at 100% 0%, #13203a 0%, transparent 35%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  min-height: 100vh;
}

.wallboard {
  width: min(1400px, 96vw);
  margin: 1.2rem auto 2rem;
  display: grid;
  gap: 1rem;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 1.2rem;
}

.logo-title-group {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.topbar-logo {
  height: 48px;
  width: auto;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

h1 { font-size: clamp(1.6rem, 3.8vw, 3rem); line-height: 1; }
h2 { font-size: 1rem; color: #dce6ff; margin-bottom: 0.8rem; }

.topbar-meta { text-align: right; color: var(--muted); font-size: 0.9rem; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.kpi-card {
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
}

.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.kpi-icon {
  width: 24px;
  height: 24px;
}

.kpi-name { font-size: 1.2rem; font-weight: 700; }

.state-pill {
  font-size: 0.74rem;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.state-available { color: var(--ok); background: rgba(74,222,128,.12); border-color: rgba(74,222,128,.35); }
.state-degraded { color: var(--warn); background: rgba(250,204,21,.12); border-color: rgba(250,204,21,.35); }
.state-outage { color: var(--bad); background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.35); }
.state-unavailable { color: var(--off); background: rgba(100,116,139,.2); border-color: rgba(100,116,139,.5); }

.kpi-metrics {
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.latency {
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  font-weight: 800;
}

.band { font-size: 0.8rem; padding: 0.15rem 0.45rem; border-radius: 8px; }
.band-good { color: var(--ok); background: rgba(74,222,128,.12); }
.band-warn { color: var(--warn); background: rgba(250,204,21,.12); }
.band-bad { color: var(--bad); background: rgba(248,113,113,.12); }

.sparkline { width: 100%; height: 56px; }

.provider-last-check {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.active-incident-msg {
  font-size: 0.8rem;
  color: #ff8080;
  margin-top: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.4rem 0.6rem;
  background: rgba(248,113,113,0.12);
  border-radius: 6px;
  border-left: 2px solid var(--bad);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.panel { padding: 1rem; min-height: 280px; }
.panel-wide { grid-column: 1 / -1; }
.chart-wrap { height: 240px; }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.panel-header h2 { margin-bottom: 0; }

.time-selector {
  display: flex;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid var(--stroke);
}

.time-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.time-btn.active { background: rgba(148,163,184,0.15); color: #f8fafc; }

.heatmap {
  display: grid;
  gap: 0.45rem;
  max-height: 240px;
  overflow: auto;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 86px repeat(12, 1fr);
  gap: 0.3rem;
  align-items: center;
}

.heatmap-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.heat-cell { height: 16px; border-radius: 3px; border: 1px solid rgba(255,255,255,.05); }
.heat-available { background: rgba(74,222,128,.95); }
.heat-degraded { background: rgba(250,204,21,.95); }
.heat-outage { background: rgba(248,113,113,.95); }
.heat-unavailable { background: rgba(100,116,139,.95); }

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  padding: 2rem 0 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  opacity: 0.7;
}

.footer-logo {
  height: 24px;
  width: auto;
  opacity: 0.6;
}

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
}
