/* /var/www/hazardeye/assets/css/dashboard.css */
:root{
  --bg0:#0e1110;
  --bg1:#121615;
  --stroke:rgba(255,255,255,.08);
  --stroke2:rgba(255,255,255,.12);

  --text:#e9efe9;
  --muted:rgba(233,239,233,.72);
  --muted2:rgba(233,239,233,.54);

  --accent:#3ddc97;
  --accent2:#e3b341;
  --danger:#ff5b6e;
  --warn:#ffb020;

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius:18px;
  --radius2:22px;

  --glass: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  --grad: radial-gradient(1000px 600px at 15% -20%, rgba(61,220,151,.18), transparent 55%),
          radial-gradient(900px 500px at 85% 0%, rgba(227,179,65,.14), transparent 55%),
          radial-gradient(900px 650px at 40% 120%, rgba(255,91,110,.10), transparent 55%);

  --ease: cubic-bezier(.2,.8,.2,1);
  --t: 180ms var(--ease);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color:var(--text);
  background:
    var(--grad),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* scrollbars */
*::-webkit-scrollbar{height:10px;width:10px}
*::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:999px}
*::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.18)}
*::-webkit-scrollbar-track{background:rgba(0,0,0,.15)}

a{color:inherit}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  padding:14px 18px;
  border-bottom:1px solid var(--stroke);
  background: rgba(16,20,18,.72);
  backdrop-filter: blur(14px);
}

.brand{display:flex;align-items:center;gap:14px;min-width:220px;}
.brandLogo{
  height:44px; width:auto; max-width:180px; object-fit:contain;
  filter:
    drop-shadow(0 0 6px rgba(61,220,151,.35))
    drop-shadow(0 0 16px rgba(61,220,151,.20));
  transition: transform .25s ease, filter .25s ease;
}
.brandLogo:hover{
  transform: scale(1.03);
  filter:
    drop-shadow(0 0 10px rgba(61,220,151,.55))
    drop-shadow(0 0 26px rgba(61,220,151,.28));
}
.brandTitle{font-weight:900;letter-spacing:.2px;font-size:16px;line-height:1.1;}
.brandSub{font-size:12px;color:var(--muted2);margin-top:2px;}
.brandText{display:flex;flex-direction:column}

@media (max-width: 520px){
  .brandLogo{height:38px}
  .brandSub{display:none}
}

.topActions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}

.seg{
  display:flex;align-items:center;gap:8px;padding:8px 10px;
  border:1px solid var(--stroke);border-radius:999px;
  background: rgba(255,255,255,.04);transition: var(--t);
}
.seg:hover{border-color:var(--stroke2)}
.segLabel{font-size:12px;color:var(--muted2)}
.segBtn{
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:900;
  transition: var(--t);
}
.segBtn:hover{border-color:var(--stroke2); transform: translateY(-1px)}
.segBtn.isActive{background: rgba(61,220,151,.18);border-color: rgba(61,220,151,.35);}

.btn{
  border:1px solid rgba(61,220,151,.45);
  background: rgba(61,220,151,.16);
  color: var(--text);
  padding:9px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
  letter-spacing:.1px;
  transition: var(--t);
}
.btn:hover{filter:brightness(1.06); transform: translateY(-1px)}
.btnGhost{border:1px solid var(--stroke);background: rgba(255,255,255,.04);text-decoration:none;}
.btnSmall{padding:7px 10px;border-radius:10px;}
.btnWide{width:100%}

.page{
  display:grid;
  grid-template-columns: 280px 1fr 320px;
  gap:14px;
  padding:14px;
}

/* Panels */
.panel{
  border:1px solid var(--stroke);
  border-radius: var(--radius2);
  background: var(--glass);
  box-shadow: var(--shadow);
  overflow:hidden;
  transform: translateZ(0);
}
.panelLeft, .panelRight{height: calc(100vh - 92px); position:sticky; top:76px;}
.panelLeft{padding:14px}
.panelRight{padding:14px}

