:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1d2330; --muted: #667085; --line: #e3e6eb;
  --accent: #2563eb; --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1419; --card: #182029; --text: #e6e9ee; --muted: #93a0b0; --line: #2a3441;
          --accent: #60a5fa; --ok: #22c55e; --warn: #f59e0b; --bad: #f87171; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding: 12px 16px;
         background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
nav a.on, nav a:hover { color: var(--text); background: var(--bg); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 8px 0 16px; } h2 { font-size: 17px; margin: 24px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.banner { display: flex; gap: 12px; align-items: center; font-size: 18px; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.failed, .dot.bad { background: var(--bad); } .dot.pending, .dot.warn { background: var(--warn); }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
table { width: 100%; border-collapse: collapse; } td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 14px; }
.scroll { overflow-x: auto; }
button, .btn { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
               color: var(--text); cursor: pointer; min-height: 40px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
                          background: var(--bg); color: var(--text); min-height: 40px; max-width: 100%; }
label { display: block; margin: 10px 0 4px; font-size: 14px; color: var(--muted); }
pre { background: var(--bg); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.badge { background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.bars div { flex: 1; background: var(--ok); border-radius: 3px 3px 0 0; min-height: 2px; }
.bars div.f { background: var(--bad); }
.flow { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.flow:last-child { border-bottom: 0; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg);
         padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; }
.login { max-width: 360px; margin: 10vh auto; }
.login input { width: 100%; }
a { color: var(--accent); }
@media (max-width: 600px) { td, th { padding: 6px 4px; font-size: 14px; } h1 { font-size: 20px; } }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
@media (prefers-color-scheme: dark) { button.primary { color: #0b1220; } }
