/* Llamadas Pendientes Plugin - Estilos CSS Original + Colores de Antigüedad */

/* NUEVO: Fondo blanco para servicios futuros */
.lp-tabla tbody tr.lp-servicio-futuro {
    background-color: #ffffff !important;
}

.lp-leyenda-item.lp-servicio-futuro {
    background: white;
    border: 2px solid #28a745;
}


.lp-container { 
    margin: 20px 0; 
}

.lp-filtros { 
    background: #f9f9f9; 
    padding: 15px; 
    margin-bottom: 20px; 
    border-radius: 5px; 
}

.lp-filtros select { 
    margin: 0 10px 10px 0; 
    padding: 8px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
}

.lp-filtros input[type="submit"] { 
    background: #0073aa; 
    color: white; 
    border: none; 
    padding: 8px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
}

.lp-tabla { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
}

.lp-tabla th, .lp-tabla td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
}

.lp-tabla th { 
    background-color: #f2f2f2; 
    font-weight: bold; 
}

.lp-tabla tr:hover { 
    background-color: #f5f5f5; 
}

.lp-btn-accion { 
    background: #28a745; 
    color: white; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 12px; 
    margin: 2px; 
}

.lp-btn-accion:hover { 
    background: #218838; 
}

.lp-btn-accion:disabled { 
    background: #6c757d; 
    cursor: not-allowed; 
}

.lp-btn-resuelta { 
    background: #17a2b8; 
}

.lp-btn-resuelta:hover { 
    background: #138496; 
}

.lp-btn-eliminar { 
    background: #dc3545; 
}

.lp-btn-eliminar:hover { 
    background: #c82333; 
}

.lp-btn-cambiar-ruta { 
    background: #fd7e14; 
    color: white; 
}

.lp-btn-cambiar-ruta:hover { 
    background: #e66a00; 
}

.lp-select-ruta { 
    padding: 4px 8px; 
    margin: 2px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    font-size: 12px; 
    max-width: 150px; 
}

.lp-acciones-container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 5px; 
    align-items: center; 
}

.lp-seccion { 
    margin-bottom: 30px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    overflow: hidden; 
}

.lp-titulo-seccion { 
    background: #0073aa; 
    color: white; 
    padding: 12px 15px; 
    margin: 0; 
    font-size: 16px; 
}

.lp-mensaje { 
    padding: 10px; 
    margin: 10px 0; 
    border-radius: 4px; 
}

.lp-mensaje.success { 
    background: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb; 
}

.lp-mensaje.error { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb; 
}

.lp-nombre-cliente { 
    font-weight: bold; 
    color: #333; 
}

.lp-telefono-link { 
    color: #0073aa; 
    text-decoration: none; 
}

.lp-telefono-link:hover { 
    color: #005a87; 
    text-decoration: underline; 
}

.lp-formulario-nuevo { 
    background: #f8f9fa; 
    border: 2px solid #28a745; 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 20px; 
    display: none; 
}

.lp-formulario-nuevo h4 { 
    margin: 0 0 15px 0; 
    color: #28a745; 
}

.lp-form-row { 
    display: flex; 
    gap: 15px; 
    margin-bottom: 15px; 
    flex-wrap: wrap; 
}

.lp-form-group { 
    display: flex; 
    flex-direction: column; 
}

.lp-form-group label { 
    font-weight: bold; 
    margin-bottom: 5px; 
    color: #333; 
}

.lp-form-group select, 
.lp-form-group input, 
.lp-form-group textarea { 
    padding: 8px 12px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    font-size: 14px; 
}

.lp-form-group textarea { 
    resize: vertical; 
    min-height: 80px; 
}

.lp-btn-toggle-form { 
    background: #28a745; 
    color: white; 
    border: none; 
    padding: 12px 20px; 
    border-radius: 5px; 
    cursor: pointer; 
    font-size: 14px; 
    margin-bottom: 15px; 
    font-weight: bold; 
}

.lp-btn-toggle-form:hover { 
    background: #218838; 
}

.lp-btn-crear { 
    background: #007cba; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 14px; 
    font-weight: bold; 
}

.lp-btn-crear:hover { 
    background: #005a87; 
}

.lp-btn-crear:disabled { 
    background: #6c757d; 
    cursor: not-allowed; 
}

/* Estilos para autocompletado de clientes */
.lp-cliente-autocomplete {
    position: relative;
    width: 100%;
}

.lp-cliente-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    text-align: left;
    min-width: 250px;
}

.lp-cliente-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.lp-cliente-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.lp-cliente-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.lp-cliente-option:hover,
.lp-cliente-option.selected {
    background: #0073aa;
    color: white;
}

.lp-cliente-option:last-child {
    border-bottom: none;
}

.lp-no-results {
    padding: 8px 12px;
    color: #666;
    font-style: italic;
}

.lp-loading {
    padding: 8px 12px;
    color: #0073aa;
    text-align: center;
}

/* Estilos para llamadas asignadas */
.lp-llamada-asignada {
    background-color: #e8f4f8 !important;
}

.lp-ruta-asignada {
    font-size: 11px;
    color: #0073aa;
    background: #cce7f0;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 3px;
    display: inline-block;
    font-weight: 500;
}

