/* Plain CSS. No preprocessor, no framework, nothing to compile. */

:root {
  --ink: #14181d;
  --muted: #6b7480;
  --line: #dfe3e8;
  --ok: #2e7d4f;
  --bad: #c0392b;
  --accent: #3d8bfd;
  --paper: #fbfbfa;
  --stale: #9ca3af;
  --note: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

/* --- header --- */

header {
  padding: 20px 28px 14px;
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 24px 0 8px; }

.tagline { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.header-link {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}

.header-link:hover { text-decoration: underline; }

/* --- controls --- */

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  flex-wrap: wrap;
}

.controls label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.controls select {
  font: inherit;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  min-width: 220px;
}

.range-buttons {
  display: flex;
  gap: 0;
}

.range-buttons button {
  font: inherit;
  font-size: 13px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
  color: var(--muted);
}

.range-buttons button:first-child { border-radius: 6px 0 0 6px; }
.range-buttons button:last-child { border-radius: 0 6px 6px 0; }
.range-buttons button + button { border-left: none; }

.range-buttons button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.range-buttons button:hover:not(.active) {
  border-color: var(--accent);
  color: var(--ink);
}

button#refresh {
  font: inherit;
  font-size: 13px;
  padding: 5px 14px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  margin-left: auto;
}

button#refresh:hover { border-color: var(--accent); color: var(--ink); }

/* --- status line --- */

.status-line {
  padding: 0 28px;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* --- main content --- */

main {
  padding-bottom: 60px;
}

.live-section, .chart-section {
  padding: 0 28px;
}

/* --- table --- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 4px;
}

th, td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Red means failure and nothing else. */
tr.row-ok td.status-cell { color: var(--ok); }
tr.row-fail td.status-cell { color: var(--bad); }
tr.row-stale td.status-cell { color: var(--stale); }

td.latency-cell {
  font-variant-numeric: tabular-nums;
}

.note {
  color: var(--note);
  font-size: 12px;
}

/* --- empty states --- */

.empty-message {
  color: var(--muted);
  font-size: 14px;
  padding: 20px 0;
  font-style: italic;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
}

/* --- chart --- */

#history-chart {
  margin-top: 8px;
}

/* --- responsive --- */

@media (max-width: 600px) {
  .controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls select {
    min-width: 100%;
  }

  button#refresh {
    margin-left: 0;
  }
}

/* --- nodes page --- */

.nodes-section {
  padding: 0 28px 60px;
}

.nodes-list table {
  margin-top: 8px;
}

