/* ============================================================
   WF TOOLS CELL-ID PRO — Professional Design System
   ============================================================ */

:root {
  /* Core palette */
  --void:    #03050c;
  --deep:    #070d1c;
  --surface: #0c1426;
  --raised:  #111e36;
  --overlay: #162240;
  --border:  rgba(255,255,255,0.07);
  --border-accent: rgba(0,212,255,0.2);

  /* Typography */
  --text-primary:   #f0f6ff;
  --text-secondary: #7a92b8;
  --text-muted:     #3f5479;

  /* Brand */
  --cyan:   #00d4ff;
  --cyan-dim: rgba(0,212,255,0.12);
  --green:  #00e5a0;
  --amber:  #ffc53d;
  --red:    #ff5566;

  /* Geometry */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  /* Layout */
  --nav-h: 86px;
  --sidebar-w: 340px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.6);
  --glow-cyan: 0 0 20px rgba(0,212,255,0.15);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--void);
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.wf-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(7, 13, 28, 0.96);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
}

.wf-nav-left, .wf-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wf-nav-right {
  margin-left: auto;
}

.wf-logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid var(--border-accent);
  flex-shrink: 0;
}

.wf-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  text-align: center;
  align-items: center;
}
.wf-brand-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wf-brand-home-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}
.wf-brand-home-link:hover,
.wf-brand-home-link:focus-visible {
  transform: translateY(-1px);
  opacity: .96;
  outline: none;
}
.wf-brand-title {
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 2.8px;
  color: var(--text-primary);
}
.wf-brand-version {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(82, 190, 255, 0.4);
  background: rgba(82, 190, 255, 0.12);
  color: #7dd1ff;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3px;
  font-weight: 600;
  line-height: 1;
}
.wf-app-version {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(126, 198, 255, 0.3);
  background: rgba(37, 89, 139, 0.2);
  color: rgba(191, 227, 255, 0.94);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.28px;
  line-height: 1;
  white-space: nowrap;
  margin-top: 2px;
}
.wf-brand-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--cyan);
  opacity: 1;
  font-weight: 900;
}

.wf-nav-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.wf-nav-meta {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* Signal badge */
.wf-signal-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--green);
  background: rgba(0,229,160,0.07);
  border: 1px solid rgba(0,229,160,0.2);
  border-radius: 999px;
  padding: 6px 14px;
}
.wf-signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Action buttons */
.wf-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.wf-action-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--text-primary);
  background: var(--overlay);
}
.wf-action-btn.wf-action-primary {
  border-color: var(--border-accent);
  background: var(--cyan-dim);
  color: var(--cyan);
}
.wf-action-btn.wf-action-primary:hover {
  background: rgba(0,212,255,0.18);
  box-shadow: var(--glow-cyan);
}
.wf-action-btn.wf-full {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wf-layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.wf-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
  background: var(--deep);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.wf-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Custom scrollbar */
.wf-sidebar-scroll::-webkit-scrollbar { width: 4px; }
.wf-sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.wf-sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--overlay);
  border-radius: 4px;
}
.wf-sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--border-accent);
}

/* ---- SECTIONS ---- */
.wf-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  transition: border-color 0.2s;
}
.wf-section:hover {
  border-color: rgba(255,255,255,0.1);
}

.wf-section-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.wf-section-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: var(--cyan-dim);
  flex-shrink: 0;
}

.wf-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  letter-spacing: 0.8px;
  color: #ffffff !important;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

/* ---- FORM FIELDS ---- */
.wf-form-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wf-field-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.wf-input,
.wf-select {
  width: 100%;
  padding: 8px 11px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.wf-input::placeholder { color: var(--text-muted); }
.wf-input:focus,
.wf-select:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.07);
}

/* Custom select arrow */
.wf-select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%233f5479' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 28px;
  cursor: pointer;
}
.wf-select option {
  background: var(--surface);
  color: var(--text-primary);
}

.wf-select.wf-select-multiple {
  background-image: none;
  padding-right: 11px;
  min-height: 120px;
  cursor: default;
}

#modalPropagationBulk .wf-select.wf-select-multiple {
  min-height: 120px;
}

/* ---- TOGGLE GROUP ---- */
.wf-toggle-group {
  display: flex;
  gap: 0;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
}
.wf-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: var(--r-xs);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.wf-toggle.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--border-accent);
}
.wf-toggle:hover:not(.active) {
  color: var(--text-primary);
}

/* ---- HINTS ---- */
.wf-field-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ---- ACTION ROW ---- */
.wf-action-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wf-inline-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.wf-inline-search .wf-action-btn {
  padding-inline: 12px;
}

/* ---- KPI GRID ---- */
.wf-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.wf-kpi {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  transition: border-color 0.2s;
}
.wf-kpi:hover { border-color: rgba(255,255,255,0.12); }
.wf-kpi:first-child { border-color: rgba(0,212,255,0.15); }
.wf-kpi:first-child .wf-kpi-value { color: var(--cyan); }

.wf-kpi-value {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.wf-kpi-label {
  font-size: 10px;
  letter-spacing: 0.5px;
  line-height: 1.2;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ---- CHART ---- */
.wf-chart-wrap {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
}

/* ---- DETAIL PANEL ---- */
.wf-detail-panel {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  min-height: 80px;
  max-height: 260px;
  overflow-y: auto;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.wf-detail-panel::-webkit-scrollbar { width: 3px; }
.wf-detail-panel::-webkit-scrollbar-thumb {
  background: var(--overlay);
  border-radius: 4px;
}

.wf-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  color: var(--text-muted);
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
}

/* Detail rows populated via JS */
.wf-detail-table {
  width: 100%;
}
.wf-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.wf-detail-row:last-child { border-bottom: none; }
.wf-detail-row:hover { background: rgba(255,255,255,0.02); }
.wf-detail-key {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.3px;
}
.wf-detail-val {
  color: var(--text-primary);
  text-align: right;
  font-size: 11px;
}
.wf-detail-val.highlight { color: var(--cyan); }

/* ---- LOG ---- */
.wf-log {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  min-height: 40px;
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ============================================================
   MAP
   ============================================================ */
.wf-main {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.wf-map {
  width: 100%;
  height: 100%;
}

.leaflet-container {
  background: #040812;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
}
.leaflet-control-zoom a {
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  font-size: 16px !important;
  transition: all 0.15s;
}
.leaflet-control-zoom a:hover {
  background: var(--raised) !important;
  color: var(--text-primary) !important;
}
.leaflet-control-zoom-in {
  border-radius: var(--r-sm) var(--r-sm) 0 0 !important;
  border-bottom: none !important;
}
.leaflet-control-zoom-out {
  border-radius: 0 0 var(--r-sm) var(--r-sm) !important;
}

.leaflet-control-attribution {
  background: rgba(7,13,28,0.8) !important;
  color: var(--text-muted) !important;
  font-size: 9px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-sm) !important;
  padding: 3px 8px !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.leaflet-control-attribution a { color: var(--cyan) !important; }

/* ============================================================
   HUD (bottom overlay)
   ============================================================ */
.wf-hud {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  gap: 8px;
}

.wf-hud-left, .wf-hud-right {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wf-hud-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(7,13,28,0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: var(--text-primary);
  letter-spacing: 0.2px;
  box-shadow: var(--shadow-sm);
}
.wf-hud-muted { color: var(--text-muted); }

.wf-hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

.wf-map-tools {
  position: absolute;
  top: 12px;
  left: 58px;
  z-index: 900;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
}

.wf-map-search {
  display: grid;
  grid-template-columns: minmax(220px, 340px) auto auto auto;
  gap: 6px;
}

.wf-map-query-input {
  height: 34px;
}

#btnMapSearch {
  height: 34px;
  min-height: 34px;
  padding-inline: 11px;
}

.wf-map-geo-btn {
  height: 34px;
  padding-inline: 11px;
}

.wf-map-geo-fab {
  position: absolute;
  left: 12px;
  bottom: 20px;
  z-index: 900;
  height: 34px;
  padding-inline: 11px;
  pointer-events: auto;
}

@media (max-width: 700px) {
  .wf-map-tools {
    top: 8px;
    left: 50px;
    right: 58px;
    display: block;
    gap: 6px;
  }

  .wf-map-search {
    grid-template-columns: 1fr auto auto auto;
    min-width: 0;
  }

  .wf-map-query-input {
    min-width: 0;
    font-size: 11px;
    padding-inline: 9px;
  }

  .wf-map-geo-btn {
    font-size: 10.5px;
    padding-inline: 8px;
  }

  .wf-map-geo-fab {
    left: 6px;
    bottom: 62px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    gap: 0;
    font-size: 0;
    border-radius: 12px;
  }
}

/* ============================================================
   MARKER CLUSTER
   ============================================================ */
.marker-cluster {
  background-clip: padding-box;
}
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(0,212,255,0.1) !important;
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(7,13,28,0.9) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(0,212,255,0.25) !important;
  font-family: 'DM Mono', monospace !important;
  font-size: 11px !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .wf-nav-meta { display: none; }
}
@media (max-width: 700px) {
  .wf-layout { flex-direction: column; }
  .wf-sidebar {
    width: 100%;
    height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .wf-main { height: 60vh; }
}

/* ============================================================
   LEAFLET POPUP CUSTOM
   ============================================================ */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text-primary) !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 12px !important;
  padding: 0 !important;
  min-width: 200px;
}
.leaflet-popup-tip {
  background: var(--surface) !important;
}
.leaflet-popup-content {
  margin: 0 !important;
}
.wf-popup-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wf-popup-body {
  padding: 8px 0;
}
.wf-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 14px;
}
.wf-popup-key {
  color: var(--text-muted);
  font-size: 10.5px;
  flex-shrink: 0;
}
.wf-popup-val {
  color: var(--text-primary);
  font-size: 11px;
  text-align: right;
}

.wf-popup-scroll {
  max-height: 260px;
  overflow-y: auto;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wf-section {
  animation: fade-in 0.3s ease both;
}
.wf-section:nth-child(1) { animation-delay: 0.05s; }
.wf-section:nth-child(2) { animation-delay: 0.1s; }
.wf-section:nth-child(3) { animation-delay: 0.15s; }
.wf-section:nth-child(4) { animation-delay: 0.2s; }

/* ============================================================
   UTILITY
   ============================================================ */
.mt-3 { margin-top: 10px !important; }

/* ============================================================
   EXPORT GRID
   ============================================================ */
.wf-export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.wf-export-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.wf-export-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--text-primary);
  background: var(--overlay);
  transform: translateY(-1px);
}

