:root {
  --bg: #f4f6f8; --panel: #ffffff; --line: #dfe4ea; --text: #17202a; --muted: #64707d;
  --accent: #0f766e; --accent-soft: #d9f2ee; --ok: #15803d; --ok-soft: #dcfce7;
  --bad: #b91c1c; --bad-soft: #fee2e2; --warn: #a16207; --warn-soft: #fef3c7; --code: #f1f4f7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418; --panel: #171e24; --line: #2a343d; --text: #e6ebef; --muted: #93a0ac;
    --accent: #2dd4bf; --accent-soft: #123b37; --ok: #4ade80; --ok-soft: #12351f;
    --bad: #f87171; --bad-soft: #3f1a1a; --warn: #facc15; --warn-soft: #3a300d; --code: #10161b;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono, code, pre { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.layout { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { font-weight: 700; font-size: 17px; padding: 0 8px 2px; }
.brand span { color: var(--accent); }
.side .env { padding: 0 8px 16px; }
.nav a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); margin-bottom: 2px; }
.nav a:hover { background: var(--code); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .who { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.main { padding: 24px 28px 60px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.bankcard { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--accent)); border-radius: 10px; padding: 14px; }
.bankcard .name { font-weight: 700; font-size: 15px; }
.bankcard dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 10px 0 0; }
.bankcard dt { color: var(--muted); }
.bankcard dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--code); }
tr.off td { opacity: .5; }
.tablewrap { overflow-x: auto; }
.tablewrap table { min-width: 880px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--code); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); margin-right: 6px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
button { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 14px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { button.primary { color: #06201d; } }
button:disabled { opacity: .55; cursor: default; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }

pre { background: var(--code); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; overflow: auto; max-height: 340px; white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 5px 12px; margin-bottom: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.note { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 0 7px 7px 0; margin-bottom: 8px; }
.note.err { border-color: var(--bad); background: var(--bad-soft); }
.note.good { border-color: var(--ok); background: var(--ok-soft); }

.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 10; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--panel); border-left: 1px solid var(--line); z-index: 11; padding: 20px 22px; overflow-y: auto; }
.drawer .close { float: right; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.form label.wide { grid-column: 1 / -1; }
.form input, .form select { color: var(--text); }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 110px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .stack { width: 100%; max-width: 46px; display: flex; flex-direction: column-reverse; border-radius: 4px; overflow: hidden; min-height: 2px; background: var(--line); }
.bars .s { background: var(--ok); }
.bars .f { background: var(--bad); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 340px; margin: 0; }
.login label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 12.5px; }
.login input { color: var(--text); }
.login button { width: 100%; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px; }
  .side .env, .side .who { padding: 0 8px; border: 0; margin: 0; }
  .nav { display: flex; flex-wrap: wrap; }
  .main { padding: 16px; }
  .form { grid-template-columns: 1fr; }
}
