/* Map container — fills remaining flex space (body is h-screen flex-col) */
#mapa-contenedor {
    position: relative;
    flex: 1;
    min-height: 0;
    /* Aísla los z-index internos de Leaflet (1000+) para que sus controles
       no tapen la cabecera ni la barra de navegación inferior */
    isolation: isolate;
}

/* Marcadores escalables por zoom via --mscale en #mapa */
.mk-dot {
    transform: scale(var(--mscale, 1));
    transform-origin: center center;
    transition: transform 0.15s;
}
.mk-dot:hover {
    transform: scale(calc(var(--mscale, 1) * 1.35)) !important;
}

/* Leaflet overrides for dark theme */
.leaflet-popup-content-wrapper {
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.leaflet-popup-tip {
    background: #1e293b;
}
.leaflet-popup-content-wrapper a {
    color: #14b8a6;
}
.leaflet-control-zoom a {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}
.leaflet-control-zoom a:hover {
    background: #273548 !important;
    color: #f1f5f9 !important;
}
.leaflet-control-attribution {
    background: rgba(15,23,42,0.8) !important;
    color: #475569 !important;
    font-size: 10px;
}
.leaflet-control-attribution a { color: #64748b !important; }

/* Custom marker */
.punto-marker {
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    transition: transform 0.15s;
    cursor: pointer;
}
.punto-marker:hover { transform: scale(1.3); }

/* Sidebar panel */
#panel-lateral {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(8px);
    border-left: 1px solid #334155;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 1000;
}
#panel-lateral.visible {
    transform: translateX(0);
}

/* Scrollbar dark */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Form styles */
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.form-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
}
.form-input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 2px rgba(20,184,166,0.15);
}
.form-input::placeholder { color: #475569; }

/* Category badge */
.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Import drop zone */
#zona-drop {
    border: 2px dashed #334155;
    border-radius: 12px;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
#zona-drop.drag-over {
    border-color: #14b8a6;
    background: rgba(20,184,166,0.05);
}

/* Añadir padding inferior en móvil para nav bar */
.pb-nav { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }

/* Sync monitor */
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes prog  { 0%{left:-40%} 100%{left:100%} }
.sync-spin { display:inline-block; animation: spin 1s linear infinite; }
.sync-progress-anim { position:relative; animation: prog 1.4s ease-in-out infinite; width:40%; }

/* Mini mapa en formulario */
#mini-mapa { height: 220px; border-radius: 8px; overflow: hidden; }
