:root {
  --bg: #0d1117; --panel: #161b22; --border: #2b333d; --text: #e6edf3;
  --muted: #8b949e; --accent: #2f81f7; --ok: #3fb950; --bad: #f85149;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", system-ui, sans-serif; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 32px; width: 340px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card p { color: var(--muted); margin-bottom: 20px; font-size: 13px; }

input, select { width: 100%; background: #0d1117; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 8px 10px; margin-bottom: 12px; }
input:focus { outline: none; border-color: var(--accent); }
label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }

button { background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 8px 16px; cursor: pointer; font-size: 14px; }
button:hover { filter: brightness(1.1); }
button.secondary { background: #21262d; border: 1px solid var(--border); }
button.danger { background: var(--bad); }
button:disabled { opacity: .5; cursor: default; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px;
  background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 16px; flex: 1; }
.topbar .user { color: var(--muted); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #21262d; }
.badge.admin { color: var(--accent); }

.content { padding: 24px; }
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; align-items: center; }
.toolbar input, .toolbar select { width: auto; margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #1c2128; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dot.off { background: var(--bad); }

.watch-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.mon-tabs button { margin-right: 6px; }
.mon-tabs button.active { outline: 2px solid var(--accent); }
.video-wrap { background: #000; border: 1px solid var(--border); border-radius: 8px;
  max-width: 100%; margin: 0 auto; }
video { display: block; width: 100%; max-height: 75vh; }
.status-line { color: var(--muted); font-size: 13px; margin-top: 10px; }
.error { color: var(--bad); font-size: 13px; margin-top: 8px; white-space: pre-wrap; }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 24px; width: 440px; max-height: 85vh; overflow: auto; }
.modal h2 { font-size: 16px; margin-bottom: 16px; }
.modal .row { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
pre.config { background: #0d1117; border: 1px solid var(--border); border-radius: 6px;
  padding: 12px; font-size: 12px; overflow: auto; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { background: #21262d; border: 1px solid var(--border); border-radius: 12px;
  padding: 2px 10px; font-size: 12px; cursor: pointer; }
.chip.active { border-color: var(--accent); color: var(--accent); }