.wf-export-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  background: var(--cyan-dim);
  border: 1px solid var(--border-accent);
  color: var(--cyan);
  flex-shrink: 0;
}
.wf-export-kml  { background: rgba(0,229,160,0.1);  border-color: rgba(0,229,160,0.25);  color: var(--green); }
.wf-export-kmz  { background: rgba(0,229,160,0.1);  border-color: rgba(0,229,160,0.25);  color: var(--green); }
.wf-export-csv  { background: rgba(255,197,61,0.1); border-color: rgba(255,197,61,0.25); color: var(--amber); }

.wf-export-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}
.wf-export-tag {
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.wf-action-pericial {
  border-color: rgba(255,197,61,0.3);
  background: rgba(255,197,61,0.07);
  color: var(--amber);
}
.wf-action-pericial:hover {
  background: rgba(255,197,61,0.14);
  box-shadow: 0 0 20px rgba(255,197,61,0.1);
}

/* ============================================================
   MODAL PERICIAL
   ============================================================ */
.wf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(3,5,12,0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

.wf-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.wf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.wf-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--amber);
}
.wf-modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.wf-modal-close:hover {
  background: var(--raised);
  color: var(--text-primary);
}

.wf-modal-body {
  padding: 20px;
}
.wf-modal-info {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  margin-bottom: 4px;
}

.wf-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--deep);
}

/* ============================================================
   UI Refresh - Friendly / Modern
   ============================================================ */
:root {
  --void: #eef4fb;
  --deep: #f5f8fd;
  --surface: #ffffff;
  --raised: #f7f9fe;
  --overlay: #edf3ff;
  --border: rgba(15, 47, 87, 0.12);
  --border-accent: rgba(25, 118, 210, 0.35);

  --text-primary: #0f2f57;
  --text-secondary: #365f8f;
  --text-muted: #5f7fa6;

  --cyan: #0f74d8;
  --cyan-dim: rgba(15, 116, 216, 0.12);
  --green: #159d68;
  --amber: #e79b19;
  --red: #d54254;

  --shadow-sm: 0 6px 16px rgba(34, 76, 129, 0.08);
  --shadow-md: 0 14px 32px rgba(34, 76, 129, 0.12);
  --shadow-lg: 0 24px 60px rgba(34, 76, 129, 0.18);
  --glow-cyan: 0 0 0 rgba(0, 0, 0, 0);
}

