/* AGRO CONSULTAS — styles.css */
:root{
  --verde-principal: #1b5e20;
  --verde-secundario: #2e7d32;
  --verde-acento: #27ae60;
  --verde-claro: #e8f5e9;
  --gris-fondo: #f4f6f8;
  --gris-card: #ffffff;
  --bg-principal: #ffffff;
  --texto-principal: #1c2833;
  --texto-secundario: #4a5568;
  --sombra-suave: rgba(0,0,0,0.06);
  --sombra-media: rgba(0,0,0,0.12);
  --borde-suave: #cbd5e1;
  --transicion: 0.24s ease;
}

:root.theme-dark, .theme-dark {
  --verde-principal: #27ae60;
  --verde-secundario: #2ecc71;
  --verde-acento: #81c784;
  --verde-claro: rgba(39, 174, 96, 0.15);
  --gris-fondo: #09130b;
  --gris-card: #0f1c12;
  --bg-principal: #0b180d;
  --texto-principal: #eef7f0;
  --texto-secundario: #a3b8a8;
  --sombra-suave: rgba(0,0,0,0.5);
  --sombra-media: rgba(0,0,0,0.6);
  --borde-suave: rgba(255,255,255,0.12);
}

*{box-sizing:border-box}
body{
  font-family:'Inter', 'Roboto', sans-serif;
  background:var(--gris-fondo);
  color:var(--texto-principal);
  margin:0;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
  overflow-x: hidden;
}

/* Evitar desbordamiento de textos en todo el sitio */
p, span, h1, h2, h3, h4, h5, h6, div, li, strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Splash Screen / Pantalla de Bienvenida Overlay */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #0f2312 0%, #061008 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s ease;
  overflow: hidden;
}

.splash-screen.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  padding: 30px 20px;
  max-width: 480px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: splashFadeUp 0.8s ease-out;
}

.splash-logo-container {
  width: 140px;
  height: 140px;
  background: #ffffff;
  border-radius: 24px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(39, 174, 96, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  border: 3px solid #27ae60;
  transition: transform 0.3s ease;
}

.splash-logo-container:hover {
  transform: scale(1.05);
}

.splash-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.splash-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.splash-subtitle {
  font-size: 1rem;
  color: #a3e635;
  margin: 0 0 24px 0;
  font-weight: 600;
  opacity: 0.95;
}

.splash-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #27ae60;
  border-radius: 50%;
  animation: splashSpin 0.9s linear infinite;
  margin-bottom: 15px;
}

.splash-progress-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

.splash-progress-fill {
  width: 0%;
  height: 100%;
  background: #27ae60;
  animation: splashProgressFill 2.5s ease-out forwards;
}

