:root {
  --bg: #1e1f22;
  --panel: #2b2d31;
  --panel-2: #313338;
  --text: #dbdee1;
  --muted: #949ba4;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --border: #3f4147;
  --code: #1e1f22;
  --ok: #23a55a;
  --warn: #f0b232;
  --bad: #f23f43;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: #00a8fc; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: 0 0 12px; font-size: 26px; }
h2 { margin: 32px 0 12px; font-size: 18px; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; font-weight: 400; }
.text-bad { color: var(--bad); }
.error { color: var(--bad); }
.fine { color: var(--muted); font-size: 13px; margin-bottom: 0; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 28px;
  height: 56px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { color: #fff; font-weight: 700; font-size: 18px; }
.brand span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: var(--muted); padding: 6px 12px; border-radius: 6px; font-weight: 600; }
.topbar nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topbar nav a.active { color: #fff; background: var(--panel-2); }
.user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.user img { border-radius: 50%; }

/* layout */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }
.center { display: flex; justify-content: center; padding: 60px 20px; }
.card { padding: 32px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.card.narrow { max-width: 440px; width: 100%; text-align: center; }
.card h1 { margin-top: 0; }
.crumbs { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

/* buttons */
.btn {
  display: inline-block; padding: 9px 18px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.small { padding: 5px 10px; font-size: 13px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn.small:hover { background: var(--border); }

/* dashboard stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { padding: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.stat.link:hover { border-color: var(--accent); text-decoration: none; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.stat .value { font-size: 22px; font-weight: 700; margin: 4px 0 2px; }
.stat .sub { color: var(--muted); font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 2px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

/* tables */
table.grid { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.grid th, .grid td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.grid th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.server { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.server img, .server-head img { border-radius: 50%; }
.icon-fallback {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700;
}
.icon-fallback.big { width: 56px; height: 56px; font-size: 24px; }
.server-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.server-head h1 { margin: 0; }
.server-head p { margin: 2px 0 0; }

.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.badge.ok { background: rgba(35, 165, 90, .2); color: var(--ok); }
.badge.warn { background: rgba(240, 178, 50, .2); color: var(--warn); }
.badge.bad { background: rgba(242, 63, 67, .2); color: var(--bad); }
.notice { padding: 10px 14px; background: rgba(35, 165, 90, .15); border: 1px solid rgba(35, 165, 90, .4); border-radius: 8px; }

/* feature switches */
.features { display: grid; gap: 8px; }
.feature {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
}
.feature:hover { border-color: #52555c; }
.feature input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  flex-shrink: 0; position: relative; width: 40px; height: 24px; margin-top: 2px;
  background: #80848e; border-radius: 12px; transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform .15s;
}
.feature input:checked + .switch { background: var(--ok); }
.feature input:checked + .switch::after { transform: translateX(16px); }
.feature input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.about { display: flex; flex-direction: column; gap: 2px; }
.cmds { margin-top: 4px; }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }

/* command channel */
.channel-form { padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.channel-form p { margin: 0 0 8px; }
.channel-form .actions { margin-top: 0; }
.channel-form select {
  min-width: 280px; padding: 8px 10px; background: var(--code); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font: inherit;
}

/* logs */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 8px; }
.filters label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 6px; }
.filters input[type=search], .filters input[type=number], .filters select {
  padding: 6px 8px; background: var(--code); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit;
}
.filters input[type=number] { width: 90px; }
.log {
  background: var(--code); border: 1px solid var(--border); border-radius: 10px; padding: 8px 0;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-x: auto;
}
.log .line { display: flex; gap: 12px; padding: 1px 14px; white-space: pre-wrap; word-break: break-word; }
.log .line:hover { background: var(--panel); }
.log time { color: var(--muted); flex-shrink: 0; }
.log .lvl { flex-shrink: 0; width: 60px; text-transform: uppercase; font-size: 11px; font-weight: 700; padding-top: 2px; color: var(--muted); }
.log .warning .lvl { color: var(--warn); }
.log .error .lvl { color: var(--bad); }
.log .error .text { color: #ffb4b6; }
.log .debug { opacity: .7; }
