:root {
    /* Paleta de colores personalizada - Azul Corporativo Original */
    --primary-color: rgb(0,22,28);      /* Azul oscuro original de la empresa */
    --secondary-color: rgb(0,22,102);    /* Azul secundario original */
    --accent-color: #06b6d4;       /* Cian para acentos */
    --success-color: #10b981;      /* Verde esmeralda */
    --warning-color: #f59e0b;      /* Ámbar */
    --danger-color: #ef4444;       /* Rojo coral */
    
    /* Colores de fondo */
    --bg-primary: #f8fafc;         /* Fondo principal claro */
    --bg-secondary: #ffffff;       /* Fondo secundario blanco */
    --bg-card: #ffffff;            /* Fondo de tarjetas */
    
    /* Colores de texto */
    --text-primary: #1f2937;       /* Texto principal oscuro */
    --text-secondary: #6b7280;     /* Texto secundario gris */
    --text-muted: #9ca3af;         /* Texto deshabilitado */
    
    /* Sombras personalizadas */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Bordes redondeados */
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
}

body {
    background-color: var(--bg-primary);
    font-family: 'Nunito', Arial, sans-serif !important;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    overflow-x: hidden; /* Evitar barra de desplazamiento horizontal */
}

/* Forzar tipografía en todos los elementos */
* {
    font-family: 'Nunito', Arial, sans-serif !important;
}

/* Tipografía específica para elementos Bootstrap */
.table, .btn, .nav-link, .navbar-brand, .card, .form-control, .form-select {
    font-family: 'Nunito', Arial, sans-serif !important;
}

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-lg);
    border-bottom: 3px solid var(--accent-color);
    padding: 1rem 0;
}

.sidebar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-md);
    height: 100vh; /* Altura completa de la ventana */
    border-right: 1px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 0; /* Desde el borde superior */
    left: 0;
    z-index: 1000;
    overflow-x: hidden;
    padding-top: 80px; /* Espacio para el navbar */
}

/* Tamaño de fuente específico para elementos del sidebar */
.sidebar .nav-link {
    font-size: 0.85rem !important; /* Asegurar que se aplique en el sidebar */
}

.sidebar .nav-link span {
    font-size: 0.85rem !important; /* Tamaño consistente para el texto */
}

/* Sidebar colapsado */
.sidebar.collapsed {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
}

/* Sidebar expandido */
.sidebar.expanded {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
}

