/* Estilos específicos para el dashboard histórico */

.filtros-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #22223b;
    border-radius: 8px;
    align-items: end;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filtro-grupo label {
    color: #deeaff;
    font-size: 0.9em;
    font-weight: 500;
}

.container-cobertura h2 {
    color: #deeaff;
    font-size: 1.4em;
    margin-bottom: 20px;
    text-align: center;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #485466;
    border-radius: 4px;
    background: #363241;
    color: #deeaff;
    font-size: 0.9em;
    min-width: 120px;
}

.form-control:focus {
    outline: none;
    border-color: #1d71ff;
    box-shadow: 0 0 0 2px rgba(29, 113, 255, 0.2);
}

.btn-filtrar,
.btn-exportar {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-filtrar {
    background: #1d71ff;
    color: white;
}

.btn-filtrar:hover {
    background: #0056cc;
}

.btn-exportar {
    background: #28a745;
    color: white;
}

.btn-exportar:hover {
    background: #1e7e34;
}

.resumen-periodo {
    margin-bottom: 30px;
}

.resumen-card {
    background: #22223b;
    padding: 20px;
    border-radius: 8px;
}

.resumen-card h3 {
    color: #deeaff;
    margin-bottom: 15px;
    text-align: center;
}

.resumen-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #73b3ef;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: #deeaff;
    font-size: 1.4em;
    font-weight: bold;
}

.cobertura-historico {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.historico-chart {
    grid-column: span 2;
}

.historico-chart h2 {
    color: #deeaff;
    margin-bottom: 15px;
    text-align: center;
}

.chart-container {
    height: 400px;
    position: relative;
}

.historico-tabla {
    margin-bottom: 30px;
}

.historico-tabla h2 {
    color: #deeaff;
    margin-bottom: 15px;
    text-align: center;
}

.tabla-container {
    overflow-x: auto;
    background: #22223b;
    border-radius: 8px;
}

.tabla-historico {
    width: 100%;
    border-collapse: collapse;
}

.tabla-historico th {
    background: #1d71ff;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-size: 0.85em;
    border-bottom: 2px solid #363241;
}

.tabla-historico td {
    padding: 10px 8px;
    text-align: center;
    color: #deeaff;
    font-size: 0.85em;
    border-bottom: 1px solid #485466;
}

.tabla-historico tbody tr:hover {
    background: rgba(29, 113, 255, 0.1);
}

.header_main {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 0;
}

.itm-link {
    padding: 10px 20px;
    background: #485466;
    color: #deeaff;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.itm-link:hover {
    background: #1d71ff;
    color: white;
}

.itm-link.active {
    background: #1d71ff;
    color: white;
}

/* ===== ESTILOS PARA TARJETAS DE COBERTURA POR CLIENTE ===== */

/* Contenedor principal de cobertura por cliente */
.cobertura-por-cliente {
    margin: 30px 0;
    padding: 0 20px;
}

.cobertura-por-cliente h2 {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Contenedor de tarjetas con flexbox responsivo */
#cobertura-clientes-periodo {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    padding: 0;
}

/* Estilos base para las tarjetas de cliente */
.card-cliente {
    background: linear-gradient(135deg, #2a2d47 0%, #1e1e2f 100%);
    border: 2px solid rgba(79, 172, 254, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 280px;
    max-width: 320px;
    flex: 1 1 auto;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-cliente::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    opacity: 0.8;
}

.card-cliente:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(79, 172, 254, 0.15);
    border-color: rgba(79, 172, 254, 0.4);
}

/* Contenido de la tarjeta */
.card-cliente .card {
    background: transparent;
    border: none;
    height: 100%;
}

.card-cliente .card-body {
    padding: 24px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Título del cliente */
.card-cliente .card-title {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
    word-break: break-word;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Filas de datos */
.card-cliente-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.card-cliente-row:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.card-cliente-row:last-child {
    margin-bottom: 0;
}

/* Etiquetas */
.card-cliente-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

/* Números y porcentajes */
.card-cliente-num {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 8px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.card-cliente-percent {
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    min-width: 60px;
    text-align: right;
}

/* Colores para cubiertos (verde) */
.cubiertos {
    color: #00ff88 !important;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Colores para no cubiertos (rojo) */
.no-cubiertos {
    color: #ff6b6b !important;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Fila total con estilo especial */
.card-cliente-total {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 2px solid rgba(79, 172, 254, 0.3) !important;
    margin-top: 8px;
    font-weight: 700;
}

.card-cliente-total .card-cliente-num.total {
    color: #ffffff;
    font-size: 1.3rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Animaciones de entrada */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-cliente {
    animation: slideInUp 0.6s ease-out;
}

.card-cliente:nth-child(1) {
    animation-delay: 0.1s;
}

.card-cliente:nth-child(2) {
    animation-delay: 0.2s;
}

.card-cliente:nth-child(3) {
    animation-delay: 0.3s;
}

.card-cliente:nth-child(4) {
    animation-delay: 0.4s;
}

.card-cliente:nth-child(5) {
    animation-delay: 0.5s;
}

.card-cliente:nth-child(6) {
    animation-delay: 0.6s;
}

/* Responsive */
@media (max-width: 768px) {
    .filtros-container {
        flex-direction: column;
    }

    .filtro-grupo {
        width: 100%;
    }

    .form-control {
        min-width: unset;
        width: 100%;
    }

    .historico-chart {
        grid-column: span 1;
    }

    .cobertura-historico {
        grid-template-columns: 1fr;
    }

    .resumen-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* Tabletas */
@media (max-width: 1024px) {
    #cobertura-clientes-periodo {
        gap: 16px;
        padding: 0 10px;
    }

    .card-cliente {
        min-width: 260px;
        max-width: 300px;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .cobertura-por-cliente {
        padding: 0 10px;
    }

    #cobertura-clientes-periodo {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .card-cliente {
        min-width: 90vw;
        max-width: 95vw;
        width: 100%;
    }

    .card-cliente .card-title {
        font-size: 1rem;
    }

    .card-cliente-row {
        padding: 8px 12px;
    }

    .card-cliente-num {
        font-size: 1.1rem;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .card-cliente {
        min-width: 95vw;
        max-width: 95vw;
    }

    .card-cliente .card-body {
        padding: 20px 16px;
    }

    .card-cliente .card-title {
        font-size: 0.95rem;
        margin-bottom: 16px;
    }

    .card-cliente-row {
        padding: 6px 10px;
        margin-bottom: 8px;
    }

    .card-cliente-label {
        font-size: 0.85rem;
    }

    .card-cliente-num {
        font-size: 1rem;
        margin: 0 6px;
    }

    .card-cliente-percent {
        font-size: 0.9rem;
        min-width: 50px;
    }
}