﻿/* =======================================
   ESTILOS PARA LA VISTA DE HORAS EXTRAS - VERSIÓN MEJORADA
   ======================================= */

/* Variables CSS específicas para horas extras */
:root {
    --horas-extras-primary: #28a745;
    --horas-extras-secondary: #6c757d;
    --horas-extras-success: #28a745;
    --horas-extras-danger: #dc3545;
    --horas-extras-warning: #ffc107;
    --horas-extras-info: #17a2b8;
    --horas-extras-bg: #f8f9fa;
    --horas-extras-border: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --modal-backdrop: rgba(0, 0, 0, 0.65);
    --modal-baja-primary: #dc3545;
    --modal-baja-secondary: #fd7e14;
}

/* =======================================
   LAYOUT GENERAL
   ======================================= */

.horas-extras-container {
    max-width: 100%;
    overflow: hidden;
}

.horas-extras-header {
    background: linear-gradient(135deg, var(--horas-extras-primary), #20c997);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

/* =======================================
   ESTADÍSTICAS GENERALES
   ======================================= */

.estadisticas-generales {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    border: 1px solid var(--horas-extras-border);
}

.estadistica-card {
    text-align: center;
    padding: 1rem;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .estadistica-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
        border-color: var(--horas-extras-primary);
    }

.estadistica-numero {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.estadistica-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =======================================
   LEYENDA
   ======================================= */

.leyenda-horas-extras {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1rem;
    border: 1px solid var(--horas-extras-border);
}

.leyenda-item {
    display: inline-flex;
    align-items: center;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

    .leyenda-item .badge {
        margin-right: 0.5rem;
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
    }

/* =======================================
   TABLA PRINCIPAL - SISTEMA DE SCROLL UNIFICADO MEJORADO
   ======================================= */

.horas-extras-contenedor-principal {
    height: 75vh;
    min-height: 700px;
    max-height: 1000px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--horas-extras-border);
    border-radius: 0.375rem;
    overflow: hidden;
    position: relative;
    background: white;
}

.horas-extras-scroll-contenedor {
    flex: 1;
    overflow: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.horas-extras-table {
    font-size: 0.85rem; /* Aumentado de 0.8rem a 0.85rem */
    min-width: 2800px; /* Aumentado para acomodar celdas más grandes */
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
}

    /* =======================================
   HEADERS DE LA TABLA
   ======================================= */

    .horas-extras-table thead th {
        position: sticky;
        top: 0;
        z-index: 30;
        border: 1px solid #dee2e6;
        vertical-align: middle;
        background-color: #343a40;
        color: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        padding: 0.75rem 0.5rem; /* Aumentado el padding */
    }

/* Columna de agentes - sticky horizontal - MEJORADA */
.agente-column {
    min-width: 220px !important; /* Aumentado de 200px a 220px */
    max-width: 220px !important;
    width: 220px !important;
    background-color: #2c3e50 !important;
    color: white !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 40 !important;
    border-right: 3px solid #34495e !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15) !important;
}

.horas-extras-table thead .agente-column {
    z-index: 50 !important;
}

/* Columnas de totales - MEJORADAS */
.total-column {
    min-width: 90px !important; /* Aumentado de 80px a 90px */
    width: 90px !important;
    text-align: center;
    background-color: #495057 !important;
    position: sticky !important;
    z-index: 35 !important;
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.1) !important;
}

.total-solicitadas {
    left: 220px !important; /* Ajustado por el nuevo ancho de agente-column */
}

.total-aceptadas {
    left: 310px !important; /* 220 + 90 */
}

.total-rechazadas {
    left: 400px !important; /* 220 + 90 + 90 */
}

/* Headers de meses - MEJORADOS */
.mes-header {
    min-width: 560px !important; /* Aumentado de 420px a 560px (7 columnas * 80px cada una) */
    text-align: center;
    background-color: #6f42c1 !important;
    color: white !important;
    position: relative;
}

    .mes-header.mes-completo {
        background-color: #28a745 !important;
    }

    .mes-header.mes-futuro {
        background-color: #6c757d !important;
    }

.mes-titulo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem; /* Aumentado de 0.25rem a 0.5rem */
}

.mes-nombre {
    font-weight: 700;
    font-size: 1rem; /* Aumentado de 0.9rem a 1rem */
}

.mes-numero {
    font-size: 0.8rem; /* Aumentado de 0.7rem a 0.8rem */
    opacity: 0.9; /* Aumentado de 0.8 a 0.9 */
}

/* Subheader para slots de días - MEJORADO */
.subheader-dias th {
    background-color: #495057 !important;
    font-size: 0.8rem; /* Aumentado de 0.7rem a 0.8rem */
    padding: 0.5rem; /* Aumentado de 0.25rem a 0.5rem */
    height: 40px; /* Aumentado de 30px a 40px */
}

.dia-slot-header {
    min-width: 80px !important; /* Aumentado de 60px a 80px */
    width: 80px !important;
    text-align: center;
    font-weight: 600;
}

/* =======================================
   CELDAS DE DATOS - MEJORADAS
   ======================================= */

.horas-extras-table tbody td {
    border: 1px solid var(--horas-extras-border);
    vertical-align: middle;
    padding: 0.75rem 0.5rem; /* Aumentado el padding */
}

/* Información del agente - MEJORADA */
.agente-info {
    padding: 0.75rem; /* Aumentado de 0.5rem a 0.75rem */
    text-align: left;
    background-color: rgba(44, 62, 80, 0.95) !important;
    border-radius: 0.375rem; /* Aumentado de 0.25rem a 0.375rem */
    margin: 0.2rem; /* Aumentado de 0.1rem a 0.2rem */
}

.agente-nombre {
    font-weight: 600;
    color: #ecf0f1 !important;
    margin-bottom: 0.5rem; /* Aumentado de 0.25rem a 0.5rem */
    font-size: 0.9rem; /* Aumentado de 0.85rem a 0.9rem */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.agente-detalle {
    font-size: 0.75rem; /* Aumentado de 0.7rem a 0.75rem */
    color: #bdc3c7 !important;
    line-height: 1.3; /* Aumentado de 1.2 a 1.3 */
}

.agente-tip {
    font-weight: 500;
    color: #3498db !important;
    background-color: rgba(52, 152, 219, 0.25); /* Aumentado la opacidad */
    padding: 0.2rem 0.4rem; /* Aumentado el padding */
    border-radius: 0.25rem; /* Aumentado de 0.2rem a 0.25rem */
    margin-right: 0.25rem;
}

.agente-rango {
    color: #95a5a6 !important;
    font-weight: 500;
}

/* Columnas de totales - contenido MEJORADO */
.total-column {
    text-align: center;
    background-color: #f8f9fa !important;
    padding: 0.75rem 0.5rem; /* Aumentado el padding */
}

.total-numero {
    font-size: 1.2rem; /* Aumentado de 1.1rem a 1.2rem */
    font-weight: 700;
    line-height: 1;
}

.total-porcentaje {
    font-size: 0.75rem; /* Aumentado de 0.7rem a 0.75rem */
    color: #6c757d;
    margin-top: 0.3rem; /* Aumentado de 0.2rem a 0.3rem */
}

/* =======================================
   CELDAS DE DÍAS (SLOTS DE HORAS EXTRAS) - MEJORADAS SIGNIFICATIVAMENTE
   ======================================= */

.dia-slot-cell {
    min-width: 80px !important; /* Aumentado de 60px a 80px */
    width: 80px !important;
    height: 80px; /* Aumentado de 60px a 80px */
    text-align: center;
    padding: 0.5rem; /* Aumentado de 0.2rem a 0.5rem */
    position: relative;
    transition: all 0.3s ease; /* Aumentado de 0.2s a 0.3s */
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

    .dia-slot-cell.vacia {
        background-color: #ffffff;
        cursor: default;
    }

    .dia-slot-cell.tiene-hora-extra {
        background-color: #e3f2fd;
        border: 2px solid #2196f3;
        cursor: pointer;
        box-shadow: 0 3px 6px rgba(33, 150, 243, 0.25); /* Aumentado la sombra */
    }

        .dia-slot-cell.tiene-hora-extra:hover {
            transform: scale(1.1); /* Aumentado de 1.05 a 1.1 */
            z-index: 15; /* Aumentado de 10 a 15 */
            box-shadow: 0 6px 12px rgba(33, 150, 243, 0.4); /* Aumentado la sombra */
        }

    /* Estados específicos de horas extras */
    .dia-slot-cell.estado-pendiente {
        background-color: #fff3cd !important;
        border-color: #ffc107 !important;
        animation: pulsoPendiente 2s ease-in-out infinite;
    }

    .dia-slot-cell.estado-aceptado {
        background-color: #d1e7dd !important;
        border-color: #28a745 !important;
    }

    .dia-slot-cell.estado-rechazado {
        background-color: #f8d7da !important;
        border-color: #dc3545 !important;
    }

/* Contenido de la celda de hora extra - MEJORADO SIGNIFICATIVAMENTE */
.hora-extra-contenido {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.4rem; /* Aumentado de 0.2rem a 0.4rem */
}

.dia-numero {
    font-size: 1rem; /* Aumentado de 0.8rem a 1rem */
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.estado-icono {
    font-size: 1.4rem; /* Aumentado de 1rem a 1.4rem */
    line-height: 1;
}

.turno-abrev {
    font-size: 0.7rem; /* Aumentado de 0.6rem a 0.7rem */
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    background-color: rgba(255, 255, 255, 0.9); /* Aumentado la opacidad */
    padding: 0.2rem 0.3rem; /* Aumentado el padding */
    border-radius: 0.25rem; /* Aumentado de 0.2rem a 0.25rem */
    line-height: 1;
    min-width: 20px; /* Añadido ancho mínimo */
    text-align: center;
}

/* =======================================
   ANIMACIONES
   ======================================= */

@keyframes pulsoPendiente {
    0%, 100% {
        box-shadow: 0 3px 6px rgba(255, 193, 7, 0.3);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.5), 0 3px 6px rgba(255, 193, 7, 0.3);
    }
}

/* =======================================
   SCROLLBARS PERSONALIZADOS
   ======================================= */

.horas-extras-scroll-contenedor::-webkit-scrollbar {
    width: 14px; /* Aumentado de 12px a 14px */
    height: 14px;
}

.horas-extras-scroll-contenedor::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 7px; /* Ajustado */
}

.horas-extras-scroll-contenedor::-webkit-scrollbar-thumb {
    background: var(--horas-extras-primary);
    border-radius: 7px; /* Ajustado */
    border: 2px solid #f8f9fa;
}

    .horas-extras-scroll-contenedor::-webkit-scrollbar-thumb:hover {
        background: #218838;
    }

.horas-extras-scroll-contenedor::-webkit-scrollbar-corner {
    background: #f8f9fa;
}

/* =======================================
   INDICADOR DE SCROLL
   ======================================= */

.scroll-indicator {
    position: absolute;
    bottom: 15px; /* Aumentado de 10px a 15px */
    right: 15px; /* Aumentado de 10px a 15px */
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 0.5rem 0.75rem; /* Aumentado el padding */
    border-radius: 0.375rem; /* Aumentado de 0.25rem a 0.375rem */
    font-size: 0.8rem; /* Aumentado de 0.75rem a 0.8rem */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.horas-extras-contenedor-principal:hover .scroll-indicator {
    opacity: 1;
}

/* =======================================
   MENSAJE VACÍO
   ======================================= */

.mensaje-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #6c757d;
    padding: 3rem; /* Aumentado de 2rem a 3rem */
}

.mensaje-icono {
    font-size: 4rem; /* Aumentado de 3rem a 4rem */
    opacity: 0.5;
}

.mensaje-texto {
    font-size: 1.2rem; /* Aumentado de 1.1rem a 1.2rem */
    text-align: center;
}

/* =======================================
   MODAL DE DETALLES
   ======================================= */

.modal-horas-extras .modal-header {
    background: linear-gradient(135deg, var(--horas-extras-primary), #20c997);
    color: white;
    border-bottom: none;
}

    .modal-horas-extras .modal-header .btn-close {
        filter: invert(1);
    }

/* =======================================
   RESPONSIVE DESIGN - MEJORADO
   ======================================= */

/* Tablets */
@media (max-width: 1024px) {
    .horas-extras-table {
        font-size: 0.8rem; /* Mantenido más grande que antes */
        min-width: 2400px; /* Ajustado */
    }

    .agente-column {
        min-width: 180px !important;
        max-width: 180px !important;
        width: 180px !important;
    }

    .total-column {
        min-width: 80px !important;
        width: 80px !important;
    }

    .total-solicitadas {
        left: 180px !important;
    }

    .total-aceptadas {
        left: 260px !important;
    }

    .total-rechazadas {
        left: 340px !important;
    }

    .dia-slot-cell {
        min-width: 70px !important;
        width: 70px !important;
        height: 70px;
    }

    .mes-header {
        min-width: 490px !important; /* 7 * 70px */
    }

    .agente-nombre {
        font-size: 0.85rem;
    }

    .estadistica-numero {
        font-size: 1.7rem;
    }

    .estado-icono {
        font-size: 1.2rem;
    }

    .dia-numero {
        font-size: 0.9rem;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .horas-extras-contenedor-principal {
        height: 65vh;
        min-height: 500px;
    }

    .horas-extras-table {
        font-size: 0.75rem;
        min-width: 2000px;
    }

    .agente-column {
        min-width: 140px !important;
        max-width: 140px !important;
        width: 140px !important;
    }

    .total-column {
        min-width: 70px !important;
        width: 70px !important;
    }

    .total-solicitadas {
        left: 140px !important;
    }

    .total-aceptadas {
        left: 210px !important;
    }

    .total-rechazadas {
        left: 280px !important;
    }

    .dia-slot-cell {
        min-width: 60px !important;
        width: 60px !important;
        height: 60px;
        padding: 0.3rem;
    }

    .mes-header {
        min-width: 420px !important; /* 7 * 60px */
    }

    .agente-nombre {
        font-size: 0.8rem;
    }

    .agente-detalle {
        font-size: 0.7rem;
    }

    .dia-numero {
        font-size: 0.85rem;
    }

    .estado-icono {
        font-size: 1.1rem;
    }

    .turno-abrev {
        font-size: 0.65rem;
    }

    .estadisticas-generales .row > div {
        margin-bottom: 1rem;
    }

    .estadistica-numero {
        font-size: 1.5rem;
    }

    .horas-extras-header {
        padding: 1rem;
    }

    .btn-group .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .horas-extras-container {
        padding: 0.5rem;
    }

    .horas-extras-contenedor-principal {
        height: 55vh;
        min-height: 400px;
    }

    .agente-column {
        min-width: 120px !important;
        max-width: 120px !important;
        width: 120px !important;
    }

    .total-column {
        min-width: 60px !important;
        width: 60px !important;
    }

    .total-solicitadas {
        left: 120px !important;
    }

    .total-aceptadas {
        left: 180px !important;
    }

    .total-rechazadas {
        left: 240px !important;
    }

    .dia-slot-cell {
        min-width: 50px !important;
        width: 50px !important;
        height: 50px;
    }

    .mes-header {
        min-width: 350px !important; /* 7 * 50px */
    }

    .estadisticas-generales {
        padding: 0.5rem;
    }

    .estadistica-card {
        padding: 0.5rem;
        min-height: 80px;
    }

    .estadistica-numero {
        font-size: 1.3rem;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

        .btn-group .btn {
            margin-bottom: 0.25rem;
        }
}

/* =======================================
   MODO OSCURO
   ======================================= */

@media (prefers-color-scheme: dark) {
    :root {
        --horas-extras-bg: #1a1a1a;
        --horas-extras-border: #404040;
    }

    .horas-extras-table {
        background-color: #2d2d2d;
        color: #ffffff;
    }

        .horas-extras-table th,
        .horas-extras-table td {
            border-color: var(--horas-extras-border);
        }

    .agente-column {
        background-color: #383838 !important;
    }

    .total-column {
        background-color: #404040 !important;
    }

    .dia-slot-cell.vacia {
        background-color: #2d2d2d;
        border-color: #404040;
    }

    .estadisticas-generales {
        background: #2d2d2d;
        border-color: #404040;
    }

    .estadistica-card {
        background: linear-gradient(135deg, #2d2d2d, #383838);
        border-color: #404040;
        color: #ffffff;
    }

    .leyenda-horas-extras {
        background: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
}

/* =======================================
   MODO DE IMPRESIÓN
   ======================================= */

@media print {
    .btn-group,
    .modal,
    .dropdown,
    .scroll-indicator {
        display: none !important;
    }

    .horas-extras-table {
        font-size: 0.6rem;
        page-break-inside: avoid;
    }

    .agente-column {
        min-width: 100px !important;
        max-width: 100px !important;
    }

    .total-column {
        min-width: 50px !important;
        width: 50px !important;
    }

    .dia-slot-cell {
        min-width: 35px !important;
        width: 35px !important;
        height: 35px;
        padding: 0.1rem;
    }

    .mes-header {
        min-width: 245px !important;
    }

    .horas-extras-contenedor-principal {
        height: auto;
        overflow: visible;
    }

    .horas-extras-scroll-contenedor {
        overflow: visible;
    }

    @page {
        margin: 0.5cm;
        size: A3 landscape;

        @bottom-right {
            content: "Página " counter(page) " de " counter(pages);
            font-size: 0.7rem;
        }

        @bottom-left {
            content: "Horas Extras - Generado: " date();
            font-size: 0.7rem;
        }
    }
}

/* =======================================
   ACCESIBILIDAD
   ======================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .horas-extras-table th,
    .horas-extras-table td {
        border: 2px solid #000;
    }

    .dia-slot-cell.tiene-hora-extra {
        border: 3px solid #000;
    }

    .estadistica-card {
        border: 2px solid #000;
    }
}

/* =======================================
   UTILIDADES ESPECÍFICAS
   ======================================= */

.horas-extras-fade-in {
    animation: fadeInUp 0.5s ease;
}

.horas-extras-bounce-in {
    animation: bounceIn 0.6s ease;
}

.horas-extras-shadow-hover:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Clases de estado para totales */
.total-column.destacado {
    background-color: rgba(40, 167, 69, 0.1) !important;
    border-color: var(--horas-extras-primary) !important;
    font-weight: 700;
}

/* Resaltado para agente actual */
.agente-row.agente-actual {
    background-color: rgba(40, 167, 69, 0.05);
}

    .agente-row.agente-actual .agente-column {
        background-color: rgba(40, 167, 69, 0.9) !important;
    }

/* Estados de carga */
.horas-extras-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

    .horas-extras-loading::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.8);
        z-index: 1000;
    }

    .horas-extras-loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 40px;
        height: 40px;
        margin: -20px 0 0 -20px;
        border: 4px solid var(--horas-extras-primary);
        border-top-color: transparent;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        z-index: 1001;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =======================================
   ESTILOS ADICIONALES PARA MEJORAR LA LEGIBILIDAD
   ======================================= */

/* Archivo: wwwroot/css/horas-extras.css */

/* Estilos para la pestaña de Horas Extras */
.horas-extras-link {
    position: relative;
    transition: all 0.3s ease;
}

    .horas-extras-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 0.375rem;
    }

.horas-extras-badge {
    background-color: #28a745;
    color: white;
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    margin-left: 0.25rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

    .horas-extras-badge i {
        font-size: 0.7rem;
    }

/* Animación para el icono de reloj */
.horas-extras-link i {
    animation: clockTick 2s infinite ease-in-out;
}

@keyframes clockTick {
    0%, 100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(15deg);
    }

    75% {
        transform: rotate(-15deg);
    }
}

/* Parar animación al hacer hover para mejor UX */
.horas-extras-link:hover i {
    animation: none;
}

/* Resaltar cuando está activa */
.nav-link.active.horas-extras-link {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745 !important;
}

/* =======================================
   MEJORAS ESPECÍFICAS PARA TOOLTIP Y HOVER
   ======================================= */

.dia-slot-cell[title] {
    cursor: help;
}

.dia-slot-cell.tiene-hora-extra[title] {
    cursor: pointer;
}

/* Efecto de brillo para celdas con horas extras */
.dia-slot-cell.tiene-hora-extra::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.dia-slot-cell.tiene-hora-extra:hover::before {
    opacity: 1;
}

/* Mejoras para el contraste de texto en diferentes estados */
.dia-slot-cell.estado-aceptado .dia-numero {
    color: #155724;
    font-weight: 800;
}

.dia-slot-cell.estado-rechazado .dia-numero {
    color: #721c24;
    font-weight: 800;
}

.dia-slot-cell.estado-pendiente .dia-numero {
    color: #856404;
    font-weight: 800;
}

/* Mejoras para los iconos de estado */
.dia-slot-cell.estado-aceptado .estado-icono {
    filter: drop-shadow(0 1px 2px rgba(21, 87, 36, 0.3));
}

.dia-slot-cell.estado-rechazado .estado-icono {
    filter: drop-shadow(0 1px 2px rgba(114, 28, 36, 0.3));
}

.dia-slot-cell.estado-pendiente .estado-icono {
    filter: drop-shadow(0 1px 2px rgba(133, 100, 4, 0.3));
}

/* =======================================
   MEJORAS PARA DISPOSITIVOS TÁCTILES
   ======================================= */

@media (hover: none) and (pointer: coarse) {
    .dia-slot-cell.tiene-hora-extra:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }

    .dia-slot-cell.tiene-hora-extra {
        border-width: 3px;
    }

    .hora-extra-contenido {
        gap: 0.5rem;
    }

    .estado-icono {
        font-size: 1.6rem;
    }

    .dia-numero {
        font-size: 1.1rem;
    }
}

/* =======================================
   ESTILOS PARA BADGES DE TIPO DE SERVICIO
   ======================================= */

.badge-tipo-servicio {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
    color: white !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    min-width: 2.5rem;
    text-align: center;
    display: inline-block;
    cursor: help;
    transition: all 0.2s ease;
}

.badge-tipo-servicio:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Colores específicos por tipo de servicio */
.badge-cs {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: 1px solid #1e7e34;
}

.badge-rf {
    background: linear-gradient(135deg, #007bff, #6610f2);
    border: 1px solid #0056b3;
}

.badge-ee {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    border: 1px solid #d39e00;
    color: #212529 !important;
}

.badge-me {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    border: 1px solid #bd2130;
}

/* Iconos para cada tipo de servicio */
.badge-cs::before { content: "🛡️ "; }
.badge-rf::before { content: "💪 "; }
.badge-ee::before { content: "🎉 "; }
.badge-me::before { content: "🏪 "; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .badge-tipo-servicio {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
        min-width: 2rem;
    }
}

/* =======================================
   ESTILOS PARA AVATARES DE AGENTES
   ======================================= */

.avatar-sm {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-title {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

/* =======================================
   OPTIMIZACIONES DE RENDIMIENTO
   ======================================= */

.horas-extras-table {
    will-change: scroll-position;
    contain: layout style paint;
}

.dia-slot-cell {
    will-change: transform;
    backface-visibility: hidden;
}

.agente-column,
.total-column {
    will-change: auto;
    contain: layout style;
}

/* =======================================
   VENTANA EMERGENTE CONFIRMACIÓN BAJA
   ======================================= */

/* Backdrop del modal */
.modal-confirmacion-baja-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--modal-backdrop);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-confirmacion-baja-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Contenedor del modal */
.modal-confirmacion-baja {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.7) translateY(-50px);
    transition: transform 0.3s ease;
}

.modal-confirmacion-baja-backdrop.show .modal-confirmacion-baja {
    transform: scale(1) translateY(0);
}

/* Header del modal */
.modal-confirmacion-baja-header {
    background: linear-gradient(135deg, var(--modal-baja-primary), var(--modal-baja-secondary));
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.modal-confirmacion-baja-header .icono-alerta {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.modal-confirmacion-baja-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-confirmacion-baja-header .btn-cerrar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal-confirmacion-baja-header .btn-cerrar:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Body del modal */
.modal-confirmacion-baja-body {
    padding: 1.5rem;
}

/* Información del agente */
.info-agente-baja {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.info-agente-baja .agente-nombre {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-agente-baja .agente-detalle {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.info-agente-baja .estado-baja {
    display: inline-block;
    background: var(--modal-baja-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Contadores */
.contadores-actualizacion {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.contadores-actualizacion h4 {
    margin: 0 0 0.75rem 0;
    color: #856404;
    font-size: 1rem;
}

.contador-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 0.25rem;
    border: 1px solid #f0f0f0;
}

.contador-fila:last-child {
    margin-bottom: 0;
}

.contador-fila .contador-label {
    font-weight: 500;
    color: #333;
}

.contador-fila .contador-cambio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.contador-actual {
    color: #6c757d;
}

.contador-flecha {
    color: var(--modal-baja-primary);
    font-size: 1.2rem;
}

.contador-nuevo {
    color: var(--modal-baja-primary);
    background: #fff5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Lista de múltiples agentes */
.lista-agentes-baja {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

.item-agente-baja {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.item-agente-baja:last-child {
    border-bottom: none;
}

.item-agente-baja .checkbox-agente {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--modal-baja-primary);
}

.item-agente-baja .info-agente {
    flex: 1;
}

.item-agente-baja .contador-resumen {
    font-size: 0.85rem;
    color: #6c757d;
    text-align: right;
}

/* Footer del modal */
.modal-confirmacion-baja-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 0.75rem 0.75rem;
}

.modal-confirmacion-baja-footer .btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.375rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-confirmar {
    background: var(--horas-extras-success);
    color: white;
}

.btn-confirmar:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

.btn-cancelar {
    background: var(--horas-extras-secondary);
    color: white;
}

.btn-cancelar:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-detalles {
    background: var(--horas-extras-info);
    color: white;
}

.btn-detalles:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* Estados de carga */
.btn-cargando {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-cargando .spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensaje de confirmación final */
.confirmacion-exitosa {
    text-align: center;
    padding: 2rem;
}

.confirmacion-exitosa .icono-exito {
    font-size: 4rem;
    color: var(--horas-extras-success);
    margin-bottom: 1rem;
    display: block;
}

.confirmacion-exitosa h3 {
    color: var(--horas-extras-success);
    margin-bottom: 1rem;
}

.confirmacion-exitosa .resumen-procesados {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
}

.confirmacion-exitosa .timestamp {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 1rem;
}

/* Responsivo */
@media (max-width: 768px) {
    .modal-confirmacion-baja {
        width: 95%;
        margin: 1rem;
    }

    .modal-confirmacion-baja-header,
    .modal-confirmacion-baja-body,
    .modal-confirmacion-baja-footer {
        padding: 1rem;
    }

    .contador-fila {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .modal-confirmacion-baja-footer {
        flex-direction: column;
    }

    .modal-confirmacion-baja-footer .btn {
        width: 100%;
        justify-content: center;
    }
}
