:root {
  --bg:#f2f6fb; --card:#fff; --line:#e2e8f2; --text:#0b1220; --muted:#5b6b85; --brand:#0369a1; --brand2:#0ea5e9; --sky:#38bdf8;
  --navy:#0a1f44; --side:#07142e; --sideText:#c3d3ec; --ok:#16a34a; --warn:#f59e0b; --bad:#ef4444; --info:#0ea5e9; --radius:14px;
}
* { box-sizing:border-box; }
body { margin:0; font:14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color:var(--text); background:var(--bg); }
.hidden { display:none !important; }
a { color:var(--brand); }
h1 { font-size:26px; margin:0 0 4px; } h2 { font-size:16px; margin:0 0 14px; } h3 { font-size:14px; margin:16px 0 8px; }
.muted { color:var(--muted); } small { color:var(--muted); }
.err { color:var(--bad); min-height:1.2em; margin:6px 0 0; }

/* login */
.login { min-height:100vh; display:grid; place-items:center; background:linear-gradient(135deg,#000000,#0a1f44 60%,#0369a1); }
.loginCard { width:360px; padding:32px; }
.logo { display:flex; align-items:center; gap:8px; font-weight:800; font-size:20px; color:#fff; }
.logo.big { color:var(--text); font-size:24px; margin-bottom:4px; }
.mark { display:inline-grid; place-items:center; width:30px; height:30px; border-radius:9px; background:linear-gradient(135deg,#0ea5e9,#38bdf8); color:#fff; font-size:13px; }

/* layout */
#app { display:flex; min-height:100vh; }
.side { width:250px; flex:none; background:var(--side); color:var(--sideText); display:flex; flex-direction:column; padding:18px 12px; position:sticky; top:0; height:100vh; }
.side .logo { padding:0 8px 16px; }
.sitePick { display:block; background:rgba(255,255,255,.07); border-radius:10px; padding:8px 10px; margin-bottom:12px; }
.sitePick small { color:#8fb3dd; display:block; font-size:11px; }
.sitePick select { width:100%; background:transparent; color:#fff; border:0; font:inherit; font-weight:700; padding:2px 0; outline:none; }
.sitePick option { color:#000; }
nav { flex:1; overflow-y:auto; margin:0 -4px; padding:0 4px; }
nav .sec { font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:#6f8fbf; margin:14px 10px 6px; font-weight:700; }
nav a { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:9px; color:var(--sideText); text-decoration:none; font-weight:600; font-size:13.5px; }
nav a:hover { background:rgba(255,255,255,.06); color:#fff; }
nav a.active { background:linear-gradient(90deg,var(--brand),var(--brand2)); color:#fff; }
nav a .ic { width:20px; text-align:center; }
nav a .badge { margin-left:auto; background:var(--bad); color:#fff; border-radius:999px; font-size:11px; padding:0 7px; }
.me { display:flex; align-items:center; gap:10px; background:rgba(255,255,255,.07); border-radius:12px; padding:10px; margin-top:10px; }
.me b { display:block; color:#fff; font-size:13px; } .me small { color:#8fb3dd; }
.avatar { width:32px; height:32px; border-radius:50%; background:var(--brand2); color:#fff; display:grid; place-items:center; font-weight:700; }
.iconBtn { margin-left:auto; background:none; border:0; color:#cfc7ec; font-size:18px; cursor:pointer; }
main { flex:1; min-width:0; padding:22px 28px; }
.foot { text-align:center; color:var(--muted); font-size:12px; margin:28px 0 8px; }

/* page header */
.pageHead { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:18px; flex-wrap:wrap; }
.pageHead p { margin:0; color:var(--muted); }
.actions { display:flex; gap:8px; flex-wrap:wrap; }

/* cards & grids */
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px; box-shadow:0 1px 2px rgba(16,24,40,.04); }
.grid { display:grid; gap:16px; margin-bottom:16px; }
.g2 { grid-template-columns:1fr 1fr; } .g3 { grid-template-columns:repeat(3,1fr); } .g6 { grid-template-columns:repeat(6,1fr); }
.g-hero { grid-template-columns:1.15fr 1fr; }
@media (max-width:1300px) { .g6 { grid-template-columns:repeat(3,1fr); } }
@media (max-width:1000px) { .g2,.g3,.g-hero { grid-template-columns:1fr; } .side { width:210px; } }
.cardHead { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.cardHead h2 { margin:0; }
.link { color:var(--brand); font-weight:600; font-size:12.5px; cursor:pointer; text-decoration:none; background:none; border:0; padding:0; }

/* buttons & forms */
.btn { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:9px; border:1px solid var(--line); background:#fff; color:var(--text); font:inherit; font-weight:600; cursor:pointer; white-space:nowrap; }
.btn:hover { border-color:#cfd2e3; }
.btn.primary { background:linear-gradient(90deg,var(--brand),var(--brand2)); color:#fff; border:0; }
.btn.danger { background:var(--bad); color:#fff; border:0; }
.btn.sm { padding:4px 9px; font-size:12px; border-radius:7px; }
.btn.wide { width:100%; justify-content:center; padding:11px; }
label { display:block; font-size:12.5px; font-weight:600; color:#3d4057; margin-bottom:12px; }
input, select, textarea { display:block; width:100%; margin-top:5px; padding:9px 11px; border:1px solid #d9dbe7; border-radius:9px; font:inherit; color:var(--text); background:#fff; }
textarea { min-height:90px; resize:vertical; }
input:focus, select:focus, textarea:focus { outline:2px solid rgba(14,165,233,.3); border-color:var(--brand2); }
input[type=checkbox] { display:inline; width:auto; margin:0 6px 0 0; vertical-align:middle; }
input[type=color] { height:40px; padding:3px; }
.check { display:flex; align-items:center; font-weight:600; }
.row { display:flex; gap:12px; } .row > * { flex:1; }
.multi { max-height:220px; overflow-y:auto; border:1px solid #d9dbe7; border-radius:9px; padding:8px; margin-top:5px; }
.multi label { font-weight:500; margin:0 0 4px; display:flex; align-items:center; }
.upl { display:flex; gap:8px; align-items:center; } .upl input[type=text] { flex:1; }
.preview { max-height:70px; max-width:140px; border-radius:6px; margin-top:6px; object-fit:contain; background:#f1f1f6; }

/* tables */
.tableWrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th { text-align:left; font-size:11.5px; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:9px 10px; border-bottom:1px solid var(--line); }
td { padding:10px; border-bottom:1px solid var(--line); vertical-align:middle; }
tr:last-child td { border-bottom:0; }
td.acts { white-space:nowrap; text-align:right; }
td img.thumb { width:54px; height:36px; object-fit:cover; border-radius:6px; background:#f1f1f6; }
td .clip { max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); }
.empty { text-align:center; color:var(--muted); padding:30px; }
.pill { display:inline-block; padding:2px 9px; border-radius:999px; font-size:11.5px; font-weight:700; background:#eef0f6; color:#555a73; text-transform:capitalize; }
.pill.ok, .pill.online, .pill.done, .pill.in-house { background:#dcfce7; color:#15803d; }
.pill.bad, .pill.offline, .pill.failing, .pill.cancelled { background:#fee2e2; color:#b91c1c; }
.pill.warn, .pill.new, .pill.pending, .pill.awaiting { background:#fef3c7; color:#b45309; }
.pill.info, .pill.progress { background:#dbeafe; color:#1d4ed8; }
.pill.disabled, .pill.checked-out { background:#eef0f6; color:#6b6f85; }

/* dashboard */
.hello { color:var(--muted); font-size:13px; }
.hero { background:linear-gradient(120deg,#000000,#0a1f44 55%,#0369a1); color:#fff; border:0; display:flex; gap:22px; align-items:center; }
.hero .ring { flex:none; }
.hero h2 { color:#fff; font-size:20px; margin:0 0 4px; } .hero p { margin:0 0 12px; color:#bfe3fb; font-size:13px; }
.hero .alerts { margin-left:auto; border-left:1px solid rgba(255,255,255,.18); padding-left:20px; display:flex; flex-direction:column; gap:10px; font-size:13px; min-width:200px; }
.hero .alerts div { display:flex; gap:8px; align-items:center; } .hero .alerts b { font-size:16px; }
.btn.ghostW { background:rgba(255,255,255,.14); color:#fff; border:1px solid rgba(255,255,255,.25); }
.quick { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.quick button { background:none; border:0; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:8px; font:inherit; font-size:12.5px; color:var(--text); padding:8px 4px; border-radius:10px; }
.quick button:hover { background:#eaf6fe; }
.quick .qi { width:42px; height:42px; border-radius:12px; background:#e0f2fe; display:grid; place-items:center; font-size:19px; border:1px solid #bae6fd; }
.stat { position:relative; }
.stat .lbl { font-size:12.5px; font-weight:700; } .stat .val { font-size:28px; font-weight:800; margin:4px 0 2px; } .stat small { font-size:11.5px; }
.stat .si { position:absolute; right:16px; top:16px; width:36px; height:36px; border-radius:10px; display:grid; place-items:center; font-size:16px; background:#e0f2fe; }
.legend div { display:flex; justify-content:space-between; font-size:12.5px; margin:9px 0; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:8px; }
.watch { display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid var(--line); }
.watch:last-child { border-bottom:0; }
.watch .tvi { width:40px; height:30px; border-radius:7px; background:var(--navy); color:#fff; display:grid; place-items:center; font-size:13px; }
.watch .w { flex:1; } .watch .w b { display:block; font-size:13px; } .watch small { font-size:12px; }
.bar { height:7px; background:#eef0f6; border-radius:9px; overflow:hidden; margin:6px 0 14px; }
.bar i { display:block; height:100%; border-radius:9px; }
.streamRow { display:flex; justify-content:space-between; align-items:center; font-size:13px; }
.act { display:flex; gap:12px; padding:8px 0; border-bottom:1px solid var(--line); align-items:flex-start; }
.act:last-child { border-bottom:0; }
.act .ai { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; font-size:12px; flex:none; background:#eef0f6; }
.act .t { flex:1; } .act .t b { display:block; font-size:13px; font-weight:600; }
.life { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; text-align:center; }
.life .n { font-size:22px; font-weight:800; } .life small { display:block; }
.life .bar { margin:10px 0 0; height:6px; }

/* channel preview, modal, toast */
.modalWrap { position:fixed; inset:0; background:rgba(2,8,23,.55); display:grid; place-items:center; z-index:50; padding:20px; }
.modal { width:min(640px,100%); max-height:92vh; overflow-y:auto; }
.modal.wide { width:min(900px,100%); }
.modal h2 { font-size:18px; }
.modalFoot { display:flex; justify-content:flex-end; gap:8px; margin-top:8px; position:sticky; bottom:-18px; background:#fff; padding:12px 0 2px; }
video.prev { width:100%; aspect-ratio:16/9; background:#000; border-radius:10px; }
.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--navy); color:#fff; padding:10px 18px; border-radius:10px; z-index:60; font-weight:600; }

/* designer previews */
.tvPreview { aspect-ratio:16/9; border-radius:12px; overflow:hidden; position:relative; background:#0b0f1a center/cover; color:#fff; padding:5%; display:flex; flex-direction:column; }
.tvPreview .tp-top { display:flex; justify-content:space-between; font-size:12px; opacity:.9; }
.tvPreview .tp-tiles { margin-top:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(70px,1fr)); gap:6px; }
.tvPreview .tp-tile { background:rgba(255,255,255,.12); border-radius:8px; padding:8px 4px; text-align:center; font-size:10px; }
.tvPreview .tp-tile span { display:block; font-size:18px; }
.tvPreview .tp-welcome { margin:auto; text-align:center; } .tvPreview .tp-welcome h3 { font-size:22px; margin:6px 0; }
.tvPreview img.tp-logo { max-height:40px; max-width:140px; }
.tileRow { display:flex; align-items:center; gap:8px; padding:8px; border:1px solid var(--line); border-radius:10px; margin-bottom:6px; }
.tileRow input[type=text] { margin:0; padding:6px 8px; } .tileRow .ico { width:56px; flex:none; } .tileRow .key { color:var(--muted); font-size:11px; width:80px; flex:none; }
.pendingTv { display:flex; align-items:center; gap:14px; border:2px dashed #7dd3fc; background:#f0f9ff; border-radius:12px; padding:12px 16px; margin-bottom:8px; }
.pendingTv .code { font-size:26px; font-weight:800; letter-spacing:4px; color:var(--brand); }
.emBox { border:2px solid #fecaca; background:#fff5f5; }
.emActive { background:#b91c1c; color:#fff; border:0; animation:pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow:0 0 0 8px rgba(239,68,68,.25); } }
.prayGrid { display:grid; grid-template-columns:repeat(6,1fr); gap:8px; text-align:center; }
.prayGrid div { background:#eaf6fe; border-radius:10px; padding:10px 4px; } .prayGrid b { display:block; font-size:18px; }
code { background:#f1f1f6; padding:2px 6px; border-radius:5px; font-size:12px; word-break:break-all; }

/* v3 dashboard */
.g-map { grid-template-columns:2fr 1fr; } .g3b { grid-template-columns:1.2fr 1.2fr 1fr; gap:22px; } .col { display:flex; flex-direction:column; gap:16px; } .col .card { margin:0; }
@media (max-width:1200px) { .g-map, .g3b { grid-template-columns:1fr; } }
.seg { display:inline-flex; border:1px solid var(--line); border-radius:9px; overflow:hidden; margin-right:10px; background:#fff; }
.seg button { border:0; background:none; padding:6px 12px; font:inherit; font-weight:600; cursor:pointer; color:var(--muted); } .seg button.on { background:var(--navy); color:#fff; }
.chart { width:100%; height:170px; display:block; } .chartMax { font-size:11px; color:var(--muted); text-align:right; margin-top:-4px; }
.kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:0 0 14px; } .kpis.small { grid-template-columns:repeat(3,1fr); margin:12px 0 0; }
.kpis div { background:#f2f8fe; border-radius:10px; padding:10px 12px; } .kpis b { display:block; font-size:20px; color:var(--navy); } .kpis small { font-size:11.5px; }
.floor { display:flex; gap:12px; margin-bottom:10px; align-items:flex-start; } .floor .fl { width:58px; flex:none; font-size:12px; font-weight:700; color:var(--muted); padding-top:14px; }
.rooms { display:flex; flex-wrap:wrap; gap:6px; flex:1; }
.room { width:74px; height:58px; border-radius:9px; padding:5px 7px; position:relative; font-size:12px; border:2px solid transparent; cursor:default; overflow:hidden; }
.room b { font-size:13px; } .room small { display:block; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:inherit; opacity:.85; }
.room .ri { position:absolute; right:5px; top:4px; font-size:11px; }
.room .rq, .legend2 .rq { position:absolute; right:-4px; bottom:-4px; background:var(--bad); color:#fff; border-radius:9px; font-size:10px; padding:1px 6px; }
.legend2 .rq { position:static; }
.room.none, .rm.none { background:#eef2f7; color:#64748b; } .room.offline, .rm.offline { background:#fee2e2; color:#991b1b; } .room.online, .rm.online { background:#e0f2fe; color:#075985; }
.room.watching, .rm.watching { background:#0ea5e9; color:#fff; } .room.disabled, .room.awaiting { background:#e2e8f0; color:#64748b; }
.room.occ { border-color:var(--navy); }
.legend2 { display:flex; gap:12px; font-size:11.5px; color:var(--muted); flex-wrap:wrap; align-items:center; } .legend2 span { display:flex; align-items:center; gap:5px; }
.rm { display:inline-block; width:12px; height:12px; border-radius:3px; }
.gauge { margin-bottom:4px; } .gauge .bar { margin:5px 0 2px; }
.upsell { background:linear-gradient(120deg,#f0f9ff,#fff); border:1px dashed #7dd3fc; margin-bottom:16px; }
.licBanner { border-radius:10px; padding:10px 14px; margin-bottom:16px; font-weight:600; font-size:13px; }
.licBanner.info { background:#e0f2fe; color:#075985; } .licBanner.warn { background:#fef3c7; color:#92400e; } .licBanner.bad { background:#fee2e2; color:#991b1b; }
nav a.lockedNav { opacity:.55; } nav a .lock { margin-left:auto; font-size:11px; }
.modGrid { display:grid; grid-template-columns:1fr 1fr; gap:6px; } .modGrid div { padding:7px 10px; border-radius:8px; font-size:12.5px; } .modGrid .on { background:#dcfce7; color:#166534; } .modGrid .off { background:#f1f5f9; color:#64748b; }
.pill.info { background:#e0f2fe; color:#075985; } .pill.grace { background:#fef3c7; color:#b45309; }

/* accounts, roles, live tv v2 */
.me a { text-decoration:none; color:inherit; } .meTxt { flex:1; min-width:0; } .meTxt small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.readonly .btn:not(.ro):not(.ghostW), .readonly #addBtn, .readonly [data-edit], .readonly [data-del] { display:none !important; }
.readonly input:not(.ro), .readonly select:not(.ro), .readonly textarea { pointer-events:none; opacity:.7; }
.readonly .pageHead::after { content:"View only"; background:#eef2f7; color:var(--muted); font-weight:700; font-size:12px; padding:4px 10px; border-radius:999px; }
.g4 { grid-template-columns:repeat(4,1fr); } @media (max-width:1000px) { .g4 { grid-template-columns:1fr 1fr; } }
.kpi { display:flex; align-items:center; gap:14px; } .kpi b { display:block; font-size:24px; } .kpi small { font-size:13px; }
.kpi .ki { width:46px; height:46px; border-radius:50%; display:grid; place-items:center; font-size:19px; flex:none; }
.tabs { display:inline-flex; background:#e9eef6; border-radius:11px; padding:4px; margin-bottom:16px; gap:2px; }
.tabs .tab { padding:7px 16px; border-radius:8px; font-weight:700; color:#334155; text-decoration:none; cursor:pointer; }
.tabs .tab.on { background:#fff; color:var(--brand); box-shadow:0 1px 3px rgba(0,0,0,.08); }
.toolbar { display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; } .toolbar input { flex:2; min-width:220px; margin:0; } .toolbar select { flex:1; min-width:140px; margin:0; }
.cat { display:inline-block; padding:2px 10px; border-radius:7px; font-size:12px; font-weight:700; background:#fff1e6; color:#c2410c; }
.typ { display:inline-block; padding:3px 9px; border-radius:7px; font-size:11.5px; font-weight:700; background:#e0f2fe; color:#0369a1; white-space:nowrap; }
.mono { font-family:Consolas,monospace; font-size:12px; }
.nologo { display:inline-grid; place-items:center; width:54px; height:36px; border-radius:6px; background:#eef2f7; }
.iconBtn2 { background:none; border:0; cursor:pointer; font-size:13px; opacity:.6; } .iconBtn2:hover { opacity:1; }
.switch { position:relative; display:inline-block; width:40px; height:22px; margin:0; } .switch input { opacity:0; width:0; height:0; position:absolute; }
.switch i { position:absolute; inset:0; background:#cbd5e1; border-radius:22px; transition:.2s; cursor:pointer; }
.switch i::before { content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; }
.switch input:checked + i { background:var(--brand2); } .switch input:checked + i::before { transform:translateX(18px); } .switch input:disabled + i { opacity:.5; cursor:default; }
.matrix td, .matrix th { padding:6px 8px; } .matrix td:not(:first-child), .matrix th:not(:first-child) { text-align:center; width:70px; }
.matrix input { display:inline; width:auto; margin:0; }
.role h2 { margin:0; } pre.cred { background:#f1f5f9; padding:14px; border-radius:10px; white-space:pre-wrap; font-size:13px; }
