:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e6e8ee;
  --muted: #9aa1b1;
  --discord: #5865f2;
  --fluxer: #3ddc97;
  --ok: #3ddc97;
  --warn: #f5b942;
  --bad: #f2555a;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--fluxer); }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* layout */
header.top { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .04em; }
.brand img { width: 28px; height: 28px; }
nav.tabs { display: flex; gap: 4px; margin-left: 18px; flex-wrap: wrap; }
nav.tabs button { background: none; border: 0; padding: 7px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; }
nav.tabs button:hover { background: var(--panel-2); color: var(--text); }
nav.tabs button.active { background: var(--panel-2); color: var(--text); }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.me img { width: 30px; height: 30px; border-radius: 50%; }
main { max-width: 1100px; margin: 0 auto; padding: 24px; }
h2 { margin: 0 0 14px; font-size: 20px; }
h3 { margin: 0 0 10px; font-size: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge.ok::before { background: var(--ok); }
.badge.down::before { background: var(--bad); }
.badge.blocked::before { background: var(--warn); }
.tag-discord { color: #aab1ff; }
.tag-fluxer { color: var(--fluxer); }

/* controls */
.btn { background: var(--panel-2); border: 1px solid var(--line); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: #3a4150; }
.btn.primary { background: var(--fluxer); border-color: var(--fluxer); color: #06140d; font-weight: 600; }
.btn.discord { background: var(--discord); border-color: var(--discord); color: #fff; font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=password], select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--discord); outline-offset: 1px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1 1 200px; }
label.field > input, label.field > select { color: var(--text); font-size: 15px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { width: 34px; height: 20px; appearance: none; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--fluxer); }
.switch input:checked::after { left: 17px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.chan { display: inline-flex; align-items: center; gap: 6px; }
.chan .hash { color: var(--muted); }
.dir { font-size: 18px; color: var(--muted); }

/* stats */
.stat { font-size: 26px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 13px; }

/* login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: min(420px, 100%); text-align: center; }
.login img.logo { width: 64px; height: 64px; }
.login h1 { margin: 12px 0 4px; letter-spacing: .06em; }
.login .card { margin-top: 20px; text-align: left; }
.error { color: var(--bad); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.bad { border-color: var(--bad); }

@media (max-width: 720px) {
  header.top { flex-wrap: wrap; padding: 12px 16px; }
  nav.tabs { margin-left: 0; order: 3; width: 100%; }
  main { padding: 16px; }
  .hide-sm { display: none; }
}
