/* ========================================
   RESET Y VARIABLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a2a3a;
    --secondary: #2c3e50;
    --success: #27ae60;
    --warning: #e67e22;
    --info: #2980b9;
    --danger: #e74c3c;
    --light: #f4f6f9;
    --white: #ffffff;
    --gray: #6b7a8f;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --sidebar-width: 270px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    overflow-x: hidden;
}

/* ========================================
   LOGIN / REGISTER - P脕GINA DE AUTENTICACI脫N
   ======================================== */
.auth-container {
    display: flex;
    min-height: 100vh;
    background: var(--white);
}

/* Slider */
.slider-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--primary);
    display: none;
}

.slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.slide-content {
    position: absolute;
    bottom: 80px;
    left: 40px;
    color: white;
    max-width: 70%;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slide-content h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.slide-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Slider controles */
.slider-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 12px 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    backdrop-filter: blur(5px);
    transition: var(--transition);
    z-index: 10;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.slider-btn.prev {
    left: 15px;
}

.slider-btn.next {
    right: 15px;
}

/* Formulario de autenticaci贸n */
.auth-form-container {
    flex: 1;
    max-width: 480px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary);
    font-size: 2rem;
}

.auth-header p {
    color: var(--gray);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--light);
    border-radius: 12px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 0.7rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--secondary);
    font-size: 0.9rem;
}

.form-group label i {
    margin-right: 6px;
    color: var(--info);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #e2e6eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--info);
    outline: none;
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

.btn-full {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--info);
    color: white;
}

.btn-primary:hover {
    background: #1f618d;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #1e8449;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--gray);
    font-size: 0.8rem;
}

/* ========================================
   DASHBOARD
   ======================================== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: white;
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.3rem;
}

.close-menu {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.user-info {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    font-size: 2.5rem;
    opacity: 0.8;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details span:first-child {
    font-weight: 600;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 4px;
}

.menu-items {
    list-style: none;
    padding: 0.5rem 0;
}

.menu-item {
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.7);
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: var(--info);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

.menu-item.admin-only {
    display: none;
}

.user-role-admin .menu-item.admin-only {
    display: flex !important;
}

.menu-item#logoutBtn {
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    color: #e74c3c;
}

.menu-item#logoutBtn:hover {
    background: rgba(231, 76, 60, 0.15);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    min-height: 100vh;
}

.top-bar {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecf0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
}

.top-bar h1 {
    font-size: 1.3rem;
    color: var(--primary);
}

.top-bar-actions {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ===== PAGE CONTENT ===== */
.page-content {
    padding: 2rem;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--info);
    opacity: 0.7;
}

.stat-card h3 {
    font-size: 1.8rem;
    color: var(--primary);
}

.stat-card p {
    color: var(--gray);
    font-size: 0.85rem;
}

.welcome-message {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.welcome-message h2 {
    color: var(--primary);
}

/* ===== ASISTENCIA CONTROLS ===== */
.asistencia-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn.entrada {
    background: var(--success);
    color: white;
}

.btn.entrada:hover {
    background: #1e8449;
}

.btn.salida {
    background: var(--warning);
    color: white;
}

.btn.salida:hover {
    background: #ca6f1e;
}

.btn.justificar {
    background: var(--info);
    color: white;
}

.btn.justificar:hover {
    background: #1f618d;
}

.btn.exportar {
    background: #8e44ad;
    color: white;
}

.btn.exportar:hover {
    background: #6c3483;
}

/* ===== HISTORIAL ===== */
.historial-container {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

.historial-container h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.registro-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #e9ecf0;
}

.registro-item .tipo {
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.tipo.entrada {
    background: #d5f5e3;
    color: #1e8449;
}

.tipo.salida {
    background: #fdebd0;
    color: #ca6f1e;
}

.tipo.justificacion {
    background: #d6eaf8;
    color: #1f618d;
}

.vacio {
    color: #a0abb8;
    text-align: center;
    padding: 1.5rem 0;
}

/* ===== JUSTIFICACIONES ===== */
.justificacion-controls textarea {
    width: 100%;
    padding: 0.7rem;
    border-radius: 10px;
    border: 2px solid #e2e6eb;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 0.8rem;
}

.justificacion-controls input[type="file"] {
    margin-bottom: 0.8rem;
    display: block;
}

/* ===== TABLA USUARIOS ===== */
.usuarios-table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.8rem 0.5rem;
    color: var(--secondary);
    font-weight: 600;
    border-bottom: 2px solid #e9ecf0;
}

td {
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid #f0f2f5;
}

/* ===== PERFIL ===== */
.perfil-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.perfil-avatar {
    font-size: 4rem;
    color: var(--gray);
}

.perfil-info p {
    margin: 0.5rem 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 769px) {
    .slider-container {
        display: block;
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .slider-container {
        display: none;
    }

    .auth-form-container {
        max-width: 100%;
        padding: 1.5rem;
        box-shadow: none;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .close-menu {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .page-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card h3 {
        font-size: 1.3rem;
    }

    .top-bar {
        padding: 0.8rem 1rem;
    }

    .perfil-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .slide-content {
        bottom: 60px;
        left: 20px;
    }

    .slide-content h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .asistencia-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   REPORTE ESTILO EXCEL
   ======================================== */
.excel-report {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.excel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.excel-toolbar h3 {
    margin: 0;
    font-size: 1rem;
    color: #2c3e50;
}

.total-registros {
    font-size: 0.85rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 12px;
}

.excel-table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.excel-table thead th {
    background: #f1f3f5;
    color: #343a40;
    font-weight: 600;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.excel-table tbody td {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.excel-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.excel-table tbody tr:hover {
    background: #e9ecef;
}

.estado-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.estado-pendiente {
    background: #fff3cd;
    color: #856404;
}

.estado-aprobado {
    background: #d4edda;
    color: #155724;
}

.estado-rechazado {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .excel-table thead th,
    .excel-table tbody td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
}

/* ========================================
   REPORTE ESTILO EXCEL - NUEVO
   ======================================== */
.excel-report {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.excel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.excel-toolbar h3 {
    margin: 0;
    font-size: 1rem;
    color: #2c3e50;
}

.total-registros {
    font-size: 0.85rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 12px;
}

.excel-table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.excel-table thead th {
    background: #f1f3f5;
    color: #343a40;
    font-weight: 600;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.excel-table tbody td {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.excel-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.excel-table tbody tr:hover {
    background: #e9ecef;
}

.estado-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.estado-pendiente {
    background: #fff3cd;
    color: #856404;
}

.estado-aprobado {
    background: #d4edda;
    color: #155724;
}

.estado-rechazado {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .excel-table thead th,
    .excel-table tbody td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
}

/* ========================================
   ESTILOS DE IMPRESIÓN PARA REPORTE
   ======================================== */
@media print {
    .sidebar,
    .top-bar,
    .menu-toggle,
    .auth-container,
    .slider-container,
    .btn,
    .asistencia-controls,
    .justificacion-controls,
    .report-controls,
    .auth-tabs,
    .auth-footer,
    .close-menu {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    #page-perfil {
        display: block !important;
    }

    .perfil-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    table {
        font-size: 10px !important;
    }

    table th,
    table td {
        padding: 4px 6px !important;
    }

    .fila-reporte {
        break-inside: avoid;
    }

    #tablaReporte {
        border: 1px solid #333 !important;
    }

    #tablaReporte thead {
        background: #333 !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #tablaReporte thead th {
        background: #333 !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .estado-span,
    .tipo-span {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    [style*="background"] {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}