@keyframes splashProgressFill {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes splashFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splashSpin {
  to {
    transform: rotate(360deg);
  }
}

.app-header{ display:flex; justify-content:space-between; align-items:center; padding:12px 20px; gap:14px; flex-wrap:wrap;}
.left{display:flex;align-items:center;gap:14px; min-width: 0; flex: 1 1 auto;}
.brand{ width:80px; height:80px; object-fit:contain; border-radius:12px; box-shadow:0 6px 16px rgba(0,0,0,0.18); flex-shrink: 0; background: #ffffff !important; padding: 6px; border: 3px solid var(--verde-principal);}
.brand-text{ min-width: 0; flex: 1 1 auto; }
.brand-text .title{ font-weight:800; color:var(--verde-principal); font-size:20px; white-space: nowrap; letter-spacing: 0.3px;}
.brand-text .subtitle, .brand-text > div:last-child{ font-size:12.5px; color:var(--texto-secundario); line-height: 1.25;}

.container{ max-width:1100px; margin:0 auto; padding:16px}
.card{ background:var(--gris-card); border-radius:12px; padding:18px; border:1px solid var(--borde-suave); box-shadow:0 10px 30px var(--sombra-suave)}

.hero{ margin:20px auto; text-align:left}
.hero h1{ margin:0 0 6px 0; font-size:22px }
.lead{ color:var(--texto-secundario); margin-bottom:12px }

.home-form label{ display:block; font-weight:600; margin-bottom:6px; color:var(--verde-principal)}
.home-form input[type="text"]{ width:100%; padding:12px; border-radius:10px; border:1px solid var(--borde-suave); margin-bottom:10px; background:transparent; color:var(--texto-principal)}
.row{ display:flex; gap:10px }
.row .btn{ flex:1 }

.btn{ display:inline-block; padding:10px 14px; border-radius:10px; border:1px solid var(--borde-suave); background:transparent; cursor:pointer; transition:all var(--transicion); color:var(--texto-principal); font-weight:600;}
.btn.primary{ background:var(--verde-principal); color:#ffffff !important; border:none; box-shadow:0 6px 18px rgba(27,94,32,0.12) }
.btn.primary:hover{ filter:brightness(1.1); transform:translateY(-1px); }
.btn.outline{ background:var(--gris-card); border:1.5px solid var(--verde-principal); color:var(--verde-principal) !important; }
.btn.outline:hover{ background:var(--verde-claro); }
.btn.link{ background:transparent; border:none; color:var(--verde-principal) !important; padding:8px 10px }

.icon-btn{ background:var(--gris-card); border:1px solid var(--borde-suave); padding:8px 12px; border-radius:8px; cursor:pointer; color:var(--texto-principal); font-size:1.1rem; transition:all var(--transicion); }
.icon-btn:hover{ background:var(--verde-claro); border-color:var(--verde-principal); }

.app-footer{ padding:32px; text-align:center; color:var(--texto-secundario) }

/* Grid de Cultivos */
.crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.crop-card {
  background: var(--gris-card);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--borde-suave);
  box-shadow: 0 4px 12px var(--sombra-suave);
  transition: transform var(--transicion), box-shadow var(--transicion);
  animation: floatUp 0.36s ease both;
  max-width: 100%;
  box-sizing: border-box;
}

.crop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--sombra-media);
}

.crop-card h3 {
  margin: 0 0 10px 0;
  color: var(--verde-principal);
  font-size: 1.25rem;
}

.crop-card .desc {
  font-size: 0.95rem;
  color: var(--texto-secundario);
  line-height: 1.5;
  margin-bottom: 15px;
}

.crop-card .details {
  border-top: 1px solid var(--borde-suave);
  padding-top: 15px;
  font-size: 0.85rem;
  color: var(--texto-principal);
}

.crop-card .details div {
  margin-bottom: 5px;
}

.error-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: rgba(255, 0, 0, 0.05);
  border-radius: 12px;
  color: var(--texto-secundario);
}

.icon-btn{ background:transparent; border:1px solid var(--borde-suave); padding:8px 10px; border-radius:8px; cursor:pointer }

@keyframes floatUp{ from{ transform:translateY(6px); opacity:0 } to{ transform:translateY(0); opacity:1 } }

/* Map Layout and Territory Sidebar Styles */
.map-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  min-height: 320px;
}

#map {
  z-index: 1;
  height: 320px;
  min-height: 280px;
  max-height: 350px;
}

.territory-sidebar {
  padding: 20px;
  background: var(--gris-card);
  border-left: 1px solid var(--borde-suave);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  max-height: 350px;
}

.territory-sidebar h3 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--verde-principal);
  font-size: 1.15rem;
}

.text-muted {
  color: var(--texto-secundario);
  font-size: 0.85rem;
  margin-bottom: 15px;
  line-height: 1.4;
}

.territory-details-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.empty-state {
  text-align: center;
  color: var(--texto-secundario);
  font-size: 0.9rem;
}

.empty-state span {
  display: block;
  margin-bottom: 10px;
}

.info-item {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.info-item strong {
  color: var(--verde-principal);
  display: block;
  margin-bottom: 2px;
}

/* Badge styles for compatibility */
.compatibility-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-top: 5px;
}

.badge-alta {
  background-color: rgba(46, 125, 50, 0.15);
  color: #2e7d32;
  border: 1px solid #2e7d32;
}

.badge-media {
  background-color: rgba(239, 108, 0, 0.15);
  color: #ef6c00;
  border: 1px solid #ef6c00;
}

