/* =========================================================================
   1. ESTILOS BASE Y CONFIGURACIÓN COMÚN GENERAL
   ========================================================================= */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out;
}

/* =========================================================================
   2. SISTEMA DE ICONOS, BOTONES Y NAVEGACIÓN FLOTANTE (MENÚS Y ACCIONES)
   ========================================================================= */
.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
    transition: 0.3s;
}

.btn-cart-float {
    transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
    border: none;
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.3) !important;
}

.btn-cart-float:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 14px 28px rgba(13, 110, 253, 0.4) !important;
}

.btn-tarjeta-marca {
    transition: all 0.3s ease;
    background-color: #ffffff;
    border-bottom: 3px solid transparent !important;
    cursor: pointer;
}

.btn-tarjeta-marca:not(.tarjeta-activa):hover {
    background-color: #eef6ff;
    border-bottom: 3px solid #0d6efd !important;
    transform: translateY(-2px);
}

.tarjeta-activa {
    background-color: #0d6efd !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4) !important;
    transform: translateY(-3px);
}

/* =========================================================================
   3. ESTRUCTURA DE COMPONENTES INTERNOS (BADGES, ACORDEONES, CARDS Y TABLAS)
   ========================================================================= */
.mi-codigo-badge {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 800;
    display: inline-block;
}

.equiv-codigo-badge {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-block;
}

.codigo-badge {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
}

