@font-face { font-family: "Michroma"; src: url(/vendor/fonts/michroma-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root {
  --bg: #0e1116; --panel: #161b22; --panel-2: #1c232d; --line: #2a323d;
  --text: #e6edf3; --muted: #8b96a5; --accent: #2f81f7; --accent-2: #1f6feb;
  --ok: #3fb950; --rec: #f85149; --warn: #d29922; --off: #6e7681;
  --radius: 8px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-size: 17px; letter-spacing: .3px; }
.brand .logo { color: var(--rec); }
.brand small { color: var(--muted); font-size: 11px; margin-left: 6px; }
nav { display: flex; gap: 4px; }
.tab { background: none; border: 0; color: var(--muted); padding: 8px 14px; border-radius: var(--radius);
  cursor: pointer; font: inherit; }
.tab.active, .tab:hover { color: var(--text); background: var(--panel-2); }

main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)) 2fr; gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.stat span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; text-transform: none; }
.bar { height: 8px; background: var(--panel-2); border-radius: 4px; margin: 8px 0 4px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--ok); transition: width .4s; }

.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.view-head h2 { margin: 0; font-size: 18px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
td.err { color: var(--warn); font-size: 12px; max-width: 280px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; background: var(--panel-2); white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.badge.recording::before { background: var(--rec); animation: pulse 1.4s infinite; }
.badge.online::before { background: var(--ok); }
.badge.reconnecting::before, .badge.error::before, .badge.offline::before { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }

.btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent-2); border-color: var(--accent); }
.btn.danger { color: var(--rec); }
.btn.rec { color: #fff; background: #8e1c1c; border-color: var(--rec); }
.btn.ghost { background: none; }
.btn:disabled { opacity: .5; cursor: wait; }

input, select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font: inherit; width: 100%; }
.filters input, .filters select { width: auto; }
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 0; width: min(720px, 95vw); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog form { padding: 20px; }
dialog h3 { margin: 0 0 16px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.grid .full { grid-column: 1 / -1; }
.req { color: var(--rec); }
.dlg-actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }
.spacer { flex: 1; }
.test-result { margin-top: 14px; padding: 10px 12px; border-radius: 6px; font-size: 13px; }
.test-result.ok { background: rgba(63,185,80,.12); border: 1px solid var(--ok); }
.test-result.fail { background: rgba(248,81,73,.1); border: 1px solid var(--rec); }

.rec-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.player { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.player video { width: 100%; background: #000; border-radius: 6px; aspect-ratio: 16/9; }

.lvl-warning { color: var(--warn); } .lvl-error { color: var(--rec); }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel-2); border: 1px solid var(--line);
  padding: 12px 16px; border-radius: var(--radius); max-width: 420px; box-shadow: 0 6px 24px rgba(0,0,0,.4); z-index: 20; }
.toast.error { border-color: var(--rec); }

/* ---- Ao vivo ---- */
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.tile { position: relative; background: #000; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 16/9; cursor: pointer; }
.tile:hover { border-color: var(--accent); }
.tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; display: flex; gap: 8px;
  align-items: center; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-size: 13px; }
.tile .label .clock { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile .nosignal, .live-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }
.live-dialog { width: min(1280px, 96vw); max-height: 96vh; }
.live-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.live-body { position: relative; background: #000; aspect-ratio: 16/9; }
.live-body img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: pulse 1.4s infinite; }

