/*
 * Monochrome monitoring surface. Typography + spacing do the work.
 * One tonal scale (neutral) + three semantic status colours.
 */

:root {
  --bg: #fafaf9;
  --bg-elev: #ffffff;
  --bg-hover: #f4f4f5;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --text: #0a0a0a;
  --text-muted: #57534e;
  --text-subtle: #a8a29e;
  --accent: #0a0a0a;
  --pass: #10b981;
  --warn: #f59e0b;
  --fail: #ef4444;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }

code, kbd, pre, .mono { font-family: var(--mono); font-feature-settings: "zero", "ss01"; }

/* ─── Layout shell ────────────────────────────────────────────── */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pass);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.nav {
  display: flex;
  gap: 2px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.nav a {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 120ms ease;
}
.nav a.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Cards + KPIs ───────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 800px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
.kpi {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Section headers ─────────────────────────────────────── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  margin-top: 28px;
}
.section-head h2 {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 600;
}
.section-head .hint { font-size: 12px; color: var(--text-subtle); }

/* ─── Platform card ─────────────────────────────────────── */
.platforms {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}
.platform-row {
  display: grid;
  grid-template-columns: 140px 1fr 120px 120px 120px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.platform-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.bar-track {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 3px; }
.bar-fill.pass { background: var(--pass); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.fail { background: var(--fail); }
.platform-metric {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.platform-metric small { display: block; color: var(--text-subtle); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
@media (max-width: 800px) {
  .platform-row { grid-template-columns: 100px 1fr 80px; }
  .platform-row .only-wide { display: none; }
}

/* ─── Tables ─────────────────────────────────────── */
.table {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.table-header, .table-row {
  display: grid;
  gap: 12px;
  padding: 10px 16px;
  align-items: center;
}
.table-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.table-row {
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background 80ms ease;
}
.table-row:last-child { border-bottom: 0; }
.table-row:hover { background: var(--bg-hover); cursor: pointer; }
.table-row.no-hover:hover { background: transparent; cursor: default; }

.mono-cell {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

/* ─── Status indicators ─────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.pass { background: var(--pass); }
.status-dot.warn { background: var(--warn); }
.status-dot.fail { background: var(--fail); }
.status-dot.idle { background: var(--text-subtle); }
.status-dot.pulsing { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text-muted);
}
.pill.pass { background: rgba(16, 185, 129, 0.12); color: #047857; }
.pill.warn { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.pill.fail { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }

/* ─── Empty / skeleton states ─────────────────────────── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-title { color: var(--text); font-weight: 600; margin-bottom: 4px; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 0%, var(--border) 50%, var(--bg-hover) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Buttons + inputs ─────────────────────────── */
button, .btn {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 100ms ease, transform 80ms ease;
}
button:hover { opacity: 0.9; }
button:active { transform: scale(0.98); }
button.ghost {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
}
button.ghost:hover { border-color: var(--border-strong); background: var(--bg-hover); }

kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Sparkline container ─────────────────────────── */
.sparkline { width: 120px; height: 28px; display: block; }

/* ─── Page titles ─────────────────────────── */
.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 4px 0;
}
.page-subtitle { color: var(--text-muted); font-size: 13px; margin: 0 0 24px 0; }

/* ─── Utilities ─────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