body {
  background:
    radial-gradient(1100px 580px at -5% -10%, rgba(130, 186, 245, 0.45), transparent 60%),
    radial-gradient(900px 460px at 110% 8%, rgba(84, 171, 242, 0.25), transparent 58%),
    linear-gradient(180deg, #f5f9ff 0%, #eef4fb 100%);
  color: var(--text-primary);
}

.wf-nav {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(15, 47, 87, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.wf-logo-mark {
  background: linear-gradient(145deg, rgba(20, 130, 235, 0.17), rgba(63, 159, 247, 0.09));
  color: #0f74d8;
}

.wf-brand-title {
  color: #0f2f57;
}

.wf-brand-tag {
  color: #0f74d8;
}

.wf-nav-meta {
  color: #55759a;
}

.wf-signal-badge {
  background: rgba(24, 168, 108, 0.12);
  border-color: rgba(24, 168, 108, 0.26);
  color: #117649;
}

.wf-action-btn {
  border: 1px solid rgba(15, 47, 87, 0.14);
  background: #ffffff;
  color: #22507f;
  box-shadow: 0 2px 8px rgba(28, 76, 128, 0.08);
}

.wf-action-btn:hover {
  background: #f3f8ff;
  border-color: rgba(20, 104, 190, 0.35);
  color: #0f4f95;
  transform: translateY(-1px);
}

.wf-action-btn.wf-action-primary {
  background: linear-gradient(135deg, #1676dd 0%, #2f8df2 100%);
  color: #ffffff;
  border-color: transparent;
}

.wf-action-btn.wf-action-primary:hover {
  background: linear-gradient(135deg, #136aca 0%, #287ed7 100%);
  box-shadow: 0 10px 18px rgba(23, 114, 210, 0.28);
}

.wf-layout {
  gap: 12px;
  padding: 12px;
  height: calc(100vh - var(--nav-h) - 8px);
}

.wf-sidebar {
  border: 1px solid rgba(15, 47, 87, 0.12);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.88);
  box-shadow: var(--shadow-md);
}

.wf-sidebar-scroll {
  padding: 14px;
}

.wf-section {
  background: #ffffff;
  border: 1px solid rgba(15, 47, 87, 0.1);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(37, 82, 131, 0.08);
}

.wf-section:hover {
  border-color: rgba(18, 104, 195, 0.22);
}

.wf-section-icon {
  background: rgba(28, 129, 228, 0.12);
  color: #136bc9;
}

.wf-section-title {
  color: #4e6f95;
}

.wf-input,
.wf-select {
  background: #f9fbff;
  border: 1px solid rgba(33, 86, 144, 0.2);
  color: #123f71;
}

.wf-input::placeholder {
  color: #7f9ec2;
}

.wf-input:focus,
.wf-select:focus {
  border-color: rgba(24, 114, 209, 0.5);
  box-shadow: 0 0 0 4px rgba(28, 128, 230, 0.13);
  background: #ffffff;
}

.wf-toggle-group {
  background: #eef4ff;
  border-color: rgba(15, 47, 87, 0.14);
}

.wf-toggle {
  color: #4a6f9a;
}

.wf-toggle.active {
  background: #ffffff;
  color: #0f66bf;
  border: 1px solid rgba(18, 104, 195, 0.4);
  box-shadow: 0 3px 10px rgba(20, 112, 205, 0.16);
}

.wf-kpi {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.wf-kpi-value {
  color: #123f71;
}

.wf-kpi:first-child .wf-kpi-value {
  color: #0f74d8;
}

.wf-chart-wrap,
.wf-log,
.wf-detail-panel {
  background: #f9fbff;
  border-color: rgba(26, 80, 138, 0.18);
}

.wf-detail-row:hover {
  background: rgba(33, 127, 224, 0.08);
}

.wf-main {
  border: 1px solid rgba(15, 47, 87, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  background: #ffffff;
}

.wf-map {
  border-radius: 18px;
}

.leaflet-container {
  background: #dcefff;
}

.leaflet-bar,
.leaflet-control-layers {
  border: 1px solid rgba(15, 47, 87, 0.16) !important;
  box-shadow: 0 10px 24px rgba(29, 78, 129, 0.2) !important;
}

.leaflet-control-zoom a {
  background: #ffffff !important;
  border-color: rgba(15, 47, 87, 0.15) !important;
  color: #1f4c7c !important;
}

.leaflet-control-zoom a:hover {
  background: #f3f8ff !important;
  color: #0f66bf !important;
}

.leaflet-control-layers {
  background: rgba(255, 255, 255, 0.96) !important;
  border-radius: 12px !important;
  color: #174673 !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.86) !important;
  color: #4f7198 !important;
  border: 1px solid rgba(20, 72, 126, 0.16) !important;
}

.wf-hud-pill {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(21, 79, 136, 0.18);
  color: #164677;
}

.wf-hud-muted {
  color: #476f9d;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(31, 136, 237, 0.2) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(255, 255, 255, 0.96) !important;
  color: #154674 !important;
  border: 1px solid rgba(21, 102, 188, 0.25) !important;
}

.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  border: 1px solid rgba(15, 47, 87, 0.16) !important;
  color: #173d68 !important;
}

.leaflet-popup-tip {
  background: #ffffff !important;
}

.wf-popup-header {
  color: #0f66bf;
  border-bottom: 1px solid rgba(15, 47, 87, 0.12);
}

.wf-popup-key {
  color: #55759a;
}

.wf-popup-val {
  color: #123f71;
}

.wf-modal {
  background: #ffffff;
  border: 1px solid rgba(15, 47, 87, 0.16);
}

.wf-modal-header {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
}

.wf-modal-info {
  background: #f8fbff;
  border-color: rgba(15, 47, 87, 0.14);
  color: #3f6793;
}

@media (max-width: 700px) {
  .wf-layout {
    padding: 8px;
    gap: 8px;
  }
  .wf-sidebar,
  .wf-main,
  .wf-map {
    border-radius: 14px;
  }
}

/* ============================================================
   Forced Dark Theme
   ============================================================ */
:root {
  --void: #050a14;
  --deep: #0b1324;
  --surface: #101d34;
  --raised: #152643;
  --overlay: #1a2f52;
  --border: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(56, 176, 255, 0.35);
  --text-primary: #e9f2ff;
  --text-secondary: #99b2d6;
  --text-muted: #6f87aa;
  --cyan: #39b2ff;
  --cyan-dim: rgba(57, 178, 255, 0.12);
  --green: #21c985;
  --amber: #f1b041;
  --red: #ff5e72;
}

body {
  background:
    radial-gradient(1200px 620px at -10% -18%, rgba(30, 117, 201, 0.26), transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, rgba(76, 41, 186, 0.2), transparent 58%),
    linear-gradient(180deg, #050a14 0%, #071020 100%);
}

.wf-nav {
  background: rgba(8, 16, 30, 0.9);
  border-bottom: 1px solid var(--border);
}

.wf-logo-mark {
  background: linear-gradient(145deg, rgba(56, 176, 255, 0.18), rgba(56, 176, 255, 0.08));
  color: #52beff;
}

.wf-brand-title { color: var(--text-primary); }
.wf-brand-tag { color: #52beff; }
.wf-nav-meta { color: #7f9bc3; }

.wf-signal-badge {
  background: rgba(33, 201, 133, 0.14);
  border-color: rgba(33, 201, 133, 0.26);
  color: #48d89d;
}

.wf-action-btn {
  background: #152643;
  border-color: rgba(255, 255, 255, 0.12);
  color: #b7cbe8;
  box-shadow: none;
}
.wf-action-btn:hover {
  background: #1a2f52;
  border-color: rgba(72, 170, 255, 0.36);
  color: #e8f3ff;
}
.wf-action-btn.wf-action-primary {
  background: linear-gradient(135deg, #1c86e6 0%, #34a5ff 100%);
  color: #fff;
}

.wf-sidebar {
  background: rgba(9, 18, 35, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.wf-section {
  background: #0f1d34;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: none;
}
.wf-section:hover {
  border-color: rgba(79, 180, 255, 0.32);
}

.wf-section-icon {
  background: rgba(56, 176, 255, 0.12);
  color: #58c1ff;
}
.wf-section-title { color: #7f9bc3; }

.wf-input,
.wf-select {
  background: #162845;
  border-color: rgba(255, 255, 255, 0.12);
  color: #e7f1ff;
}
.wf-input::placeholder { color: #86a2c8; }
.wf-input:focus,
.wf-select:focus {
  border-color: rgba(72, 170, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(52, 165, 255, 0.14);
  background: #1a3154;
}

.wf-toggle-group {
  background: #152845;
  border-color: rgba(255, 255, 255, 0.12);
}
.wf-toggle { color: #9fb7d8; }
.wf-toggle.active {
  background: rgba(57, 178, 255, 0.13);
  color: #6ecaff;
  border-color: rgba(72, 170, 255, 0.35);
  box-shadow: none;
}

.wf-kpi,
.wf-chart-wrap,
.wf-log,
.wf-detail-panel {
  background: #142744;
  border-color: rgba(255, 255, 255, 0.12);
}
.wf-kpi-value { color: #d8e9ff; }
.wf-detail-row:hover { background: rgba(57, 178, 255, 0.08); }

.wf-main {
  background: #0b1428;
  border: 1px solid var(--border);
}

.leaflet-container { background: #081224; }

.leaflet-control-zoom a {
  background: #122440 !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
  color: #aecdff !important;
}
.leaflet-control-zoom a:hover {
  background: #1a3154 !important;
  color: #fff !important;
}

.leaflet-control-layers {
  background: rgba(10, 19, 35, 0.95) !important;
  color: #c5d9f7 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.leaflet-control-attribution {
  background: rgba(7, 13, 26, 0.84) !important;
  color: #8aa3c8 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.wf-hud-pill {
  background: rgba(9, 18, 34, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  color: #d2e5ff;
}
.wf-hud-muted { color: #8da8cd; }

.leaflet-popup-content-wrapper {
  background: #0f1f38 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e5f1ff !important;
}
.leaflet-popup-tip { background: #0f1f38 !important; }
.wf-popup-header {
  color: #63c7ff;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.wf-popup-key { color: #86a2c8; }
.wf-popup-val { color: #e5f1ff; }

/* UI extras requested */
:root {
  --sidebar-w: 460px;
}

.wf-sidebar-scroll {
  padding-inline: 20px;
}

.wf-top-total {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(57, 178, 255, 0.12);
  color: #b9dcff;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.wf-top-total-label {
  color: #8ab4df;
}

.wf-top-total strong {
  color: #e9f4ff;
  font-size: 13px;
  font-weight: 800;
}

.wf-modal-loading {
  max-width: 360px;
}

.wf-loading-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.wf-loading-progress-wrap {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#actionModal,
#modalSearchResult,
#modalPericial,
#modalPropagation,
#modalPropagationBulk,
#actionModalProgressWrap {
  display: none;
}

.wf-loading-progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.wf-loading-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
  transition: width .18s ease;
}

.wf-loading-progress-pct {
  min-width: 38px;
  text-align: right;
  font: 700 11px/1 "DM Mono", monospace;
  color: #c8ddfb;
}

.wf-loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--cyan);
  animation: wf-spin .8s linear infinite;
}

@keyframes wf-spin {
  to { transform: rotate(360deg); }
}

#map.map-theme-satellite .marker-cluster-small,
#map.map-theme-satellite .marker-cluster-medium,
#map.map-theme-satellite .marker-cluster-large {
  background-color: rgba(255, 255, 255, 0.36) !important;
}

#map.map-theme-satellite .marker-cluster-small div,
#map.map-theme-satellite .marker-cluster-medium div,
#map.map-theme-satellite .marker-cluster-large div {
  background-color: rgba(255, 255, 255, 0.96) !important;
  color: #0b1527 !important;
  border: 1px solid rgba(11, 21, 39, 0.25) !important;
  font-weight: 800 !important;
}

#map.map-theme-streets .marker-cluster-small,
#map.map-theme-streets .marker-cluster-medium,
#map.map-theme-streets .marker-cluster-large {
  background-color: rgba(10, 20, 36, 0.55) !important;
}

#map.map-theme-streets .marker-cluster-small div,
#map.map-theme-streets .marker-cluster-medium div,
#map.map-theme-streets .marker-cluster-large div {
  background-color: rgba(8, 16, 30, 0.93) !important;
  color: #e6f2ff !important;
  border: 1px solid rgba(113, 170, 236, 0.36) !important;
  font-weight: 800 !important;
}

#map.map-theme-satellite .leaflet-marker-icon,
#map.map-theme-satellite .leaflet-div-icon {
  filter: brightness(1.1) contrast(1.08);
}

#map.map-theme-streets .leaflet-marker-icon,
#map.map-theme-streets .leaflet-div-icon {
  filter: brightness(0.74) contrast(1.12) saturate(0.8);
}

/* Mobile layout fix */
@media (max-width: 700px) {
  :root {
    --nav-h: 104px;
  }

  .wf-nav {
    height: var(--nav-h);
    padding: 8px 10px;
    align-items: flex-start;
    gap: 8px;
  }

  .wf-nav-left,
  .wf-nav-right {
    width: 100%;
    gap: 8px;
  }

  .wf-nav-left {
    justify-content: flex-start;
  }

  .wf-nav-right {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .wf-nav-divider,
  .wf-nav-meta {
    display: none;
  }

  .wf-brand {
    align-items: flex-start;
    text-align: left;
    gap: 1px;
  }

  .wf-brand-title {
    font-size: 16px;
    letter-spacing: 1.1px;
    line-height: 1;
  }

  .wf-brand-tag {
    font-size: 10px;
    letter-spacing: 1px;
    line-height: 1;
  }

  .wf-top-total {
    padding: 5px 10px;
    font-size: 10.5px;
  }

  .wf-action-btn {
    padding: 7px 10px;
    font-size: 12px;
    gap: 5px;
  }

  .wf-layout {
    margin-top: var(--nav-h);
    height: calc(100vh - var(--nav-h) - 8px);
    flex-direction: column;
  }

  .wf-sidebar {
    width: 100%;
    height: 38vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .wf-main {
    height: 62vh;
  }

  .wf-section-title {
    font-size: 15px;
  }

  .wf-kpi-value {
    font-size: 18px;
  }
}

/* Mobile tune v2 */
@media (max-width: 700px) {
  :root { --nav-h: 92px; }

  .wf-nav {
    height: var(--nav-h);
    padding: 6px 8px;
    align-items: center;
  }

  .wf-nav-left {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    gap: 6px;
  }

  .wf-brand {
    align-items: flex-start;
    text-align: left;
    max-width: 120px;
  }

  .wf-brand-title {
    font-size: 13px;
    letter-spacing: 0.8px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
  }

  .wf-brand-tag {
    font-size: 9px;
    letter-spacing: 0.8px;
    white-space: nowrap;
  }

  .wf-nav-right {
    width: auto;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto auto auto auto;
    grid-template-rows: auto auto;
    gap: 4px 6px;
    justify-items: end;
    align-items: center;
  }

  #btnOpenPropagationModal {
    grid-column: 1;
    grid-row: 1;
  }

  #btnOpenPropagationBulkModal {
    grid-column: 2;
    grid-row: 1;
  }

  #btnRefresh {
    grid-column: 3;
    grid-row: 1;
  }

  #btnClear {
    grid-column: 4;
    grid-row: 1;
  }

  #topCellTotal {
    grid-column: 1;
    grid-row: 2;
  }

  #signalBadge {
    grid-column: 2 / span 2;
    grid-row: 2;
  }

  .wf-action-btn {
    padding: 6px 8px;
    font-size: 11px;
    border-radius: 10px;
  }

  .wf-top-total,
  .wf-signal-badge {
    padding: 6px 8px;
    font-size: 10px;
    min-height: 30px;
    border-radius: 10px;
  }

  .wf-top-total strong {
    font-size: 11px;
  }

  .wf-layout {
    margin-top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    gap: 6px;
    padding: 6px;
  }

  .wf-sidebar {
    height: 31vh;
    min-height: 210px;
  }

  .wf-main {
    height: 69vh;
  }

  .wf-sidebar-scroll {
    padding: 10px;
  }

  .wf-section {
    padding: 10px;
  }

  .wf-section-title {
    font-size: 14px;
  }
}

/* Modal dark override (final) */
.wf-modal-backdrop {
  background: rgba(3, 8, 16, 0.82) !important;
}

.wf-modal,
.wf-modal.wf-modal-loading {
  background: #0f1c33 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #e8f2ff !important;
}

.wf-modal-header {
  background: #122542 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.wf-modal-title {
  color: #d9ebff !important;
}

.wf-modal-body {
  color: #c8ddfb !important;
}

.wf-modal-info {
  background: #152a4b !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #c2d9fa !important;
}

.wf-modal-footer {
  background: #0d1a30 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.wf-modal-close {
  color: #c6dcfb !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: #172b4a !important;
}

.wf-modal-close:hover {
  background: #1f3860 !important;
  color: #ffffff !important;
}

.wf-loading-wrap {
  color: #c8ddfb !important;
}

.wf-loading-spinner {
  border-color: rgba(255, 255, 255, 0.2) !important;
  border-top-color: #5bc1ff !important;
}

.wf-mobile-toggle {
  display: none;
}

@media (max-width: 700px) {
  .wf-mobile-toggle {
    display: inline-flex;
    position: static;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(9, 18, 35, 0.88);
    color: #e8f2ff;
    font-size: 11px;
    font-weight: 700;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    margin-top: 5px;
    align-self: flex-start;
  }

  .wf-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .wf-layout {
    position: relative;
    overflow: hidden;
  }

  .wf-main {
    height: 100% !important;
    flex: 1 1 auto;
    min-height: 0;
  }

  .wf-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: min(92vw, 380px);
    height: 100%;
    z-index: 1200;
    transform: translateX(-104%);
    transition: transform .24s ease;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.48);
  }

  body.mobile-sidebar-open .wf-sidebar {
    transform: translateX(0);
  }
}

.wf-action-propagation {
  border-color: rgba(0, 229, 160, 0.3);
  background: rgba(0, 229, 160, 0.08);
  color: #4af1be;
}

.wf-action-propagation:hover {
  background: rgba(0, 229, 160, 0.16);
  border-color: rgba(0, 229, 160, 0.45);
  color: #89ffd8;
}

/* Clusters más llamativos */
.wf-cluster {
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #0a0f18;
  font-family: "DM Mono", monospace;
  font-weight: 800;
  letter-spacing: 0.3px;
  border: 2px solid rgba(220, 255, 255, 0.95);
  background: radial-gradient(circle at 30% 26%, rgba(127, 235, 255, 0.95), rgba(23, 127, 214, 0.93));
  box-shadow: 0 0 0 4px rgba(89, 190, 255, 0.2), 0 10px 22px rgba(5, 36, 80, 0.45);
}

.wf-cluster-sm {
  width: 36px !important;
  height: 36px !important;
  font-size: 11px;
}

.wf-cluster-md {
  width: 44px !important;
  height: 44px !important;
  font-size: 12px;
}

.wf-cluster-lg {
  width: 54px !important;
  height: 54px !important;
  font-size: 13px;
  box-shadow: 0 0 0 6px rgba(126, 229, 255, 0.2), 0 14px 28px rgba(4, 31, 71, 0.55);
}

.wf-point-label {
  background: rgba(255, 255, 255, 0.94);
  color: #0e2039;
  border: 1px solid rgba(14, 32, 57, 0.28);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 10px rgba(7, 22, 44, 0.25);
}

.wf-point-label-name,
.wf-point-label-id {
  display: block;
  white-space: nowrap;
}

.wf-point-label-name {
  font-weight: 800;
}

.wf-point-label-id {
  font-size: 9.6px;
  opacity: 0.82;
}

.wf-point-label::before {
  border-top-color: rgba(255, 255, 255, 0.94) !important;
}

.wf-search-result-grid {
  display: grid;
  gap: 8px;
}

.wf-search-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(13, 33, 59, 0.55);
}

.wf-search-key {
  font-size: 11px;
  color: #92b4e0;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wf-search-val {
  font-size: 12px;
  color: #e8f2ff;
  font-weight: 700;
  word-break: break-word;
}

.wf-batch-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.wf-section-batch {
  background: #0b2d57;
  border-color: rgba(78, 228, 255, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 0 0 1px rgba(0, 255, 221, 0.22),
    0 0 30px rgba(0, 255, 170, 0.2),
    0 20px 36px rgba(0, 11, 26, 0.58);
}

.wf-section-batch .wf-section-title {
  color: #effcff;
  text-shadow:
    0 0 14px rgba(0, 255, 210, 0.5),
    0 0 24px rgba(0, 210, 255, 0.34);
}

.wf-section-batch .wf-field-hint {
  color: #c0dcff;
}

.wf-batch-empty {
  border: 1px dashed rgba(146, 180, 224, 0.4);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  color: #92b4e0;
  text-align: center;
}

.wf-batch-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(13, 33, 59, 0.55);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.wf-batch-main {
  display: grid;
  gap: 2px;
}

.wf-batch-title {
  font-size: 12px;
  color: #e8f2ff;
  font-weight: 700;
  word-break: break-word;
}

.wf-batch-meta {
  font-size: 10.5px;
  color: #9bbce6;
  word-break: break-word;
}

.wf-batch-actions {
  display: flex;
  gap: 6px;
}

.wf-batch-actions .wf-action-btn {
  padding: 6px 8px;
  font-size: 10px;
}

.wf-ui-notice {
  position: fixed;
  top: 78px;
  right: 20px;
  z-index: 12050;
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 22, 40, 0.95);
  color: #eaf3ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 24px rgba(4, 16, 31, 0.35);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wf-ui-notice.show {
  opacity: 1;
  transform: translateY(0);
}

.wf-ui-notice.ok {
  border-color: rgba(0, 229, 160, 0.5);
}

.wf-ui-notice.warn {
  border-color: rgba(255, 194, 61, 0.6);
}

.wf-section-coverage {
  background: #0b2d57;
  border-color: rgba(74, 222, 128, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 0 0 1px rgba(34, 197, 94, 0.24),
    0 0 30px rgba(34, 197, 94, 0.2),
    0 18px 34px rgba(0, 13, 30, 0.52);
  overflow: hidden;
}

.wf-coverage-summary {
  border: 1px solid rgba(126, 198, 255, 0.3);
  border-radius: 10px;
  background: rgba(20, 42, 73, 0.55);
  color: #cde3ff;
  font-size: 11px;
  line-height: 1.45;
  padding: 10px;
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  margin-top: 6px !important;
}

.wf-coverage-summary strong {
  color: #f3f9ff;
  font-weight: 800;
}

#topCellTotal,
#signalBadge {
  min-height: 36px;
  border-radius: var(--r-sm);
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(28, 76, 128, 0.08);
}

.wf-prop-modal {
  max-width: 920px;
}

.wf-prop-modal .wf-modal-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 20px;
}


.wf-prop-tabs {
  display: flex;
  gap: 8px;
}

.wf-prop-pane {
  width: 100%;
}

.wf-prop-list {
  display: grid;
  gap: 10px;
  max-height: min(48vh, 430px);
  overflow: auto;
  padding-right: 4px;
}

.wf-prop-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #122542;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.wf-prop-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #a7c8f2;
  letter-spacing: 0.3px;
}

.wf-prop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.wf-prop-grid .wf-field {
  margin-top: 0;
}

.wf-prop-remove {
  border: 1px solid rgba(235, 94, 129, 0.35);
  background: rgba(235, 94, 129, 0.13);
  color: #ffc7d6;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
}

.wf-prop-remove:hover {
  background: rgba(235, 94, 129, 0.2);
}

.wf-prop-textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.45;
}

.wf-prop-bulk-upload {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
}

.wf-prop-bulk-body {
  display: grid;
  gap: 8px;
}

.wf-prop-bulk-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.35px;
  color: #9fc3ec;
  text-transform: uppercase;
}

#propBulkSummary {
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(94, 154, 217, 0.25);
  border-radius: 9px;
  background: rgba(26, 53, 92, 0.45);
  color: #9bb7dc;
}

.wf-prop-bulk-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
  align-items: start;
}

