:root {
  --bg: #f6f6f3; --surface: #fff; --text: #1d1d1b; --muted: #6b6b66; --line: #e3e2dc;
  --accent: #2f5bd3; --ok: #1f7a4a; --warn: #9a6400; --bad: #b3261e;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; color: var(--text); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --surface: #20201e; --text: #ecebe6; --muted: #9c9b94; --line: #33332f;
          --accent: #7b9cff; --ok: #5cc28a; --warn: #e0a842; --bad: #f08a80; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.top { display: flex; align-items: center; gap: 24px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 16px; flex: 1; }
.brand { font-weight: 700; color: var(--text); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.head h1 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; } .top { flex-wrap: wrap; gap: 12px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .props { grid-template-columns: 1fr; }
}
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
textarea { resize: vertical; }
button, .btn { font: inherit; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; cursor: pointer; display: inline-block; }
.btn:hover { text-decoration: none; }
button.secondary, .btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
button.link { background: none; color: var(--muted); padding: 0; }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; color: var(--muted); font-size: 13px; min-width: 160px; }
.kpi span { display: block; font-size: 22px; font-weight: 600; color: var(--text); }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: currentColor; }
.pill.bad { color: var(--bad); border-color: currentColor; }
.tag { display: inline-block; white-space: nowrap; font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; margin: 0 4px 4px 0; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; }
.flash.ok { color: var(--ok); } .flash.warn { color: var(--warn); } .flash.error { color: var(--bad); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { flex: 1; min-width: 220px; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; }
.props { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; margin: 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.qr { background: #fff; padding: 12px; width: fit-content; border-radius: 8px; }
.qr svg { width: 220px; height: 220px; display: block; }
pre { white-space: pre-wrap; word-break: break-all; font-size: 13px; }
code { font-size: 13px; background: var(--bg); padding: 1px 4px; border-radius: 4px; word-break: break-all; }
.row { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.btnrow { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; }
.btnrow.more { display: none; }
.btnrow:has(input:not(:placeholder-shown)) + .btnrow.more { display: grid; }
.big { font-size: 22px; font-weight: 600; margin: 0; }
.pill.warn { color: var(--warn); border-color: currentColor; }
.tg { background: var(--bg); border-radius: 12px; padding: 12px; max-width: 420px; }
.tg-media { background: var(--line); border-radius: 8px; padding: 32px 12px; text-align: center; color: var(--muted); margin-bottom: 8px; }
.tg-text { white-space: normal; line-height: 1.45; }
.tg-btn { margin-top: 6px; text-align: center; padding: 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--accent); font-size: 14px; }
form:has(> button.link) { margin: 0; }
.tg-btn.primary { background: #3390ec; color: #fff; border-color: #3390ec; }
.tg-btn.success { background: #31a24c; color: #fff; border-color: #31a24c; }
.tg-btn.danger { background: #e53935; color: #fff; border-color: #e53935; }
@media (max-width: 760px) { .btnrow { grid-template-columns: 1fr; } }
.tg-note { width: 140px; height: 140px; border-radius: 50%; background: var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); margin-bottom: 8px; }
