/* maps.css - Agenda y Mapa Cultural de Boyacá */

:root {
  --primary-color: #1e3a8a;
  --primary-hover: #1e40af;
  --accent-color: #0284c7;
  --accent-light: #e0f2fe;
  --success-color: #059669;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 72px);
}

/* --- HEADER --- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1000;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-izq {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.header-titles h1 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
}

.header-titles p {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-logo-center {
  display: flex;
  align-items: center;
  margin-right: 80px;
}

.logo-centro {
  height: 44px;
  width: auto;
  object-fit: contain;
}

/* --- TOP SECTION (MAP + SIDEBAR) --- */
/* --- QUICK TAGS / FILTROS RÁPIDOS --- */
.quick-tags-wrapper {
  background: var(--bg-card);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.quick-tags-header {
  flex-shrink: 0;
}

.quick-tags-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.quick-tags-title i {
  color: #d97706; /* Amber/gold bolt icon */
}

.quick-tags-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  padding-top: 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.quick-tags-scroll::-webkit-scrollbar {
  height: 4px;
}
.quick-tags-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tag-chip i {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.tag-chip:hover {
  border-color: var(--primary-color);
  background: #f1f5f9;
  color: var(--primary-color);
}

.tag-chip:hover i {
  color: var(--primary-color);
}

.tag-chip.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
}

.tag-chip.active i {
  color: #f59e0b;
}

/* --- MOBILE FILTER TRIGGER & BACKDROP & DRAWER --- */
.mobile-filter-trigger {
  display: none; /* oculto en escritorio */
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.mobile-filter-trigger:hover, .mobile-filter-trigger:active {
  background: #1e293b;
  transform: translateY(-1px);
}

.filter-count-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.filter-count-badge.hidden {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.drawer-drag-handle {
  display: none;
  width: 40px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 3px;
  margin: 0 auto 10px auto;
}

.btn-close-drawer {
  display: none;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close-drawer:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-apply-mobile {
  display: none;
  flex: 1;
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.top-section {
  display: flex;
  flex: 1;
  min-height: 520px;
  padding: 20px 24px;
  gap: 20px;
  background-color: #f1f5f9;
}

.map-wrapper {
  flex: 3;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

#map {
  width: 100%;
  height: 100%;
  min-height: 480px;
  z-index: 1;
}

/* Leyenda del Mapa */
.map-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.legend-color.marker {
  background-color: #ef4444;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.legend-scale-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-scale {
  display: flex;
  gap: 2px;
  align-items: center;
}

.scale-box {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}

/* --- SIDEBAR --- */
#sidebar {
  flex: 1;
  max-width: 360px;
  min-width: 300px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 10px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-row {
  display: flex;
  gap: 10px;
}

.flex-1 {
  flex: 1;
}

.filter-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  width: 100%;
  padding: 10px 32px 10px 14px;
}

#btn-clear-search {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

/* Inputs & Selects */
.filter-group select,
.filter-group input {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.filter-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.filter-group select:hover,
.filter-group input:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--accent-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Botón Restablecer */
.btn-primary-clear {
  width: 100%;
  padding: 12px 16px;
  background-color: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-clear:hover {
  background-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(220, 38, 38, 0.3);
}

/* Indicadores de Estadísticas */
.quick-stats {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.stat-card {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-color);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* --- TABLA DE EVENTOS --- */
.tabla-container {
  padding: 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.tabla-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.tabla-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tabla-subtitle {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-export {
  padding: 9px 16px;
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.btn-export:hover {
  background-color: #047857;
  transform: translateY(-1px);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th {
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  text-align: left;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

th.sortable:hover {
  background-color: #1e3a8a;
}

th.sortable .sort-icon {
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease;
}

th.sortable:hover .sort-icon {
  opacity: 1;
}

th.sortable.sorted-asc .sort-icon,
th.sortable.sorted-desc .sort-icon {
  opacity: 1;
  color: #fde047;
}

td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) {
  background-color: #f8fafc;
}

tr:hover {
  background-color: #f0f9ff;
  cursor: pointer;
}

/* Badges dentro de Tabla */
.badge-date {
  font-weight: 700;
  color: var(--primary-color);
  background-color: #eff6ff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  white-space: nowrap;
}

.event-title {
  color: var(--text-main);
  font-size: 14px;
}

.badge-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--accent-light);
  color: #0369a1;
  white-space: nowrap;
}

.text-subcat {
  font-size: 13px;
  color: var(--text-muted);
}

.badge-mun {
  font-weight: 600;
  color: #0f172a;
}

.badge-prov {
  font-size: 12px;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
}

.badge-lrpci {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background-color: #f8fafc;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.btn-focus-event {
  padding: 6px 12px;
  background-color: #f1f5f9;
  color: var(--primary-color);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-focus-event:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 2px dashed #cbd5e1;
  margin-top: 12px;
}

.empty-icon {
  font-size: 40px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px 0;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}

.btn-secondary {
  padding: 10px 18px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* Custom Leaflet Marker Styling - Puntos rojos compactos */
.custom-event-marker .marker-pin {
  width: 10px;
  height: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  border: 1.5px solid #ffffff;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.custom-event-marker:hover .marker-pin {
  transform: scale(1.6);
  background-color: #dc2626;
}

.popup-card {
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding: 2px;
}

.popup-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 4px;
}

.popup-card h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.3;
}

.popup-detail {
  font-size: 12px;
  color: #475569;
  margin-bottom: 4px;
  line-height: 1.4;
}

.popup-detail i {
  width: 14px;
  color: var(--accent-color);
}

/* --- NAVEGACIÓN POR PESTAÑAS --- */
.nav-tabs-container {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--primary-color);
  background: #f8fafc;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: #f1f5f9;
}

.tab-btn i {
  font-size: 16px;
  color: var(--accent-color);
}

.tab-btn.active i {
  color: var(--primary-color);
}

.tab-view {
  display: block;
  width: 100%;
}

.tab-view.hidden {
  display: none !important;
}

/* --- DASHBOARD DE ESTADÍSTICAS --- */
.stats-dashboard {
  padding: 24px 28px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.stats-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: #ffffff;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
}

.stats-header-bar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-header-bar h2 i {
  color: var(--accent-color);
}

.stats-subtitle {
  margin: 4px 0 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.stats-filter-badge {
  background: var(--accent-light);
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #bae6fd;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-icon.bg-blue { background: #dbeafe; color: #1e40af; }
.kpi-icon.bg-emerald { background: #d1fae5; color: #047857; }
.kpi-icon.bg-purple { background: #f3e8ff; color: #6b21a8; }
.kpi-icon.bg-amber { background: #fef3c7; color: #b45309; }
.kpi-icon.bg-rose { background: #ffe4e6; color: #be123c; }
.kpi-icon.bg-cyan { background: #cffafe; color: #0e7490; }

.kpi-data {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.kpi-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 2px;
}

.kpi-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.chart-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-header h3 i {
  color: var(--accent-color);
}

.chart-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

.margin-top-lg {
  margin-top: 24px;
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
  .top-section {
    flex-direction: column;
    min-height: auto;
  }

  .map-wrapper {
    height: 480px;
  }

  #sidebar {
    max-width: 100%;
    min-width: unset;
  }
}

@media screen and (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-card-wide {
    grid-column: 1;
  }
}

@media screen and (max-width: 768px) {
  .quick-tags-wrapper {
    padding: 10px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .quick-tags-scroll {
    width: 100%;
  }

  .mobile-filter-trigger {
    display: inline-flex;
  }

  /* Transform #sidebar into Bottom Sheet Drawer on Mobile */
  #sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 82vh;
    border-radius: 20px 20px 0 0;
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
    padding: 16px 20px 24px 20px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
  }

  #sidebar.drawer-open {
    transform: translateY(0);
  }

  .drawer-drag-handle {
    display: block;
  }

  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .btn-close-drawer {
    display: inline-flex;
  }

  .sidebar-actions {
    display: flex;
    gap: 10px;
  }

  .btn-apply-mobile {
    display: inline-flex;
  }
}

@media screen and (max-width: 640px) {
  .header {
    padding: 10px 16px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .nav-tabs-container {
    padding: 0 12px;
  }

  .tab-btn {
    padding: 12px 14px;
    font-size: 13px;
  }

  .stats-dashboard {
    padding: 16px 12px;
  }

  .top-section {
    padding: 12px;
    gap: 12px;
  }

  .map-wrapper {
    height: 380px;
  }

  .tabla-container {
    padding: 16px;
  }

  th, td {
    padding: 10px 12px;
    font-size: 12.5px;
  }
}