.badge-baja {
  background-color: rgba(198, 40, 40, 0.15);
  color: #c62828;
  border: 1px solid #c62828;
}

/* Badges de Origen y Confiabilidad (Estandarizados) */
.badge-origin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-origin.real {
  background-color: rgba(46, 125, 50, 0.15);
  color: #2e7d32;
  border: 1px solid #2e7d32;
}

.badge-origin.regional {
  background-color: rgba(2, 119, 189, 0.15);
  color: #0277bd;
  border: 1px solid #0277bd;
}

.badge-origin.calculado {
  background-color: rgba(106, 27, 154, 0.15);
  color: #6a1b9a;
  border: 1px solid #6a1b9a;
}

.badge-origin.estimado {
  background-color: rgba(239, 108, 0, 0.15);
  color: #ef6c00;
  border: 1px solid #ef6c00;
}

.badge-origin.simulado {
  background-color: rgba(216, 27, 96, 0.15);
  color: #d81b60;
  border: 1px solid #d81b60;
}

.badge-origin.no-disponible,
.badge-origin.nodisponible {
  background-color: rgba(117, 117, 117, 0.15);
  color: #616161;
  border: 1px solid #757575;
}

.theme-dark .badge-origin.real {
  background-color: rgba(129, 199, 132, 0.2);
  color: #a5d6a7;
  border-color: #81c784;
}

.theme-dark .badge-origin.regional {
  background-color: rgba(79, 195, 247, 0.2);
  color: #81d4fa;
  border-color: #4fc3f7;
}

.theme-dark .badge-origin.calculado {
  background-color: rgba(186, 104, 200, 0.2);
  color: #ce93d8;
  border-color: #ba68c8;
}

.theme-dark .badge-origin.estimado {
  background-color: rgba(255, 183, 77, 0.2);
  color: #ffe082;
  border-color: #ffb74d;
}

.theme-dark .badge-origin.simulado {
  background-color: rgba(240, 98, 146, 0.2);
  color: #f48fb1;
  border-color: #f06292;
}

.theme-dark .badge-origin.no-disponible,
.theme-dark .badge-origin.nodisponible {
  background-color: rgba(189, 189, 189, 0.2);
  color: #e0e0e0;
  border-color: #bdbdbd;
}

/* Tarjeta vacía "NO DISPONIBLE" */
.unavailable-card-block {
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--borde-suave);
  border-radius: 10px;
  padding: 16px;
  margin: 10px 0;
  text-align: left;
}

.unavailable-card-block .title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--texto-secundario);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.unavailable-card-block .explanation {
  font-size: 0.82rem;
  color: var(--texto-secundario);
  margin: 0;
  line-height: 1.4;
}

/* Dark theme specific fixes for Leaflet controls */
.theme-dark .leaflet-bar a,
.theme-dark .leaflet-control-zoom-in,
.theme-dark .leaflet-control-zoom-out {
  background: var(--gris-card) !important;
  color: var(--texto-principal) !important;
  border-color: var(--borde-suave) !important;
}

.theme-dark .leaflet-container {
  background: var(--gris-fondo) !important;
}

/* ============================================================================
   Carrusel de Módulos (Home)
   ============================================================================ */
.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 10px 0;
}

.carousel-track-container {
  overflow: hidden;
  width: 100%;
  border-radius: 12px;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  box-sizing: border-box;
  padding: 4px;
}

.module-card {
  background: var(--gris-fondo);
  border: 1px solid var(--borde-suave);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  box-shadow: 0 4px 12px var(--sombra-suave);
  transition: transform 0.2s ease;
}

.carousel-btn {
  background: var(--gris-card);
  border: 1px solid var(--borde-suave);
  color: var(--verde-principal);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--sombra-suave);
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 2;
}

.carousel-btn:hover {
  background: var(--verde-principal);
  color: #ffffff;
  transform: scale(1.05);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--verde-principal);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s ease;
}

.carousel-dot.active {
  background: var(--verde-principal);
  width: 28px;
  border-radius: 12px;
}