/* ---- Usuário / perfil ---- */
body:not(.is-admin) .admin-only { display: none !important; }
.brand-logo { width: 26px; height: 26px; vertical-align: -7px; margin-right: 4px; }
.user-menu { display: flex; gap: 4px; align-items: center; }
#btn-profile { display: flex; gap: 8px; align-items: center; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-2); display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.avatar.big { width: 44px; height: 44px; font-size: 18px; }
.profile { padding: 20px; }
.profile form { padding: 0; }
.profile-head { display: flex; gap: 12px; align-items: center; }
.profile-head h3 { margin: 0; }
.profile h4 { margin: 22px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 16px; }
.consent { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.consent p { margin: 6px 0 10px; color: var(--muted); line-height: 1.5; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: auto; }
.pf-pass { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.face-frame { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4/3; }
.face-frame.small-frame { max-width: 360px; margin: 0 auto; }
.face-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.face-oval { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 30% 42% at 50% 47%, transparent 98%, rgba(14,17,22,.62) 100%); }
.face-oval::after { content: ""; position: absolute; left: 50%; top: 47%; width: 60%; height: 84%;
  transform: translate(-50%,-50%); border: 2px dashed rgba(88,166,255,.85); border-radius: 50%; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.tag.ok { color: var(--ok); border-color: var(--ok); }
.tag.off { color: var(--muted); }

@media (max-width: 900px) {
  #user-name { display: none; }
  .mosaic { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats .disk { grid-column: 1 / -1; }
  .rec-layout, .grid { grid-template-columns: 1fr; }
  main { padding: 12px; }
}

/* =====================================================================
   TEMA "Corporativo Azul" (v0.1.3)
   Paleta: marinho #0d2155 · azul profundo #002060 · faixa #004087 ·
           destaque #1e488f · branco · cinza-claro #d0cece
   Layout inspirado em peças corporativas: fundo marinho, cards brancos
   com faixa azul no topo e botões sólidos em azul profundo.
   ===================================================================== */
:root {
  --navy: #0d2155; --navy-deep: #002060; --stripe: #004087; --blue: #1e488f;
  --navy-line: #354672; --on-navy: #ffffff; --on-navy-muted: #b9c3dd;
  --bg: var(--navy); --panel: #ffffff; --panel-2: #f3f5f9; --line: #dde2ec;
  --text: #0d2155; --muted: #5b6b8c; --accent: var(--stripe); --accent-2: var(--navy-deep);
  --ok: #1a7f37; --rec: #d1242f; --warn: #9a6700; --off: #8c959f;
  --radius: 10px;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}
body { background: var(--navy); color: var(--text); }

/* Cabeçalho */
.topbar { background: var(--navy); border-bottom: 1px solid var(--navy-line); color: var(--on-navy); padding: 12px 24px; }
.brand { color: var(--on-navy); font-size: 19px; }
.brand small { color: var(--on-navy-muted); }
.tab { color: var(--on-navy-muted); font-weight: 500; }
.tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab.active { color: #fff; background: var(--stripe); }
.topbar .btn.ghost { color: #fff; border-color: var(--navy-line); }
.topbar .btn.ghost:hover { border-color: #fff; }
.avatar { background: var(--stripe); border: 2px solid rgba(255,255,255,.6); }

/* Textos diretamente sobre o marinho */
.view-head h2 { color: var(--on-navy); font-size: 22px; font-weight: 600; }
.view-head .muted, .view > p.muted, #mosaic > p.muted { color: var(--on-navy-muted); }

/* Cards brancos com faixa azul (assinatura visual) */
.stat, .table-wrap, .player, dialog {
  background: var(--panel); color: var(--text); border: 0; border-top: 5px solid var(--stripe);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.stat { border-radius: var(--radius); }
.stat span { color: var(--muted); font-weight: 600; }
.stat strong { color: var(--navy-deep); font-weight: 800; }
.bar { background: #e6eaf2; }

/* Tabelas */
th { background: var(--panel-2); color: var(--navy-deep); font-weight: 700; }
th, td { border-bottom: 1px solid var(--line); }
tbody tr:hover td { background: #f7f9fc; }
td .sub { color: var(--muted); }
td.err { color: var(--warn); }

/* Botões (estilo "selo de preço": sólido, azul profundo) */
.btn { background: #fff; color: var(--navy-deep); border: 1px solid #c7cfdd; border-radius: 8px; font-weight: 600; }
.btn:hover { border-color: var(--stripe); background: #f3f6fc; }
.btn.primary { background: var(--navy-deep); color: #fff; border-color: var(--navy-deep); box-shadow: 0 2px 6px rgba(0,32,96,.35); }
.btn.primary:hover { background: var(--stripe); border-color: var(--stripe); }
.view-head .btn.primary { border-color: #fff; }
.btn.rec { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn.danger { color: var(--rec); }
.btn.ghost { background: transparent; }

/* Formulários */
input, select { background: #fff; color: var(--text); border: 1px solid #c7cfdd; }
input:focus, select:focus { outline: 2px solid var(--stripe); border-color: transparent; }
.grid label, .pf-pass { color: var(--muted); font-weight: 600; }

/* Diálogos */
dialog { border-radius: 14px; }
dialog::backdrop { background: rgba(5,15,40,.65); }
.profile h4 { color: var(--navy-deep); border-top-color: var(--line); }
.consent { background: var(--panel-2); border-color: var(--line); }

/* Status */
.badge { background: #eef2fa; color: var(--navy-deep); font-weight: 600; }
.tag { background: #eef2fa; border-color: #c7cfdd; color: var(--navy-deep); }
.tag.ok { color: var(--ok); border-color: var(--ok); background: #e9f6ee; }
.test-result.ok { background: #e9f6ee; border-color: var(--ok); }
.test-result.fail { background: #fdecee; border-color: var(--rec); }
.lvl-warning { color: var(--warn); font-weight: 600; } .lvl-error { color: var(--rec); font-weight: 600; }

/* Ao vivo */
.tile { border: 2px solid var(--navy-line); border-radius: var(--radius); }
.tile:hover { border-color: #fff; }
.live-dialog { border-top-width: 5px; }
.live-head { background: #fff; border-bottom-color: var(--line); }
.player video { border-radius: 8px; }

/* Avisos */
.toast { background: #fff; color: var(--text); border: 0; border-left: 5px solid var(--stripe); }
.toast.error { border-left-color: var(--rec); }
.view-head .btn.primary { background: var(--stripe); border: 1px solid rgba(255,255,255,.8); }
.view-head .btn.primary:hover { background: #0a55ad; }

/* =====================================================================
   TEMA ESCURO (mesma paleta azul, superfícies escuras)
   Ativado por <html data-theme="dark"> — ver js/theme.js
   ===================================================================== */
.theme-btn { min-width: 92px; }
[data-theme="dark"] {
  --navy: #07122e; --navy-line: #1f3166; --stripe: #2f6fd1; --navy-deep: #2f6fd1;
  --on-navy-muted: #9fb0d6;
  --panel: #0f1d45; --panel-2: #142553; --line: #23366c;
  --text: #e6ecf8; --muted: #9fb0d6;
  --ok: #3fb950; --rec: #f85149; --warn: #e3b341; --off: #8b96a5;
  color-scheme: dark;
}
[data-theme="dark"] .topbar { background: #0a1838; }
[data-theme="dark"] .stat, [data-theme="dark"] .table-wrap, [data-theme="dark"] .player,
[data-theme="dark"] dialog { box-shadow: 0 6px 18px rgba(0,0,0,.45); }
[data-theme="dark"] .stat strong { color: #ffffff; }
[data-theme="dark"] th { color: #c9d6f2; }
[data-theme="dark"] tbody tr:hover td { background: #13234f; }
[data-theme="dark"] .bar { background: #1a2b5e; }
[data-theme="dark"] .btn { background: #142553; color: #e6ecf8; border-color: #2a3d78; }
[data-theme="dark"] .btn:hover { background: #1a2e66; border-color: var(--stripe); }
[data-theme="dark"] .btn.primary { background: var(--stripe); border-color: var(--stripe); color: #fff; box-shadow: 0 2px 8px rgba(47,111,209,.4); }
[data-theme="dark"] .btn.primary:hover { background: #3d7fe6; }
[data-theme="dark"] .btn.ghost { background: transparent; }
[data-theme="dark"] .btn.danger { color: var(--rec); }
[data-theme="dark"] .btn.rec { background: #b62324; border-color: var(--rec); color: #fff; }
[data-theme="dark"] input, [data-theme="dark"] select { background: #0a1736; color: var(--text); border-color: #2a3d78; }
[data-theme="dark"] .badge, [data-theme="dark"] .tag { background: #1a2b5e; color: #dfe7f7; border-color: #2a3d78; }
[data-theme="dark"] .tag.ok { background: rgba(63,185,80,.12); color: var(--ok); border-color: var(--ok); }
[data-theme="dark"] .test-result.ok { background: rgba(63,185,80,.12); }
[data-theme="dark"] .test-result.fail { background: rgba(248,81,73,.12); }
[data-theme="dark"] .toast { background: #142553; color: var(--text); }
[data-theme="dark"] .live-head { background: var(--panel); }
[data-theme="dark"] .tile { border-color: #1f3166; }
[data-theme="dark"] .tile:hover { border-color: var(--stripe); }
[data-theme="dark"] dialog::backdrop { background: rgba(0,0,0,.7); }

/* ---------- perfis de acesso e Gestão (v0.4.0) ---------- */
body:not(.can-edit) .editor-only { display: none !important; }
body.is-restricted .full-access-only { display: none !important; }   /* v0.10.0: acesso limitado a algumas câmeras */
.role-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.role-badge:empty { display: none; }
.role-badge.admin { color: #f43f5e; background: rgba(244,63,94,.12); border-color: rgba(244,63,94,.45); }
.role-badge.editor { color: #d97706; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.45); }
.role-badge.viewer { color: #0ea5e9; background: rgba(14,165,233,.12); border-color: rgba(14,165,233,.45); }
#btn-profile .role-badge { margin-left: 6px; font-size: 10.5px; padding: 1px 7px; }
.gm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.gm-head h2 { margin: 2px 0 4px; font-size: 22px; }
.gm-head p { margin: 0; }
.gm-kicker { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; letter-spacing: 1.6px; font-weight: 700; color: var(--accent); }
.gm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.gm-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; border-top: 3px solid var(--accent); }
.gm-kpi.admin { border-top-color: #f43f5e; } .gm-kpi.editor { border-top-color: #f59e0b; } .gm-kpi.viewer { border-top-color: #0ea5e9; }
.gm-kpi span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.gm-kpi strong { display: block; font-size: 26px; font-variant-numeric: tabular-nums; margin: 2px 0; }
.gm-kpi small { color: var(--muted); font-size: 12px; }
.gm-tabs { margin-bottom: 12px; }
.gm-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.gm-filters input { flex: 1 1 240px; }
.gm-filters select { flex: 0 1 220px; }
.gm-user { display: flex; align-items: center; gap: 10px; }
.gm-user strong { display: block; }
.gm-user small { color: var(--muted); font-size: 12px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; flex: none; color: #fff; }
.avatar.co { border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
tr.gm-off td { opacity: .62; }
tr.gm-off td:last-child { opacity: 1; }
.gm-empty { text-align: center; padding: 26px 12px !important; }
.btn.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.gm-role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 12px; }
.gm-role-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; border-left: 4px solid; }
.gm-role-card.admin { border-left-color: #f43f5e; } .gm-role-card.editor { border-left-color: #f59e0b; } .gm-role-card.viewer { border-left-color: #0ea5e9; }
.gm-role-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.gm-role-top span:last-child { font-size: 12px; color: var(--muted); }
.gm-role-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.gm-matrix td:not(:first-child), .gm-matrix th:not(:first-child) { text-align: center; width: 130px; }
.gm-yes { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 800;
  color: #fff; background: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,.35); }
.gm-no { color: var(--muted); }
.gm-role-hint { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.5; color: var(--muted); }
#company-form textarea { width: 100%; resize: vertical; font: inherit; }

/* ---------- seletor de câmera (v0.4.2) ---------- */
select.ncp-native { display: none !important; }
.ncp { position: relative; display: inline-block; min-width: 340px; max-width: 100%; vertical-align: middle; }
.ncp-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 12px 6px 6px; cursor: pointer; font: inherit; text-align: left;
  color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s; }
.ncp-btn:hover, .ncp.open .ncp-btn { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ncp-tile { --sc: #6b7280; position: relative; flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--sc) 50%, transparent);
  box-shadow: inset 0 0 10px color-mix(in srgb, var(--sc) 22%, transparent); }
.ncp-tile svg { width: 20px; height: 20px; }
.ncp-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--sc);
  border: 2px solid var(--panel); }
.ncp-dot.live { box-shadow: 0 0 0 0 var(--sc); animation: ncpPulse 1.8s infinite; }
@keyframes ncpPulse { 70% { box-shadow: 0 0 0 6px transparent; } }
.ncp-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ncp-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ncp-line strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncp-code { flex: none; font-family: ui-monospace, Consolas, monospace; font-size: 11px; letter-spacing: .5px; padding: 1px 6px; border-radius: 5px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.ncp-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: ui-monospace, Consolas, monospace; letter-spacing: .3px; }
.ncp-txt small em { font-style: normal; font-weight: 700; }
.ncp-count { flex: none; font-size: 11px; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--panel-2); }
.ncp-chev { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.ncp.open .ncp-chev { transform: rotate(180deg); }
.ncp-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: max(100%, 420px); max-width: 92vw;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.45); animation: ncpIn .14s ease-out; }
@keyframes ncpIn { from { opacity: 0; transform: translateY(-4px); } }
.ncp-search { display: flex; align-items: center; gap: 8px; margin: 10px; padding: 0 10px; height: 36px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.ncp-search:focus-within { border-color: var(--accent); }
.ncp-search svg { width: 15px; height: 15px; flex: none; }
.ncp-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: none !important; color: var(--text); font: inherit; padding: 0 !important; box-shadow: none !important; }
.ncp-list { max-height: 360px; overflow-y: auto; padding: 0 6px 6px; }
.ncp-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.ncp-item:hover, .ncp-item.hi { background: var(--panel-2); }
.ncp-item.sel { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.ncp-rec { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .6px; color: #fff; background: #ef4444; padding: 2px 6px; border-radius: 5px; }
.ncp-check { flex: none; color: var(--accent); font-weight: 800; }
.ncp-empty { margin: 0; padding: 18px; text-align: center; color: var(--muted); }
@media (max-width: 640px) { .ncp { min-width: 0; width: 100%; } .ncp-count { display: none; } }

/* ---------- janela de confirmação do sistema (nvConfirm) — substitui o "localhost diz" ---------- */
dialog.nvc { --tc: #e11d2e; --tc-soft: rgba(225,29,46,.14); width: min(470px, 94vw); padding: 0; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tc) 35%, var(--line)); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03) inset; animation: nvc-in .18s cubic-bezier(.2,.9,.3,1.2); }
dialog.nvc[data-tone="warning"] { --tc: #f59e0b; --tc-soft: rgba(245,158,11,.14); }
dialog.nvc[data-tone="info"] { --tc: #3b82f6; --tc-soft: rgba(59,130,246,.14); }
dialog.nvc::backdrop { background: rgba(4,6,10,.62); backdrop-filter: blur(3px); animation: nvc-fade .18s ease; }
dialog.nvc.nvc-out { animation: nvc-out .14s ease forwards; }
@keyframes nvc-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes nvc-out { to { opacity: 0; transform: scale(.97); } }
@keyframes nvc-fade { from { opacity: 0; } }
.nvc-glow { height: 4px; background: linear-gradient(90deg, transparent, var(--tc), transparent); }
.nvc-head { display: flex; gap: 14px; align-items: center; padding: 20px 22px 4px; }
.nvc-icon { position: relative; flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  color: var(--tc); background: var(--tc-soft); border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); }
.nvc-icon::after { content: ""; position: absolute; inset: -5px; border-radius: 17px; border: 1px solid var(--tc); opacity: 0;
  animation: nvc-ring 2.2s ease-out infinite; }
@keyframes nvc-ring { 0% { opacity: .55; transform: scale(.9); } 70%, 100% { opacity: 0; transform: scale(1.18); } }
.nvc-icon svg { width: 25px; height: 25px; }
.nvc-titles small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--tc); }
.nvc-titles h3 { margin: 2px 0 0; font-size: 19px; line-height: 1.25; }
.nvc-subject { margin: 14px 22px 0; padding: 11px 14px; border-radius: 10px; background: var(--panel-2);
  border: 1px solid var(--line); border-left: 3px solid var(--tc); display: flex; flex-direction: column; gap: 2px; }
.nvc-subject b { font-size: 15px; word-break: break-word; }
.nvc-subject span { font-size: 12.5px; color: var(--muted); }
.nvc-msg { margin: 12px 22px 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.nvc-impacts { list-style: none; margin: 14px 22px 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.nvc-impacts li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; }
.nvc-impacts i { flex: none; width: 19px; height: 19px; border-radius: 6px; display: grid; place-items: center; font-style: normal;
  font-size: 11px; font-weight: 900; margin-top: 1px; }
.nvc-impacts .del i { background: rgba(239,68,68,.16); color: #ef4444; }
.nvc-impacts .keep i { background: rgba(34,197,94,.16); color: #22c55e; }
.nvc-impacts .warn i { background: rgba(245,158,11,.16); color: #f59e0b; }
.nvc-impacts .info i { background: rgba(59,130,246,.16); color: #3b82f6; }
.nvc-check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 22px 0; padding: 11px 13px; border-radius: 10px;
  border: 1px dashed var(--line); cursor: pointer; transition: border-color .15s, background .15s; }
.nvc-check input { margin-top: 3px; accent-color: var(--tc); width: 16px; height: 16px; flex: none; }
.nvc-check b { display: block; font-size: 13.5px; }
.nvc-check small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.nvc-armed .nvc-check { border-style: solid; border-color: var(--tc); background: var(--tc-soft); }
.nvc-type { margin: 10px 22px 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.nvc-type.hidden { display: none; }
.nvc-type code { font-weight: 800; color: var(--text); background: var(--panel-2); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); }
.nvc-type input { padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
  font-weight: 700; letter-spacing: .5px; }
.nvc-type input:focus { outline: none; border-color: var(--tc); box-shadow: 0 0 0 3px var(--tc-soft); }
.nvc-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 22px 20px; margin-top: 6px; }
.nvc-actions .btn { min-width: 112px; padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.nvc-ok { color: #fff !important; border: 0 !important; }
.nvc-ok.danger { background: linear-gradient(180deg, #ef2b3c, #c8101f) !important; box-shadow: 0 8px 22px rgba(225,29,46,.35); }
.nvc-ok.warning { background: linear-gradient(180deg, #f59e0b, #d97706) !important; box-shadow: 0 8px 22px rgba(245,158,11,.3); }
.nvc-ok.info { background: linear-gradient(180deg, #3b82f6, #2563eb) !important; box-shadow: 0 8px 22px rgba(59,130,246,.3); }
.nvc-ok:disabled { opacity: .4; box-shadow: none; cursor: not-allowed; }
.nvc-ok:not(:disabled):hover { filter: brightness(1.08); }
.nvc-cancel:focus-visible, .nvc-ok:focus-visible { outline: 2px solid var(--tc); outline-offset: 2px; }
/* a caixa extra da confirmação não herda o layout de campo de formulário (rótulo em coluna, input 100%) */
dialog.nvc label.nvc-check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; margin: 16px 22px 0; font-weight: 400; }
dialog.nvc label.nvc-check > span { flex: 1; min-width: 0; text-align: left; }
dialog.nvc label.nvc-check input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 3px 0 0; flex: none; box-shadow: none; }
dialog.nvc .nvc-type input { width: auto; margin: 0; }

/* marca Eliris: "Eli" + "ris" na cor de destaque (como no rodapé do login) */
.brand-name { font-weight: 800; letter-spacing: .4px; }
.brand-name span { color: var(--stripe); }

/* ---------- v0.10.0: acesso às câmeras por usuário (Gestão → usuário) ---------- */
.ua-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 4px 0 0; min-width: 0; }
.ua-box legend { padding: 0 6px; font-weight: 700; font-size: 13px; }
.ua-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ua-opt { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 8px; margin: 0; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; font-size: 13px; }
.ua-opt input { width: auto; margin: 2px 0 0; }
.ua-opt span { display: grid; gap: 2px; }
.ua-opt small { color: var(--muted); font-size: 11.5px; }
.ua-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.ua-box.is-admin-role .ua-opt { opacity: .45; pointer-events: none; }
#ua-admin-note { margin: 8px 0 0; }
#ua-pick { margin-top: 10px; display: grid; gap: 8px; }
#ua-pick.hidden { display: none; }
.ua-bar { display: flex; gap: 10px; align-items: center; }
.ua-bar input { flex: 1; min-width: 0; }
.ua-sum { font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.ua-sum.on { color: var(--accent); }
.ua-sum.zero { color: #f59e0b; }
.ua-tree { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; gap: 2px;
  background: color-mix(in srgb, var(--panel-2) 50%, transparent); }
.ua-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px calc(6px + var(--lvl, 0) * 18px); border-radius: 8px; font-size: 13px; }
.ua-row:hover { background: var(--panel-2); }
.ua-row label { display: flex !important; flex-direction: row !important; align-items: center; gap: 7px; margin: 0; cursor: pointer; min-width: 0; flex: 1; }
.ua-row input { width: auto; margin: 0; }
.ua-row .ua-n { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ua-row.folder b { font-weight: 650; }
.ua-row.cam { font-size: 12.5px; }
.ua-row.cam .ua-code { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.ua-row.cam .ua-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-row.on { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.ua-row.inh label { cursor: default; }
.ua-row.inh .ua-tag { font-size: 10.5px; color: var(--accent); white-space: nowrap; }
.ua-tw { width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px;
  transition: transform .15s; flex: none; }
.ua-tw.closed { transform: rotate(-90deg); }
.ua-tw.empty { visibility: hidden; }
.ua-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.ua-cell { font-size: 12.5px; white-space: nowrap; }
.ua-cell.lim { color: var(--accent); font-weight: 600; }
@media (max-width: 640px) { .ua-mode { grid-template-columns: 1fr; } }
/* o formulário em grade (.grid label / input largura total) não vale dentro do seletor de acesso */
#ua-box label { justify-content: flex-start !important; text-align: left; color: var(--text); font-weight: 500; font-size: 13px; }
#ua-box input[type="checkbox"], #ua-box input[type="radio"] { width: 16px !important; height: 16px; flex: none; padding: 0; accent-color: var(--accent); }
#ua-box .ua-opt small { font-weight: 400; }

/* ============ Vídeo → RTSP (v0.13.0) ============ */
.vd-warn { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); margin-bottom: 12px; }
.vd-top { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 14px; margin-bottom: 16px; }
.vd-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border: 2px dashed var(--line); border-radius: 12px;
  background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; min-height: 92px; }
.vd-drop:hover, .vd-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.vd-drop.busy { pointer-events: none; opacity: .85; }
.vd-drop-ico { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 26px;
  color: #fff; background: var(--accent); }
.vd-up { position: absolute; left: 14px; right: 14px; bottom: 10px; display: flex; flex-direction: column; gap: 3px; }
.vd-up em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.vd-bar { display: block; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.vd-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s linear; }
.vd-steps { list-style: none; counter-reset: vd; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.vd-steps li { counter-increment: vd; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.vd-steps li::before { content: counter(vd); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--accent); border: 1.5px solid var(--accent); margin-bottom: 4px; }
.vd-steps li span { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.vd-list { display: flex; flex-direction: column; gap: 10px; }
.vd-empty { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 34px; border: 1px dashed var(--line); border-radius: 12px; }
.vd-card { display: grid; grid-template-columns: 176px 1fr auto; gap: 14px; align-items: start; padding: 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; border-left: 4px solid var(--off); }
.vd-card.st-transmitindo { border-left-color: var(--ok); }
.vd-card.st-pronto { border-left-color: var(--accent); }
.vd-card.st-erro { border-left-color: var(--rec); }
.vd-card.st-processando { border-left-color: var(--warn); }
.vd-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; font-size: 28px; }
.vd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-thumb em { position: absolute; right: 6px; bottom: 6px; font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: rgba(0,0,0,.7); color: #fff; }
.vd-live { position: absolute; left: 6px; top: 6px; font-size: 10px; letter-spacing: .5px; padding: 2px 6px; border-radius: 4px; background: var(--rec); color: #fff; }
.vd-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.vd-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vd-title b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.vd-prog { display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.vd-prog small { color: var(--muted); }
.vd-prog.live .vd-bar i { background: var(--ok); }
.vd-note { margin: 0; font-size: 13px; color: var(--muted); }
.vd-note.err { color: var(--rec); }
.vd-url { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vd-url code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; padding: 6px 10px; border-radius: 6px; background: var(--panel-2);
  border: 1px solid var(--line); user-select: all; word-break: break-all; }
.vd-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 190px; }
.vd-rep { display: flex !important; flex-direction: row !important; align-items: center; justify-content: flex-start !important; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 2px 4px; cursor: pointer; white-space: nowrap; text-align: left; }
.vd-rep input { width: auto !important; margin: 0; flex: none; }
@media (max-width: 1100px) { .vd-top { grid-template-columns: 1fr; } .vd-steps { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (max-width: 800px) { .vd-card { grid-template-columns: 120px 1fr; } .vd-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; } }

/* ============ Câmeras organizadas por pasta (v0.14.2) ============ */
.cf-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cf-search { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; max-width: 420px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); }
.cf-search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.cf-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 8px 0 !important; width: 100%; }
.cf-table td.cf-ind { padding-left: calc(12px + var(--d, 0) * 26px) !important; }
.cf-table tr.cf-folder td.cf-ind { border-left: 3px solid color-mix(in srgb, var(--accent) calc(100% - var(--d, 0) * 35%), transparent); }
.cf-folder td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); padding-top: 7px; padding-bottom: 7px; }
.cf-folder[data-fkey="none"] td { background: transparent; }
.cf-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cf-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0; color: var(--text); font: inherit;
  cursor: pointer; text-align: left; }
.cf-toggle b { font-size: 14px; }
.cf-caret { display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.cf-folder.closed .cf-caret { transform: rotate(-90deg); }
.cf-n { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.cf-stats { display: inline-flex; gap: 12px; font-size: 12px; }
.cf-stats i { font-style: normal; color: var(--muted); }
.cf-stats i.ok { color: var(--ok); }
.cf-stats i.rec { color: var(--rec); }
.cf-add { margin-left: auto; padding: 3px 10px !important; font-size: 12px !important; }
.cf-cam:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.cf-empty td { padding-top: 6px; padding-bottom: 6px; }

/* v0.16.0: nome ELIRIS no topo com a mesma fonte larga da logo */
.brand-name { font-family: "Michroma", "Space Grotesk", sans-serif !important; font-weight: 400 !important;
  letter-spacing: 4px !important; font-size: 15px; vertical-align: 1px; }
.brand-logo { width: 30px !important; height: 30px !important; vertical-align: -9px !important; margin-right: 8px !important; }

/* v0.16.1: seletor de câmera agrupado por pasta */
.ncp-pop { width: max(100%, 480px) !important; }
.ncp-list { max-height: 440px !important; }
.ncp-folder { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px calc(10px + var(--d, 0) * 18px); margin-top: 4px;
  border-radius: 8px; cursor: pointer; user-select: none; position: sticky; top: 0; z-index: 1;
  background: color-mix(in srgb, var(--panel-2) 92%, transparent); backdrop-filter: blur(4px); }
.ncp-folder:hover { background: var(--panel-2); }
.ncp-caret { flex: none; width: 14px; height: 14px; display: grid; color: var(--muted); transition: transform .15s; }
.ncp-caret svg { width: 14px; height: 14px; }
.ncp-folder.open .ncp-caret { transform: rotate(90deg); }
.ncp-ficon { flex: none; width: 16px; height: 16px; color: #f5b041; display: grid; }
.ncp-folder.loose .ncp-ficon { color: var(--muted); }
.ncp-ficon svg { width: 16px; height: 16px; }
.ncp-fname { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; letter-spacing: .3px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncp-fstat { flex: none; font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--muted); }
.ncp-fstat i { font-style: normal; font-weight: 700; }
.ncp-fstat i.ok { color: #22c55e; }
.ncp-fstat i.rec { color: #ef4444; }
.ncp-item { margin-left: calc(var(--d, 0) * 18px); position: relative; }
.ncp-item[style*="--d"]::before { content: ""; position: absolute; left: -9px; top: 8px; bottom: 8px; border-left: 1px solid var(--border); }
.ncp-path { color: var(--text); opacity: .75; }
