  :root {
            --primary: #4f46e5;
            --primary-dark: #4338ca;
            --secondary: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --radius: 1rem;
        }
        
        /* Reset y Base */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }
        
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            min-height: 100vh;
            overflow-x: hidden;
        }
        
        /* Glass Effect */
        .glass {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        /* Animaciones */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        @keyframes slideIn {
            from { transform: translateX(-20px); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
        
        .animate-fade-in {
            animation: fadeIn 0.3s ease-out;
        }
        
        .animate-slide-in {
            animation: slideIn 0.3s ease-out;
        }
        
        .animate-pulse {
            animation: pulse 2s infinite;
        }
        
        /* Scroll Personalizado */
        .scroll-thin::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }
        
        .scroll-thin::-webkit-scrollbar-track {
            background: rgba(241, 245, 249, 0.5);
            border-radius: 10px;
        }
        
        .scroll-thin::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 10px;
        }
        
        .scroll-thin::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }
        
        /* Tabs */
        .tab-content {
            display: none;
            opacity: 0;
            transform: translateY(10px);
            transition: all 0.3s ease;
        }
        
        .tab-content.active {
            display: block;
            opacity: 1;
            transform: translateY(0);
        }
        
        /* Cards Hover */
        .card-hover {
            transition: all 0.2s ease;
        }
        
        .card-hover:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
        }
        
        /* Botones */
        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            transition: all 0.3s ease;
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
        }
        
        .btn-success {
            background: linear-gradient(135deg, var(--secondary), #059669);
            color: white;
        }
        
        .btn-danger {
            background: linear-gradient(135deg, var(--danger), #dc2626);
            color: white;
        }
        
        /* Inputs */
        .input-field {
            background: white;
            border: 2px solid #e2e8f0;
            transition: all 0.3s ease;
        }
        
        .input-field:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        /* Responsive Design */
        @media (max-width: 640px) {
            .mobile-stack {
                flex-direction: column !important;
            }
            
            .mobile-full {
                width: 100% !important;
            }
            
            .mobile-padding {
                padding: 1rem !important;
            }
            
            .mobile-text-sm {
                font-size: 0.875rem !important;
            }
            
            .mobile-hide {
                display: none !important;
            }
        }
        
        @media (min-width: 641px) and (max-width: 1024px) {
            .tablet-grid-2 {
                grid-template-columns: repeat(2, 1fr) !important;
            }
        }
        
        /* Loading States */
        .skeleton {
            background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
        }
        
        @keyframes loading {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        
        /* Modal Backdrop */
        .modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.9);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 1rem;
        }
        
        .modal-backdrop.active {
            display: flex;
        }
        
        /* Toast Notifications */
        .toast {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            padding: 1rem 1.5rem;
            border-radius: 0.75rem;
            color: white;
            font-weight: 600;
            font-size: 0.875rem;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
            z-index: 9999;
            animation: fadeIn 0.3s ease-out;
        }
        
        .toast-success {
            background: linear-gradient(135deg, #10b981, #059669);
        }
        
        .toast-error {
            background: linear-gradient(135deg, #ef4444, #dc2626);
        }
        
        .toast-info {
            background: linear-gradient(135deg, #3b82f6, #2563eb);
        }
        
        /* Table Styles */
        .table-responsive {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        
        .table-striped tbody tr:nth-child(odd) {
            background-color: rgba(241, 245, 249, 0.5);
        }
        
        /* Product Grid */
        .product-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1rem;
        }
        
        @media (max-width: 640px) {
            .product-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        
        /* Badge Status */
        .badge {
            display: inline-flex;
            align-items: center;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        
        .badge-success {
            background-color: #d1fae5;
            color: #065f46;
        }
        
        .badge-warning {
            background-color: #fef3c7;
            color: #92400e;
        }
        
        .badge-danger {
            background-color: #fee2e2;
            color: #991b1b;
        }
        
        /* Gradient Text */
        .gradient-text {
            background: linear-gradient(135deg, var(--primary), #7c3aed);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        /*PARAPADEO DE LA PESTAÑA DE VENTAS*/
        @keyframes pulse-attention {
        0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7); }
        70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); }
        100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
        }

        .tab-atencion {
        animation: pulse-attention 2s infinite;
        background-color: #eef2ff !important; /* Un tono azul muy suave */
        position: relative;
        }

/* El punto rojo indicador */
.tab-atencion::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

/*calculo automatico del header y el nav*/
header {
    height: var(--header-height, auto);
}

nav {
    /* Esto es lo más profesional: se pega justo donde termina el anterior */
    top: 73px; 
}

/* En móviles el header suele ser más alto por el flex-col */
@media (max-width: 640px) {
    nav {
        top: 110px; /* Ajuste para el modo vertical del logo/usuario */
    }
}

/* botón parpadeante para descargar facturas*/
@keyframes pulse-red-glow {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); transform: scale(1); }
    50% { box-shadow: 0 0 0 15px rgba(220, 38, 38, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); transform: scale(1); }
}

.btn-pdf-notorio {
    animation: pulse-red-glow 1.5s infinite ease-in-out;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border: 2px solid #fee2e2;
}

/* Animaciones para el splash screen ================================================================= */
@keyframes pulse-slow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.animate-pulse-slow {
    animation: pulse-slow 2s ease-in-out infinite;
}

.delay-300 {
    animation-delay: 300ms;
}

/* Transiciones suaves */
#splashScreen {
    transition: opacity 0.5s ease-in-out;
}

#splashScreen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Estilos para pestañas ================================================================= */
.tab-btn {
    position: relative;
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.tab-btn.border-primary::after {
    width: 100%;
}

.tab-btn:hover::after {
    width: 60%;
    opacity: 0.5;
}

/* Transición suave para iconos */
.tab-btn svg {
    transition: all 0.2s ease;
}

.tab-btn:hover svg {
    transform: scale(1.1);
}

.tab-btn.border-primary svg {
    color: #4f46e5;
}

/* ==============================================
   LOADER DE CONTABILIDAD - VERSIÓN OPTIMIZADA
   ============================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out;
}

/* Spinner */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* Estilos para el loader de contabilidad */
/* Loader base - solo posicionamiento */
#contabilidadLoader {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
}

#contabilidadLoader:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Garantizar que el loader siempre esté por encima */
#contabilidadLoader {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    display: none;
    pointer-events: none; /* Permite hacer clic a través del loader si está oculto */
}

