.map-controls-bar {
    display: flex;
    gap: 10px;
    background: #f8fafc;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

#mapTokenInput {
    flex: 1;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.btn-buscar-mapa {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* El selector de capas minimalista que hicimos */
/* --- SELECTOR DE CAPAS (FIX) --- */
.leaflet-control-layers {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.leaflet-control-layers-list {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
}

/* Ocultamos el input de Leaflet pero mantenemos su funcionalidad */
.leaflet-control-layers-selector {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
    margin: 0 !important;
}

/* Estilo del contenedor del botón */
.leaflet-control-layers-list label {
    position: relative;
    display: block;
    width: 48px;
    height: 48px;
    padding: 0 !important;
    margin: 0 !important;
}

/* El icono visual */
.layer-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: white;
    border: 2px solid #cbd5e1;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    pointer-events: none;
    /* Deja que el clic pase al input */
}

/* Cambio de estilo cuando el input hermano está marcado */
.leaflet-control-layers-selector:checked+span .layer-btn,
.leaflet-control-layers-selector:checked~.layer-btn {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

/* Asegura que el contenedor de la vista no sea más alto que el panel del admin */
.view-section {
    max-height: calc(100vh - 60px);
    /* Ajusta 60px según la altura de tu top-bar de admin */
}

/* Forzar que las leyendas y controles de Leaflet estén siempre visibles */
.leaflet-bottom.leaflet-right {
    margin-bottom: 15px !important;
    /* Separación del borde inferior */
    margin-right: 15px !important;
    /* Separación del borde derecho */
}

.leaflet-top.leaflet-right {
    margin-top: 15px !important;
}

/* Evitar que el mapa se estire infinitamente */
#main-leaflet-map {
    height: 100% !important;
    width: 100% !important;
}