/* ==========================================================================
   CHUYAY RIOBAMBA - STITCH DESIGN SYSTEM: "CIVIC GIS COMMAND"
   Plataforma de Monitoreo Urbano y Gestión de Residuos
   GAD Municipal de Riobamba · Dirección de Gestión Ambiental & TICs
   Versión Responsiva Adaptativa: 2K/UltraWide Web + Smartphone Móvil
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Stitch Design System: Civic GIS Command Palette */
  --navy-950: #050d25;
  --navy-900: #0a122a;
  --navy-850: #0d1633;
  --navy-800: #131a33;
  --navy-700: #1c2541;
  --navy-600: #243256;
  --navy-500: #313852;

  /* Civic Energy & Primary Accents */
  --brand-orange: #f97316;
  --brand-orange-dark: #ea580c;
  --brand-orange-deep: #c2410c;
  --brand-orange-glow: rgba(249, 115, 22, 0.38);

  /* Operational GIS Status Matrix */
  --status-green: #10b981;
  --status-green-glow: rgba(16, 185, 129, 0.45);
  --status-orange: #f59e0b;
  --status-orange-glow: rgba(245, 158, 11, 0.4);
  --status-blue: #38bdf8;
  --status-blue-glow: rgba(56, 189, 248, 0.45);
  --status-red: #ef4444;
  --status-red-glow: rgba(239, 68, 68, 0.45);

  /* Neutral Light Surfaces (Default Mode) */
  --bg-page: #f8fafc;
  --surface-card: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --surface-subtle: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-focus: #cbd5e1;

  /* Typography */
  --text-title: #0a122a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-white: #ffffff;

  /* Shadows & Depth */
  --glass-shadow: 0 12px 34px -6px rgba(10, 18, 42, 0.12), 0 4px 8px -2px rgba(10, 18, 42, 0.05);
  --elevated-shadow: 0 24px 48px -12px rgba(10, 18, 42, 0.22);
  --card-shadow: 0 3px 10px rgba(10, 18, 42, 0.07);

  /* Corner Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

[data-theme="dark"] {
  --bg-page: #050d25;
  --surface-card: #0a122a;
  --surface-glass: rgba(10, 18, 42, 0.92);
  --surface-subtle: #131a33;
  --border-subtle: #1c2541;
  --border-focus: #243256;
  --text-title: #f8fafc;
  --text-body: #dbe1ff;
  --text-muted: #8e9bb5;
  --glass-shadow: 0 14px 40px -6px rgba(0, 0, 0, 0.7);
  --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   MASTER ADAPTIVE LAYOUT
   Diseñado para expandirse elegantemente en monitores 2K/4K sin verse pequeño
   ========================================================================== */
.gov-layout {
  width: 100%;
  max-width: 2500px;
  margin: 0 auto;
  padding: 14px 28px 28px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ==========================================================================
   TOP EXECUTIVE NAVBAR (CIVIC GIS HEADER)
   ========================================================================== */
.gov-navbar {
  background: linear-gradient(135deg, var(--navy-900) 0%, #060e22 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--elevated-shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  position: relative;
  z-index: 2000;
}

.gov-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gov-seal-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-dark) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--brand-orange-glow);
  color: #fff;
  flex-shrink: 0;
}

.gov-seal-badge svg {
  width: 26px;
  height: 26px;
}

.gov-brand-titles h1 {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: #fff;
  line-height: 1.15;
}

.gov-brand-titles h1 span {
  color: var(--brand-orange);
}

