:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e5e5e8;
  --text: #1d1d1f;
  --text-muted: #6c6c70;
  --accent: #0066cc;
  --green: #34a853;
  --red: #ea4335;
  --gray: #b6b6bb;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 20px; }
.topbar h1 a { color: inherit; text-decoration: none; }
.topbar nav a {
  margin-left: 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}
.topbar nav a:hover { color: var(--accent); }

main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gray);
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi--up { border-left-color: var(--green); }
.kpi--down { border-left-color: var(--red); }

.kpi-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 22px; font-weight: 600; }

table.monitors {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.monitors th, .monitors td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}
.monitors th {
  background: #fafafb;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.monitors tbody tr:last-child td { border-bottom: none; }
.monitors td.num { text-align: right; font-variant-numeric: tabular-nums; }
.monitors td.target { color: var(--text-muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; word-break: break-all; }
.monitors td.error { color: var(--red); font-size: 12px; }
.monitors td.empty { text-align: center; color: var(--text-muted); padding: 24px; }
.row--down { background: #fff2f2; }
.row--disabled { opacity: 0.55; }

.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  vertical-align: middle;
}
.dot--green { background: var(--green); }
.dot--red { background: var(--red); }
.dot--gray { background: var(--gray); }

.footer-note {
  text-align: right;
  color: var(--text-muted);
  font-size: 12px;
  margin: 16px 0 0;
}

footer {
  text-align: center;
  margin: 32px 0 16px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .monitors { font-size: 13px; }
  .monitors td.target { font-size: 11px; }
  .totals { grid-template-columns: 1fr 1fr; }
}
