:root {
  --bg: #f6f7fb; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #4f46e5; --brand2: #06b6d4; --ok: #16a34a; --danger: #dc2626; --chip: #eef2ff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1020; --card: #121a2f; --text: #e5e7eb; --muted: #94a3b8; --line: #1f2a44; --chip: #1e1b4b; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--brand); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand2)); display: grid; place-items: center; color: #fff; font-weight: 800; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.btn { appearance: none; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn.secondary { background: var(--chip); color: var(--brand); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.muted { color: var(--muted); }
.err { color: var(--danger); min-height: 1.5em; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--chip); color: var(--brand); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--ok); }
.hidden { display: none !important; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat b { display: block; font-size: 26px; }
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); width: min(520px, calc(100vw - 32px)); padding: 20px; }
dialog::backdrop { background: rgb(0 0 0 / .45); }
