/* ===== THEME ===== */
:root {
  --bg: #060a13; --panel: #0c1221; --card: #111b2e; --hover: #1a2740;
  --border: #1e2d45; --t1: #e2e8f0; --t2: #8b9dc3; --t3: #4a5f82;
  --gold: #f5a623; --green: #10b981; --red: #ef4444; --cyan: #06b6d4;
  --nps-dred: #991b1b; --nps-red: #dc2626; --nps-orange: #f97316;
  --nps-yellow: #eab308; --nps-lgreen: #4ade80; --nps-dgreen: #16a34a;
  --nps-grey: #374151;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--t1); overflow: hidden; height: 100vh; }
.mono { font-family: 'Space Mono', monospace; }

/* ===== HEADER ===== */
#hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 50px;
  background: rgba(6,10,19,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 10px;
}
.logo { font-family: 'Space Mono', monospace; font-size: 15px; font-weight: 700; color: var(--gold); letter-spacing: 1px; cursor: pointer; white-space: nowrap; }
.logo span { color: var(--t3); font-weight: 400; font-size: 10px; margin-left: 6px; }

/* Navigation */
#nav-links { display: flex; gap: 6px; margin-left: 8px; }
.nav-link {
  padding: 4px 10px; font-size: 11px; font-family: 'Space Mono', monospace;
  color: var(--t3); text-decoration: none; border: 1px solid var(--border);
  border-radius: 4px; transition: all .15s; white-space: nowrap;
}
.nav-link:hover { color: var(--t1); background: var(--hover); }
.nav-link.active { color: var(--bg); background: var(--gold); border-color: var(--gold); }

/* Search */
#sbox { position: relative; flex: 0 1 220px; }
#sinp { width: 100%; padding: 6px 10px 6px 30px; background: var(--card); border: 1px solid var(--border);
  border-radius: 5px; color: var(--t1); font-size: 12px; font-family: 'DM Sans', sans-serif; outline: none; }
#sinp:focus { border-color: var(--gold); }
#sinp::placeholder { color: var(--t3); }
#sico { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--t3); font-size: 12px; pointer-events: none; }
#sres { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: 5px; margin-top: 2px; max-height: 280px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 1100; }
#sres.show { display: block; }
.si { padding: 7px 10px; cursor: pointer; font-size: 11px; border-bottom: 1px solid var(--border); }
.si:hover { background: var(--hover); }
.st { font-size: 9px; color: var(--t3); font-family: 'Space Mono', monospace; margin-left: 4px; }

/* Controls */
#ctrls { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: nowrap; }
.cg { display: flex; align-items: center; gap: 4px; }
.cl { font-size: 9px; color: var(--t3); font-family: 'Space Mono', monospace; text-transform: uppercase; }
.cb { padding: 3px 8px; background: var(--card); border: 1px solid var(--border); border-radius: 4px;
  color: var(--t2); font-size: 10px; cursor: pointer; font-family: 'Space Mono', monospace; transition: all .15s; white-space: nowrap; }
.cb:hover { background: var(--hover); color: var(--t1); }
.cb.on { background: var(--gold); color: var(--bg); border-color: var(--gold); }
#hbtn { width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1px solid var(--border);
  color: var(--t3); font-size: 11px; font-weight: 700; font-family: 'Space Mono', monospace;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
#hbtn:hover { border-color: var(--gold); color: var(--gold); }

/* Help */
#help { display: none; position: fixed; top: 54px; right: 16px; z-index: 1100; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; max-width: 300px;
  font-size: 11px; line-height: 1.5; color: var(--t2); box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
#help.show { display: block; }

/* ===== LEFT SIDEBAR NPS DASHBOARD ===== */
#nps-sidebar {
  position: fixed; top: 50px; left: 0; bottom: 0; width: 220px; z-index: 850;
  background: rgba(12,18,33,0.95); backdrop-filter: blur(12px);
  border-right: 1px solid var(--border); transition: transform 0.3s ease;
  overflow-y: auto;
}
#nps-sidebar.collapsed { transform: translateX(-220px); }
#nps-sidebar::-webkit-scrollbar { width: 2px; }
#nps-sidebar::-webkit-scrollbar-thumb { background: var(--border); }

#nps-toggle {
  position: absolute; top: 12px; right: -28px; width: 28px; height: 28px;
  background: rgba(12,18,33,0.95); border: 1px solid var(--border);
  border-left: none; border-radius: 0 6px 6px 0;
  color: var(--t3); font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
}
#nps-toggle:hover { color: var(--gold); }
#nps-sidebar.collapsed #nps-toggle { transform: scaleX(-1); }

.ns-content { padding: 16px 14px; }
.ns-section-label {
  font-size: 8px; color: var(--t3); font-family: 'Space Mono', monospace;
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px;
}
.ns-hero { text-align: center; margin-bottom: 16px; }
.ns-nps { font-size: 42px; font-weight: 700; line-height: 1; }

.ns-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.ns-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px; text-align: center;
}
.ns-val { display: block; font-size: 18px; font-weight: 700; color: var(--t1); }
.ns-lbl { display: block; font-size: 7px; color: var(--t3); font-family: 'Space Mono', monospace; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.ns-divider { height: 1px; background: var(--border); margin: 14px 0; }

.ns-bars { display: flex; flex-direction: column; gap: 10px; }
.ns-bar-row { display: flex; align-items: center; gap: 6px; }
.ns-bar-label { font-size: 9px; color: var(--t2); width: 62px; flex-shrink: 0; }
.ns-bar-track { flex: 1; height: 6px; background: var(--card); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.ns-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.ns-bar-fill.pro { background: var(--green); }
.ns-bar-fill.pas { background: var(--gold); }
.ns-bar-fill.det { background: var(--red); }
.ns-bar-pct { font-size: 10px; font-weight: 700; width: 36px; text-align: right; flex-shrink: 0; }

.ns-footer { text-align: center; }
.ns-info { font-size: 8px; color: var(--t3); font-family: 'Space Mono', monospace; line-height: 1.6; }

/* ===== LOADER ===== */
#loader { position: fixed; top: 50px; left: 0; right: 0; bottom: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 999; transition: opacity .4s; }
#loader.gone { opacity: 0; pointer-events: none; }
.lp { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); opacity: .3; animation: lp 1.4s ease-in-out infinite; }
@keyframes lp { 0%,100% { transform: scale(.8); opacity: .3; } 50% { transform: scale(1.2); opacity: .7; } }
.lt { margin-top: 10px; font-family: 'Space Mono', monospace; font-size: 10px; color: var(--t3); letter-spacing: 1px; }

/* ===== NPS BIG SCORE ===== */
.nps-big { font-family: 'Space Mono', monospace; font-size: 32px; font-weight: 700; text-align: center; padding: 4px 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  #panel { width: 100%; right: -100%; top: 40vh; }
  #map-wrap.po { right: 0; }
  #nps-sidebar { transform: translateX(-220px); }
  #nps-sidebar:not(.collapsed) { transform: translateX(0); }
  #map-wrap { left: 0 !important; }
}
@media (max-width: 600px) {
  #scope-toggle { bottom: 60px; }
}