.panelHeader{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.panelHeader h3{
  margin:0;
  font-size:13px;
  letter-spacing:.22px;
  text-transform:uppercase;
  color:rgba(233,239,233,.88);
}

.badge{
  font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--muted);
}
.badge.ok{border-color: rgba(61,220,151,.35);background: rgba(61,220,151,.12);color: rgba(233,239,233,.92);}

.kv{display:flex; flex-direction:column; gap:10px; margin:10px 0 14px;}
.kvRow{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 12px;border:1px solid var(--stroke);
  border-radius:14px;background: rgba(255,255,255,.03);transition: var(--t);
}
.kvRow:hover{border-color:var(--stroke2)}
.kvRow span{color:var(--muted2); font-size:12px}
.kvRow strong{font-size:14px}

.pill{
  padding:5px 10px;border-radius:999px;
  background: rgba(227,179,65,.12);
  border:1px solid rgba(227,179,65,.28);
  font-size:12px;
}
.pill2{
  padding:5px 10px;border-radius:999px;
  background: rgba(61,220,151,.10);
  border:1px solid rgba(61,220,151,.25);
  font-size:12px;
}

.hint{
  padding:12px;border:1px dashed rgba(255,255,255,.14);
  border-radius:14px;background: rgba(255,255,255,.03);
  color:var(--muted);font-size:12px;line-height:1.4;
}
.divider{height:1px;background: var(--stroke);margin:14px 0;}

.form label{display:block;font-size:12px;color:var(--muted2);margin:10px 0 6px;}

.form select, .form input[type="date"]{
  width:100%;
  padding:10px 44px 10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(700px 260px at 20% 0%, rgba(61,220,151,.10), transparent 55%),
    radial-gradient(700px 260px at 80% 0%, rgba(227,179,65,.08), transparent 55%),
    rgba(10,12,11,.35);
  color: rgba(233,239,233,.92);
  outline:none;
  transition: var(--t);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.04),
    0 10px 30px rgba(0,0,0,.25);
}
.form input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(1) opacity(.75);
  cursor:pointer;
}
.form select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23E9EFE9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat,no-repeat;
  background-position:0 0, right 14px center;
  background-size:auto,16px 16px;
}
.form select:hover, .form input[type="date"]:hover{
  border-color: rgba(61,220,151,.22);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    0 0 0 4px rgba(61,220,151,.08),
    0 16px 46px rgba(0,0,0,.28);
}
.form select:focus, .form input[type="date"]:focus{
  border-color: rgba(61,220,151,.42);
  box-shadow:
    inset 0 0 0 1px rgba(61,220,151,.10),
    0 0 0 4px rgba(61,220,151,.12),
    0 18px 55px rgba(0,0,0,.30);
}
.form select option{background:#0f1312;color:rgba(233,239,233,.92);}

.row2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;}
.row2 > div{min-width:0;}
@media (max-width: 860px){ .row2{grid-template-columns:minmax(0,1fr);} }

.form input[type="range"]{width:100%}
.rangeMeta{display:flex;justify-content:space-between;font-size:11px;color:var(--muted2);}
#minConfVal{color:rgba(233,239,233,.92);font-weight:900}
.inlineNote{margin-top:10px;line-height:1.35}
.small{font-size:12px;color:var(--muted2)}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;}

.miniStats{display:grid;grid-template-columns: 1fr 1fr;gap:10px;}
.miniCard{
  padding:12px;border-radius:16px;border:1px solid var(--stroke);
  background: rgba(255,255,255,.03);transition: var(--t);
}
.miniCard:hover{border-color:var(--stroke2); transform: translateY(-1px)}
.miniCard span{display:block;color:var(--muted2);font-size:12px}
.miniCard strong{font-size:18px;letter-spacing:.2px}

.main{display:flex;flex-direction:column;gap:14px;min-width:0;}

