:root {
  --brand: #32b662;            /* verde Fast Pass (mesmo da marca assets/fastpass-mark.png) */
  --brand-glow: rgba(50, 182, 98, .45);
  --bg: #0b0a1a;
  --bg-2: #100f24;
  --panel: #13122b;
  --panel-2: #181735;
  --line: #262448;
  --line-2: #322f5c;
  --text: #e8e7f5;
  --muted: #8d8bb0;
  --dim: #5f5d84;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-bg: rgba(139, 92, 246, .14);
  --cyan: #22d3ee;
  --cyan-bg: rgba(34, 211, 238, .12);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, .12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, .14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, .12);
  --radius: 10px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
:root[data-theme="light"] {
  --bg: #f4f4fb; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #f7f6fd;
  --line: #e3e1f2; --line-2: #d4d1ea; --text: #19172e; --muted: #625f86; --dim: #9a98b8;
  --accent-bg: rgba(139, 92, 246, .1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
.mono { font-family: var(--mono); }

.app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar { width: 200px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: width .2s; }
.brand { height: 64px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border-bottom: 1px solid var(--line); }
.brand-logo { flex: none; object-fit: contain; filter: drop-shadow(0 0 8px var(--brand-glow)); }
.brand-word { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; font-family: Orbitron, Inter, sans-serif; transform: skewX(-10deg); }
.brand .brand-logo { width: 34px; height: 24px; }
.brand { gap: 6px; }
.brand-word .w1 { font-weight: 900; font-size: 13px; letter-spacing: .03em; color: var(--text); text-shadow: 0 0 10px rgba(255, 255, 255, .25); }
.brand-word .w1 em { font-style: normal; color: var(--brand); text-shadow: 0 0 10px var(--brand-glow); }
.brand-word .w2 { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 10.5px; letter-spacing: .04em; color: var(--brand); margin-top: 2px; }
.brand-word .w2 i { display: block; flex: 1; height: 2px; border-radius: 2px; background: var(--brand); min-width: 26px; }
.collapse-btn { margin-left: auto; }
.nav { padding: 12px 8px; flex: 1; }
.nav-section { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); padding: 14px 8px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); cursor: pointer; margin-bottom: 2px; white-space: nowrap; }
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-2); }
.sidebar-footer { border-top: 1px solid var(--line); padding: 8px; }
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .brand-word, .sidebar.collapsed .nav-label, .sidebar.collapsed .nav-section { display: none; }
.sidebar.collapsed .collapse-btn { transform: rotate(180deg); margin-left: 0; }
.sidebar.collapsed .brand { flex-direction: column; justify-content: center; gap: 2px; }