.wf-prop-bulk-map .wf-field {
  padding: 10px;
  border: 1px solid rgba(93, 132, 184, 0.24);
  border-radius: 10px;
  background: rgba(20, 42, 73, 0.5);
}

.wf-prop-bulk-map .wf-bulk-span-3 {
  grid-column: 1 / -1;
}

@media (max-width: 940px) {
  .wf-prop-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .wf-prop-bulk-map {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .wf-prop-bulk-map .wf-bulk-span-3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .wf-prop-modal {
    max-width: 98vw;
  }

  .wf-prop-grid {
    grid-template-columns: 1fr;
  }

  .wf-prop-bulk-upload {
    grid-template-columns: 1fr;
  }

  .wf-prop-bulk-map {
    grid-template-columns: 1fr;
  }

  .wf-prop-bulk-map .wf-bulk-span-3 {
    grid-column: auto;
  }

  .wf-modal-footer {
    flex-wrap: wrap;
  }

  .wf-modal-footer .wf-action-btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 700px) {
  #modalPropagationBulk {
    padding: 8px;
    align-items: center;
  }

  #modalPropagationBulk .wf-prop-modal {
    width: min(100vw - 12px, 760px);
    max-width: min(100vw - 12px, 760px);
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
  }

  #modalPropagationBulk .wf-modal-header {
    padding: 12px 14px;
  }

  #modalPropagationBulk .wf-modal-title {
    font-size: 16px;
    line-height: 1.15;
  }

  #modalPropagationBulk .wf-modal-body {
    padding: 12px 14px;
    overflow: auto;
  }

  #modalPropagationBulk .wf-prop-bulk-upload,
  #modalPropagationBulk .wf-prop-bulk-map {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #modalPropagationBulk .wf-prop-bulk-map .wf-field {
    padding: 9px;
  }

  #modalPropagationBulk .wf-field-label {
    font-size: 11px;
  }

  #modalPropagationBulk .wf-input,
  #modalPropagationBulk .wf-select {
    min-height: 40px;
    font-size: 13px;
  }

  #modalPropagationBulk .wf-modal-footer {
    padding: 10px 12px;
    gap: 8px;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  #modalPropagationBulk .wf-modal-footer .wf-action-btn {
    flex: 1 1 100%;
    min-height: 40px;
    justify-content: center;
  }
}

