/**
 * Estilos específicos: Buscador de restricciones de ZBE en España
 * Fijate Tools - Suite de Movilidad y Medio Ambiente
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta Base Tema Oscuro (Predeterminado) */
  --bg-primary: #0a0e17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-input: #151d2c;
  --border-color: #27354a;
  --border-hover: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);

  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.12);
  --accent-green-border: rgba(16, 185, 129, 0.35);

  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-amber-border: rgba(245, 158, 11, 0.35);

  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-red-border: rgba(239, 68, 68, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-hover: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.15);

  --accent-green-bg: #ecfdf5;
  --accent-green-border: #a7f3d0;

  --accent-amber-bg: #fffbeb;
  --accent-amber-border: #fde68a;

  --accent-red-bg: #fef2f2;
  --accent-red-border: #fecaca;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Requisitos canónicos de estructura */
body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.hero-title,
.section-title,
.tab-title,
.modal-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.mono, code {
  font-family: var(--font-mono);
}

/* Layout general con sidebar */
.main-wrapper.tool-layout {
  max-width: 1240px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hero de presentación */
.hero-tool-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .hero-tool-banner {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

[data-theme="light"] .hero-badge-tag {
  color: #047857;
  background: #d1fae5;
  border-color: #6ee7b7;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: var(--text-main);
  line-height: 1.25;
}

.hero-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 820px;
}

/* Barra de pestañas de navegación */
.tool-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tool-nav-tabs::-webkit-scrollbar {
  display: none;
}

.tool-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 42px;
}

.tool-nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.tool-nav-tab.active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.tab-view-content {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-view-content.active {
  display: flex;
}

/* Panel interactivo de filtros cruzados */
.filter-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.filter-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-inline-helper {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-inline-helper:hover {
  color: var(--primary-hover);
}

/* Desplegables <select> cumpliendo reglas */
.form-select,
select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 44px;
  min-height: 40px;
  padding: 0 40px 0 0.85rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font-main);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  box-sizing: border-box;
}

.form-select option,
select option {
  background-color: var(--bg-surface);
  color: var(--text-main);
  padding: 8px 12px;
}

.form-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 40px;
  padding: 0 0.85rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font-main);
  box-sizing: border-box;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Autocompletado */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.autocomplete-item {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
}

.autocomplete-item:hover {
  background: var(--primary-glow);
}

.autocomplete-item.empty {
  color: var(--text-dim);
  cursor: default;
  font-size: 0.85rem;
}

.item-prov {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: normal;
}

