#mcb-contenedor-general {
    width: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #334155;
    box-sizing: border-box;
}

#mcb-contenedor-general * {
    box-sizing: border-box;
}

#mcb-titulo-principal {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 16px 0 !important;
    text-align: left;
}

/* Ocultar atribución de Leaflet */
.leaflet-control-attribution {
    display: none !important;
}

/* Pines de color dinámicos */
.mcb-custom-pin {
    background: none;
    border: none;
}

/* Contadores / Métricas */
#mcb-contadores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.mcb-card-contador {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.mcb-num-contador {
    display: block;
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #0284c7 !important;
    line-height: 1.2 !important;
}

.mcb-label-contador {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Barra de Filtros */
#mcb-barra-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#mcb-barra-filtros input,
#mcb-barra-filtros select {
    flex: 1 1 160px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px !important;
    outline: none;
    background-color: #fff;
    color: #334155;
    height: 38px;
}

#mcb-barra-filtros input:focus,
#mcb-barra-filtros select:focus {
    border-color: #0284c7;
}

#mcb-btn-limpiar {
    padding: 8px 15px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    height: 38px;
    transition: background 0.2s;
}

#mcb-btn-limpiar:hover { background: #dc2626; }

/* Contenedor del Mapa */
#mcb-mapa-wrapper {
    position: relative;
    width: 100%;
    height: 560px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#mcb-mapa { width: 100%; height: 100%; z-index: 1; }

#mcb-loader {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #0284c7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Indicador flotante en segundo plano */
#mcb-bg-status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 998;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    color: #475569;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcb-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #0284c7;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(2, 132, 199, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

/* Panel Lateral de Ficha */
#mcb-contenedor-general #mcb-panel-lateral {
    position: absolute;
    top: 0; right: 0;
    width: 380px;
    height: 100%;
    background: #ffffff;
    z-index: 999;
    box-shadow: -4px 0 16px rgba(0,0,0,0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px 20px;
    overflow-y: auto;
}

#mcb-contenedor-general #mcb-panel-lateral.mcb-oculto { transform: translateX(100%); }

#mcb-cerrar-panel {
    position: absolute;
    top: 14px; right: 16px;
    background: #f1f5f9;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    display: flex; align-items: center; justify-content: center;
}

#mcb-cerrar-panel:hover { background: #e2e8f0; color: #0f172a; }

.mcb-ficha-titulo {
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #0f172a !important;
    margin: 0 0 12px 0 !important;
    padding-right: 25px;
}

.mcb-ficha-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mcb-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.mcb-badge-tipo { background: #e0f2fe; color: #0369a1; }
.mcb-badge-nat { background: #f1f5f9; color: #475569; }
.mcb-badge-alcance { background: #fef3c7; color: #92400e; }

.mcb-ficha-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.mcb-ficha-label { font-size: 11px !important; font-weight: 700 !important; text-transform: uppercase; color: #94a3b8 !important; margin-bottom: 4px !important; }
.mcb-ficha-val { font-size: 13px !important; color: #334155 !important; line-height: 1.5 !important; margin: 0 !important; }

.mcb-ficha-contacto { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.mcb-btn-link {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 12px; background-color: #0284c7; color: #ffffff !important;
    text-decoration: none !important; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.mcb-btn-link:hover { background-color: #0369a1; }
.mcb-info-pill { font-size: 12px; color: #475569; background: #f8fafc; padding: 6px 10px; border-radius: 6px; border: 1px solid #e2e8f0; }

/* Leyenda de Colores */
#mcb-leyenda-wrapper {
    margin-top: 15px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}

.mcb-leyenda-titulo {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: #64748b !important;
    margin: 0 0 8px 0 !important;
}

#mcb-leyenda-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mcb-leyenda-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #334155;
}

.mcb-leyenda-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Listado General de Actores */
#mcb-listado-seccion {
    margin-top: 25px;
}

.mcb-listado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.mcb-listado-header h3 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
}

#mcb-listado-count {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

#mcb-listado-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 5px;
}

.mcb-actor-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mcb-actor-card:hover {
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
    transform: translateY(-2px);
}

.mcb-actor-card-nombre {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 6px 0 !important;
}

.mcb-actor-card-ubi {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.mcb-actor-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    padding-top: 8px;
    border-top: 1px dashed #f1f5f9;
}

.mcb-oculto { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    #mcb-contadores { grid-template-columns: 1fr; }
    #mcb-barra-filtros input, #mcb-barra-filtros select { flex: 1 1 100%; }
    #mcb-listado-grid { grid-template-columns: 1fr; }
    #mcb-contenedor-general #mcb-panel-lateral {
        width: 100%; height: 65%;
        top: auto; bottom: 0;
        border-radius: 16px 16px 0 0;
    }
    #mcb-contenedor-general #mcb-panel-lateral.mcb-oculto { transform: translateY(100%); }
}