/* Side menu — grouped (desktop) and bottom tabs (phone) */
.nav-jump{display:flex;align-items:center;gap:9px;height:40px;margin:0 2px 8px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:#f4f8fa;color:#5d7387;font:inherit;font-size:13px;cursor:pointer;text-align:left}
.nav-jump:hover{border-color:#b9d3dd;color:var(--navy)}
.nav-jump-ic{width:17px;height:17px;display:grid;place-items:center}.nav-jump-ic svg{width:17px;height:17px}
.nav-jump span.nav-label{flex:1}
.nav-jump kbd{flex:none;font:inherit;font-size:11px;font-weight:700;padding:1px 6px;border-radius:5px;border:1px solid #c9dbe3;background:#fff;color:#5d7387}
#nav{gap:2px}
#nav .nav-group{margin-top:10px}
#nav .nav-group[hidden]{display:none}
#nav .nav-gh{height:auto;width:100%;display:flex;align-items:center;justify-content:space-between;padding:5px 12px;border:0;background:none;box-shadow:none;font-size:11px;font-weight:800;letter-spacing:.1em;color:#6a8094;border-radius:6px;cursor:pointer}
#nav .nav-gh::after{content:"";width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .15s}
#nav .nav-group.shut .nav-gh::after{transform:rotate(-45deg)}
#nav .nav-gh:hover{color:var(--navy);background:none}
#nav button.nav-folded{display:none}
#nav button[data-page]{position:relative}
.nav-badge{justify-self:end;margin-left:auto;font-size:11px;font-weight:800;padding:2px 7px;border-radius:20px;white-space:nowrap;line-height:1.3}
#nav button[data-page]:has(.nav-badge){grid-template-columns:24px 1fr auto}
.nav-badge.bad{background:#fdecee;color:#a12639}.nav-badge.warn{background:#fff3e0;color:#8a5200}
.side-foot{display:flex;flex-direction:column;gap:7px;color:#33495c;font-size:12.5px}
.side-foot .sf-row{display:flex;align-items:center;gap:8px}.side-foot .sf-row[hidden]{display:none}
.side-foot .sf-row span{flex:1}.side-foot .sf-row b{margin:0;color:var(--navy);font-variant-numeric:tabular-nums}
.side-foot .sf-row i{width:8px;height:8px;border-radius:50%;background:#193966}.side-foot .sf-row i.ok{background:#1f9d6b}.side-foot .sf-row i.warn{background:#e08a1e}
.sf-bar{display:block;height:5px;border-radius:3px;background:#e3edf2;overflow:hidden}.sf-bar[hidden]{display:none}
.sf-bar i{display:block;height:100%;width:0;background:#193966;border-radius:3px}.sf-bar i.warn{background:#c77a12}.sf-bar i.bad{background:#c2364b}
.side-foot small{font-size:11px;color:#8da0b2;margin-top:2px}
/* collapsed sidebar: dividers instead of titles, dots instead of badges */
.shell.sidebar-collapsed .nav-jump{justify-content:center;padding:0;margin:0 0 8px}
.shell.sidebar-collapsed .nav-jump .nav-label{display:none}
.shell.sidebar-collapsed #nav .nav-gh{height:9px;padding:0;font-size:0;border-top:1px solid #e3edf2;border-radius:0;margin:4px 10px 0;width:auto;pointer-events:none}
.shell.sidebar-collapsed #nav .nav-gh::after{display:none}
.shell.sidebar-collapsed #nav button.nav-folded{display:grid}
.shell.sidebar-collapsed .nav-badge{position:absolute;top:7px;right:16px;width:9px;height:9px;padding:0;font-size:0;border:2px solid #fff;box-sizing:border-box}
.shell.sidebar-collapsed .nav-badge.bad{background:#c2364b}.shell.sidebar-collapsed .nav-badge.warn{background:#e08a1e}
.rtl .nav-jump{text-align:right}.rtl .shell.sidebar-collapsed .nav-badge{right:auto;left:16px}
/* jump to */
.jumpbox{position:fixed;inset:0;z-index:3000;background:rgba(8,26,44,.35);display:flex;justify-content:center;align-items:flex-start;padding:12vh 16px 16px}
.jumpbox.hidden{display:none}
.jb-card{width:min(560px,100%);background:#fff;border-radius:14px;box-shadow:0 24px 60px rgba(8,41,69,.3);overflow:hidden;display:flex;flex-direction:column}
.jb-card input{height:54px;border:0;border-bottom:1px solid #e3edf2;padding:0 18px;font:inherit;font-size:16px;outline:none}
#jbList{max-height:50vh;overflow:auto;padding:6px}
#jbList button{width:100%;display:flex;align-items:center;gap:12px;padding:9px 10px;border:0;border-radius:9px;background:none;font:inherit;text-align:left;cursor:pointer;color:var(--txt)}
#jbList button[aria-selected=true],#jbList button:hover{background:#eaf8f9}
.jb-ic{width:32px;height:32px;border-radius:8px;background:#eef4f7;display:grid;place-items:center;color:var(--navy);flex:none}.jb-ic svg{width:18px;height:18px}
.jb-t{flex:1;display:flex;flex-direction:column;min-width:0}.jb-t b{font-size:14px}.jb-t small{font-size:12px;color:#5d7387;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#jbList em{font-style:normal;font-size:11.5px;font-weight:700;color:#00718a}#jbList em.off{color:#a12639}
.jb-none{margin:0;padding:16px;color:#5d7387;font-size:13px}
.jb-card>small{padding:8px 16px;border-top:1px solid #eef3f6;font-size:11.5px;color:#8da0b2}
/* phone */
.tabbar,.tabsheet{display:none}
@media (max-width:860px){
  #sidebar{display:none}
  .shell{padding-bottom:72px}
  .tabbar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;z-index:1500;height:64px;padding:4px 6px calc(6px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);box-shadow:0 -6px 18px rgba(8,41,69,.06)}
  .tabbar button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;background:none;font:inherit;font-size:11px;font-weight:700;color:#5d7387;cursor:pointer;min-width:0}
  .tabbar button.on{color:#00718a}
  .tabbar .tb-ic{width:22px;height:22px;display:grid;place-items:center}.tabbar .tb-ic svg{width:22px;height:22px}
  .tb-badge{position:absolute;top:2px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:#c2364b;color:#fff;font-size:10px;font-style:normal;font-weight:800;display:grid;place-items:center}
  .tb-badge[hidden]{display:none}
  .tabsheet{display:flex;position:fixed;inset:0 0 64px 0;z-index:1400;background:rgba(8,26,44,.45);align-items:flex-end}
  .tabsheet.hidden{display:none}
  .tabsheet section{width:100%;box-sizing:border-box;background:#fff;border-radius:18px 18px 0 0;padding:10px 16px 16px;display:flex;flex-direction:column;gap:10px}
  .ts-grip{align-self:center;width:40px;height:4px;border-radius:2px;background:#c9dbe3}
  .tabsheet section>b{font-size:15px;color:var(--navy)}
  #tabsheetGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  #tabsheetGrid button{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 4px;border:1px solid #e3edf2;border-radius:12px;background:#f6fafb;font:inherit;font-size:12px;font-weight:600;color:#33495c;cursor:pointer;text-align:center}
  #tabsheetGrid .tb-ic{width:22px;height:22px;color:#193966}#tabsheetGrid .tb-ic svg{width:22px;height:22px}
}
body:has(#appShell.hidden) .tabbar,body:has(#appShell.hidden) .tabsheet{display:none!important}
/* cameras: online / offline counters */
.nav-cams{justify-self:end;margin-left:auto;display:flex;align-items:center;border-radius:20px;overflow:hidden;font-size:11.5px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1}
.nav-cams>span{display:flex;align-items:center;gap:5px;padding:4px 8px}
.nav-cams i{width:7px;height:7px;border-radius:50%}
.nc-on{background:#e3f6ed;color:#0d6b4a}.nc-on i{background:#1f9d6b}
.nc-off{background:#fdecee;color:#a12639}.nc-off i{background:#c2364b}
#nav button[data-page]:has(.nav-cams){grid-template-columns:24px 1fr auto}
.shell.sidebar-collapsed .nav-cams{position:absolute;top:7px;right:16px;width:10px;height:10px;border-radius:50%;border:2px solid #fff;box-sizing:border-box;background:#1f9d6b}
.shell.sidebar-collapsed .nav-cams.has-off{background:#c2364b}
.shell.sidebar-collapsed .nav-cams>span{display:none}
.rtl .shell.sidebar-collapsed .nav-cams{right:auto;left:16px}