.gov-brand-titles p {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Conmutador Central de Vistas */
.nav-segmented {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px;
  border-radius: var(--radius-md);
  gap: 5px;
}

.nav-seg-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.nav-seg-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.nav-seg-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-seg-btn.active {
  background: #ffffff;
  color: var(--navy-900);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Herramientas de Cabecera */
.gov-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tool-chip-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s;
}

.tool-chip-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   VISTA 1: VECINO (MAP-CENTRIC GIS COMMAND)
   ========================================================================== */
.view-container {
  display: none;
}

.view-container.active {
  display: block;
}

.map-layout-grid {
  display: grid;
  grid-template-columns: minmax(420px, 460px) 1fr;
  gap: 22px;
  align-items: stretch;
}

/* Handle ergonómico para versión móvil (oculto en desktop) */
.mobile-sheet-handle {
  display: none;
  width: 44px;
  height: 5px;
  background: var(--border-focus);
  border-radius: 3px;
  margin: 0 auto 12px auto;
  cursor: grab;
}

/* Panel Lateral de Telemetría */
.panel-drawer {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Banner de KPIs y Estado en Vivo */
.kpi-banner-card {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--glass-shadow);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.kpi-banner-card h3 {
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1.25;
  margin-bottom: 5px;
}

.kpi-banner-card p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 18px;
}

.kpi-three-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.kpi-mini-stat .num {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.1;
  font-feature-settings: "tnum" 1;
}

.kpi-mini-stat .desc {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Buscador Inteligente */
.search-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  height: 52px;
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 18px 0 46px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-title);
  box-shadow: var(--card-shadow);
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 4px var(--brand-orange-glow);
}

.search-icon-svg {
  position: absolute;
  left: 16px;
  top: 16px;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
}

/* Ficha de Inspección del Contenedor Seleccionado */
.container-detail-card {
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.container-code-text {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--navy-900);
  line-height: 1.2;
}

[data-theme="dark"] .container-code-text {
  color: #f8fafc;
}

.container-address-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.green {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1.5px solid rgba(16, 185, 129, 0.35);
}

.status-badge.orange {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1.5px solid rgba(245, 158, 11, 0.35);
}

.status-badge.red {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1.5px solid rgba(239, 68, 68, 0.35);
}

.status-badge.blue {
  background: rgba(56, 189, 248, 0.15);
  color: #0284c7;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
}

[data-theme="dark"] .status-badge.green { color: #34d399; }
[data-theme="dark"] .status-badge.orange { color: #fbbf24; }
[data-theme="dark"] .status-badge.red { color: #f87171; }
[data-theme="dark"] .status-badge.blue { color: #38bdf8; }

.details-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--surface-subtle);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.spec-item .label {
  display: block;
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.spec-item .value {
  font-size: 0.94rem;
  font-weight: 850;
  color: var(--text-title);
  margin-top: 3px;
  font-feature-settings: "tnum" 1;
}

/* Botones de Acción Primaria */
.btn-primary-action {
  width: 100%;
  min-height: 50px;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-deep) 100%);
  color: #ffffff;
  border: none;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 850;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 4px 16px var(--brand-orange-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.48);
}

.btn-primary-action:active {
  transform: translateY(1px);
}

.btn-secondary-action {
  min-height: 48px;
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-title);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s;
}

.btn-secondary-action:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  background: var(--surface-subtle);
}

/* ==========================================================================
   MAP VIEW CANVAS & FLOATING GIS HUD
   ========================================================================== */
.map-canvas-container {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-floating-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.floating-glass-bar {
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--glass-shadow);
  padding: 6px 8px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

[data-theme="dark"] .floating-glass-bar {
  border-color: rgba(255, 255, 255, 0.12);
}

.filter-chip {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-chip:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-title);
}

[data-theme="dark"] .filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
}

.filter-chip.active {
  background: var(--navy-900);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(10, 18, 42, 0.35);
}

[data-theme="dark"] .filter-chip.active {
  background: #ffffff;
  color: var(--navy-900);
}

.dot-chip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green { background: var(--status-green); }
.dot-orange { background: var(--status-orange); }
.dot-red { background: var(--status-red); }
.dot-blue { background: var(--status-blue); }

.map-control-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--text-title);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
  white-space: nowrap;
}

.map-control-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .map-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.map-control-btn.active {
  background: var(--brand-orange);
  color: #fff;
}

/* Contenedor del Mapa Leaflet Dinámico */
#chuyay-map {
  width: 100%;
  height: calc(100vh - 170px);
  min-height: 700px;
  max-height: 1100px;
  background: #e2e8f0;
  z-index: 10;
}

/* Floating Bottom Footer / Telemetría */
.map-floating-footer {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  gap: 12px;
}

.map-floating-footer .floating-glass-bar {
  padding: 8px 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 650;
}

/* ==========================================================================
   MARKERS EN EL MAPA (SVG Vectoriales de Alta Precisión)
   ========================================================================== */
