
:root {
  color-scheme: light dark;
  --bg: #fff; --side: #fafafa; --line: #e8e9ec; --line-soft: #f1f2f4;
  --ink: #16181d; --muted: #62697a; --faint: #9aa0ad;
  --accent: #3d5afe; --accent-soft: #eef1ff;
  --ok: #15803d; --bad: #dc2626; --bar: #dfe4fd;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --side: #14161b; --line: #24272f; --line-soft: #1b1e24;
          --ink: #e8eaee; --muted: #9199a8; --faint: #6a7180;
          --accent: #7d94ff; --accent-soft: #1a1f38; --ok: #4ade80; --bad: #f87171;
          --bar: #232a45; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
       -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.shell.collapsed { grid-template-columns: 56px 1fr; }
aside { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
        gap: 2px; padding: 10px; background: var(--side);
        border-right: 1px solid var(--line); }
.shell.collapsed aside { padding: 10px 8px; }
.side-head { display: flex; align-items: center; height: 40px; margin-bottom: 6px; }
.brand { flex: 1; padding-left: 10px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.toggle { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0;
          border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer;
          padding: 0; }
.toggle:hover { background: var(--line); color: var(--ink); }
.shell.collapsed .brand { display: none; }
.shell.collapsed .side-head { justify-content: center; }

nav { display: flex; flex-direction: column; gap: 2px; min-height: 0;
      overflow: hidden auto; }
.item { flex: none; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
        border-radius: 8px; color: var(--muted); font-size: 14px; white-space: nowrap;
        border: 0; background: none; font-family: inherit; cursor: pointer; width: 100%; }
.item:hover { background: var(--line-soft); color: var(--ink); }
.item.on { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.item svg, .item .avatar { flex: none; }
.avatar { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px;
          background: var(--line); color: var(--muted); font-size: 9px; font-weight: 700; }
.item.on .avatar { background: var(--accent); color: #fff; }
.item .label { overflow: hidden; text-overflow: ellipsis; }
.shell.collapsed .item { padding: 0; justify-content: center; }
.shell.collapsed .item .label, .shell.collapsed .group { display: none; }
.group { flex: none; margin: 14px 10px 4px; font-size: 11px; font-weight: 600; color: var(--faint);
         letter-spacing: .04em; }
.side-foot { flex: none; margin-top: auto; padding-top: 6px; }

/* ---- page ---- */
main { padding: 34px 36px 80px; min-width: 0; }
.wrap { max-width: 900px; margin: 0 auto; }
.head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 6px; }
.head form { margin-left: auto; }
h1 { margin: 0; font-size: 21px; font-weight: 620; letter-spacing: -.02em; }
h1.mono { font-size: 20px; letter-spacing: 0; }
.facts { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.facts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
section { margin-top: 30px; }
.title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 13px;
         font-weight: 600; }
.title a { color: var(--accent); font-weight: 500; font-size: 12.5px; }
.box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.box.pad { padding: 14px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

/* ---- tables ---- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 550; color: var(--faint); padding: 9px 14px;
     white-space: nowrap; background: var(--side); border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-top: 1px solid var(--line-soft); white-space: nowrap; }
tbody tr:first-child td { border-top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.act { text-align: right; padding: 6px 8px; }
.code-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px;
             font-weight: 550; }
.code-link:hover { color: var(--accent); }
tr.fresh td { background: var(--accent-soft); }
tr.fresh td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.fresh-note { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px;
              font-size: 13px; color: var(--accent); }
.fresh-note a { font-weight: 550; }
.empty { padding: 34px 16px; text-align: center; color: var(--faint); font-size: 13.5px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px;
       vertical-align: 1px; background: var(--ok); }
.dot.off { background: var(--faint); }

/* ---- forms ---- */
.fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; min-width: 0; }
legend { color: var(--muted); font-size: 12px; }
label.check { flex-direction: row; align-items: center; gap: 7px; height: 34px; }
input, select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px;
                background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px; }
input[type=date] { padding-right: 6px; }
input[type=file] { padding: 6px 8px; }
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--accent);
                            box-shadow: 0 0 0 3px var(--accent-soft); }
button { height: 34px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px;
         background: var(--accent); color: #fff; font: inherit; font-size: 13.5px; font-weight: 550;
         cursor: pointer; }
button:hover { filter: brightness(1.07); }
button.quiet { height: 28px; padding: 0 9px; background: none; color: var(--muted);
               font-weight: 450; font-size: 13px; }
button.quiet:hover { background: var(--line-soft); color: var(--ink); filter: none; }
button.quiet.risk:hover { color: var(--bad); }
.warn { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; font-size: 13px;
        color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); }

/* ---- bars ---- */
.bars { display: grid; gap: 6px; }
.bars .b { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 10px;
           align-items: center; padding: 6px 10px; border-radius: 6px; font-size: 13.5px; }
.bars .fill { position: absolute; inset: 0 auto 0 0; background: var(--bar); border-radius: 6px; }
.bars .b > span { position: relative; }
.bars .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ---- login ---- */
.login { width: 300px; margin: 16vh auto; }
.login h1 { margin-bottom: 18px; text-align: center; }
.login form { display: grid; gap: 14px; }
.login button { width: 100%; }
