:root {
  --bg: #f4f6fb; --panel: #ffffff; --ink: #1d2433; --muted: #6b7385; --line: #e3e7f0;
  --brand: #1b2a6b; --accent: #2a5bd7; --ok: #1f7a4d; --warn: #b26a00; --bad: #b42335;
  --ok-bg: #e6f4ec; --warn-bg: #fff4e0; --bad-bg: #fdecee; --chip: #eef1f8;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
       color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
.side { width: 230px; background: var(--brand); color: #cfd6f3; padding: 18px 0; flex-shrink: 0; }
.side .logo { color: #fff; font-weight: 700; font-size: 17px; padding: 0 20px 14px; }
.side .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; padding: 14px 20px 4px; }
.side a { display: flex; justify-content: space-between; color: #dfe4fa; padding: 6px 20px; }
.side a:hover, .side a.on { background: rgba(255,255,255,.1); text-decoration: none; color: #fff; }
.side .badge { background: #f0b429; color: #222; border-radius: 9px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.main { flex: 1; padding: 22px 28px 60px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.tile .v { font-size: 22px; font-weight: 700; }
.tile .l { font-size: 12px; color: var(--muted); }
.tile .d { font-size: 12px; }
.up { color: var(--ok); } .down { color: var(--bad); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfe; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #fafbff; }
.scroll { overflow-x: auto; }
form.inline { display: inline; }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=url], select, textarea { width: 100%; padding: 7px 9px; border: 1px solid #cfd5e3; border-radius: 6px; font: inherit;
  background: #fff; }
textarea { min-height: 90px; }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; min-height: 420px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }
.check { display: flex; gap: 6px; align-items: center; color: var(--ink); font-size: 13px; margin: 8px 0; }
.check input { width: auto; }
.btn { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 7px 14px;
       border-radius: 6px; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn.light { background: #fff; color: var(--accent); }
.btn.bad { background: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 12px; font-weight: 500; }
.chip { display: inline-block; background: var(--chip); border-radius: 10px; padding: 1px 8px; font-size: 12px; margin: 1px 2px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.on { background: var(--accent); color: #fff; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 6px 6px 0 0; color: var(--muted); }
.tabs a.on { background: var(--panel); border: 1px solid var(--line); border-bottom-color: var(--panel); color: var(--ink);
             margin-bottom: -1px; }
.bar { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.heat td { text-align: center; font-size: 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters > div { min-width: 140px; }
.help { background: #f1f4ff; border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 4px; font-size: 13px; }
.pager { margin-top: 10px; display: flex; gap: 8px; }
iframe.preview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.login { max-width: 360px; margin: 10vh auto; }
pre.json { background: #f7f8fc; border: 1px solid var(--line); padding: 10px; border-radius: 6px; font-size: 12px;
           white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
@media (max-width: 900px) {
  .layout { flex-direction: column; } .side { width: 100%; } .g2, .g3 { grid-template-columns: 1fr; } .main { padding: 16px; }
}