/* ============================================================================
   Acordeón Plegable de Preguntas Frecuentes (FAQ)
   ============================================================================ */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.faq-item {
  background: var(--gris-fondo);
  border: 1px solid var(--borde-suave);
  border-radius: 10px;
  overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.faq-item[open] {
  border-color: var(--verde-principal);
  background: var(--gris-card);
  box-shadow: 0 4px 12px var(--sombra-suave);
}

.faq-question {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--verde-principal);
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  outline: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '➕';
  font-size: 0.85rem;
  transition: transform 0.25s ease;
  margin-left: 10px;
  flex-shrink: 0;
}

.faq-item[open] .faq-question::after {
  content: '➖';
}

.faq-answer {
  padding: 0 20px 18px 20px;
  font-size: 0.88rem;
  color: var(--texto-secundario);
  line-height: 1.6;
  border-top: 1px dashed var(--borde-suave);
  margin-top: 4px;
  padding-top: 12px;
}

/* ============================================================================
   Sección Explicativa (Home) - Grid y Cards
   ============================================================================ */
.explanation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.explanation-card {
  text-align: center;
  padding: 24px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.explanation-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.explanation-card .icon-circle {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: inline-block;
}

.explanation-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.explanation-card p {
  font-size: 0.9rem;
  color: var(--texto-secundario);
  line-height: 1.4;
  margin: 0;
}

/* ============================================================================
   Leyenda del Mapa (Map Legend)
   ============================================================================ */
.map-legend {
  position: absolute;
  bottom: 15px;
  left: 15px;
  z-index: 1000;
  background: var(--gris-card);
  border: 1px solid var(--borde-suave);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 250px;
  backdrop-filter: blur(4px);
}

.map-legend h4 {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--texto-principal);
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--texto-secundario);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-color.forestal { background: #2ecc71; }
.legend-color.pampeano { background: #f1c40f; }
.legend-color.vitivinicola { background: #9b59b6; }
.legend-color.citricola { background: #e67e22; }
.legend-color.horticola { background: #1abc9c; }
.legend-color.multipropósito { background: #3498db; }

/* ============================================================================
   Rediseño Premium de las Tarjetas de Cultivo (Crop Cards)
   ============================================================================ */
.crop-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--borde-suave);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.crop-icon {
  font-size: 1.6rem;
}

.crop-grid-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.sub-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--borde-suave);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.8rem;
  max-width: 100%;
  box-sizing: border-box;
}

.sub-card h4 {
  margin: 0 0 5px 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--verde-principal);
  letter-spacing: 0.3px;
}

.theme-dark .sub-card {
  background: rgba(255, 255, 255, 0.02);
}

/* Reporte de compatibilidad de diseño premium */
.premium-report {
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid var(--borde-suave) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  margin-bottom: 15px !important;
}

.theme-dark .premium-report {
  background: rgba(255, 255, 255, 0.02) !important;
}

.premium-report .report-header {
  font-weight: 700;
  color: var(--verde-principal);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.premium-report .report-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.premium-report .report-block strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--texto-principal);
  margin-bottom: 4px;
}

.premium-report .report-block ul {
  margin: 0;
  padding-left: 14px;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Manejo Sostenible de diseño premium */
.premium-sustainability {
  font-size: 0.85rem;
  background: rgba(46, 204, 113, 0.04) !important;
  border: 1px solid rgba(46, 204, 113, 0.18) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  transition: background-color 0.2s ease;
}

.premium-sustainability .sustainability-header {
  font-weight: 700;
  color: #27ae60;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px dashed rgba(46, 204, 113, 0.18);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

/* Modal Ficha Técnica Universal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  overflow-y: auto;
}

.modal-card {
  background: var(--gris-card, #ffffff);
  color: var(--texto-principal, #2c3e50);
  border-radius: 12px;
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border-top: 5px solid var(--verde-principal, #1b5e20);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--borde-suave, #e0e0e0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gris-card, #ffffff);
}

.modal-tabs {
  display: flex;
  overflow-x: auto;
  background: var(--gris-fondo, #f4f6f8);
  border-bottom: 1px solid var(--borde-suave, #e0e0e0);
  padding: 0 10px;
  gap: 4px;
}

.modal-tabs .tab-btn {
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--texto-secundario, #7f8c8d);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.modal-tabs .tab-btn.active {
  color: var(--verde-principal, #1b5e20);
  border-bottom-color: var(--verde-principal, #1b5e20);
  background: var(--gris-card, #ffffff);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

@media (max-width: 850px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
  .territory-sidebar {
    border-left: none;
    border-top: 1px solid var(--borde-suave);
    max-height: none;
  }
  .forest-layout {
    grid-template-columns: 1fr !important;
  }
  .tracking-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .app-header {
    padding: 8px 12px;
    gap: 8px;
  }
  .brand {
    width: 52px;
    height: 52px;
  }
  .brand-text .title {
    font-size: 16px;
  }
  .brand-text .subtitle, .brand-text > div:last-child {
    font-size: 0.68rem !important;
    line-height: 1.2;
  }
  .container {
    padding: 10px;
  }
  .card {
    padding: 12px;
  }
  .crop-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .crop-grid-details {
    grid-template-columns: 1fr;
  }
  .map-legend {
    position: relative;
    bottom: auto;
    left: auto;
    max-width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 6px 10px;
  }
  .brand {
    width: 48px;
    height: 48px;
  }
  .brand-text .title {
    font-size: 15px;
  }
  .brand-text .subtitle, .brand-text > div:last-child {
    font-size: 0.62rem !important;
  }
  .app-header .right {
    gap: 4px !important;
    width: 100%;
  }
  .app-header .btn {
    padding: 6px 8px;
    font-size: 0.72rem !important;
  }
}

/* ============================================================================
   ESTILOS DE IMPRESIÓN Y GENERACIÓN DE INFORME PDF PROFESIONAL
   ============================================================================ */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    line-height: 1.4;
  }

  .app-header .right,
  .theme-toggle,
  #themeToggle,
  #btnTutorial,
  #btnComoFunciona,
  #resultadosSearchForm,
  #btn-geolocalizar,
  #evidence-file-input,
  #btnClearBatch,
  #btnExportPDF,
  .btn,
  .modal-overlay,
  .icon-btn {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
    margin-bottom: 15px !important;
    padding: 15px !important;
  }

  .app-header {
    border-bottom: 2px solid #27ae60 !important;
    padding-bottom: 10px !important;
    margin-bottom: 20px !important;
  }

  .crop-card {
    break-inside: avoid;
    border: 1px solid #bbb !important;
    margin-bottom: 12px !important;
  }

  details {
    display: block !important;
  }

  details summary {
    display: none !important;
  }

  details[open] > div, details > div {
    display: block !important;
  }

  @page {
    margin: 1.5cm;
    size: A4 portrait;
  }
}


/* Identidad visual GIS: bosque profundo, verde cartográfico y menta */
:root {
  --verde-principal: #087c45;
  --verde-secundario: #126b43;
  --verde-acento: #24a86a;
  --verde-claro: #e4f5eb;
}
:root.theme-dark, .theme-dark {
  --verde-principal: #16a765;
  --verde-secundario: #0d8a50;
  --verde-acento: #73e6b1;
  --verde-claro: rgba(36, 168, 106, .16);
  --gris-fondo: #06130d;
  --gris-card: #0b1d14;
  --bg-principal: #07170f;
  --texto-principal: #edf8f1;
  --texto-secundario: #9db7a7;
  --sombra-suave: rgba(0,0,0,.42);
  --sombra-media: rgba(0,0,0,.56);
  --borde-suave: rgba(115,230,177,.16);
}
.theme-dark .app-header {
  background: rgba(5, 19, 12, .96);
  border-bottom: 1px solid var(--borde-suave);
}
.theme-dark .card {
  background: linear-gradient(145deg, rgba(12,31,21,.98), rgba(7,23,15,.98));
  border-color: var(--borde-suave);
}
.theme-dark .btn.primary {
  background: linear-gradient(135deg, #087c45, #16a765);
}
.theme-dark .btn.outline {
  background: rgba(10,29,19,.72);
  border-color: rgba(115,230,177,.28);
  color: #b8f5d6 !important;
}
