body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#map {
    width: 100%;
    height: calc(100vh - 56px); /* Full height minus navbar height */
    z-index: 1;
}

#map-container {
    position: relative;
}

#project-selector-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000; /* Ensure it's above the map but below modals if any */
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#project-selector-container label {
    margin-right: 10px;
    font-weight: bold;
}

.navbar {
    z-index: 2;
}

/* --- Estilos para los marcadores personalizados y la tabla --- */

/* Contenedor del icono de Leaflet. No necesita estilos. */
.custom-marker-icon {
    background: none;
    border: none;
}

.marker-inner-dot {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* La chincheta usa una variable CSS '--marker-color' definida en el HTML */
.marker-pin {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--marker-color);
    border: 2px solid #fff;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

.marker-pin::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 26px; /* Posiciona la punta justo debajo del círculo */
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid var(--marker-color);
}

/* Punto de color en la tabla de marcadores */
.color-dot {
    height: 15px;
    width: 15px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid #6c757d;
}

.marker-row {
    cursor: pointer;
}

.marker-row-clickable {
    cursor: pointer;
}

.leaflet-custom-div-icon {
    background: transparent;
    border: none;
}

.marker-svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.5));
}

/* Legend Styles */
.legend-container {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    border: 1px solid #ddd;
}

.legend {
    padding: 8px 12px;
    font: 16px/1.5 Arial, Helvetica, sans-serif;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    line-height: 24px;
    color: #333;
}
.legend h4 {
    margin: 0 0 8px;
    color: #000;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}
.legend-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.legend-item:hover {
    background-color: #f4f4f4;
}
.legend-item-inactive {
    opacity: 0.6;
    text-decoration: line-through;
    background-color: #e9ecef;
}

/* --- Action Icons in Tables --- */
.actions-cell a.icon-action {
    color: #6c757d; /* secondary */
    text-decoration: none;
    margin: 0 4px;
    font-size: 1.1rem;
    transition: transform 0.1s ease-in-out, color 0.1s ease-in-out;
    display: inline-block; /* Allows transform */
}

.actions-cell a.icon-action:hover {
    transform: scale(1.2);
    color: #212529; /* dark */
}

.actions-cell a.icon-action.text-danger:hover {
    color: #dc3545 !important; /* Ensure hover on delete is red */
}