.chuyay-svg-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pin-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chuyay-svg-pin:hover .pin-bubble {
  transform: scale(1.24);
}

.pin-bubble.pulse-effect::after {
  content: '';
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px solid var(--status-blue);
  animation: radarPulse 1.8s infinite;
}

@keyframes radarPulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ==========================================================================
   VISTA 2: RECOLECTOR (CONSOLA TÁCTIL DE CAMPO)
   ========================================================================== */
.truck-console-grid {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 22px;
}

.console-card {
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--glass-shadow);
}

.driver-banner {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: #fff;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.route-pill-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.route-choice-btn {
  background: var(--surface-subtle);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-title);
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.route-choice-btn.active {
  background: var(--navy-900);
  color: #ffffff;
  border-color: var(--navy-900);
  box-shadow: 0 4px 14px rgba(10, 18, 42, 0.35);
}

.truck-paradas-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.parada-row-card {
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-left: 6px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.parada-row-card.is-emptied {
  border-left-color: var(--status-green);
  background: rgba(16, 185, 129, 0.03);
}

.parada-row-card.is-reported {
  border-left-color: var(--status-blue);
  background: rgba(56, 189, 248, 0.04);
}

.btn-big-touch {
  width: 100%;
  min-height: 54px;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-deep) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 850;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px var(--brand-orange-glow);
  transition: all 0.15s ease;
}

.btn-big-touch:active {
  transform: scale(0.98);
}

.btn-big-touch.completed {
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}

/* ==========================================================================
   VISTA 3: PANEL EJECUTIVO (CENTRO DE CONTROL URBANO)
   ========================================================================== */
.exec-metrics-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.exec-stat-box {
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--glass-shadow);
}

.exec-stat-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 8px;
}

.exec-stat-number {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--navy-900);
  font-feature-settings: "tnum" 1;
}

[data-theme="dark"] .exec-stat-number {
  color: #f8fafc;
}

.exec-split-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.progress-track-bar {
  width: 100%;
  height: 9px;
  background: var(--surface-subtle);
  border-radius: 5px;
  margin: 12px 0;
  overflow: hidden;
}

.progress-fill-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-orange) 0%, var(--status-green) 100%);
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* ==========================================================================
   MODALES Y VENTANAS EMERGENTES
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 13, 37, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--elevated-shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1.5px solid var(--border-subtle);
}

.photo-capture-area {
  width: 100%;
  height: 190px;
  border: 2px dashed var(--border-focus);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.photo-capture-area:hover {
  border-color: var(--brand-orange);
}

.photo-capture-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Alerta Toast Flotante */
.app-toast-alert {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--navy-900);
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 40px;
  font-size: 0.94rem;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* ==========================================================================
   ADAPTATIVIDAD 1: PANTALLAS GRANDES Y 2K/4K (>= 1800px)
   Resuelve el problema donde el usuario lo ve "muy pequeño" en monitor 2560px
   ========================================================================== */
@media (min-width: 1800px) {
  .gov-layout {
    padding: 16px 36px 36px 36px;
  }

  .gov-brand-titles h1 {
    font-size: 1.55rem;
  }

  .nav-seg-btn {
    padding: 12px 28px;
    font-size: 1rem;
  }

  .map-layout-grid {
    grid-template-columns: 480px 1fr;
    gap: 28px;
  }

  #chuyay-map {
    height: calc(100vh - 175px);
    min-height: 800px;
    max-height: 1200px;
  }

  .kpi-banner-card {
    padding: 26px;
  }

  .kpi-banner-card h3 {
    font-size: 1.4rem;
  }

  .kpi-mini-stat .num {
    font-size: 1.9rem;
  }

  .search-input {
    height: 56px;
    font-size: 1.05rem;
  }

  .container-code-text {
    font-size: 1.55rem;
  }

  .container-address-text {
    font-size: 1.02rem;
  }

  .spec-item .value {
    font-size: 1.05rem;
  }

  .btn-primary-action {
    min-height: 54px;
    font-size: 1.08rem;
  }

  .btn-secondary-action {
    min-height: 52px;
    font-size: 0.98rem;
  }

  .exec-stat-number {
    font-size: 2.8rem;
  }
}

/* ==========================================================================
   ADAPTATIVIDAD 2: TABLETS & PANTALLAS MEDIANAS (769px a 1100px)
   ========================================================================== */