#contabilidadLoader:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: all; /* Cuando está visible, captura clicks */
}

#contabilidadLoader > div {
    pointer-events: all; /* El contenido del loader captura clicks */
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out;
}

/* Spinner */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==============================================
   stylos para el modal de vendedores
   ============================================== */
   #modalLoginVendedor.active {
        display: flex;
    }
    
    #modalLoginVendedor.active #modalLoginVendedorContent {
        transform: scale(1);
        opacity: 1;
    }
/* ==============================================
stylos extras para el modal de vendedores
   ============================================== */
/* Modal Login Vendedor */
#modalLoginVendedor {
    transition: opacity 0.3s ease;
}

#modalLoginVendedor:not(.active) {
    opacity: 0;
    pointer-events: none;
}

#modalLoginVendedor.active {
    opacity: 1;
    pointer-events: all;
}

#modalLoginVendedorContent {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#modalLoginVendedor:not(.active) #modalLoginVendedorContent {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
}

/* ==============================================
stylos para los botones de razón predefinida en la pestaña de productos
   ============================================== */
/* Botones de razón predefinida */
.razon-preset {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.razon-preset:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.2);
}

.razon-preset.selected {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border-color: #4f46e5;
}
/* ==============================================
   BOTÓN PROCESAR VENTA - ESTILOS MEJORADOS
   ============================================== */

/* Estado HABILITADO - Verde vibrante */
.btn-venta-enabled {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    cursor: pointer;
    opacity: 1;
}

.btn-venta-enabled:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-venta-enabled:active {
    transform: translateY(0);
}

/* Estado DESHABILITADO - Verde opaco/desaturado */
.btn-venta-disabled {
    background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(0.1);
    box-shadow: none;
}

.btn-venta-disabled:hover {
    transform: none;
    background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
    box-shadow: none;
}