/* Mobile header layout v3 */
@media (max-width: 700px) {
  :root {
    --nav-h: 168px;
  }

  .wf-nav {
    height: var(--nav-h);
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    align-items: center;
    justify-items: center;
    justify-content: initial;
  }

  .wf-nav-left,
  .wf-nav-right {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0 auto;
    justify-self: stretch;
  }

  .wf-nav-left {
    display: block;
  }

  .wf-brand {
    display: grid;
    grid-template-columns: max-content auto;
    grid-template-areas:
      "title toggle"
      "meta toggle"
      "version toggle";
    align-items: center;
    justify-items: start;
    justify-content: space-between;
    text-align: left;
    column-gap: 10px;
    row-gap: 2px;
    width: 100%;
    max-width: none;
  }

  .wf-brand-title {
    grid-area: title;
    font-size: 26px;
    line-height: 1;
    letter-spacing: 1px;
    font-weight: 900;
    justify-self: start;
  }

  .wf-brand-home-link {
    grid-area: title / title / meta / meta;
    align-items: flex-start;
  }

  .wf-brand-meta {
    grid-area: meta;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: center;
  }

  .wf-brand .wf-app-version {
    grid-area: version;
    justify-self: center;
    margin-top: 1px;
    font-size: 9.5px;
    padding: 2px 8px;
    min-height: 0;
  }

  .wf-brand-tag {
    grid-area: auto;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.95px;
    font-weight: 800;
    opacity: 0.95;
    justify-self: center;
  }

  .wf-brand-version {
    grid-area: auto;
    font-size: 8.8px;
    padding: 2px 7px;
    margin-top: 0;
    justify-self: auto;
    border: 1px solid rgba(126, 198, 255, 0.28);
    background: rgba(37, 89, 139, 0.2);
    color: rgba(191, 227, 255, 0.94);
    border-radius: 999px;
    letter-spacing: 0.28px;
    font-family: 'DM Mono', monospace;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }

  #mobileSidebarToggle {
    grid-area: toggle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    align-self: center;
    margin: 0;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
    border: 1px solid rgba(126, 198, 255, 0.32);
    background: linear-gradient(180deg, rgba(32, 67, 107, 0.46), rgba(17, 37, 63, 0.42));
    color: #e9f4ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 10px rgba(6, 16, 30, 0.28);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  }

  #mobileSidebarToggle:hover {
    border-color: rgba(147, 209, 255, 0.48);
    background: linear-gradient(180deg, rgba(38, 81, 129, 0.56), rgba(20, 46, 80, 0.5));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 6px 14px rgba(6, 17, 32, 0.34);
  }

  #mobileSidebarToggle:active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 7px rgba(6, 17, 32, 0.26);
  }

  #mobileSidebarToggle:focus-visible {
    outline: none;
    border-color: rgba(167, 219, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(92, 173, 245, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  body.mobile-sidebar-open #mobileSidebarToggle {
    border-color: rgba(120, 228, 201, 0.58);
    background: linear-gradient(180deg, rgba(18, 112, 102, 0.42), rgba(14, 79, 74, 0.42));
    color: #e7fff8;
  }

  .wf-nav-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    gap: 8px;
    align-items: stretch;
    justify-items: stretch;
    margin-left: 0;
  }

  #btnOpenPropagationModal { grid-column: 1; grid-row: 1; }
  #btnOpenPropagationBulkModal { grid-column: 2; grid-row: 1; }
  #btnRefresh { grid-column: 1; grid-row: 2; }
  #btnClear { grid-column: 2; grid-row: 2; }
  #btnHelpTour { grid-column: 1 / span 2; grid-row: 3; }
  #topCellTotal { display: none !important; }
  #signalBadge { display: none !important; }

  .wf-nav-right .wf-action-btn,
  #topCellTotal,
  #signalBadge {
    width: 100%;
    min-height: 36px;
    height: 36px;
    padding: 6px 10px;
    border-radius: 11px;
    font-size: 11px;
    line-height: 1;
  }

  .wf-nav-right .wf-action-btn {
    justify-content: center;
    font-weight: 700;
  }

  #topCellTotal {
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.2px;
  }

  #signalBadge {
    justify-content: center;
    gap: 6px;
    font-weight: 700;
  }

  #topCellTotalValue {
    font-size: 12.5px;
    font-weight: 800;
  }
}
.wf-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 180000;
  background:
    radial-gradient(circle at 20% 16%, rgba(34, 211, 238, 0.12), transparent 44%),
    radial-gradient(circle at 82% 80%, rgba(251, 191, 36, 0.1), transparent 40%),
    rgba(3, 8, 20, 0.68);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.wf-tour-panel {
  position: fixed;
  z-index: 180002;
  width: min(520px, calc(100vw - 22px));
  background:
    linear-gradient(140deg, rgba(7, 19, 39, 0.985), rgba(9, 26, 53, 0.97)),
    radial-gradient(circle at right top, rgba(56, 189, 248, 0.2), transparent 42%);
  border: 1px solid rgba(125, 211, 252, 0.42);
  border-radius: 16px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.52);
  padding: 14px 14px 12px;
  color: #e8f1ff;
}

