:root {
  --bg: #0e1116;
  --surface: #171c24;
  --surface-2: #1f2630;
  --border: #2a323d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3b82f6;
  --up: #3fb950;
  --down: #f85149;
  --warn: #d29922;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

.muted { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--surface);
  border-block-end: 1px solid var(--border);
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.1rem; margin: 0; }
.topbar-end { display: flex; align-items: center; gap: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  background: var(--surface-2);
}
.btn:hover { border-color: var(--accent); }

.page {
  max-inline-size: 1100px;
  margin-inline: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* responsive card grids — no media queries needed */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.card-top { display: flex; align-items: center; gap: 0.5rem; }
.card-title { font-weight: 600; font-size: 0.95rem; }
.card-sub { font-size: 0.82rem; }
.card-value { font-size: 0.9rem; margin-block-start: auto; }

.dot {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}
.dot.up { color: var(--up); background: var(--up); }
.dot.down { color: var(--down); background: var(--down); }
.dot.warn { color: var(--warn); background: var(--warn); }

.block { display: flex; flex-direction: column; gap: 0.75rem; }
.block-head, .panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.block-head h2, .panel-head h2 { font-size: 1rem; margin: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.bar {
  block-size: 12px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  block-size: 100%;
  inline-size: 0;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  transition: inline-size .4s ease;
}
.bar-fill.warn { background: linear-gradient(90deg, var(--warn), #f0c14b); }
.bar-fill.danger { background: linear-gradient(90deg, var(--down), #ff7b72); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { inline-size: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.6rem 0.8rem; text-align: start; white-space: nowrap; }
thead th { background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: 0.8rem; }
tbody tr { border-block-start: 1px solid var(--border); }
tbody tr:hover { background: var(--surface); }
td.num { font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--surface-2);
}
.pill.up { color: var(--up); }
.pill.down { color: var(--muted); }

/* login */
.login-wrap { min-block-size: 100dvb; display: grid; place-content: center; padding: 1rem; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  inline-size: min(360px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login-card h1 { margin: 0; font-size: 1.25rem; }
.login-card input {
  inline-size: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}
.login-card input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-card button {
  padding: 0.7rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}
.login-card .err { color: var(--down); font-size: 0.85rem; }
