/* Eliris — LAYOUT NOVO (v0.15.0, em teste). Tudo aqui vale só com <body class="nv-new"> (js/layout-novo.js).
   Fontes próprias (SIL OFL, em /vendor/fonts): Inter (texto), Space Grotesk (títulos), JetBrains Mono (códigos/horas). */
@font-face { font-family: "Inter"; src: url(/vendor/fonts/inter-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/vendor/fonts/inter-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/vendor/fonts/inter-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/vendor/fonts/inter-latin-700-normal.woff2) format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(/vendor/fonts/space-grotesk-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(/vendor/fonts/space-grotesk-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(/vendor/fonts/space-grotesk-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/vendor/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/vendor/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/vendor/fonts/jetbrains-mono-latin-600-normal.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }

/* ---------- fora do layout novo: nada disto aparece; no clássico, o ⋯ some e as ações ficam em linha ---------- */
#nv-rail, #nv-head, #nv-status, #nv-tools, #nv-drawer, #nv-peek { display: none; }
.more-btn { display: none !important; }
.act-more { display: contents; }
.tile .hud { display: none; }
body.nv-new #nv-try { display: none; }
#nv-try { border-color: color-mix(in srgb, var(--accent) 55%, transparent) !important; color: var(--accent) !important; font-weight: 700; }

/* ================================================================ base */
body.nv-new { --rail-w: 72px; --nv-mono: "JetBrains Mono", ui-monospace, Consolas, monospace; --nv-head: "Space Grotesk", "Inter", sans-serif;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; padding-left: var(--rail-w); }
body.nv-new .content { background-image: radial-gradient(color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
body.nv-new .view-head h2, body.nv-new .gm-head h2, body.nv-new .an-head h2 { font-family: var(--nv-head); font-weight: 600; letter-spacing: -.2px; }
body.nv-new .gm-kicker, body.nv-new code, body.nv-new kbd, body.nv-new .ncp-code, body.nv-new .vd-url code,
body.nv-new .tile .label .clock, body.nv-new td .sub { font-family: var(--nv-mono); }
body.nv-new .cf-cam td:nth-child(3) { font-family: var(--nv-mono); font-size: 13px; }

/* ================================================================ menu lateral */
body.nv-new #nv-rail { display: flex; position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: var(--rail-w); flex-direction: column;
  align-items: center; gap: 4px; padding: 12px 0 14px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: visible;
  scrollbar-width: none; }
.nvr-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.nvr-logo img { width: 36px; height: 36px; }  /* v0.16.0: logo de câmeras maior no trilho */
.nvr-grp { font-size: 8.5px; letter-spacing: 1.3px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.nvr-sep { width: 30px; height: 1px; background: var(--line); margin: 7px 0 5px; }
.nvr-fill { flex: 1; min-height: 10px; }
.nvr-item { position: relative; width: 48px; height: 44px; flex: none; border: 0; border-radius: 12px; display: grid; place-items: center;
  background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.nvr-item:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.nvr-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nvr-item.active { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 18%, transparent); }
.nvr-item.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nvr-tip { position: fixed; left: calc(var(--rail-w) + 6px); padding: 6px 10px; border-radius: 8px; background: #111114; color: #fff; font-size: 12.5px;
  font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); border: 1px solid #2a2a30; z-index: 80; }
.nvr-item:hover .nvr-tip, .nvr-item:focus-visible .nvr-tip { opacity: 1; transform: none; }
.nvr-badge { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--rec);
  color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--panel); }
.nvr-badge.hidden { display: none; }
#nvr-classic { opacity: .75; }

/* ================================================================ barra de status (topo) */
body.nv-new .topbar { background: var(--panel) !important; border-bottom: 1px solid var(--line) !important; color: var(--text) !important; gap: 14px;
  justify-content: flex-start; padding: 0 16px 0 20px; }
body.nv-new .topbar .brand, body.nv-new .topbar > nav { display: none !important; }
body.nv-new #nv-head { display: flex; flex-direction: column; gap: 1px; min-width: 120px; flex: none; }
#nv-kicker { font-family: var(--nv-mono); font-size: 10px; letter-spacing: 2px; color: var(--accent); font-weight: 600; }
#nv-title { margin: 0; font-family: var(--nv-head); font-size: 20px; font-weight: 600; letter-spacing: -.2px; line-height: 1.1; white-space: nowrap; }
body.nv-new #nv-status { display: flex; gap: 8px; flex: 1; min-width: 0; overflow: hidden; flex-wrap: nowrap; }
.nvs-chip { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 32px; padding: 0 11px; border-radius: 9px; font-size: 12.5px;
  background: color-mix(in srgb, var(--text) 4%, transparent); border: 1px solid var(--line); color: var(--text); font-family: inherit; white-space: nowrap; }
.nvs-chip span { color: var(--muted); }
.nvs-chip b { font-family: var(--nv-mono); font-weight: 600; }
.nvs-dot { width: 8px; height: 8px; border-radius: 50%; display: block; }
.nvs-dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.nvs-dot.rec { background: var(--rec); animation: nv-blink 1.4s infinite; }
.nvs-meter { width: 46px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text) 12%, transparent); overflow: hidden; display: block; }
.nvs-meter i { display: block; height: 100%; border-radius: 3px; }
.nvs-alert { cursor: pointer; background: color-mix(in srgb, var(--rec) 10%, transparent); border-color: color-mix(in srgb, var(--rec) 40%, transparent); }
.nvs-alert b { color: var(--rec); }
.nvs-alert em { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--rec); color: #fff; }
.nvs-alert:hover { border-color: var(--rec); }
body.nv-new #nv-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.nv-cmdk { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 4%, transparent); color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.nv-cmdk kbd { font-size: 10.5px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.nv-cmdk:hover { border-color: var(--accent); color: var(--text); }
#nv-clock { font-family: var(--nv-mono); font-size: 17px; font-weight: 500; letter-spacing: 1px; min-width: 84px; text-align: right; }
.nv-bell { position: relative; width: 38px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--text);
  display: grid; place-items: center; cursor: pointer; }
