:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: rgba(29, 78, 216, 0.08);
  --green: #15803d;
  --green-soft: rgba(21, 128, 61, 0.10);
  --green-border: rgba(21, 128, 61, 0.25);
  --red: #b91c1c;
  --red-soft: rgba(185, 28, 28, 0.10);
  --red-border: rgba(185, 28, 28, 0.25);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.12);
  --amber-border: rgba(180, 83, 9, 0.28);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --radius: 12px;
  --radius-lg: 16px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #090d16;
  --surface: #111827;
  --surface-2: #161f33;
  --surface-3: #1e293b;
  --ink: #f1f5f9;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --line: #1f2937;
  --line-strong: #334155;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --green-border: rgba(74, 222, 128, 0.28);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --red-border: rgba(248, 113, 113, 0.28);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --amber-border: rgba(251, 191, 36, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.03em;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}
.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* MAIN */
main.shell {
  padding: 20px 0 48px;
}

/* BANNER PRINCIPAL (IDÉNTICO A LA CAPTURA DE REFERENCIA SIN BOTÓN DE ACTUALIZAR) */
.intro {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 36px 40px 36px 290px;
  margin-bottom: 20px;
  border: 1px solid #1e293b;
  border-radius: 20px;
  background: linear-gradient(135deg, #090f1d 0%, #0d1527 100%);
  color: #f8fafc;
  box-shadow: var(--shadow);
  min-height: 176px;
}
.rings {
  position: absolute;
  left: 54px;
  top: -66px;
  width: 196px;
  height: 216px;
  pointer-events: none;
}
.rings i {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
}
.rings i:nth-child(1) {
  inset: 0;
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.06);
}
.rings i:nth-child(2) {
  inset: 32px;
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.09);
}
.rings i:nth-child(3) {
  inset: 64px;
  border-color: rgba(20, 184, 166, 0.78);
  background: rgba(20, 184, 166, 0.15);
}
.rings::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 41%;
  width: 16px;
  height: 16px;
  margin: -8px;
  border-radius: 50%;
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.35);
}
.intro-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.intro-eyebrow {
  color: #5eead4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.intro h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: #ffffff;
}
.intro p {
  margin: 0;
  color: #94a3b8;
  font-size: 13.5px;
  line-height: 1.5;
}

/* KPI CARDS */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  --stat-color: var(--accent);
  position: relative;
  text-align: left;
  padding: 15px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 3px;
  background: var(--stat-color);
}
.stat.open { --stat-color: var(--green); }
.stat.closed { --stat-color: var(--red); }
.stat.off { --stat-color: var(--amber); }
.stat:hover, .stat.selected {
  border-color: var(--stat-color);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.stat.open .stat-head { color: var(--green); }
.stat.closed .stat-head { color: var(--red); }
.stat.off .stat-head { color: var(--amber); }
.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stat-color);
}
.stat-value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* TABS */
.tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  transition: all 0.15s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

/* TOOLBAR & FILTERS */
.toolbar-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.search-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) 1fr 1fr;
  gap: 10px;
}
.search-box {
  position: relative;
}
.search-box-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}
.search-box .control {
  padding-left: 36px;
  padding-right: 32px;
}
.control:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.chip-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.filter-chip:hover { color: var(--ink); }
.filter-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.right-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.ce-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.ce-filter input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}
.ce-badge {
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}
.view-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.view-btn {
  padding: 5px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.view-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* RESULTS META */
.results-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.results-meta-bar strong { color: var(--ink); }
.clear-btn {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}
.clear-btn:hover { text-decoration: underline; }

/* CARDS GRID & MAP SPLIT */
.locator-wrap.with-map {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.85fr);
  gap: 14px;
  align-items: start;
}
.map-panel {
  display: none;
  position: sticky;
  top: 78px;
  height: min(74vh, 680px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.locator-wrap.with-map .map-panel {
  display: block;
}
#mapCanvas {
  width: 100%;
  height: 100%;
}
:root[data-theme="dark"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.8);
}
.map-legend {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}
.locator-wrap.with-map .cards-grid {
  grid-template-columns: 1fr;
  max-height: min(74vh, 680px);
  overflow-y: auto;
  padding-right: 4px;
}

/* STORE CARD */
.store-card {
  --card-accent: var(--line-strong);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.store-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--card-accent);
}
.store-card.status-open { --card-accent: var(--green); }
.store-card.status-closed { --card-accent: var(--red); }
.store-card.status-off { --card-accent: var(--amber); }
.store-card:hover, .store-card.active {
  border-color: var(--card-accent);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.store-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.store-name {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.open { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); }
.badge.closed { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-border); }
.badge.off { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.badge.ce {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(29, 78, 216, 0.22);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}
.badge.ce::before { display: none; }
.badge.facial {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  border: 1px solid rgba(20, 184, 166, 0.25);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}
.badge.facial::before { display: none; }
:root[data-theme="dark"] .badge.facial {
  background: rgba(45, 212, 191, 0.14);
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.28);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 12px 0;
}
.field-full { grid-column: 1 / -1; }
.field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.field-value {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* ALTERNATIVE STORE BOX */
.nearest-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: var(--amber);
  font-size: 12px;
}
.nearest-box strong {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nearest-jump {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--amber-border);
  background: var(--surface);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.nearest-jump:hover {
  background: var(--amber);
  color: #ffffff;
}

details.card-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 8px;
}
details.card-details summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 14px;
  padding-top: 10px;
}
.detail-grid a {
  color: var(--accent);
  text-decoration: none;
}
.detail-grid a:hover { text-decoration: underline; }

