:root { --ink: #1c1c1c; --muted: #6b6b6b; --line: #e4e1dc; --bg: #f5f3ef; --accent: #1f6feb; --red: #c62a20; --r: 12px; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
h1 { font-size: 1.7rem; margin: 0; line-height: 1.15; }
h2 { font-size: 1.1rem; margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
code { font-size: .8rem; word-break: break-all; }

.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 18px; background: var(--ink); color: #ddd; }
.bar a { text-decoration: none; color: #ddd; padding: 4px 8px; border-radius: 8px; }
.bar a:hover { background: #333; color: #fff; }
.bar__brand { font-weight: 800; color: #fff !important; }
.bar__nav, .bar__end { display: flex; gap: 4px; flex-wrap: wrap; }
.bar__end { margin-left: auto; }

.main { max-width: 1000px; margin: 0 auto; padding: 22px 16px 60px; display: grid; gap: 16px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head .back { flex-basis: 100%; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 14px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.narrow { max-width: 460px; width: 100%; margin: 0 auto; }
.empty { text-align: center; }
.auth { max-width: 380px; width: 100%; margin: 8vh auto 0; }

.flash { padding: 10px 14px; border-radius: 10px; background: #e2f4e9; color: #0b6b37; font-weight: 500; }
.flash--err { background: #fde3e0; color: #a3170f; }
.flash a { color: inherit; font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: .6em 1.1em; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--sm { padding: .35em .8em; font-size: .85rem; }
.btn--block { width: 100%; }

.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f > span { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.f input, .f select { width: 100%; padding: .6em .75em; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; min-height: 42px; }
.f input:focus, .f select:focus { outline: none; border-color: var(--ink); }
.f small { font-size: .78rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f--wide { grid-column: 1 / -1; }
.toggle { display: flex; align-items: center; gap: 8px; }
.toggle input { width: 18px; height: 18px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; }
.stat span { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.stat strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat--bad strong { color: var(--red); }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.is-off td { opacity: .55; }
.acts { display: flex; gap: 4px; flex-wrap: wrap; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.portal { max-width: 640px; width: 100%; margin: 0 auto; display: grid; gap: 18px; }
.portal__head p { margin: 0; }

@media (max-width: 640px) {
  .grid2, .stats { grid-template-columns: 1fr; }
  .bar__end { margin-left: 0; }
}
