:root { --bg:#f3f5f9;--panel:#fff;--panel-2:#edf1f7;--line:#dce3ed;--fg:#182437;--muted:#5e6c80;--accent:#1f6feb;--ok:#13845b;--bad:#c73c46;--warn:#a66a00;color-scheme:light; }
:root[data-theme=dark] { --bg:#0c1320;--panel:#141e2f;--panel-2:#1d2a3e;--line:#2d3b50;--fg:#edf2fa;--muted:#a5b4c9;--accent:#6ba4ff;--ok:#4dd5a0;--bad:#ff858b;--warn:#f3c46b;color-scheme:dark; }
body { font-size:14px; }
button,.btn,input,select { min-height:38px; }
a:focus-visible,summary:focus-visible { outline:3px solid var(--accent);outline-offset:3px; }
.portal-shell { min-height:100dvh;padding-top:64px;padding-left:76px; }
.portal-top { position:fixed;inset:0 0 auto;height:64px;background:#1f6feb;color:white;z-index:40;display:flex;align-items:center;gap:16px;padding:0 22px; }
.portal-brand { display:flex;align-items:center;gap:9px;white-space:nowrap;color:white;font-size:19px;letter-spacing:-.5px; }
.portal-brand img { width:33px;height:33px;background:#fff;border-radius:9px;padding:4px; }
.portal-brand small { font-size:10px;letter-spacing:.5px;background:#ffffff24;border:1px solid #ffffff40;border-radius:5px;padding:2px 5px; }
.top-links { display:flex;gap:4px;white-space:nowrap; }
.top-links a { color:white;padding:8px 16px;border-radius:24px; }
.top-links a.selected,.top-links a:hover { background:#ffffff24; }
.global-search { margin-left:auto;position:relative;width:min(340px,28vw); }
.global-search input { background:#175cc8;border-color:#ffffff38;color:#fff; }
.global-search input::placeholder { color:#e1ecff; }
.global-results { position:absolute;inset:46px 0 auto;background:var(--panel);color:var(--fg);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 30px #0002;overflow:hidden; }
.global-results a,.global-results>span { display:block;padding:12px 16px;color:var(--fg); }
.global-results a:hover { background:var(--panel-2); }
.top-button { color:white;border:0;background:transparent;min-width:40px;position:relative;font-size:21px;justify-content:center;padding:4px; }
.badge { position:absolute;top:-2px;right:-4px;border-radius:12px;background:#d3223e;color:white;font-size:10px;padding:1px 4px; }
.avatar { display:grid;place-items:center;min-width:36px;height:36px;border-radius:50%;background:#fff;color:#1f6feb;font-weight:700; }
.portal-rail { position:fixed;left:0;top:64px;bottom:0;width:76px;background:#164d9d;z-index:35;display:flex;align-items:center;flex-direction:column;gap:10px;padding:20px 0; }
.rail-link,.rail-group>summary { display:grid;place-items:center;width:46px;min-height:44px;border-radius:12px;color:#e0ecff;position:relative;font-size:24px;list-style:none;cursor:pointer; }
.rail-link.selected,.rail-link:hover,.rail-group[open]>summary { background:#ffffff26;color:#fff; }
.rail-label { display:none;position:absolute;left:60px;background:var(--panel);color:var(--fg);font-size:13px;white-space:nowrap;padding:8px 14px;border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 12px #0002; }
.rail-link:hover .rail-label,.rail-link:focus-visible .rail-label { display:block; }
.rail-account { margin-top:auto; }.rail-manage { background:transparent;border:0;padding:0; }.portal-rail { gap:6px; }.rail-icon { display:flex; }
.rail-group { position:relative; }
.rail-group summary::-webkit-details-marker { display:none; }
.rail-submenu { position:absolute;bottom:0;left:60px;width:250px;max-height:65vh;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:12px;box-shadow:0 12px 32px #0003;color:var(--fg); }
.rail-submenu a,.rail-submenu strong { display:block;padding:10px 12px; }
.rail-submenu a { color:var(--fg);border-radius:8px; }.rail-submenu a:hover { background:var(--panel-2); }
.portal-main { padding:30px 32px 48px;max-width:1800px;margin:auto; }
h1 { font-size:25px;letter-spacing:-.6px; }h2 { font-size:16px; }.intro { color:var(--muted);margin:-4px 0 24px; }
.stats-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:22px 0; }
.stat-card { background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:18px 22px;color:var(--fg);display:grid;gap:6px;position:relative; }
.stat-card>span { color:var(--muted);font-size:13px; }.stat-card strong { font-size:32px;font-weight:650;line-height:1.3; }.stat-card small { font-size:11px;color:var(--muted); }
.stat-card.online:after,.stat-card.offline:after,.stat-card.pending:after { content:'';width:9px;height:9px;border-radius:50%;position:absolute;right:22px;top:24px;background:var(--ok); }.stat-card.offline:after { background:var(--bad); }.stat-card.pending:after { background:var(--warn); }
.card { border-radius:14px;padding:22px; }.home-columns { display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:22px; }.home-aside { display:grid;align-content:start;gap:22px; }
.ops-dashboard { display:grid;grid-template-columns:minmax(250px,310px) minmax(0,1fr);gap:16px;padding:16px;background:#0d1015;border:1px solid #242a33;border-radius:16px;color:#edf2f8;min-height:560px; }
.ops-sidebar { display:grid;align-content:start;gap:12px;min-width:0; }
.ops-panel { padding:17px;background:#13171d;border:1px solid #282e37;border-radius:11px;content-visibility:auto;contain-intrinsic-size:auto 280px auto 180px; }
.ops-panel h2 { margin:0;color:#eef3f9; }.ops-panel-title { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px; }.ops-ok { color:#58d48a;font-size:11px; }.ops-ok:before { content:'';display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:50%;background:currentColor; }
.ops-facts { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:11px 14px;margin:0;color:#aeb8c5; }.ops-facts dt,.ops-facts dd { margin:0; }.ops-facts dd { color:#eef3f9;text-align:right;font-variant-numeric:tabular-nums; }
.ops-meter { block-size:9px;margin:12px 0 15px;border-radius:99px;background:#343b46;overflow:clip; }.ops-meter span { display:block;block-size:100%;border-radius:inherit;background:#35c978; }
.ops-panel .quick-links { margin-top:14px; }.ops-panel .btn { background:#1a2029;border-color:#303946;color:#dbe5f2;text-align:left;justify-content:flex-start; }
.ops-monitor { display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;background:#090b0f;border:1px solid #242a33;border-radius:11px;overflow:clip; }
.ops-monitor-head { display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;background:#13171d; }.ops-monitor-head>div:first-child { display:grid;gap:3px; }.ops-camera-state { color:#aeb8c5;font-size:11px; }.ops-camera-state.online { color:#58d48a; }.ops-camera-state.offline { color:#ff858b; }
.ops-live-stage { display:grid;place-items:center;min-block-size:360px;background:#000; }.ops-live-stage>.player { inline-size:100%;block-size:100%;border-radius:0;aspect-ratio:auto; }.ops-live-stage video { object-fit:contain; }
.ops-camera-strip { display:flex;gap:7px;padding:9px;overflow-x:auto;scrollbar-gutter:stable;overscroll-behavior-inline:contain;background:#13171d; }
.ops-camera-button { flex:0 0 150px;display:grid;gap:4px;justify-items:start;min-width:0;padding:9px 11px;background:#1a2029;border-color:#303946;color:#dbe5f2;text-align:left; }.ops-camera-button strong { max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }.ops-camera-button[aria-pressed=true] { border-color:#4f98ff;box-shadow:inset 0 0 0 1px #4f98ff; }.ops-camera-button .status-label { font-size:10px;color:#aeb8c5; }
.ops-intelligence { margin-top:22px; }
.feed-item { display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:14px 0;border-bottom:1px solid var(--line);color:var(--fg); }.feed-item:last-child { border-bottom:0; }.feed-item>img { width:104px;aspect-ratio:16/9;object-fit:cover;border-radius:7px; }.feed-item>div { display:grid;gap:3px; }.feed-item span,.feed-item small { color:var(--muted); }.feed-item small { font-size:11px; }
.ai-summary { display:grid;grid-template-columns:repeat(2,1fr);gap:12px; }.ai-count { display:grid;gap:4px;padding:18px;background:var(--panel-2);border-radius:10px;color:var(--fg); }.ai-count strong { font-size:25px; }.ai-count span { color:var(--muted); }.ai-summary>p { grid-column:1/-1; }.quick-links { display:grid;gap:10px; }.quick-links .btn { background:var(--panel); }
.camera-toolbar { display:flex;justify-content:space-between;gap:16px;margin:22px 0;flex-wrap:wrap; }.camera-toolbar input { max-width:220px; }.camera-toolbar select { max-width:180px; }.camera-grid { grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:20px; }.cam { position:relative;box-shadow:0 3px 9px #132b4c05; }.cam .meta { align-items:flex-start;flex-direction:column;padding:14px 16px;gap:7px; }.cam .meta a { color:var(--fg);font-weight:600; }.cam-actions { display:flex;gap:16px;padding:0 16px 16px;font-size:12px; }.favorite { position:absolute;top:10px;right:10px;border:0;background:#132338cc;color:white;font-size:21px;width:36px;padding:0;justify-content:center; }.favorite[aria-pressed=true] { color:#ffda75; }.status-label { display:flex;gap:6px;align-items:center;font-size:11px;color:var(--muted); }.status-label:before { content:'';width:7px;height:7px;background:var(--warn);border-radius:50%; }.status-label.online:before { background:var(--ok); }.status-label.offline:before { background:var(--bad); }.camera-list { display:flex;flex-direction:column; }.camera-list .cam { display:flex;align-items:center; }.camera-list .cam>a { width:180px; }.camera-list .meta { flex:1; }.camera-list .favorite { position:static;order:4;margin:12px; }
.visually-hidden { position:absolute;clip-path:inset(50%);overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap; }
.source-filter { display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:18px 0 0;padding:0;border:0; }.source-filter legend { width:100%;margin-bottom:3px;color:var(--muted);font-size:12px;font-weight:650; }.source-choice { display:inline-flex;align-items:center;min-height:42px;padding:0 15px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--fg);cursor:pointer; }.source-choice:has(input:checked) { border-color:var(--accent);background:var(--accent);color:white; }.source-choice:has(input:focus-visible) { outline:3px solid var(--accent);outline-offset:2px; }
.camera-state-row { display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%; }.source-badge { padding:3px 7px;border-radius:999px;background:var(--panel-2);color:var(--muted);font-size:10px;font-weight:650; }.source-badge.nvr { background:#e5efff;color:#1857aa; }:root[data-theme=dark] .source-badge.nvr { background:#203b65;color:#9dc4ff; }
.portal-dialog { width:min(560px,calc(100vw - 24px)); }.portal-dialog .head { justify-content:space-between; }.skip-link { position:fixed;left:12px;top:-100px;z-index:100;background:var(--panel);padding:12px; }.skip-link:focus { top:8px; }.stage { max-width:1300px; }.timeline .cursor { background:#e62449; }.player .tag { color:white; }.timeline .hover { color:white; }
.map-layout { display:grid;grid-template-columns:300px 1fr;gap:16px; }.map-canvas { height:65vh;min-height:400px;border:1px solid var(--line);border-radius:14px;z-index:1; }.map-list { max-height:65vh;overflow:auto; }.map-row { display:block;width:100%;text-align:left;margin-bottom:8px; }.map-state { font-size:12px;color:var(--muted); }.leaflet-popup-content { color:#172438; }
@media(max-width:1050px) { .portal-main { padding:22px 20px; }.top-links { display:none; }.global-search { width:min(340px,38vw); }.home-columns { grid-template-columns:1fr; }.ops-dashboard { grid-template-columns:1fr; }.ops-sidebar { grid-template-columns:repeat(2,minmax(0,1fr)); }.ops-sidebar .ops-panel:last-child { grid-column:1/-1; } }
@media(max-width:700px) { .portal-shell { padding-left:0;padding-bottom:70px; }.portal-top { padding:0 12px;gap:8px; }.portal-brand { font-size:17px; }.portal-brand small,.global-search { display:none; }.top-button:first-of-type { margin-left:auto; }.portal-main { padding:20px 14px; }.portal-rail { inset:auto 0 0;width:100%;height:64px;flex-direction:row;gap:5px;justify-content:space-around;padding:6px;overflow:visible; }.rail-link { min-width:34px;width:34px;font-size:22px; }.rail-label { display:none!important; }.rail-group>summary { width:34px; }.rail-submenu { left:auto;right:0;bottom:58px; }.rail-account { margin:0; }.stats-grid { grid-template-columns:repeat(2,1fr);gap:10px; }.stat-card { padding:14px; }.stat-card strong { font-size:25px; }.stat-card small { font-size:10px; }.stat-card:after { right:14px!important; }.card { padding:16px; }.camera-toolbar .actions { width:100%; }.camera-toolbar input,.camera-toolbar select { flex:1; }.camera-grid { grid-template-columns:1fr; }.camera-list .cam>a { width:100px; }.camera-list .cam-actions { display:none; }.map-layout { grid-template-columns:1fr; }.map-list { max-height:200px; }.map-canvas { height:50vh; }.head h1 { font-size:22px; } }
@media(max-width:700px) { .ops-dashboard { padding:8px; }.ops-sidebar { grid-template-columns:1fr; }.ops-sidebar .ops-panel:last-child { grid-column:auto; }.ops-monitor-head { align-items:flex-start;flex-direction:column; }.ops-live-stage { min-block-size:240px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important;animation:none!important;transition:none!important; } }
@media(max-width:700px){.portal-rail{gap:2px}.portal-rail .rail-link{width:26px;min-width:26px}.portal-rail svg{width:20px;height:20px}}
@media(max-height:700px) and (min-width:701px){.portal-rail{gap:3px;padding:8px 0}.portal-rail .rail-link{min-height:36px}}
.update-banner { position:fixed;z-index:100;left:50%;bottom:20px;transform:translateX(-50%);display:flex;align-items:center;gap:16px;max-width:calc(100vw - 24px);padding:10px 12px 10px 16px;background:#17263b;color:#fff;border:1px solid #ffffff38;border-radius:12px;box-shadow:0 12px 30px #0005; }
.update-banner button { min-height:34px;background:#fff;color:#174f9e;border-color:#fff;font-weight:650;white-space:nowrap; }
