:root {
  --bg-deep: #0a0e1a;
  --bg-surface: #111728;
  --bg-elevated: #161d33;
  --bg-elevated-2: #1a2342;
  --accent: #4f7df5;
  --accent-2: #22d3a7;
  --accent-glow: rgba(79, 125, 245, 0.35);
  --text-primary: #e8ecf4;
  --text-secondary: #8a93ad;
  --text-dim: #5b6480;
  --border: rgba(140, 160, 220, 0.10);
  --border-strong: rgba(140, 160, 220, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(79,125,245,0.35), 0 8px 28px rgba(79,125,245,0.25);

  --warn: #f5b14f;
  --danger: #f56e6e;
  --ok: var(--accent-2);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(79,125,245,0.12), transparent 60%),
              radial-gradient(900px 500px at 110% 10%, rgba(34,211,167,0.08), transparent 60%),
              var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 48px 20px;
}

.system-status .status-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-elevated));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.status-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.status-header p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.header-right { display: flex; align-items: center; gap: 14px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(34,211,167,0.10);
  color: var(--accent-2);
  border: 1px solid rgba(34,211,167,0.25);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
}
.status-pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2);
}
.last-updated { font-size: 12px; color: var(--text-dim); }

/* Pulse */
.pulse-dot { position: relative; width: 36px; height: 36px; display: grid; place-items: center; }
.pulse-core { width: 10px; height: 10px; background: var(--accent-2); border-radius: 50%; box-shadow: 0 0 12px var(--accent-2); }
.pulse-ring {
  position: absolute; inset: 4px; border-radius: 50%;
  border: 2px solid var(--accent-2);
  animation: pulse 2s ease-out infinite;
  opacity: 0;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Block */
.status-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-lg);
}
.block-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.status-block h3 {
  margin: 0;
  font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-primary);
}
.status-block h3 .num {
  font-size: 11px; color: var(--text-dim);
  background: var(--bg-elevated-2);
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border-strong);
  font-weight: 500;
}
.refresh-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elevated); color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 12px;
  font-size: 12px; cursor: pointer; transition: all .2s;
}
.refresh-btn:hover { color: var(--text-primary); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Status grid */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.status-item {
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-elevated-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.status-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.si-top { display: flex; justify-content: space-between; align-items: center; }
.si-icon { font-size: 20px; }
.label { color: var(--text-secondary); font-size: 13px; }
.value {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
}
.value .dot { width: 6px; height: 6px; border-radius: 50%; }
.value.stable { color: var(--accent-2); background: rgba(34,211,167,0.10); border: 1px solid rgba(34,211,167,0.25); }
.value.stable .dot { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.value.active { color: var(--accent); background: rgba(79,125,245,0.10); border: 1px solid rgba(79,125,245,0.25); }
.value.active .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

.meter {
  height: 6px; background: rgba(255,255,255,0.04);
  border-radius: 999px; overflow: hidden;
}
.meter > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 1s ease;
}
.meta { font-size: 11px; color: var(--text-dim); }

/* Tabs */
.tabs {
  display: flex; gap: 4px;
  background: var(--bg-elevated);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab {
  flex: 1; min-width: 160px;
  background: transparent; border: 0;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .2s;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 4px 14px rgba(0,0,0,0.3);
}
.tab-dot { width: 8px; height: 8px; border-radius: 50%; }
.tab-dot.known { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.tab-dot.fixed { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.tab-dot.planned { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.tab-count {
  background: rgba(255,255,255,0.06);
  font-size: 11px; padding: 2px 7px;
  border-radius: 999px; color: var(--text-secondary);
}

.tab-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 12px;
  margin-bottom: 14px; color: var(--text-dim);
}
.tab-search input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text-primary); font-size: 13px;
}
.tab-search input::placeholder { color: var(--text-dim); }

/* Panels & lists */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.issue-list, .fix-list, .plan-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.issue-list li, .fix-list li, .plan-list li {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  transition: border-color .2s, transform .2s, background .2s;
}
.issue-list li:hover, .fix-list li:hover, .plan-list li:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated-2);
  transform: translateX(2px);
}
.li-main { display: flex; gap: 12px; align-items: center; }
.li-main strong { display: block; font-size: 14px; }
.li-main p { margin: 2px 0 0; color: var(--text-secondary); font-size: 12px; }
.li-meta { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

.sev {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 9px; border-radius: 6px;
  text-transform: uppercase; flex-shrink: 0;
}
.sev-low { color: var(--warn); background: rgba(245,177,79,0.12); border: 1px solid rgba(245,177,79,0.25); }
.sev-med { color: var(--danger); background: rgba(245,110,110,0.12); border: 1px solid rgba(245,110,110,0.25); }
.sev-fix { color: var(--accent-2); background: rgba(34,211,167,0.12); border: 1px solid rgba(34,211,167,0.25); }
.sev-plan { color: var(--accent); background: rgba(79,125,245,0.12); border: 1px solid rgba(79,125,245,0.25); }

.empty-state {
  text-align: center; color: var(--text-dim);
  padding: 30px; font-size: 13px;
}

@media (max-width: 600px) {
  body { padding: 24px 12px; }
  .status-block, .status-header { padding: 18px; }
  .li-meta { display: none; }
}