:root {
  --bg: #0f1222; --surface: #181c33; --surface-2: #20253f; --text: #eef0fb; --muted: #a3a8c3;
  --primary: #ff8a5b; --secondary: #3dd6c6; --danger: #ff5c7a; --border: #2c3254;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f6fb; --surface: #ffffff; --surface-2: #eef0f7; --text: #161a2e; --muted: #5b6080;
          --border: #d9dceb; }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg);
       color: var(--text); line-height: 1.45; }
header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px;
         border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; }
.brand svg { width: 28px; height: 28px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
        margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 40px auto; }
h1, h2 { margin: 0 0 12px; } h1 { font-size: 1.4rem; } h2 { font-size: 1.1rem; }
label { display: block; font-size: .9rem; color: var(--muted); margin: 10px 0 4px; }
input, select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
                background: var(--surface-2); color: var(--text); font-size: 1rem; }
button { cursor: pointer; border: 0; border-radius: 8px; padding: 9px 14px; font-weight: 600;
         background: var(--primary); color: #1b1020; }
button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); color: #fff; }
button:disabled { opacity: .6; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.stat .value { font-size: 1.4rem; font-weight: 700; color: var(--secondary); }
.stat .label { font-size: .85rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem;
         background: var(--surface-2); border: 1px solid var(--border); }
.badge.ok { color: var(--secondary); } .badge.warn { color: var(--danger); }
.message { margin-top: 10px; font-size: .92rem; min-height: 1.2em; }
.message.error { color: var(--danger); } .message.success { color: var(--secondary); }
.hidden { display: none; }
.muted { color: var(--muted); font-size: .88rem; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button.active { background: var(--secondary); color: #08201d; }
.row input, .row select { flex: 1; width: auto; min-width: 180px; }
