/* ============================================
   SGTI - Mapa de Rutas Styles
   ============================================ */

.mapa-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 140px);
}

.mapa-sidebar {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

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

#mapaLeaflet {
    width: 100%;
    height: 100%;
}

/* Ruta list */
.ruta-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ruta-card {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.ruta-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}

.ruta-card.active {
    border-color: var(--accent-blue);
    background: rgba(46, 134, 171, 0.04);
}

.ruta-card .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.ruta-card h4 {
    font-size: 0.9rem;
    color: var(--navy-900);
    margin-bottom: 4px;
}

.ruta-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ruta-card .tolerancia {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Vehicle markers info */
.vehiculo-info-card {
    padding: 12px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    margin-top: 6px;
    font-size: 0.78rem;
}

.vehiculo-info-card .desviado {
    color: var(--danger-red);
    font-weight: 600;
}

.vehiculo-info-card .en-ruta {
    color: var(--success-teal);
    font-weight: 600;
}

/* Legend */
.mapa-legend {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.8rem;
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 500;
}

.mapa-legend h4 {
    font-size: 0.75rem;
    margin-bottom: 8px;
    color: var(--navy-900);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Route form */
.ruta-form-card {
    padding: 16px;
}

.ruta-form-card h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--navy-900);
}

.puntos-editor {
    max-height: 300px;
    overflow-y: auto;
}

.punto-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.punto-row input {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.punto-row .punto-numero {
    font-weight: 700;
    color: var(--accent-blue);
    min-width: 24px;
    text-align: center;
}

/* GPS Simulation Controls */
.gps-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gps-controls .btn-sm {
    flex: 1;
    min-width: 100px;
}

@media (max-width: 1024px) {
    .mapa-container {
        flex-direction: column;
        height: auto;
    }
    .mapa-sidebar {
        width: 100%;
        max-height: 300px;
    }
    .mapa-main {
        height: 400px;
    }
}