:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #eef0f4; --text: #1b1f27; --muted: #667085;
  --border: #dde1e8; --accent: #3b5bdb; --accent-text: #ffffff; --ok: #2b8a3e; --warn: #b7791f; --bad: #c92a2a;
  --ok-bg: #e6f4ea; --warn-bg: #fdf3e1; --bad-bg: #fde8e8; --info-bg: #e8edfd;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --surface: #171b23; --surface-2: #1f2430; --text: #e6e8ee; --muted: #98a2b3;
    --border: #2a3040; --accent: #7b93ff; --accent-text: #0f1218; --ok: #69db7c; --warn: #f6c453; --bad: #ff8787;
    --ok-bg: #1d3324; --warn-bg: #3a2f17; --bad-bg: #3d1f22; --info-bg: #1f2747;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; width: 100%; }
textarea { min-height: 80px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
label { display: block; margin: 10px 0; color: var(--muted); font-size: 12px; } label input, label select, label textarea { margin-top: 4px; color: var(--text); font-size: 14px; }
button { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--bad); } button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(380px, 100%); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
nav a.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.who { display: flex; gap: 8px; align-items: center; color: var(--muted); }
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi .v { font-size: 26px; font-weight: 700; } .kpi .l { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.row > * { flex: 0 0 auto; width: auto; }
.cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface-2); }
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--surface-2); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--accent); }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bots { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.bot { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 10px; }
.bot img, .avatar { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.bot .t { font-weight: 600; } .bot .s { color: var(--muted); font-size: 12px; }
.small { font-size: 12px; } code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
pre { background: var(--surface-2); padding: 10px; border-radius: 8px; overflow: auto; font-size: 12px; max-height: 320px; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(720px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.45); }
.secret { font-size: 22px; letter-spacing: 2px; font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 8px 12px; border-radius: 8px; display: inline-block; }
.notice { background: var(--info-bg); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
@media (max-width: 640px) { .top { gap: 8px; } main { padding: 12px 16px; } .kpi .v { font-size: 22px; } }
