:root {
  --bg: #0b0d10;
  --panel: #151922;
  --panel2: #1d2430;
  --text: #eef2f6;
  --muted: #9aa4b2;
  --line: #2c3442;
  --accent: #d6b36a;
  --danger: #d96b6b;
  --ok: #52b788;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #202637 0, #0b0d10 45%); }
.login-card { width: min(440px, 100%); background: rgba(21,25,34,.96); border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: 0 24px 80px rgba(0,0,0,.45); }
h1, h2 { margin: 0 0 12px; letter-spacing: -.02em; }
p { color: var(--muted); line-height: 1.5; }
label { display: block; margin: 16px 0 6px; color: var(--muted); font-size: 14px; }
input[type="text"], input[type="password"], input[type="file"], select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #0f131a; color: var(--text); padding: 12px 14px; font: inherit; }
textarea { resize: vertical; min-height: 84px; }
button, .button-link { display: inline-block; border: 0; border-radius: 12px; background: var(--accent); color: #141414; padding: 11px 16px; font-weight: 700; cursor: pointer; margin-top: 16px; }
button.secondary, .button-link.secondary { background: #252d3a; color: var(--text); }
button.small, .button-link.small { padding: 8px 12px; margin-top: 0; }
small { display: block; margin-top: 14px; color: var(--muted); line-height: 1.45; }
code { background: #0f131a; border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; color: #dce6f4; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: rgba(11,13,16,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; }
.container { width: min(1280px, 100%); margin: 0 auto; padding: 24px; }
.container.narrow { width: min(980px, 100%); }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin-bottom: 18px; }
.channel-card { min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; }
.current-title { font-size: 20px; color: var(--text); font-weight: 700; }
.alert { border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.alert.error { background: rgba(217,107,107,.14); border: 1px solid rgba(217,107,107,.35); color: #ffdada; }
.alert.ok { background: rgba(82,183,136,.14); border: 1px solid rgba(82,183,136,.35); color: #dcffe9; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; font-weight: 600; }
.inline-form { margin: 0; display: inline; }
.inline-form button { margin: 0; padding: 6px 10px; }
.inline-remove { margin-left: 8px; }
.stacked-form button { margin-top: 10px; }
.pill { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.online { background: rgba(82,183,136,.16); color: #9ff0c0; }
.pill.offline { background: rgba(154,164,178,.14); color: #cbd2dc; }
.pill.admin { background: rgba(214,179,106,.16); color: #f8d994; }
.pill.viewer { background: rgba(93,139,244,.16); color: #b8c9ff; }
.ua { max-width: 360px; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); font-size: 13px; }
.danger-text { color: #ffdada !important; }
.compact-list { margin: 0; padding-left: 18px; color: var(--text); }
.compact-list li { margin: 0 0 8px; }
.player-body { background: #000; overflow: hidden; width: 100vw; height: 100vh; }
#adVideo { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover; background: #000; }
.player-status { position: fixed; top: 12px; left: 12px; z-index: 3; background: rgba(0,0,0,.52); color: #fff; padding: 8px 10px; border-radius: 10px; font-size: 13px; max-width: calc(100vw - 24px); }
.start-overlay { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(30,36,48,.94), rgba(0,0,0,.96)); padding: 24px; text-align: center; }
.start-overlay.hidden { display: none; }
.start-overlay div { max-width: 560px; }
.start-overlay h1 { font-size: clamp(32px, 6vw, 72px); }
.start-overlay p { font-size: 18px; }
@media (max-width: 780px) { .grid.two { grid-template-columns: 1fr; } .topbar { align-items: flex-start; gap: 12px; flex-direction: column; } th, td { padding: 10px; } }

.client-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.client-form-grid .full-width { grid-column: 1 / -1; }
.spaced-top { margin-top: 18px; }
.inline-password-form { display: flex; gap: 8px; align-items: center; min-width: 280px; }
.inline-password-form input[type="password"] { min-width: 170px; padding: 9px 10px; }
.inline-password-form button { margin-top: 0; white-space: nowrap; }
.channel-video-form label { margin-top: 10px; }
.player-back-button { position: fixed; left: 12px; bottom: 12px; z-index: 3; display: none; background: rgba(0,0,0,.48); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 8px 11px; font-size: 12px; font-weight: 700; backdrop-filter: blur(8px); }
.player-back-button.visible { display: inline-block; }
@media (max-width: 780px) { .client-form-grid { grid-template-columns: 1fr; } .inline-password-form { min-width: 240px; } }