/* Estilos para botón WhatsApp */
.lp-btn-whatsapp {
    background: #25d366;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 2px;
}

.lp-btn-whatsapp:hover {
    background: #128c7e;
}

.lp-btn-whatsapp:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Estilos para el área de cambio de ruta */
.lp-cambio-ruta-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 5px;
    background: #fff3cd;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

.lp-cambio-ruta-label {
    font-size: 11px;
    color: #856404;
    font-weight: bold;
}

/* NUEVO: Colores de antigüedad */
.lp-nueva {
    background-color: #d4f6d4 !important; /* Verde claro - menos de 1 día */
}

.lp-reciente {
    background-color: #fff9c4 !important; /* Amarillo claro - 1-3 días */
}

.lp-antigua {
    background-color: #ffe4b5 !important; /* Naranja claro - 3-7 días */
}

.lp-muy-antigua {
    background-color: #ffcdd2 !important; /* Rojo claro - más de 7 días */
}

/* NUEVO: Leyenda de colores */
.lp-leyenda-colores {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
}

.lp-leyenda-colores h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.lp-leyenda-item {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px 5px 2px 0;
    border-radius: 3px;
    font-size: 12px;
    border: 1px solid #ccc;
}

.lp-leyenda-item.lp-nueva {
    background-color: #d4f6d4;
}

.lp-leyenda-item.lp-reciente {
    background-color: #fff9c4;
}

.lp-leyenda-item.lp-antigua {
    background-color: #ffe4b5;
}

.lp-leyenda-item.lp-muy-antigua {
    background-color: #ffcdd2;
}

/* ============================================
   NUEVO v3.1: ESTILOS PARA FECHA DE SERVICIO
   ============================================ */

/* Badge de fecha de servicio - Base */
.lp-fecha-servicio {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px !important;
    font-weight: 700 !important;
    font-style: normal !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    margin: 2px 0;
    letter-spacing: 0.3px;
    border: 2px solid transparent;
}

/* Fecha de servicio FUTURA - Verde destacado con animación */
.lp-fecha-servicio.lp-fecha-servicio-futura {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: white !important;
    border-color: #2e7d32;
    animation: lp-pulso-suave 2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Fecha de servicio PASADA - Naranja/Ámbar */
.lp-fecha-servicio.lp-fecha-servicio-pasada {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
    color: white !important;
    border-color: #e65100;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Animación de pulso para fechas futuras */
@keyframes lp-pulso-suave {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 5px 12px rgba(76, 175, 80, 0.4);
    }
}

/* ================================================
   NUEVO v3.1: ESTADÍSTICAS POR TIPO DE SERVICIO
   ================================================ */

.lp-estadisticas-motivos {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 20px 0 25px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lp-estadisticas-motivos h4 {
    margin: 0 0 14px 0;
    font-size: 17px;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.lp-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.lp-stat-item {
    background: white;
    padding: 10px 16px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.lp-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    border-color: #0073aa;
}

.lp-stat-item strong {
    color: #0073aa;
    margin: 0 4px;
    font-weight: 600;
}

/* =======================================================
   NUEVO v3.2: ESTILOS PARA ESTADÍSTICAS POR DÍA DE SEMANA
   ======================================================= */

.lp-estadisticas-dias {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #90caf9;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 20px 0 25px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lp-estadisticas-dias h4 {
    margin: 0 0 14px 0;
    font-size: 17px;
    color: #1565c0;
    font-weight: 600;
    border-bottom: 2px solid #1976d2;
    padding-bottom: 8px;
}

.lp-dias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.lp-dia-item {
    background: white;
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
}


.lp-dia-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    border-color: #1976d2;
}

.lp-dia-porcentaje {
    background: #f0f4c3;
    color: #558b2f;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.lp-porcentaje {
    background: #fff9c4;
    color: #827717;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    min-width: 55px;        /* 🔹 Mantiene ancho similar */
    text-align: center;     /* 🔹 Centra el texto */
    box-sizing: border-box; /* 🔹 Asegura alineación uniforme */
}


.lp-dia-nombre {
    font-size: 15px;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 4px;
}

.lp-dia-fecha {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
}

.lp-dia-stats {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    margin-top: 8px;
}

.lp-creadas {
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.lp-resueltas {
    background: #c8e6c9;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Clases especiales para alertar sobre días con muchas llamadas */
.lp-dia-alto {
    border-color: #f44336 !important;
    background: #ffebee !important;
}

.lp-dia-alto .lp-dia-nombre {
    color: #c62828 !important;
}

.lp-dia-medio {
    border-color: #ff9800 !important;
    background: #fff3e0 !important;
}

.lp-dia-medio .lp-dia-nombre {
    color: #e65100 !important;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .lp-dias-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .lp-dia-item {
        padding: 10px 8px;
    }
    
    .lp-dia-nombre {
        font-size: 13px;
    }
    
    .lp-dia-fecha {
        font-size: 10px;
    }
    
    .lp-creadas,
    .lp-resueltas {
        font-size: 11px;
        padding: 3px 6px;
    }
}
