:root {
  --bg: #0f1419; --panel: #171e26; --panel2: #1e2731; --line: #2a3542; --text: #e6edf3; --muted: #8b98a7;
  --accent: #2f81f7; --accent2: #1f6feb; --ok: #3fb950; --warn: #d29922; --bad: #f85149;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
button, .btn {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 12px; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
button.primary:hover { background: var(--accent); }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; color: var(--muted); margin: 12px 0 4px; font-size: 12px; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, ui-monospace, monospace; }
.err { color: var(--bad); min-height: 1.2em; margin-top: 10px; }

/* auth pages */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; width: 100%; max-width: 380px; }
.card h1 { margin: 0 0 4px; font-size: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #7ee787); display: grid; place-items: center; color: #0f1419; font-weight: 800; font-size: 14px; }
.card .brand { margin-bottom: 20px; }
.card button { width: 100%; justify-content: center; margin-top: 18px; padding: 10px; }

/* app shell */
header.top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
header.top nav { display: flex; gap: 4px; margin-left: 20px; }
header.top nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
header.top nav a.on, header.top nav a:hover { color: var(--text); background: var(--panel2); }
header.top .spacer { flex: 1; }
main { padding: 18px; max-width: 1300px; margin: 0 auto; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { max-width: 300px; }
h2 { font-size: 15px; margin: 22px 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--panel2); }
tr:last-child td { border-bottom: 0; }
tr.row:hover td { background: #1b232d; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #4a5563; margin-right: 6px; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.pill { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.pill.live { color: var(--warn); border-color: var(--warn); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 22px; width: min(560px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h3 { margin-top: 0; }
.copybox { display: flex; gap: 6px; margin-top: 4px; }
.copybox input { font-family: Consolas, monospace; }
.code-big { font-size: 34px; letter-spacing: .2em; font-weight: 700; text-align: center; margin: 10px 0; font-family: Consolas, monospace; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