.vendedor-badge {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.table thead {
    background-color: #f1f5f9;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.nav-tabs .nav-link {
    border: none;
    color: #64748b;
    font-weight: 600;
    padding: 12px 20px;
    transition: all 0.2s;
}

.nav-tabs .nav-link.active {
    color: #3b82f6;
    border-bottom: 3px solid #3b82f6;
    background: transparent;
}

/* Animaciones y Badges Críticos */
.pedido-critico {
    color: #dc3545;
    font-weight: 800;
    animation: pulse 2s infinite;
}

.badge-notify {
    font-size: 0.7rem;
    padding: 0.25em 0.6em;
    animation: pulse-red 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* =========================================================================
   4. ESTRUCTURAS VISTAS ESPECÍFICAS (INDEX, CONFIGURACIÓN Y EXCLUSIVOS)
   ========================================================================= */

/* --- CONFIGURACIONES DE ICONOS INTERNOS EN HOVER --- */
.bg-empresa { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; transition: 0.3s; }
.bg-usuarios { background-color: rgba(16, 185, 129, 0.1); color: #10b981; transition: 0.3s; }

/* --- CLASE BASE DE MINI TARJETAS Y PANELES (UNIFICADO) --- */
.nav-card {
    border: none !important;
    border-radius: 20px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
}

/* Control estricto para evitar subrayados heredados de enlaces */
.nav-card *, .nav-card:hover * {
    text-decoration: none !important;
}

/* Efecto hover general (Elevación limpia y cambio de texto a blanco) */
.nav-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
    color: #ffffff !important;
}

.nav-card:hover .text-title-card {
    color: #ffffff !important;
}

.nav-card:hover p { 
    color: rgba(255, 255, 255, 0.85) !important; 
}

.nav-card:hover .icon-box { 
    background: rgba(255, 255, 255, 0.2) !important; 
    color: #ffffff !important; 
}

/* --- COLORES EXCLUSIVOS HOVER PARA EL INDEX Y PANEL CONFIGURACIÓN --- */
.card-mis-filtros:hover,
.card-empresa-config:hover { 
    background-color: #3b82f6 !important; /* Azul Corporativo */
}

.card-registrar:hover,
.card-usuarios-config:hover { 
    background-color: #10b981 !important; /* Verde Usuarios */
}

.card-equiv:hover { background-color: #0dcaf0 !important; }
.card-oportunidades:hover { background-color: #ffc107 !important; }
.card-oportunidades:hover h6, .card-oportunidades:hover p { color: #1e293b !important; }

.card-medidas:hover { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; 
}

/* Previsualizaciones del sistema */
.preview-logo-box {
    width: 70px;
    height: 70px;
    background-color: #1e293b;
    border-radius: 12px;
    padding: 8px;
}
.preview-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.stat-card {
    border: none;
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
    text-decoration: none;
    display: block;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.15);
    color: white;
}

/* Grid dinámico */
@media (min-width: 992px) {
    .col-lg-2-5 { flex: 0 0 auto; width: 20%; }
}


/* =========================================================================
   5. REGLAS EXCLUSIVAS DE IMPRESIÓN (MEDIOS FÍSICOS Y PAPEL)
   ========================================================================= */
@media print {
    .navbar, .btn-print, .no-print, a.btn {
        display: none !important;
    }
    body {
        background-color: white !important;
        color: #000 !important;
        font-size: 12pt !important;
        padding: 0;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .accordion-collapse {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
    }
    .accordion-button::after {
        display: none !important;
    }
}

/* =========================================================================
   6. AJUSTES EXCLUSIVOS DE LA PÁGINA DE LOGIN
   ========================================================================= */

/* Solo si el body contiene la tarjeta de login, aplicamos el centrado de pantalla completa */
body:has(.card-login) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 15px !important;
}

/* Forzamos a la tarjeta a recuperar su tamaño central original */
.card-login {
    width: 100% !important;
    max-width: 420px !important; /* Evita que ocupe toda la pantalla */
    margin: auto !important;
}

/* Estilo extra por si deseas ajustar tu logo */
.card-login .img-logo {
    max-width: 100px;
    height: auto;
    border-radius: 50%;
    margin-bottom: 15px;
}

/* Asegura que el menú flotante siempre flote POR ENCIMA de cualquier tarjeta o tabla */
.dropdown-menu.custom-dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}
/* --- EFECTOS HOVER EXCLUSIVOS PARA EL PORTAL DE BIENVENIDA CENTRAL --- */
.card-modulo-filtros:hover {
    background-color: #0d6efd !important; /* Azul para Filtros */
}

.card-modulo-general:hover {
    background-color: #8257e5 !important; /* Morado para Productos Generales */
   
}
.card-modulo-web:hover {
     background-color: #41b0e4 !important; /* Morado para Productos Generales */
}
/* =========================================================================
   REPARACIÓN VISUAL DEL ACCESO Y ROL EN EL MENÚ FLOTANTE (NAVBAR)
   ========================================================================= */

/* Rol SADMIN / ADMIN: Fondo Rojo Carmesí Intenso */
.navbar-nav .dropdown-menu .badge.bg-danger {
    background-color: #bd1c2a !important; /* Rojo oscuro de alta visibilidad */
    color: #ffffff !important;            /* Letras blancas brillantes */
    font-weight: 800 !important;
}

/* Rol VENTAS / CAJA: Fondo Azul Marino Profundo o Negro */
.navbar-nav .dropdown-menu .badge.bg-secondary {
    background-color: #1e293b !important; /* Azul medianoche muy oscuro (Slate-800) */
    color: #ffffff !important;            /* Letras blancas brillantes */
    font-weight: 800 !important;
}

/* Texto de respaldo superior de la fila informativa */
.navbar-nav .dropdown-menu li.px-3.py-2 {
    color: #e2e8f0 !important; /* Texto gris claro de excelente contraste */
    background-color: #0f172a !important; /* Fondo del encabezado interna más oscuro */
}

.navbar-nav .dropdown-menu li.px-3.py-2 strong.text-white {
    color: #ffffff !important; /* Fuerza las letras del rol en blanco puro */
}
/* =========================================================================
 X. COMPONENTES DEL MÓDULO DE IMPORTACIÓN MASIVA
 ========================================================================= */
.dropzone-container {
    border: 2px dashed #cbd5e1;
    border-radius: 15px;
    background-color: #f8fafc;
    transition: all 0.25s ease-in-out;
    cursor: pointer;
}
.dropzone-container:hover {
    border-color: #8257e5;
    background-color: #f5f0ff;
}
.text-purple-system {
    color: #8257e5 !important;
}
.bg-purple-system {
    background-color: #8257e5 !important;
}
.table-responsive-custom {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
}
.sticky-thead th {
    position: sticky;
    top: 0;
    background-color: #f1f5f9 !important;
    color: #334155;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    z-index: 2;
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
.badge-error-list {
    display: inline-block;
    white-space: normal;
    text-align: left;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}
.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}
.bg-warning-light { background-color: #fef9c3 !important; } /* Amarillo tenue */
.bg-danger-light { background-color: #fee2e2 !important; }  /* Rojo tenue */
.text-warning-custom { color: #d97706 !important; }
/* =========================================================================
 X. MEJORAS DE CONTRASTE Y ESTILOS PARA FORMULARIOS DE REGISTRO
 ========================================================================= */
.force-uppercase {
    text-transform: uppercase;
}

/* Cajas de entrada con alto contraste */
.custom-input-box {
    background-color: #f1f5f9 !important; /* Gris slate claro */
    border: 1.5px solid #cbd5e1 !important; /* Borde visible definido */
    color: #0f172a !important; /* Texto oscuro de alta visibilidad */
    transition: all 0.2s ease-in-out !important;
    border-radius: 10px !important;
}

/* Efecto de enfoque (Focus) */
.custom-input-box:focus {
    background-color: #ffffff !important;
    border-color: #8257e5 !important; /* Borde Púrpura Corporativo */
    box-shadow: 0 0 0 3px rgba(130, 87, 229, 0.2) !important;
    outline: none !important;
}

/* Adaptación para selectores Tom Select */
.ts-control {
    background-color: #f1f5f9 !important;
    border: 1.5px solid #cbd5e1 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    transition: all 0.2s ease-in-out !important;
}
.ts-wrapper.focus .ts-control {
    background-color: #ffffff !important;
    border-color: #8257e5 !important;
    box-shadow: 0 0 0 3px rgba(130, 87, 229, 0.2) !important;
}

/* Botón Guardar Púrpura del Sistema */
.btn-system-save {
    background-color: #8257e5 !important;
    border: none !important;
    color: #ffffff !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(130, 87, 229, 0.3) !important;
}
.btn-system-save:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(130, 87, 229, 0.45) !important;
    background-color: #6d44c5 !important;
}
.btn-system-save:active {
    transform: translateY(0) !important;
}

/* Botón Cancelar */
.btn-system-cancel {
    border: 1.5px solid #64748b !important;
    color: #64748b !important;
    background-color: transparent !important;
    transition: all 0.25s ease !important;
}
.btn-system-cancel:hover {
    background-color: #64748b !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}
/* =========================================================================
 XI. ALERTAS DINÁMICAS DE CONTROL DE INVENTARIO (STOCKS)
 ========================================================================= */
.badge-stock-normal {
    background-color: #10b981 !important; /* Verde Esmeralda */
    color: #ffffff !important; /* Forzar texto blanco */
}

.badge-stock-minimo {
    background-color: #f59e0b !important; /* Ámbar / Amarillo Alerta */
    color: #000000 !important; /* 🌟 REPARACIÓN DEFINITIVA: Forzar texto negro puro sobre el fondo claro */
}

.badge-stock-critico {
    background-color: #ef4444 !important; /* Rojo Intenso */
    color: #ffffff !important; /* Forzar texto blanco */
    animation: pulso-critico 1.5s infinite ease-in-out;
}

@keyframes pulso-critico {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}