@media (max-width: 1100px) and (min-width: 769px) {
  .gov-layout {
    padding: 12px 18px;
  }

  .map-layout-grid {
    grid-template-columns: 1fr;
  }

  #chuyay-map {
    height: 580px;
    min-height: 500px;
  }

  .truck-console-grid,
  .exec-split-columns {
    grid-template-columns: 1fr;
  }

  .exec-metrics-quad {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   ADAPTATIVIDAD 3: SMARTPHONES Y DISPOSITIVOS MÓVILES (< 768px)
   Implementa arquitectura "Bottom Sheet / Mobile-First" ergonómica
   ========================================================================== */
@media (max-width: 768px) {
  .gov-layout {
    padding: 8px 10px 20px 10px;
  }

  /* Header Móvil Compacto */
  .gov-navbar {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .gov-brand {
    justify-content: space-between;
    width: 100%;
  }

  .gov-seal-badge {
    width: 38px;
    height: 38px;
  }

  .gov-brand-titles h1 {
    font-size: 1.12rem;
  }

  .gov-brand-titles p {
    font-size: 0.68rem;
  }

  .gov-tools {
    align-self: flex-end;
  }

  .live-badge {
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .tool-chip-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  /* Conmutador de Vistas en Barra Completa */
  .nav-segmented {
    width: 100%;
    justify-content: space-between;
  }

  .nav-seg-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .nav-seg-btn svg {
    width: 15px;
    height: 15px;
  }

  /* Vista Mapa Móvil: Split Map arriba + Bottom Drawer abajo */
  .map-layout-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .map-canvas-container {
    order: 1;
    height: 48vh;
    min-height: 330px;
    border-radius: var(--radius-md);
  }

  #chuyay-map {
    height: 100%;
    min-height: 330px;
  }

  /* Drawer Convertido en Bottom Sheet Móvil */
  .panel-drawer {
    order: 2;
    background: var(--surface-card);
    border-radius: 24px 24px var(--radius-lg) var(--radius-lg);
    padding: 14px 16px 20px 16px;
    box-shadow: 0 -8px 28px rgba(10, 18, 42, 0.14);
    border: 1px solid var(--border-subtle);
  }

  /* Handle indicador táctil */
  .mobile-sheet-handle {
    display: block;
  }

  /* Ficha de Contenedor Móvil */
  .container-detail-card {
    padding: 16px;
    border-radius: var(--radius-md);
    gap: 14px;
    box-shadow: none;
    border: 1.5px solid var(--border-subtle);
  }

  .container-code-text {
    font-size: 1.15rem;
  }

  .container-address-text {
    font-size: 0.82rem;
  }

  .status-badge {
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  .details-spec-grid {
    padding: 12px;
    gap: 8px;
  }

  .spec-item .label {
    font-size: 0.68rem;
  }

  .spec-item .value {
    font-size: 0.84rem;
  }

  .btn-primary-action {
    min-height: 48px;
    font-size: 0.94rem;
    padding: 12px 16px;
  }

  .btn-secondary-action {
    min-height: 46px;
    font-size: 0.86rem;
    padding: 10px 14px;
  }

  /* Barra Flotante de Herramientas en Mapa Móvil */
  .map-floating-toolbar {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 8px;
  }

  .floating-glass-bar {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 4px 6px;
    scrollbar-width: none;
  }

  .floating-glass-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    padding: 6px 12px;
    font-size: 0.74rem;
  }

  .map-control-btn {
    padding: 6px 10px;
    font-size: 0.76rem;
  }

  /* Footer en Mapa Móvil */
  .map-floating-footer {
    bottom: 10px;
    left: 10px;
    right: 10px;
  }

  .map-floating-footer .floating-glass-bar {
    font-size: 0.72rem;
    padding: 6px 12px;
  }

  /* Recolector y Panel en Móvil */
  .truck-console-grid,
  .exec-split-columns {
    grid-template-columns: 1fr;
  }

  .exec-metrics-quad {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .exec-stat-box {
    padding: 16px;
  }

  .exec-stat-number {
    font-size: 1.8rem;
  }

  .modal-content-card {
    padding: 20px;
    border-radius: var(--radius-lg);
  }
}
