:root {
  --bg: #f6f7f9;
  --panel: #fff;
  --ink: #1c2128;
  --muted: #62707f;
  --line: #dfe3e8;
  --accent: #2b5f9e;
  --ok: #1a7f45;
  --bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --panel: #1c2027; --ink: #e6e9ee; --muted: #9aa5b1;
    --line: #2c323b; --accent: #6ea8e8; --ok: #4cc17e; --bad: #f2837b;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { font-weight: 600; }
.topbar nav { display: flex; gap: 18px; margin-right: auto; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.on { color: var(--accent); border-bottom-color: var(--accent); }

main { padding: 28px 20px 64px; }
h1 { font-size: 22px; margin: 0 0 20px; }
h2 { font-size: 16px; margin: 32px 0 12px; }
.muted { color: var(--muted); font-size: 13.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.break { word-break: break-all; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
       background: var(--bg); padding: 1px 5px; border-radius: 4px; }

.cards { display: flex; gap: 14px; flex-wrap: wrap; }
.card { flex: 1 1 160px; background: var(--panel); border: 1px solid var(--line);
        border-radius: 10px; padding: 16px; color: var(--muted); font-size: 13px; }
.card .big { display: block; font-size: 26px; font-weight: 600; color: var(--ink); }

.panel { background: var(--panel); border: 1px solid var(--line);
         border-radius: 10px; padding: 18px; margin-bottom: 24px; }
.panel h2 { margin-top: 0; }

table { width: 100%; border-collapse: collapse; background: var(--panel);
        border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
table.wide { display: block; overflow-x: auto; white-space: nowrap; }
table.wide .break { white-space: normal; }

form.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
input, select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px;
                background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { padding: 8px 15px; border: 0; border-radius: 6px; background: var(--accent);
         color: #fff; font: inherit; font-weight: 500; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button.small { padding: 5px 10px; font-size: 13px; }
button.danger { background: var(--bad); }
button.link { background: none; color: var(--muted); padding: 0; font-size: 13px; text-decoration: underline; }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.success { background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid var(--ok); }
.flash.error { background: color-mix(in srgb, var(--bad) 14%, transparent); border: 1px solid var(--bad); }
.ok { color: var(--ok); font-weight: 500; }
.bad { color: var(--bad); font-weight: 500; }

.log { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
       padding: 14px; overflow-x: auto; font-family: ui-monospace, Menlo, Consolas, monospace;
       font-size: 12px; line-height: 1.55; max-height: 65vh; overflow-y: auto; }
.filters { margin-bottom: 18px; }

.login { max-width: 340px; margin: 12vh auto; background: var(--panel);
         border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.login h1 { margin-bottom: 2px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.login button { width: 100%; padding: 10px; }
