:root {
  --background: oklch(0.98 0.005 240);
  --foreground: oklch(0.2 0.02 240);
  --card: oklch(1 0 0);
  --muted: oklch(0.5 0.02 240);
  --border: oklch(0.92 0 0);
  --primary: oklch(0.62 0.17 135);
  --primary-fg: #fff;
  --accent: oklch(0.94 0.035 135);
  --ok: #15803d;
  --warn: #b45309;
  --crit: #b91c1c;
  --radius: 0.625rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.45;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}
.brand img { height: 40px; width: auto; }
.brand-mark {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 1rem;
}
.header-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--muted); }
.header-left { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.site-nav { display: flex; gap: 0.2rem; }
.site-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--foreground); background: oklch(0.95 0.01 240); }
.site-nav a.active { color: var(--foreground); background: var(--accent); }
.header-meta a, .text-btn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--muted);
  cursor: pointer; text-decoration: none;
}
.header-meta a:hover, .text-btn:hover { color: var(--foreground); }

main { max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.page { min-height: 100vh; display: flex; flex-direction: column; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.login-card { width: 100%; max-width: 26rem; }
.login-card h1 { margin: 0 0 0.35rem; font-size: 1.5rem; text-align: center; }
.login-card p.lead { margin: 0 0 1.25rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; }
input {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border);
  border-radius: 0.5rem; font: inherit; margin-bottom: 0.9rem; background: #fff;
}
input:focus { outline: 2px solid color-mix(in oklch, var(--primary) 40%, white); border-color: transparent; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; border: 0; border-radius: 0.5rem; padding: 0.65rem 1rem;
  font: inherit; font-weight: 600; background: var(--primary); color: var(--primary-fg);
  cursor: pointer;
}
.btn:disabled { opacity: 0.65; cursor: default; }
.btn-secondary {
  width: auto; background: oklch(0.95 0.01 240); color: var(--foreground);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.btn-row .btn { width: auto; }
.error {
  background: color-mix(in oklch, var(--crit) 10%, white);
  color: var(--crit);
  border-radius: 0.5rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
}
.ok-banner, .warn-banner, .crit-banner {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}
.ok-banner { background: #dcfce7; color: #166534; }
.warn-banner { background: #fef3c7; color: #92400e; }
.crit-banner { background: #fee2e2; color: #991b1b; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.metric h3 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.metric .val { font-size: 1.55rem; font-weight: 750; margin-top: 0.2rem; }
.metric .sub { font-size: 0.8rem; color: var(--muted); }
.bar { height: 6px; background: oklch(0.94 0.01 240); border-radius: 99px; overflow: hidden; margin-top: 0.6rem; }
.bar > i { display: block; height: 100%; background: var(--primary); }
.bar.warn > i { background: var(--warn); }
.bar.crit > i { background: var(--crit); }

.section-title { margin: 0 0 0.75rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge { font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 99px; }
.b-ok { background: #dcfce7; color: #166534; }
.b-warn { background: #fef3c7; color: #92400e; }
.b-crit { background: #fee2e2; color: #991b1b; }
.note { color: var(--muted); font-size: 0.88rem; margin: 0; }
.note a { color: inherit; }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--foreground); }
.updated { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
code { font-size: 0.85em; }
