:root {
  --bg: #060911;
  --surface: #0d1322;
  --surface-2: #131c31;
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(255, 255, 255, 0.18);
  --text: #f3f6fc;
  --muted: #8f9db8;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #38bdf8;
  --purple: #a855f7;
  --wa: #25d366;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.4;
  min-height: 100vh;
  padding-bottom: 48px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* PIN LOCK OVERLAY */
.pin-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(circle at 50% 20%, #111c35 0%, #060911 70%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pin-box {
  width: 100%; max-width: 340px;
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 22px; padding: 26px 22px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65);
}
.pin-badge {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.12em; color: var(--green);
  background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.pin-box h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.pin-box p { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.pin-input {
  width: 100%; padding: 14px; font-size: 24px; font-weight: 800;
  letter-spacing: 0.35em; text-align: center; color: #fff;
  background: #070b14; border: 1.5px solid var(--border-hi);
  border-radius: 14px; margin-bottom: 12px; outline: none;
}
.pin-input:focus { border-color: var(--green); }
.btn-primary {
  width: 100%; padding: 13px 16px; border: 0; border-radius: 13px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #031b0b; font-weight: 800; font-size: 14px; cursor: pointer;
}
.pin-err { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 18px; }

/* SHELL & TOP LED BAR */
.hq-wrap { max-width: 980px; margin: 0 auto; padding: 12px 12px 32px; }
.top-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.brand-row { display: flex; align-items: center; gap: 8px; }
.hq-pill {
  background: #fff; color: #060911; font-weight: 900; font-size: 11px;
  letter-spacing: 0.08em; padding: 4px 9px; border-radius: 999px;
}
.hq-title { font-size: 15px; font-weight: 800; }
.header-actions { display: flex; gap: 6px; align-items: center; }
.btn-chip {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-hi); border-radius: 10px;
  padding: 7px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.btn-chip.is-on { border-color: rgba(34,197,94,0.5); color: #86efac; }

.led-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px;
}
@media (min-width: 720px) { .led-grid { grid-template-columns: repeat(4, 1fr); } }
.led-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 11px; display: flex; flex-direction: column; gap: 4px;
}
.led-row { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.led-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: #374151;
}
.dot.green { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulseLed 2s infinite; }
.dot.amber { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: pulseLed 1.3s infinite; }
.dot.red { background: var(--red); box-shadow: 0 0 12px var(--red); animation: pulseLed 0.9s infinite; }
.dot.blue { background: var(--blue); box-shadow: 0 0 9px var(--blue); }
.dot.purple { background: var(--purple); box-shadow: 0 0 9px var(--purple); }
.dot.off { background: #4b5563; box-shadow: none; }
@keyframes pulseLed { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* FLOW SHIELD BAR */
.flow-bar {
  background: linear-gradient(135deg, #10182b, #0c1220);
  border: 1px solid var(--border-hi); border-radius: 15px;
  padding: 11px 13px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.flow-info { display: flex; align-items: center; gap: 10px; }
.flow-timer { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.btn-flow {
  background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff;
  border: 0; border-radius: 11px; padding: 9px 13px; font-size: 12px; font-weight: 800; cursor: pointer;
}
.btn-flow:disabled { opacity: 0.45; cursor: not-allowed; background: #334155; }

/* RADAR EN VIVO */
.radar-card {
  background: #09101d; border: 1px solid rgba(34,197,94,0.26);
  border-radius: 15px; padding: 10px 12px; margin-bottom: 12px;
}
.radar-card.flash { animation: radarFlash 1.2s ease; }
@keyframes radarFlash {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.65); border-color: #22c55e; }
  100% { box-shadow: 0 0 0 14px rgba(34,197,94,0); }
}
.radar-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 800; color: #86efac; letter-spacing: 0.06em; margin-bottom: 6px;
}
.radar-list {
  list-style: none; max-height: 112px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px;
}
.radar-item {
  font-size: 12px; color: #dbe7ff; display: flex; align-items: center; gap: 7px;
  padding: 4px 6px; border-radius: 8px; background: rgba(255,255,255,0.03);
}
.radar-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* FILTERS & TOOLBAR */
.toolbar { display: flex; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.search-in {
  flex: 1; min-width: 180px; background: var(--surface); border: 1px solid var(--border);
  color: #fff; padding: 9px 12px; border-radius: 11px; font-size: 13px; outline: none;
}
.filters-strip {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px;
  scrollbar-width: none;
}
.filters-strip::-webkit-scrollbar { display: none; }
.filter-btn {
  white-space: nowrap; background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.filter-btn.active { background: #fff; color: #060911; border-color: #fff; }

/* PROSPECT CARDS + 4 BUBBLES */
.leads-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .leads-grid { grid-template-columns: repeat(2, 1fr); } }
.lead-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.lead-card.is-live { border-color: rgba(34,197,94,0.65); box-shadow: 0 0 24px rgba(34,197,94,0.14); }
.lead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.lead-name { font-size: 15.5px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 7px; }
.lead-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.lead-badges { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.pill-stat {
  font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.06); color: #dce6f7;
}
.pill-prio { background: rgba(245,158,11,0.18); color: #fcd34d; border: 1px solid rgba(245,158,11,0.35); cursor: pointer; }

.bubbles-list { display: flex; flex-direction: column; gap: 5px; }
.bubble-line {
  font-size: 12px; color: #d5e0f2; background: rgba(255,255,255,0.035);
  border-left: 2.5px solid rgba(37,211,102,0.55); padding: 5px 8px; border-radius: 0 8px 8px 0;
}
.bubble-line strong { color: #86efac; margin-right: 4px; }

.wa-dispatch-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.btn-wa-num {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 0; border-radius: 11px; border: 1px solid rgba(37,211,102,0.4);
  background: rgba(37,211,102,0.13); color: #86efac;
  font-size: 13px; font-weight: 900; text-decoration: none; cursor: pointer;
}
.btn-wa-num:active { transform: scale(0.96); }
.btn-wa-num.sent { background: rgba(37,211,102,0.32); color: #fff; border-color: #25d366; }

.card-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding-top: 6px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.state-select, .wsp-mini {
  background: #070b14; color: var(--text); border: 1px solid var(--border-hi);
  border-radius: 8px; padding: 5px 8px; font-size: 11.5px;
}
.wsp-mini { width: 138px; }