/* Ajustar contenido principal para sidebar colapsado */
.sidebar.collapsed ~ .col-md-10,
.sidebar.collapsed + .col-md-10 {
    margin-left: 80px !important;
    width: calc(100% - 80px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ajustar contenido principal para sidebar expandido */
.sidebar.expanded ~ .col-md-10,
.sidebar.expanded + .col-md-10 {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Asegurar que el contenido principal tenga el margen correcto por defecto */
.col-md-10 {
    margin-left: 240px !important; /* Por defecto expandido */
    width: calc(100% - 240px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    min-height: calc(100vh - 80px);
    padding-top: 1rem !important; /* Espacio superior reducido */
    padding-left: 1.5rem !important; /* Espacio lateral izquierdo reducido */
    padding-right: 1.5rem !important; /* Espacio lateral derecho reducido */
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-md);
    margin: 3px 0;
    padding: 0.75rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.85rem; /* Reducido para que encajen títulos largos */
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

/* Nav-links en sidebar colapsado */
.sidebar.collapsed .nav-link {
    padding: 0.75rem 0.25rem !important;
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    min-height: 45px !important;
    border-radius: var(--border-radius-sm) !important;
    margin: 3px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.sidebar.collapsed .nav-link span {
    display: none !important;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0 !important;
    font-size: 1.2rem !important;
    display: inline-block !important;
    color: rgba(255, 255, 255, 0.9) !important;
    width: 100% !important;
    text-align: center !important;
    line-height: 1 !important;
}

/* Hover effect SIMPLE para iconos en sidebar colapsado */
.sidebar.collapsed .nav-link:hover i {
    color: var(--accent-color) !important;
    transform: scale(1.1) !important;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.6) !important;
    transition: all 0.2s ease !important;
}

/* BRILLO ESPECIAL para iconos ACTIVOS en sidebar colapsado - Ahora con íconos negros */
.sidebar.collapsed .nav-link.active i {
    color: #1f2937 !important; /* Gris oscuro para íconos */
    text-shadow: 0 0 8px rgba(31, 41, 55, 0.3) !important; /* Sombra sutil */
    animation: none !important; /* Sin animación para mejor legibilidad */
}

/* Animación de brillo pulsante para iconos activos */
@keyframes activeGlow {
    0% {
        text-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
        transform: scale(1);
    }
    100% {
        text-shadow: 0 0 16px rgba(6, 182, 212, 1);
        transform: scale(1.05);
    }
}

/* ASEGURAR que NO haya movimiento horizontal en sidebar colapsado */
.sidebar.collapsed .nav-link:hover {
    transform: none !important;
}

.sidebar.collapsed .nav-link {
    transform: none !important;
}

/* MANTENER animaciones normales para sidebar ABIERTO */
.sidebar.expanded .nav-link:hover {
    transform: translateX(4px);
}

/* Ocultar título del menú cuando está colapsado */
.sidebar.collapsed h6 {
    display: none !important;
}

/* Padding para sidebar colapsado */
.sidebar.collapsed .p-3 {
    padding: 0.75rem 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* Asegurar que el contenedor nav sea visible */
.sidebar.collapsed .nav {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* Asegurar que los iconos sean visibles y clickeables */
.sidebar.collapsed .nav-link {
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Forzar que los iconos Font Awesome se muestren */
.sidebar.collapsed .nav-link i.fas,
.sidebar.collapsed .nav-link i.far,
.sidebar.collapsed .nav-link i.fab {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    width: auto !important;
    height: auto !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Asegurar que los iconos específicos se muestren */
.sidebar.collapsed .nav-link i.fa-money-check-alt::before,
.sidebar.collapsed .nav-link i.fa-file-alt::before,
.sidebar.collapsed .nav-link i.fa-list::before,
.sidebar.collapsed .nav-link i.fa-shipping-fast::before,
.sidebar.collapsed .nav-link i.fa-project-diagram::before,
.sidebar.collapsed .nav-link i.fa-paperclip::before,
.sidebar.collapsed .nav-link i.fa-users-cog::before {
    display: inline-block !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* DESACTIVAR animaciones del sidebar abierto cuando está colapsado */
.sidebar.collapsed .nav-link:hover::before,
.sidebar.collapsed .nav-link::before {
    animation: none !important;
    transform: none !important;
}

.sidebar.collapsed .nav-link i::before {
    animation: none !important;
    transform: none !important;
}

/* Estilo normal para iconos en sidebar colapsado */
.sidebar.collapsed .nav-link i {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: none !important;
    transition: all 0.2s ease !important;
}

/* Forzar que los iconos se muestren con contenido directo */
.sidebar.collapsed .nav-link[href*="contabilidad_pagos"] i::before {
    content: "\f53c" !important; /* fa-money-check-alt */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

.sidebar.collapsed .nav-link[href*="encabezado"] i::before {
    content: "\f15c" !important; /* fa-file-alt */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

.sidebar.collapsed .nav-link[href*="detalle"] i::before {
    content: "\f03a" !important; /* fa-list */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

.sidebar.collapsed .nav-link[href*="logistica"] i::before {
    content: "\f48b" !important; /* fa-shipping-fast */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

.sidebar.collapsed .nav-link[href*="trazabilidad"] i::before {
    content: "\f542" !important; /* fa-project-diagram */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

.sidebar.collapsed .nav-link[href*="adjuntos"] i::before {
    content: "\f0c6" !important; /* fa-paperclip */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

.sidebar.collapsed .nav-link[href*="admin_usuarios"] i::before {
    content: "\f509" !important; /* fa-users-cog */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

/* Limpiar cualquier contenido ::before que interfiera */
.sidebar.collapsed .nav-link::before {
    content: none !important;
    display: none !important;
}

/* Estilo sutil para los elementos del sidebar colapsado */
.sidebar.collapsed .nav-link {
    background: rgba(255, 255, 255, 0.05) !important;
    transition: all 0.3s ease !important;
}

.sidebar.collapsed .nav-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Tooltip para iconos colapsados */
.sidebar.collapsed .nav-link {
    position: relative;
}

.sidebar.collapsed .nav-link::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-left: 0.5rem;
    z-index: 1000;
}

.sidebar.collapsed .nav-link:hover::after {
    opacity: 1;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

/* Estilo destacado para sección ACTIVA - Fondo blanco con íconos negros */
.sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%) !important;
    color: #1f2937 !important; /* Gris oscuro para el texto */
    transform: translateX(8px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    font-weight: 600 !important;
}

/* Íconos negros para sección activa */
.sidebar .nav-link.active i {
    color: #1f2937 !important; /* Gris oscuro para íconos */
}

.sidebar .nav-link.active span {
    color: #1f2937 !important; /* Gris oscuro para texto */
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--accent-color);
    border-radius: 0 2px 2px 0;
    transition: height 0.3s ease;
}

.nav-link:hover::before, .nav-link.active::before {
    height: 70%;
}

.main-content {
    padding: 2rem;
    background: var(--bg-primary);
    min-height: calc(100vh - 80px);
    transition: all 0.3s ease;
    margin-left: 0;
}

/* ELIMINADO: Todos los ajustes problemáticos del main-content */

/* Botón hamburguesa en sidebar */
.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.85rem;
    padding: 0.75rem 0.75rem;
    margin: 0.5rem auto;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    height: auto;
    font-weight: 600;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.sidebar-toggle i {
    transition: transform 0.3s ease;
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.sidebar-toggle.rotated i {
    transform: rotate(180deg);
}

/* Posición del botón en sidebar colapsado */
.sidebar.collapsed .sidebar-toggle {
    margin: 0.5rem auto;
    width: 40px;
    padding: 0.5rem;
}

.sidebar.collapsed .sidebar-toggle span {
    display: none !important;
}

.sidebar.collapsed .sidebar-toggle i {
    margin-right: 0 !important;
    font-size: 1.2rem !important;
}

/* Posición del botón en sidebar expandido */
.sidebar.expanded .sidebar-toggle {
    margin: 0.5rem 1rem;
    width: auto;
    padding: 0.5rem 1rem;
}

.sidebar.expanded .sidebar-toggle span {
    display: inline !important;
}

.card {
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    color: white !important;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0 !important;
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    position: relative;
}

/* Forzar el estilo azul corporativo en TODOS los card-header */
.card-header.bg-warning,
.card-header.bg-success,
.card-header.bg-danger,
.card-header.bg-info {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    color: white !important;
}

.card-header h5,
.card-header .mb-0,
.card-header i {
    color: white !important;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
}

/* Botones Primarios Mejorados */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

/* Efecto de brillo en hover */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Botones Secundarios */
.btn-secondary {
    background: linear-gradient(135deg, var(--text-secondary) 0%, var(--text-muted) 100%);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
}

/* Botones de Éxito */
.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Botones de Advertencia */
.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* Botones de Información */
.btn-info {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0891b2 100%);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

/* Botones Outline */
.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stats-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.stats-card:hover::before {
    top: -25%;
    right: -25%;
}

.tab-content {
    background: var(--bg-card);
    border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #e9ecef;
}

.nav-tabs .nav-link {
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.estado-badge {
    font-size: 0.9em;
    padding: 8px 12px;
}

.collapsible-header {
    cursor: pointer;
}

.collapsible-header:hover {
    background-color: rgba(255,255,255,0.1);
}

.timeline .card {
    border-left: 4px solid var(--primary-color);
}

.table-responsive {
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: none;
    border: none;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    min-width: 100%; /* Tabla responsiva */
    width: 100%;
}

/* Contenedor de tabla con título superior */
.table-container {
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* Asegurar que la tabla mantenga su ancho mínimo */
.table-responsive .table {
    min-width: 2200px !important;
    width: max-content !important;
}

/* Revertir: Eliminar barras de desplazamiento del contenedor principal */
.main-content,
.container-fluid,
.row {
    overflow-x: visible !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Revertir: El col-md-10 sin overflow */
.col-md-10 {
    flex: 1 !important;
    max-width: 100% !important;
    overflow-x: visible !important;
}

/* Revertir: Eliminar overflow del body */
body:has(.table-container) {
    overflow-x: visible !important;
}

/* Revertir: Espaciado normal de la tabla */
.table-responsive {
    margin-bottom: 1rem !important;
    padding-bottom: 0 !important;
}

/* Columnas responsivas con anchos mínimos */
.table-responsive .table th:nth-child(1),
.table-responsive .table td:nth-child(1) { min-width: 60px; } /* ID */

.table-responsive .table th:nth-child(2),
.table-responsive .table td:nth-child(2) { min-width: 120px; } /* Importación UR */

.table-responsive .table th:nth-child(3),
.table-responsive .table td:nth-child(3) { min-width: 100px; } /* NIT */

.table-responsive .table th:nth-child(4),
.table-responsive .table td:nth-child(4) { min-width: 150px; } /* Nombre Proveedor */

.table-responsive .table th:nth-child(5),
.table-responsive .table td:nth-child(5) { min-width: 120px; } /* N° Factura */

.table-responsive .table th:nth-child(6),
.table-responsive .table td:nth-child(6) { min-width: 130px; } /* Condición de Pago */

.table-responsive .table th:nth-child(7),
.table-responsive .table td:nth-child(7) { min-width: 100px; } /* Fecha BL */

.table-responsive .table th:nth-child(8),
.table-responsive .table td:nth-child(8) { min-width: 120px; } /* Fecha de Vencimiento */

.table-responsive .table th:nth-child(9),
.table-responsive .table td:nth-child(9) { min-width: 120px; } /* Estado de Pago */

.table-responsive .table th:nth-child(10),
.table-responsive .table td:nth-child(10) { min-width: 120px; } /* Fecha de Pago */

.table-responsive .table th:nth-child(11),
.table-responsive .table td:nth-child(11) { min-width: 150px; } /* N° Confirmación */

.table-responsive .table th:nth-child(12),
.table-responsive .table td:nth-child(12) { min-width: 200px; } /* Adjunto */

.table-responsive .table th:nth-child(13),
.table-responsive .table td:nth-child(13) { min-width: 120px; } /* Acción */

/* Estilo mejorado para la barra de desplazamiento horizontal */
.table-responsive::-webkit-scrollbar {
    height: 12px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* GARANTIZAR SCROLL COMPLETO DE LA TABLA */
.table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
}

/* Tabla responsiva con layout automático */
.table-responsive .table {
    table-layout: auto !important;
    width: 100% !important;
    min-width: 100% !important;
}

/* Estilos específicos para inputs dentro de la tabla */
.table-responsive .table input[type="text"],
.table-responsive .table input[type="date"],
.table-responsive .table select {
    width: 100% !important;
    min-width: 80px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 4px 8px !important;
    font-size: 0.875rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
}

/* Permitir que el texto se parta en varias líneas */
.table-responsive .table th,
.table-responsive .table td {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: none !important;
    padding: 8px 6px !important;
    vertical-align: top !important;
}

/* FORZAR colores del texto en la tabla */
.table-responsive .table tbody td,
.table tbody td,
.table td {
    color: #000000 !important;
    background-color: transparent !important;
    font-weight: 500 !important;
    text-shadow: none !important;
}

/* Específicamente para los IDs y números */
.table-responsive .table tbody td:first-child,
.table tbody td:first-child {
    color: #000000 !important;
    font-weight: 600 !important;
    background-color: #f8f9fa !important;
}

/* REGLAS ESPECÍFICAS PARA TABLA DE ENCABEZADO */
#Importaciones .table-responsive .table tbody td {
    color: #000000 !important;
    background-color: #ffffff !important;
    font-weight: 500 !important;
    border: 1px solid #e9ecef !important;
}

#Importaciones .table-responsive .table tbody tr:nth-child(even) td {
    background-color: #f8f9fa !important;
}

#Importaciones .table-responsive .table tbody tr:nth-child(odd) td {
    background-color: #ffffff !important;
}

/* IDs en la tabla de encabezado */
#Importaciones .table-responsive .table tbody td:first-child {
    color: #000000 !important;
    font-weight: 700 !important;
    background-color: #e3f2fd !important;
    text-align: center !important;
}

/* Botones dentro de la tabla */
.table-responsive .table .btn {
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    margin: 2px !important;
    white-space: nowrap !important;
}

/* Estilos específicos para botones en columna Adjunto - SIMÉTRICOS */
.table-responsive .table td:nth-child(12) .btn {
    width: 100% !important;
    min-width: 90px !important;
    max-width: 100px !important;
    font-size: 0.7rem !important;
    padding: 6px 8px !important;
    margin: 1px 0 !important;
    text-align: center !important;
    display: inline-block !important;
    box-sizing: border-box !important;
}

/* EXCEPCIÓN: Los botones NO deben tener el ancho del campo de texto */
.table-responsive .table td:nth-child(12) .btn {
    width: auto !important;
    min-width: 90px !important;
    max-width: 100px !important;
    display: inline-block !important;
}

/* Texto de nombre de archivo en columna Adjunto */
.table-responsive .table td:nth-child(12) {
    vertical-align: top !important;
    padding: 8px 4px !important;
}

/* Contenedor de botones en Adjunto */
.table-responsive .table td:nth-child(12) > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    align-items: stretch !important;
}

/* Estilo para texto de archivo adjunto */
.table-responsive .table td:nth-child(12) .text-muted {
    font-size: 0.75rem !important;
    word-break: break-word !important;
    max-width: 100% !important;
    margin-bottom: 4px !important;
    padding: 2px 0 !important;
    line-height: 1.2 !important;
}

/* Asegurar que los nombres de archivo largos se vean completos */
.table-responsive .table td:nth-child(12) {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

/* CAMPO RESPONSIVO PARA NOMBRE DE ARCHIVO */
.table-responsive .table td:nth-child(12) input[type="text"],
.table-responsive .table td:nth-child(12) .form-control,
.table-responsive .table td:nth-child(12) .text-muted,
.table-responsive .table td:nth-child(12) span:not(.btn),
.table-responsive .table td:nth-child(12) div:not(.btn-group) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 150px !important;
    font-size: 0.85rem !important;
    padding: 8px 12px !important;
    margin: 2px 0 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    background: #f9fafb !important;
    color: #374151 !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Estilo especial para el texto que muestra el estado del archivo */
.table-responsive .table td:nth-child(12) .text-muted {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    text-align: left !important;
    min-height: 32px !important;
}

/* CONTENEDOR DE PAGINADOR FUERA DEL SCROLL */
.pagination-container {
    margin-top: 20px !important;
    text-align: center !important;
    padding: 15px 0 !important;
    background: #f8f9fa !important;
    border-radius: var(--border-radius-md) !important;
    border: 1px solid #e9ecef !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Asegurar que el paginador esté fuera del área de scroll */
.table-container {
    overflow: visible !important;
}

.table-container .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
    margin-bottom: 0 !important;
}

/* ESTILOS ESPECÍFICOS PARA TABLA DE ENCABEZADO */
/* Ajustar TODAS las columnas para que los títulos se vean completos */
.table-responsive .table th:nth-child(1),
.table-responsive .table td:nth-child(1) { min-width: 60px; } /* ID */

.table-responsive .table th:nth-child(2),
.table-responsive .table td:nth-child(2) { min-width: 120px; } /* Estado */

.table-responsive .table th:nth-child(3),
.table-responsive .table td:nth-child(3) { min-width: 130px; } /* Importación UR */

.table-responsive .table th:nth-child(4),
.table-responsive .table td:nth-child(4) { min-width: 140px; } /* Fecha de Creación */

.table-responsive .table th:nth-child(5),
.table-responsive .table td:nth-child(5) { min-width: 120px; } /* NIT Proveedor */

.table-responsive .table th:nth-child(6),
.table-responsive .table td:nth-child(6) { min-width: 180px; } /* Nombre Proveedor */

.table-responsive .table th:nth-child(7),
.table-responsive .table td:nth-child(7) { min-width: 100px; } /* BL N° */

.table-responsive .table th:nth-child(8),
.table-responsive .table td:nth-child(8) { min-width: 100px; } /* Fecha BL */

.table-responsive .table th:nth-child(9),
.table-responsive .table td:nth-child(9) { min-width: 100px; } /* Fecha ETD */

.table-responsive .table th:nth-child(10),
.table-responsive .table td:nth-child(10) { min-width: 100px; } /* Fecha ETA */

.table-responsive .table th:nth-child(11),
.table-responsive .table td:nth-child(11) { min-width: 150px; } /* Condición de Pago */

.table-responsive .table th:nth-child(12),
.table-responsive .table td:nth-child(12) { min-width: 160px; } /* Fecha Límite de Pago */

.table-responsive .table th:nth-child(13),
.table-responsive .table td:nth-child(13) { min-width: 180px; } /* Referencia Transportador */

.table-responsive .table th:nth-child(14),
.table-responsive .table td:nth-child(14) { min-width: 120px; } /* Fecha Factura */

.table-responsive .table th:nth-child(15),
.table-responsive .table td:nth-child(15) { min-width: 140px; } /* Número Factura */

.table-responsive .table th:nth-child(16),
.table-responsive .table td:nth-child(16) { min-width: 200px; } /* Observación */

.table-responsive .table th:nth-child(17),
.table-responsive .table td:nth-child(17) { min-width: 120px; } /* Acciones */

/* Asegurar que la tabla de encabezado tenga suficiente espacio */
#Importaciones .table-responsive .table {
    min-width: 100% !important;
}

#Importaciones .table-responsive .table th,
#Importaciones .table-responsive .table td {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    padding: 10px 8px !important;
    font-size: 0.9rem !important;
}

/* FORZAR colores de encabezados con máxima especificidad */
.table-responsive .table thead th,
#Importaciones .table-responsive .table thead th,
.table-container .table thead th,
.table thead th {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* ESTILOS ESPECÍFICOS PARA DATATABLES */
table.dataTable thead th,
table.dataTable thead td,
table.dataTable thead tr th,
table.dataTable thead tr td {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* Para elementos generados dinámicamente por DataTables */
.dataTable thead th,
.dataTable thead td,
.dataTable thead tr th,
.dataTable thead tr td {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* FILTROS Y CONTROLES DE DATATABLES */
table.dataTable thead tr.filters th,
table.dataTable thead tr.filters td,
table.dataTable thead tr:nth-child(2) th,
table.dataTable thead tr:nth-child(2) td {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* SELECTORES MÁS ESPECÍFICOS PARA LA TABLA DE ENCABEZADO */
#tablaEncabezado thead th,
#tablaEncabezado thead td,
#tablaEncabezado.dataTable thead th,
#tablaEncabezado.dataTable thead td,
#tablaEncabezado.dataTable thead tr th,
#tablaEncabezado.dataTable thead tr td {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* ANULAR ESTILOS CONFLICTIVOS DE BOOTSTRAP Y DATATABLES */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc,
table.dataTable thead th.sorting_disabled {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* FORZAR ESTILO EN TODOS LOS ELEMENTOS TH DEL ENCABEZADO */
thead th,
thead td,
table thead th,
table thead td {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* CSS ULTRA AGRESIVO PARA LOS ENCABEZADOS PROBLEMÁTICOS */
#tablaEncabezado thead tr th:nth-child(11),
#tablaEncabezado thead tr th:nth-child(12),
#tablaEncabezado thead tr th:nth-child(13),
#tablaEncabezado thead tr th:nth-child(14),
table.dataTable#tablaEncabezado thead tr th:nth-child(11),
table.dataTable#tablaEncabezado thead tr th:nth-child(12),
table.dataTable#tablaEncabezado thead tr th:nth-child(13),
table.dataTable#tablaEncabezado thead tr th:nth-child(14),
.dataTable#tablaEncabezado thead tr th:nth-child(11),
.dataTable#tablaEncabezado thead tr th:nth-child(12),
.dataTable#tablaEncabezado thead tr th:nth-child(13),
.dataTable#tablaEncabezado thead tr th:nth-child(14) {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    background-image: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* FORZAR ESTILO EN CADA ENCABEZADO INDIVIDUALMENTE */
#tablaEncabezado thead tr th:nth-child(11) {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
}

#tablaEncabezado thead tr th:nth-child(12) {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
}

#tablaEncabezado thead tr th:nth-child(13) {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
}

#tablaEncabezado thead tr th:nth-child(14) {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
}

/* ANULAR CUALQUIER ESTILO DE BOOTSTRAP QUE INTERFIERA */
.table-striped thead th,
.table thead th,
.table thead td,
.table-striped thead td {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* FORZAR ESTILO EN TODOS LOS ELEMENTOS DE LA TABLA DE ENCABEZADO */
#Importaciones table thead th,
#Importaciones table thead td,
#Importaciones .table thead th,
#Importaciones .table thead td,
#Importaciones .table-responsive table thead th,
#Importaciones .table-responsive table thead td {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* CSS PARA FORZAR ESTILO DESPUÉS DE CARGA DE DATATABLES */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc,
table.dataTable thead th.sorting_disabled,
table.dataTable thead th:nth-child(11),
table.dataTable thead th:nth-child(12),
table.dataTable thead th:nth-child(13),
table.dataTable thead th:nth-child(14) {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    background-image: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* CSS ULTRA AGRESIVO - ANULAR TODOS LOS ESTILOS DE DATATABLES */
table.dataTable thead th,
table.dataTable thead td,
table.dataTable thead tr th,
table.dataTable thead tr td,
.dataTable thead th,
.dataTable thead td,
.dataTable thead tr th,
.dataTable thead tr td,
#tablaEncabezado.dataTable thead th,
#tablaEncabezado.dataTable thead td,
#tablaEncabezado.dataTable thead tr th,
#tablaEncabezado.dataTable thead tr td,
#tablaEncabezado thead th,
#tablaEncabezado thead td,
#tablaEncabezado thead tr th,
#tablaEncabezado thead tr td {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    background-image: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* FORZAR ESTILO EN TODOS LOS ELEMENTOS TH SIN IMPORTAR SU ORIGEN */
th,
thead th,
table th,
table thead th,
.table th,
.table thead th,
.table-responsive th,
.table-responsive thead th {
    background: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    background-color: rgb(0,22,102) !important;
    background-image: linear-gradient(135deg, rgb(0,22,28) 0%, rgb(0,22,102) 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-shadow: none !important;
}

/* Mejorar específicamente los últimos campos de la tabla de encabezado */
#Importaciones .table-responsive .table th:nth-child(11),
#Importaciones .table-responsive .table td:nth-child(11),
#Importaciones .table-responsive .table th:nth-child(12),
#Importaciones .table-responsive .table td:nth-child(12),
#Importaciones .table-responsive .table th:nth-child(13),
#Importaciones .table-responsive .table td:nth-child(13),
#Importaciones .table-responsive .table th:nth-child(14),
#Importaciones .table-responsive .table td:nth-child(14) {
    padding: 12px 10px !important;
    font-weight: 500 !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* RESPONSIVIDAD PARA PANTALLAS PEQUEÑAS */
@media (max-width: 1200px) {
    .table-responsive .table th:nth-child(4),
    .table-responsive .table td:nth-child(4) { min-width: 120px; } /* Nombre Proveedor */
    
    .table-responsive .table th:nth-child(12),
    .table-responsive .table td:nth-child(12) { min-width: 180px; } /* Adjunto */
    
    .table-responsive .table th:nth-child(13),
    .table-responsive .table td:nth-child(13) { min-width: 100px; } /* Acción */
}

@media (max-width: 992px) {
    .table-responsive .table th:nth-child(4),
    .table-responsive .table td:nth-child(4) { min-width: 100px; } /* Nombre Proveedor */
    
    .table-responsive .table th:nth-child(12),
    .table-responsive .table td:nth-child(12) { min-width: 150px; } /* Adjunto */
    
    .table-responsive .table th:nth-child(13),
    .table-responsive .table td:nth-child(13) { min-width: 100px; } /* Acción */
}


/* Título superior de tabla */
.table-title {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.table-title i {
    font-size: 1.2rem;
    margin-right: 1rem !important;
}

/* Mejoras para las tablas */
.table {
    margin-bottom: 0;
}

/* REGLA ELIMINADA - CONFLICTO CON REGLAS MÁS ESPECÍFICAS */

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    transform: scale(1.001);
}

.table tbody td {
    padding: 1rem 0.75rem;
    border-color: #f3f4f6;
    vertical-align: middle;
}

.form-control {
    border-radius: var(--border-radius-md);
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
    transform: translateY(-1px);
}

.form-select {
    border-radius: var(--border-radius-md);
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
    transform: translateY(-1px);
}

.alert {
    border-radius: 10px;
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .card {
        margin-bottom: 1.25rem;
    }
    
    /* Ajustar logo centrado en tablets */
    .logo-empresa {
        font-size: 1.4rem !important;
    }
    
    .logo-text {
        font-size: 1.4rem !important;
    }
}

@media (max-width: 768px) {
    /* Sidebar en móviles - comportamiento adaptativo MEJORADO */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 1000 !important;
        transform: translateX(-100%) !important; /* Oculto por defecto */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        min-height: auto;
        padding-top: 70px !important;
    }
    
    .sidebar.show {
        transform: translateX(0) !important;
    }
    
    /* Sidebar overlay para móviles */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Botón hamburguesa mejorado */
    .sidebar-toggle {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: rgba(255, 255, 255, 0.9) !important;
        border: 2px solid var(--primary-color) !important;
        color: var(--primary-color) !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    .sidebar-toggle:hover {
        background: var(--primary-color) !important;
        color: white !important;
    }
        
    /* Mejorar visibilidad del logo en móviles */
    .logo-empresa {
        font-size: 1.2rem !important;
    }
    
    .logo-text {
        font-size: 1.2rem !important;
    }
    
    /* Optimizar navbar para móviles */
    .navbar {
        padding: 0.5rem 1rem !important;
    }
    
    .navbar-brand {
        font-size: 1.1rem !important;
    }
    
    /* Ajustar contenido principal para móviles */
    .main-content {
        padding: 1rem !important;
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Optimizar cards para móviles */
    .card {
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    .card-header {
        padding: 1rem !important;
        font-size: 1rem !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Formularios móviles MEJORADOS */
    .form-control, .form-select {
        font-size: 16px !important; /* Evita zoom en iOS */
        padding: 12px 16px !important;
        border-radius: 8px !important;
        border: 2px solid #e5e7eb !important;
    }
    
    .form-control:focus, .form-select:focus {
        border-color: var(--accent-color) !important;
        box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1) !important;
    }
    
    .form-label {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Botones móviles MEJORADOS */
    .btn {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        border-radius: 8px !important;
        margin-bottom: 0.5rem !important;
        min-height: 44px !important; /* Área de toque mínima */
    }
    
    /* Tablas responsivas MEJORADAS */
    .table-responsive {
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        margin-bottom: 1rem !important;
    }
    
    .table-responsive .table {
        font-size: 0.8rem !important;
        min-width: 800px !important;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 8px 6px !important;
        white-space: nowrap !important;
    }
    
    /* Scrollbar personalizada para móviles */
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 4px;
    }
    
    .table-responsive .table .btn {
        font-size: 0.7rem !important;
        padding: 3px 6px !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Sidebar visible cuando se abre */
    .sidebar.expanded {
        transform: translateX(0) !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
        border-right: 1px solid rgba(255,255,255,0.1) !important;
        border-bottom: none !important;
    }
    
    /* Overlay para cerrar sidebar al tocar fuera */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Ajustar contenido principal en móviles */
    .col-md-10 {
        margin-left: 0 !important;
        width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .main-content {
        padding: 1rem;
        min-height: auto;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: var(--border-radius-lg);
    }
    
    .card-header {
        padding: 1rem;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0 !important;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        margin: 2px 0;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    .btn-primary, .btn-secondary, .btn-success, .btn-warning, .btn-info {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius-md);
        font-size: 0.9rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 800px; /* Asegurar ancho mínimo para scroll horizontal */
    }
    
    .table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .table tbody td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    .stats-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .form-control, .form-select {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* Mejorar controles de DataTables en móviles */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 1rem;
    }
    
    .dataTables_wrapper .dataTables_length select {
        min-width: 60px;
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    /* Sidebar en móviles pequeños - mantener funcionalidad */
    .sidebar {
        width: 280px !important; /* Ancho fijo para móviles pequeños */
    }
    
    /* Ajustar navbar para móviles pequeños */
    .navbar-brand {
        font-size: 1rem !important;
    }
    
    /* Logo centrado más pequeño en móviles pequeños */
    .logo-empresa {
        font-size: 1rem !important;
    }
    
    .logo-text {
        font-size: 1rem !important;
    }
    
    /* Optimizar botones para móviles pequeños */
    .btn {
        font-size: 0.85rem !important;
        padding: 0.4rem 0.8rem !important;
    }
    
    /* Ajustar formularios para móviles pequeños */
    .form-control, .form-select {
        font-size: 0.9rem !important;
        padding: 0.5rem !important;
    }
    
    /* Optimizar texto para móviles pequeños */
    .card-title {
        font-size: 1.1rem !important;
    }
    
    .card-text {
        font-size: 0.9rem !important;
    }
    
    .navbar-text {
        font-size: 0.9rem !important;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .card {
        border-radius: var(--border-radius-md);
    }
    
    .card-header {
        padding: 0.75rem;
        border-radius: var(--border-radius-md) var(--border-radius-md) 0 0 !important;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .btn-primary, .btn-secondary, .btn-success, .btn-warning, .btn-info {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .stats-card {
        padding: 1.25rem;
    }
    
    .table thead th {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .table tbody td {
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }
    
    /* Ocultar columnas menos importantes en móviles */
    .table .d-none-mobile {
        display: none !important;
    }
}

/* Mejoras para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        min-width: 200px;
    }
    
    .main-content {
        padding: 1.75rem;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
}

/* Estilos adicionales para mejorar la experiencia visual */

/* Animaciones suaves para transiciones globales */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Mejoras para los badges de estado */
.badge {
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Estilos para iconos */
.fas, .far, .fab {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
    display: inline-block !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Asegurar que los iconos se muestren correctamente */
.fas::before, .far::before, .fab::before {
    display: inline-block !important;
}

/* Mejoras para el navbar */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

/* Espaciado para títulos de sección con iconos */
h2 i, .main-content h2 i {
    margin-right: 1.5rem !important;
    font-size: 1.1em;
}

/* Espaciado adicional para títulos de secciones - Espacio moderado */
.main-content h2,
.col-md-10 h2,
h2 {
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
    padding-top: 0.5rem !important;
}

/* Corregir superposición en encabezados de DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    margin: 0.5rem 0;
}

/* Ajustar ancho de columnas específicas para evitar superposición */
.dataTables_wrapper table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 120px;
    position: relative;
}

/* Asegurar que las flechas de ordenamiento no se superpongan */
.dataTables_wrapper table th.sorting,
.dataTables_wrapper table th.sorting_asc,
.dataTables_wrapper table th.sorting_desc {
    padding-right: 30px !important; /* Espacio para las flechas */
}

/* Ajustar específicamente la columna "Importación UR" */
.dataTables_wrapper table th:nth-child(1) {
    min-width: 140px !important;
    max-width: 160px !important;
}

.navbar-text {
    font-weight: 500;
}

/* Efectos de carga y transiciones */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Mejoras para los filtros y controles */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

/* Estilos para DataTables */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--border-radius-sm);
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    min-width: 60px;
    width: auto;
    height: auto;
    line-height: 1.5;
}

/* Corregir el selector de registros */
.dataTables_wrapper .dataTables_length select {
    padding: 0.25rem 0.5rem;
    margin: 0 0.25rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.875rem;
    min-width: 70px;
    width: auto;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 22, 28, 0.25);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--border-radius-sm);
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Mejorar el layout de DataTables */
.dataTables_wrapper {
    width: 100%;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.dataTables_wrapper .dataTables_length {
    float: left;
    margin: 0;
}

.dataTables_wrapper .dataTables_filter {
    float: right;
    margin: 0;
}

.dataTables_wrapper .dataTables_info {
    float: left;
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_paginate {
    float: right;
    margin: 0.5rem 0 0 0;
}

/* Limpiar floats */
.dataTables_wrapper:after {
    content: "";
    display: table;
    clear: both;
}

/* Mejorar el selector de registros por página */
.dataTables_wrapper .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_length select {
    display: inline-block;
    vertical-align: middle;
    padding: 0.375rem 0.75rem;
    margin: 0 0.25rem;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-sm);
    background-color: #fff;
    font-size: 0.875rem;
    min-width: 80px;
    height: auto;
    line-height: 1.5;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-sm);
    background-color: #fff;
    font-size: 0.875rem;
    width: 200px;
    height: auto;
    line-height: 1.5;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   ESTILOS PARA PÁGINAS ESPECÍFICAS
   ======================================== */

/* Estilos para login */
body.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-body {
    padding: 2.5rem;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 0.75rem;
    font-weight: 600;
    width: 100%;
    color: white;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Estilos para páginas de administración */
.admin-container {
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Estilos para formularios específicos */
.form-section {
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

/* Estilos para ver_usuarios.php */
.ver-usuarios-table {
    border-collapse: collapse;
    width: 100%;
}

.ver-usuarios-table th,
.ver-usuarios-table td {
    border: 1px solid #ccc;
    padding: 8px;
}

.ver-usuarios-table th {
    background: #eee;
}

.ok { color: green; }
.no { color: red; }
code { font-size: 0.9em; }

/* ========================================
   SISTEMA DE TEMAS CLARO/OSCURO
   ======================================== */


/* ========================================
   OCULTAR COLUMNAS DE LA TABLA IMPORTACIONES
   ======================================== */

/* Ocultar columnas específicas de la tabla IMPORTACIONES */
#tablaEncabezado th:nth-child(4),  /* Fecha Creación */
#tablaEncabezado td:nth-child(4) {
    display: none !important;
}

#tablaEncabezado th:nth-child(5),  /* NIT Proveedor */
#tablaEncabezado td:nth-child(5) {
    display: none !important;
}

#tablaEncabezado th:nth-child(7),  /* BL N° */
#tablaEncabezado td:nth-child(7) {
    display: none !important;
}

#tablaEncabezado th:nth-child(8),  /* Fecha BL */
#tablaEncabezado td:nth-child(8) {
    display: none !important;
}

#tablaEncabezado th:nth-child(11), /* Condición de Pago */
#tablaEncabezado td:nth-child(11) {
    display: none !important;
}

#tablaEncabezado th:nth-child(12), /* Fecha Límite de Pago */
#tablaEncabezado td:nth-child(12) {
    display: none !important;
}

#tablaEncabezado th:nth-child(14), /* Fecha Factura */
#tablaEncabezado td:nth-child(14) {
    display: none !important;
}

/* ========================================
   CENTRAR TEXTO EN TABLA DETALLE
   ======================================== */

/* Centrar todo el texto en la tabla de detalle */
#tablaDetalle th,
#tablaDetalle td {
    text-align: center !important;
    vertical-align: middle !important;
}

/* ========================================
   LOGO ANIMADO
   ======================================== */

.navbar-brand {
    position: relative;
    overflow: hidden;
}

.navbar-brand::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -100%;
    width: 100%;
    height: calc(100% + 4px);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.navbar-brand:hover::before {
    left: 100%;
}

.navbar-brand i {
    transition: transform 0.3s ease;
}

.navbar-brand:hover i {
    transform: rotate(360deg) scale(1.1);
}

/* ========================================
   ICONOS ANIMADOS
   ======================================== */

/* Animación para iconos del menú */
.nav-link i {
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover i {
    transform: scale(1.3) rotate(360deg);
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Efecto de brillo SIMPLE para iconos en sidebar colapsado */
.sidebar.collapsed .nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--border-radius-sm) !important;
}

/* Fondo especial para iconos ACTIVOS en sidebar colapsado - Fondo blanco con íconos negros */
.sidebar.collapsed .nav-link.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: var(--border-radius-sm) !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) !important;
    transform: scale(1.05) !important;
}

/* Íconos negros para sidebar colapsado activo */
.sidebar.collapsed .nav-link.active i {
    color: #1f2937 !important; /* Gris oscuro para íconos */
}

@keyframes iconGlow {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0.3; }
}

/* Animación para iconos de botones */
.btn i {
    transition: all 0.3s ease;
}

.btn:hover i {
    transform: scale(1.1);
}

/* Animación para iconos de tabla */
.table .btn i {
    transition: all 0.2s ease;
}

.table .btn:hover i {
    transform: scale(1.2);
}

/* ========================================
   ANIMACIONES DE ENTRADA
   ======================================== */

/* Animación fade-in para tarjetas */
.card {
    animation: slideInUp 0.6s ease-out;
}

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

/* Animación escalonada para filas de tabla */
.table tbody tr {
    animation: fadeInLeft 0.4s ease-out;
    animation-fill-mode: both;
}

.table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.table tbody tr:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ESTILOS PARA NAVBAR CON LOGO CENTRADO */
.navbar-brand.mx-auto {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10 !important;
}

/* Estilos especiales para el logo de la empresa */
.logo-empresa {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.logo-text {
    display: inline-block;
    margin-left: 0.5rem;
}

/* Efecto especial para "UR" */
.ur-highlight {
    background: linear-gradient(90deg, #1528f5, #0517d6, #e6e3e3, #174ced, #100de6);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900 !important;
    font-size: 1.1em !important;
    animation: urFlow 6s ease-in-out infinite;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Animación sutil de gradiente que fluye */
@keyframes urFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Efecto hover sutil para todo el logo */
.logo-empresa:hover .ur-highlight {
    animation-duration: 3s;
    transform: scale(1.02);
}

/* Efecto para tema oscuro */
[data-theme="dark"] .ur-highlight {
    background: linear-gradient(90deg, #87CEEB, #4682B4, #5F9EA0, #87CEEB, #4682B4);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .btn-link.navbar-brand {
    color: white !important;
    text-decoration: none !important;
    font-size: 1.2rem !important;
    padding: 0.5rem !important;
}

.navbar .btn-link.navbar-brand:hover {
    color: var(--accent-color) !important;
}

/* Animación para el navbar */
.navbar {
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación para contenido principal */
.main-content {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.navbar-text {
    color: white !important;
}

/* ==========================================
   ANIMACIÓN DE BARCO NAVEGANDO
   ========================================== */

/* Barra azul global debajo del header */
.barra-azul {
    position: relative;
    height: 18px; /* Grosor final perfecto para efecto de mar */
    background: linear-gradient(90deg,
        #1e40af 0%,
        #3b82f6 25%,
        #06b6d4 50%,
        #3b82f6 75%,
        #1e40af 100%); /* Gradiente más rico */
    overflow-x: hidden; /* Evitar barra de desplazamiento horizontal */
    overflow-y: visible; /* Permitir que el barco se vea arriba */
    width: 100%;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2); /* Sombra y brillo interno */
}

/* Emoji de barco navegando - POSICIÓN PERFECTA FINAL */
.barquito {
    position: absolute;
    top: -6px; /* Posición perfecta final (5-6px desde arriba) */
    left: 0px; /* Empezar desde el borde izquierdo */
    font-size: 1.2rem; /* Tamaño reducido a la mitad */
    color: #ffffff !important; /* Color blanco sólido */
    text-shadow: 
        0 0 8px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.9); /* Sombra negra para contraste */
    animation: navegar 15s linear infinite;
    z-index: 100; /* Z-index más alto */
    transition: transform 0.3s ease !important;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important;
    /* Limpio y simple para emoji */
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    line-height: 1 !important;
}

/* Efecto hover exactamente igual al del navbar-brand i */
.barquito:hover {
    transform: rotate(360deg) scale(1.1) !important;
    animation-play-state: paused; /* Pausar animación al hacer hover */
}

/* Animación de navegación con efecto de olas realista */
@keyframes navegar {
    0% { 
        left: 0px; /* Empezar desde el borde izquierdo */
        transform: scaleX(1) translateY(0px); /* Emoji navegando */
        opacity: 1;
    }
    8% { 
        transform: scaleX(1) translateY(-3px); /* Subida de ola */
        opacity: 1;
    }
    16% { 
        transform: scaleX(1) translateY(-1px); /* Bajada suave */
        opacity: 1;
    }
    24% { 
        transform: scaleX(1) translateY(2px); /* Valle de ola */
        opacity: 1;
    }
    32% { 
        transform: scaleX(1) translateY(-2px); /* Subida de ola */
        opacity: 1;
    }
    40% { 
        transform: scaleX(1) translateY(1px); /* Bajada suave */
        opacity: 1;
    }
    48% { 
        transform: scaleX(1) translateY(-1px); /* Movimiento sutil */
        opacity: 1;
    }
    56% { 
        transform: scaleX(1) translateY(3px); /* Valle más profundo */
        opacity: 1;
    }
    64% { 
        transform: scaleX(1) translateY(-2px); /* Subida de ola */
        opacity: 1;
    }
    72% { 
        transform: scaleX(1) translateY(1px); /* Bajada suave */
        opacity: 1;
    }
    80% { 
        transform: scaleX(1) translateY(-1px); /* Movimiento sutil */
        opacity: 1;
    }
    88% { 
        transform: scaleX(1) translateY(2px); /* Valle de ola */
        opacity: 1;
    }
    96% { 
        transform: scaleX(1) translateY(-1px); /* Subida final */
        opacity: 1;
    }
    100% { 
        left: calc(100% - 1.2rem); /* Terminar justo antes del borde derecho */
        transform: scaleX(1) translateY(0px); /* Volver a posición neutral */
        opacity: 1;
    }
}

/* Efecto de olas sutil */
.barra-azul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.1) 75%, 
        transparent 100%);
    animation: olas 8s ease-in-out infinite;
}

@keyframes olas {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* Responsive: Ajustar velocidad en pantallas pequeñas */
@media (max-width: 768px) {
    .barquito {
        animation-duration: 12s; /* Más rápido en móviles */
        font-size: 1.1rem; /* Tamaño proporcional para tablets */
        top: -5px; /* Posición perfecta en tablets */
        text-shadow:
            0 0 6px rgba(0, 0, 0, 0.8),
            0 0 12px rgba(0, 0, 0, 0.6),
            0 2px 4px rgba(0, 0, 0, 0.9);
    }
    
    .barra-azul {
        height: 15px; /* Grosor proporcional en tablets */
    }
}

@media (max-width: 576px) {
    .barquito {
        animation-duration: 10s; /* Aún más rápido */
        font-size: 1rem; /* Tamaño proporcional para móviles */
        top: -4px; /* Posición perfecta en móviles */
        text-shadow:
            0 0 4px rgba(0, 0, 0, 0.8),
            0 0 8px rgba(0, 0, 0, 0.6),
            0 2px 4px rgba(0, 0, 0, 0.9);
    }

    .barra-azul {
        height: 12px; /* Grosor proporcional en móviles */
    }
    
    /* Mejoras adicionales para móviles pequeños */
    .table-responsive {
        font-size: 0.75rem !important;
    }
    
    .btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .form-control {
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    .card-header h2 {
        font-size: 1.1rem !important;
    }
    
    /* DataTables responsive en móviles */
    .dtr-details {
        font-size: 0.85rem !important;
    }
    
    .dtr-title {
        font-weight: 600 !important;
    }
    
    .dtr-data {
        padding: 0.25rem 0 !important;
    }
}

.navbar .nav-link {
    color: white !important;
}

.navbar .nav-link:hover {
    color: rgba(255,255,255,0.8) !important;
}
.sidebar h6 {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ========================================
   ANIMACIÓN DE BARCO EN LOGIN
   ======================================== */

/* Contenedor del barco navegando dentro del formulario de login */
.login-boat-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5; /* Por debajo de los campos del formulario */
    overflow: visible;
}

/* Barco navegando dentro del formulario */
.login-boat {
    position: absolute;
    font-size: 1.2rem; /* Más pequeño para no interferir */
    color: #ffffff;
    text-shadow: 
        0 0 8px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.9);
    animation: navegarLogin 20s linear infinite;
    z-index: 5; /* Por debajo de los campos del formulario */
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

/* Efecto hover para el barco del login */
.login-boat:hover {
    transform: scale(1.3) !important;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6)) !important;
    animation-play-state: paused !important;
}

/* Animación del barco navegando dentro del formulario de login */
@keyframes navegarLogin {
    /* Lado superior: de izquierda a derecha */
    0% {
        top: 10px;
        left: 10px;
        transform: rotate(0deg);
    }
    25% {
        top: 10px;
        left: calc(100% - 40px);
        transform: rotate(0deg);
    }
    /* Lado derecho: de arriba a abajo */
    25.1% {
        top: 10px;
        left: calc(100% - 40px);
        transform: rotate(90deg);
    }
    50% {
        top: calc(100% - 40px);
        left: calc(100% - 40px);
        transform: rotate(90deg);
    }
    /* Lado inferior: de derecha a izquierda */
    50.1% {
        top: calc(100% - 40px);
        left: calc(100% - 40px);
        transform: rotate(180deg);
    }
    75% {
        top: calc(100% - 40px);
        left: 10px;
        transform: rotate(180deg);
    }
    /* Lado izquierdo: de abajo a arriba */
    75.1% {
        top: calc(100% - 40px);
        left: 10px;
        transform: rotate(270deg);
    }
    100% {
        top: 10px;
        left: 10px;
        transform: rotate(270deg);
    }
}

/* Efecto de olas sutil para el barco del login */
.login-boat {
    animation: 
        navegarLogin 20s linear infinite,
        olasLogin 3s ease-in-out infinite;
}

@keyframes olasLogin {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-4px); 
    }
}

/* Responsive para el barco del login */
@media (max-width: 768px) {
    .login-boat {
        font-size: 1rem;
        animation-duration: 15s;
    }
    
    @keyframes navegarLogin {
        0% { top: 8px; left: 8px; transform: rotate(0deg); }
        25% { top: 8px; left: calc(100% - 32px); transform: rotate(0deg); }
        25.1% { top: 8px; left: calc(100% - 32px); transform: rotate(90deg); }
        50% { top: calc(100% - 32px); left: calc(100% - 32px); transform: rotate(90deg); }
        50.1% { top: calc(100% - 32px); left: calc(100% - 32px); transform: rotate(180deg); }
        75% { top: calc(100% - 32px); left: 8px; transform: rotate(180deg); }
        75.1% { top: calc(100% - 32px); left: 8px; transform: rotate(270deg); }
        100% { top: 8px; left: 8px; transform: rotate(270deg); }
    }
}

@media (max-width: 576px) {
    .login-boat {
        font-size: 0.9rem;
        animation-duration: 12s;
    }
    
    @keyframes navegarLogin {
        0% { top: 6px; left: 6px; transform: rotate(0deg); }
        25% { top: 6px; left: calc(100% - 28px); transform: rotate(0deg); }
        25.1% { top: 6px; left: calc(100% - 28px); transform: rotate(90deg); }
        50% { top: calc(100% - 28px); left: calc(100% - 28px); transform: rotate(90deg); }
        50.1% { top: calc(100% - 28px); left: calc(100% - 28px); transform: rotate(180deg); }
        75% { top: calc(100% - 28px); left: 6px; transform: rotate(180deg); }
        75.1% { top: calc(100% - 28px); left: 6px; transform: rotate(270deg); }
        100% { top: 6px; left: 6px; transform: rotate(270deg); }
    }
}

/* Mejoras adicionales para responsividad móvil */
@media (max-width: 480px) {
    /* Móviles muy pequeños */
    .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .card {
        margin-bottom: 0.75rem !important;
    }
    
    .btn-group .btn {
        font-size: 0.75rem !important;
        padding: 0.3rem 0.6rem !important;
    }
    
    /* Optimizar tablas para móviles muy pequeños */
    .table-responsive {
        font-size: 0.75rem !important;
    }
    
    .table th, .table td {
        padding: 0.3rem !important;
    }
    
    /* Logo más pequeño en móviles muy pequeños */
    .logo-empresa {
        font-size: 0.9rem !important;
    }
    
    .logo-text {
        font-size: 0.9rem !important;
    }
}

/* Optimizaciones para orientación landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 0.3rem 1rem !important;
    }
    
    .barra-azul {
        height: 14px !important;
    }
    
    .barquito {
        font-size: 1rem !important;
        top: -4px !important;
    }
    
    /* Reducir altura del sidebar en landscape */
    .sidebar {
        height: 100vh !important;
    }
}

/* Mejoras para touch devices */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivos táctiles */
    .btn {
        min-height: 44px !important; /* Tamaño mínimo recomendado para touch */
        min-width: 44px !important;
    }
    
    .nav-link {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .form-control, .form-select {
        min-height: 44px !important;
    }
    
    /* Mejorar área de toque para iconos */
    .fas, .far, .fab {
        min-width: 20px !important;
        text-align: center !important;
    }
}