.item-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Badges de etiquetas ambientales DGT */
.etiquetas-selector-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.btn-etiqueta-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.65rem 0.35rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-input);
  cursor: pointer;
  min-height: 60px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-etiqueta-badge .badge-icon {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.btn-etiqueta-badge .badge-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.btn-etiqueta-badge:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-etiqueta-badge.active {
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Colores específicos de etiquetas DGT */
.btn-etiqueta-badge[data-etiqueta="sin_etiqueta"].active {
  background: #334155;
  border-color: #ef4444;
  color: #ffffff;
}

.btn-etiqueta-badge[data-etiqueta="b"].active {
  background: #ca8a04;
  border-color: #facc15;
  color: #000000;
}

.btn-etiqueta-badge[data-etiqueta="c"].active {
  background: #059669;
  border-color: #34d399;
  color: #ffffff;
}

.btn-etiqueta-badge[data-etiqueta="eco"].active {
  background: linear-gradient(135deg, #0284c7 0%, #059669 100%);
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-etiqueta-badge[data-etiqueta="cero"].active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
}

/* Selector de tipo de vehículo */
.vehiculos-selector-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
}

.btn-vehiculo-type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: all 0.2s;
}

.btn-vehiculo-type:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.btn-vehiculo-type.active {
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* Panel de Semáforo / Veredicto Legal */
.panel-veredicto-box {
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.veredicto-verde {
  background: var(--accent-green-bg);
  border-color: var(--accent-green-border);
}

.veredicto-amarillo {
  background: var(--accent-amber-bg);
  border-color: var(--accent-amber-border);
}

.veredicto-rojo {
  background: var(--accent-red-bg);
  border-color: var(--accent-red-border);
}

.veredicto-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.veredicto-icon-box {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.veredicto-headers {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.veredicto-badge-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-veredicto {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.badge-veredicto.green {
  background: #10b981;
  color: #ffffff;
}

.badge-veredicto.amber {
  background: #f59e0b;
  color: #000000;
}

.badge-veredicto.red {
  background: #ef4444;
  color: #ffffff;
}

.badge-veredicto.blue {
  background: #3b82f6;
  color: #ffffff;
}

.veredicto-city-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
}

.veredicto-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
  line-height: 1.25;
}

.veredicto-detail-text {
  font-size: 0.95rem;
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
}

.veredicto-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.vdetail-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.vdetail-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.vdetail-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.vdetail-content strong {
  color: var(--text-main);
  font-size: 0.82rem;
}

.vdetail-content span {
  color: var(--text-muted);
}

.veredicto-tramite-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.veredicto-tramite-box svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Ficha del municipio seleccionado */
.ficha-ciudad-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ficha-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.ficha-location {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}

.ficha-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.2rem 0 0;
  color: var(--text-main);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.badge-activa_sancionando {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.badge-activa_sancionando .dot { background: #ef4444; }

.badge-informativa {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}
.badge-informativa .dot { background: #f59e0b; }

.badge-aprobada_moratoria {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #3b82f6;
}
.badge-aprobada_moratoria .dot { background: #3b82f6; }

.badge-en_tramitacion {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #94a3b8;
}
.badge-en_tramitacion .dot { background: #94a3b8; }

.ficha-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.ficha-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.spec-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spec-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.spec-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.text-red {
  color: #ef4444 !important;
}

.ficha-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-external-link,
.btn-ver-en-mapa {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.2s;
}

.btn-external-link {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.btn-external-link:hover {
  background: var(--primary-hover);
}

.btn-ver-en-mapa {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-ver-en-mapa:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
}

/* Mapa Cartográfico Leaflet */
.map-container-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.map-legend {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.red { background: #ef4444; }
.legend-dot.amber { background: #f59e0b; }
.legend-dot.blue { background: #3b82f6; }
.legend-dot.gray { background: #64748b; }

#leaflet-map-zbe {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  z-index: 1;
}

/* Popups de Leaflet */
.leaflet-popup-content-wrapper {
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border-color);
  padding: 0.25rem !important;
}

.leaflet-popup-tip {
  background: var(--bg-surface) !important;
}

.zbe-map-popup {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 200px;
}

.zbe-map-popup .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.zbe-map-popup .popup-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.zbe-map-popup .popup-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.zbe-map-popup .popup-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
}

.btn-popup-select {
  margin-top: 0.4rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-popup-select:hover {
  background: var(--primary-hover);
}

/* Tabla de los 150+ Municipios */
.tabla-container-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tabla-filters-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 44px;
  min-height: 40px;
  padding: 0 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-export:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
}

.table-responsive-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.zbe-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.zbe-table th {
  background: var(--bg-surface-elevated);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.zbe-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.zbe-table tr:hover td {
  background: rgba(59, 130, 246, 0.05);
}

.zbe-table tr.row-selected td {
  background: rgba(59, 130, 246, 0.12);
}

.cell-city {
  display: flex;
  flex-direction: column;
}

.cell-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.badge-status-table {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-etiqueta-mini {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.etq-prohibido {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.etq-condicionado {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.btn-table-action {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-table-action:hover {
  background: var(--primary-hover);
}

/* Modales canónicos */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

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

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
}

.btn-close-modal:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detector-result-card {
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.detector-result-card.etq-res-sin_etiqueta { background: #334155; color: #fff; }
.detector-result-card.etq-res-b { background: #ca8a04; color: #000; }
.detector-result-card.etq-res-c { background: #059669; color: #fff; }
.detector-result-card.etq-res-eco { background: linear-gradient(135deg, #0284c7 0%, #059669 100%); color: #fff; }
.detector-result-card.etq-res-cero { background: #2563eb; color: #fff; }

.detector-result-badge {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.detector-result-desc {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.95;
}

.btn-modal-action {
  width: 100%;
  height: 44px;
  min-height: 40px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-modal-action:hover {
  background: var(--primary-hover);
}

/* Sección de Preguntas Frecuentes y Guía Legal */
.faq-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: var(--text-main);
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-question {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.35rem;
}

.faq-answer {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Responsividad en dispositivos móviles */
@media (max-width: 900px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .tabla-filters-row {
    grid-template-columns: 1fr;
  }

  .etiquetas-selector-group {
    grid-template-columns: repeat(3, 1fr);
  }

  .vehiculos-selector-group {
    grid-template-columns: repeat(2, 1fr);
  }

  #leaflet-map-zbe {
    height: 380px;
  }
}

@media (max-width: 600px) {
  .hero-tool-banner {
    padding: 1.25rem;
  }

  .filter-card,
  .panel-veredicto-box,
  .ficha-ciudad-card,
  .map-container-box,
  .tabla-container-box,
  .faq-section {
    padding: 1.15rem;
  }

  .etiquetas-selector-group {
    grid-template-columns: repeat(2, 1fr);
  }

  .veredicto-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .ficha-actions {
    flex-direction: column;
  }

  .btn-external-link,
  .btn-ver-en-mapa {
    width: 100%;
    justify-content: center;
  }
}