/* Topbar */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* 3 colunas: título | relógio centralizado | ações — o relógio nunca sobrepõe as ações */
.topbar { height: 64px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.topbar > div:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title { font-weight: 700; font-size: 15px; }
.topbar-sub { font-size: 11px; color: var(--muted); }
.clock { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 5px 14px; }
.clock-tz { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }
.clock-time { font-family: var(--mono); color: var(--cyan); font-weight: 600; font-size: 14px; }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.icon-btn:hover { color: var(--text); }
.icon-btn.boxed { width: 32px; height: 32px; border: 1px solid var(--line-2); background: var(--panel); }
.badge-dot { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: 9px; font-weight: 700; border-radius: 99px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 3px; }
.badge-dot.zero { display: none; }
.link { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 10px; }
.link[hidden] { display: none; }
.cpu { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 10px; font-variant-numeric: tabular-nums; }
.cpu[hidden] { display: none; }
.cpu-bar { width: 34px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cpu-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .4s; }
.cpu-val { min-width: 52px; }
.cpu.high { color: var(--amber); border-color: rgba(245,158,11,.5); background: var(--amber-bg); animation: cpuPulse 1.6s ease-in-out infinite; }
.cpu.high .cpu-bar i { background: var(--amber); }
@keyframes cpuPulse { 50% { box-shadow: 0 0 0 3px rgba(245,158,11,.18); } }
@media (max-width: 760px) { .cpu-bar { display: none; } }
.link.ok { color: #4ade80; border-color: rgba(34,197,94,.35); }
.link.ok .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.link.down { color: #f87171; border-color: rgba(239,68,68,.4); }
.link.down .dot { background: var(--red); }
.link.warn { color: var(--amber); border-color: rgba(245,158,11,.45); }
.link.warn .dot { background: var(--amber); }
/* comando em andamento na API (MCR Box): o botão mostra que está trabalhando */
button.busy { cursor: progress; position: relative; }
button.busy::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 3px; height: 2px; border-radius: 2px; background: currentColor; opacity: .7; animation: btnBusy 1s ease-in-out infinite; }
@keyframes btnBusy { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { button.busy::after { animation: none; } }
.account { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 13px; }
.account [data-icon] { color: var(--accent-2); }
button.account { cursor: pointer; color: var(--text); font-family: inherit; }
button.account:hover { border-color: var(--accent); }

/* Content */
.content { flex: 1; overflow: auto; padding: 24px; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 12px; font-size: 12.5px; color: var(--muted); background: var(--panel); }
.chip b { color: var(--text); }
.chip.green { border-color: rgba(34,197,94,.35); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.amber { background: var(--amber); }
.dot.cyan { background: var(--cyan); }
.dot.red { background: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: var(--red-bg); border-color: rgba(239,68,68,.4); color: #f87171; }
.btn.success { background: var(--green-bg); border-color: rgba(34,197,94,.35); color: #4ade80; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.alert { border: 1px solid rgba(139,92,246,.35); background: var(--accent-bg); color: var(--accent-2); border-radius: var(--radius); padding: 10px 14px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.alert.amber { border-color: rgba(245,158,11,.35); background: var(--amber-bg); color: var(--amber); }
.alert.cyan { border-color: rgba(34,211,238,.3); background: var(--cyan-bg); color: var(--cyan); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 14px; }
.card-head p { margin: 0; font-size: 11.5px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-head > [data-icon] { color: var(--accent-2); }
.card-body { padding: 16px 18px; }
.label { font-size: 10.5px; letter-spacing: .1em; font-weight: 700; color: var(--muted); text-transform: uppercase; }

/* Forms */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field small { font-size: 11px; color: var(--dim); }
.input, select.input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 7px; padding: 8px 10px; width: 100%; outline: none; }
.input:focus { border-color: var(--accent); }
.input.mono { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.req { color: var(--red); }
.radio-row { display: flex; gap: 18px; font-size: 13px; }
.radio-row label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); }
input[type=range] { accent-color: var(--accent); width: 100%; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--muted); user-select: none; }
.switch input { display: none; }
.switch .track { width: 34px; height: 19px; border-radius: 99px; background: var(--line-2); position: relative; transition: .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 17px; }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; border: 1px solid transparent; background: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-2); background: var(--accent-bg); border-color: rgba(139,92,246,.3); }
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.subtab { padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid transparent; background: none; }
.subtab.active { color: var(--cyan); border-color: var(--line-2); background: var(--panel-2); }
.subtab small { color: var(--dim); font-weight: 400; margin-left: 4px; font-size: 10px; }

/* Ingest cards */
.ingest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 316px)); gap: 20px; align-items: start; }
.ingest { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ingest:hover { border-color: var(--accent); }
.ingest-hero { height: 176px; padding: 54px 18px 0; background: linear-gradient(180deg, #1f3a4a 0%, #1b2a43 60%, #1a2040 100%); }
:root[data-theme="light"] .ingest-hero { background: linear-gradient(180deg, #dbeafe, #e0e7ff); }
.ingest-hero .kicker { font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.ingest-hero .state { font-size: 16px; font-weight: 800; margin: 12px 0 8px; }
.ingest-hero .state.on { color: var(--text); }
.ingest-hero .hint { font-size: 13px; color: var(--muted); }
.ingest-info { padding: 14px 16px 10px; }
.ingest-info .name { display: flex; justify-content: space-between; font-weight: 700; }
.ingest-info .desc { color: var(--dim); font-style: italic; font-size: 12.5px; margin: 6px 0 10px; }
.proto { font-size: 9.5px; font-weight: 700; color: var(--cyan); background: var(--cyan-bg); border-radius: 4px; padding: 2px 6px; font-family: var(--mono); }
.ingest-actions { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.ingest-actions .icon-btn.live { color: var(--green); }
.ingest-section { border-top: 1px solid var(--line); padding: 12px 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 6px; }
.stat .k { font-size: 9px; font-weight: 700; letter-spacing: .06em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { color: var(--cyan); font-weight: 700; font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; }
.feed { display: inline-flex; flex-direction: column; gap: 6px; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; background: var(--bg); }
.feed-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--panel-2); border-radius: 5px; padding: 2px 6px; }
.feed-tag.on { color: #4ade80; }
.feed-tag .port { font-family: var(--mono); font-size: 9.5px; color: var(--dim); }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--accent-2); margin-bottom: 6px; }
.sec-title .pill { font-size: 10px; letter-spacing: 0; font-weight: 600; color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; background: var(--panel-2); }
.sec-title .icon-btn { margin-left: auto; }
.sec-text { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.pid { display: block; padding: 6px 0; cursor: pointer; }
.pid-top { display: flex; gap: 6px; align-items: center; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.pid-meta { font-size: 11px; color: var(--muted); margin: 3px 0 0 22px; }
/* faixas reais do MCR Box: uma linha por faixa, tags embaixo (o card é estreito) */
.pid-list { display: flex; flex-direction: column; gap: 6px; }
.pid-list .pid { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); transition: border-color .15s, background .15s; }
.pid-list .pid:hover { border-color: var(--accent-2); }
.pid-list .pid:has(input:checked) { border-color: var(--accent-2); background: var(--accent-bg); }
.pid-list .pid.on { box-shadow: inset 3px 0 0 var(--amber); }
.pid-list .pid input { margin: 2px 0 0; flex: none; accent-color: var(--accent-2); }
.pid-body { min-width: 0; flex: 1; }
.pid-head { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.pid-name { font-size: 12.5px; font-weight: 700; color: var(--text); }
.pid-no { font-family: var(--mono); font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.pid-list .pid-meta { margin: 2px 0 0; }
.pid-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pid-tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 9.5px; font-weight: 700; border-radius: 4px; padding: 2px 6px; border: 1px solid; font-family: var(--mono); }
.tag.green { color: #4ade80; border-color: rgba(34,197,94,.45); background: var(--green-bg); }
.tag.amber { color: var(--amber); border-color: rgba(245,158,11,.45); background: var(--amber-bg); }
.tag.cyan { color: var(--cyan); border-color: rgba(34,211,238,.35); background: var(--cyan-bg); }
.tag.red { color: #f87171; border-color: rgba(239,68,68,.4); background: var(--red-bg); }
.tag.gray { color: var(--muted); border-color: var(--line-2); background: var(--panel-2); }
.tag.purple { color: var(--accent-2); border-color: rgba(139,92,246,.4); background: var(--accent-bg); }
.copy-row { display: flex; align-items: center; gap: 10px; }
.copy-row .label { font-size: 9.5px; display: flex; gap: 4px; align-items: center; }
.copy-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 8px; font-family: var(--mono); font-size: 11px; background: var(--bg); }
.copy-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.trim-row { display: grid; grid-template-columns: 90px 80px auto; gap: 8px; align-items: center; font-size: 12.5px; margin-bottom: 6px; }
.trim-row small { color: var(--dim); font-size: 10.5px; }

/* Routing */
.route { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 18px; align-items: stretch; }
.route-col { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; background: var(--bg); }
.route-col .label { margin-bottom: 8px; display: block; }
.route-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; background: var(--panel); }
.route-opt:hover { border-color: var(--line-2); }
.route-opt.sel { border-color: var(--accent); background: var(--accent-bg); }
.route-opt .meta { font-size: 11px; color: var(--muted); }
.route-opt .grow { flex: 1; min-width: 0; }
.route-opt b { display: block; font-size: 13px; }
.route-arrow { display: grid; place-items: center; color: var(--accent-2); }
.route-take { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 170px; }
.route-status { font-size: 12px; color: var(--muted); text-align: center; }

.out-list { display: grid; gap: 10px; margin-top: 16px; }
.out-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) 190px 124px; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel-2); }
.out-item .t { font-weight: 700; }
.out-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.out-actions .spacer-btn { visibility: hidden; }
.out-actions .btn.toggle { min-width: 78px; }
.out-src { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.out-item .s { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

.url-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-top: 8px; }
.url-row b { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.url-row span { font-family: var(--mono); color: var(--cyan); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel-2); margin-top: 8px; font-size: 12.5px; }
.monitor-row .k { font-size: 9.5px; color: var(--muted); font-weight: 700; letter-spacing: .06em; }
.monitor-row .v { font-family: var(--mono); font-weight: 600; }

/* SCTE */
.scte-layout { display: grid; grid-template-columns: 1fr 460px; gap: 16px; align-items: stretch; }
.scte-layout > .stack:first-child { align-content: start; }
/* o Program Preview desce até o fim da coluna da esquerda (Break History) — os dois lados terminam alinhados */
.scte-layout > .stack:last-child { grid-template-rows: 1fr; }
.stack { display: grid; gap: 16px; }
.dur-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.dur { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 7px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.dur.active { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); }
.big-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; font-weight: 700; letter-spacing: .02em; cursor: pointer; border: 1px solid; font-size: 13.5px; margin-top: 10px; }
.big-btn.red { background: #e2475f; border-color: #e2475f; color: #fff; }
.big-btn.red:hover { filter: brightness(1.08); }
.big-btn.dark { background: var(--bg); border-color: var(--line-2); color: var(--text); }
.big-btn:disabled { opacity: .5; cursor: not-allowed; }
.running { margin-top: 10px; border: 1px solid rgba(239,68,68,.35); background: var(--red-bg); color: #f87171; border-radius: 8px; padding: 8px 12px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.progress { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: #f87171; transition: width .25s linear; }

.preview { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #000; }
.preview canvas { width: 100%; height: 100%; display: block; }
.preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity .2s; }
.preview video.on { opacity: 1; }
.preview video.on.off { opacity: 0; }
.preview .onair, .preview .src { z-index: 2; }
.preview .logo-ov { position: absolute; max-width: 30%; pointer-events: none; transition: all .2s; }
.preview .slate-ov { position: absolute; inset: 0; display: grid; place-items: center; background: #000; }
.preview .slate-ov img { width: 100%; height: 100%; object-fit: cover; }
.preview .onair { position: absolute; left: 8px; top: 8px; font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: var(--red); color: #fff; letter-spacing: .06em; }
.preview .src { position: absolute; left: 8px; bottom: 8px; font-size: 10px; font-family: var(--mono); background: rgba(0,0,0,.55); color: #fff; padding: 2px 6px; border-radius: 4px; }
.meters { padding: 8px 2px 2px; display: grid; gap: 5px; }
.meter { display: grid; grid-template-columns: 12px 1fr 40px; gap: 8px; align-items: center; font-size: 10px; color: var(--muted); font-family: var(--mono); }
.meter .bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter .bar > div { height: 100%; background: linear-gradient(90deg, #22c55e 70%, #f59e0b 88%, #ef4444); transition: width .12s; }
/* Loudness no VU do preview: "LUFS  M -23.8  S -23.2  I -23.4   EBU R128 -23 ±1" */
.lufs-line { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: var(--bg); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.lufs-line .lufs-tag { color: var(--accent-2); font-weight: 800; letter-spacing: .04em; margin-right: 4px; }
.lufs-line .k { color: var(--muted); font-weight: 700; }
.lufs-line .k.m { color: #f97316; }
.lufs-line .v { color: #4ade80; font-weight: 700; min-width: 40px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.lufs-line .v.off { color: var(--amber); }
.lufs-line a { margin-left: auto; font-size: 10.5px; color: var(--dim); }
.lufs-line a:hover { color: var(--cyan); }
.gfx-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.gfx-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 8px; padding: 9px 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.gfx-btn .st { margin-left: auto; }
.gfx-btn.open { border-color: var(--accent); background: var(--accent-bg); }
.gfx-btn.live { border-color: rgba(239,68,68,.5); }
.gfx-panel { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; background: var(--bg); display: grid; gap: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumb { aspect-ratio: 16/9; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; cursor: pointer; background: repeating-conic-gradient(#1e1c3a 0 25%, #16152d 0 50%) 0 0/12px 12px; display: grid; place-items: center; position: relative; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.thumb.add { color: var(--muted); background: var(--panel-2); border-style: dashed; }
.pos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pos-grid button { padding: 6px; font-size: 11.5px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; color: var(--muted); }
.pos-grid button.active { border-color: var(--accent); color: var(--accent-2); background: var(--accent-bg); }
.slider-row { display: grid; grid-template-columns: 70px 1fr 42px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.slider-row b { font-family: var(--mono); font-size: 11px; color: var(--text); text-align: right; }

.history { max-height: 420px; overflow: auto; padding: 10px; display: grid; gap: 8px; }
.h-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 10px; background: var(--panel-2); }
.h-item .grow { flex: 1; }
.h-item b { font-size: 12.5px; display: block; }
.h-item small { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 24px 10px; }

/* Assets */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.asset { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; overflow: hidden; }
.asset .thumb { border: 0; border-radius: 0; cursor: default; }
.asset .thumb .ready { position: absolute; left: 6px; bottom: 6px; }
.asset .info { padding: 10px; }
.asset .info b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset .info small { color: var(--muted); font-size: 11.5px; display: block; }
.asset .acts { display: flex; gap: 4px; border-top: 1px solid var(--line); padding: 6px 8px; }
.tab-n { font-size: 10.5px; color: var(--dim); margin-left: 2px; font-weight: 600; }
.tab.active .tab-n { color: var(--accent-2); }
.chip.storage { gap: 6px; }
.st-bar { display: inline-block; width: 50px; height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--green); }
.asset-filters { align-items: center; }
.filters .spacer { flex: 1; }
.asset .thumb .demo { position: absolute; right: 6px; top: 6px; }
.asset .info small { display: flex; align-items: center; gap: 4px; }
.mini-thumb { width: 64px; aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; display: grid; place-items: center; background: repeating-conic-gradient(#1e1c3a 0 25%, #16152d 0 50%) 0 0/10px 10px; }
.mini-thumb img, .mini-thumb video { max-width: 100%; max-height: 100%; object-fit: contain; }
.mini-thumb svg { width: 18px; height: 18px; color: var(--dim); }
.table.assets-list td { vertical-align: middle; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 6px 10px; color: var(--muted); }
.search input { background: none; border: 0; outline: none; width: 160px; }

/* Logs / Analytics */
:root { --series-upstream: #3987e5; --series-auto: #d95926; --series-manual: #199e70; --grid: #24223f; --axis: #3a3760; }
:root[data-theme="light"] { --series-upstream: #2a78d6; --series-auto: #eb6834; --series-manual: #1baf7a; --grid: #ecebf5; --axis: #cfcce4; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .search input { width: 200px; }
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:hover td { background: var(--panel-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .tag { display: inline-flex; align-items: center; gap: 4px; }
.muted { color: var(--muted); }
.table-foot { padding: 10px 14px; font-size: 12px; color: var(--muted); }
.origin { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.s-upstream { background: var(--series-upstream); fill: var(--series-upstream); }
.s-auto { background: var(--series-auto); fill: var(--series-auto); }
.s-manual { background: var(--series-manual); fill: var(--series-manual); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px; background: var(--panel); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.active { background: var(--accent-bg); color: var(--accent-2); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile > span:first-child { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile b { font-size: 26px; font-weight: 700; }
.delta { font-size: 11.5px; color: var(--muted); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { color: var(--text); }
.chart { max-width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 10.5px; font-family: var(--mono); }
.chart .hit { fill: transparent; cursor: default; }
.chart .col.hover .hit { fill: var(--text); fill-opacity: .04; }
.viz-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 150px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.viz-tip[hidden] { display: none; }
.viz-tip b { display: block; margin-bottom: 4px; }
.viz-tip div { display: flex; align-items: center; gap: 7px; color: var(--muted); padding: 1px 0; }
.viz-tip div span { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.viz-tip .tot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; color: var(--text); }
.ana-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: stretch; }
.ana-grid .card { display: flex; flex-direction: column; overflow: hidden; }
.ana-grid .table-wrap { flex: 1; }
.ana-grid .table tbody tr:last-child td { border-bottom: 0; }
.hbars { display: grid; gap: 14px; flex: 1; align-content: center; }
.hbar { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; font-size: 12.5px; }
.hbar .hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb { height: 14px; background: var(--series-upstream); border-radius: 0 4px 4px 0; min-width: 2px; flex: none; }
.hv { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } .ana-grid { grid-template-columns: 1fr; } }

/* Settings */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.help { display: block; font-size: 11.5px; color: var(--dim); margin-top: 6px; line-height: 1.5; }
code { font-family: var(--mono); font-size: 11px; color: var(--cyan); background: var(--cyan-bg); border-radius: 4px; padding: 1px 5px; }
.table.alerts td { white-space: normal; vertical-align: middle; }
.table.alerts td b { display: block; font-size: 12.5px; }
.table.alerts td small { display: block; color: var(--muted); font-size: 11px; }
.table.alerts .c { text-align: center; width: 80px; }
.table.alerts .fixed { display: block; max-width: 170px; font-size: 11.5px; line-height: 1.35; }
.input.thr { width: 92px; padding: 6px 8px; }
.field.sink { margin: 8px 0 4px 24px; }

/* Loudness */
.tiles.six { grid-template-columns: repeat(6, 1fr); }
.tile b.sm { font-size: 18px; overflow-wrap: anywhere; }
.tile .tag { align-self: flex-start; }
.sw.band { background: var(--line-2); }
.sw.adshade { background: rgba(217, 89, 38, .35); }
.chart .band { fill: var(--line-2); opacity: .45; }
.chart .adshade { fill: var(--series-auto); opacity: .14; }
.chart .target { stroke: var(--muted); stroke-width: 1; }
.chart .lline { fill: none; stroke: var(--series-upstream); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
@media (max-width: 1300px) { .tiles.six { grid-template-columns: repeat(3, 1fr); } }

/* Health & SLA */
.st-green { background: var(--green); } .st-red { background: var(--red); } .st-gray { background: var(--line-2); }
.sla-list { display: grid; gap: 14px; }
.sla-row { display: grid; grid-template-columns: 200px 1fr 150px; gap: 16px; align-items: center; }
.sla-name b { font-size: 13px; }
.sla-name small { display: block; margin-top: 4px; }
.sla-bar { position: relative; height: 22px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.sla-bar i { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--panel); }
.sla-bar i:hover { filter: brightness(1.25); }
.sla-num { text-align: right; }
.sla-num b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.sla-num small { font-size: 11px; color: var(--muted); }
.sla-axis { position: relative; height: 16px; margin: -6px 166px 0 216px; }
.sla-axis span { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.sla-axis span:first-child { transform: none; } .sla-axis span:last-child { transform: translateX(-100%); }
@media (max-width: 1000px) { .sla-row { grid-template-columns: 1fr; } .sla-num { text-align: left; align-items: flex-start; } .sla-axis { margin: 0; } }

/* SCTE-35 Inspector */
.insp-input { resize: vertical; min-height: 64px; font-size: 12.5px; line-height: 1.5; word-break: break-all; }
.insp-grid { display: grid; gap: 18px; }
.insp-sec .label { display: block; margin-bottom: 6px; }
.table.insp td { white-space: normal; padding: 6px 12px; vertical-align: top; }
.table.insp td:first-child { width: 42%; color: var(--muted); }
.table.insp td small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; font-family: Inter, sans-serif; }
.hexdump { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.6; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; color: var(--text); }
.hexdump .off { color: var(--dim); margin-right: 8px; }

/* Settings → Storage */
.lib-usage { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.lib-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); font-weight: 600; }
.lib-top b { font-size: 22px; color: var(--text); }
.lib-bar { height: 6px; border-radius: 99px; background: rgba(34,197,94,.15); overflow: hidden; }
.lib-bar i { display: block; height: 100%; min-width: 2px; background: var(--green); border-radius: 99px; transition: width .4s; }
.lib-usage.warn .lib-bar { background: var(--amber-bg); } .lib-usage.warn .lib-bar i { background: var(--amber); }
.lib-usage.crit .lib-bar { background: var(--red-bg); } .lib-usage.crit .lib-bar i { background: var(--red); }
.lib-usage small { font-size: 12px; color: var(--muted); }
.lib-usage .lib-warn { color: var(--amber); display: flex; gap: 6px; align-items: center; }

/* Login */
.login { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: radial-gradient(60% 50% at 50% 30%, rgba(50,182,98,.10), transparent 70%), var(--bg); }
.login[hidden] { display: none; }
.login-card { width: min(390px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 34px 36px 26px; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-mark { align-self: center; object-fit: contain; filter: drop-shadow(0 0 14px var(--brand-glow)); }
.login-brand { align-self: center; margin-top: 12px; }
.login-brand .brand-word .w1 { font-size: 26px; }
.login-brand .brand-word .w2 { font-size: 15px; }
.login-brand .brand-word .w2 i { min-width: 40px; }
.login-tag { text-align: center; font-size: 10.5px; letter-spacing: .16em; color: var(--muted); margin-top: 8px; }
.login-card hr { border: 0; border-top: 1px solid var(--line-2); margin: 22px 0; width: 100%; }
.login-card h2 { margin: 0; font-size: 18px; }
.login-sub { margin: 6px 0 18px; font-size: 13px; color: var(--muted); }
.login-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.login-input { display: flex; align-items: center; gap: 9px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 0 10px 0 12px; color: var(--muted); }
.login-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.login-input input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 11px 0; font-size: 14px; color: var(--text); }
/* autofill do Chrome pinta o campo de azul claro: mantém o fundo e a cor do tema */
.login-input input:-webkit-autofill, .login-input input:-webkit-autofill:hover, .login-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--bg) inset; transition: background-color 9999s; }
.login-error { background: var(--red-bg); border: 1px solid rgba(239,68,68,.4); color: #f87171; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; }
.login-error[hidden] { display: none; }
.login-btn { width: 100%; padding: 11px; font-size: 14px; margin-top: 4px; }
.login-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.login-foot .powered { display: inline-flex; align-items: center; gap: 7px; }
.login-foot .powered img { display: block; }
.login-foot small { font-size: 11px; color: var(--dim); }
.login-foot .copy { margin-top: 12px; letter-spacing: .06em; }
:root[data-theme="light"] .login-foot .powered img { filter: brightness(.35); }

/* Hardware observability */
.hw-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hw-tile { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 7px; min-width: 0; }
.hw-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); font-weight: 600; }
.hw-top b { font-size: 20px; color: var(--text); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.hw-tile small { font-size: 11px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.hw-bar { height: 6px; border-radius: 99px; background: rgba(34,197,94,.15); overflow: hidden; }
.hw-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .5s; }
.hw-tile.warn .hw-bar { background: var(--amber-bg); } .hw-tile.warn .hw-bar i { background: var(--amber); } .hw-tile.warn .hw-top b svg { color: var(--amber); }
.hw-tile.crit .hw-bar { background: var(--red-bg); } .hw-tile.crit .hw-bar i { background: var(--red); } .hw-tile.crit .hw-top b svg { color: var(--red); }
.hw-spark { position: relative; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 8px; }
.hw-spark-head { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; margin-bottom: 6px; }
.hw-spark svg { width: 100%; height: 64px; display: block; }
.hw-line { fill: none; stroke: var(--series-upstream); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hw-thr { stroke: var(--amber); stroke-width: 1; opacity: .7; }
.hw-thr-key { display: inline-block; width: 14px; height: 0; border-top: 1px solid var(--amber); vertical-align: middle; margin-right: 5px; }
.hw-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; margin: 14px 0 0; }
.hw-info div { min-width: 0; }
.hw-info dt { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hw-info dd { margin: 2px 0 0; font-size: 12.5px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .hw-grid { grid-template-columns: repeat(2, 1fr); } }

/* Alerts */
.chip.red { border-color: rgba(239,68,68,.45); }
.table.alerts-list td { vertical-align: middle; }
.table.alerts-list td b { display: block; font-size: 12.5px; }
.table.alerts-list td small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.table.alerts-list .msg { white-space: normal; min-width: 220px; color: var(--muted); }
.table.alerts-list tr.is-active td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.table.alerts-list .actions { display: table-cell; }
.table.alerts-list .actions .btn { margin-left: 4px; }
.empty.big { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px; }
.empty.big [data-icon], .empty.big svg { color: var(--green); }
.empty.big b { color: var(--text); font-size: 14px; }

/* Modal / toasts */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5,4,15,.7); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; flex: 1; }
.modal-body { padding: 16px 18px; display: grid; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: tin .2s ease; }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1100px) {
  .scte-layout { grid-template-columns: 1fr; }
  .route { grid-template-columns: 1fr; }
  .route-arrow { transform: rotate(90deg); }
  .out-item { grid-template-columns: auto 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 60px; }
  .sidebar .brand-word, .sidebar .nav-label, .sidebar .nav-section { display: none; }
  .clock { display: none; }
  .content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .account span:nth-child(2) { display: none; }
}

/* Botões destrutivos discretos (Clear all) */
.danger-text { color: #f87171 !important; }

/* Sino: painel de notificações */
.notif-wrap { position: relative; display: inline-flex; }
.notif-pop { position: absolute; top: calc(100% + 10px); right: 0; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.45); z-index: 45; overflow: hidden; }   /* abaixo do modal (50): confirmações abertas a partir do sino ficam por cima */
.notif-pop[hidden] { display: none; }
.np-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.np-head b { font-size: 14px; }
.np-head .chip { padding: 2px 9px; font-size: 11.5px; }
.np-head .btn { margin-left: auto; }
.np-list { overflow: auto; padding: 6px; display: grid; gap: 4px; }
.np-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 8px; border-radius: 9px; }
.np-item:hover { background: var(--panel-2); }
.np-item.active { background: rgba(239, 68, 68, .06); }
.np-item.cleared { opacity: .7; }
.np-sev { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.np-sev.red { color: #f87171; background: var(--red-bg); }
.np-sev.amber { color: var(--amber); background: var(--amber-bg); }
.np-sev.cyan { color: var(--cyan); background: var(--cyan-bg); }
.np-sev.gray { color: var(--muted); background: var(--panel-2); }
.np-body { min-width: 0; }
.np-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.np-top span { color: var(--muted); font-size: 11.5px; }
.np-top time { margin-left: auto; color: var(--dim); font-size: 11px; white-space: nowrap; }
.np-body p { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.np-item .btn, .np-item .tag { align-self: center; }
.np-empty { display: grid; justify-items: center; gap: 6px; padding: 18px 10px 10px; color: var(--green); text-align: center; }
.np-empty b { color: var(--text); font-size: 13px; }
.np-sub, .np-more { font-size: 11px; color: var(--dim); padding: 8px 8px 2px; text-transform: uppercase; letter-spacing: .06em; }
.np-more { text-transform: none; letter-spacing: 0; text-align: center; }
.np-foot { padding: 10px 12px; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .notif-pop { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; }
}
.np-tools { margin-left: auto; display: flex; gap: 2px; }

/* Live Ingest com o MCR Box (como no Kabrath): feed B de backup, failover e a janela Create / Edit Channel */
.feed-pair { display: flex; flex-wrap: wrap; gap: 10px; }
.feed-active { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.feed-active svg { color: var(--accent-2); }
.feed-active b.a { color: #4ade80; } .feed-active b.b { color: var(--amber); }
.feed-active span { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--dim); }
.fo-panel { padding: 12px 14px; border-radius: 8px; background: rgba(139, 92, 246, .05); border: 1px solid rgba(139, 92, 246, .18); }
.fo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fo-head a { font-size: 11px; font-weight: 700; color: var(--cyan); text-decoration: none; }
.fo-head a:hover { text-decoration: underline; }
.fo-panel .sec-text { margin: 6px 0 10px; }
.fo-summary { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.fo-summary b { color: var(--text); margin: 0 3px; }
.fo-summary em { font-style: normal; color: var(--cyan); }
.if-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.if-mode { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); cursor: pointer; font: inherit; }
.if-mode b { color: var(--text); font-size: 13px; }
.if-mode small { font-size: 11px; line-height: 1.4; }
.if-mode.active { border-color: var(--accent); background: var(--accent-bg); }
.if-mode.active svg { color: var(--accent-2); }
.if-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.if-seg button:disabled { opacity: .55; cursor: not-allowed; }
.if-box { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.if-box > .label { margin-bottom: 10px; }
.if-err { color: #f87171 !important; }
.if-backup { margin: 4px 0; }
.if-backup .muted { font-size: 12px; margin-left: 6px; }
#modalBody .field + .field, #modalBody .field + .help { margin-top: 12px; }
@media (max-width: 640px) { .if-modes { grid-template-columns: 1fr; } }
#modalBody small.help { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
/* Cartão do canal de ingest (Kabrath ONE / Fast One): aviso de codec, backup, indicador de sinal e telemetria */
.ic-warning, .ic-backup { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; margin: -4px 0 8px; }
.ic-warning { color: var(--amber); }
.ic-backup { color: #4ade80; }
.icon-btn.sig { cursor: default; }
.icon-btn.sig.live { color: #4ade80; }
.icon-btn.sig.warn { color: var(--amber); }
.icon-btn.sig.pending { color: var(--cyan); }
.icon-btn.sig.idle { color: var(--dim); }
.stats .v.warn { color: var(--amber); }
.tel-hint, .tel-breach { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.tel-breach { display: flex; align-items: center; gap: 6px; color: var(--amber); }

/* Settings → Program: política de perda de sinal (como no Fast One) */
.loss-opts { display: grid; gap: 10px; }
.loss-opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.loss-opt:hover { border-color: var(--line-2); }
.loss-opt.on { border-color: var(--accent); background: var(--accent-bg); }
.loss-opt input { margin-top: 3px; accent-color: var(--accent); }
.loss-opt .lo-text { display: grid; gap: 3px; flex: 1; }
.loss-opt .lo-text small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.loss-opt .lo-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); white-space: nowrap; }

/* Settings → Region: fuso do canal (como no Kabrath) */
.tz-current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); margin-bottom: 14px; }
.tz-current b { font-family: var(--mono); }
.tz-now { margin-left: auto; font-family: var(--mono); color: var(--cyan); font-weight: 600; }
.tz-list { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; margin: -4px 0 14px; }
.tz-opt { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--text); text-align: left; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.tz-opt:hover { background: var(--accent-bg); }
.tz-opt.sel { color: var(--accent-2); font-weight: 600; }
.tz-check { margin-left: auto; display: inline-flex; }
.tz-regions { display: flex; flex-wrap: wrap; gap: 6px; }

/* SCTE-35 / Ads → Program Preview: crawl e três botões de grafismo (como no Fast One) */
.crawl-ov { position: absolute; left: 0; right: 0; bottom: 0; height: 11%; background: rgba(10, 8, 30, .82); border-top: 2px solid var(--accent); overflow: hidden; display: flex; align-items: center; pointer-events: none; }
.crawl-ov.top { top: 0; bottom: auto; border-top: 0; border-bottom: 2px solid var(--accent); }
.crawl-ov span { white-space: nowrap; color: #fff; font-weight: 700; font-size: 13px; padding-left: 100%; animation: crawl linear infinite; will-change: transform; }
@keyframes crawl { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .crawl-ov span { animation: none; padding-left: 12px; } }
.gfx-btns.three { grid-template-columns: repeat(3, 1fr); }
.gfx-btns.three .gfx-btn { font-size: 12px; padding: 8px; }
.pos-grid.two { grid-template-columns: 1fr 1fr; }

/* Program Preview: botão de áudio (como no Fast One) */
.preview .pv-audio { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: rgba(0,0,0,.6); color: #cbd5e1; cursor: pointer; }
.preview .pv-audio:hover { color: #fff; border-color: rgba(255,255,255,.35); }
.preview .pv-audio.on { color: #fff; background: var(--accent); border-color: var(--accent); }

/* SCTE-35 → Manual Insert: fim do break em destaque e CUE-IN forçado (como no Fast Creator) */
.big-btn.scte-end-now { background: #f59e0b; border-color: #f59e0b; color: #1a1205; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.big-btn.scte-end-now:hover { filter: brightness(1.08); }
.big-btn.scte-end-now small { margin-left: auto; font-weight: 600; letter-spacing: 0; font-size: 11.5px; opacity: .75; }
.big-btn.scte-force { background: var(--bg); border-color: rgba(245,158,11,.45); color: #fbbf24; }
.big-btn.scte-force:hover:not(:disabled) { background: rgba(245,158,11,.08); }
.big-btn.scte-force small { margin-left: auto; font-weight: 500; letter-spacing: 0; font-size: 11.5px; color: var(--muted); }

/* Settings → Program → Default Slate: regra de inserção */
.slate-rules { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); font-size: 12.5px; color: var(--muted); }
.slate-rules b { color: var(--text); }
.slate-rules ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.rule-errs { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: #f87171; }

/* Health: feeds A/B da entrada (verde = sinal · vermelho = iniciado sem sinal · cinza = parado) */
.sla-feeds { display: flex; gap: 4px; justify-content: flex-end; margin: 2px 0; }
.sla-feeds span { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--dim); }
.sla-feeds span.ok { color: #4ade80; border-color: rgba(34,197,94,.45); background: var(--green-bg); }
.sla-feeds span.bad { color: #f87171; border-color: rgba(239,68,68,.45); background: var(--red-bg); }

/* topo: disco da MCR Box acima de 90% (à esquerda da CPU) */
.disk-warn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: #f87171; border: 1px solid rgba(239,68,68,.5); background: var(--red-bg); border-radius: 99px; padding: 4px 10px; cursor: pointer; animation: cpuPulse 1.6s ease-in-out infinite; }
.disk-warn[hidden] { display: none; }
.chip.storage.crit { color: #f87171; border-color: rgba(239,68,68,.5); }
.log-ret select { max-width: 200px; }

/* Settings → Hardware: sem GPU NVIDIA, só o aviso centralizado no quadro */
.hw-tile.hw-nogpu { display: flex; align-items: center; justify-content: center; text-align: center; }
.hw-tile.hw-nogpu span { font-size: 13px; font-weight: 700; color: var(--muted); }

/* Settings → License → Show machine ID: o ID inteiro quebra a linha dentro da janela */
.machine-id { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.machine-id span { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.machine-id code { font-family: var(--mono); font-size: 12.5px; color: var(--cyan); word-break: break-all; line-height: 1.5; }
