:root {
  --bg: #0a0a0b; --panel: #111113; --card: #141416; --line: #232327; --line2: #2e2e33;
  --text: #ededef; --muted: #8b8b93; --accent: #2b5cff; --accent2: #4a74ff;
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --r: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; display: flex; min-height: 100vh; }
a { color: var(--text); text-decoration: none; } a:hover { color: var(--accent2); }
h1 { font-size: 24px; margin: 4px 0; font-weight: 600; letter-spacing: -.01em; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 20px; margin: 2px 0 12px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
h3 { font-size: 14px; margin: 0 0 12px; font-weight: 600; }
.mt { margin-top: 24px; }
.muted { color: var(--muted); } small { font-size: 12px; }
code, pre { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; }
code { background: #1c1c20; padding: 1px 6px; border-radius: 5px; }

.side { width: 232px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand b { display: block; font-size: 15px; } .brand small { color: var(--muted); display: block; }
.logo { width: 32px; height: 32px; display: grid; place-items: center; background: var(--accent); border-radius: 9px; font-size: 16px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); }
.side nav a:hover { background: #18181b; color: var(--text); }
.side nav a.on { background: #1a1d29; color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.sec { color: #5c5c64; font-size: 11px; letter-spacing: .08em; padding: 14px 10px 4px; }

main { flex: 1; min-width: 0; padding: 28px 32px 60px; max-width: 1280px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.top p { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.card.narrow { width: 340px; display: flex; flex-direction: column; gap: 14px; }
.card.danger { border-color: #3a1d1f; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols.wide-left { grid-template-columns: 1.7fr 1fr; align-items: start; }
.cols > * { min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; } .between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.stat { background: #111114; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.stat small { color: var(--muted); } .stat b { font-size: 15px; font-weight: 600; }
.bar { display: block; height: 4px; background: #222; border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
#chart { width: 100%; background: linear-gradient(180deg, #16131c, #111114); border: 1px solid var(--line); border-radius: 10px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.list li:last-child { border: 0; }
.right { margin-left: auto; } .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); } .dot.bad { background: var(--bad); }

.pill, .tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; letter-spacing: .02em; }
.pill.ok { background: #0f2a1a; color: var(--ok); } .pill.warn { background: #2d2310; color: var(--warn); } .pill.bad { background: #2d1214; color: var(--bad); }
.tag { background: #1d2033; color: #9fb3ff; font-weight: 500; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border: 0; }
.kv td:first-child { color: var(--muted); width: 90px; }

label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12.5px; }
input, textarea, select { background: #0e0e10; border: 1px solid var(--line2); color: var(--text); border-radius: 8px; padding: 9px 11px; font: inherit; width: 100%; }
textarea { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #2b5cff33; }
.suffix { display: flex; } .suffix input { border-radius: 8px 0 0 8px; }
.suffix span { background: #18181b; border: 1px solid var(--line2); border-left: 0; border-radius: 0 8px 8px 0; padding: 9px 11px; color: var(--muted); white-space: nowrap; }
.search { margin-bottom: 16px; max-width: 360px; }

button, .btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 500; cursor: pointer; display: inline-block; white-space: nowrap; }
button:hover, .btn:hover { background: var(--accent2); color: #fff; }
.ghost { background: transparent; border: 1px solid var(--line2); color: var(--text); }
.ghost:hover { background: #1a1a1e; }
.bad { background: #b91c1c; } .bad:hover { background: var(--bad); }
.sm { padding: 5px 11px; font-size: 12.5px; }
form { margin: 0; }

.seg { display: inline-flex; background: #0e0e10; border: 1px solid var(--line2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg label { flex-direction: row; align-items: center; padding: 5px 14px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 13px; }
.seg input { display: none; }
.seg label:has(input:checked) { background: #1f2437; color: var(--text); }
.drop { border: 1.5px dashed var(--line2); border-radius: 10px; padding: 26px 12px; text-align: center; cursor: pointer; color: var(--muted); }
.drop:hover { border-color: var(--accent); color: var(--text); }
.drop input { display: none; }
details summary { cursor: pointer; color: var(--text); margin-bottom: 10px; }
.hint { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
pre { background: #0b0b0d; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; margin: 0; }
.console { height: 360px; white-space: pre-wrap; word-break: break-all; color: #cfd3dc; }

.flash { padding: 10px 14px; border-radius: 9px; margin-bottom: 16px; }
.flash.ok { background: #0f2a1a; color: #86efac; border: 1px solid #14532d; }
.flash.bad { background: #2d1214; color: #fca5a5; border: 1px solid #7f1d1d; }

.repos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.repo { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; min-height: 42px; }

body.login { align-items: center; justify-content: center; }

@media (max-width: 900px) {
  body { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .side nav { flex-direction: row; flex-wrap: wrap; } .sec { display: none; }
  main { padding: 20px 16px; }
  .cols, .cols.wide-left { grid-template-columns: 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  table { display: block; overflow-x: auto; }
}
