:root { --bg:#f3f5f9; --card:#fff; --text:#1b2233; --muted:#667085; --line:#e2e6ee; --accent:#1d4ed8; --ok:#15803d; --warn:#b45309; --bad:#b91c1c; }
* { box-sizing:border-box; }
body { margin:0; font:14px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:var(--text); background:var(--bg); display:flex; min-height:100vh; }
a { color:var(--accent); text-decoration:none; } a:hover { text-decoration:underline; }
h1 { font-size:22px; margin:0 0 16px; } h2 { font-size:15px; margin:0 0 12px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.muted { color:var(--muted); } .right { margin-left:auto; } .nowrap { white-space:nowrap; } .num { text-align:right; white-space:nowrap; } .pre { white-space:pre-wrap; }

aside { width:220px; flex:none; background:#101828; color:#fff; padding:18px 12px; display:flex; flex-direction:column; gap:14px; position:sticky; top:0; height:100vh; }
.brand { font-weight:700; font-size:16px; padding:0 8px; } .brand small { display:block; font-weight:400; color:#98a2b3; }
nav { display:flex; flex-direction:column; gap:2px; flex:1; }
nav a { color:#d0d5dd; padding:8px 10px; border-radius:8px; display:flex; justify-content:space-between; align-items:center; }
nav a:hover { background:#1d2939; text-decoration:none; } nav a.on { background:var(--accent); color:#fff; }
nav b { background:#f04438; color:#fff; border-radius:10px; padding:0 7px; font-size:12px; }
aside .btn.ghost { color:#d0d5dd; border-color:#344054; background:transparent; width:100%; }
main { flex:1; min-width:0; padding:24px 28px 60px; max-width:1200px; }

.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px 18px; margin-bottom:16px; }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:12px; margin-bottom:16px; }
.cards .card { margin:0; }
.stat { display:flex; flex-direction:column; gap:2px; color:inherit; } a.stat:hover { text-decoration:none; border-color:var(--accent); }
.stat span { color:var(--muted); font-size:13px; } .stat b { font-size:28px; line-height:1.2; } .stat small { color:var(--muted); }
.stat.ok b { color:var(--ok); } .stat.warn b { color:var(--warn); } .stat.bad b { color:var(--bad); }
.stat.live b::before { content:""; display:inline-block; width:10px; height:10px; border-radius:50%; background:#22c55e; margin-right:8px; vertical-align:middle; animation:pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity:.3; } }
.two { display:grid; grid-template-columns:1fr 1fr; gap:16px; } .two .card { margin-bottom:16px; }

table { width:100%; border-collapse:collapse; } th { text-align:left; font-size:12px; color:var(--muted); font-weight:600; }
th, td { padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:top; } tr:last-child td { border-bottom:0; }
tr.off td { opacity:.5; } .scroll { overflow-x:auto; }

.badge { display:inline-block; padding:1px 8px; border-radius:10px; font-size:12px; background:#eef1f6; color:#344054; white-space:nowrap; font-weight:500; }
.badge.ok { background:#dcfce7; color:var(--ok); } .badge.warn { background:#fef3c7; color:var(--warn); } .badge.bad { background:#fee2e2; color:var(--bad); }
.dot { width:12px; height:12px; border-radius:50%; display:inline-block; }

.btn { display:inline-block; font:inherit; font-weight:600; background:var(--accent); color:#fff; border:1px solid var(--accent); border-radius:8px; padding:8px 16px; cursor:pointer; }
.btn:hover { filter:brightness(1.08); text-decoration:none; } .btn.sm { padding:5px 11px; font-size:13px; }
.btn.ghost { background:#fff; color:var(--text); border-color:var(--line); } .btn.danger { background:var(--bad); border-color:var(--bad); }
label { display:block; margin:0 0 12px; font-size:13px; color:#344054; font-weight:500; }
input, select, textarea { display:block; width:100%; margin-top:4px; font:inherit; padding:8px 10px; border:1px solid #cfd5e0; border-radius:8px; background:#fff; color:var(--text); }
input[type=color] { padding:2px; height:38px; } input[type=checkbox], input[type=radio] { display:inline; width:auto; margin:0 6px 0 0; }
input:focus, select:focus, textarea:focus { outline:2px solid #bfd3ff; border-color:var(--accent); }
label.check, label.radio { display:flex; align-items:flex-start; gap:4px; font-weight:400; } label.radio input { margin-top:4px; }
.grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.filters input, .filters select { width:auto; margin:0; min-width:160px; }
form.inline { display:inline; }
.pager { display:flex; gap:8px; align-items:center; padding-top:12px; }

.flash { padding:10px 14px; border-radius:8px; margin-bottom:16px; background:#dcfce7; color:#14532d; } .flash.err { background:#fee2e2; color:#7f1d1d; }
details { border-top:1px solid var(--line); padding:10px 0 2px; } details summary { cursor:pointer; color:var(--accent); font-weight:500; margin-bottom:10px; }
.inbox .q { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:10px; } .inbox .q b { font-size:15px; }
pre { background:#101828; color:#e4e7ec; padding:12px; border-radius:8px; overflow-x:auto; font-size:12px; white-space:pre-wrap; word-break:break-all; }
code { background:#eef1f6; padding:1px 5px; border-radius:4px; } ul { padding-left:18px; } li { margin-bottom:6px; }

.chart { display:flex; align-items:flex-end; gap:4px; height:190px; padding-top:18px; }
.chart .col { flex:1; min-width:0; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:3px; }
.chart em { font-style:normal; font-size:11px; color:var(--muted); } .chart small { font-size:10px; color:var(--muted); white-space:nowrap; }
.chart .bar { width:100%; max-width:34px; background:#f5b971; border-radius:4px 4px 0 0; display:flex; flex-direction:column; justify-content:flex-end; overflow:hidden; min-height:0; }
.chart .bar div { background:#16a34a; }
.legend { margin-left:auto; font-weight:400; font-size:12px; color:var(--muted); } .legend .k { display:inline-block; width:10px; height:10px; border-radius:2px; margin:0 4px 0 10px; }
.k.ok { background:#16a34a; } .k.rest { background:#f5b971; }

body.auth { align-items:center; justify-content:center; } .authbox { width:340px; max-width:92vw; } .authbox h1 { margin-bottom:4px; }
@media (max-width:820px) { body { flex-direction:column; } aside { width:auto; height:auto; position:static; } nav { flex-direction:row; flex-wrap:wrap; }
  main { padding:16px; } .two, .grid3 { grid-template-columns:1fr; } }
