:root { --bg:#F3F5F4; --surface:#fff; --ink:#14201D; --muted:#5A6863; --line:#D3DAD7; --accent:#0E5C4F; --accent-ink:#fff; --signal:#E0A100; --ok:#1B7A4B; --err:#B3261E; --warn-soft:#FCEBDC; }
@media (prefers-color-scheme: dark) { :root { --bg:#0F1614; --surface:#17211E; --ink:#E6EEEB; --muted:#9AAAA4; --line:#2A3833; --accent:#4FC2A8; --accent-ink:#06201A; --ok:#5BD08F; --err:#F2938C; --warn-soft:#3A2617; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 16px; }
main.wide { max-width: 1100px; }
header.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
header.top h1 { margin: 0; }
section { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 10px; min-width: 0; }
h2 { margin: 0; font-size: 20px; } h3 { margin: 0; font-size: 16px; }
label { display: grid; gap: 4px; }
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--bg); min-width: 0; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .btn { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; justify-self: start; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.small { padding: 6px 12px; font-size: 14px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: 14px; }
.msg { font-size: 14px; min-height: 1.5em; margin: 0; }
.msg.err { color: var(--err); } .msg.ok { color: var(--ok); }
pre { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 12px; margin: 0; }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
code.secret { font-size: 15px; letter-spacing: .06em; word-break: break-all; background: var(--bg); padding: 4px 8px; border-radius: 6px; }
.code-input { font-size: 24px; letter-spacing: .3em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }
.notice { background: var(--warn-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
/* Admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--surface); min-width: 0; }
.card .head { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.err { color: var(--err); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td input { width: 90px; padding: 6px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { width: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.kpi .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 13px; color: var(--muted); }
.meter { height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter i.hot { background: var(--err); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-bottom: 1px solid var(--line); }
.bars i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 1px; }
.prices { display: flex; gap: 4px; align-items: center; }
.prices input { width: 58px; padding: 5px; font-size: 13px; }
table.spend th, table.spend td { white-space: normal; vertical-align: top; }
table.spend th:first-child, table.spend td:first-child { min-width: 130px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