.cameraWall, .analytics{
  border:1px solid var(--stroke);
  border-radius: var(--radius2);
  background: var(--glass);
  box-shadow: var(--shadow);
  padding:14px;
  overflow:hidden;
}

.sectionHeader{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:12px;}
.sectionHeader h2{margin:0;font-size:16px;letter-spacing:.2px;}
.sectionMeta{color:var(--muted2);font-size:12px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.sep{opacity:.5}
.dotLive{
  width:8px;height:8px;border-radius:999px;background:var(--accent);
  box-shadow:0 0 0 6px rgba(61,220,151,.12);display:inline-block
}

/* Grid */
.grid{display:grid;gap:12px;}
.grid1{grid-template-columns:1fr;}
.grid4{grid-template-columns:1fr 1fr;}
.grid9{grid-template-columns:1fr 1fr 1fr;}

/* Camera card */
.camCard{
  border:1px solid var(--stroke);
  border-radius:18px;
  background: rgba(255,255,255,.03);
  overflow:hidden;
  min-height: 240px;
  display:flex;
  flex-direction:column;
  transition: var(--t);
}
.camCard:hover{border-color: rgba(255,255,255,.14); transform: translateY(-2px);}
.camTop{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 12px;border-bottom:1px solid var(--stroke);
  background: rgba(255,255,255,.03);
}
.camTitle{display:flex;flex-direction:column;gap:3px}
.camName{font-weight:900;font-size:13px}
.camSite{font-size:12px;color:var(--muted2)}

.camVideo{position:relative;flex:1;background:#070a09;}
.video{width:100%;height:100%;object-fit:contain;display:block;background:#050806;}

.camOverlay{
  position:absolute;left:10px;right:10px;bottom:10px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.overlayLeft{
  display:flex;align-items:center;gap:10px;
  padding:8px 10px;border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(10,12,11,.55);
  backdrop-filter: blur(10px);
}
.tag{
  font-size:11px;font-weight:900;padding:5px 8px;border-radius:999px;
  border:1px solid rgba(61,220,151,.35);
  background: rgba(61,220,151,.14);
}
.overlayRight{display:flex;gap:8px}
.iconBtn{
  width:36px;height:36px;border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(10,12,11,.55);
  color:var(--text);
  cursor:pointer;
  backdrop-filter: blur(10px);
  transition: var(--t);
}
.iconBtn:hover{border-color: rgba(61,220,151,.30); transform: translateY(-1px)}

.camFooter{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 12px;border-top:1px solid var(--stroke);
  background: rgba(255,255,255,.02);
}
.health{display:flex;align-items:center;gap:8px}
.healthDot{
  width:8px;height:8px;border-radius:999px;
  background:rgba(61,220,151,.85);
  box-shadow:0 0 0 6px rgba(61,220,151,.10)
}

.camLoading{
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;
  background: radial-gradient(700px 400px at 50% 30%, rgba(255,255,255,.06), rgba(0,0,0,.35));
  opacity:0;pointer-events:none;transition: var(--t);
}
.camCard.isLoading .camLoading{opacity:1}
.spinner{
  width:28px;height:28px;border-radius:999px;
  border:3px solid rgba(255,255,255,.16);
  border-top-color: rgba(61,220,151,.75);
  animation: spin 900ms linear infinite;
}
@keyframes spin{to{transform: rotate(360deg)}}

/* placeholders */
.isPlaceholder{display:flex;align-items:center;justify-content:center;background: rgba(255,255,255,.02);}
.placeholderInner{text-align:center;padding:18px;color:var(--muted2);}
.phIcon{
  width:52px;height:52px;border-radius:18px;border:1px dashed rgba(255,255,255,.18);
  display:grid;place-items:center;margin:0 auto 10px;font-size:24px;color:rgba(233,239,233,.80);
}
.phText{font-weight:900;color:rgba(233,239,233,.92)}
.phSub{font-size:12px;margin-top:6px}

/* Analytics */
.analytics .cards{
  display:grid;
  grid-template-columns: 1.2fr .9fr .9fr;
  gap:12px;
  align-items: stretch;
}
.card{
  border:1px solid var(--stroke);
  border-radius:18px;
  background: rgba(255,255,255,.03);
  padding:12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height: 260px;
  transition: var(--t);
}
.cardHead{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;}
.cardHead h4{margin:0;font-size:13px;text-transform:uppercase;letter-spacing:.2px;color:rgba(233,239,233,.88);}

.chartWrap{position:relative;flex:1;min-height:200px;}
.analytics .card canvas{width:100% !important;height:200px !important;}
.chartOverlay{
  position:absolute;inset:0;border-radius:14px;
  background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.06), rgba(255,255,255,.03));
  background-size: 240% 100%;
  opacity:0;pointer-events:none;
}
.chartOverlay.isOn{opacity:1;animation: shimmer 1.2s linear infinite;}
@keyframes shimmer{0%{background-position: 100% 0}100%{background-position: -140% 0}}

/* Heatmap */
.heatmap{display:grid;grid-template-columns: repeat(12, 1fr);gap:6px;padding:2px;}
.hmCell{
  height:18px;border-radius:8px;border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  position:relative;overflow:hidden;transition: var(--t);
}
.hmCell:hover{transform: translateY(-1px); border-color: rgba(255,255,255,.14)}
.hmCell::after{content:'';position:absolute;inset:0;background: rgba(61,220,151,.0);}
.hmCell[data-lvl="1"]::after{background: rgba(61,220,151,.08)}
.hmCell[data-lvl="2"]::after{background: rgba(61,220,151,.14)}
.hmCell[data-lvl="3"]::after{background: rgba(227,179,65,.18)}
.hmCell[data-lvl="4"]::after{background: rgba(255,176,32,.25)}
.hmCell[data-lvl="5"]::after{background: rgba(255,91,110,.26)}
.heatLegend{display:flex;align-items:center;gap:10px;margin-top:10px;}
.heatLegend .bar{
  flex:1;height:10px;border-radius:999px;border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(90deg,
    rgba(61,220,151,.10),
    rgba(61,220,151,.22),
    rgba(227,179,65,.25),
    rgba(255,176,32,.28),
    rgba(255,91,110,.30)
  );
}

/* Right panel */
.rightMeta{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.miniSelect{
  border:1px solid var(--stroke);border-radius:12px;padding:6px 8px;
  background: rgba(255,255,255,.03);color:var(--text);transition: var(--t);
}
.miniSelect:focus{outline:none;border-color: rgba(61,220,151,.35); box-shadow: 0 0 0 4px rgba(61,220,151,.10);}

.eventsToolbar{display:flex;gap:10px;align-items:center;margin:8px 0 10px;}
.eventsList{
  display:flex;flex-direction:column;gap:10px;overflow:auto;
  height: calc(100vh - 230px);
  padding-right:4px;
}
.eventCard{
  border-radius:16px;border:1px solid var(--stroke);
  background: rgba(255,255,255,.03);
  padding:10px 12px;transition: var(--t);
}
.eventCard:hover{border-color: rgba(255,255,255,.14); transform: translateY(-1px)}
.eventCard.isNew{animation: pop 220ms var(--ease) both;}
@keyframes pop{from{transform: translateY(6px);opacity:.6}to{transform: translateY(0);opacity:1}}

.eventTop{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.eventTitle{font-weight:900}
.eventMeta{color:var(--muted2);font-size:12px;margin-top:6px;display:flex;gap:10px;flex-wrap:wrap}
.sev{font-size:11px;padding:4px 8px;border-radius:999px;border:1px solid rgba(255,255,255,.12);}
.sev.high{border-color: rgba(255,91,110,.35); background: rgba(255,91,110,.12)}
.sev.med{border-color: rgba(255,176,32,.35); background: rgba(255,176,32,.10)}
.sev.low{border-color: rgba(61,220,151,.35); background: rgba(61,220,151,.10)}

.panelFooter{margin-top:10px;padding-top:10px;border-top:1px solid var(--stroke);color:var(--muted2);}

@media (max-width: 1200px){
  .page{grid-template-columns: 280px 1fr}
  .panelRight{display:none}
  .analytics .cards{grid-template-columns: 1fr}
}
@media (max-width: 860px){
  .page{grid-template-columns: 1fr}
  .cameraWall{padding:12px}
  .grid4,.grid9{grid-template-columns: 1fr}
}

/* --- Live Events: thumbnail + modal (ADD THIS AT END) --- */

.eventBody{
  display:grid;
  grid-template-columns: 88px 1fr;
  gap:10px;
  margin-top:10px;
  align-items:stretch;
}

.eventThumb{
  width:88px;
  height:64px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  overflow:hidden;
  cursor:pointer;
  position:relative;
  transition: var(--t);
}
.eventThumb:hover{
  border-color: rgba(61,220,151,.28);
  transform: translateY(-1px);
}
.eventThumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  filter: saturate(1.05) contrast(1.03);
}
.eventThumb .thumbBadge{
  position:absolute;
  left:8px; top:8px;
  font-size:10px;
  padding:4px 7px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(10,12,11,.55);
  backdrop-filter: blur(10px);
  color: rgba(233,239,233,.92);
}

.eventNoThumb{
  width:88px;
  height:64px;
  border-radius:12px;
  border:1px dashed rgba(255,255,255,.12);
  background: rgba(255,255,255,.02);
  display:grid;
  place-items:center;
  color: rgba(233,239,233,.65);
  font-weight:900;
  letter-spacing:.2px;
  user-select:none;
}

.eventText{
  min-width:0;
}
.eventMsg{
  margin-top:8px;
  font-size:12px;
  color: rgba(233,239,233,.68);
  line-height:1.35;
}

/* Modal */
.heModal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(10px);
}
.heModal.isOn{display:flex}

.heModalPanel{
  width:min(980px, 96vw);
  max-height:92vh;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(16,20,18,.92);
  box-shadow: 0 30px 90px rgba(0,0,0,.60);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.heModalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.heModalTitle{
  font-weight:900;
  letter-spacing:.2px;
}
.heModalClose{
  width:38px;height:38px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  transition: var(--t);
}
.heModalClose:hover{
  border-color: rgba(61,220,151,.28);
  transform: translateY(-1px);
}

.heModalBody{
  display:grid;
  grid-template-columns: 1fr 280px;
  gap:0;
  min-height: 320px;
}
@media (max-width: 860px){
  .heModalBody{grid-template-columns: 1fr}
}

.heModalImgWrap{
  background: #070a09;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
}
.heModalImg{
  max-width:100%;
  max-height:78vh;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
}

.heModalSide{
  border-left:1px solid rgba(255,255,255,.10);
  padding:12px;
  overflow:auto;
}
@media (max-width: 860px){
  .heModalSide{border-left:none;border-top:1px solid rgba(255,255,255,.10)}
}

.heMetaList{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.heMetaItem{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.heMetaItem .k{font-size:11px;color:var(--muted2);text-transform:uppercase;letter-spacing:.2px}
.heMetaItem .v{margin-top:4px;font-weight:900;word-break:break-word}

.camVideo {
  position: relative;
}

.overlayCanvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

/* ============================================================
   Status chips / AI badge / people count
   ============================================================ */
.peopleChip{
  display:inline-flex;align-items:center;gap:5px;
  padding:4px 10px;border-radius:999px;
  border:1px solid rgba(61,220,151,.35);
  background:rgba(10,12,11,.55);
  color:#8df0bd;font-size:12px;font-weight:900;
  backdrop-filter:blur(10px);
}
.peopleChip::before{content:'';width:7px;height:7px;border-radius:999px;background:rgba(61,220,151,.9);box-shadow:0 0 0 4px rgba(61,220,151,.15);}
.peopleChip.hot{border-color:rgba(255,91,110,.45);color:#ffb2bb;}
.peopleChip.hot::before{background:rgba(255,91,110,.9);box-shadow:0 0 0 4px rgba(255,91,110,.15);}
.aiBadge{border-color:rgba(168,85,247,.35);background:rgba(168,85,247,.12);color:#d3b6ff;}
.aiBadge.ok{border-color:rgba(61,220,151,.35);background:rgba(61,220,151,.12);color:rgba(233,239,233,.92);}
.aiBadge[hidden]{display:none !important;}

/* ============================================================
   Mobile: bottom nav + panelless layout toggles
   ============================================================ */
.mobileNav{
  display:none;
  position:fixed;left:0;right:0;bottom:0;z-index:60;
  background:rgba(14,18,16,.92);
  border-top:1px solid var(--stroke);
  backdrop-filter:blur(16px);
  padding:8px 10px calc(8px + env(safe-area-inset-bottom));
  grid-auto-flow:column;grid-auto-columns:1fr;gap:8px;
}
.mnBtn{
  display:flex;flex-direction:column;align-items:center;gap:4px;
  border:none;background:transparent;color:var(--muted2);
  font-size:11px;font-weight:700;padding:8px 6px;border-radius:14px;cursor:pointer;transition:var(--t);
}
.mnBtn span{font-size:18px;line-height:1;}
.mnBtn.isActive{background:rgba(61,220,151,.14);color:#e9efe9;}
.btnNav{display:none;}

@media (max-width: 900px){
  .mobileNav{display:grid;}
  body{padding-bottom:74px;}
  .btnNav{display:inline-flex;}
  .panelLeft, .panelRight{height:auto;position:static;display:none;}
  #page.tabEvents .panelRight{display:block;position:fixed;left:10px;right:10px;bottom:70px;top:auto;
    max-height:60vh;overflow:auto;z-index:55;background:rgba(16,20,18,.92);backdrop-filter:blur(16px);
    box-shadow:0 -10px 40px rgba(0,0,0,.6);}
  #page.tabEvents .panelRight .eventsList{height:auto;max-height:42vh;}
  #page.tabFilters .panelLeft{display:block;}
}

/* ============================================================
   KPI strip + toast (upgrade)
   ============================================================ */
.kpiStrip{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:12px;
}
.kpiCard{
  border:1px solid var(--stroke);
  border-radius:18px;
  background:var(--glass);
  box-shadow:var(--shadow);
  padding:14px 16px;
  transition:var(--t);
  min-height:78px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.kpiCard:hover{ border-color:rgba(255,255,255,.16); transform:translateY(-2px); }
.kpiCard span{
  font-size:11px;color:var(--muted2);text-transform:uppercase;
  letter-spacing:.08em;margin-bottom:8px;font-weight:600;
}
.kpiCard strong{font-size:26px;line-height:1;font-weight:800;letter-spacing:.3px;}
@media (max-width:1200px){ .kpiStrip{grid-template-columns:repeat(3,1fr);} }
@media (max-width:700px){ .kpiStrip{grid-template-columns:repeat(2,1fr);} }

.toast{
  position:fixed;left:50%;bottom:22px;transform:translateX(-50%) translateY(20px);opacity:0;
  transition:all .25s var(--ease);z-index:99999;pointer-events:none;max-width:90vw;
  background:rgba(20,28,24,.95);border:1px solid rgba(61,220,151,.45);
  color:#e9efe9;padding:12px 18px;border-radius:14px;font-size:13px;font-weight:600;
  box-shadow:0 18px 50px rgba(0,0,0,.5);
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
.toast.err{border-color:rgba(255,91,110,.55);}
