/* =========================================================================
   FlexRoute PRO — Estética Cyberpunk DoorDash Mobile-First
   Paleta: #090B0E (Negro Inmersivo) | #12161F (Grafito Translúcido)
   Acentos: #0099FF (Azul Eléctrico) | #22FF88 (Verde Neón) | #D37900 (Amazon Naranja)
   ========================================================================= */

:root {
  --bg-app: #090B0E;
  --bg-deep: #050608;
  --card-bg: #12161F;
  --card-bg-elevated: #161C27;
  --card-gradient: linear-gradient(135deg, rgba(22, 27, 38, 0.95) 0%, rgba(15, 18, 26, 0.98) 100%);
  --border-subtle: 1px solid rgba(255, 255, 255, 0.05);
  --border-active: 1px solid rgba(0, 153, 255, 0.45);
  --border-neon: 1px solid rgba(34, 255, 136, 0.45);

  --electric-blue: #0099FF;
  --electric-blue-glow: rgba(0, 153, 255, 0.35);
  --neon-green: #22FF88;
  --neon-green-glow: rgba(34, 255, 136, 0.35);
  --amazon-orange: #D37900;
  --amazon-orange-glow: rgba(211, 121, 0, 0.35);
  --danger-red: #FF3B4E;

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.42);

  --radius-pill: 999px;
  --radius-card: 16px;
  --radius-sm: 10px;

  --topbar-height: 56px;
  --bottom-nav-height: 64px;
  --app-max-width: 480px;
}

/* =========================================================================
   RESET GLOBAL Y BASE TIPOGRÁFICA
   ========================================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea {
  user-select: text;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================================
   SHELL DE APLICACIÓN MÓVIL
   ========================================================================= */
.app-shell {
  width: 100%;
  max-width: var(--app-max-width);
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* =========================================================================
   HEADER SUPERIOR TRANSPARENTE
   ========================================================================= */
.topbar {
  flex: none;
  height: var(--topbar-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 11, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: var(--border-subtle);
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #FFFFFF;
}

.logo-text-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.logo-name {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.logo-pro {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--electric-blue);
  color: #FFFFFF;
  box-shadow: 0 0 10px var(--electric-blue-glow);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 138, 31, 0.1);
  border: 1px solid rgba(255, 138, 31, 0.35);
  box-shadow: 0 0 12px rgba(255, 138, 31, 0.15);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amazon-orange);
  box-shadow: 0 0 8px var(--amazon-orange);
  animation: pulseNeon 1.8s infinite ease-in-out;
}

@keyframes pulseNeon {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.plan-badge-text {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #FF8A1F;
}

.top-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}

.top-btn:active {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.top-btn svg {
  width: 18px;
  height: 18px;
}

/* =========================================================================
   MAIN APP BODY & VISTAS
   ========================================================================= */
.app-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.view.active {
  display: flex;
}

.view-header {
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--electric-blue);
}

.view-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #FFFFFF;
}

.view-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
}

/* =========================================================================
   COMPONENTES DE TARJETA
   ========================================================================= */
.card {
  background: var(--card-bg);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* =========================================================================
   PESTAÑA 1: CAPTURE
   ========================================================================= */
#view-capture {
  padding: 0 0 20px 0;
}

.dropzone-card {
  margin: 8px 16px 14px;
  position: relative;
  overflow: hidden;
  background: var(--card-gradient);
  border: 1px dashed rgba(0, 153, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 18px;
  gap: 10px;
}

.dropzone-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 80px;
  background: var(--electric-blue-glow);
  filter: blur(40px);
  pointer-events: none;
}

.dropzone-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 153, 255, 0.12);
  border: 1px solid rgba(0, 153, 255, 0.3);
  display: grid;
  place-items: center;
  color: var(--electric-blue);
  box-shadow: 0 0 16px var(--electric-blue-glow);
}

.dropzone-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.dz-head {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.dz-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--electric-blue);
  color: #FFFFFF;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--electric-blue-glow);
  transition: transform 0.15s, background-color 0.15s;
}

.btn-select:active {
  transform: scale(0.97);
  background: #0088e6;
}

.btn-primary-action {
  margin: 0 16px 14px;
  padding: 15px;
  border: none;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #0099FF 0%, #0066CC 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--electric-blue-glow);
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary-action:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary-action:disabled {
  opacity: 0.35;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-primary-action svg {
  width: 18px;
  height: 18px;
}

.demo-preset-card {
  margin: 0 16px;
  background: var(--card-gradient);
}

.card-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.badge-mini {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--neon-green);
  text-transform: uppercase;
}

.btn-link-action {
  background: transparent;
  border: none;
  color: var(--electric-blue);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.preset-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.preset-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* =========================================================================
   PESTAÑA 2: PANTALLA UNIFICADA "MAP"
   Mitad Sup Fija (Mapa) + Centro (Métricas) + Mitad Inf Scroll (Entregas)
   ========================================================================= */
#view-map {
  padding: 0;
  overflow: hidden;
  height: 100%;
  display: none;
  flex-direction: column;
}

#view-map.active {
  display: flex;
}

