/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.splash-screen.active {
    opacity: 1;
}

.splash-content {
    text-align: center;
    color: white;
    animation: fadeInUp 1s ease-out;
}

.splash-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.splash-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.splash-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Loading Progress */
.loading-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.loading-progress.active {
    opacity: 1;
}

.progress-bar {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Hide main content during splash */
body.splash-active {
    overflow: hidden;
}

body.splash-active > *:not(#splashScreen):not(#loadingProgress) {
    opacity: 0;
    pointer-events: none;
}

/* Comprobante Styles */
.comprobante-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.comprobante-content {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
}

.comprobante-header {
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.comprobante-logo {
    width: 120px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.comprobante-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0.5rem 0;
}

.comprobante-subtitle {
    color: var(--text-color);
    font-size: 1rem;
    margin: 0;
}

.comprobante-body {
    margin: 2rem 0;
}

.comprobante-section {
    margin-bottom: 1.5rem;
}

.comprobante-section h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3rem;
}

.comprobante-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.comprobante-row:last-child {
    border-bottom: none;
}

/* Estilos para el Popup del Splash Screen */
.splash-popup {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.9) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 999999 !important;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.splash-popup.show {
    opacity: 1;
}

.splash-popup.hide {
    opacity: 0;
    pointer-events: none;
}

.splash-popup-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

.splash-popup-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.splash-popup-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-popup-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.splash-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.splash-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.splash-loading p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin: 0;
}

/* Estilos para Reportes Tabulares */
.report-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-end;
}

.report-type, .report-options {
    flex: 1;
    min-width: 250px;
}

.report-type label, .report-options label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.report-type select, .report-options select,
.report-options input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.report-type select:focus, .report-options select:focus,
.report-options input:focus {
    outline: none;
    border-color: #667eea;
}

.report-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input, .form-group select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.reporte-resultado {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.reporte-container {
    padding: 2rem;
}

.reporte-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.reporte-header h3 {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 700;
}

.reporte-actions {
    display: flex;
    gap: 1rem;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.reporte-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.reporte-table th {
    background: var(--light-color, #f8fafc);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color, #1f2937);
    border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.reporte-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    color: var(--dark-color, #374151);
    vertical-align: middle;
}

.reporte-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
    transition: background-color 0.2s ease;
}

.reporte-table tbody tr:last-child td {
    border-bottom: none;
}

.reporte-vacio {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.reporte-vacio h3 {
    color: #374151;
    margin-bottom: 1rem;
}

/* Responsive para reportes */
/* Tablets */
@media (max-width: 1024px) {
    .report-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .report-type, .report-options {
        min-width: 100%;
    }
    
    .reporte-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .reporte-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Tablets pequeñas y celulares grandes */
@media (max-width: 768px) {
    .report-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .report-type, .report-options {
        min-width: 100%;
    }
    
    .reporte-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .reporte-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .reporte-table th,
    .reporte-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.75rem;
        font-size: 14px;
    }
}

/* Celulares */
@media (max-width: 480px) {
    .reporte-container {
        padding: 1rem;
    }
    
    .reporte-header h3 {
        font-size: 1.25rem;
    }
    
    .reporte-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .reporte-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .table-responsive {
        font-size: 11px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .reporte-table th,
    .reporte-table td {
        padding: 0.5rem 0.25rem;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .reporte-vacio {
        padding: 2rem 1rem;
    }
    
    .reporte-vacio h3 {
        font-size: 1.25rem;
    }
    
    .reporte-vacio p {
        font-size: 0.875rem;
    }
}

/* Popup Splash Responsive */
@media (max-width: 768px) {
    .splash-popup-content {
        max-width: 90%;
        padding: 1.5rem;
    }
    
    .splash-popup-image {
        width: 120px;
        height: 120px;
    }
    
    .splash-popup-content h2 {
        font-size: 1.5rem;
    }
    
    .splash-popup-content p {
        font-size: 1rem;
    }
    
    .splash-spinner {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .splash-popup-content {
        max-width: 95%;
        padding: 1rem;
    }
    
    .splash-popup-image {
        width: 100px;
        height: 100px;
    }
    
    .splash-popup-content h2 {
        font-size: 1.25rem;
    }
    
    .splash-popup-content p {
        font-size: 0.875rem;
    }
    
    .splash-loading p {
        font-size: 0.75rem;
    }
}
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
}

.comprobante-modal {
    position: relative !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
    max-width: 800px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    z-index: 100000 !important;
    animation: slideIn 0.3s ease-out !important;
    transform: none !important;
    margin: auto !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.comprobante-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.comprobante-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.comprobante-content {
    padding: 2rem;
}

.comprobante-actions {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-radius: 0 0 12px 12px;
}

.comprobante-body {
    font-family: 'Inter', sans-serif;
    color: #333;
}

.comprobante-header-info {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #667eea;
}

.comprobante-header-info h3 {
    color: #667eea;
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.comprobante-section {
    margin-bottom: 1.5rem;
}

.comprobante-section h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item:last-child {
    border-bottom: none;
}

.comprobante-label {
    font-weight: 500;
    color: var(--text-color);
}

.comprobante-value {
    font-weight: 600;
    color: var(--dark-color);
    text-align: right;
}

.comprobante-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.terminos-condiciones {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.terminos-condiciones p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.terminos-condiciones ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.terminos-condiciones li {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

/* Estilos para impresión */
@media print {
    .modal-overlay {
        position: static;
        background: white;
        box-shadow: none;
    }
    
    .comprobante-modal {
        max-width: 100%;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
    }
    
    .comprobante-header,
    .comprobante-actions {
        display: none;
    }
    
    .comprobante-content {
        padding: 0;
    }
}

.comprobante-terminos {
    background: var(--light-color);
    padding: 1rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--warning-color);
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.comprobante-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.comprobante-actions .btn {
    min-width: 150px;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .comprobante-content, .comprobante-content * {
        visibility: visible;
    }
    
    .comprobante-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 1rem;
    }
    
    .comprobante-actions {
        display: none;
    }
}
