:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #283548;
  --border: #334155;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.1);
  --orange: #fb923c;
  --orange-bg: rgba(251, 146, 60, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ─── Hero ─── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 14px;
  text-decoration: none; color: inherit;
}
.brand-logo {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--green), #059669);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: -2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Banner ─── */
main { padding: 40px 0 64px; }
.banner {
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 40px;
  display: flex; align-items: center; gap: 24px;
  border: 1px solid;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.banner-icon { font-size: 44px; flex-shrink: 0; }
.banner-text h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.banner-text p { color: var(--text-dim); font-size: 15px; }

.banner-loading { background: var(--bg-card); border-color: var(--border); }
.banner-operational {
  background: var(--green-bg);
  border-color: rgba(16, 185, 129, 0.3);
}
.banner-operational h1 { color: var(--green); }

.banner-degraded {
  background: var(--yellow-bg);
  border-color: rgba(245, 158, 11, 0.3);
}
.banner-degraded h1 { color: var(--yellow); }

.banner-partial_outage {
  background: var(--orange-bg);
  border-color: rgba(251, 146, 60, 0.3);
}
.banner-partial_outage h1 { color: var(--orange); }

.banner-major_outage {
  background: var(--red-bg);
  border-color: rgba(239, 68, 68, 0.3);
}
.banner-major_outage h1 { color: var(--red); }

/* ─── Components ─── */
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 600;
}

.components-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.component-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}
.component-row:last-child { border-bottom: 0; }
.component-row:hover { background: var(--bg-card-hover); }

.component-info {
  display: flex; align-items: center; gap: 14px;
}
.component-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.status-dot {
  width: 12px; height: 12px; border-radius: 50%;
  flex-shrink: 0;
}
.status-dot[data-status="operational"] {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.status-dot[data-status="degraded"] {
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
}
.status-dot[data-status="down"] {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}
.status-dot[data-status="unknown"] {
  background: var(--text-muted);
}

.component-status {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.component-operational .component-status { color: var(--green); }
.component-degraded .component-status { color: var(--yellow); }
.component-down .component-status { color: var(--red); }

/* ─── Legend ─── */
.legend {
  margin-top: 40px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.legend h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 600;
}
.legend-items {
  display: flex; flex-direction: column; gap: 8px;
}
.legend-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
  color: var(--text-dim);
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 32px;
}
.footer-line {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.footer-meta { font-size: 12px; opacity: 0.8; }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .banner { flex-direction: column; align-items: flex-start; text-align: left; padding: 24px; }
  .banner-icon { font-size: 36px; }
  .banner-text h1 { font-size: 22px; }
  .component-row { padding: 16px 18px; }
  .component-name { font-size: 15px; }
}

/* ─── Refresh animation ─── */
@keyframes fadeIn {
  from { opacity: 0.6; }
  to { opacity: 1; }
}
.refreshing .components-list { animation: fadeIn 0.3s ease; }
