*{box-sizing:border-box}body{margin:0;background:#f4f6f9;color:#1f2937;font-family:Arial,Helvetica,sans-serif}.login{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#0b1220}.loginbox{width:360px;background:#fff;border-radius:12px;padding:24px;box-shadow:0 20px 60px #0005}.input{width:100%;height:42px;border:1px solid #d1d5db;border-radius:8px;padding:0 12px;margin:8px 0;background:#fff;color:#111827}.btn{border:0;border-radius:8px;background:#f97316;color:#fff;font-weight:800;padding:10px 14px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.btn.blue{background:#2563eb}.btn.gray{background:#64748b}.btn.red{background:#dc2626}.btn.green{background:#16a34a}.err{color:#dc2626}.layout{display:flex;min-height:100vh}.side{width:245px;background:#111827;color:#cbd5e1;position:fixed;left:0;top:0;bottom:0}.brand{height:62px;display:flex;align-items:center;gap:10px;padding:0 18px;border-bottom:1px solid #263143;color:#fff;font-weight:900}.brandIcon{color:#f97316}.nav a{display:block;color:#cbd5e1;text-decoration:none;padding:13px 18px;border-left:4px solid transparent}.nav a.active,.nav a:hover{background:#1f2937;color:#fff;border-left-color:#f97316}.main{margin-left:245px;width:calc(100% - 245px)}.top{height:62px;background:#fff;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;justify-content:space-between;padding:0 22px}.content{padding:22px}.loading{background:#fff;border-radius:12px;padding:24px;color:#64748b}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:18px}.card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 1px 3px #0001;padding:16px}.stat small{color:#64748b}.stat b{display:block;font-size:28px;margin-top:6px}.nvr{margin-bottom:18px}.nvrHead{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;border-bottom:1px solid #e5e7eb;padding-bottom:12px}.nvrTitle{font-size:22px;font-weight:900}.muted{color:#64748b}.tag{display:inline-block;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:800}.ok{background:#dcfce7;color:#166534}.off{background:#fee2e2;color:#991b1b}.camGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px;margin-top:14px}.cam{border:1px solid #e5e7eb;border-radius:12px;padding:10px;background:#f8fafc}.thumb{height:68px;background:#0b1220;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#38bdf8;font-weight:900;font-size:22px}.cam input,.nvr input{width:100%;height:36px;border:1px solid #d1d5db;border-radius:8px;padding:0 10px;margin-top:8px}.mini{font-size:12px;color:#64748b;margin:7px 0;word-break:break-word}.actions{display:flex;gap:7px;flex-wrap:wrap}.m3u8{font-size:10px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:6px;color:#2563eb;word-break:break-all}.modal{position:fixed;inset:0;background:#000c;display:none;align-items:center;justify-content:center;z-index:99}.modalBox{width:min(1050px,96vw);background:#111827;border-radius:12px;overflow:hidden}.modalTop{height:48px;display:flex;justify-content:space-between;align-items:center;padding:0 12px;background:#1f2937;color:#fff}.player{height:min(62vh,600px);background:#000}.player video{width:100%;height:100%;object-fit:cover;background:#000}.nvrViewer{display:grid;grid-template-columns:260px 1fr;gap:14px}.viewerList{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:12px}.viewerScreen{background:#020617;border-radius:12px;min-height:520px;padding:12px}.videoGrid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.videoCell{background:#000;border-radius:10px;overflow:hidden;min-height:230px;position:relative}.videoCell video{width:100%;height:100%;object-fit:cover;background:#000}.videoTitle{position:absolute;left:8px;top:8px;background:#0009;color:#fff;border-radius:8px;padding:5px 8px;font-size:12px}@media(max-width:900px){.side{position:static;width:100%}.layout{display:block}.main{margin:0;width:100%}.cards,.nvrViewer,.videoGrid{grid-template-columns:1fr}}
.nvrConsole{display:grid;grid-template-columns:280px 1fr;gap:16px;min-height:560px}.camSide{background:#0f172a;border:1px solid #243449;border-radius:16px;padding:14px}.camMenu{margin-top:14px;display:flex;flex-direction:column;gap:8px}.camItem{display:flex;flex-direction:column;align-items:flex-start;text-align:left;border:1px solid #26364e;background:#111827;color:#e5e7eb;border-radius:12px;padding:12px;cursor:pointer}.camItem span{font-size:12px;color:#a7b4c7}.camItem.active{border-color:#f97316;background:#1f2937;box-shadow:0 0 0 2px rgba(249,115,22,.25)}.camStage{background:#0f172a;border:1px solid #243449;border-radius:16px;padding:14px}.stageTop{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.stagePlayer{background:#000;border-radius:12px;overflow:hidden;aspect-ratio:16/9;border:1px solid #26364e}.stagePlayer video{width:100%;height:100%;object-fit:cover;background:#000}.stageActions{display:flex;gap:8px;align-items:center;margin-top:12px}.stageActions input{flex:1}@media(max-width:900px){.nvrConsole{grid-template-columns:1fr}.camSide{order:1}.camStage{order:2}}
.camItem small{margin-top:4px;font-size:10px;color:#38bdf8}.camItem:not(.active) small{color:#94a3b8}
.stagePlayer{position:relative}.stageStatus{position:absolute;left:14px;bottom:14px;background:#0009;color:#dbeafe;border:1px solid #334155;border-radius:999px;padding:6px 10px;font-size:12px;pointer-events:none}.camItem small{color:#7dd3fc}
.stagePlayer iframe{width:100%;height:100%;border:0;background:#000;display:block}
.playerLabLink{font-size:12px;color:#2563eb;text-decoration:none;font-weight:800}

/* Dashboard profissional DCT */
.heroDash{background:linear-gradient(135deg,#0f172a,#1e293b 55%,#f97316);border-radius:18px;padding:22px;color:#fff;margin-bottom:18px;box-shadow:0 18px 45px #0f172a33;display:flex;justify-content:space-between;align-items:center;gap:16px}.heroDash h2{margin:0 0 6px;font-size:26px}.heroDash p{margin:0;color:#dbeafe}.heroPill{background:#ffffff22;border:1px solid #ffffff33;border-radius:999px;padding:8px 12px;font-weight:900}.proCards{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:18px}.proCard{position:relative;overflow:hidden;border:0;border-radius:18px;padding:18px;color:#fff;box-shadow:0 12px 28px #0f172a22}.proCard:after{content:"";position:absolute;right:-24px;bottom:-30px;width:110px;height:110px;border-radius:50%;background:#ffffff22}.proCard .ico{font-size:28px;margin-bottom:14px}.proCard small{display:block;color:#ffffffcc;font-weight:800}.proCard b{display:block;font-size:34px;margin-top:4px}.gradBlue{background:linear-gradient(135deg,#2563eb,#06b6d4)}.gradGreen{background:linear-gradient(135deg,#16a34a,#22c55e)}.gradOrange{background:linear-gradient(135deg,#f97316,#f59e0b)}.gradPurple{background:linear-gradient(135deg,#7c3aed,#db2777)}.dashGrid{display:grid;grid-template-columns:1.3fr .7fr;gap:18px}.dashPanel{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:18px;box-shadow:0 8px 24px #0f172a0d}.dashPanel h3{margin:0 0 10px}.healthRow{display:flex;align-items:center;gap:10px;margin:10px 0}.dot{width:12px;height:12px;border-radius:999px;background:#22c55e}.dot.offline{background:#ef4444}@media(max-width:900px){.proCards,.dashGrid{grid-template-columns:1fr}.heroDash{display:block}}

/* Acesso direto /login com ID do NVR: tela exclusiva, sem menus administrativos */
.layout.nvrOnly{display:block;min-height:100vh;background:radial-gradient(circle at top left,#12345a 0,#07111f 38%,#020617 100%)}
.nvrOnlyMain{margin:0;min-height:100vh;padding:18px}.nvrOnlyMain .top{border-radius:18px;background:rgba(15,23,42,.92);border:1px solid rgba(148,163,184,.18);box-shadow:0 18px 45px rgba(0,0,0,.25)}
.nvrOnlyMain .content{padding:18px 0}.nvrOnly .nvrConsole{min-height:calc(100vh - 145px)}
.nvrOnly .camStage,.nvrOnly .stagePlayer{background:#000}.nvrOnly .stagePlayer iframe,.nvrOnly .stagePlayer video{width:100%;height:100%;object-fit:fill;border:0;background:#000}
@media(max-width:900px){.nvrOnlyMain{padding:10px}.nvrOnly .nvrConsole{grid-template-columns:1fr}.nvrOnly .camSide{order:2}.nvrOnly .camStage{order:1}}

/* Ajuste cloud: preencher 100% do quadro, sem margem lateral */
.stagePlayer iframe,.stagePlayer video,.player video,.videoCell video{width:100%!important;height:100%!important;object-fit:cover!important;background:#000!important;}
.stagePlayer{width:100%;min-height:520px;aspect-ratio:auto;}
.stagePlayer:fullscreen{width:100vw!important;height:100vh!important;border-radius:0;}
.stagePlayer:fullscreen iframe,.stagePlayer:fullscreen video{width:100vw!important;height:100vh!important;}