/* Transición suave entre estados */
#btnProcesarVenta {
    transition: all 0.2s ease-in-out;
}

/* ==============================================
   PRODUCT GRID CON SCROLL INTERNO
   ============================================== */

/* Contenedor con scroll */
.product-grid-container {
    max-height: 550px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scroll-behavior: smooth;
}

/* Scroll personalizado */
.product-grid-container::-webkit-scrollbar {
    width: 6px;
}

.product-grid-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.product-grid-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.product-grid-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Grid responsivo */
.product-grid {
    display: grid;
    gap: 1rem;
}

/* Desktop: 3 columnas */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .product-grid-container {
        max-height: 550px;
    }
}

/* Tablet: 2 columnas */
@media (min-width: 640px) and (max-width: 1023px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-grid-container {
        max-height: 480px;
    }
}
/*=====================================================================*/
/* Móvil: 1 columna */
@media (max-width: 639px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    .product-grid-container {
        max-height: 420px;
    }
}
/* ==============================================
   TARJETAS DE PRODUCTOS - ALTURA UNIFORME
   ============================================== */

/* Contenedor del grid con scroll */
.product-grid-container {
    max-height: 550px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scroll-behavior: smooth;
}

/* Grid que contiene las tarjetas */
.product-grid {
    display: grid;
    gap: 1rem;
    align-items: stretch; /* Fuerza a que todas las tarjetas tengan la misma altura */
}

/* Desktop: 3 columnas */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .product-grid-container {
        max-height: 550px;
    }
}

/* Tablet: 2 columnas */
@media (min-width: 640px) and (max-width: 1023px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-grid-container {
        max-height: 480px;
    }
}

/* Móvil: 1 columna */
@media (max-width: 639px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    .product-grid-container {
        max-height: 420px;
    }
}

/* Scroll personalizado */
.product-grid-container::-webkit-scrollbar {
    width: 6px;
}

.product-grid-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.product-grid-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.product-grid-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==============================================
   TARJETA DE PRODUCTO - ESTRUCTURA FIJA
   ============================================== */

/* Cada tarjeta debe tener altura 100% para que el grid las iguale */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px; /* Altura mínima consistente */
    transition: all 0.2s ease;
}

/* Área de información del producto (crece para empujar el botón) */
.product-card-info {
    flex: 1;
}

/* Línea de precio y stock - altura fija */
.product-card-price-row {
    min-height: 70px;
}

/* Botón siempre al fondo */
.product-card-button {
    margin-top: auto;
}

/* Asegurar que los textos no rompan el layout */
.product-card h4 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5rem;
}

.product-card .text-xs.font-mono {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================================
   TARJETAS DE PRODUCTOS - ESTÉTICA MODERNA
   ============================================== */

/* Tarjeta base */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.15);
}

/* Línea de 2 líneas para nombres largos */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Grid responsivo */
.product-grid {
    display: grid;
    gap: 1.25rem;
    align-items: stretch;
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 639px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Contenedor con scroll */
.product-grid-container {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scroll-behavior: smooth;
}

/* Scroll personalizado */
.product-grid-container::-webkit-scrollbar {
    width: 6px;
}

.product-grid-container::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

.product-grid-container::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

.product-grid-container::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ==============================================
   IMAGEN DE FONDO EN TARJETAS DE PRODUCTOS
   ============================================== */

.product-card {
    position: relative;
    background-color: white;
    transition: all 0.3s ease;
}

/* Contenedor de la imagen de fondo */
.product-card-bg-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}

/* Overlay de opacidad sobre la imagen */
.product-card-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.75) 100%);
    backdrop-filter: blur(1px);
}

/* Hover: la imagen escala ligeramente */
.product-card:hover .product-card-bg-image {
    transform: scale(1.05);
}

/* Contenido por encima del fondo */
.product-card-content {
    position: relative;
    z-index: 10;
}

/* Asegurar que el texto sea legible */
.product-card .bg-gradient-to-r,
.product-card .badge,
.product-card .text-slate-800,
.product-card .text-slate-500 {
    position: relative;
    z-index: 2;
}