.wf-tour-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wf-tour-head {
  font: 600 11px/1.2 "DM Mono", monospace;
  letter-spacing: .35px;
  color: #88cbff;
  margin: 0;
}

.wf-tour-stepchip {
  border: 1px solid rgba(148, 197, 255, 0.48);
  border-radius: 999px;
  padding: 4px 9px;
  font: 700 11px/1 "DM Mono", monospace;
  color: #dcecff;
  background: rgba(27, 57, 94, 0.45);
}

.wf-tour-progress {
  margin-top: 8px;
  margin-bottom: 10px;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
  overflow: hidden;
}

.wf-tour-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
  transition: width .24s ease;
}

.wf-tour-title {
  margin: 0 0 6px;
  font: 800 17px/1.2 "Orbitron", "DM Sans", sans-serif;
  letter-spacing: 0.25px;
  color: #f2f7ff;
}

.wf-tour-text {
  margin: 0;
  color: #d1e0f7;
  font: 500 13px/1.5 "DM Sans", sans-serif;
}

.wf-tour-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.wf-tour-btn {
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 9px;
  background: rgba(8, 21, 43, 0.95);
  color: #dbe9ff;
  padding: 8px 11px;
  font: 700 12px/1 "DM Sans", sans-serif;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.wf-tour-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, 0.7);
  box-shadow: 0 8px 18px rgba(2, 10, 24, 0.34);
}

.wf-tour-btn-primary {
  background: linear-gradient(120deg, #06b6d4, #3b82f6);
  border-color: rgba(125, 211, 252, 0.8);
  color: #f7fbff;
}

.wf-tour-target {
  position: relative !important;
  z-index: 180001 !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.96), 0 0 0 8px rgba(34, 211, 238, 0.42), 0 0 20px rgba(59, 130, 246, 0.52) !important;
  border-radius: 10px;
  animation: wf-tour-target-pulse 1.35s ease-in-out infinite;
}

.wf-btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.92;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wf-btn-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  animation: wf-btn-spin .8s linear infinite;
  flex: 0 0 12px;
}

.wf-btn-loading-label {
  white-space: nowrap;
}

@keyframes wf-btn-spin {
  to { transform: rotate(360deg); }
}

@keyframes wf-tour-target-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.96), 0 0 0 8px rgba(34, 211, 238, 0.42), 0 0 18px rgba(59, 130, 246, 0.5); }
  50% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.96), 0 0 0 10px rgba(34, 211, 238, 0.28), 0 0 28px rgba(59, 130, 246, 0.62); }
}

@media (max-width: 700px) {
  .wf-tour-panel {
    width: calc(100vw - 18px);
    border-radius: 14px;
    padding: 12px;
  }

  .wf-tour-actions {
    gap: 6px;
  }

  .wf-tour-btn {
    font-size: 11px;
    padding: 8px 10px;
  }
}

/* GIS sidebar tabs */
.wf-sidebar-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 0 12px;
  margin-bottom: 10px;
  background:
    linear-gradient(180deg, rgba(9, 24, 46, 0.96), rgba(9, 24, 46, 0.86)),
    radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.12), transparent 40%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.wf-sidebar-tab {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(120, 145, 176, 0.46);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 39, 69, 0.88), rgba(12, 30, 54, 0.9));
  color: #c7d8ef;
  font: 800 12.5px/1 "DM Sans", sans-serif;
  letter-spacing: 0.22px;
  padding: 10px 6px;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .12s ease, box-shadow .16s ease;
}