/* Toolbar de controles superiores del mapa */
.map-toolbar {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(18, 22, 31, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: var(--border-subtle);
  position: relative;
  z-index: 50;
}

.layer-selector {
  display: flex;
  gap: 6px;
}

.btn-toggle {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 7px 4px;
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-toggle.active {
  color: #04120A;
  background: var(--neon-green);
  border-color: var(--neon-green);
  box-shadow: 0 0 12px var(--neon-green-glow);
}

.map-quick-switches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.chip-toggle.active {
  background: rgba(0, 153, 255, 0.18);
  color: #FFFFFF;
  border-color: var(--electric-blue);
  box-shadow: 0 0 12px var(--electric-blue-glow);
}

.chip-toggle svg {
  width: 14px;
  height: 14px;
  color: var(--electric-blue);
}

/* MITAD SUPERIOR: CONTENEDOR DEL MAPA (FIJO ~40% DE PANTALLA) */
.map-viewport-wrapper {
  flex: 0 0 40%;
  min-height: 220px;
  max-height: 44%;
  position: relative;
  width: 100%;
  background: var(--bg-app);
  z-index: 1;
}

.map-container,
#map {
  width: 100%;
  height: 100%;
  background: #090B0E;
  position: relative;
  z-index: 1;
}

/* HUD FLOTANTE SOBRE EL MAPA */
.map-hud-legend {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 500;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.hud-chip {
  background: rgba(15, 18, 26, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.hud-line {
  display: inline-block;
  width: 12px;
  height: 0;
}

.hud-line.line-blue {
  border-top: 3px solid var(--electric-blue);
  box-shadow: 0 0 6px var(--electric-blue-glow);
}

.hud-line.line-orange-dashed {
  border-top: 3px dashed var(--amazon-orange);
}

/* PINES PERSONALIZADOS EN LEAFLET */
.custom-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0F121A;
  border: 2px solid var(--electric-blue);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.76rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.85);
}

.custom-pin.warehouse {
  background: var(--neon-green);
  border-color: var(--neon-green);
  color: #04120A;
  box-shadow: 0 0 14px var(--neon-green-glow);
}

.custom-pin.next-stop {
  border-color: var(--neon-green);
  box-shadow: 0 0 12px var(--neon-green);
}

/* POPUPS DE LEAFLET EN TEMA CYBERPUNK */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: #12161F !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75) !important;
}

.leaflet-popup-content {
  font-family: 'Outfit', sans-serif !important;
  margin: 10px 12px !important;
  line-height: 1.35 !important;
}

/* CENTRO: BANNER DE MÉTRICAS OUTFIT */
.metrics-banner {
  flex: none;
  background: var(--card-bg);
  border-top: var(--border-subtle);
  border-bottom: var(--border-subtle);
  padding: 8px 14px;
  z-index: 20;
}

.banner-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.banner-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.banner-counter {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--electric-blue);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.metric-cell {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.m-label {
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.m-val-group {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.m-val {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.m-val.highlight {
  color: var(--neon-green);
}

.m-unit {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--electric-blue);
}

.m-diff {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--neon-green);
  margin-top: 2px;
}

.text-neon {
  color: var(--neon-green) !important;
}

/* MITAD INFERIOR: LISTA SCROLLABLE DE ENTREGAS */
.deliveries-scroll-pane {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* BLOQUE DE NAVEGACIÓN EN GOOGLE MAPS */
.gmaps-batch-card {
  padding: 10px 12px;
  background: var(--card-gradient);
}

.gmaps-batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gmaps-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gmaps-icon {
  width: 15px;
  height: 15px;
  color: var(--electric-blue);
}

.gmaps-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFFFFF;
}

.gmaps-tag {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(0, 153, 255, 0.15);
  color: var(--electric-blue);
}

.gmaps-btn-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-gmaps-batch {
  flex: 1 1 calc(50% - 3px);
  background: linear-gradient(135deg, #0099FF, #0066CC);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--electric-blue-glow);
  text-align: center;
}

.btn-gmaps-batch:active {
  transform: scale(0.97);
}

/* ENCABEZADO DE SECUENCIA */
.sequence-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}

.seq-title-group {
  display: flex;
  flex-direction: column;
}

.seq-main-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #FFFFFF;
}

.seq-sub-title {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.btn-mini-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-mini-reset svg {
  width: 12px;
  height: 12px;
}

/* LISTA DE PARADAS */
.stops-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* TARJETA DE PARADA SECUENCIAL */
.stop-card {
  background: var(--card-gradient);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s;
}

.stop-card.is-warehouse {
  border-left: 3px solid var(--neon-green);
  background: linear-gradient(135deg, rgba(34, 255, 136, 0.06) 0%, rgba(15, 18, 26, 0.98) 100%);
}

.stop-card.is-next {
  border-color: rgba(34, 255, 136, 0.45);
  box-shadow: 0 4px 18px rgba(34, 255, 136, 0.12);
}

.stop-card.is-completed {
  opacity: 0.55;
}

.stop-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stop-number-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stop-badge-num {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.stop-card.is-warehouse .stop-badge-num {
  color: var(--neon-green);
}

.stop-amazon-orig-tag {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stop-amazon-orig-tag b {
  color: #FF8A1F;
}

/* BOTÓN DE LÁPIZ DE EDICIÓN MANUAL */
.btn-pencil-edit {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pencil-edit:active {
  color: #FFFFFF;
  background: var(--electric-blue);
  border-color: var(--electric-blue);
}

.btn-pencil-edit svg {
  width: 14px;
  height: 14px;
}

/* ÁREA DE DIRECCIÓN Y EDICIÓN INLINE */
.stop-address-box {
  width: 100%;
}

.stop-address-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.35;
  word-break: break-word;
}

.stop-address-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* MODO DE EDICIÓN ACTIVO CON INPUT Y BOTÓN DE VERIFICACIÓN CHECK */
.inline-edit-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.inline-edit-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--electric-blue);
  border-radius: 8px;
  padding: 8px 10px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  box-shadow: 0 0 10px var(--electric-blue-glow);
}

.btn-check-verify {
  width: 32px;
  height: 32px;
  background: var(--neon-green);
  border: none;
  border-radius: 8px;
  color: #04120A;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 12px var(--neon-green-glow);
}

.btn-check-verify svg {
  width: 16px;
  height: 16px;
}

.btn-cancel-edit {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.btn-cancel-edit svg {
  width: 14px;
  height: 14px;
}

/* PIE DE TARJETA */
.stop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.stop-status-badge {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.stop-actions-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stop-check-delivered {
  width: 18px;
  height: 18px;
  accent-color: var(--neon-green);
  cursor: pointer;
}

.btn-delete-stop {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-delete-stop:active {
  color: var(--danger-red);
}

/* =========================================================================
   PESTAÑA 3: PLANS
   ========================================================================= */
#view-plans {
  padding: 0 0 24px 0;
}

.plan-save-card {
  margin: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.plan-input-row {
  display: flex;
  gap: 8px;
}

.cyber-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
}

.cyber-input:focus {
  border-color: var(--electric-blue);
  box-shadow: 0 0 10px var(--electric-blue-glow);
}

.btn-action-pill {
  background: var(--electric-blue);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.plans-list-wrapper {
  padding: 0 16px;
}

.plans-section-sub {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.plans-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-item-card {
  background: var(--card-gradient);
  border: var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.plan-info span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.plan-actions-group {
  display: flex;
  gap: 6px;
}

.btn-plan-load {
  background: rgba(0, 153, 255, 0.15);
  border: 1px solid var(--electric-blue);
  color: var(--electric-blue);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-plan-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px;
  cursor: pointer;
}

.btn-plan-del:active {
  color: var(--danger-red);
}

/* =========================================================================
   BARRA DE NAVEGACIÓN INFERIOR (SOLO 3 PESTAÑAS: CAPTURE, MAP, PLANS)
   ========================================================================= */
.bottom-nav {
  flex: none;
  height: var(--bottom-nav-height);
  background: rgba(9, 11, 14, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 100;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.nav-icon-wrap svg {
  width: 22px;
  height: 22px;
  transition: transform 0.15s ease, stroke 0.15s ease;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-item.active {
  color: var(--electric-blue);
}

.nav-item.active .nav-icon-wrap svg {
  stroke: var(--electric-blue);
  filter: drop-shadow(0 0 8px var(--electric-blue-glow));
  transform: translateY(-1px);
}

/* =========================================================================
   PANTALLA DE CARGA CYBERPUNK (LOADING SCREEN / SPINNER)
   ========================================================================= */
.loading-screen {
  position: absolute;
  inset: 0;
  background: rgba(9, 11, 14, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: grid;
  place-items: center;
  transition: opacity 0.25s ease;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none !important;
  display: none !important;
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.cyber-spinner {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(0, 153, 255, 0.15);
  border-top-color: var(--electric-blue);
  border-radius: 50%;
  animation: cyberSpin 1s linear infinite;
  box-shadow: 0 0 16px var(--electric-blue-glow);
}

@keyframes cyberSpin {
  100% { transform: rotate(360deg); }
}

.spinner-core {
  font-size: 1.2rem;
  font-weight: 800;
  color: #FFFFFF;
}

.loading-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

.loading-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.loading-bar {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 4px;
}

.loading-progress {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--electric-blue), var(--neon-green));
  border-radius: var(--radius-pill);
  animation: barProgress 1.6s infinite ease-in-out;
}

@keyframes barProgress {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(50%); }
  100% { transform: translateX(250%); }
}

/* =========================================================================
   NOTIFICACIÓN TOAST
   ========================================================================= */
.toast {
  position: absolute;
  bottom: calc(var(--bottom-nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 22, 31, 0.96);
  border: 1px solid rgba(0, 153, 255, 0.4);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1500;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