.nv-bell:hover { border-color: var(--accent); }
.nv-bell b { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--rec);
  color: #fff; font-size: 10px; display: grid; place-items: center; }
.nv-bell b.hidden { display: none; }
.nv-bell.ring svg { animation: nv-ring 1.2s ease-in-out infinite; transform-origin: 50% 10%; }
body.nv-new .topbar .user-menu .btn.ghost { color: var(--text) !important; border-color: var(--line) !important; }
@media (max-width: 1500px) { .nvs-hide-s { display: none; } .nv-cmdk span { display: none; } }
@media (max-width: 1200px) { .nv-cmdk kbd { display: none; } #nv-clock { display: none; } }

/* ================================================================ central de alertas */
body.nv-new #nv-drawer { display: flex; position: fixed; z-index: 55; top: var(--top-h); right: 0; bottom: 0; width: 380px; max-width: 100vw;
  flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(0,0,0,.28);
  transform: translateX(105%); transition: transform .22s ease; }
body.nv-new.nv-drawer-open #nv-drawer { transform: none; }
.nvd-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.nvd-head h2 { margin: 0; font-family: var(--nv-head); font-size: 16px; font-weight: 600; white-space: nowrap; }
.nvd-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); animation: nv-blink 1.2s infinite; flex: none; }
.nvd-pend { font-family: var(--nv-mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nvd-fill { flex: 1; }
.nvd-icon { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); display: grid;
  place-items: center; cursor: pointer; }
.nvd-icon.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.nvd-icon:hover { color: var(--text); }
.nvd-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.nvd-empty { text-align: center; padding: 30px 12px; line-height: 1.5; }
.nvd-all { margin: 0 12px 12px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; }
.nvd-all:hover { border-color: var(--accent); }
.nva { padding: 11px; border-radius: 12px; background: color-mix(in srgb, var(--text) 3%, var(--panel)); border: 1px solid var(--line); }
.nva.hot { border-color: color-mix(in srgb, var(--rec) 55%, transparent); }
.nva.hot:not(.rated) { animation: nv-glow 2s ease-in-out infinite; }
.nva.new { animation: nv-in .35s ease-out; }
.nva.rated { opacity: .72; }
.nva-row { display: flex; gap: 11px; }
.nva-thumb { position: relative; flex: 0 0 104px; height: 64px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #0b0b0e; cursor: pointer; }
.nva-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nva-play { position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.65); color: #fff; }
.nva-play svg { fill: currentColor; }
.nva-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nva-txt b { font-size: 13.5px; line-height: 1.25; }
.nva-meta { display: flex; align-items: center; gap: 7px; }
.nva-tag { font-family: var(--nv-mono); font-size: 9.5px; letter-spacing: 1px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.nva.hot .nva-tag { background: color-mix(in srgb, var(--rec) 18%, transparent); color: var(--rec); }
.nva-ago { font-family: var(--nv-mono); font-size: 11px; color: var(--muted); }
.nva-extra { font-size: 12px; color: var(--text); opacity: .85; }
.nva-where { font-family: var(--nv-mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nva-acts { display: flex; gap: 7px; margin-top: 9px; align-items: center; }
.nva-acts button { height: 32px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0 10px; }
.nva-ok { flex: 1; border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); color: var(--ok); }
.nva-no { flex: 1; border: 1px solid var(--line); background: transparent; color: var(--text); }
.nva-open { border: 1px solid var(--line); background: transparent; color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.nva-open svg { fill: currentColor; }
.nva-acts button:hover { filter: brightness(1.15); border-color: var(--accent); }
.nva-done { flex: 1; font-size: 12px; font-weight: 600; color: var(--muted); }
.nva-done.ok { color: var(--ok); }
.nva-done.no { color: var(--muted); }

/* aviso de alerta novo (canto inferior direito) */
body.nv-new #nv-peek { display: flex; position: fixed; z-index: 70; right: 18px; bottom: 18px; width: 340px; gap: 11px; align-items: center; padding: 10px;
  border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.4); cursor: pointer;
  transform: translateY(140%); opacity: 0; transition: transform .25s ease, opacity .25s; }
body.nv-new #nv-peek.show { transform: none; opacity: 1; }
#nv-peek.hot { border-color: var(--rec); animation: nv-glow 1.6s ease-in-out infinite; }
#nv-peek img { width: 92px; height: 58px; object-fit: cover; border-radius: 8px; flex: none; }
#nv-peek div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#nv-peek small { font-family: var(--nv-mono); font-size: 10px; letter-spacing: 1.2px; color: var(--rec); font-weight: 700; }
#nv-peek b { font-size: 13.5px; }
#nv-peek span { font-family: var(--nv-mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvp-x { align-self: flex-start; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid;
  place-items: center; cursor: pointer; }

/* ================================================================ Ctrl+K */
#nv-cmd { width: min(620px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.5); margin-top: 12vh; }
#nv-cmd::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.nvc-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.nvc-in input { flex: 1; border: 0 !important; background: transparent !important; color: var(--text); font: inherit; font-size: 16px; outline: none; box-shadow: none !important; padding: 0 !important; }
.nvc-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.nvc-it { width: 100%; display: grid; grid-template-columns: 74px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; padding: 8px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.nvc-it.sel, .nvc-it:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nvc-k { grid-row: span 2; align-self: center; font-family: var(--nv-mono); font-size: 10px; letter-spacing: 1.2px; color: var(--accent); font-weight: 700; }
.nvc-it small { color: var(--muted); font-size: 12px; }
.nvc-foot { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); font-family: var(--nv-mono); }

/* ================================================================ monitor: HUD sobre o vídeo */
body.nv-new .tile { border-radius: 10px; }
body.nv-new .tile > .label { display: none !important; }
body.nv-new #toast { z-index: 95; }
body.nv-new .tile .hud { display: block; position: absolute; inset: 0; pointer-events: none; font-family: var(--nv-mono); color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.hud .hc { position: absolute; width: 16px; height: 16px; border-color: rgba(255,255,255,.6); border-style: solid; border-width: 0; }
.hud .tl { left: 8px; top: 8px; border-left-width: 2px; border-top-width: 2px; }
.hud .tr { right: 8px; top: 8px; border-right-width: 2px; border-top-width: 2px; }
.hud .bl { left: 8px; bottom: 8px; border-left-width: 2px; border-bottom-width: 2px; }
.hud .br { right: 8px; bottom: 8px; border-right-width: 2px; border-bottom-width: 2px; }
.hud-tl { position: absolute; left: 16px; top: 13px; display: flex; flex-direction: column; gap: 1px; max-width: 60%; }
.hud-tl b { font-size: 12px; letter-spacing: .5px; }
.hud-tl span { font-family: "Inter", sans-serif; font-size: 12px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-tr { position: absolute; right: 16px; top: 13px; display: flex; align-items: center; gap: 8px; font-size: 11px; }
.hud-rec { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 5px; background: rgba(225,29,46,.88); font-weight: 700; text-shadow: none; }
.hud-rec i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: nv-blink 1.2s infinite; }
.hud-bl { position: absolute; left: 16px; bottom: 13px; font-size: 11px; }
.hud-br { position: absolute; right: 16px; bottom: 13px; font-size: 11px; opacity: .85; }
.hud-alert { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); max-width: 86%; padding: 6px 12px; border-radius: 8px;
  background: rgba(225,29,46,.92); font-family: "Inter", sans-serif; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; text-shadow: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-alert:empty { display: none; }
body.nv-new .tile.alarm { border-color: var(--rec) !important; animation: nv-alarm 1.4s ease-in-out infinite; }

/* ================================================================ câmeras: Ao vivo + ⋯ */
body.nv-new #cam-rows .actions { position: relative; justify-content: flex-end; flex-wrap: nowrap; }
body.nv-new #cam-rows .more-btn { display: inline-flex !important; min-width: 38px; justify-content: center; font-size: 18px; line-height: 1; letter-spacing: 1px; }
body.nv-new #cam-rows .act-more { display: none; position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); min-width: 190px; flex-direction: column;
  gap: 4px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
body.nv-new #cam-rows .actions.open .act-more { display: flex; }
body.nv-new #cam-rows .actions.open .more-btn { border-color: var(--accent); color: var(--accent); }
body.nv-new #cam-rows .act-more .btn { width: 100%; justify-content: flex-start; text-align: left; border-color: transparent; background: transparent; }
body.nv-new #cam-rows .act-more .btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
body.nv-new #cam-rows .cf-cam td { padding-top: 8px; padding-bottom: 8px; }

/* ================================================================ animações */
@keyframes nv-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes nv-glow { 0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rec) 50%, transparent), 0 0 18px color-mix(in srgb, var(--rec) 20%, transparent); }
  50% { box-shadow: 0 0 0 1px var(--rec), 0 0 28px color-mix(in srgb, var(--rec) 40%, transparent); } }
@keyframes nv-alarm { 0%, 100% { box-shadow: 0 0 0 2px var(--rec), 0 0 26px color-mix(in srgb, var(--rec) 50%, transparent); }
  50% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--rec) 35%, transparent), 0 0 6px transparent; } }
@keyframes nv-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nv-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { body.nv-new * { animation: none !important; transition: none !important; } }

/* ================================================================ celular / tela estreita */
@media (max-width: 760px) {
  body.nv-new { --rail-w: 56px; }
  .nvr-item { width: 42px; height: 40px; }
  .nvr-grp { display: none; }
  body.nv-new #nv-head { min-width: 0; }
  body.nv-new #nv-status .nvs-chip:not(.nvs-alert) { display: none; }
  body.nv-new .nv-cmdk { display: none; }
  body.nv-new #nv-drawer { width: 100vw; }
  body.nv-new #nv-peek { left: calc(var(--rail-w) + 8px); right: 8px; width: auto; }
}

/* v0.16.0: fundo escuro atrás da logo de câmeras (o vermelho sumia no fundo vermelho) */
body.nv-new .nvr-logo { background: #0B0B0D !important; border: 1px solid rgba(255, 45, 70, .35) !important; box-shadow: 0 0 18px rgba(255, 45, 70, .18); }