.wf-sidebar-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  opacity: 0.5;
}

.wf-sidebar-tab:hover {
  border-color: rgba(191, 219, 254, 0.8);
  color: #f8fbff;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(3, 12, 27, 0.38);
}

.wf-sidebar-tab.active {
  color: #f7fbff;
  transform: translateY(-1px);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.18);
  box-shadow:
    0 10px 22px rgba(2, 12, 24, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.wf-sidebar-tab[data-sidebar-tab="consulta"] {
  border-color: rgba(96, 165, 250, 0.5);
}

.wf-sidebar-tab[data-sidebar-tab="consulta"]::after {
  background: linear-gradient(90deg, #60a5fa, #38bdf8);
}

.wf-sidebar-tab[data-sidebar-tab="consulta"].active {
  border-color: rgba(125, 211, 252, 0.92);
  background: linear-gradient(135deg, rgba(20, 69, 121, 0.96), rgba(16, 51, 92, 0.98));
}

.wf-sidebar-tab[data-sidebar-tab="cobertura"] {
  border-color: rgba(74, 222, 128, 0.5);
}

.wf-sidebar-tab[data-sidebar-tab="cobertura"]::after {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.wf-sidebar-tab[data-sidebar-tab="cobertura"].active {
  border-color: rgba(74, 222, 128, 0.95);
  background: linear-gradient(135deg, rgba(13, 86, 64, 0.96), rgba(13, 66, 52, 0.98));
}

.wf-sidebar-tab[data-sidebar-tab="lote"] {
  border-color: rgba(45, 212, 191, 0.5);
}

.wf-sidebar-tab[data-sidebar-tab="lote"]::after {
  background: linear-gradient(90deg, #2dd4bf, #22d3ee);
}

.wf-sidebar-tab[data-sidebar-tab="lote"].active {
  border-color: rgba(45, 212, 191, 0.95);
  background: linear-gradient(135deg, rgba(11, 83, 88, 0.96), rgba(10, 61, 77, 0.98));
}

.wf-sidebar-tab[data-sidebar-tab="exportar"] {
  border-color: rgba(251, 191, 36, 0.5);
}

.wf-sidebar-tab[data-sidebar-tab="exportar"]::after {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.wf-sidebar-tab[data-sidebar-tab="exportar"].active {
  border-color: rgba(251, 191, 36, 0.95);
  background: linear-gradient(135deg, rgba(106, 66, 13, 0.96), rgba(81, 49, 8, 0.98));
}

.wf-panel { display: block; }
.wf-panel.is-hidden { display: none !important; }

.wf-sidebar-scroll {
  display: block;
}

@media (min-width: 701px) {
  .wf-sidebar.wf-sidebar-compact {
    height: 100% !important;
    max-height: none;
    align-self: stretch;
    overflow: auto;
    border-radius: 8px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-scroll {
    max-height: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    padding: 8px;
  }

  .wf-sidebar.wf-sidebar-compact #wfSidebarSummary {
    display: block !important;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-smart {
    min-height: min(24vh, 200px);
  }

  .wf-sidebar.wf-sidebar-compact .wf-panel,
  .wf-sidebar.wf-sidebar-compact .wf-sidebar-smart,
  .wf-sidebar.wf-sidebar-compact #wfSidebarSummary {
    margin: 0;
    position: static !important;
    transform: none !important;
  }

  .wf-sidebar.wf-sidebar-compact .wf-section {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    position: relative;
    z-index: 1;
    border-radius: 8px;
    padding: 8px;
    box-shadow: none;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-tabs {
    gap: 4px;
    padding: 4px 0 6px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-tab {
    border-radius: 8px;
    padding: 6px 5px;
    font-size: 11px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-action-btn,
  .wf-sidebar.wf-sidebar-compact .wf-export-btn,
  .wf-sidebar.wf-sidebar-compact .wf-input,
  .wf-sidebar.wf-sidebar-compact .wf-select,
  .wf-sidebar.wf-sidebar-compact .wf-coverage-summary,
  .wf-sidebar.wf-sidebar-compact .wf-batch-item,
  .wf-sidebar.wf-sidebar-compact .wf-batch-empty,
  .wf-sidebar.wf-sidebar-compact .wf-sidebar-smart {
    border-radius: 8px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-section-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-section-title {
    font-size: 14px;
    letter-spacing: 0.4px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-field {
    gap: 4px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-field-label {
    font-size: 9px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-input,
  .wf-sidebar.wf-sidebar-compact .wf-select {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-action-btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-export-btn {
    gap: 3px;
    padding: 8px 6px;
    min-height: 56px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-export-label {
    font-size: 12px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-export-tag {
    font-size: 10px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-coverage-summary {
    padding: 8px;
    gap: 3px;
    font-size: 10px;
    max-height: 220px;
    overflow: auto;
    min-width: 0;
  }

  .wf-sidebar.wf-sidebar-compact .wf-section-coverage {
    overflow: hidden !important;
    min-height: 540px !important;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-summary,
  .wf-sidebar.wf-sidebar-compact .wf-sidebar-smart {
    padding: 8px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-summary-head,
  .wf-sidebar.wf-sidebar-compact .wf-smart-head {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-summary-grid,
  .wf-sidebar.wf-sidebar-compact .wf-smart-grid {
    gap: 6px;
    margin-top: 6px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-summary-kpi,
  .wf-sidebar.wf-sidebar-compact .wf-smart-chip {
    padding: 6px 7px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-summary-kpi-label {
    font-size: 9px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-summary-kpi-val {
    font-size: 12px;
    margin-top: 3px;
  }

  .wf-sidebar.wf-sidebar-compact .wf-sidebar-summary-last,
  .wf-sidebar.wf-sidebar-compact .wf-smart-sub,
  .wf-sidebar.wf-sidebar-compact .wf-smart-log-item {
    font-size: 10px;
    line-height: 1.3;
  }
}

.wf-sidebar-summary {
  margin-top: 10px;
  border: 1px solid rgba(120, 145, 176, 0.36);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(12, 28, 52, 0.9), rgba(10, 24, 45, 0.9));
  padding: 10px;
}

.wf-sidebar-summary-head {
  margin: 0 0 8px;
  color: #e8f2ff;
  font: 800 12px/1.2 "DM Sans", sans-serif;
  letter-spacing: 0.2px;
}

.wf-sidebar-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.wf-sidebar-summary-kpi {
  border: 1px solid rgba(99, 131, 171, 0.35);
  border-radius: 9px;
  padding: 7px 8px;
  background: rgba(17, 40, 71, 0.72);
}

.wf-sidebar-summary-kpi-label {
  color: #8fb1dc;
  font: 600 10px/1 "DM Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.wf-sidebar-summary-kpi-val {
  margin-top: 4px;
  color: #f1f7ff;
  font: 800 14px/1.1 "DM Sans", sans-serif;
}

.wf-sidebar-summary-meta {
  margin-top: 8px;
  color: #a8bfdc;
  font: 500 11px/1.4 "DM Sans", sans-serif;
}

.wf-sidebar-summary-last {
  margin-top: 6px;
  border-top: 1px solid rgba(118, 149, 189, 0.25);
  padding-top: 6px;
  color: #c5d8f4;
  font: 600 11px/1.4 "DM Sans", sans-serif;
}

.wf-sidebar-smart {
  margin-top: 10px;
  border: 1px solid rgba(118, 149, 189, 0.34);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 10%, rgba(34, 211, 238, 0.08), transparent 42%),
    linear-gradient(160deg, rgba(8, 20, 39, 0.9), rgba(7, 18, 35, 0.92));
  padding: 10px;
}

.wf-smart-head {
  margin: 0;
  color: #e8f2ff;
  font: 800 12px/1.2 "DM Sans", sans-serif;
}

.wf-smart-sub {
  margin: 6px 0 0;
  color: #9fb9dd;
  font: 500 11px/1.4 "DM Sans", sans-serif;
}

.wf-smart-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.wf-smart-chip {
  border: 1px solid rgba(100, 129, 165, 0.35);
  border-radius: 9px;
  background: rgba(14, 33, 58, 0.68);
  color: #cfe1fb;
  font: 700 11px/1 "DM Sans", sans-serif;
  padding: 8px;
  text-align: center;
}

.wf-smart-log {
  margin-top: 8px;
  border-top: 1px solid rgba(112, 143, 181, 0.24);
  padding-top: 8px;
  display: grid;
  gap: 5px;
}

.wf-smart-log-item {
  color: #b6cbe9;
  font: 500 10.5px/1.35 "DM Mono", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Altura responsive real por contenido (sin espacios vacios forzados) */
.wf-panel-cobertura,
.wf-panel-lote,
.wf-panel-exportar {
  min-height: 0;
}

.wf-panel-lote .wf-batch-list {
  max-height: min(42vh, 360px);
}

/* Alinear sidebar y mapa hasta el mismo borde inferior */
@media (min-width: 701px) {
  .wf-layout {
    height: calc(100vh - var(--nav-h)) !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .wf-sidebar,
  .wf-main {
    height: 100% !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
  }

  .wf-map {
    border-radius: 0 !important;
  }
}

@media (max-width: 700px) {
  .wf-sidebar-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding-top: 6px;
  }

  .wf-panel-lote .wf-batch-list {
    max-height: min(34vh, 240px);
  }
}

/* Mobile final override: organized from scratch */
@media (max-width: 700px) {
  :root { --nav-h: 166px; }

  .wf-nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-h) !important;
    padding: 8px 10px !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
    gap: 6px !important;
    align-items: start !important;
  }

  .wf-nav-left,
  .wf-nav-right {
    width: 100% !important;
    margin: 0 !important;
  }

  .wf-nav-left {
    display: block !important;
  }

  .wf-nav-divider,
  .wf-nav-meta,
  #topCellTotal,
  #signalBadge {
    display: none !important;
  }

  .wf-brand {
    position: relative !important;
    width: 100% !important;
    min-height: 46px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding-right: 150px !important;
  }

  .wf-brand-title {
    font-size: 14px !important;
    line-height: 1 !important;
    letter-spacing: 1px !important;
  }

  .wf-brand-tag {
    font-size: 9px !important;
    letter-spacing: 0.8px !important;
  }

  .wf-app-version {
    font-size: 9px !important;
    margin-top: 2px !important;
  }

  #btnHelpTour,
  #mobileSidebarToggle {
    position: absolute !important;
    top: 7px !important;
    transform: none !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    z-index: 3 !important;
  }

  #mobileSidebarToggle {
    right: 0 !important;
    min-width: 68px !important;
  }

  #btnHelpTour {
    right: 74px !important;
    width: 66px !important;
    border-color: rgba(125, 211, 252, 0.45) !important;
    background: linear-gradient(180deg, rgba(22, 49, 83, 0.92), rgba(15, 35, 62, 0.94)) !important;
    color: #dff1ff !important;
  }

  .wf-nav-right {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    align-items: stretch !important;
    margin-top: 0 !important;
  }

  .wf-nav-right .wf-action-btn {
    width: 100% !important;
    height: 33px !important;
    min-height: 33px !important;
    padding: 0 8px !important;
    border-radius: 9px !important;
    font-size: 10.5px !important;
    justify-content: center !important;
  }

  .wf-layout {
    margin-top: var(--nav-h) !important;
    height: calc(100vh - var(--nav-h)) !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .wf-main {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .wf-map-tools {
    position: static !important;
    order: 1 !important;
    width: 100% !important;
    padding: 6px 10px 6px !important;
    display: flex !important;
    justify-content: center !important;
    z-index: auto !important;
  }

  .wf-map-search {
    width: 100% !important;
    grid-template-columns: 1fr auto !important;
    gap: 6px !important;
    align-items: center !important;
  }

  #btnStreetView {
    display: none !important;
  }

  .wf-map-query-input {
    min-width: 0 !important;
    height: 34px !important;
    font-size: 11.5px !important;
  }

  .wf-map {
    order: 3 !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .wf-map-geo-fab {
    position: static !important;
    order: 2 !important;
    align-self: center !important;
    margin: 0 0 4px !important;
    height: 32px !important;
    min-height: 32px !important;
    width: auto !important;
    min-width: 0 !important;
    padding-inline: 10px !important;
    border-radius: 9px !important;
    left: auto !important;
    bottom: auto !important;
  }
}

/* Mobile fallback: disable the custom mobile chrome */
@media (max-width: 700px) {
  :root { --nav-h: 166px !important; }

  .wf-nav {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    height: var(--nav-h) !important;
    padding: 10px 10px 8px !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
    gap: 8px !important;
    align-items: stretch !important;
    background:
      linear-gradient(180deg, rgba(7, 13, 28, 0.98), rgba(8, 17, 33, 0.96)) !important;
    border-bottom: 1px solid rgba(126, 198, 255, 0.14) !important;
  }

  .wf-nav-left,
  .wf-nav-right {
    width: 100% !important;
    margin: 0 !important;
  }

  .wf-nav-left {
    display: block !important;
  }

  .wf-nav-divider,
  .wf-nav-meta,
  #topCellTotal,
  #signalBadge {
    display: none !important;
  }

  .wf-brand {
    position: relative !important;
    min-height: 48px !important;
    padding-right: 154px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
  }

  .wf-brand-title {
    font-size: 16px !important;
    letter-spacing: 1.1px !important;
    line-height: 1 !important;
  }

  .wf-brand-meta {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .wf-brand-tag {
    font-size: 9px !important;
    letter-spacing: 1px !important;
    line-height: 1.1 !important;
    align-self: center !important;
    margin-left: 0 !important;
    transform: translateX(-6px) !important;
  }

  .wf-app-version {
    margin-top: 3px !important;
    font-size: 9px !important;
    padding: 2px 8px !important;
  }

  #mobileSidebarToggle {
    display: inline-flex !important;
    position: absolute !important;
    top: 16px !important;
    right: 0 !important;
    transform: none !important;
    min-width: 70px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    justify-content: center !important;
  }

  #btnHelpTour {
    display: none !important;
    position: absolute !important;
    top: 16px !important;
    right: 78px !important;
    transform: none !important;
    min-width: 68px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    justify-content: center !important;
    border-color: rgba(123, 176, 239, 0.34) !important;
    background: rgba(18, 38, 67, 0.88) !important;
    color: #d8eaff !important;
    z-index: 5 !important;
  }

  .wf-nav-right {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    align-items: stretch !important;
  }

  .wf-nav-right .wf-action-btn {
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 10px !important;
    font-size: 10.5px !important;
    border-radius: 10px !important;
    justify-content: center !important;
  }

  .wf-layout {
    margin-top: var(--nav-h) !important;
    height: calc(100vh - var(--nav-h)) !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .wf-sidebar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: min(92vw, 360px) !important;
    height: 100% !important;
    border-radius: 0 14px 14px 0 !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.46) !important;
  }

  .wf-main {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: 100% !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .wf-map-tools {
    position: static !important;
    order: 1 !important;
    width: 100% !important;
    padding: 8px 10px 6px !important;
    display: flex !important;
    justify-content: center !important;
    z-index: auto !important;
  }

  .wf-map-search {
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: 1fr auto !important;
    gap: 6px !important;
    align-items: center !important;
  }

  .wf-map-query-input {
    min-width: 0 !important;
    height: 36px !important;
    font-size: 11.5px !important;
    padding-inline: 12px !important;
  }

  #btnMapSearch {
    height: 36px !important;
    min-height: 36px !important;
    padding-inline: 12px !important;
  }

  #btnStreetView {
    display: none !important;
  }

  .wf-map {
    order: 2 !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .wf-map-geo-fab {
    position: absolute !important;
    left: 12px !important;
    top: auto !important;
    bottom: 62px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    justify-content: center !important;
    gap: 0 !important;
    font-size: 0 !important;
    border-radius: 12px !important;
  }

  .wf-sidebar-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
}

@media (min-width: 701px) {
  .wf-main,
  .wf-map {
    border: none !important;
    box-shadow: none !important;
  }
}