.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.map-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}
.map-link.primary {
  background: var(--accent-soft);
  border-color: rgba(29, 78, 216, 0.25);
  color: var(--accent);
}
.map-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* TABLE VIEW */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.data-table tr:hover td {
  background: var(--surface-2);
}

/* NOVEDADES Y LINEAMIENTOS */
.nl-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.nl-header-bar h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.nl-header-bar p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.nl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.nl-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.nl-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.nl-block-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.nl-alert {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}
.nl-alert.info { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(29, 78, 216, 0.2); }
.nl-alert.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.nl-alert.danger { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-border); }

.nl-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}
.nl-guide-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.nl-guide-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 8px;
}
.nl-guide-card strong {
  display: block;
  font-size: 12.5px;
  margin-bottom: 4px;
  color: var(--ink);
}
.nl-guide-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.nl-subhead {
  margin: 16px 0 8px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nl-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.nl-result-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.nl-result-card.ok {
  background: var(--green-soft);
  border-color: var(--green-border);
}
.nl-result-card.fail {
  background: var(--red-soft);
  border-color: var(--red-border);
}
.nl-result-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink);
}
.nl-result-card.ok .nl-result-title { color: var(--green); }
.nl-result-card.fail .nl-result-title { color: var(--red); }
.nl-speech {
  margin: 0 0 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-style: italic;
  color: var(--ink);
  line-height: 1.45;
}
.nl-action {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
}
.nl-action strong {
  font-weight: 700;
  color: var(--ink);
}
.nl-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.nl-meta-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.nl-meta-card h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.nl-bullet-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.55;
}
.nl-bullet-list li + li {
  margin-top: 4px;
}
.badge.pilot-v13 {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(29, 78, 216, 0.25);
}
.badge.pilot-v13::before { background: var(--accent); }
.badge.pilot-l16 {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}
.badge.pilot-l16::before { background: var(--amber); }

/* INCIDENT ALERTS BANNER & TOAST */
.incident-host {
  margin-bottom: 16px;
}
.incident-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.incident-card.sev-critica { border-left-color: var(--red); background: var(--red-soft); border-color: var(--red-border); }
.incident-card.sev-advertencia { border-left-color: var(--amber); background: var(--amber-soft); border-color: var(--amber-border); }
.incident-card.sev-informativa { border-left-color: var(--accent); background: var(--accent-soft); border-color: rgba(29, 78, 216, 0.25); }
.incident-main { flex: 1; min-width: 0; }
.incident-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}
.incident-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.incident-title {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}
.incident-comm {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
}
.incident-time {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.incident-dismiss {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.incident-dismiss:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.incident-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 950;
  width: min(410px, calc(100vw - 28px));
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--red);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.incident-toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red);
}
.incident-toast-body {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
}
.incident-toast-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
@media (max-width: 600px) {
  .incident-card { flex-direction: column; }
  .incident-toast { left: 14px; right: 14px; bottom: 14px; width: auto; }
}

/* EMPTY, LOADING, ERROR, BUTTONS */
.state-box {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  color: var(--muted);
}
.state-box.error {
  border-color: var(--red-border);
  background: var(--red-soft);
  color: var(--red);
}
.load-error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--red-border);
  background: var(--red-soft);
  color: var(--red);
  text-align: left;
}
.load-error-banner.hidden {
  display: none;
}
.soft-sync-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.soft-sync-notice.hidden {
  display: none !important;
}
.load-error-banner strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.load-error-banner span {
  font-size: 12.5px;
  color: var(--ink-2);
}
.retry-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--red-border);
  background: var(--surface);
  color: var(--red);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.retry-btn:hover {
  border-color: var(--red);
  background: var(--surface-2);
}
.load-more {
  display: block;
  margin: 18px auto 0;
  padding: 10px 22px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.load-more:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

footer.app-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.hidden { display: none !important; }

@media (max-width: 860px) {
  .intro { padding: 26px 24px; }
  .rings { opacity: 0.22; left: auto; right: -40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .search-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .locator-wrap.with-map { grid-template-columns: 1fr; }
  .locator-wrap.with-map .map-panel { position: relative; top: 0; height: 360px; }
  .locator-wrap.with-map .cards-grid { max-height: none; overflow: visible; }
}
@media (max-width: 480px) {
  .card-grid, .detail-grid { grid-template-columns: 1fr; }
}