/* SafeSpeed UI — design tokens ported from the approved mockup.
   Page CONTENT uses inline styles (matching the mockup authoring style);
   this file owns the shell chrome, interactive states, and Leaflet. */
:root{
  --bg:#eef1f6; --ink:#16202e; --muted:#73849b; --muted2:#8593a8;
  --card:#fff; --line:#e6eaf1; --line2:#eef1f6;
  --navy:#0b1626; --navy2:#13294a;
  --blue:#3a86ff; --blue2:#2f6bed; --green:#1f9d6d;
  --amber:#f5b301; --orange:#f57c00; --red:#e5383b;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;height:100%;}
body{font-family:'Plus Jakarta Sans',system-ui,sans-serif;background:var(--bg);
  color:var(--ink);-webkit-font-smoothing:antialiased;}
.mono{font-family:'IBM Plex Mono',monospace;}
.boot{display:flex;height:100vh;align-items:center;justify-content:center;
  color:#8593a8;font-weight:600;}
::-webkit-scrollbar{width:10px;height:10px;}
::-webkit-scrollbar-thumb{background:#cdd5e0;border-radius:10px;border:3px solid transparent;background-clip:content-box;}
::-webkit-scrollbar-thumb:hover{background:#aebacc;background-clip:content-box;}
@keyframes dash{to{stroke-dashoffset:-24;}}
@keyframes pulse{0%{transform:scale(.7);opacity:.9;}70%{transform:scale(2.4);opacity:0;}100%{opacity:0;}}
@keyframes fadein{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}

/* ---- shell ---- */
.shell{display:flex;height:100vh;width:100%;min-width:1180px;overflow:hidden;}
.sidebar{width:262px;flex:none;height:100%;background:var(--navy);
  display:flex;flex-direction:column;border-right:1px solid #0a1220;}
.brand{padding:22px 20px 18px;display:flex;align-items:center;gap:11px;border-bottom:1px solid #15233a;}
.brand-mark{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;
  flex:none;background:linear-gradient(135deg,#3a86ff,#1f9d6d);box-shadow:0 4px 12px rgba(58,134,255,.35);}
.nav{flex:1;overflow-y:auto;padding:16px 12px;display:flex;flex-direction:column;gap:3px;}
.nav-section{color:#536580;font-size:10px;font-weight:700;letter-spacing:.09em;
  text-transform:uppercase;padding:14px 12px 7px;}
.nav-btn{display:flex;align-items:center;gap:11px;width:100%;padding:9px 12px;border:none;
  border-radius:9px;cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;text-align:left;
  background:transparent;color:#9fb0c6;transition:background .14s,color .14s;}
.nav-btn:hover{background:#13243f;color:#cfe0f5;}
.nav-btn.active{background:#16294a;color:#fff;}
.nav-btn .tag{width:17px;flex:none;text-align:center;font-family:'IBM Plex Mono',monospace;
  font-size:11px;font-weight:600;color:#3a86ff;}
.sidebar-foot{padding:14px 18px;border-top:1px solid #15233a;display:flex;flex-direction:column;gap:6px;}

.main{flex:1;height:100%;display:flex;flex-direction:column;min-width:0;background:var(--bg);}
.topbar{flex:none;height:66px;background:rgba(255,255,255,.85);backdrop-filter:blur(10px);
  border-bottom:1px solid #e1e6ee;display:flex;align-items:center;justify-content:space-between;padding:0 28px;z-index:5;}
.content{flex:1;overflow-y:auto;overflow-x:hidden;}
.content-inner{padding:26px 28px 60px;max-width:1320px;margin:0 auto;animation:fadein .25s ease;}

/* ---- segmented toggle (country) ---- */
.seg{display:flex;align-items:center;background:#eef1f6;border:1px solid #e1e6ee;border-radius:9px;padding:3px;gap:2px;}
.seg.on-dark{background:#0e1d34;border-color:#1b2d4c;}
.seg button{padding:6px 12px;border:none;border-radius:7px;cursor:pointer;font-family:inherit;
  font-size:12px;font-weight:600;background:transparent;color:#73849b;transition:all .14s;}
.seg button.active{background:#fff;color:#16202e;box-shadow:0 1px 3px rgba(16,32,56,.12);}
.seg.on-dark button{color:#7e96b6;}
.seg.on-dark button.active{background:#274063;color:#fff;}

/* ---- generic card / utilities used by pages ---- */
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;
  box-shadow:0 1px 2px rgba(16,32,56,.04);}
.h-title{font-size:14px;font-weight:700;color:var(--ink);}
.h-sub{font-size:11.5px;color:var(--muted2);margin-top:2px;}
.clickable{cursor:pointer;}
.row-hover:hover{background:#f7f9fc;}
.list-row:hover{background:#f2f7ff;}

/* ---- Leaflet ---- */
#leafmap{width:100%;height:100%;background:#0b1626;border-radius:0;}
.leaflet-container{font-family:'Plus Jakarta Sans',system-ui,sans-serif;background:#0e1726;}
.leaflet-popup-content-wrapper{border-radius:12px;box-shadow:0 8px 28px rgba(7,14,26,.4);padding:2px;}
.leaflet-popup-content{margin:12px 14px;font-size:12.5px;line-height:1.5;}
.leaflet-bar a{border-radius:6px;}
.seg-pulse{border-radius:50%;background:#e5383b;box-shadow:0 0 0 rgba(229,56,59,.5);}
.map-legend{background:rgba(11,22,38,.86);color:#cfe0f5;border:1px solid #1d2f4c;border-radius:10px;
  padding:11px 13px;box-shadow:0 6px 18px rgba(7,14,26,.4);font-size:11px;}
.map-badge{background:rgba(11,22,38,.86);color:#cfe0f5;border:1px solid #1d2f4c;border-radius:9px;
  padding:7px 11px;font-size:11.5px;font-weight:600;}
.map-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  color:#7e96b6;font-weight:600;z-index:500;background:rgba(11,22,38,.4);}
