/* Estilos adicionales para la Landing Page */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    margin-top: -20px;
}

.hero-section h1 {
    color: white;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.9);
}

.hero-image {
    padding: 40px;
}

.hero-icon {
    font-size: 200px;
    color: rgba(255, 255, 255, 0.2);
    animation: float 3s ease-in-out infinite;
}

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

.min-vh-50 {
    min-height: 50vh;
}

/* Módulos Section */
.modulos-section {
    padding: 80px 0;
    background: white;
}

.modulo-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.modulo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.modulo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modulo-icon .material-icons {
    font-size: 40px;
    color: white;
}

.modulo-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.modulo-description {
    color: #6c757d;
    margin-bottom: 20px;
    text-align: center;
    min-height: 60px;
}

.modulo-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modulo-features li {
    padding: 8px 0;
    color: #495057;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.modulo-features .check-icon {
    font-size: 20px;
    color: #28a745;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Features Section */
.features-section {
    padding: 80px 0;
}

.feature-item {
    padding: 30px 20px;
}

.feature-icon {
    font-size: 60px;
    color: #667eea;
    margin-bottom: 20px;
}

.feature-item h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-item p {
    color: #6c757d;
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
}

.cta-section .btn-light {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.cta-section .btn-light:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-icon {
        font-size: 120px;
    }
    
    .modulo-card {
        margin-bottom: 20px;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
}

/* Ajustes para el navbar en landing */
.hero-section ~ * {
    margin-top: 0;
}

/* Mejoras de accesibilidad */
.modulo-card:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 4px;
}

/* Animaciones suaves */
.modulo-card,
.feature-item {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Stagger animation para las tarjetas */
.modulo-card:nth-child(1) { animation-delay: 0.1s; }
.modulo-card:nth-child(2) { animation-delay: 0.2s; }
.modulo-card:nth-child(3) { animation-delay: 0.3s; }
.modulo-card:nth-child(4) { animation-delay: 0.4s; }
.modulo-card:nth-child(5) { animation-delay: 0.5s; }
.modulo-card:nth-child(6) { animation-delay: 0.6s; }

/* ============================================================================
   ESTILOS PARA PÁGINAS: QUIÉNES SOMOS, CONTACTO, PRECIOS
   Consistencia con landing existente - Sin CSS inline
   ============================================================================ */

/* Hero reducido para subpáginas */
.hero-section-sm {
    padding: 50px 0;
    min-height: auto;
}

.hero-section-sm .min-vh-50 {
    min-height: auto;
}

.opacity-90 {
    opacity: 0.9;
}

/* About Section - Quiénes Somos */
.about-section {
    background: white;
}

.about-content .text-primary {
    color: var(--tenant-color-primary, #667eea) !important;
}

.about-icon-wrapper {
    padding: 40px;
}

.about-main-icon {
    font-size: 180px;
    color: rgba(102, 126, 234, 0.2);
    animation: float 3s ease-in-out infinite;
}

/* Values Section - Misión, Visión, Valores */
.value-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    text-align: center;
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.value-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.value-icon .material-icons {
    font-size: 36px;
    color: white;
}

.value-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.value-description {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Team Section - Nuestro Equipo */
.team-section {
    background: white;
}

.team-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    text-align: center;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.team-avatar-wrapper {
    width: 120px;
    height: 140px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #e9ecef;
}

.team-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.team-role {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 10px;
}

.team-bio {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
}

/* Contact Section */
.contact-section {
    background: white;
}

.contact-info-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    height: 100%;
}

.contact-info-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}

.contact-info-item:last-child {
    margin-bottom: 0;
}

.contact-info-icon {
    font-size: 28px;
    color: #667eea;
    flex-shrink: 0;
}

.contact-form-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.contact-form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.contact-form .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.contact-form .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Pricing Section */
.pricing-section {
    background: linear-gradient(180deg, #f7f8fc 0%, #ffffff 40%, #ffffff 100%);
}

.pricing-grid {
    align-items: stretch;
}

.pricing-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 28px rgba(44, 62, 80, 0.06);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    border: 1px solid #e6e9f0;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(44, 62, 80, 0.1);
}

.pricing-card-featured {
    border-color: rgba(102, 126, 234, 0.45);
    box-shadow: 0 10px 32px rgba(102, 126, 234, 0.14);
}

.pricing-card-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #5c6cfa 0%, #7c4dff 100%);
}

.pricing-card-featured:hover {
    box-shadow: 0 16px 38px rgba(102, 126, 234, 0.2);
}

.pricing-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    left: auto;
    transform: none;
    background: linear-gradient(135deg, #5c6cfa 0%, #7c4dff 100%);
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(92, 108, 250, 0.3);
}

.pricing-header {
    padding: 28px 24px 18px;
    text-align: center;
    border-bottom: 1px solid #eef0f5;
    flex-shrink: 0;
}

.pricing-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.pricing-card-featured .pricing-title {
    color: #1a2458;
    padding-right: 5.5rem;
}

.pricing-price {
    margin: 10px 0 12px;
}

.pricing-currency {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 600;
    vertical-align: super;
}

.pricing-amount {
    font-size: 2.35rem;
    font-weight: 800;
    color: #2c3e50;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.pricing-period {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
}

.pricing-anual-slot {
    min-height: 5.75rem;
    display: flex;
    align-items: stretch;
}

.pricing-anual-box {
    width: 100%;
    margin: 0;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.07) 0%, rgba(102, 126, 234, 0.07) 100%);
    border: 1px solid rgba(40, 167, 69, 0.22);
    text-align: center;
}

.pricing-anual-top {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.3rem;
}

.pricing-anual-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.28);
}

.pricing-anual-ahorro {
    font-size: 0.8rem;
    font-weight: 700;
    color: #198754;
}

.pricing-anual-precio {
    line-height: 1.3;
}

.pricing-anual-tachado {
    display: inline-block;
    margin-right: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9aa3af;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.pricing-anual-monto {
    font-size: 1.05rem;
    font-weight: 800;
    color: #2c3e50;
}

.pricing-anual-periodo {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.82rem;
}

.pricing-anual-hint {
    margin-top: 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #667eea;
    text-transform: uppercase;
}

.pricing-anual-placeholder {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px dashed #d8dde8;
    background: #f8f9fc;
    padding: 0.75rem;
}

.pricing-anual-placeholder-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #8b93a7;
    letter-spacing: 0.02em;
}

.pricing-card-featured .pricing-anual-box {
    border-color: rgba(102, 126, 234, 0.35);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(102, 126, 234, 0.12) 100%);
}

.pricing-description {
    font-size: 0.88rem;
    color: #6c757d;
    margin: 0 0 4px;
    min-height: 1.35rem;
}

.pricing-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.pricing-features {
    list-style: none;
    padding: 16px 22px 8px;
    margin: 0;
    flex: 1 1 auto;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    color: #495057;
    border-bottom: 1px solid #f1f3f7;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-check {
    font-size: 18px;
    color: #28a745;
    flex-shrink: 0;
    margin-top: 1px;
}

.pricing-feature-text {
    font-size: 0.88rem;
    line-height: 1.4;
}

.pricing-nota-pie {
    margin: auto 22px 8px;
    padding-top: 4px;
    font-size: 0.74rem;
    line-height: 1.35;
    color: #6c757d;
    font-style: italic;
    min-height: 1.2rem;
}

.pricing-nota-pie--empty {
    visibility: hidden;
}

.pricing-footer {
    padding: 12px 22px 22px;
    margin-top: auto;
    flex-shrink: 0;
}

.pricing-footer .btn,
.pricing-cta {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.pricing-card-featured .pricing-cta {
    background: linear-gradient(135deg, #5c6cfa 0%, #7c4dff 100%);
    border: none;
}

/* Responsive para nuevas secciones */
@media (max-width: 768px) {
    .hero-section-sm {
        padding: 40px 0;
    }

    .about-main-icon {
        font-size: 120px;
    }

    .team-avatar-wrapper {
        width: 100px;
        height: 116px;
    }

    .contact-form-card {
        padding: 25px;
    }
}

/* Footer premium — landing pública */
.landing-footer {
    margin-top: 0;
    padding: 3.5rem 0 2rem;
    background: linear-gradient(160deg, #1e2433 0%, #2c3e50 55%, #1a1f2e 100%);
    color: rgba(255, 255, 255, 0.88);
}

.landing-footer-titulo {
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

.landing-footer-subtitulo {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
}

.landing-footer-descripcion {
    font-size: 0.9rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.68);
}

.landing-footer-seccion-titulo {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1.1rem;
}

.landing-contacto-bloque {
    font-size: 0.9rem;
    line-height: 1.55;
}

.landing-contacto-marca {
    color: #fff;
    font-size: 1rem;
}

.landing-contacto-lista li {
    margin-bottom: 0.35rem;
    color: rgba(255, 255, 255, 0.78);
}

.landing-contacto-lista--direccion li {
    color: rgba(255, 255, 255, 0.72);
}

.landing-contacto-etiqueta {
    display: inline-block;
    min-width: 6.5rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
}

.landing-contacto-enlace {
    color: #c7d4ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.landing-contacto-enlace:hover {
    color: #fff;
    text-decoration: underline;
}

.landing-footer-enlaces a {
    display: block;
    padding: 0.3rem 0;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.landing-footer-enlaces a:hover {
    color: #fff;
    padding-left: 0.25rem;
}

.landing-footer-divider {
    height: 1px;
    margin: 2.25rem 0 1.5rem;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );
}

.landing-footer-copy,
.landing-footer-legal-links {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.55;
}

.landing-footer-legal-links a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
}

.landing-footer-legal-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.landing-footer-sep {
    margin: 0 0.45rem;
    opacity: 0.45;
}

/* Páginas legales — Política y Términos */
.legal-section {
    background: #f4f6fb;
}

.legal-document-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem 2.75rem;
    box-shadow: 0 8px 28px rgba(44, 62, 80, 0.08);
    border: 1px solid #e9ecef;
}

.legal-document-meta {
    font-size: 0.9rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1.25rem;
}

.legal-document-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
}

.legal-document-card p {
    color: #495057;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.legal-document-list {
    padding-left: 1.25rem;
    color: #495057;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.legal-document-list li {
    margin-bottom: 0.45rem;
}

.legal-document-card a {
    color: #667eea;
    text-decoration: none;
}

.legal-document-card a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .landing-footer {
        padding: 2.5rem 0 1.5rem;
        text-align: left;
    }

    .landing-footer-meta {
        text-align: left !important;
    }

    .landing-footer-legal-links {
        text-align: left !important;
        margin-top: 0.75rem;
    }

    .legal-document-card {
        padding: 1.5rem 1.25rem;
    }
}

/* ============================================================================
   ESTILOS PARA PÁGINA DE LOGIN - TONOS GRISES OSCUROS
   Diseño elegante, moderno y amigable - 100% Responsive
   ============================================================================ */

/* Reset completo para la página de login */
body.login-page,
body.login-page * {
    box-sizing: border-box;
}

body.login-page {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    min-height: 100vh !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    position: relative !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    color: #333333 !important;
}

/* Reset de Bootstrap para login page */
body.login-page .container,
body.login-page .container-fluid,
body.login-page .row,
body.login-page .col,
body.login-page .col-md,
body.login-page .col-lg {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none !important;
}

/* Ocultar elementos no deseados de Bootstrap */
body.login-page nav,
body.login-page footer,
body.login-page .navbar,
body.login-page main.container,
body.login-page header {
    display: none !important;
}

/* Forzar fondo oscuro en todos los elementos */
body.login-page > *:not(.login-container) {
    background: transparent !important;
}

/* Animación sutil del fondo */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efecto de partículas sutiles en el fondo */
body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Contenedor principal del login */
.login-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    height: 100vh !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 40px 20px !important;
    position: relative !important;
    z-index: 999 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Wrapper del login box */
.login-wrapper {
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    margin: 60px auto 0 auto !important;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Caja principal del login - Estilo de ficha elegante con marco */
.login-box {
    /* ============================================
       COLOR DE FONDO DE LA FICHA DE LOGIN
       Degradado de gris claro con más blanco - Cambiar aquí para modificar
       ============================================ */
    /*background: linear-gradient(135deg, #e0e0e0 0%, #d5d5d5 20%, #c8c8c8 50%) !important; */ /* Degradado gris muy claro (más blanco) */
    background: linear-gradient(135deg, #b8b8b8 10%, #a0a0a0 50%, #a0a0a0 100%)
    background-color: #d5d5d5 !important;  /* Color de respaldo (fallback) - gris muy claro */
    /* ============================================ */
    
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 24px !important;
    padding: 60px 50px !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    border: 4px solid #1a1a1a !important;
    border-style: solid !important;
    position: relative !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    display: block !important;
    visibility: visible !important;
}

/* Efecto de brillo sutil en la ficha */
.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.8s ease;
}

.login-box:hover::before {
    left: 100%;
}

.login-box:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: #2d2d2d !important;
}

/* Header del login */
.login-header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 0;
    padding: 0;
    position: relative;
}

.login-logo {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 50%, #2d2d2d 100%);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: logoFloat 3s ease-in-out infinite;
}

.login-logo--brand {
    width: auto;
    max-width: 240px;
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
    animation: none;
}

.login-logo--brand img {
    max-width: 220px;
    max-height: 72px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    background: transparent;
}

.login-logo:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

.login-logo .material-icons {
    font-size: 52px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.branding-logo-nav {
    height: 40px;
    width: auto;
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    background: transparent;
}

.login-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: -1px;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 1.05rem;
    color: #b8b8b8;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* Mensajes de alerta */
.login-messages {
    margin-bottom: 28px;
}

.login-messages .alert {
    background: rgba(58, 58, 58, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #ffffff;
    padding: 14px 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideInDown 0.4s ease-out;
}

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

.login-messages .alert-error,
.login-messages .alert-danger {
    background: rgba(74, 42, 42, 0.9);
    border-color: rgba(220, 53, 69, 0.4);
    color: #ff8a8a;
}

.login-messages .alert-success {
    background: rgba(42, 74, 42, 0.9);
    border-color: rgba(40, 167, 69, 0.4);
    color: #8bff8b;
}

.login-messages .alert .material-icons {
    font-size: 22px;
    margin-right: 10px;
    flex-shrink: 0;
}

.login-messages .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.login-messages .btn-close:hover {
    opacity: 1;
}

/* Formulario de login */
.login-form {
    margin-top: 32px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center !important; /* Cambiado de stretch a center para centrar elementos */
    width: 100%;
    text-align: center !important; /* Centrar el contenido del formulario */
}

.login-form .login-button-wrapper {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.login-form .btn-login {
    width: auto !important;
    min-width: 220px !important;
    max-width: 100% !important;
}

/* Asegurar que el botón dentro de login-box esté centrado y con fondo azul oscuro suave */
.login-box .btn-login,
.login-box form .btn-login {
    margin-left: auto !important;
    margin-right: auto !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: #2c5282 !important; /* Azul oscuro suave */
    background-color: #2c5282 !important;
    background-image: none !important;
}

/* Grupos de formulario */
.login-form .form-group {
    margin-bottom: 30px; /* Separación aumentada entre inputs */
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    position: relative;
    width: 100%; /* Los inputs deben ocupar el 100% del ancho */
    align-self: stretch; /* Los form-groups sí deben estirarse */
}

.login-form .form-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: color 0.3s ease;
}

.login-form .form-group:focus-within .form-label {
    color: #ffffff;
}

.login-form .form-label .material-icons {
    font-size: 20px;
    color: #a0a0a0;
    transition: color 0.3s ease;
}

.login-form .form-group:focus-within .form-label .material-icons {
    color: #ffffff;
}

/* Campos de entrada - FORZAR TEXTO NEGRO SOBRE FONDO BLANCO */
.login-form .form-control,
.login-box .form-control,
.login-box .login-form .form-control,
.login-form input[type="text"],
.login-form input[type="password"] {
    background: #ffffff !important; /* Fondo blanco sólido */
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1.5px solid rgba(0, 0, 0, 0.25) !important; /* Borde oscuro */
    border-radius: 12px !important;
    color: #000000 !important; /* Texto negro */
    -webkit-text-fill-color: #000000 !important; /* Para Safari */
    padding: 16px 18px !important;
    font-size: 1rem !important;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
    display: block;
    line-height: 1.5;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.login-form .form-control:hover,
.login-box .form-control:hover,
.login-form input[type="text"]:hover,
.login-form input[type="password"]:hover {
    border-color: rgba(0, 0, 0, 0.35) !important;
    background: #ffffff !important; /* Fondo blanco sólido al hover */
    background-color: #ffffff !important;
    color: #000000 !important; /* Texto negro */
    -webkit-text-fill-color: #000000 !important;
}

.login-form .form-control:focus,
.login-box .form-control:focus,
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    background: #ffffff !important; /* Fondo blanco sólido al focus */
    background-color: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.5) !important; /* Borde más oscuro al focus */
    color: #000000 !important; /* Texto negro */
    -webkit-text-fill-color: #000000 !important;
    box-shadow: 
        0 0 0 4px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.15);
    outline: none;
    transform: translateY(-1px);
    z-index: 1;
}

/* Asegurar que el input-group tenga el mismo estilo al hacer focus */
.login-form .input-group:focus-within .form-control {
    z-index: 2;
}

.login-form .input-group:focus-within .btn {
    z-index: 2;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.login-form .form-control::placeholder,
.login-box .form-control::placeholder,
.login-form input[type="text"]::placeholder,
.login-form input[type="password"]::placeholder {
    color: #666666 !important; /* Placeholder gris oscuro para que se vea */
    font-weight: 400;
    opacity: 0.7 !important;
    -webkit-text-fill-color: #666666 !important;
}

/* Input group para campo de contraseña */
.login-form .input-group {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    position: relative !important;
}

.login-form .input-group .form-control {
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
    padding-right: 16px !important;
    background: rgba(255, 255, 255, 0.95) !important; /* Fondo blanco */
    color: #000000 !important; /* Texto negro */
    border-color: rgba(0, 0, 0, 0.2) !important; /* Borde oscuro */
}

.login-form .input-group .btn {
    flex-shrink: 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: none !important;
    background: rgba(240, 240, 240, 0.9) !important; /* Fondo gris claro */
    border-color: rgba(0, 0, 0, 0.2) !important; /* Borde oscuro */
    color: #333333 !important; /* Color oscuro para el icono */
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    min-width: 48px !important;
}

.login-form .input-group .btn:hover {
    background: rgba(220, 220, 220, 1) !important; /* Fondo gris más claro al hover */
    border-color: rgba(0, 0, 0, 0.3) !important;
    color: #000000 !important; /* Color negro al hover */
}

.login-form .input-group .btn:focus {
    box-shadow: none !important;
    outline: none !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    background: rgba(30, 30, 30, 0.85) !important;
}

.login-form .input-group .btn:active {
    background: rgba(35, 35, 35, 0.9) !important;
    transform: scale(0.98);
}

.login-form .input-group .btn .material-icons {
    font-size: 22px !important;
    line-height: 1 !important;
    transition: transform 0.2s ease !important;
}

.login-form .input-group .btn:hover .material-icons {
    transform: scale(1.1);
}

/* Opciones del login */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 12px;
}

.login-options .form-check {
    margin: 0;
    display: flex;
    align-items: center;
}

.login-options .form-check-input {
    background-color: rgba(26, 26, 26, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    width: 20px;
    height: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-top: 0;
}

.login-options .form-check-input:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(30, 30, 30, 0.9);
}

.login-options .form-check-input:checked {
    background-color: #4a4a4a;
    border-color: rgba(255, 255, 255, 0.4);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.login-options .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
    outline: none;
}

.login-options .form-check-label {
    color: #b8b8b8;
    font-weight: 500;
    margin-left: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
}

.login-options .form-check-label:hover {
    color: #ffffff;
}

.forgot-password {
    color: #b8b8b8;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.forgot-password:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

/* Wrapper para centrar el botón de login */
.login-button-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
}

/* Botón de login - Centrado y con fondo azul oscuro suave - MÁXIMA PRIORIDAD */
button.btn-login,
.btn-login,
.login-form .btn-login,
.login-box .btn-login,
.login-box form .btn-login,
body.login-page .btn-login,
body.login-page button.btn-login {
    width: auto !important;
    min-width: 220px !important;
    max-width: 100% !important;
    background: #2c5282 !important; /* Azul oscuro suave */
    background-color: #2c5282 !important; /* Color de respaldo azul oscuro suave */
    background-image: none !important; /* Eliminar cualquier gradiente o imagen */
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    color: #ffffff !important; /* Texto blanco */
    -webkit-text-fill-color: #ffffff !important; /* Para Safari */
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    padding: 18px 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    box-shadow: 
        0 6px 20px rgba(44, 82, 130, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    margin: 0 !important; /* Sin margen, el wrapper se encarga del centrado */
    box-sizing: border-box;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.5;
    text-align: center !important;
}

/* Asegurar que el texto y los iconos dentro del botón sean blancos */
.btn-login *,
.btn-login span,
.btn-login .material-icons,
button.btn-login *,
button.btn-login span,
button.btn-login .material-icons {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

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

.btn-login:hover,
button.btn-login:hover {
    background: #3a6ba3 !important; /* Azul oscuro suave más claro al hover */
    background-color: #3a6ba3 !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(44, 82, 130, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: #ffffff !important; /* Texto blanco al hover */
    -webkit-text-fill-color: #ffffff !important;
}

.btn-login:hover *,
.btn-login:hover span,
.btn-login:hover .material-icons,
button.btn-login:hover *,
button.btn-login:hover span,
button.btn-login:hover .material-icons {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.btn-login:active,
button.btn-login:active {
    transform: translateY(-1px);
    background: #1e4a7a !important; /* Azul oscuro suave más oscuro al presionar */
    background-color: #1e4a7a !important;
    background-image: none !important;
    color: #ffffff !important; /* Texto blanco al presionar */
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 
        0 4px 15px rgba(44, 82, 130, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-login:active *,
.btn-login:active span,
.btn-login:active .material-icons,
button.btn-login:active *,
button.btn-login:active span,
button.btn-login:active .material-icons {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.btn-login .material-icons {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.btn-login:hover .material-icons {
    transform: translateX(2px);
}

/* Footer del login */
.login-footer {
    margin-top: 36px;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    text-align: center;
    padding-top: 28px;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer-text {
    color: #9a9a9a;
    font-size: 0.9rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    flex-wrap: wrap;
}

.login-footer-text .material-icons {
    font-size: 18px;
    opacity: 0.8;
}

.register-link {
    color: #c0c0c0;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.register-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.back-to-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9a9a9a;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 18px;
    border-radius: 10px;
    margin-top: 8px;
}

.back-to-home:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-4px);
}

.back-to-home .material-icons {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.back-to-home:hover .material-icons {
    transform: translateX(-2px);
}

/* Seleccionar panel — grilla de iconos con scroll interno (no desborda la ficha) */
.login-container--paneles {
    height: auto !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    padding: 16px !important;
    align-items: center !important;
}

.login-wrapper--paneles {
    max-width: 560px;
    width: 100%;
    margin: 0 auto !important;
    max-height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.login-box--paneles {
    display: flex !important;
    flex-direction: column !important;
    max-height: min(92vh, 840px) !important;
    padding: 28px 24px 20px !important;
    overflow: hidden !important;
}

.login-box--paneles::before {
    display: none;
}

.login-box--paneles:hover {
    transform: none;
}

.login-box--paneles .login-header {
    flex-shrink: 0;
    margin-bottom: 16px;
    z-index: 1;
}

.login-box.login-box--paneles .login-title {
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
    background: none !important;
    text-shadow: none;
    font-size: 1.65rem;
    letter-spacing: -0.4px;
}

.login-box.login-box--paneles .login-subtitle {
    color: #3d3d3d !important;
    font-size: 0.95rem;
}

.login-box.login-box--paneles .panel-select-user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    margin: 10px 0 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(26, 26, 26, 0.14);
    color: #1a1a1a !important;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
}

.login-box.login-box--paneles .panel-select-user .material-icons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #2c5282;
    overflow: hidden;
}

.login-box.login-box--paneles .panel-select-user-name {
    min-width: 0;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-box--paneles .login-messages {
    flex-shrink: 0;
    margin-bottom: 12px;
    z-index: 1;
}

.login-box--paneles .login-form,
.login-box--paneles .panel-select-form {
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    margin-top: 4px;
    padding: 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden;
    z-index: 1;
}

.panel-select-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

.panel-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
    width: 100%;
    max-height: min(52vh, 420px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 4px 6px 10px 2px;
    -webkit-overflow-scrolling: touch;
}

.panel-select-grid::-webkit-scrollbar {
    width: 8px;
}

.panel-select-grid::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.08);
    border-radius: 8px;
}

.panel-select-grid::-webkit-scrollbar-thumb {
    background: rgba(26, 26, 26, 0.38);
    border-radius: 8px;
}

.panel-select-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 12px 8px 10px;
    border: 1px solid rgba(26, 26, 26, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.55);
    color: #1a1a1a;
    cursor: pointer;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.panel-select-tile:hover,
.panel-select-tile:focus-visible {
    background: #ffffff;
    border-color: #2c5282;
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.18);
    outline: none;
}

.panel-select-tile:focus-visible {
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.35);
}

.panel-select-tile:active {
    background: #f3f6fa;
}

.panel-select-tile.is-actual {
    border-color: #2c5282;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.28);
}

.panel-select-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #2c5282;
    overflow: hidden;
}

.panel-select-tile-icon .material-icons {
    font-size: 26px;
    line-height: 1;
    width: 26px;
    height: 26px;
    color: #ffffff;
    overflow: hidden;
}

.panel-select-tile-label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    max-height: 2.6em;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.login-box.login-box--paneles .login-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 12px;
    z-index: 1;
}

.panel-select-volver {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.panel-select-volver .material-icons {
    font-size: 18px;
    line-height: 1;
}

.login-box.login-box--paneles .back-to-home {
    color: #2c5282 !important;
}

.login-box.login-box--paneles .back-to-home:hover {
    color: #1a365d !important;
    background: rgba(44, 82, 130, 0.08);
    transform: none;
}

.login-box.login-box--paneles .link-cerrar-sesion {
    color: inherit;
}

@media (max-width: 768px) {
    .login-box.login-box--paneles {
        padding: 22px 16px 16px !important;
    }

    .login-box.login-box--paneles .login-title {
        font-size: 1.4rem;
    }

    .panel-select-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        max-height: min(48vh, 380px);
        gap: 8px;
    }

    .panel-select-tile-icon {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 576px) {
    .login-container--paneles {
        padding: 10px !important;
        align-items: stretch !important;
    }

    .login-box.login-box--paneles {
        max-height: 100% !important;
        padding: 18px 12px 12px !important;
        border-radius: 18px !important;
    }

    .panel-select-grid {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        max-height: min(56vh, 420px);
    }

    .panel-select-tile {
        padding: 10px 6px 8px;
    }

    .panel-select-tile-label {
        font-size: 0.72rem;
    }

    .login-box.login-box--paneles .panel-select-user-name {
        max-width: 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .panel-select-tile,
    .login-box--paneles .back-to-home {
        transition: none;
    }
}

/* Responsive para login - 100% Responsive */
@media (max-width: 768px) {
    .login-wrapper {
        max-width: 100%;
        margin-top: 40px !important;
    }
    
    .login-box {
        padding: 50px 40px !important;
        border-radius: 20px;
    }
    
    .login-title {
        font-size: 2.25rem;
    }
    
    .login-logo {
        width: 80px;
        height: 80px;
        border-radius: 20px;
    }

    .login-logo--brand {
        width: auto;
        max-width: 200px;
        height: auto;
        min-height: 52px;
    }

    .login-logo--brand img {
        max-width: 180px;
        max-height: 58px;
    }
    
    .login-logo .material-icons {
        font-size: 46px;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .login-wrapper {
        max-width: 100%;
        margin-top: 30px !important;
    }
    
    .login-box {
        padding: 45px 30px !important;
        border-radius: 20px;
    }
    
    .login-header {
        margin-bottom: 32px;
    }
    
    .login-title {
        font-size: 2rem;
        letter-spacing: -0.8px;
    }
    
    .login-subtitle {
        font-size: 0.95rem;
    }
    
    .login-logo {
        width: 75px;
        height: 75px;
        border-radius: 18px;
        margin-bottom: 20px;
    }
    
    .login-logo .material-icons {
        font-size: 42px;
    }
    
    .login-form {
        margin-top: 28px;
    }
    
    .login-form .form-group {
        margin-bottom: 24px;
    }
    
    .login-form .form-control {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 28px;
    }
    
    .forgot-password {
        margin-top: 0;
        width: 100%;
        text-align: left;
    }
    
    .btn-login {
        padding: 16px 24px;
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .login-footer {
        margin-top: 32px;
        padding-top: 24px;
    }
    
    .login-footer-text {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 6px;
    }
    
    .back-to-home {
        font-size: 0.85rem;
        padding: 8px 16px;
    }
}

@media (max-width: 400px) {
    .login-container {
        padding: 12px;
        padding-top: 32px;
    }
    
    .login-wrapper {
        margin-top: 20px !important;
    }
    
    .login-box {
        padding: 40px 25px !important;
        border-radius: 18px;
    }
    
    .login-title {
        font-size: 1.75rem;
    }
    
    .login-logo {
        width: 70px;
        height: 70px;
    }

    .login-logo--brand {
        width: auto;
        max-width: 180px;
        height: auto;
        min-height: 48px;
    }

    .login-logo--brand img {
        max-width: 160px;
        max-height: 52px;
    }
    
    .login-logo .material-icons {
        font-size: 38px;
    }
    
    .btn-login {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

/* Animación de entrada mejorada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mejoras de accesibilidad y usabilidad */
.login-form .form-control:invalid:not(:focus):not(:placeholder-shown) {
    border-color: rgba(220, 53, 69, 0.4);
}

.login-form .form-control:valid:not(:focus):not(:placeholder-shown) {
    border-color: rgba(40, 167, 69, 0.3);
}

/* Prevenir zoom en iOS al hacer focus en inputs */
@media screen and (max-width: 768px) {
    .login-form .form-control {
        font-size: 16px !important;
    }
}

/* Reset adicional para elementos Bootstrap que puedan interferir */
body.login-page .alert {
    margin-bottom: 0 !important;
}

body.login-page .form-group {
    margin-bottom: 28px !important;
}

body.login-page .form-label {
    margin-bottom: 12px !important;
}

/* Asegurar que no haya scroll horizontal */
html {
    overflow-x: hidden;
}

body.login-page {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Reset de estilos de lista */
body.login-page ul,
body.login-page ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Reset de estilos de enlaces */
body.login-page a {
    text-decoration: none;
}

body.login-page a:hover {
    text-decoration: none;
}

/* Asegurar que los elementos estén en su lugar */
body.login-page .login-container {
    flex-direction: column;
}

body.login-page .login-wrapper {
    flex-shrink: 0;
    margin-top: 90px !important; /* Más espacio superior antes de la ficha */
}

/* Reset de estilos de botones de Bootstrap - EXCEPTO btn-login */
body.login-page button:not(.btn-login),
body.login-page .btn:not(.btn-login) {
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
}

body.login-page button:not(.btn-login):focus,
body.login-page .btn:not(.btn-login):focus {
    outline: none;
    box-shadow: none;
}

/* Asegurar que btn-login mantenga sus estilos con fondo azul oscuro suave */
body.login-page .btn-login {
    background: #2c5282 !important; /* Azul oscuro suave */
    background-color: #2c5282 !important;
    background-image: none !important;
}

/* Reset de estilos de inputs de Bootstrap */
body.login-page input[type="text"],
body.login-page input[type="password"],
body.login-page input[type="email"],
body.login-page input[type="checkbox"] {
    outline: none;
}

body.login-page input[type="text"]:focus,
body.login-page input[type="password"]:focus,
body.login-page input[type="email"]:focus {
    outline: none;
}

/* Asegurar que Material Icons se muestren correctamente */
body.login-page .material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ================================
   SuperUser - Layout con Sidebar
   ================================ */
.superuser-layout {
    background: #f8f9fa;
    min-height: 100vh;
}

.su-shell {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
}

.su-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #dee2e6;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

.su-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.su-brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

.su-brand-logo-placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    border-radius: 8px;
    flex-shrink: 0;
}

.su-brand-logo-placeholder .material-icons {
    font-size: 28px;
    color: #6c757d;
}

.su-brand-text {
    flex: 1;
    min-width: 0;
}

.su-brand-title {
    font-weight: 700;
    color: var(--bs-primary);
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.2;
}

.su-brand-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
    margin: 0;
    line-height: 1.2;
}

.su-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-right: 8px;
}

.su-nav::-webkit-scrollbar {
    width: 6px;
}

.su-nav::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 3px;
}

.su-nav::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.su-nav::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.su-nav-section-title {
    margin-top: 24px;
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.su-nav-link,
.su-nav-toggle,
.su-sub-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 6px;
    border-radius: 8px;
    color: var(--bs-body-color);
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    text-align: left;
}

.su-nav-toggle {
    font-weight: 600;
    border: none;
}

.su-nav-toggle:focus,
.su-nav-link:focus,
.su-sub-link:focus {
    outline: none;
    box-shadow: none;
}

.su-nav-link:hover,
.su-nav-toggle:hover,
.su-sub-link:hover {
    background: #f1f3f5;
    border-color: #e9ecef;
    color: var(--bs-body-color);
}

.su-nav-toggle::after {
    content: "▸";
    margin-left: auto;
    transition: transform 0.2s ease;
    color: #6c757d;
}

.su-nav-toggle[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

.su-submenu {
    padding-left: 8px;
}

.su-submenu .su-sub-link {
    font-size: 0.95rem;
}

.su-submenu-n2 {
    padding-left: 12px;
    margin-left: 8px;
    border-left: 1px dashed #dee2e6;
}

.su-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 280px;
    padding-top: 0;
}

.su-header {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.su-header-start {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.su-header-title {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.su-header-user {
    color: #6c757d;
    font-size: 0.95rem;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.su-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.su-cambiar-panel-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}

.su-cambiar-panel-btn:hover,
.su-cambiar-panel-btn:focus-visible {
    background: #f1f3f5;
    border-color: #ced4da;
    color: #212529;
    text-decoration: none;
}

.su-cambiar-panel-btn .material-icons {
    font-size: 18px;
    line-height: 1;
}

.su-sidebar-logout .su-cambiar-panel-btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
}

/* Botón hamburguesa / backdrop / logout drawer (móvil) */
.su-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #ffffff;
    color: #495057;
    flex-shrink: 0;
    cursor: pointer;
}

.su-menu-btn .material-icons {
    font-size: 24px;
    line-height: 1;
}

.su-menu-btn:hover {
    background: #f1f3f5;
    border-color: #ced4da;
}

.su-menu-btn:focus-visible {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

.su-nav-backdrop {
    display: none;
}

.su-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin-left: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #ffffff;
    color: #495057;
    flex-shrink: 0;
    cursor: pointer;
}

.su-sidebar-close .material-icons {
    font-size: 22px;
    line-height: 1;
}

.su-sidebar-close:hover {
    background: #f1f3f5;
    border-color: #ced4da;
}

.su-sidebar-logout {
    display: none;
    flex-shrink: 0;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #e9ecef;
}

.su-sidebar-logout .su-logout-btn {
    width: 100%;
}

.su-logout-btn {
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.su-logout-btn:hover {
    background: #f1f3f5;
    border-color: #ced4da;
}

.su-content {
    padding: 24px;
    margin-top: 64px;
}

.su-page-title {
    margin-bottom: 20px;
}

.su-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.su-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 16px;
}

.su-card-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.su-card-text {
    color: #6c757d;
    margin: 0;
}

.su-alerts {
    position: fixed;
    top: 64px;
    left: 280px;
    right: 0;
    z-index: 998;
    padding: 16px 24px 0;
    max-width: 100%;
    pointer-events: none;
}

.su-alerts .alert {
    pointer-events: auto;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.su-sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    text-align: center;
}

.su-sidebar-footer-logo {
    max-width: 128px;
    max-height: 64px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 10px;
    object-fit: contain;
}

.su-sidebar-footer-text {
    font-size: 0.7rem;
    color: #6c757d;
    line-height: 1.3;
    margin: 0;
    padding: 0 8px;
}

/* Drawer móvil: cerrado por defecto; desktop (≥992px) sin cambios de layout */
@media (max-width: 991px) {
    .su-shell {
        flex-direction: column;
    }

    .su-menu-btn {
        display: inline-flex;
    }

    .su-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(320px, 88vw);
        height: 100vh;
        height: 100dvh;
        border-right: 1px solid #dee2e6;
        border-bottom: none;
        padding: 16px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.25s ease, box-shadow 0.25s ease;
        box-shadow: none;
        -webkit-overflow-scrolling: touch;
    }

    body.su-nav-open .su-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    }

    .su-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        border: 0;
        padding: 0;
        cursor: pointer;
    }

    body.su-nav-open .su-nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.su-nav-open {
        overflow: hidden;
    }

    .su-main {
        margin-left: 0;
        padding-top: 0;
        width: 100%;
    }

    .su-brand {
        margin-bottom: 16px;
        padding-bottom: 12px;
        align-items: flex-start;
    }

    .su-sidebar-close {
        display: inline-flex;
    }

    .su-sidebar-logout {
        display: block;
    }

    .su-brand-logo,
    .su-brand-logo-placeholder {
        width: 40px;
        height: 40px;
    }

    .su-brand-logo-placeholder .material-icons {
        font-size: 24px;
    }

    .su-brand-title {
        font-size: 1rem;
    }

    .su-brand-subtitle {
        font-size: 0.75rem;
    }

    .su-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 10px 12px;
        z-index: 1000;
        min-height: 56px;
    }

    .su-header-actions {
        gap: 8px;
    }

    .su-header-actions .su-logout-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .su-cambiar-panel-btn {
        padding: 8px 10px;
    }

    .su-header-actions .su-cambiar-panel-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .su-alerts {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        padding: 12px 16px 0;
        z-index: 998;
    }

    .su-content {
        margin-top: 56px;
        padding: 16px;
    }

    .su-sidebar-footer {
        margin-top: 8px;
        padding-top: 12px;
    }

    .su-sidebar-footer-logo {
        max-width: 96px;
        max-height: 48px;
    }

    .su-sidebar-footer-text {
        font-size: 0.65rem;
        padding: 0 4px;
    }
}

@media (max-width: 575px) {
    .su-header-user {
        display: none;
    }

    .su-header-actions .su-logout-btn {
        padding: 8px 12px;
    }
}

/* ============================================================================
   Estilos para Formulario de Creación de Empresa
   ============================================================================ */

.empresa-form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.empresa-form {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 30px;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.form-section-header .material-icons {
    font-size: 28px;
    color: #2c5282;
}

.form-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.form-label.required {
    font-weight: 600;
}

.form-label .text-danger {
    color: #dc3545;
    margin-left: 4px;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #2c5282;
    box-shadow: 0 0 0 0.2rem rgba(44, 82, 130, 0.25);
    outline: none;
}

.form-control:invalid {
    border-color: #dc3545;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 6px;
    display: block;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.input-group {
    position: relative;
}

.input-group .btn-outline-secondary {
    border-left: none;
    border-color: #ced4da;
    background: #ffffff;
    color: #6c757d;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-group .btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #ced4da;
    color: #495057;
}

.input-group .btn-outline-secondary .material-icons {
    font-size: 20px;
}

.input-group .form-control:focus + .btn-outline-secondary {
    border-color: #2c5282;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
    margin-top: 30px;
}

.form-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form-actions .btn .material-icons {
    font-size: 20px;
}

.form-actions .btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

.form-actions .btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    color: #ffffff;
}

.form-actions .btn-primary {
    background: #2c5282;
    border-color: #2c5282;
    color: #ffffff;
}

.form-actions .btn-primary:hover {
    background: #1e4a7a;
    border-color: #1a3f6b;
    color: #ffffff;
}

/* Responsive para formulario de empresa */
@media (max-width: 768px) {
    .empresa-form-container {
        padding: 10px;
    }
    
    .empresa-form {
        padding: 20px 15px;
    }
    
    .form-section {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }
    
    .form-section-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .form-section-title {
        font-size: 1.25rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .empresa-form-container {
        padding: 5px;
    }
    
    .empresa-form {
        padding: 15px 10px;
        border-radius: 6px;
    }
    
    .form-section-header .material-icons {
        font-size: 24px;
    }
    
    .form-section-title {
        font-size: 1.1rem;
    }
}

/* ============================================================================
   Estilos Globales para Mensajes de Error Informativos
   Fondo azul oscuro con letras blancas en negrilla
   ============================================================================ */

/* Mensajes de error - Fondo azul oscuro con letras blancas en negrilla */
.alert-error,
.alert-danger,
.alert.alert-error,
.alert.alert-danger,
.alert-danger.alert-dismissible,
.alert-error.alert-dismissible {
    background-color: #2c5282 !important;
    background: #2c5282 !important;
    color: #ffffff !important;
    border-color: #1e4a7a !important;
    font-weight: bold !important;
    font-weight: 700 !important;
}

.alert-error *,
.alert-danger *,
.alert.alert-error *,
.alert.alert-danger *,
.alert-danger.alert-dismissible *,
.alert-error.alert-dismissible * {
    color: #ffffff !important;
    font-weight: bold !important;
    font-weight: 700 !important;
}

/* Mensajes informativos también con fondo azul oscuro */
.alert-info,
.alert.alert-info,
.alert-info.alert-dismissible {
    background-color: #2c5282 !important;
    background: #2c5282 !important;
    color: #ffffff !important;
    border-color: #1e4a7a !important;
    font-weight: bold !important;
    font-weight: 700 !important;
}

.alert-info *,
.alert.alert-info *,
.alert-info.alert-dismissible * {
    color: #ffffff !important;
    font-weight: bold !important;
    font-weight: 700 !important;
}

/* Botón de cierre en mensajes de error - debe ser blanco */
.alert-error .btn-close,
.alert-danger .btn-close,
.alert-info .btn-close,
.alert.alert-error .btn-close,
.alert.alert-danger .btn-close,
.alert.alert-info .btn-close {
    filter: brightness(0) invert(1) !important;
    opacity: 0.9 !important;
}

.alert-error .btn-close:hover,
.alert-danger .btn-close:hover,
.alert-info .btn-close:hover,
.alert.alert-error .btn-close:hover,
.alert.alert-danger .btn-close:hover,
.alert.alert-info .btn-close:hover {
    opacity: 1 !important;
}

/* Aplicar a todos los contenedores de mensajes */
.su-alerts .alert-error,
.su-alerts .alert-danger,
.su-alerts .alert-info,
.login-messages .alert-error,
.login-messages .alert-danger,
.login-messages .alert-info {
    background-color: #2c5282 !important;
    background: #2c5282 !important;
    color: #ffffff !important;
    border-color: #1e4a7a !important;
    font-weight: bold !important;
    font-weight: 700 !important;
}

.su-alerts .alert-error *,
.su-alerts .alert-danger *,
.su-alerts .alert-info *,
.login-messages .alert-error *,
.login-messages .alert-danger *,
.login-messages .alert-info * {
    color: #ffffff !important;
    font-weight: bold !important;
    font-weight: 700 !important;
}

/* Override específico para login-messages que tenía estilos previos */
.login-messages .alert-error,
.login-messages .alert-danger {
    background: #2c5282 !important;
    background-color: #2c5282 !important;
    border-color: #1e4a7a !important;
    color: #ffffff !important;
    font-weight: bold !important;
    font-weight: 700 !important;
}

.login-messages .alert-error *,
.login-messages .alert-danger * {
    color: #ffffff !important;
    font-weight: bold !important;
    font-weight: 700 !important;
}

/* ============================================================================
   Estilos para Listado de Empresas (Edición)
   ============================================================================ */

.empresas-list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.empresas-list-header {
    margin-bottom: 32px;
}

.empresas-list-title-section {
    text-align: center;
}

.empresas-list-title {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 8px 0;
}

.empresas-list-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

.empresas-list-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.btn-new-empresa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #2c5282;
    border-color: #2c5282;
    color: #ffffff;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-new-empresa:hover {
    background: #1e4a7a;
    border-color: #1e4a7a;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 82, 130, 0.3);
}

.btn-new-empresa .material-icons {
    font-size: 20px;
}

.empresas-table-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.empresas-table {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
}

.empresas-table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empresas-table thead th.text-center {
    text-align: center;
}

.empresas-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.empresas-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.empresas-table tbody td {
    padding: 16px 20px;
    vertical-align: middle;
    color: #495057;
}

.empresa-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.empresa-logo-small {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.empresa-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.empresa-logo-placeholder .material-icons {
    font-size: 24px;
}

.empresa-name-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.empresa-name-primary {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.empresa-name-secondary {
    font-size: 0.85rem;
    color: #6c757d;
}

.empresa-date-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-size: 0.9rem;
}

.empresa-date-cell .material-icons {
    font-size: 18px;
    color: #6c757d;
}

.empresa-status-cell {
    display: flex;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
}

.status-badge .material-icons {
    font-size: 16px;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-active .material-icons {
    color: #28a745;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-inactive .material-icons {
    color: #dc3545;
}

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

.status-warning .material-icons {
    color: #856404;
}

.preview-advertencias-list {
    margin-bottom: 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
}

.fila-preview.table-info td {
    background-color: rgba(13, 202, 240, 0.08);
}

.status-archived {
    background: #e2e3e5;
    color: #383d41;
}

.status-archived .material-icons {
    color: #6c757d;
}

.empresa-actions-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

a.btn-action {
    text-decoration: none;
}

.btn-action .material-icons {
    font-size: 20px;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-action-view {
    color: #1976d2;
}

.btn-action-view:hover {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-action-edit:hover {
    background: #fff3e0;
    color: #f57c00;
}

.btn-action-precio:hover {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-action-precio {
    color: #388e3c;
}

.btn-action-precio-activo,
.btn-action-precio.btn-action-precio-activo {
    background: #e8f5e9;
    color: #1b5e20;
}

.btn-action-clientes {
    position: relative;
    color: #00838f;
}

.btn-action-clientes:hover {
    background: #e0f7fa;
    color: #006064;
}

.btn-action.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-action-delete:hover {
    background: #ffebee;
    color: #d32f2f;
}

.btn-action-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-action-stock:hover {
    background: #c8e6c9;
    color: #1b5e20;
}

.btn-action-seniat:hover {
    background: #e3f2fd;
    color: #0277bd;
}

.btn-action-seniat-active {
    background: #e1f5fe;
    color: #01579b;
}

.btn-action-seniat-active:hover {
    background: #b3e5fc;
    color: #01466f;
}

button.btn-action {
    cursor: pointer;
}

.btn-action-diseno {
    border: none;
    background: transparent;
    color: #6a1b9a;
}

.btn-action-diseno:hover {
    background: #f3e5f5;
    color: #4a148c;
}

.btn-action-diseno-active {
    background: #ede7f6;
    color: #4527a0;
}

.btn-action-diseno-active:hover {
    background: #d1c4e9;
    color: #311b92;
}

.btn-action-admin-soporte {
    color: #00695c;
}

.btn-action-admin-soporte:hover {
    background: #e0f2f1;
    color: #004d40;
}

.btn-action-admin-soporte-active {
    background: #e0f2f1;
    color: #00695c;
    cursor: default;
}

.btn-action-warning:hover {
    background: #fff8e1;
    color: #f57f17;
}

.empresas-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empresas-empty-state .material-icons {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empresas-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 10px 0;
}

.empresas-empty-state p {
    font-size: 1rem;
    margin: 0 0 30px 0;
}

/* Estilos de paginación */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.pagination-nav {
    display: flex;
    align-items: center;
    }
    
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
    align-items: center;
}

.page-item {
    display: flex;
    align-items: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
        justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #fff;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.page-link:hover:not(.disabled):not(.active) {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-link .material-icons {
    font-size: 20px;
}

/* Responsive para tabla de empresas */
@media (max-width: 992px) {
    .empresas-list-actions {
        margin-top: 16px;
    }
    
    .empresas-table-wrapper {
        overflow-x: auto;
    }
    
    .empresas-table {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .empresas-list-container {
        padding: 16px;
    }
    
    .empresas-list-title {
        font-size: 1.5rem;
    }
    
    .empresas-list-subtitle {
        font-size: 1rem;
    }
    
    .empresas-list-actions {
        margin-top: 16px;
    }
    
    .empresas-table thead th {
        padding: 12px 15px;
        font-size: 10px;
    }
    
    .empresas-table tbody td {
        padding: 12px 15px;
    }
    
    .empresa-name-cell {
        gap: 10px;
    }
    
    .empresa-logo-small,
    .empresa-logo-placeholder {
        width: 35px;
        height: 35px;
    }
    
    .empresa-name-primary {
        font-size: 0.9rem;
    }
    
    .empresa-name-secondary {
        font-size: 0.8rem;
    }
    
    .btn-action {
        width: 32px;
        height: 32px;
    }
    
    .btn-action .material-icons {
        font-size: 18px;
    }
    
    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pagination-info {
        text-align: center;
        width: 100%;
    }
    
    .pagination-nav {
        justify-content: center;
        width: 100%;
    }
    
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-link {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .empresas-list-container {
        padding: 12px;
    }
    
    .empresas-list-title {
        font-size: 1.25rem;
    }
    
    .empresas-list-subtitle {
        font-size: 0.9rem;
    }
    
    .empresas-list-actions {
        margin-top: 12px;
    }
    
    .btn-new-empresa {
        width: 100%;
        justify-content: center;
    }
    
    .empresas-table thead th {
        padding: 10px 12px;
        font-size: 9px;
    }
    
    .empresas-table tbody td {
        padding: 10px 12px;
    }
    
    .empresa-actions-cell {
        flex-direction: column;
        gap: 4px;
    }
    
    .status-badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
    
    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .page-link .material-icons {
        font-size: 18px;
    }
    
    .pagination {
        gap: 2px;
    }
}

/* ============================================
   Estilos para Confirmación de Eliminación de Empresa
   ============================================ */

.empresa-delete-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.empresa-delete-header-actions {
    margin-bottom: 24px;
}

.empresa-delete-warning {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
    color: #fff;
}

.empresa-delete-warning-icon {
    margin-bottom: 16px;
}

.empresa-delete-warning-icon .material-icons {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.9);
}

.empresa-delete-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.empresa-delete-subtitle {
    font-size: 1.1rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.empresa-delete-info {
    margin-bottom: 32px;
}

.empresa-delete-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e9ecef;
    margin-bottom: 24px;
}

.empresa-delete-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.empresa-delete-card-header .material-icons {
    font-size: 24px;
    color: #667eea;
}

.empresa-delete-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.empresa-delete-card-body {
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.empresa-delete-logo-section {
    flex-shrink: 0;
}

.empresa-delete-logo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #dee2e6;
}

.empresa-delete-logo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #dee2e6;
}

.empresa-delete-logo-placeholder .material-icons {
    font-size: 48px;
    color: #adb5bd;
}

.empresa-delete-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empresa-delete-field {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.empresa-delete-field:last-child {
    border-bottom: none;
}

.empresa-delete-field-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 140px;
    font-size: 0.9rem;
}

.empresa-delete-field-value {
    color: #212529;
    font-weight: 500;
}

.empresa-delete-alert {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.empresa-delete-alert-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.empresa-delete-alert-header .material-icons {
    font-size: 28px;
    color: #ff9800;
}

.empresa-delete-alert-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #856404;
}

.empresa-delete-alert-body p {
    margin: 0 0 16px 0;
    color: #856404;
    font-weight: 500;
}

.empresa-delete-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.empresa-delete-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    color: #856404;
    font-size: 0.9rem;
}

.empresa-delete-list li .material-icons {
    font-size: 20px;
    color: #ff9800;
}

.empresa-delete-warning-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
}

.empresa-delete-warning-box .material-icons {
    font-size: 24px;
    color: #dc3545;
    flex-shrink: 0;
}

.empresa-delete-warning-box p {
    margin: 0;
    font-size: 0.95rem;
}

.empresa-delete-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    border: 1px solid #e9ecef;
}

.empresa-delete-confirm {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.empresa-delete-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #212529;
    user-select: none;
}

.empresa-delete-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #dc3545;
}

.empresa-delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-delete {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.2s ease;
}

.btn-delete:hover:not(:disabled) {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-cancel {
    padding: 12px 24px;
}

/* Responsive para confirmación de eliminación */
@media (max-width: 768px) {
    .empresa-delete-container {
        padding: 16px;
    }
    
    .empresa-delete-warning {
        padding: 24px 20px;
    }
    
    .empresa-delete-title {
        font-size: 1.5rem;
    }
    
    .empresa-delete-subtitle {
        font-size: 1rem;
    }
    
    .empresa-delete-warning-icon .material-icons {
        font-size: 56px;
    }
    
    .empresa-delete-card-body {
        flex-direction: column;
        gap: 20px;
    }
    
    .empresa-delete-logo,
    .empresa-delete-logo-placeholder {
        width: 80px;
        height: 80px;
    }
    
    .empresa-delete-logo-placeholder .material-icons {
        font-size: 40px;
    }
    
    .empresa-delete-field {
        flex-direction: column;
        gap: 4px;
    }
    
    .empresa-delete-field-label {
        min-width: auto;
    }
    
    .empresa-delete-list {
        grid-template-columns: 1fr;
    }
    
    .empresa-delete-actions {
        flex-direction: column-reverse;
    }
    
    .empresa-delete-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .empresa-delete-container {
        padding: 12px;
    }
    
    .empresa-delete-warning {
        padding: 20px 16px;
        border-radius: 12px;
    }
    
    .empresa-delete-title {
        font-size: 1.25rem;
    }
    
    .empresa-delete-subtitle {
        font-size: 0.9rem;
    }
    
    .empresa-delete-warning-icon .material-icons {
        font-size: 48px;
    }
    
    .empresa-delete-card-header {
        padding: 16px 20px;
    }
    
    .empresa-delete-card-header h3 {
        font-size: 1.1rem;
    }
    
    .empresa-delete-card-body {
        padding: 20px;
    }
    
    .empresa-delete-alert {
        padding: 20px;
    }
    
    .empresa-delete-alert-header h4 {
        font-size: 1.1rem;
    }
    
    .empresa-delete-form {
        padding: 20px;
    }
    
    .empresa-delete-confirm {
        padding: 16px;
    }
    
    .empresa-delete-checkbox-label {
        font-size: 0.9rem;
    }
}

/* ============================================
   Estilos para Ficha de Detalles de Empresa
   ============================================ */

.empresa-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.empresa-detail-header-actions {
    margin-bottom: 24px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    transform: translateX(-2px);
}

.btn-back .material-icons {
    font-size: 20px;
}

.empresa-detail-header {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    color: #fff;
}

.empresa-detail-logo-section {
    flex-shrink: 0;
}

.empresa-detail-logo {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.empresa-detail-logo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.empresa-detail-logo-placeholder .material-icons {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.9);
}

.empresa-detail-title-section {
    flex: 1;
}

.empresa-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.empresa-detail-subtitle {
    font-size: 1.25rem;
    margin: 0 0 16px 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.empresa-detail-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.empresa-detail-status .status-badge {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 16px;
    font-size: 0.95rem;
}

.empresa-detail-status .status-badge .material-icons {
    color: #fff;
}

.empresa-detail-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.empresa-detail-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.empresa-detail-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.empresa-detail-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.empresa-detail-card-header .material-icons {
    font-size: 24px;
    color: #667eea;
}

.empresa-detail-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.empresa-detail-card-body {
    padding: 24px;
}

.empresa-detail-field {
    margin-bottom: 24px;
}

.empresa-detail-field:last-child {
    margin-bottom: 0;
}

.empresa-detail-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.empresa-detail-field-label .material-icons {
    font-size: 18px;
    color: #667eea;
}

.empresa-detail-field-value {
    font-size: 1.1rem;
    color: #212529;
    font-weight: 500;
    word-break: break-word;
}

.empresa-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    text-decoration: none;
    transition: all 0.2s ease;
}

.empresa-detail-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.empresa-detail-link .material-icons {
    font-size: 18px;
}

.empresa-detail-id {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

.empresa-detail-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empresa-detail-empty .material-icons {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 16px;
}

.empresa-detail-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Responsive para ficha de empresa */
@media (max-width: 992px) {
    .empresa-detail-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .empresa-detail-header {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    
    .empresa-detail-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .empresa-detail-container {
        padding: 16px;
    }
    
    .empresa-detail-header {
        padding: 24px 20px;
        gap: 20px;
    }
    
    .empresa-detail-logo,
    .empresa-detail-logo-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .empresa-detail-logo-placeholder .material-icons {
        font-size: 56px;
    }
    
    .empresa-detail-title {
        font-size: 1.75rem;
    }
    
    .empresa-detail-subtitle {
        font-size: 1.1rem;
    }
    
    .empresa-detail-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .empresa-detail-card-header {
        padding: 16px 20px;
    }
    
    .empresa-detail-card-header h3 {
        font-size: 1.1rem;
    }
    
    .empresa-detail-card-body {
        padding: 20px;
    }
    
    .empresa-detail-field {
        margin-bottom: 20px;
    }
    
    .empresa-detail-field-value {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .empresa-detail-container {
        padding: 12px;
    }
    
    .empresa-detail-header {
        padding: 20px 16px;
        border-radius: 12px;
    }
    
    .empresa-detail-logo,
    .empresa-detail-logo-placeholder {
        width: 80px;
        height: 80px;
    }
    
    .empresa-detail-logo-placeholder .material-icons {
        font-size: 48px;
    }
    
    .empresa-detail-title {
        font-size: 1.5rem;
    }
    
    .empresa-detail-subtitle {
        font-size: 1rem;
    }
    
    .empresa-detail-status .status-badge {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .empresa-detail-card-header {
        padding: 14px 16px;
    }
    
    .empresa-detail-card-header .material-icons {
        font-size: 20px;
    }
    
    .empresa-detail-card-header h3 {
        font-size: 1rem;
    }
    
    .empresa-detail-card-body {
        padding: 16px;
    }
    
    .empresa-detail-field-label {
        font-size: 0.8rem;
    }
    
    .empresa-detail-field-value {
        font-size: 0.95rem;
    }
    
    .btn-back {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .btn-back .material-icons {
        font-size: 18px;
    }
}

/* ============================================
   Estilos para Gestión de Licencias
   ============================================ */

.licencias-list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: visible;
    overflow-y: visible;
}

.licencias-list-header {
    margin-bottom: 32px;
}

.licencias-list-title-section {
    text-align: center;
}

.licencias-list-title {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 8px 0;
}

.licencias-list-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

.licencias-list-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.licencias-list-actions .btn-export-excel {
    background: #366092;
    border-color: #366092;
    color: #ffffff;
    font-weight: 500;
    transition: all 0.2s ease;
}

.licencias-list-actions .btn-export-excel .material-icons {
    color: #ffffff;
}

.licencias-list-actions .btn-export-excel:hover,
.licencias-list-actions .btn-export-excel:focus {
    background: #2c5282;
    border-color: #2c5282;
    color: #ffffff;
}

.licencias-list-actions .btn-export-excel:hover .material-icons,
.licencias-list-actions .btn-export-excel:focus .material-icons {
    color: #ffffff;
}

.licencias-table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid #e9ecef;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.licencias-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.licencias-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.licencias-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.licencias-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.licencias-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 1700px;
}

/* Tabla de descuentos de productos con columna de acciones (10 columnas) */
.licencias-table-descuentos {
    min-width: 1800px;
}

/* Tabla de descuentos por moneda (10 columnas con acciones) */
.licencias-table-descuentos-moneda {
    min-width: 1900px;
}

.licencias-table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Anchos específicos para columnas de productos */
.licencias-table thead th:nth-child(1),
.licencias-table tbody td:nth-child(1) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

.licencias-table thead th:nth-child(2),
.licencias-table tbody td:nth-child(2) {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
}

.licencias-table thead th:nth-child(3),
.licencias-table tbody td:nth-child(3) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.licencias-table thead th:nth-child(4),
.licencias-table tbody td:nth-child(4) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.licencias-table thead th:nth-child(5),
.licencias-table tbody td:nth-child(5) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.licencias-table thead th:nth-child(6),
.licencias-table tbody td:nth-child(6) {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.licencias-table thead th:nth-child(7),
.licencias-table tbody td:nth-child(7) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

.licencias-table thead th:nth-child(8),
.licencias-table tbody td:nth-child(8) {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    text-align: center;
}

.licencias-table thead th:nth-child(9),
.licencias-table tbody td:nth-child(9) {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
}

.licencias-table thead th:nth-child(10),
.licencias-table tbody td:nth-child(10) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    text-align: center;
}

/* Anchos específicos para columnas de descuentos por moneda (9 columnas) */
.licencias-table-descuentos-moneda thead th:nth-child(1),
.licencias-table-descuentos-moneda tbody td:nth-child(1) { /* Moneda */
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.licencias-table-descuentos-moneda thead th:nth-child(2),
.licencias-table-descuentos-moneda tbody td:nth-child(2) { /* Tipo de Descuento */
    width: 160px;
    min-width: 160px;
    max-width: 160px;
}

.licencias-table-descuentos-moneda thead th:nth-child(3),
.licencias-table-descuentos-moneda tbody td:nth-child(3) { /* Valor del Descuento */
    width: 160px;
    min-width: 160px;
    max-width: 160px;
}

.licencias-table-descuentos-moneda thead th:nth-child(4),
.licencias-table-descuentos-moneda tbody td:nth-child(4) { /* Fecha de Inicio */
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.licencias-table-descuentos-moneda thead th:nth-child(5),
.licencias-table-descuentos-moneda tbody td:nth-child(5) { /* Fecha de Fin */
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.licencias-table-descuentos-moneda thead th:nth-child(6),
.licencias-table-descuentos-moneda tbody td:nth-child(6) { /* Vigencia */
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.licencias-table-descuentos-moneda thead th:nth-child(7),
.licencias-table-descuentos-moneda tbody td:nth-child(7) { /* Monto Mínimo Factura */
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

.licencias-table-descuentos-moneda thead th:nth-child(8),
.licencias-table-descuentos-moneda tbody td:nth-child(8) { /* Estado */
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.licencias-table-descuentos-moneda thead th:nth-child(9),
.licencias-table-descuentos-moneda tbody td:nth-child(9) { /* Fecha de Registro */
    width: 160px;
    min-width: 160px;
    max-width: 160px;
}

.licencias-table-descuentos-moneda thead th:nth-child(10),
.licencias-table-descuentos-moneda tbody td:nth-child(10) { /* Acciones */
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    text-align: center;
}

.licencias-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
}

.licencias-table tbody td .licencia-empresa-name-primary,
.licencias-table tbody td .licencia-empresa-name-secondary {
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    display: block;
}

.licencias-table tbody td .licencia-date-cell,
.licencias-table tbody td .licencia-status-cell,
.licencias-table tbody td .licencia-empresa-cell {
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.licencias-table tbody tr:hover {
    background-color: #f8f9fa;
}


.licencia-empresa-logo,
.licencia-empresa-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.licencia-empresa-logo {
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.licencia-empresa-logo-placeholder {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
}

.licencia-empresa-logo-placeholder .material-icons {
    font-size: 24px;
    color: #adb5bd;
}

.licencia-empresa-info {
    flex: 1;
    min-width: 0;
}

.licencia-empresa-name-primary {
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.licencia-empresa-name-secondary {
    font-size: 0.85rem;
    color: #6c757d;
}


.licencia-date-cell .material-icons {
    font-size: 18px;
    color: #6c757d;
}

.licencia-no-asignada {
    color: #adb5bd;
    font-style: italic;
    font-size: 0.9rem;
}


.licencia-dias-restantes {
    font-size: 0.8rem;
    margin-left: 4px;
    opacity: 0.8;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-pending .material-icons {
    color: #ffc107;
}

.status-no-license {
    background: #e2e3e5;
    color: #383d41;
}

.status-no-license .material-icons {
    color: #6c757d;
}

.licencia-actions-cell {
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 100%;
}

.licencia-actions-cell .btn-action {
    flex-shrink: 0;
}

/* Columna Acciones en tablas ERP — evita desborde de botones */
.tabla-erp th.tabla-erp-col-acciones,
.tabla-erp td.tabla-erp-col-acciones,
.tabla-erp td.licencia-actions-cell,
.tabla-erp td:has(> .licencia-actions-cell),
.tabla-erp td:has(> .fv-crud-actions),
.licencias-table td.licencia-actions-cell,
.licencias-table td:has(> .licencia-actions-cell) {
    min-width: 132px;
    max-width: none !important;
    width: 1%;
    white-space: nowrap;
    overflow: visible;
    vertical-align: middle;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

.tabla-erp-col-acciones-wide,
.tabla-erp th.tabla-erp-col-acciones.tabla-erp-col-acciones-wide,
.tabla-erp td.tabla-erp-col-acciones.tabla-erp-col-acciones-wide,
.tabla-erp td.licencia-actions-cell.erp-db-row-actions {
    min-width: 176px;
}

.contacto-icon {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
    flex-shrink: 0;
}

.contacto-text {
    word-break: break-word;
    overflow-wrap: break-word;
}

.producto-stock-cell,
.producto-precio-cell {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.stock-display,
.precio-display {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.stock-display .material-icons,
.precio-display .material-icons {
    font-size: 18px;
    color: #6c757d;
    flex-shrink: 0;
}

.stock-value,
.precio-value {
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
    white-space: nowrap;
}

.producto-moneda-codigo {
    display: inline-block;
    min-width: 2.5em;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    flex-shrink: 0;
}

.licencia-empresa-cell {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.licencia-empresa-name-primary {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    line-height: 1.4;
}

.licencia-date-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-size: 0.9rem;
    white-space: nowrap;
}

.licencia-status-cell {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Estilos para tabla de ajustar stock */
.ajustar-stock-table {
    table-layout: auto;
}

.ajustar-stock-table thead th:nth-child(1),
.ajustar-stock-table tbody td:nth-child(1) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.ajustar-stock-table thead th:nth-child(2),
.ajustar-stock-table tbody td:nth-child(2) {
    width: 300px;
    min-width: 300px;
}

.ajustar-stock-table thead th:nth-child(3),
.ajustar-stock-table tbody td:nth-child(3) {
    width: 180px;
    min-width: 180px;
}

.ajustar-stock-table thead th:nth-child(4),
.ajustar-stock-table tbody td:nth-child(4) {
    width: 140px;
    min-width: 140px;
}

.ajustar-stock-table thead th:nth-child(5),
.ajustar-stock-table tbody td:nth-child(5) {
    width: 160px;
    min-width: 160px;
}

.input-ubicacion,
.input-stock {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-ubicacion:focus,
.input-stock:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.stock-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-input-wrapper > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-input-wrapper .input-stock {
    flex: 1;
    min-width: 0;
}

.stock-input-wrapper .unidad-medida {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
}

.stock-disponible-info {
    margin-top: 4px;
    padding-left: 4px;
}

.stock-disponible-info small {
    font-size: 0.8rem;
    color: #6c757d;
}

.precio-costo-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #495057;
    font-size: 0.9rem;
}

.precio-costo-display .material-icons {
    font-size: 18px;
    color: #6c757d;
}

.precio-venta-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #495057;
    font-size: 0.9rem;
}

.ajustar-stock-moneda-codigo {
    display: inline-block;
    min-width: 2.5em;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}

.form-actions-stock {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.ajustar-stock-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-stock-minimo-header {
    align-items: center;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
}

.modal-stock-minimo-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-stock-minimo-icon {
    color: #f9a825;
    font-size: 28px;
}

.modal-stock-minimo-lead {
    margin-bottom: 16px;
}

.modal-stock-minimo-tabla {
    margin-bottom: 12px;
}

.modal-stock-minimo-mas {
    font-size: 0.875rem;
}

.modal-stock-minimo-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-stock-minimo-footer .btn .material-icons {
    font-size: 18px;
}

.stock-minimo-valor-bajo,
.stock-minimo-faltante {
    color: #c62828;
    font-weight: 600;
}

.stock-minimo-contador {
    display: inline-block;
    margin-left: 6px;
    color: #c62828;
    font-weight: 600;
}

.reponer-stock-presentacion-resumen .stock-minimo-valor-bajo,
.reponer-stock-presentacion-resumen .stock-minimo-faltante {
    font-size: 1.15rem;
}

.ajustar-stock-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ajustar-stock-toolbar .btn .material-icons {
    font-size: 20px;
}

.form-actions-stock .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 500;
}

.form-actions-stock .btn .material-icons {
    font-size: 20px;
}

.btn-action-license {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-action-license .material-icons {
    font-size: 20px;
}

.btn-action-license:hover {
    background: #e3f2fd;
    color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.licencias-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.licencias-empty-state .material-icons {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.licencias-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 10px 0;
}

.licencias-empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Tabla procesar recepción (WMS) */
.tabla-recepcion-procesar-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.tabla-recepcion-procesar {
    width: 100%;
    min-width: 1320px;
    table-layout: auto;
    margin-bottom: 0;
}

.tabla-recepcion-procesar th,
.tabla-recepcion-procesar td {
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tabla-recepcion-procesar thead th {
    white-space: normal;
    line-height: 1.25;
    font-size: 0.8125rem;
}

.tabla-recepcion-procesar .recepcion-col-producto {
    min-width: 150px;
    max-width: 240px;
}

.tabla-recepcion-procesar .recepcion-col-presentacion {
    min-width: 130px;
    max-width: 200px;
}

.tabla-recepcion-procesar .recepcion-pres-nombre {
    display: block;
    font-weight: 600;
    line-height: 1.25;
}

.tabla-recepcion-procesar .recepcion-pres-codigo,
.tabla-recepcion-procesar .recepcion-pres-cant {
    display: block;
    font-size: 0.75rem;
    color: #5f6368;
    line-height: 1.3;
}

.tabla-recepcion-procesar .recepcion-prod-codigo {
    display: block;
    font-weight: 600;
    white-space: nowrap;
}

.tabla-recepcion-procesar .recepcion-prod-nombre {
    display: block;
    font-size: 0.8125rem;
    color: #5f6368;
    line-height: 1.3;
}

.tabla-recepcion-procesar .recepcion-col-num {
    min-width: 88px;
    white-space: nowrap;
    text-align: end;
}

.tabla-recepcion-procesar .recepcion-col-input {
    min-width: 108px;
    max-width: 132px;
}

.tabla-recepcion-procesar .recepcion-col-ubicacion {
    min-width: 140px;
    max-width: 190px;
}

.tabla-recepcion-procesar .recepcion-col-lote {
    min-width: 108px;
    max-width: 150px;
}

.tabla-recepcion-procesar .recepcion-col-fecha {
    min-width: 138px;
    max-width: 160px;
}

.tabla-recepcion-procesar .recepcion-col-monto {
    min-width: 118px;
    white-space: nowrap;
}

.tabla-recepcion-procesar .recepcion-col-obs {
    min-width: 150px;
    max-width: 240px;
}

.tabla-recepcion-procesar .recepcion-col-acciones {
    min-width: 72px;
    width: 72px;
    white-space: nowrap;
}

.tabla-recepcion-procesar .recepcion-valor-readonly {
    display: inline-block;
    min-width: 4.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.4;
}

.tabla-recepcion-procesar .recepcion-precio-sugerido {
    color: #1b5e20;
}

.tabla-recepcion-procesar .form-control,
.tabla-recepcion-procesar .form-select,
.tabla-recepcion-procesar textarea.form-control {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tabla-recepcion-procesar textarea.form-control {
    resize: vertical;
    min-height: 2.25rem;
}

.recepcion-ficha-pres-table th,
.recepcion-ficha-pres-table td {
    vertical-align: middle;
}

.recepcion-ficha-pres-cod {
    font-weight: 600;
    white-space: nowrap;
}

.recepcion-ficha-datos {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 14px;
}

/* Estilos para formulario de asignar licencia */
.licencia-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.licencia-form-header {
    margin-bottom: 24px;
}

.licencia-empresa-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.licencia-empresa-info-header {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #fff;
}

.licencia-empresa-info-logo,
.licencia-empresa-info-logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.licencia-empresa-info-logo {
    object-fit: cover;
    background: #fff;
}

.licencia-empresa-info-logo-placeholder {
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.licencia-empresa-info-logo-placeholder .material-icons {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
}

.licencia-empresa-info-text h2 {
    margin: 0 0 4px 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.licencia-empresa-info-text p {
    margin: 0;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.licencia-form-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.licencia-form-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.licencia-form-card-header .material-icons {
    font-size: 24px;
    color: #667eea;
}

.licencia-form-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.licencia-form {
    padding: 24px;
}

.licencia-current-info {
    margin-top: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.licencia-current-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.licencia-current-info-header .material-icons {
    font-size: 20px;
    color: #667eea;
}

.licencia-current-info-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.licencia-current-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.licencia-current-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 80px;
}

.licencia-current-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.licencia-dias-text {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Estilos para información de lógica de licencias */
.licencia-logic-info {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    border: 1px solid #bbdefb;
}

.licencia-logic-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.licencia-logic-info-header .material-icons {
    font-size: 24px;
    color: #1976d2;
}

.licencia-logic-info-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1976d2;
}

.licencia-logic-info-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.licencia-logic-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #1976d2;
}

.licencia-logic-item:last-child {
    border-left-color: #4caf50;
}

.licencia-logic-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.licencia-logic-icon.premium {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.licencia-logic-icon .material-icons {
    color: #fff;
    font-size: 24px;
}

.licencia-logic-content {
    flex: 1;
}

.licencia-logic-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.licencia-logic-description {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
}

.licencia-logic-description strong {
    color: #1976d2;
    font-weight: 600;
}

.licencia-logic-item:last-child .licencia-logic-description strong {
    color: #4caf50;
}

/* Estilos para información del plan seleccionado */
.licencia-plan-info {
    margin-top: 24px;
    padding: 20px;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffc107;
}

.licencia-plan-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.licencia-plan-info-header .material-icons {
    font-size: 24px;
    color: #f57c00;
}

.licencia-plan-info-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f57c00;
}

.licencia-plan-info-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.licencia-plan-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #ffe082;
}

.licencia-plan-field:last-child {
    border-bottom: none;
}

.licencia-plan-label {
    font-weight: 600;
    color: #f57c00;
    min-width: 140px;
}

.licencia-plan-value {
    flex: 1;
    color: #212529;
}

.licencia-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

/* Responsive para gestión de licencias */
@media (max-width: 992px) {
    .licencias-table-wrapper {
        overflow-x: auto;
    }
    
    .licencias-table {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .licencias-list-container {
        padding: 16px;
    }
    
    .licencias-list-title {
        font-size: 1.5rem;
    }
    
    .licencias-list-subtitle {
        font-size: 1rem;
    }

    .licencias-list-actions {
        margin-top: 16px;
        flex-direction: column;
        width: 100%;
    }

    .licencias-list-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .licencias-table thead th {
        padding: 12px 15px;
        font-size: 10px;
    }
    
    .licencias-table tbody td {
        padding: 12px 15px;
    }
    
    .licencia-empresa-logo,
    .licencia-empresa-logo-placeholder {
        width: 35px;
        height: 35px;
    }
    
    .licencia-empresa-name-primary {
        font-size: 0.9rem;
    }
    
    .licencia-empresa-name-secondary {
        font-size: 0.8rem;
    }
    
    .licencia-form-container {
        padding: 16px;
    }
    
    .licencia-empresa-info-card {
        padding: 20px;
    }
    
    .licencia-empresa-info-logo,
    .licencia-empresa-info-logo-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .licencia-empresa-info-text h2 {
        font-size: 1.5rem;
    }
    
    .licencia-empresa-info-text p {
        font-size: 1rem;
    }
    
    .licencia-form {
        padding: 20px;
    }
    
    .licencia-form-actions {
        flex-direction: column-reverse;
    }
    
    .licencia-form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .licencia-logic-info-body {
        gap: 12px;
    }
    
    .licencia-logic-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .licencia-logic-icon {
        width: 40px;
        height: 40px;
    }
    
    .licencia-logic-icon .material-icons {
        font-size: 20px;
    }
    
    .licencia-plan-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .licencia-plan-label {
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .licencias-list-container {
        padding: 12px;
    }
    
    .licencias-list-title {
        font-size: 1.25rem;
    }
    
    .licencias-list-subtitle {
        font-size: 0.9rem;
    }
    
    .licencias-table thead th {
        padding: 10px 12px;
        font-size: 9px;
    }
    
    .licencias-table tbody td {
        padding: 10px 12px;
    }
    
    .licencia-empresa-cell {
        gap: 8px;
    }
    
    .licencia-empresa-logo,
    .licencia-empresa-logo-placeholder {
        width: 32px;
        height: 32px;
    }
    
    .licencia-empresa-logo-placeholder .material-icons {
        font-size: 20px;
    }
    
    .licencia-empresa-name-primary {
        font-size: 0.85rem;
    }
    
    .licencia-empresa-name-secondary {
        font-size: 0.75rem;
    }
    
    .licencia-date-cell {
        font-size: 0.85rem;
    }
    
    .licencia-date-cell .material-icons {
        font-size: 16px;
    }
    
    .licencia-form-container {
        padding: 12px;
    }
    
    .licencia-empresa-info-card {
        padding: 16px;
    }
    
    .licencia-empresa-info-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .licencia-empresa-info-logo,
    .licencia-empresa-info-logo-placeholder {
        width: 50px;
        height: 50px;
    }
    
    .licencia-empresa-info-text h2 {
        font-size: 1.25rem;
    }
    
    .licencia-empresa-info-text p {
        font-size: 0.9rem;
    }
    
    .licencia-form-card-header {
        padding: 16px 20px;
    }
    
    .licencia-form-card-header h3 {
        font-size: 1.1rem;
    }
    
    .licencia-form {
        padding: 16px;
    }
}

/* ============================================
   Estilos para Panel de Administrador de Empresa
   ============================================ */

.admin-dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.panel-dashboard-tabbed-card .su-tienda-api-tab-content,
.admin-dashboard-tabbed-card .su-tienda-api-tab-content,
.bancos-dashboard-tabbed-card .su-tienda-api-tab-content {
    padding: 0 1.25rem 1.5rem;
}

.panel-dashboard-tabbed-card .cxc-guia-panel,
.admin-dashboard-tabbed-card .cxc-guia-panel,
.bancos-dashboard-tabbed-card .cxc-guia-panel {
    border: none;
    box-shadow: none;
    margin-bottom: 0;
}

.reportes-chart-container {
    max-height: 360px;
}

.admin-dashboard-header {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.admin-empresa-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 300px;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: #fff;
}

.admin-empresa-logo,
.admin-empresa-logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.admin-empresa-logo {
    object-fit: cover;
    background: #fff;
}

.admin-empresa-logo-placeholder {
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-empresa-logo-placeholder .material-icons {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
}

.admin-empresa-details {
    flex: 1;
}

.admin-empresa-name {
    margin: 0 0 4px 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.admin-empresa-comercial {
    margin: 0;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.admin-licencia-info {
    min-width: 280px;
}

.admin-licencia-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid;
}

.admin-licencia-card.active {
    border-color: #28a745;
}

.admin-licencia-card.inactive {
    border-color: #dc3545;
}

.admin-licencia-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-licencia-card.active .admin-licencia-icon {
    background: #d4edda;
}

.admin-licencia-card.inactive .admin-licencia-icon {
    background: #f8d7da;
}

.admin-licencia-icon .material-icons {
    font-size: 32px;
}

.admin-licencia-card.active .admin-licencia-icon .material-icons {
    color: #28a745;
}

.admin-licencia-card.inactive .admin-licencia-icon .material-icons {
    color: #dc3545;
}

.admin-licencia-details {
    flex: 1;
}

.admin-licencia-status {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.admin-licencia-card.active .admin-licencia-status {
    color: #28a745;
}

.admin-licencia-card.inactive .admin-licencia-status {
    color: #dc3545;
}

.admin-licencia-days {
    margin-bottom: 4px;
}

.admin-licencia-warning {
    color: #ff9800;
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-licencia-ok {
    color: #28a745;
    font-weight: 500;
    font-size: 0.95rem;
}

.admin-licencia-dates {
    font-size: 0.9rem;
    color: #6c757d;
}

.admin-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.admin-dashboard-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    min-width: 0;
}

.admin-dashboard-cards--gerente-kpi {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-dashboard-cards--gerente-kpi .admin-dashboard-card {
    align-items: flex-start;
}

.admin-dashboard-cards--gerente-kpi .admin-card-icon {
    margin-top: 2px;
}

.admin-dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.admin-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-card-icon .material-icons {
    font-size: 32px;
    color: #fff;
}

.admin-card-content {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.admin-card-value {
    font-size: clamp(1.15rem, 2.5vw, 2rem);
    font-weight: 700;
    color: #212529;
    margin-bottom: 4px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-card-label {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.admin-card-subvalue {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 600;
    margin-top: 4px;
}

.admin-card-moneda-hint {
    display: block;
    font-size: 0.72rem;
    color: #868e96;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.admin-kpi-monto-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 100%;
    margin-bottom: 2px;
}

.admin-kpi-monto-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.35rem;
    max-width: 100%;
    min-width: 0;
}

.admin-kpi-monto-prefix {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    flex-shrink: 0;
}

.admin-kpi-monto-valor {
    font-size: clamp(0.95rem, 2.1vw, 1.35rem);
    font-weight: 700;
    color: #212529;
    line-height: 1.25;
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-kpi-monto-dual {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-width: 100%;
    margin-bottom: 2px;
}

.admin-kpi-monto-dual--compact {
    gap: 0.15rem;
    margin-bottom: 0;
}

.admin-kpi-monto-dual--compact .admin-kpi-monto-valor {
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
}

.admin-kpi-cuentas-stack {
    max-height: 9.5rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.admin-kpi-cuenta-line {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.admin-kpi-cuenta-etiqueta {
    font-size: 0.72rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.admin-kpi-moneda-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: #f1f3f5;
    flex-shrink: 0;
    line-height: 1.3;
}

.btn-material-icon-leading {
    vertical-align: middle;
    font-size: 1.1rem;
}

.admin-welcome-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid #dee2e6;
}

.admin-welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-welcome-icon .material-icons {
    font-size: 48px;
    color: #fff;
}

.admin-welcome-content {
    flex: 1;
}

.admin-welcome-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 12px 0;
}

.admin-welcome-content p {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
}

/* Responsive para panel de admin */
@media (max-width: 992px) {
    .admin-dashboard-header {
        flex-direction: column;
    }
    
    .admin-licencia-info {
        width: 100%;
    }
    
    .admin-dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .admin-dashboard-cards--gerente-kpi {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .admin-dashboard-container {
        padding: 16px;
    }
    
    .admin-empresa-info {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .admin-empresa-name {
        font-size: 1.5rem;
    }
    
    .admin-empresa-comercial {
        font-size: 1rem;
    }
    
    .admin-licencia-card {
        padding: 16px;
    }
    
    .admin-licencia-icon {
        width: 48px;
        height: 48px;
    }
    
    .admin-licencia-icon .material-icons {
        font-size: 28px;
    }
    
    .admin-dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .admin-welcome-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
    
    .admin-welcome-content h2 {
        font-size: 1.5rem;
    }
    
    .admin-welcome-content p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .admin-dashboard-container {
        padding: 12px;
    }
    
    .admin-empresa-info {
        padding: 16px;
    }
    
    .admin-empresa-logo,
    .admin-empresa-logo-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .admin-empresa-logo-placeholder .material-icons {
        font-size: 40px;
    }
    
    .admin-empresa-name {
        font-size: 1.25rem;
    }
    
    .admin-empresa-comercial {
        font-size: 0.9rem;
    }
    
    .admin-licencia-card {
        padding: 14px;
        gap: 12px;
    }
    
    .admin-licencia-icon {
        width: 40px;
        height: 40px;
    }
    
    .admin-licencia-icon .material-icons {
        font-size: 24px;
    }
    
    .admin-licencia-status {
        font-size: 1rem;
    }
    
    .admin-dashboard-card {
        padding: 20px;
        gap: 16px;
    }
    
    .admin-card-icon {
        width: 56px;
        height: 56px;
    }
    
    .admin-card-icon .material-icons {
        font-size: 28px;
    }
    
    .admin-card-value {
        font-size: 1.75rem;
    }

    .admin-kpi-monto-valor {
        font-size: 1.15rem;
    }
    
    .admin-welcome-card {
        padding: 20px;
    }
    
    .admin-welcome-icon {
        width: 64px;
        height: 64px;
    }
    
    .admin-welcome-icon .material-icons {
        font-size: 40px;
    }
    
    .admin-welcome-content h2 {
        font-size: 1.25rem;
    }
    
    .admin-welcome-content p {
        font-size: 0.95rem;
    }
}

/* Estilos para carga masiva de clientes */
.table-warning {
    background-color: #fff3cd !important;
}

.table-success {
    background-color: #d1e7dd !important;
}

.table-warning td,
.table-success td {
    border-color: rgba(0,0,0,0.1) !important;
}

/* Estilos para campos editables en preview */
.fila-preview .campo-editable {
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    width: 100%;
    box-sizing: border-box;
}

.fila-preview .campo-editable:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.fila-preview .form-select {
    font-size: 0.95rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.fila-preview .form-select-sm {
    font-size: 0.95rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.fila-preview .guardar-fila {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    min-width: 50px;
}

.fila-preview .guardar-fila:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.errores-fila {
    font-size: 0.9rem;
    min-width: 250px;
    max-width: 400px;
    word-wrap: break-word;
}

.errores-fila ul {
    margin: 0;
    padding-left: 20px;
}

/* Ajustar tamaño de celdas en tabla de preview */
.fila-preview td {
    padding: 0.75rem 0.5rem !important;
    vertical-align: middle;
}

.fila-preview th {
    padding: 1rem 0.5rem !important;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Asegurar que los campos tengan espacio suficiente */
.fila-preview .licencias-table {
    table-layout: auto;
    width: 100%;
}

.fila-preview .licencias-table td {
    min-width: 120px;
    white-space: nowrap;
    overflow: visible;
    word-wrap: break-word;
}

/* Anchos específicos para cada columna */
.fila-preview .licencias-table th:nth-child(1),
.fila-preview .licencias-table td:nth-child(1) {
    min-width: 60px;
    width: 60px;
    text-align: center;
}

.fila-preview .licencias-table th:nth-child(2),
.fila-preview .licencias-table td:nth-child(2) {
    min-width: 140px;
    width: 140px;
}

.fila-preview .licencias-table th:nth-child(3),
.fila-preview .licencias-table td:nth-child(3) {
    min-width: 160px;
    width: 160px;
}

.fila-preview .licencias-table th:nth-child(4),
.fila-preview .licencias-table td:nth-child(4) {
    min-width: 200px;
    width: 200px;
}

.fila-preview .licencias-table th:nth-child(5),
.fila-preview .licencias-table td:nth-child(5) {
    min-width: 200px;
    width: 200px;
}

.fila-preview .licencias-table th:nth-child(6),
.fila-preview .licencias-table td:nth-child(6) {
    min-width: 150px;
    width: 150px;
}

.fila-preview .licencias-table th:nth-child(7),
.fila-preview .licencias-table td:nth-child(7) {
    min-width: 180px;
    width: 180px;
}

.fila-preview .licencias-table th:nth-child(8),
.fila-preview .licencias-table td:nth-child(8) {
    min-width: 140px;
    width: 140px;
}

.fila-preview .licencias-table th:nth-child(9),
.fila-preview .licencias-table td:nth-child(9) {
    min-width: 250px;
    width: 250px;
}

.fila-preview .licencias-table th:nth-child(10),
.fila-preview .licencias-table td:nth-child(10) {
    min-width: 140px;
    width: 140px;
}

.fila-preview .licencias-table th:nth-child(11),
.fila-preview .licencias-table td:nth-child(11) {
    min-width: 130px;
    width: 130px;
}

.fila-preview .licencias-table th:nth-child(12),
.fila-preview .licencias-table td:nth-child(12) {
    min-width: 130px;
    width: 130px;
}

.fila-preview .licencias-table th:nth-child(13),
.fila-preview .licencias-table td:nth-child(13) {
    min-width: 120px;
    width: 120px;
}

.fila-preview .licencias-table th:nth-child(14),
.fila-preview .licencias-table td:nth-child(14) {
    min-width: 300px;
    width: 300px;
}

.fila-preview .licencias-table th:nth-child(15),
.fila-preview .licencias-table td:nth-child(15) {
    min-width: 100px;
    width: 100px;
    text-align: center;
}

/* Responsive para tabla de preview */
@media (max-width: 1200px) {
    .fila-preview .campo-editable {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
        min-width: 100px;
    }
    
    .fila-preview .form-select,
    .fila-preview .form-select-sm {
        font-size: 0.85rem;
        padding: 0.4rem 1.75rem 0.4rem 0.6rem;
        min-width: 130px;
    }
}

/* ============================================================================
   Estilos para módulos de empresa (ver y editar)
   ============================================================================ */

.modulos-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modulo-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    align-items: center;
}

.modulo-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modulo-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modulo-item-icon .material-icons {
    color: #fff;
    font-size: 24px;
}

.modulo-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modulo-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.modulo-item-code {
    font-size: 0.9rem;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.modulo-item-description {
    font-size: 0.95rem;
    color: #495057;
    margin-top: 4px;
}

.modulo-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.modulo-item-actions {
    flex-shrink: 0;
}

.modulo-eliminar-form {
    display: inline;
}

.modulo-total-badge {
    font-size: 1.1rem;
}

/* Responsive para módulos */
@media (max-width: 768px) {
    .modulo-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modulo-item-icon {
        width: 40px;
        height: 40px;
    }
    
    .modulo-item-icon .material-icons {
        font-size: 20px;
    }
    
    .modulo-item-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modulo-item-actions {
        width: 100%;
    }
    
    .modulo-item-actions .btn {
        width: 100%;
    }
}

/* Estilos para secciones de módulos en listar_modulos */
.modulos-section-wrapper {
    margin-bottom: 30px;
}

.modulos-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modulos-section-icon {
    vertical-align: middle;
    font-size: 1.5rem;
}

/* Estilos para columnas de tablas de módulos */
.licencias-table .modulo-col-codigo {
    width: 12%;
    min-width: 100px;
}

.licencias-table .modulo-col-nombre {
    width: 20%;
    min-width: 150px;
}

.licencias-table .modulo-col-app {
    width: 15%;
    min-width: 120px;
}

.licencias-table .modulo-col-version {
    width: 8%;
    min-width: 80px;
}

.licencias-table .modulo-col-empresa {
    width: 18%;
    min-width: 150px;
}

.licencias-table .modulo-col-esencial {
    width: 10%;
    min-width: 90px;
}

.licencias-table .modulo-col-estado {
    width: 10%;
    min-width: 90px;
}

.licencias-table .modulo-col-fecha {
    width: 12%;
    min-width: 110px;
}

.licencias-table .modulo-col-acciones {
    width: 8%;
    min-width: 80px;
    white-space: nowrap;
}

/* Asegurar que las celdas no se desborden */
.licencias-table td.modulo-col-codigo,
.licencias-table td.modulo-col-nombre,
.licencias-table td.modulo-col-app,
.licencias-table td.modulo-col-version,
.licencias-table td.modulo-col-empresa,
.licencias-table td.modulo-col-esencial,
.licencias-table td.modulo-col-estado,
.licencias-table td.modulo-col-fecha,
.licencias-table td.modulo-col-acciones {
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

/* Responsive para tablas de módulos */
@media (max-width: 1200px) {
    .licencias-table .modulo-col-codigo {
        width: 10%;
        min-width: 90px;
    }
    
    .licencias-table .modulo-col-nombre {
        width: 18%;
        min-width: 140px;
    }
    
    .licencias-table .modulo-col-app {
        width: 14%;
        min-width: 110px;
    }
    
    .licencias-table .modulo-col-empresa {
        width: 16%;
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .licencias-table-wrapper {
        overflow-x: auto;
        display: block;
        width: 100%;
    }
    
    .licencias-table {
        min-width: 1410px;
        display: table;
    }
    
    .licencias-table thead th,
    .licencias-table tbody td {
        padding: 12px 15px;
    }
    
    .licencias-table thead th {
        font-size: 10px;
    }
    
    .licencias-table .modulo-col-codigo,
    .licencias-table .modulo-col-nombre,
    .licencias-table .modulo-col-app,
    .licencias-table .modulo-col-version,
    .licencias-table .modulo-col-empresa,
    .licencias-table .modulo-col-esencial,
    .licencias-table .modulo-col-estado,
    .licencias-table .modulo-col-fecha,
    .licencias-table .modulo-col-acciones {
        min-width: auto;
    }
    
    .stock-value,
    .precio-value {
        font-size: 0.85rem;
    }
    
    .licencia-empresa-name-primary {
        font-size: 0.9rem;
    }
    
    .ajustar-stock-table {
        min-width: 900px;
    }
    
    .ajustar-stock-table thead th,
    .ajustar-stock-table tbody td {
        padding: 12px 15px;
    }
    
    .input-ubicacion,
    .input-stock {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    .form-actions-stock {
        flex-direction: column;
    }
    
    .form-actions-stock .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Estilos para planes de licencia */
.plan-nombre-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-nombre-cell strong {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.plan-nombre-cell small {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

.plan-precio {
    font-weight: 600;
    color: #28a745;
    font-size: 1rem;
}

.plan-limit {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.plan-limit-unlimited {
    font-weight: 600;
    color: #667eea;
    font-size: 0.95rem;
    font-style: italic;
}

.plan-orden {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Responsive para planes de licencia */
@media (max-width: 992px) {
    .plan-nombre-cell small {
        display: none;
    }
}

@media (max-width: 768px) {
    .licencias-table th,
    .licencias-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .plan-precio,
    .plan-limit,
    .plan-limit-unlimited {
        font-size: 0.85rem;
    }
}

/* Estilos para gráfico de tasas de cambio */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 250px;
    }
}

/* Reportes — tienda virtual (gráficos) */
.reportes-tienda-chart-wrap {
    min-height: 280px;
}

.reportes-tienda-mensual-chart {
    position: relative;
    height: 380px;
    width: 100%;
}

@media (max-width: 768px) {
    .reportes-tienda-mensual-chart {
        height: 300px;
    }
}

/* Estilos para tabla de facturación */
.facturacion-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

/* Contenedor específico para tabla de ítems de Facturación - Punto de Venta.
   Los estilos de .facturacion-items-table solo aplican dentro de este wrapper,
   evitando afectar otras tablas ERP del sistema. */
.facturacion-pos-items-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table {
    width: 100%;
    min-width: 900px;
    table-layout: fixed;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table thead th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 8px;
    font-weight: 600;
    font-size: 11px;
    border-bottom: 2px solid #dee2e6;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table tbody td {
    padding: 10px 8px;
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 11pt;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table tbody td input {
    width: 100%;
    min-width: 0;
    font-size: 11pt;
}

/* Celda Precio: asegurar min-width en input editable para editar_borrador */
.facturacion-pos-items-table-wrapper .facturacion-items-table .facturacion-cell-precio input {
    min-width: 100px;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table .item-precio-editable {
    width: 100%;
    max-width: 100%;
}

/* Celda Precio: span de visualización en facturar debe mostrar montos completos */
.facturacion-pos-items-table-wrapper .facturacion-items-table .facturacion-cell-precio .item-precio-display {
    white-space: nowrap;
    display: inline-block;
    min-width: 4em;
}

.facturacion-pos-items-table-wrapper .facturacion-col-codigo {
    width: 8%;
    min-width: 90px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-nombre {
    width: 18%;
    min-width: 140px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-descripcion {
    width: 15%;
    min-width: 120px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-presentacion {
    width: 16%;
    min-width: 140px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-cantidad {
    width: 8%;
    min-width: 75px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-precio {
    width: 14%;
    min-width: 125px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-descuento {
    width: 10%;
    min-width: 80px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-iva {
    width: 10%;
    min-width: 80px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-total {
    width: 12%;
    min-width: 105px;
}

.facturacion-pos-items-table-wrapper .facturacion-col-acciones {
    width: 6%;
    min-width: 50px;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table .licencia-empresa-cell {
    max-width: 100%;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table .licencia-empresa-name-primary {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table .licencia-empresa-name-secondary {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 10pt;
    margin-top: 4px;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table .facturacion-cell-descripcion {
    font-size: 10pt;
    color: #6c757d;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table .facturacion-cell-presentacion {
    vertical-align: middle;
    min-width: 140px;
}

.facturacion-pos-items-table-wrapper .facturacion-items-table .facturacion-cell-presentacion .item-presentacion {
    width: 100%;
    max-width: 220px;
    font-size: 0.85rem;
}

/* Responsive para tabla de facturación POS */
@media (max-width: 1200px) {
    .facturacion-pos-items-table-wrapper .facturacion-items-table {
        min-width: 780px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-codigo {
        width: 8%;
        min-width: 80px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-nombre {
        width: 16%;
        min-width: 120px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-descripcion {
        width: 14%;
        min-width: 100px;
    }

    .facturacion-pos-items-table-wrapper .facturacion-col-presentacion {
        width: 14%;
        min-width: 120px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-cantidad {
        width: 9%;
        min-width: 65px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-precio {
        width: 12%;
        min-width: 100px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-descuento,
    .facturacion-pos-items-table-wrapper .facturacion-col-iva {
        width: 9%;
        min-width: 70px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-total {
        width: 11%;
        min-width: 85px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-acciones {
        width: 10%;
        min-width: 50px;
    }
}

@media (max-width: 768px) {
    .facturacion-pos-items-table-wrapper .facturacion-items-table {
        min-width: 680px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table thead th {
        padding: 10px 6px;
        font-size: 10.5pt;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table tbody td {
        padding: 8px 6px;
        font-size: 10.5pt;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table tbody td input {
        font-size: 10.5pt;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table .facturacion-cell-precio input {
        min-width: 90px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-codigo {
        width: 8%;
        min-width: 70px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-nombre {
        width: 15%;
        min-width: 100px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-descripcion {
        width: 13%;
        min-width: 85px;
    }

    .facturacion-pos-items-table-wrapper .facturacion-col-presentacion {
        width: 14%;
        min-width: 100px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-cantidad {
        width: 10%;
        min-width: 55px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-precio {
        width: 12%;
        min-width: 90px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-descuento,
    .facturacion-pos-items-table-wrapper .facturacion-col-iva {
        width: 10%;
        min-width: 65px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-total {
        width: 12%;
        min-width: 75px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-acciones {
        width: 10%;
        min-width: 50px;
    }
}

@media (max-width: 576px) {
    .facturacion-pos-items-table-wrapper .facturacion-items-table {
        min-width: 580px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table thead th {
        padding: 8px 4px;
        font-size: 10pt;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table tbody td {
        padding: 6px 4px;
        font-size: 10pt;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table tbody td input {
        font-size: 10pt;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table .facturacion-cell-precio input {
        min-width: 80px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-codigo {
        width: 8%;
        min-width: 60px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-nombre {
        width: 14%;
        min-width: 85px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-descripcion {
        width: 12%;
        min-width: 70px;
    }

    .facturacion-pos-items-table-wrapper .facturacion-col-presentacion {
        width: 14%;
        min-width: 90px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-cantidad {
        width: 11%;
        min-width: 48px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-precio {
        width: 13%;
        min-width: 80px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-descuento,
    .facturacion-pos-items-table-wrapper .facturacion-col-iva {
        width: 10%;
        min-width: 58px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-total {
        width: 12%;
        min-width: 65px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-col-acciones {
        width: 10%;
        min-width: 45px;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table .licencia-empresa-name-primary {
        font-size: 10pt;
    }
    
    .facturacion-pos-items-table-wrapper .facturacion-items-table .licencia-empresa-name-secondary {
        font-size: 9pt;
    }
}

.facturacion-icon-delete {
    font-size: 18px;
}

/* Registrar compra: scroll horizontal + Acciones (precio + eliminar) visibles */
.compras-registrar-items-wrapper.facturacion-pos-items-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.compras-registrar-items-wrapper .facturacion-items-table {
    min-width: 1320px;
    table-layout: auto;
}

.compras-registrar-items-wrapper .facturacion-col-costo-final {
    min-width: 100px;
    white-space: nowrap;
}

.compras-registrar-items-wrapper .item-costo-final {
    font-weight: 600;
    color: #37474f;
}

.compras-registrar-items-wrapper .item-costo-final.compras-costo-final-cambia {
    color: #1565c0;
}

.compras-registrar-items-wrapper .facturacion-col-und-inventario {
    min-width: 110px;
    white-space: nowrap;
}

.compras-registrar-items-wrapper .item-cantidad-base {
    font-weight: 600;
    color: #37474f;
}

.compras-registrar-items-wrapper .facturacion-col-acciones,
.compras-registrar-items-wrapper td.facturacion-col-acciones {
    min-width: 96px;
    width: 96px;
    white-space: nowrap;
}

.compras-registrar-items-wrapper .facturacion-items-table th.facturacion-col-acciones,
.compras-registrar-items-wrapper .facturacion-items-table td.facturacion-col-acciones {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff;
    box-shadow: -6px 0 10px rgba(0, 0, 0, 0.06);
}

.compras-registrar-items-wrapper .facturacion-items-table thead th.facturacion-col-acciones {
    z-index: 4;
    background: #f8f9fa;
}

.compras-registrar-items-wrapper .licencia-actions-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.compras-registrar-hint-icon {
    font-size: 16px;
    vertical-align: middle;
    color: #388e3c;
}

.compras-fila-precio-editado {
    background: #f1f8e9;
}

/* Estilos para contenedor de facturación */
.facturacion-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.facturacion-acciones-pos .btn .material-icons {
    vertical-align: middle;
    font-size: 1.1rem;
    margin-right: 0.25rem;
}

@media (max-width: 575.98px) {
    .facturacion-acciones-pos {
        justify-content: stretch !important;
    }

    .facturacion-acciones-pos .btn {
        flex: 1 1 100%;
        width: 100%;
    }
}

.facturacion-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 16px 18px;
}

.facturacion-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.facturacion-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.facturacion-panel-title .material-icons {
    font-size: 20px;
    color: #0d6efd;
}

.facturacion-busqueda-input {
    max-width: 360px;
}

.facturacion-totales {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.facturacion-totales-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.facturacion-totales-moneda {
    font-weight: 600;
    white-space: nowrap;
}

.facturacion-totales-row strong {
    font-size: 1.05rem;
}

.facturacion-totales-row.monto-total {
    font-size: 1.2rem;
}

/* Estilos para totales en diferentes monedas */
.facturacion-totales-monedas {
    margin-top: 1rem;
}

.facturacion-totales-monedas .card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.facturacion-totales-monedas .card-body {
    padding: 1.25rem 1.5rem;
}

.facturacion-totales-monedas .card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
}

.facturacion-totales-monedas .card-title .material-icons {
    font-size: 1.2rem;
    color: #0d6efd;
}

.facturacion-totales-monedas-item {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.facturacion-totales-monedas-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.facturacion-totales-monedas-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
}

/* Ficha Tasas del día (facturación) */
.facturacion-tasas-dia .card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f7f8f9;
}

.facturacion-tasas-dia .card-body {
    padding: 1rem 1.25rem;
}

.facturacion-tasas-dia .card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
}

.facturacion-tasas-dia .card-title .material-icons {
    font-size: 0.95rem;
    color: #0d6efd;
}

.facturacion-tasas-dia-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #f1f3f4;
    border-radius: 6px;
}

.facturacion-tasas-dia-label {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
}

.facturacion-tasas-dia-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #212529;
}

/* Panel Tasas del Día (pestaña en facturación) */
.facturacion-tasas-dia-panel {
    margin-top: 0.5rem;
}

.facturacion-tasas-dia-panel-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
}

.facturacion-tasas-dia-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.facturacion-tasas-dia-panel-header .material-icons {
    font-size: 1.5rem;
}

.facturacion-tasas-dia-panel-body {
    padding: 1.25rem 1.5rem;
}

.facturacion-tasas-dia-panel-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.facturacion-tasas-dia-panel-item:last-child {
    margin-bottom: 0;
}

.facturacion-tasas-dia-panel-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.facturacion-tasas-dia-panel-icon .material-icons {
    font-size: 1.75rem;
    color: #fff;
}

.facturacion-tasas-item-ves .facturacion-tasas-dia-panel-icon {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.4);
}

.facturacion-tasas-item-cop .facturacion-tasas-dia-panel-icon {
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 100%);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
}

.facturacion-tasas-item-copves .facturacion-tasas-dia-panel-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
}

.facturacion-tasas-dia-panel-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.facturacion-tasas-dia-panel-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.facturacion-tasas-dia-panel-value {
    font-size: 18pt;
    font-weight: 700;
    color: #212529;
}

/* Ficha de tasas de cambio - Cierre de Caja */
.cierre-caja-fecha-input {
    max-width: 160px;
}

.cierre-tasas-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
}

.cierre-tasas-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: none;
}

.cierre-tasas-card .card-header .material-icons {
    font-size: 1.25rem;
    vertical-align: middle;
    margin-right: 6px;
}

.cierre-tasas-card .card-body {
    padding: 1rem 1.25rem;
}

.cierre-tasas-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

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

.cierre-tasas-item-label {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.cierre-tasas-item-value {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
}

.cierre-tasas-card .cierre-tasas-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.inventario-dia-fecha-input {
    max-width: 160px;
}

.inventario-dia-filtros {
    flex-wrap: wrap;
}

.tabla-erp th.inventario-dia-col-fact,
.tabla-erp td.inventario-dia-col-fact {
    font-weight: 600;
    color: #1a365d;
}

.inventario-dia-tabs {
    margin-bottom: 1rem;
}

.inventario-dia-pane {
    margin-top: 0.25rem;
}

.inventario-dia-equiv-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inventario-dia-equiv-grupo {
    padding: 1rem 1.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}

.inventario-dia-equiv-titulo {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.35rem 0;
    color: #1a365d;
}

.inventario-dia-equiv-cabecera {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #1a365d;
}

.inventario-dia-equiv-total {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.inventario-dia-equiv-lineas {
    margin: 0;
    padding-left: 1.25rem;
}

.inventario-dia-equiv-lineas li {
    margin-bottom: 0.25rem;
}

.inventario-dia-equiv-vacio {
    padding: 1.5rem;
}

.inventario-dia-equiv-pie {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.inventario-dia-ganancia-resumen {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.inventario-dia-ganancia-item {
    flex: 1 1 10rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}

.inventario-dia-ganancia-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.inventario-dia-ganancia-valor {
    display: block;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a365d;
}

.inventario-dia-ganancia-item.inventario-dia-col-fact {
    border-color: #90cdf4;
    background: #eef6ff;
}

.tabla-erp th.inventario-dia-col-ingreso,
.tabla-erp td.inventario-dia-col-ingreso {
    background: #f0fff4;
}

.inventario-dia-badge-apertura {
    display: inline-block;
    margin-left: auto;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a365d;
    background: #bee3f8;
    border-radius: 999px;
}

.inventario-dia-badge-ingreso-neto {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #744210;
    background: #fefcbf;
    border-radius: 4px;
    vertical-align: middle;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .inventario-dia-badge-apertura {
        margin-left: 0;
        margin-top: 0.35rem;
    }

    .inventario-dia-badge-ingreso-neto {
        display: block;
        margin-left: 0;
        margin-top: 0.25rem;
        width: fit-content;
        margin-inline-start: auto;
    }

    .inventario-dia-btn-desglose {
        display: block;
        margin-top: 0.25rem;
        margin-inline-start: auto;
    }
}

.inventario-dia-btn-desglose-icon {
    font-size: 1.1rem;
    vertical-align: middle;
}

.inventario-dia-desglose-resumen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.inventario-dia-desglose-item {
    flex: 1 1 9rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}

.inventario-dia-desglose-item.inventario-dia-desglose-total {
    border-color: #90cdf4;
    background: #eef6ff;
}

.inventario-dia-desglose-label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.inventario-dia-desglose-valor {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #1a365d;
}

.inventario-dia-tabla-movimientos {
    font-size: 0.9rem;
}

.inventario-dia-modal-producto {
    font-weight: 600;
    color: #1a365d;
}

/* Clase para ocultar totales con descuento por divisas */
.facturacion-totales-descuento-oculto {
    display: none !important;
}

/* Ficha subtotal restante por cobrar (pagos múltiples) */
.ficha-restante-icon {
    font-size: 1rem;
}

.ficha-restante-icon-sm {
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Responsive para totales en monedas */
@media (max-width: 768px) {
    .facturacion-totales-row {
        flex-wrap: wrap;
    }

    .facturacion-totales-monedas-item {
        margin-bottom: 0.5rem;
    }
    
    .facturacion-totales-monedas-value {
        font-size: 1rem;
    }
}

.facturacion-metodos-pago .form-check {
    margin-bottom: 6px;
}

.facturacion-caja-pos-hint {
    margin-top: 4px;
    margin-bottom: 0;
    color: #6c757d;
    font-size: 0.85rem;
}

.facturacion-caja-pos-alerta {
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .facturacion-caja-pos-hint,
    .facturacion-caja-pos-alerta {
        width: 100%;
    }
}

/* Contenedor para los tres campos de cliente */
.facturacion-campos-cliente-container {
    width: 100%;
}

/* Wrapper para input y sugerencias */
.facturacion-input-wrapper {
    position: relative;
    width: 100%;
}

/* Contenedor de sugerencias - posición absoluta para no afectar layout */
.facturacion-sugerencias-container {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.facturacion-sugerencias-container:not(:empty) {
    display: block;
}

.facturacion-sugerencias-list {
    margin: 0;
    padding: 0;
}

.facturacion-sugerencias-list .list-group-item {
    cursor: pointer;
    border: none;
    border-bottom: 1px solid #f1f3f5;
}

.facturacion-sugerencias-list .list-group-item:last-child {
    border-bottom: none;
}

.facturacion-sugerencias-list .list-group-item:hover {
    background-color: #f1f3f5;
}

.facturacion-sugerencia-precios-unidad {
    min-width: 6.5rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}

.facturacion-sugerencia-precios-etiqueta {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

.facturacion-sugerencia-precio-linea {
    font-size: 0.8rem;
}

.facturacion-sugerencia-precio-facturacion {
    font-weight: 600;
    font-size: 0.85rem;
    color: #212529;
}

.facturacion-sugerencia-moneda {
    display: inline-block;
    min-width: 2.1rem;
    text-align: left;
}

/* Asegurar que los campos mantengan su tamaño fijo y no se distorsionen */
.facturacion-cliente-col {
    display: flex;
    flex-direction: column;
}

.facturacion-cliente-col > label {
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.facturacion-cliente-col .form-control,
.facturacion-cliente-col .input-group {
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.facturacion-input-wrapper {
    width: 100%;
    flex-shrink: 0;
}

.facturacion-input-wrapper .input-group {
    width: 100%;
}

#clienteNombreDisplay {
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
}

/* Campo de fecha con ancho reducido */
.facturacion-fecha-col {
    max-width: 100%;
}

#fechaEmisionDisplay {
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    max-width: 180px;
}

.facturacion-cliente-col > .form-text {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

/* Asegurar que el input-group tenga el botón integrado correctamente */
.facturacion-cliente-col .input-group .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.facturacion-cliente-col .input-group .btn {
    flex-shrink: 0;
}

/* Estilos para campo de búsqueda de productos */
.facturacion-panel .row.g-2 .col-12.col-lg-6 .input-group {
    width: 100%;
    box-sizing: border-box;
}

.facturacion-panel .row.g-2 .col-12.col-lg-6 .input-group .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.facturacion-panel .row.g-2 .col-12.col-lg-6 .input-group .btn {
    flex-shrink: 0;
}

/* Asegurar que la tabla esté correctamente posicionada */
.facturacion-panel .facturacion-table-wrapper,
.facturacion-panel .facturacion-pos-items-table-wrapper {
    margin-top: 0;
    clear: both;
}

/* Estilos para producto duplicado */
.facturacion-item-duplicado {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107 !important;
    animation: facturacion-resaltar 0.5s ease-in-out;
}

/* Fila con cantidad incrementada por producto repetido (rojo tenue) */
.facturacion-pos-items-table-wrapper .facturacion-items-table tbody tr.facturacion-item-cantidad-incrementada td {
    background-color: #ffebee !important;
}
.facturacion-pos-items-table-wrapper .facturacion-items-table tbody tr.facturacion-item-cantidad-incrementada {
    background-color: #ffebee !important;
}

@keyframes facturacion-resaltar {
    0% {
        background-color: #fff3cd;
    }
    50% {
        background-color: #ffc107;
    }
    100% {
        background-color: #fff3cd;
    }
}

/* Mensaje de producto duplicado */
.facturacion-mensaje-duplicado {
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    border-left: 4px solid #ffc107;
}

/* Estilos para componente de tasa USD del día */
.tasa-dia-card-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.tasa-dia-item {
    display: flex;
    align-items: flex-start;
    min-width: 0;
}

.tasa-usd-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 16px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.tasa-usd-icon .material-icons {
    font-size: 28px;
    color: #fff;
}

.tasa-usd-info {
    flex: 1;
    min-width: 0;
}

.tasa-usd-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 4px;
}

.tasa-usd-value {
    font-size: 1.05rem;
    color: #212529;
    word-break: break-word;
}

.tasa-usd-value strong {
    font-weight: 700;
}

.tasa-usd-fecha {
    font-size: 0.8rem;
    color: #868e96;
    margin-top: 2px;
}

.tasa-fuente-wrap {
    margin-top: 0.4rem;
}

.tasa-fuente-badge {
    display: inline-block;
    max-width: 100%;
    padding: 0.2rem 0.55rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.tasa-fuente-api {
    color: #0b3d91;
    background: #e8f1fc;
    border-color: #b6d0f2;
}

.tasa-fuente-propia {
    color: #0f5132;
    background: #d1e7dd;
    border-color: #a3cfbb;
}

.tasa-fuente-contingencia {
    color: #664d03;
    background: #fff3cd;
    border-color: #ffecb5;
}

.tasa-fuente-otra {
    color: #41464b;
    background: #e9ecef;
    border-color: #ced4da;
}

.tasa-fuente-leyenda {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
    color: #6c757d;
}

.tasa-usd-badge {
    display: inline-flex;
}

.tasa-usd-badge .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tasa-usd-badge .material-icons {
    font-size: 16px;
}

/* Aclaratoria COP/VES (dashboard admin) */
.cop-per-ves-help {
    border: 1px solid #cfe2ff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.08);
    overflow: hidden;
}

.cop-per-ves-help-header {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, #e7f1ff 0%, #f0f7ff 55%, #ffffff 100%);
    border-bottom: 1px solid #cfe2ff;
}

.cop-per-ves-help-header-icon {
    color: #0d6efd;
    font-size: 1.75rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.cop-per-ves-help-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #084298;
    margin: 0 0 0.35rem;
}

.cop-per-ves-help-lead {
    font-size: 0.9rem;
    color: #345;
    line-height: 1.45;
}

.cop-per-ves-pill {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}

.cop-per-ves-pill--ok {
    background: #d1e7dd;
    color: #0f5132;
}

.cop-per-ves-help-card {
    height: 100%;
    border-radius: 0.65rem;
    padding: 1rem;
    border: 1px solid transparent;
}

.cop-per-ves-help-card--ok {
    background: linear-gradient(180deg, #edf8f1 0%, #f7fcf9 100%);
    border-color: #a3cfbb;
}

.cop-per-ves-help-card--warn {
    background: linear-gradient(180deg, #fff6e8 0%, #fffbf3 100%);
    border-color: #ffc107;
}

.cop-per-ves-help-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.55rem;
}

.cop-per-ves-help-card--ok .cop-per-ves-help-card-badge {
    color: #0f5132;
}

.cop-per-ves-help-card--warn .cop-per-ves-help-card-badge {
    color: #997404;
}

.cop-per-ves-help-card-badge .material-icons {
    font-size: 1rem;
}

.cop-per-ves-help-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.cop-per-ves-help-card--ok .cop-per-ves-help-card-title {
    color: #146c43;
}

.cop-per-ves-help-card--warn .cop-per-ves-help-card-title {
    color: #997404;
}

.cop-per-ves-help-card-def {
    font-size: 0.88rem;
    color: #444;
    margin-bottom: 0.65rem;
}

.cop-per-ves-help-list {
    margin: 0 0 0.85rem;
    padding-left: 1.1rem;
    font-size: 0.86rem;
    color: #333;
}

.cop-per-ves-help-list li + li {
    margin-top: 0.25rem;
}

.cop-per-ves-help-example {
    border-radius: 0.5rem;
    padding: 0.7rem 0.8rem;
    background: #ffffff;
    border: 1px dashed #75b798;
    font-size: 0.84rem;
    color: #1b4332;
}

.cop-per-ves-help-example--warn {
    border-color: #ffcd39;
    color: #664d03;
    background: #fffdf5;
}

.cop-per-ves-help-example-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
    opacity: 0.85;
}

.cop-per-ves-help-example code,
.cop-per-ves-help-list code,
.cop-per-ves-help-lead code {
    font-size: 0.82em;
}

.cop-per-ves-help-live {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.55rem;
    background: linear-gradient(90deg, #cff4fc 0%, #e8f9fd 100%);
    border: 1px solid #9eeaf9;
    color: #055160;
    font-size: 0.9rem;
}

.cop-per-ves-help-live .material-icons {
    color: #0dcaf0;
    font-size: 1.25rem;
    line-height: 1.2;
}

@media (max-width: 767.98px) {
    .cop-per-ves-help-header {
        padding: 0.85rem 0.95rem;
    }

    .cop-per-ves-help-title {
        font-size: 0.98rem;
    }
}

/* Responsive para tasa USD / fuente publicada */
@media (max-width: 768px) {
    .tasa-dia-col {
        margin-bottom: 1rem;
    }

    .tasa-usd-icon {
        width: 48px;
        height: 48px;
        margin-right: 12px;
    }

    .tasa-usd-icon .material-icons {
        font-size: 24px;
    }

    .tasa-usd-value {
        font-size: 1rem;
    }

    .tasa-usd-value strong {
        font-size: 1.1rem;
    }

    .tasa-fuente-leyenda {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .tasa-usd-icon {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }

    .tasa-usd-icon .material-icons {
        font-size: 20px;
    }

    .tasa-usd-label {
        font-size: 0.85rem;
    }

    .tasa-usd-value {
        font-size: 0.95rem;
    }

    .tasa-usd-value strong {
        font-size: 1.05rem;
    }

    .tasa-usd-fecha {
        font-size: 0.75rem;
    }

    .tasa-fuente-badge {
        font-size: 0.7rem;
        white-space: normal;
    }
}

/* Estilos para Preview Carga Masiva de Productos */
.preview-carga-wrapper {
    margin-top: 20px;
}

.preview-alert {
    margin-bottom: 20px;
}

.preview-alert-icon {
    vertical-align: middle;
}

.preview-table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.preview-table {
    width: max-content;
    min-width: 100%;
}

.preview-errores-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9em;
}

.guardar-fila-icon {
    font-size: 18px;
}

.preview-pagination-wrapper {
    margin-top: 20px;
}

.preview-form-container {
    margin-top: 20px;
}

.preview-info-icon {
    font-size: 16px;
    vertical-align: middle;
}

.preview-form-actions {
    margin-top: 30px;
}

.preview-actions-text {
    font-size: 0.9em;
}

/* Estilos para Listar Borradores */
.borrador-action-icon {
    font-size: 18px;
}

/* Estilos para Previsualización de Factura */
.facturacion-preview-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
}

.facturacion-preview-header {
    margin-bottom: 30px;
}

.facturacion-preview-document {
    background: white;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.facturacion-preview-encabezado {
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.facturacion-preview-encabezado-spacer {
    min-height: 4.75rem;
}

.facturacion-preview-empresa-nombre {
    font-size: 1.417rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 10px;
}

.facturacion-preview-empresa-comercial {
    font-size: 1.017rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.facturacion-preview-empresa-info {
    font-size: 0.817rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.facturacion-preview-documento-titulo {
    font-size: 1.917rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 15px;
}

.facturacion-preview-documento-info {
    font-size: 0.867rem;
    color: #495057;
    margin-bottom: 5px;
}

.facturacion-preview-cliente {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.facturacion-preview-seccion-titulo {
    font-size: 1.017rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.facturacion-preview-cliente-info {
    font-size: 0.867rem;
    color: #495057;
    margin-bottom: 8px;
}

.facturacion-preview-detalle {
    margin-bottom: 30px;
}

.facturacion-preview-table {
    width: 100%;
    border-collapse: collapse;
}

.facturacion-preview-table thead {
    background: #f8f9fa;
}

.facturacion-preview-table th {
    padding: 12px 8px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.817rem;
}

.facturacion-preview-table td {
    padding: 4px 8px;
    border-bottom: none;
    font-size: 0.817rem;
    line-height: 1.3;
}

.facturacion-preview-table tbody tr:hover {
    background: #f8f9fa;
}

.facturacion-preview-col-item {
    width: 4%;
}

.facturacion-preview-col-producto {
    width: 30%;
}

.facturacion-preview-col-cantidad {
    width: 9%;
}

.facturacion-preview-col-precio {
    width: 11%;
}

.facturacion-preview-col-descuento {
    width: 11%;
}

.facturacion-preview-col-iva {
    width: 7%;
}

.facturacion-preview-col-monto-iva {
    width: 10%;
}

.facturacion-preview-col-total {
    width: 18%;
}

.facturacion-preview-producto-nombre {
    font-weight: 500;
    color: #212529;
    margin-bottom: 4px;
}

.facturacion-preview-producto-codigo {
    font-size: 0.767rem;
    color: #6c757d;
}

.facturacion-preview-totales {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

.facturacion-preview-observaciones {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.facturacion-preview-observaciones-texto {
    font-size: 0.817rem;
    color: #495057;
    margin: 0;
    white-space: pre-wrap;
}

.facturacion-preview-totales-box {
    background: #f8f9fa;
    padding: 24px 32px;
    border-radius: 8px;
    margin-left: auto;
    max-width: 540px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.facturacion-preview-totales-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.867rem;
    color: #495057;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.facturacion-preview-totales-total {
    border-top: 2px solid #dee2e6;
    margin-top: 6px;
    padding-top: 6px;
    font-size: 1.017rem;
    color: #212529;
}

.facturacion-preview-totales-divider {
    border-top: 1px solid #dee2e6;
    margin: 4px 0;
}

.facturacion-preview-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.facturacion-preview-footer-nota {
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #ffc107;
}

/* Estilos para impresión */
@media print {
    .facturacion-preview-container {
        padding: 0;
        background: white;
    }
    
    .facturacion-preview-header {
        display: none;
    }
    
    .facturacion-preview-document {
        box-shadow: none;
        padding: 20px;
    }
    
    .facturacion-preview-table tbody tr {
        page-break-inside: avoid;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .facturacion-preview-document {
        padding: 20px;
    }
    
    .facturacion-preview-encabezado .row {
        flex-direction: column;
    }
    
    .facturacion-preview-encabezado .col-md-6.text-end {
        text-align: left !important;
        margin-top: 20px;
    }
    
    .facturacion-preview-table {
        font-size: 0.767rem;
    }
    
    .facturacion-preview-table th,
    .facturacion-preview-table td {
        padding: 8px 4px;
    }
    
    .facturacion-preview-totales-box {
        max-width: 100%;
        margin-left: 0;
    }
}

/* Estilo para texto informativo de descuentos */
.descuento-info-text {
    font-size: 0.75rem;
    margin-top: 4px;
    color: #6c757d;
    line-height: 1.2;
}

/* Estilo para header de lista completa de productos */
.facturacion-sugerencia-header-list {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cerrar-lista-btn {
    float: right;
}

.cerrar-lista-icon {
    font-size: 18px;
}

/* ========== ADMIN — CATEGORÍAS DE PRODUCTOS (pestañas) ========== */

.categorias-tabs .nav-link,
.carga-masiva-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.categorias-tab-icon,
.carga-masiva-tab-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.carga-masiva-tab-content {
    padding-top: 1rem;
}

.categorias-guia-tabla {
    font-size: 0.875rem;
}

.categorias-guia-checklist {
    list-style: none;
    padding-left: 0;
}

.categorias-guia-checklist li {
    position: relative;
    padding-left: 1.5rem;
}

.categorias-guia-checklist li::before {
    content: "check_circle";
    font-family: "Material Icons";
    font-size: 1rem;
    line-height: 1;
    position: absolute;
    left: 0;
    top: 0.15rem;
    color: var(--color-primary, #0d6efd);
}

/* ========== FACTURACIÓN - TABS Y FORMULARIO NUEVO CLIENTE ========== */

.facturacion-tabs {
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.facturacion-tab-content {
    padding-top: 1rem;
}

.facturacion-form-nuevo-cliente .row.g-3 {
    margin-bottom: 0;
}

.facturacion-form-nuevo-cliente .form-control,
.facturacion-form-nuevo-cliente .form-select {
    width: 100%;
}

.facturacion-tab-nuevo-cliente-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

@media (max-width: 576px) {
    .facturacion-tabs .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .facturacion-tabs .nav-tabs .nav-link {
        white-space: nowrap;
    }

    .facturacion-form-nuevo-cliente .form-control,
    .facturacion-form-nuevo-cliente .form-select {
        padding: 0.5rem 0.75rem;
        min-height: 44px;
    }
}

/* Estilos para tabla de detalle de factura - columnas compactas */
/* Desactivar scroll horizontal para esta tabla específica */
.detalle-factura-wrapper {
    overflow-x: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Asegurar que el contenedor padre no cause desbordamiento */
.licencias-list-container .detalle-factura-wrapper {
    width: calc(100% - 0px) !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Forzar layout fijo para que los anchos porcentuales funcionen */
.detalle-factura-table {
    table-layout: fixed !important;
    width: 100% !important;
    font-size: 0.8rem !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}

/* Sobrescribir min-width de licencias-table para esta tabla específica */
.detalle-factura-wrapper .detalle-factura-table,
.licencias-table-wrapper.detalle-factura-wrapper .detalle-factura-table,
.detalle-factura-wrapper .licencias-table.detalle-factura-table {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Reducir padding en celdas para hacer más compacta */
.detalle-factura-table thead th,
.detalle-factura-table tbody td {
    padding: 5px 3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.75rem !important;
}

/* Permitir wrap solo en columna de producto */
.detalle-factura-table thead th:nth-child(1),
.detalle-factura-table tbody td:nth-child(1) {
    white-space: normal !important;
    word-wrap: break-word !important;
    font-size: 0.75rem !important;
}

/* Estilos para precios con descuento - más compactos */
.detalle-factura-table .text-decoration-line-through {
    font-size: 0.65rem !important;
    line-height: 1.1 !important;
}

.detalle-factura-table .text-success {
    font-size: 0.75rem !important;
    line-height: 1.1 !important;
}

/* Estilos para descuentos - más compactos */
.detalle-factura-table tbody td .small {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
}

/* Sobrescribir estilos nth-child para esta tabla específica */
.detalle-factura-table thead th:nth-child(1),
.detalle-factura-table tbody td:nth-child(1) {
    width: 33.5% !important;
    min-width: auto !important;
    max-width: none !important;
    padding-left: 12px !important;
}

.detalle-factura-table thead th:nth-child(2),
.detalle-factura-table tbody td:nth-child(2) {
    width: 7.5% !important;
    min-width: auto !important;
    max-width: none !important;
}

.detalle-factura-table thead th:nth-child(3),
.detalle-factura-table tbody td:nth-child(3) {
    width: 13.5% !important;
    min-width: auto !important;
    max-width: none !important;
}

.detalle-factura-table thead th:nth-child(4),
.detalle-factura-table tbody td:nth-child(4) {
    width: 13.5% !important;
    min-width: auto !important;
    max-width: none !important;
}

.detalle-factura-table thead th:nth-child(5),
.detalle-factura-table tbody td:nth-child(5) {
    width: 16.4% !important;
    min-width: auto !important;
    max-width: none !important;
}

.detalle-factura-table thead th:nth-child(6),
.detalle-factura-table tbody td:nth-child(6) {
    width: 15.6% !important;
    min-width: auto !important;
    max-width: none !important;
    padding-right: 12px !important;
}

/* Clases específicas como respaldo */
.detalle-factura-table .detalle-factura-col-producto {
    width: 33.5% !important;
}

.detalle-factura-table .detalle-factura-col-cantidad {
    width: 7.5% !important;
}

.detalle-factura-table .detalle-factura-col-precio {
    width: 13.5% !important;
}

.detalle-factura-table .detalle-factura-col-descuentos {
    width: 13.5% !important;
}

.detalle-factura-table .detalle-factura-col-iva {
    width: 16.4% !important;
}

.detalle-factura-table .detalle-factura-col-total {
    width: 15.6% !important;
}

/* Responsive: en pantallas pequeñas, hacer tabla scrollable verticalmente */
@media (max-width: 768px) {
    .detalle-factura-wrapper {
        overflow-x: auto !important;
    }
    
    .detalle-factura-table {
        min-width: 600px;
    }
}

/* Tabla Listar Paneles - columna dashboard URL */
.panel-dashboard-url {
    font-size: 0.85rem;
}

/* Tabla Configurar Permisos (PermisosRolEmpresaView) - sin scroll horizontal */
.permisos-rol-table-wrapper {
    overflow-x: visible;
}

.licencias-table.permisos-rol-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.permisos-rol-table .permisos-col-recurso,
.permisos-rol-table th.permisos-col-recurso,
.permisos-rol-table td:nth-child(1) {
    width: 22%;
    min-width: 0;
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.permisos-rol-table .permisos-col-descripcion,
.permisos-rol-table th.permisos-col-descripcion,
.permisos-rol-table td:nth-child(2) {
    width: 42%;
    min-width: 0;
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.permisos-rol-table .permisos-col-check,
.permisos-rol-table th.permisos-col-check,
.permisos-rol-table td:nth-child(3),
.permisos-rol-table td:nth-child(4) {
    width: 18%;
    min-width: 0;
    max-width: none;
}

@media (max-width: 768px) {
    .permisos-rol-table .permisos-col-recurso,
    .permisos-rol-table td:nth-child(1) {
        width: 28%;
    }

    .permisos-rol-table .permisos-col-descripcion,
    .permisos-rol-table td:nth-child(2) {
        width: 32%;
    }

    .permisos-rol-table .permisos-col-check,
    .permisos-rol-table td:nth-child(3),
    .permisos-rol-table td:nth-child(4) {
        width: 20%;
    }
}

/* Iconos en badges de permisos (PermisosUsuarioEmpresaView) */
.permisos-badge-icon {
    font-size: 1rem;
    vertical-align: middle;
}

/* ========== TABLAS ERP - ESTRUCTURA BASE (Fase 1) ========== */

/* Contenedor estándar para tablas con scroll horizontal */
/* Alias: .licencias-table-wrapper comparte estilos durante la migración */
.tabla-erp-wrapper,
.licencias-table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    border: 1px solid #e9ecef;
}

/* Scrollbar personalizado para wrappers de tabla */
.tabla-erp-wrapper::-webkit-scrollbar,
.licencias-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.tabla-erp-wrapper::-webkit-scrollbar-track,
.licencias-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tabla-erp-wrapper::-webkit-scrollbar-thumb,
.licencias-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.tabla-erp-wrapper::-webkit-scrollbar-thumb:hover,
.licencias-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/*
 * Encabezado fijo (sticky) — solo wrappers con >7 filas (.tabla-erp-sticky-head).
 * Scroll vertical interno al wrapper (top: 0) para no tapar filas bajo .su-header.
 *
 * La tabla puede ser hija directa o estar bajo .table-responsive. Bootstrap aplica
 * overflow-x:auto en .table-responsive; eso crea un scrollport intermedio y, según
 * MDN (position:sticky), el thead deja de fijarse al wrapper. Se neutraliza el
 * overflow del anidado para que el único scrollport sea el wrapper.
 */
.tabla-erp-wrapper.tabla-erp-sticky-head,
.licencias-table-wrapper.tabla-erp-sticky-head {
    max-height: min(70vh, 640px);
    overflow-x: auto;
    overflow-y: auto;
}

.tabla-erp-wrapper.tabla-erp-sticky-head > .table-responsive,
.licencias-table-wrapper.tabla-erp-sticky-head > .table-responsive {
    overflow: visible;
    max-height: none;
}

.tabla-erp-wrapper.tabla-erp-sticky-head table.tabla-erp,
.tabla-erp-wrapper.tabla-erp-sticky-head table.licencias-table,
.licencias-table-wrapper.tabla-erp-sticky-head table.tabla-erp,
.licencias-table-wrapper.tabla-erp-sticky-head table.licencias-table {
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-erp-wrapper.tabla-erp-sticky-head table.tabla-erp > thead > tr > th,
.tabla-erp-wrapper.tabla-erp-sticky-head table.licencias-table > thead > tr > th,
.licencias-table-wrapper.tabla-erp-sticky-head table.tabla-erp > thead > tr > th,
.licencias-table-wrapper.tabla-erp-sticky-head table.licencias-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    background-clip: padding-box;
    box-shadow: 0 1px 0 #dee2e6;
}

/* Clase base para tablas ERP (estilos comunes) */
/* Alias: .licencias-table hereda estilos base durante la migración */
.tabla-erp,
.licencias-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.tabla-erp {
    table-layout: auto;
}

.tabla-erp thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cabeceras ordenables — listados ERP (Fase 0) */
.tabla-erp-th-sortable {
    padding: 0;
    vertical-align: middle;
}

.tabla-erp-th-static {
    cursor: default;
}

.tabla-erp-sort-link {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 48px;
    padding: 16px 20px;
    color: inherit;
    text-decoration: none;
    text-transform: inherit;
    letter-spacing: inherit;
    font-weight: inherit;
    font-size: inherit;
}

.tabla-erp-sort-link:hover,
.tabla-erp-sort-link:focus-visible {
    color: var(--color-primary, #0d6efd);
    text-decoration: none;
    outline: 2px solid var(--color-primary, #0d6efd);
    outline-offset: -2px;
}

.tabla-erp-sort-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabla-erp-sort-icon {
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1;
    opacity: 0.45;
}

.tabla-erp-th-sorted .tabla-erp-sort-icon {
    opacity: 1;
    color: var(--color-primary, #0d6efd);
}

.tabla-erp tbody td,
.licencias-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.tabla-erp tbody tr:hover,
.licencias-table tbody tr:hover {
    background-color: #f8f9fa;
}

/*
 * ERP list rows — hide decorative tbody icons (igual que Productos).
 * Opt-out: data-erp-row-icons="keep" | .facturacion-container | POS wrappers.
 * :where() en opt-out evita que :not() gane en especificidad al restore.
 */
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-empresa-logo-placeholder,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-empresa-logo-placeholder,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-empresa-logo-placeholder {
    display: none !important;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .material-icons,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .material-icons {
    display: none !important;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-actions-cell .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .btn-action .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .form-inline-action .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .fv-crud-actions .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .tabla-erp-col-acciones .material-icons,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-actions-cell .material-icons,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .btn-action .material-icons,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .form-inline-action .material-icons,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .fv-crud-actions .material-icons,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .tabla-erp-col-acciones .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-actions-cell .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .btn-action .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .form-inline-action .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .fv-crud-actions .material-icons,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .tabla-erp-col-acciones .material-icons {
    display: inline-flex !important;
}

.facturacion-container .tabla-erp-wrapper .tabla-erp tbody .licencia-empresa-logo-placeholder,
.facturacion-container .tabla-erp-wrapper .licencias-table tbody .licencia-empresa-logo-placeholder,
.facturacion-pos-items-table-wrapper .tabla-erp tbody .licencia-empresa-logo-placeholder,
.tabla-erp-wrapper[data-erp-row-icons="keep"] .tabla-erp tbody .licencia-empresa-logo-placeholder,
.tabla-erp-wrapper[data-erp-row-icons="keep"] .licencias-table tbody .licencia-empresa-logo-placeholder,
.licencias-table-wrapper[data-erp-row-icons="keep"] .licencias-table tbody .licencia-empresa-logo-placeholder,
.licencias-table-wrapper[data-erp-row-icons="keep"] .tabla-erp tbody .licencia-empresa-logo-placeholder {
    display: flex !important;
}

.facturacion-container .tabla-erp-wrapper .tabla-erp tbody .material-icons,
.facturacion-container .tabla-erp-wrapper .licencias-table tbody .material-icons,
.facturacion-pos-items-table-wrapper .tabla-erp tbody .material-icons,
table.facturacion-items-table tbody .material-icons,
.tabla-erp-wrapper[data-erp-row-icons="keep"] .tabla-erp tbody .material-icons,
.tabla-erp-wrapper[data-erp-row-icons="keep"] .licencias-table tbody .material-icons,
.licencias-table-wrapper[data-erp-row-icons="keep"] .licencias-table tbody .material-icons,
.licencias-table-wrapper[data-erp-row-icons="keep"] .tabla-erp tbody .material-icons {
    display: inline-flex !important;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody td:not(.tabla-erp-col-acciones):not(.tabla-erp-col-edicion):not(.mayoreo-comision-col-sel):not(:has(> .licencia-actions-cell)):not(:has(> .fv-crud-actions)),
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody td:not(.tabla-erp-col-acciones):not(.tabla-erp-col-edicion):not(.mayoreo-comision-col-sel):not(:has(> .licencia-actions-cell)):not(:has(> .fv-crud-actions)),
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody td:not(.tabla-erp-col-acciones):not(.tabla-erp-col-edicion):not(.mayoreo-comision-col-sel):not(:has(> .licencia-actions-cell)):not(:has(> .fv-crud-actions)) {
    padding: 10px 12px;
    overflow: hidden;
    font-size: 0.8rem;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-empresa-cell,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-empresa-cell,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-empresa-cell {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    gap: 0;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-empresa-info,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-empresa-info,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-empresa-info {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-empresa-name-primary,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-empresa-name-secondary,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .tabla-erp-cell-text,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-empresa-name-primary,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-empresa-name-secondary,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .tabla-erp-cell-text,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-empresa-name-primary,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-empresa-name-secondary,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .tabla-erp-cell-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    line-height: 1.35;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-empresa-name-primary,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-empresa-name-primary,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-empresa-name-primary {
    font-weight: 600;
    font-size: 0.82rem;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-date-cell,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-date-cell,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-date-cell {
    display: block;
    gap: 0;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-status-cell,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-status-cell,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-status-cell {
    white-space: normal;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody .licencia-status-cell .status-badge,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody .licencia-status-cell .status-badge,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .licencias-table tbody .licencia-status-cell .status-badge {
    max-width: 100%;
    font-size: 0.72rem;
    padding: 2px 8px;
}

.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody td.tabla-erp-col-acciones,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody td.tabla-erp-col-edicion,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody td.mayoreo-comision-col-sel,
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody td:has(> .licencia-actions-cell),
.tabla-erp-wrapper:where(:not([data-erp-row-icons="keep"])):where(:not(.facturacion-pos-items-table-wrapper)) .tabla-erp tbody td:has(> .fv-crud-actions),
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody td.tabla-erp-col-acciones,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody td.tabla-erp-col-edicion,
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody td:has(> .licencia-actions-cell),
.licencias-table-wrapper:where(:not([data-erp-row-icons="keep"])) .licencias-table tbody td:has(> .fv-crud-actions) {
    overflow: visible;
    font-size: inherit;
}

/* ========== VARIANTES DE TABLA - FASE 2 ========== */
/*
 * Estrategia de anchos (plan):
 * - Texto largo (nombre, descripción, email): min-width: 180px; max-width: 280px;
 * - Código/RIF: min-width: 100px; max-width: 140px;
 * - Numéricas: min-width: 90px; max-width: 120px; text-align: right;
 * - Fecha: min-width: 110px; max-width: 130px;
 * - Estado/badge: min-width: 100px; max-width: 140px;
 * - Acciones: min-width: 132px; sin max-width; text-align: center;
 *
 * min-width por variante (plan 2.3):
 * - ≤6 columnas: 700px | 7-8 columnas: 900px | 9-10 columnas: 1100px | 10+ (preview): 1400px
 */

/* --- Productos (checkbox opcional + columnas semánticas; cabecera 1 línea) --- */
.tabla-productos {
    min-width: 1320px;
    table-layout: fixed;
    width: 100%;
}

.tabla-productos thead th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1.25;
    vertical-align: middle;
    padding: 10px 6px;
    word-break: normal;
    overflow-wrap: normal;
}

.tabla-productos thead .tabla-erp-sort-link {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 2.75rem;
    padding: 8px 6px;
    gap: 2px;
    white-space: nowrap;
}

.tabla-productos thead th.text-end .tabla-erp-sort-link,
.tabla-productos thead th.col-prod-venta .tabla-erp-sort-link,
.tabla-productos thead th.col-prod-stock .tabla-erp-sort-link,
.tabla-productos thead th.col-prod-costo .tabla-erp-sort-link,
.tabla-productos thead th.col-prod-costo-fact .tabla-erp-sort-link {
    justify-content: flex-end;
}

.tabla-productos thead th.text-center .tabla-erp-sort-link,
.tabla-productos thead th.col-prod-unidad .tabla-erp-sort-link,
.tabla-productos thead th.col-prod-acciones .tabla-erp-sort-link {
    justify-content: center;
}

.tabla-productos thead .tabla-erp-sort-label {
    flex: 0 1 auto;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.tabla-productos thead .tabla-erp-th-static {
    white-space: nowrap;
}

.tabla-productos .producto-cb-col-sel {
    width: 44px;
    min-width: 44px;
    max-width: 48px;
    padding-left: 6px;
    padding-right: 6px;
}

.tabla-productos .col-prod-codigo {
    width: 9%;
    min-width: 96px;
}

.tabla-productos .col-prod-nombre {
    width: 16%;
    min-width: 140px;
}

.tabla-productos .col-prod-marca {
    width: 8%;
    min-width: 72px;
}

.tabla-productos .col-prod-categoria {
    width: 10%;
    min-width: 96px;
}

.tabla-productos .col-prod-unidad {
    width: 5%;
    min-width: 56px;
}

.tabla-productos .col-prod-venta,
.tabla-productos .col-prod-stock,
.tabla-productos .col-prod-costo,
.tabla-productos .col-prod-costo-fact {
    width: 10%;
    min-width: 108px;
}

.tabla-productos .col-prod-acciones {
    width: 8%;
    min-width: 118px;
}

.tabla-productos tbody td {
    padding: 10px 8px;
    overflow: hidden;
    vertical-align: middle;
    font-size: 0.8rem;
}

.tabla-productos .licencia-empresa-cell {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.tabla-productos .licencia-empresa-info {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.tabla-productos .licencia-empresa-name-primary,
.tabla-productos .licencia-empresa-name-secondary,
.tabla-productos .tabla-productos-cell-text,
.tabla-productos .stock-value,
.tabla-productos .precio-value {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    line-height: 1.35;
}

.tabla-productos .precio-value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    overflow: visible;
    text-overflow: clip;
}

.tabla-productos .licencia-empresa-name-primary {
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0;
}

.tabla-productos .licencia-empresa-name-secondary {
    font-size: 0.72rem;
}

.tabla-productos .producto-stock-cell,
.tabla-productos .producto-precio-cell {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: normal;
}

.tabla-productos .licencia-actions-cell {
    justify-content: center;
    flex-wrap: nowrap;
}

/* --- Clientes (8 columnas) --- */
.tabla-clientes {
    min-width: 900px;
}

.tabla-clientes thead th:nth-child(1),
.tabla-clientes tbody td:nth-child(1) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-clientes thead th:nth-child(2),
.tabla-clientes tbody td:nth-child(2) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-clientes thead th:nth-child(3),
.tabla-clientes tbody td:nth-child(3),
.tabla-clientes thead th:nth-child(4),
.tabla-clientes tbody td:nth-child(4) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-clientes thead th:nth-child(5),
.tabla-clientes tbody td:nth-child(5) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-clientes thead th:nth-child(6),
.tabla-clientes tbody td:nth-child(6) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-clientes thead th:nth-child(7),
.tabla-clientes tbody td:nth-child(7) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-clientes thead th:nth-child(8),
.tabla-clientes tbody td:nth-child(8) {
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

/* --- Usuarios (7 columnas) --- */
.tabla-usuarios {
    min-width: 900px;
}

.tabla-usuarios thead th:nth-child(1),
.tabla-usuarios tbody td:nth-child(1) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-usuarios thead th:nth-child(2),
.tabla-usuarios tbody td:nth-child(2) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-usuarios thead th:nth-child(3),
.tabla-usuarios tbody td:nth-child(3) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-usuarios thead th:nth-child(4),
.tabla-usuarios tbody td:nth-child(4),
.tabla-usuarios thead th:nth-child(5),
.tabla-usuarios tbody td:nth-child(5) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-usuarios thead th:nth-child(6),
.tabla-usuarios tbody td:nth-child(6) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-usuarios thead th:nth-child(7),
.tabla-usuarios tbody td:nth-child(7) {
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

/* Tabla Roles: columna Paneles permite wrap de badges para evitar desbordamiento */
.tabla-roles tbody td:nth-child(4) .licencia-status-cell {
    flex-wrap: wrap;
    white-space: normal;
}

/* Asignar paneles a usuarios: evitar desborde de "Paneles actuales" sobre "Acciones" */
.tabla-usuarios-paneles thead th:nth-child(4),
.tabla-usuarios-paneles tbody td:nth-child(4) {
    min-width: 220px;
    max-width: 320px;
}

.tabla-usuarios-paneles tbody td:nth-child(4) .licencia-status-cell {
    flex-wrap: wrap;
    gap: 4px;
    white-space: normal;
}

.tabla-usuarios-paneles thead th:nth-child(5),
.tabla-usuarios-paneles tbody td:nth-child(5) {
    min-width: 170px;
    max-width: 190px;
    text-align: center;
}

/* --- Almacenes (9 columnas) --- */
.tabla-almacenes {
    min-width: 1100px;
}

.tabla-almacenes thead th:nth-child(1),
.tabla-almacenes tbody td:nth-child(1) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-almacenes thead th:nth-child(2),
.tabla-almacenes tbody td:nth-child(2) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-almacenes thead th:nth-child(3),
.tabla-almacenes tbody td:nth-child(3) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-almacenes thead th:nth-child(4),
.tabla-almacenes tbody td:nth-child(4) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-almacenes thead th:nth-child(5),
.tabla-almacenes tbody td:nth-child(5),
.tabla-almacenes thead th:nth-child(6),
.tabla-almacenes tbody td:nth-child(6),
.tabla-almacenes thead th:nth-child(7),
.tabla-almacenes tbody td:nth-child(7) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-almacenes thead th:nth-child(8),
.tabla-almacenes tbody td:nth-child(8) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-almacenes thead th:nth-child(9),
.tabla-almacenes tbody td:nth-child(9) {
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

/* --- Impuestos (6 columnas) --- */
.tabla-impuestos {
    min-width: 700px;
}

.tabla-impuestos thead th:nth-child(1),
.tabla-impuestos tbody td:nth-child(1) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-impuestos thead th:nth-child(2),
.tabla-impuestos tbody td:nth-child(2) {
    min-width: 90px;
    max-width: 120px;
    text-align: right;
}

.tabla-impuestos thead th:nth-child(3),
.tabla-impuestos tbody td:nth-child(3),
.tabla-impuestos thead th:nth-child(4),
.tabla-impuestos tbody td:nth-child(4) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-impuestos thead th:nth-child(5),
.tabla-impuestos tbody td:nth-child(5) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-impuestos thead th:nth-child(6),
.tabla-impuestos tbody td:nth-child(6) {
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

/* --- Categorías (6 columnas) --- */
.tabla-categorias {
    min-width: 700px;
}

.tabla-categorias thead th:nth-child(1),
.tabla-categorias tbody td:nth-child(1) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-categorias thead th:nth-child(2),
.tabla-categorias tbody td:nth-child(2) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-categorias thead th:nth-child(3),
.tabla-categorias tbody td:nth-child(3) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-categorias thead th:nth-child(4),
.tabla-categorias tbody td:nth-child(4) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-categorias thead th:nth-child(5),
.tabla-categorias tbody td:nth-child(5) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-categorias thead th:nth-child(6),
.tabla-categorias tbody td:nth-child(6) {
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

/* --- Unidades (6 columnas) --- */
.tabla-unidades {
    min-width: 700px;
}

.tabla-unidades thead th:nth-child(1),
.tabla-unidades tbody td:nth-child(1) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-unidades thead th:nth-child(2),
.tabla-unidades tbody td:nth-child(2) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-unidades thead th:nth-child(3),
.tabla-unidades tbody td:nth-child(3) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-unidades thead th:nth-child(4),
.tabla-unidades tbody td:nth-child(4) {
    min-width: 90px;
    max-width: 120px;
    text-align: right;
}

.tabla-unidades thead th:nth-child(5),
.tabla-unidades tbody td:nth-child(5) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-unidades thead th:nth-child(6),
.tabla-unidades tbody td:nth-child(6) {
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

/* --- Tasas cambio (7 columnas) --- */
.tabla-tasas {
    min-width: 900px;
}

.tabla-tasas thead th:nth-child(1),
.tabla-tasas tbody td:nth-child(1),
.tabla-tasas thead th:nth-child(2),
.tabla-tasas tbody td:nth-child(2) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-tasas thead th:nth-child(3),
.tabla-tasas tbody td:nth-child(3) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-tasas thead th:nth-child(4),
.tabla-tasas tbody td:nth-child(4) {
    min-width: 90px;
    max-width: 120px;
    text-align: right;
}

.tabla-tasas thead th:nth-child(5),
.tabla-tasas tbody td:nth-child(5) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-tasas thead th:nth-child(6),
.tabla-tasas tbody td:nth-child(6) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-tasas thead th:nth-child(7),
.tabla-tasas tbody td:nth-child(7) {
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

/* --- Facturas (7 columnas) --- */
.tabla-facturas {
    min-width: 900px;
}

.tabla-facturas thead th:nth-child(1),
.tabla-facturas tbody td:nth-child(1) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-facturas thead th:nth-child(2),
.tabla-facturas tbody td:nth-child(2) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-facturas thead th:nth-child(3),
.tabla-facturas tbody td:nth-child(3) {
    min-width: 110px;
    max-width: 130px;
}

.tabla-facturas thead th:nth-child(4),
.tabla-facturas tbody td:nth-child(4) {
    min-width: 90px;
    max-width: 120px;
    text-align: right;
}

.tabla-facturas thead th:nth-child(5),
.tabla-facturas tbody td:nth-child(5) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-facturas thead th:nth-child(6),
.tabla-facturas tbody td:nth-child(6) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-facturas thead th:nth-child(7),
.tabla-facturas tbody td:nth-child(7) {
    min-width: 140px;
    max-width: none;
    width: 1%;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
}

/* --- Borradores (6-7 columnas) --- */
.tabla-borradores {
    min-width: 900px;
}

/* --- Despachos (6-7 columnas) --- */
.tabla-despachos {
    min-width: 900px;
}

/* --- Módulos (6-7 columnas) --- */
.tabla-modulos {
    min-width: 900px;
}

/* --- Monedas (5-6 columnas) --- */
.tabla-monedas {
    min-width: 700px;
}

/* --- Planes (5-6 columnas) --- */
.tabla-planes {
    min-width: 700px;
}

/* --- Empresas (6-7 columnas) --- */
.tabla-empresas {
    min-width: 900px;
}

/* --- Licencias (10 columnas) --- */
.tabla-licencias {
    min-width: 1100px;
}

/* --- Descuentos producto (10 columnas) --- */
.tabla-descuentos-producto {
    min-width: 1100px;
}

/* --- Descuentos moneda (10 columnas) --- */
.tabla-descuentos-moneda {
    min-width: 1100px;
}

/* --- Ajuste stock (6 columnas) --- */
.tabla-ajuste-stock {
    min-width: 920px;
}

.tabla-ajuste-stock thead th:nth-child(1),
.tabla-ajuste-stock tbody td:nth-child(1) {
    min-width: 100px;
    max-width: 140px;
}

.tabla-ajuste-stock thead th:nth-child(2),
.tabla-ajuste-stock tbody td:nth-child(2) {
    min-width: 180px;
    max-width: 280px;
}

.tabla-ajuste-stock thead th:nth-child(3),
.tabla-ajuste-stock tbody td:nth-child(3) {
    min-width: 160px;
    max-width: 240px;
}

.tabla-ajuste-stock thead th:nth-child(4),
.tabla-ajuste-stock tbody td:nth-child(4),
.tabla-ajuste-stock thead th:nth-child(5),
.tabla-ajuste-stock tbody td:nth-child(5) {
    min-width: 110px;
    max-width: 140px;
    text-align: right;
}

.tabla-ajuste-stock thead th:nth-child(6),
.tabla-ajuste-stock tbody td:nth-child(6) {
    min-width: 140px;
    max-width: 200px;
}

/* --- Permisos (4 columnas) --- */
.tabla-permisos {
    min-width: 700px;
}

/* --- Cuentas por cobrar (11 columnas) --- */
.tabla-cuentas-cobrar {
    min-width: 1400px;
}

.tabla-cuentas-cobrar thead th:nth-child(6),
.tabla-cuentas-cobrar tbody td:nth-child(6),
.tabla-cuentas-cobrar thead th:nth-child(7),
.tabla-cuentas-cobrar tbody td:nth-child(7),
.tabla-cuentas-cobrar thead th:nth-child(8),
.tabla-cuentas-cobrar tbody td:nth-child(8) {
    text-align: right;
}

.tabla-cuentas-cobrar thead th:nth-child(11),
.tabla-cuentas-cobrar tbody td:nth-child(11) {
    min-width: 176px;
    max-width: none;
    width: 1%;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
}

/* --- Aplicar anticipo (5-6 columnas) --- */
.tabla-anticipo {
    min-width: 700px;
}

/* --- Detalle factura (7 columnas) --- */
.tabla-detalle-factura {
    min-width: 900px;
}

/* --- Preview carga masiva (columnas dinámicas, sin desfase thead/tbody) --- */
.preview-table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}

.tabla-preview-carga {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-preview-carga thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    vertical-align: middle;
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 10px;
}

.tabla-preview-carga tbody td {
    vertical-align: middle;
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
}

.tabla-preview-carga tbody tr.fila-preview:hover {
    filter: brightness(0.985);
}

.tabla-preview-carga .campo-editable {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    height: auto;
    min-height: 2rem;
}

.tabla-preview-carga textarea.campo-editable {
    min-height: 3.25rem;
    resize: vertical;
    white-space: pre-wrap;
    line-height: 1.35;
}

.tabla-preview-carga .preview-col-fila {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    font-variant-numeric: tabular-nums;
}

.tabla-preview-carga .preview-col-codigo {
    min-width: 5.5rem;
    max-width: 8.5rem;
}

.tabla-preview-carga .preview-col-categoria {
    min-width: 10rem;
    max-width: 16rem;
}

.tabla-preview-carga .preview-col-texto {
    min-width: 6.5rem;
    max-width: 11rem;
}

.tabla-preview-carga .preview-col-nombre {
    min-width: 9rem;
    max-width: 16rem;
}

.tabla-preview-carga .preview-col-desc {
    min-width: 10rem;
    max-width: 18rem;
}

.tabla-preview-carga .preview-col-numero {
    min-width: 5rem;
    max-width: 7.5rem;
}

.tabla-preview-carga .preview-col-numero .campo-editable {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tabla-preview-carga .preview-col-bool {
    min-width: 5.5rem;
    max-width: 9.5rem;
}

.tabla-preview-carga .preview-col-estado {
    min-width: 7rem;
    max-width: 10rem;
    white-space: nowrap;
}

.tabla-preview-carga .preview-col-obs {
    min-width: 11rem;
    max-width: 18rem;
    white-space: normal;
}

.tabla-preview-carga .preview-obs-box {
    max-height: 5.5rem;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.35;
}

.tabla-preview-carga .preview-obs-ok {
    font-size: 0.8rem;
    font-weight: 500;
}

.tabla-preview-carga .preview-col-acciones {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

.tabla-preview-carga .preview-errores-list,
.tabla-preview-carga .preview-advertencias-list,
.tabla-preview-carga .list-error-detail {
    margin: 0;
    padding-left: 1.1rem;
}

.preview-advertencias-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9em;
}


/* ========== RESPONSIVE - TABLAS ERP (Fase 3) ========== */

@media (max-width: 992px) {
    .tabla-erp-wrapper .tabla-productos,
    .licencias-table-wrapper .tabla-productos {
        min-width: 1200px;
    }

    .tabla-erp-wrapper .tabla-almacenes,
    .tabla-erp-wrapper .tabla-licencias,
    .tabla-erp-wrapper .tabla-descuentos-producto,
    .tabla-erp-wrapper .tabla-descuentos-moneda,
    .licencias-table-wrapper .tabla-almacenes,
    .licencias-table-wrapper .tabla-licencias,
    .licencias-table-wrapper .tabla-descuentos-producto,
    .licencias-table-wrapper .tabla-descuentos-moneda {
        min-width: 880px;
    }

    .tabla-erp-wrapper .tabla-clientes,
    .tabla-erp-wrapper .tabla-usuarios,
    .tabla-erp-wrapper .tabla-tasas,
    .tabla-erp-wrapper .tabla-facturas,
    .tabla-erp-wrapper .tabla-borradores,
    .tabla-erp-wrapper .tabla-despachos,
    .tabla-erp-wrapper .tabla-modulos,
    .tabla-erp-wrapper .tabla-empresas,
    .tabla-erp-wrapper .tabla-detalle-factura,
    .licencias-table-wrapper .tabla-clientes,
    .licencias-table-wrapper .tabla-usuarios,
    .licencias-table-wrapper .tabla-tasas,
    .licencias-table-wrapper .tabla-facturas,
    .licencias-table-wrapper .tabla-borradores,
    .licencias-table-wrapper .tabla-despachos,
    .licencias-table-wrapper .tabla-modulos,
    .licencias-table-wrapper .tabla-empresas,
    .licencias-table-wrapper .tabla-detalle-factura {
        min-width: 720px;
    }

    .tabla-erp-wrapper .tabla-impuestos,
    .tabla-erp-wrapper .tabla-categorias,
    .tabla-erp-wrapper .tabla-unidades,
    .tabla-erp-wrapper .tabla-monedas,
    .tabla-erp-wrapper .tabla-planes,
    .tabla-erp-wrapper .tabla-ajuste-stock,
    .tabla-erp-wrapper .tabla-permisos,
    .tabla-erp-wrapper .tabla-anticipo,
    .licencias-table-wrapper .tabla-impuestos,
    .licencias-table-wrapper .tabla-categorias,
    .licencias-table-wrapper .tabla-unidades,
    .licencias-table-wrapper .tabla-monedas,
    .licencias-table-wrapper .tabla-planes,
    .licencias-table-wrapper .tabla-ajuste-stock,
    .licencias-table-wrapper .tabla-permisos,
    .licencias-table-wrapper .tabla-anticipo {
        min-width: 560px;
    }

    .tabla-erp-wrapper .tabla-cuentas-cobrar,
    .licencias-table-wrapper .tabla-cuentas-cobrar {
        min-width: 1120px;
    }

    .tabla-erp-wrapper .tabla-preview-carga,
    .licencias-table-wrapper .tabla-preview-carga {
        min-width: 0;
        width: max-content;
    }

    .tabla-erp thead th,
    .licencias-table thead th,
    .tabla-erp tbody td,
    .licencias-table tbody td {
        padding: 12px 16px;
    }
}

@media (max-width: 768px) {
    .tabla-erp-wrapper .tabla-productos,
    .licencias-table-wrapper .tabla-productos {
        min-width: 1100px;
    }

    .tabla-erp-wrapper .tabla-almacenes,
    .tabla-erp-wrapper .tabla-licencias,
    .tabla-erp-wrapper .tabla-descuentos-producto,
    .tabla-erp-wrapper .tabla-descuentos-moneda,
    .licencias-table-wrapper .tabla-almacenes,
    .licencias-table-wrapper .tabla-licencias,
    .licencias-table-wrapper .tabla-descuentos-producto,
    .licencias-table-wrapper .tabla-descuentos-moneda {
        min-width: 770px;
    }

    .tabla-erp-wrapper .tabla-clientes,
    .tabla-erp-wrapper .tabla-usuarios,
    .tabla-erp-wrapper .tabla-tasas,
    .tabla-erp-wrapper .tabla-facturas,
    .tabla-erp-wrapper .tabla-borradores,
    .tabla-erp-wrapper .tabla-despachos,
    .tabla-erp-wrapper .tabla-modulos,
    .tabla-erp-wrapper .tabla-empresas,
    .tabla-erp-wrapper .tabla-detalle-factura,
    .licencias-table-wrapper .tabla-clientes,
    .licencias-table-wrapper .tabla-usuarios,
    .licencias-table-wrapper .tabla-tasas,
    .licencias-table-wrapper .tabla-facturas,
    .licencias-table-wrapper .tabla-borradores,
    .licencias-table-wrapper .tabla-despachos,
    .licencias-table-wrapper .tabla-modulos,
    .licencias-table-wrapper .tabla-empresas,
    .licencias-table-wrapper .tabla-detalle-factura {
        min-width: 630px;
    }

    .tabla-erp-wrapper .tabla-impuestos,
    .tabla-erp-wrapper .tabla-categorias,
    .tabla-erp-wrapper .tabla-unidades,
    .tabla-erp-wrapper .tabla-monedas,
    .tabla-erp-wrapper .tabla-planes,
    .tabla-erp-wrapper .tabla-ajuste-stock,
    .tabla-erp-wrapper .tabla-permisos,
    .tabla-erp-wrapper .tabla-anticipo,
    .licencias-table-wrapper .tabla-impuestos,
    .licencias-table-wrapper .tabla-categorias,
    .licencias-table-wrapper .tabla-unidades,
    .licencias-table-wrapper .tabla-monedas,
    .licencias-table-wrapper .tabla-planes,
    .licencias-table-wrapper .tabla-ajuste-stock,
    .licencias-table-wrapper .tabla-permisos,
    .licencias-table-wrapper .tabla-anticipo {
        min-width: 490px;
    }

    .tabla-erp-wrapper .tabla-cuentas-cobrar,
    .licencias-table-wrapper .tabla-cuentas-cobrar {
        min-width: 980px;
    }

    .tabla-erp-wrapper .tabla-preview-carga,
    .licencias-table-wrapper .tabla-preview-carga {
        min-width: 0;
        width: max-content;
    }

    .tabla-erp thead th,
    .licencias-table thead th {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .tabla-erp tbody td,
    .licencias-table tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 576px) {
    .tabla-erp-wrapper .tabla-productos,
    .licencias-table-wrapper .tabla-productos {
        min-width: 1080px;
    }

    .tabla-erp-wrapper .tabla-almacenes,
    .tabla-erp-wrapper .tabla-licencias,
    .tabla-erp-wrapper .tabla-descuentos-producto,
    .tabla-erp-wrapper .tabla-descuentos-moneda,
    .licencias-table-wrapper .tabla-almacenes,
    .licencias-table-wrapper .tabla-licencias,
    .licencias-table-wrapper .tabla-descuentos-producto,
    .licencias-table-wrapper .tabla-descuentos-moneda {
        min-width: 660px;
    }

    .tabla-erp-wrapper .tabla-clientes,
    .tabla-erp-wrapper .tabla-usuarios,
    .tabla-erp-wrapper .tabla-tasas,
    .tabla-erp-wrapper .tabla-facturas,
    .tabla-erp-wrapper .tabla-borradores,
    .tabla-erp-wrapper .tabla-despachos,
    .tabla-erp-wrapper .tabla-modulos,
    .tabla-erp-wrapper .tabla-empresas,
    .tabla-erp-wrapper .tabla-detalle-factura,
    .licencias-table-wrapper .tabla-clientes,
    .licencias-table-wrapper .tabla-usuarios,
    .licencias-table-wrapper .tabla-tasas,
    .licencias-table-wrapper .tabla-facturas,
    .licencias-table-wrapper .tabla-borradores,
    .licencias-table-wrapper .tabla-despachos,
    .licencias-table-wrapper .tabla-modulos,
    .licencias-table-wrapper .tabla-empresas,
    .licencias-table-wrapper .tabla-detalle-factura {
        min-width: 540px;
    }

    .tabla-erp-wrapper .tabla-impuestos,
    .tabla-erp-wrapper .tabla-categorias,
    .tabla-erp-wrapper .tabla-unidades,
    .tabla-erp-wrapper .tabla-monedas,
    .tabla-erp-wrapper .tabla-planes,
    .tabla-erp-wrapper .tabla-ajuste-stock,
    .tabla-erp-wrapper .tabla-permisos,
    .tabla-erp-wrapper .tabla-anticipo,
    .licencias-table-wrapper .tabla-impuestos,
    .licencias-table-wrapper .tabla-categorias,
    .licencias-table-wrapper .tabla-unidades,
    .licencias-table-wrapper .tabla-monedas,
    .licencias-table-wrapper .tabla-planes,
    .licencias-table-wrapper .tabla-ajuste-stock,
    .licencias-table-wrapper .tabla-permisos,
    .licencias-table-wrapper .tabla-anticipo {
        min-width: 420px;
    }

    .tabla-erp-wrapper .tabla-cuentas-cobrar,
    .licencias-table-wrapper .tabla-cuentas-cobrar {
        min-width: 840px;
    }

    .tabla-erp-wrapper .tabla-preview-carga,
    .licencias-table-wrapper .tabla-preview-carga {
        min-width: 0;
        width: max-content;
    }

    .tabla-erp-wrapper,
    .licencias-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tabla-erp-wrapper .btn-action,
    .licencias-table-wrapper .btn-action {
        width: 32px;
        height: 32px;
    }

    .tabla-erp-wrapper .btn-action .material-icons,
    .licencias-table-wrapper .btn-action .material-icons {
        font-size: 18px;
    }
}

/* ========== UTILIDADES - REEMPLAZO DE ESTILOS INLINE (Fase 4) ========== */

.form-inline-action {
    display: inline;
}

.js-toggle-container {
    display: none;
}

.js-toggle-container.is-visible {
    display: block;
}

.section-spacing {
    margin-top: 20px;
    margin-bottom: 20px;
}

.section-spacing-top {
    margin-top: 20px;
}

.section-spacing-top-lg {
    margin-top: 30px;
}

.section-spacing-bottom {
    margin-bottom: 20px;
}

.me-10 {
    margin-right: 10px;
}

.badge-status-pendiente {
    background-color: #ffc107;
    color: #000;
}

.badge-status-inactivo {
    background-color: #6c757d;
    color: #fff;
}

.icon-sm {
    font-size: 14px;
    vertical-align: middle;
}

.icon-md {
    font-size: 18px;
    vertical-align: middle;
}

.icon-xs {
    font-size: 16px;
    vertical-align: middle;
}

.login-button-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

.btn-login {
    width: auto;
    min-width: 220px;
    margin: 0;
    background: #2c5282;
    background-color: #2c5282;
    background-image: none;
    color: #ffffff;
}

.btn-login .material-icons,
.btn-login span {
    color: #ffffff;
}

.link-volver-inicio {
    color: #2c5282;
    font-size: 1.2rem;
}

.link-cerrar-sesion {
    color: #2c5282;
    font-size: 1rem;
}

.admin-card-icon-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-card-icon-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.admin-card-icon-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.admin-card-icon-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.admin-card-icon-warning {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.admin-card-icon-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.reporte-export-actions {
    margin-bottom: 0.25rem;
}

.empresa-logo-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.empresa-logo-carga-panel {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: #fff;
}

.empresa-logo-carga-col {
    display: flex;
    flex-direction: column;
}

.empresa-logo-preview-col {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.empresa-logo-preview-frame--panel {
    flex: 1 1 auto;
    min-height: 180px;
}

.empresa-logo-preview-wrap {
    margin-top: 0.75rem;
}

.empresa-logo-preview-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0;
}

.empresa-logo-preview-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.empresa-logo-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #6c757d;
    text-align: center;
}

.empresa-logo-preview-placeholder .material-icons {
    font-size: 2.5rem;
    opacity: 0.65;
}

.empresa-logo-preview-hint {
    font-size: 0.875rem;
    max-width: 220px;
}

.empresa-logo-preview-placeholder--hidden,
.empresa-logo-preview--hidden {
    display: none !important;
}

.empresa-logo-preview-frame .empresa-logo-preview {
    margin: 0;
    max-width: 200px;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.empresa-logo-preview-new {
    max-width: 200px;
    max-height: 160px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-top: 0.75rem;
    object-fit: contain;
}

.producto-imagen-carga-panel {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: #fff;
    height: 100%;
}

.producto-imagen-carga-col {
    display: flex;
    flex-direction: column;
}

.producto-imagen-preview-col {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.producto-imagen-preview-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.producto-imagen-preview-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.producto-imagen-preview-frame--panel {
    flex: 1 1 auto;
    min-height: 180px;
}

.producto-imagen-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #6c757d;
    text-align: center;
}

.producto-imagen-preview-placeholder .material-icons {
    font-size: 2.5rem;
    opacity: 0.65;
}

.producto-imagen-preview-hint {
    font-size: 0.875rem;
    max-width: 220px;
}

.producto-imagen-preview-placeholder--hidden,
.producto-imagen-preview--hidden {
    display: none !important;
}

.producto-imagen-preview-frame .producto-imagen-preview {
    margin: 0;
    max-width: 200px;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.tabla-productos .producto-listado-con-thumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.tabla-productos .producto-listado-con-thumb .licencia-empresa-info,
.tabla-productos .producto-listado-con-thumb .tabla-productos-cell-text {
    min-width: 0;
    flex: 1 1 auto;
}

.producto-listado-thumb {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

@media (max-width: 767.98px) {
    .producto-imagen-carga-panel {
        padding: 0.75rem 1rem;
    }

    .producto-imagen-preview-frame,
    .producto-imagen-preview-frame--panel {
        min-height: 140px;
    }

    .producto-imagen-preview-frame .producto-imagen-preview {
        max-width: 160px;
        max-height: 120px;
    }

    .producto-listado-thumb {
        width: 28px;
        height: 28px;
    }
}

.preview-table-responsive {
    -webkit-overflow-scrolling: touch;
}

.list-error-detail {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9em;
}

.small-muted {
    font-size: 0.8em;
    margin-top: 0.25rem;
}

.confirm-carga-box {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.toast-mensaje {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
}

.text-90 {
    font-size: 0.9em;
}

/* Límites de crédito — edición inline por columna (no apiñar en Acciones) */
.tabla-limites-credito td.tabla-erp-col-edicion {
    min-width: 120px;
    max-width: none !important;
    overflow: visible;
    vertical-align: middle;
    white-space: nowrap;
}

.tabla-limites-credito .limites-credito-input {
    min-width: 120px;
    width: 100%;
    max-width: 160px;
    margin-left: auto;
}

.tabla-limites-credito .dias-credito-input {
    min-width: 72px;
    width: 88px;
    max-width: 96px;
    margin-left: auto;
    margin-right: auto;
}

.tabla-limites-credito .limites-credito-modo-select {
    min-width: 150px;
    width: 100%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.tabla-limites-credito .limites-credito-form-acciones {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.tabla-limites-credito .limites-credito-form-acciones .btn .material-icons {
    font-size: 16px;
    margin-right: 4px;
}

.tabla-limites-credito th.tabla-erp-col-acciones,
.tabla-limites-credito td.tabla-erp-col-acciones {
    min-width: 120px;
}

.cxc-cobro-form-card {
    width: 100%;
}

.cxc-cobro-ficha {
    display: none;
    width: 100%;
    margin-top: 4px;
    padding: 16px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    background: var(--bs-secondary-bg, #f8f9fa);
}

.cxc-cobro-ficha.is-visible {
    display: block;
}

.cxc-cobro-ficha-title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.cxc-cobro-ficha-intro {
    margin-bottom: 12px;
}

.cxc-cobro-cuenta-bancaria-row:not(.is-visible),
.cxc-cobro-extra-row:not(.is-visible) {
    display: none !important;
}

.cxc-cobro-caja-hint,
.cxc-cobro-destino-hint {
    margin-top: 4px;
    margin-bottom: 0;
}

.cxc-cobro-alerta {
    margin-bottom: 12px;
}

.cxc-cobro-tasa-wrap {
    display: none;
}

.cxc-cobro-tasa-wrap.is-visible {
    display: block;
}

.cxc-cobro-tasa-preview {
    margin-bottom: 0;
    font-weight: 600;
}

.cxc-cobro-abono-resumen {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--bs-primary, #0d6efd);
    border-radius: 8px;
    background: var(--bs-body-bg, #fff);
    text-align: center;
}

.cxc-cobro-abono-label {
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
}

.cxc-cobro-abono-facturacion {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.cxc-cobro-abono-valor-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0;
}

.cxc-cobro-abono-input {
    width: 100%;
    max-width: 16rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--bs-body-color, #212529);
}

.cxc-cobro-abono-iso {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.cxc-cobro-abono-saldo,
.cxc-cobro-abono-resto {
    margin-bottom: 0;
    color: var(--bs-secondary-color, #6c757d);
}

.cxc-cobro-abono-error {
    margin-top: 8px;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--bs-danger, #dc3545);
}

.cxc-cobro-abono-resumen.is-ok {
    border-color: var(--bs-success, #198754);
}

.cxc-cobro-abono-resumen.is-ok .cxc-cobro-abono-input {
    color: var(--bs-success, #198754);
}

.cxc-cobro-abono-resumen.is-exceso {
    border-color: var(--bs-danger, #dc3545);
    background: var(--bs-danger-bg-subtle, #f8d7da);
}

.cxc-cobro-abono-resumen.is-exceso .cxc-cobro-abono-input {
    color: var(--bs-danger, #dc3545);
}

.cxc-cobro-abono-resumen.is-pendiente {
    border-color: var(--bs-border-color, #dee2e6);
}

.cxc-cobro-extra-hist {
    display: block;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .cxc-cobro-ficha {
        padding: 12px;
    }

    .cxc-cobro-caja-hint,
    .cxc-cobro-alerta,
    .cxc-cobro-destino-hint,
    .cxc-cobro-abono-resumen {
        width: 100%;
    }

    .cxc-cobro-abono-input {
        font-size: 1.6rem;
        max-width: 100%;
    }
}

.cxc-credito-badge-indexado {
    font-size: 0.75rem;
}

/* CxC — cobros mayoreo pendientes (Petición E) */
.cxc-mayoreo-pend-list .cxc-mayoreo-pend-alerta {
    margin-bottom: 1rem;
}

.cxc-mayoreo-pend-tabla td {
    vertical-align: middle;
}

.cxc-mayoreo-pend-ficha .cxc-mayoreo-pend-dl dt {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.cxc-mayoreo-pend-ficha .cxc-mayoreo-pend-dl dd {
    margin-bottom: 0.65rem;
}

.cxc-mayoreo-pend-nota {
    line-height: 1.4;
}

.cxc-mayoreo-pend-form-card {
    height: 100%;
}

.cxc-mayoreo-pend-hint {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.cxc-mayoreo-pend-cuenta-row.is-hidden,
.cxc-mayoreo-pend-origen-row.is-hidden {
    display: none;
}

@media (max-width: 768px) {
    .cxc-mayoreo-pend-registrar .licencias-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cxc-mayoreo-pend-form .btn {
        width: 100%;
        justify-content: center;
    }

    .cxc-mayoreo-pend-form-actions {
        flex-direction: column;
    }

    .cxc-mayoreo-pend-detalle .licencias-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cxc-mayoreo-pend-detalle .licencias-list-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Ficha informativa - resumen orden de compra */
.compras-orden-resumen-card .compras-orden-resumen-label {
    margin-right: 0.5rem;
}

.compras-orden-resumen-card .compras-orden-resumen-total {
    color: #0d6efd;
}

/* ============================================================
   WMS SUPERUSUARIO — Dashboard y Configuración (SU-WMS-09)
   Prefijo: .wms-su-*
   ============================================================ */

.wms-su-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wms-su-kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.wms-su-kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.wms-su-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c5282;
    line-height: 1;
    margin-bottom: .25rem;
}

.wms-su-kpi-label {
    font-size: .8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.wms-su-kpi-card.wms-activo .wms-su-kpi-value { color: #28a745; }

.wms-toggle-form { display: inline; }

.wms-toggle-btn {
    padding: .2rem .5rem;
    font-size: .75rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

.wms-toggle-btn.wms-on { background-color: #d4edda; color: #155724; }
.wms-toggle-btn.off    { background-color: #f8d7da; color: #721c24; }
.wms-toggle-btn:hover  { opacity: .85; }

.wms-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .75rem;
}

.wms-feature-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .5rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #f8f9fa;
}

.wms-feature-desc {
    font-size: .75rem;
    color: #6c757d;
    margin-top: .15rem;
}

@media (max-width: 768px) {
    .wms-su-kpi-grid    { grid-template-columns: repeat(2, 1fr); }
    .wms-features-grid  { grid-template-columns: 1fr; }
}

/* ============================================================================
   SECCIÓN IA - Landing Page (ai-section, ai-feature-list, ai-capability-card)
   ============================================================================ */

/* Sección principal IA */
.ai-section {
    background: linear-gradient(160deg, #0f1535 0%, #1a2458 55%, #0f1535 100%);
    color: #e8eaf6;
    padding: 80px 0;
}

.ai-section h2 {
    color: #ffffff;
}

.ai-section h1 {
    color: #ffffff;
}

.ai-section .lead {
    color: rgba(232, 234, 246, 0.80);
}

/* Hero landing — misma paleta que ai-section */
.ai-section-hero {
    margin-top: -20px;
    padding: 88px 0 80px;
}

.ai-section-hero-row {
    min-height: 50vh;
}

.ai-section-hero-card {
    padding: 0;
    overflow: hidden;
    text-align: left;
}

.ai-hero-assembler-wrap {
    position: relative;
}

.ai-hero-assembler-terminal {
    position: relative;
    background: rgba(8, 12, 32, 0.72);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(124, 140, 248, 0.12);
    animation: ai-hero-assembler-glow 4s ease-in-out infinite;
}

.ai-hero-assembler-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(124, 140, 248, 0.18);
}

.ai-hero-assembler-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(124, 140, 248, 0.35);
}

.ai-hero-assembler-dot:nth-child(1) {
    background: #ff6b7a;
    opacity: 0.85;
}

.ai-hero-assembler-dot:nth-child(2) {
    background: #ffd166;
    opacity: 0.85;
}

.ai-hero-assembler-dot:nth-child(3) {
    background: #6ee7b7;
    opacity: 0.85;
}

.ai-hero-assembler-title {
    margin-left: auto;
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(199, 212, 255, 0.55);
}

.ai-hero-assembler-code {
    margin: 0;
    padding: 1.1rem 1.15rem 1.25rem;
    font-family: ui-monospace, "Cascadia Code", "Consolas", "Courier New", monospace;
    font-size: 0.72rem;
    line-height: 1.65;
    color: rgba(232, 234, 246, 0.9);
    overflow: hidden;
    max-height: 16.5rem;
}

.ai-hero-assembler-code code {
    display: block;
    white-space: pre;
}

.ai-hero-asm-line {
    display: block;
    opacity: 0;
    transform: translateX(-6px);
    animation: ai-hero-asm-line-in 0.45s ease forwards;
}

.ai-hero-asm-line:nth-child(1) { animation-delay: 0.1s; }
.ai-hero-asm-line:nth-child(2) { animation-delay: 0.22s; }
.ai-hero-asm-line:nth-child(3) { animation-delay: 0.34s; }
.ai-hero-asm-line:nth-child(4) { animation-delay: 0.46s; }
.ai-hero-asm-line:nth-child(5) { animation-delay: 0.58s; }
.ai-hero-asm-line:nth-child(6) { animation-delay: 0.7s; }
.ai-hero-asm-line:nth-child(7) { animation-delay: 0.82s; }
.ai-hero-asm-line:nth-child(8) { animation-delay: 0.94s; }
.ai-hero-asm-line:nth-child(9) { animation-delay: 1.06s; }
.ai-hero-asm-line:nth-child(10) { animation-delay: 1.18s; }
.ai-hero-asm-line:nth-child(11) { animation-delay: 1.3s; }
.ai-hero-asm-line:nth-child(12) { animation-delay: 1.42s; }
.ai-hero-asm-line:nth-child(13) { animation-delay: 1.54s; }
.ai-hero-asm-line:nth-child(14) { animation-delay: 1.66s; }

.asm-comment {
    color: rgba(110, 231, 183, 0.72);
}

.asm-directive {
    color: #c4b5fd;
}

.asm-label {
    color: #7dd3fc;
}

.asm-opcode {
    color: #f9a8d4;
    font-weight: 600;
}

.asm-reg {
    color: #fde68a;
}

.asm-hex {
    color: #a5b4fc;
}

.ai-hero-asm-line--cursor {
    min-height: 1.65em;
}

.ai-hero-assembler-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: #7c8cf8;
    animation: ai-hero-assembler-cursor-blink 1s step-end infinite;
}

.ai-hero-assembler-scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 42%;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(124, 140, 248, 0.07) 48%,
        transparent 100%
    );
    animation: ai-hero-assembler-scan 5s linear infinite;
    opacity: 0.65;
}

@keyframes ai-hero-asm-line-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ai-hero-assembler-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes ai-hero-assembler-glow {
    0%, 100% {
        box-shadow:
            inset 0 0 0 1px rgba(124, 140, 248, 0.12),
            0 0 24px rgba(92, 108, 250, 0.12);
    }
    50% {
        box-shadow:
            inset 0 0 0 1px rgba(124, 140, 248, 0.28),
            0 0 36px rgba(124, 140, 248, 0.22);
    }
}

@keyframes ai-hero-assembler-scan {
    0% { top: -45%; }
    100% { top: 105%; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-hero-asm-line {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .ai-hero-assembler-cursor,
    .ai-hero-assembler-scan,
    .ai-hero-assembler-terminal {
        animation: none;
    }
}

.ai-section-hero-actions .btn-lg {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
}

.ai-section-btn-primary {
    background: linear-gradient(135deg, #5c6cfa 0%, #7c4dff 100%);
    border: none;
    color: #ffffff;
}

.ai-section-btn-primary:hover,
.ai-section-btn-primary:focus {
    background: linear-gradient(135deg, #6b7afb 0%, #8b5fff 100%);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(92, 108, 250, 0.35);
}

.ai-section-btn-outline {
    color: #c7d4ff;
    border-color: rgba(124, 140, 248, 0.55);
    background: transparent;
}

.ai-section-btn-outline:hover,
.ai-section-btn-outline:focus {
    color: #ffffff;
    background: rgba(124, 140, 248, 0.14);
    border-color: rgba(124, 140, 248, 0.75);
}

/* Lista de features IA (bullet list con icono) */
.ai-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    color: rgba(232, 234, 246, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.97rem;
    line-height: 1.5;
}

.ai-feature-list li:last-child {
    border-bottom: none;
}

.ai-feature-list li .material-icons {
    color: #7c8cf8;
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Card lateral de la sección IA */
.ai-section-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(124, 140, 248, 0.30);
    border-radius: 20px;
    padding: 44px 36px;
    backdrop-filter: blur(8px);
}

.ai-section-card p {
    color: rgba(232, 234, 246, 0.78);
}

.ai-section-icon {
    font-size: 72px;
    color: #7c8cf8;
    margin-bottom: 20px;
    display: block;
}

/* Grid de capacidades IA (6 cards) */
.ai-capabilities-section {
    background: #f4f6ff;
    padding: 70px 0;
}

.ai-capabilities-section .section-title {
    color: #1a2458;
}

.ai-capabilities-section .section-lead {
    color: #5c6bc0;
}

.ai-capability-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 4px 18px rgba(100, 120, 255, 0.09);
    border: 1px solid rgba(124, 140, 248, 0.18);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    height: 100%;
    position: relative;
}

.ai-capability-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(100, 120, 255, 0.18);
}

.ai-capability-icon {
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #5c6cfa 0%, #7c4dff 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.ai-capability-icon .material-icons {
    font-size: 32px;
    color: #ffffff;
}

.ai-capability-card h5 {
    color: #1a2458;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.ai-capability-card p {
    color: #5a6080;
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
}

.ai-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: linear-gradient(90deg, #5c6cfa, #7c4dff);
    border-radius: 30px;
    padding: 2px 9px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .ai-section {
        padding: 50px 0;
    }
    .ai-section-hero {
        padding: 56px 0 50px;
    }
    .ai-section-hero-row {
        min-height: auto;
    }
    .ai-section-hero-card {
        margin-top: 1rem;
    }

    .ai-hero-assembler-code {
        font-size: 0.64rem;
        max-height: 14rem;
    }
    .ai-capabilities-section {
        padding: 50px 0;
    }
    .ai-section-card {
        padding: 30px 20px;
        margin-top: 30px;
    }
}

/* Panel tienda_minimal */
.ts-minimal-body {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    min-height: 100vh;
}

.ts-minimal-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 24, 39, 0.82);
    backdrop-filter: blur(6px);
    padding: 0.85rem 0;
}

.ts-minimal-title {
    color: #f8fafc;
    font-weight: 700;
}

.ts-minimal-subtitle {
    color: #9ca3af;
    font-size: 0.85rem;
}

.ts-minimal-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ts-minimal-logo-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

.ts-minimal-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.ts-minimal-card h2 {
    color: #f8fafc;
    font-weight: 700;
}

.ts-minimal-card .text-muted {
    color: #cbd5e1 !important;
}

.ts-minimal-card-logo {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.ts-minimal-card-logo-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-minimal-card-logo-placeholder .material-icons {
    font-size: 42px;
}

.ts-minimal-main {
    padding-top: 1.25rem;
}

.ts-minimal-logout-btn {
    font-weight: 600;
}

/* Superuser -> gestionar_tenant_tienda_api -> paleta */
.tp-palette-preview-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.tp-palette-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    display: inline-block;
}

.tp-palette-primary {
    background: #1f4e79;
}

.tp-palette-secondary {
    background: #5f6b7a;
}

.tp-palette-accent {
    background: #c89b3c;
}

.tp-palette-danger {
    background: #b63c3c;
}

.tp-palette-warning {
    background: #d9a441;
}

.tp-palette-bg {
    background: #f4f1ea;
}

.tp-palette-text {
    background: #1b2430;
}

.tp-palette-topbar-start {
    background: #f5f1e8;
}

.tp-palette-topbar-end {
    background: #e7edf6;
}

.tp-palette-ribbon-tenant-start {
    background: #e9eef7;
}

.tp-palette-ribbon-tenant-end {
    background: #fdfdfd;
}

.tp-palette-ribbon-hero-start {
    background: #f9f6ef;
}

.tp-palette-ribbon-hero-end {
    background: #e8f0fb;
}

.tp-palette-ribbon-text {
    background: #233142;
}

.tp-palette-ribbon-tenant {
    background: #1f2f46;
}

.tp-palette-ribbon-hero {
    background: #233142;
}

/* Superuser -> gestionar_tenant_tienda_api — pestañas */
.su-tienda-api-workspace {
    margin-top: 1.25rem;
    margin-bottom: 2rem;
}

.su-tienda-api-tabbed-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.su-tienda-api-nav-tabs {
    flex-wrap: wrap;
    gap: 0;
    padding: 0.5rem 0.65rem 0;
    margin-bottom: 0;
    border-bottom: none;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.su-tienda-api-nav-item {
    flex: 1 1 220px;
    min-width: 0;
}

.su-tienda-api-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.85rem 1rem 0.95rem;
    margin-bottom: 0;
    border: 1px solid transparent;
    border-radius: 10px 10px 0 0 !important;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.su-tienda-api-nav-link:hover {
    color: var(--color-primary, #667eea);
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(148, 163, 184, 0.25);
}

.su-tienda-api-nav-link.active {
    color: #1e293b;
    background: #fff;
    border-color: rgba(148, 163, 184, 0.28);
    border-bottom-color: #fff !important;
    margin-bottom: -1px;
    box-shadow: 0 -2px 14px rgba(15, 23, 42, 0.04);
}

/* Panel tienda_pedidos -> listado y detalle */
.tdp-action-btn .material-icons {
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
}

.tdp-order-detail .tdp-kpi-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.tdp-kpi-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.tdp-kpi-value {
    font-size: 1.02rem;
    color: #1e293b;
    font-weight: 700;
    word-break: break-word;
}

.tdp-dual-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tdp-dual-line {
    display: block;
    font-weight: 700;
}

.tdp-dual-muted {
    font-size: 0.92em;
    color: #64748b;
    font-weight: 600;
}

.tdp-tasa-ref {
    max-width: 960px;
}

.tdp-moneda-pago-banner {
    border-radius: 10px;
}

.tdp-moneda-pago-banner .tdp-mpb-line {
    display: inline;
}

.tdp-moneda-pago-banner .tdp-mpb-sep {
    margin: 0 0.15em;
}

.tdp-th-dual {
    white-space: nowrap;
    font-size: 0.72rem;
}

.tdp-td-dual {
    font-size: 0.88rem;
    white-space: nowrap;
}

.tdp-products-tfoot th,
.tdp-products-tfoot td {
    border-top: 2px solid #e2e8f0;
    vertical-align: middle;
    padding-top: 0.65rem;
    background-color: #f8fafc;
}

.tdp-products-tfoot-label {
    font-weight: 700;
    text-align: right;
    color: #1e293b;
    font-size: 0.88rem;
}

.tdp-products-tfoot-total {
    font-weight: 700;
    color: #0f172a;
}

.tdp-products-tfoot-muted {
    color: #94a3b8;
}

@media (max-width: 991.98px) {
    .tdp-order-detail .tabla-erp-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.tdp-card {
    border: 1px solid #e7ebf2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.tdp-card-header {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border-bottom: 1px solid #e7ebf2;
}

.tdp-field-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tdp-field-row {
    display: grid;
    grid-template-columns: minmax(140px, 170px) 1fr;
    gap: 10px;
    align-items: baseline;
    border-bottom: 1px dashed #e6ebf3;
    padding-bottom: 6px;
}

.tdp-field-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tdp-field-value {
    font-size: 0.94rem;
    color: #0f172a;
    word-break: break-word;
}

.tdp-payment-card {
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.tdp-payment-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tdp-extra-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 10px;
}

.tdp-extra-item {
    background: #f8fafc;
    border: 1px solid #e7ecf3;
    border-radius: 10px;
    padding: 8px 10px;
}

.tdp-proof-thumb {
    max-height: 120px;
    width: auto;
}

@media (max-width: 768px) {
    .tdp-field-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.su-tienda-api-nav-link.active::after {
    content: "";
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--color-primary, #667eea);
}

.su-tienda-api-nav-item .su-tienda-api-nav-link {
    position: relative;
}

.su-tienda-api-nav-icon {
    font-size: 24px !important;
    line-height: 1;
    color: inherit;
    opacity: 0.92;
}

.su-tienda-api-nav-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.su-tienda-api-nav-title {
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
}

.su-tienda-api-nav-sub {
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.25;
}

.su-tienda-api-nav-link.active .su-tienda-api-nav-sub {
    color: #64748b;
}

.su-tienda-api-tab-content {
    background: #fff;
    padding: 0 1.25rem 1.35rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.su-tienda-api-tab-pane > .su-tienda-api-pane-inner + .su-tienda-api-pane-actions {
    margin-top: 0;
}

.su-tienda-api-pane-inner {
    padding: 1.15rem 0 1rem;
}

.su-tienda-api-pane-actions {
    padding: 0.25rem 0 0.35rem;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 576px) {
    .su-tienda-api-nav-link {
        border-radius: 10px !important;
        margin-bottom: 0.35rem;
    }

    .su-tienda-api-nav-tabs {
        padding: 0.5rem;
    }

    .su-tienda-api-nav-link.active {
        margin-bottom: 0.35rem;
        border-bottom-color: rgba(148, 163, 184, 0.28) !important;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    }
}

/* Vista previa reporte pedidos tienda (scroll horizontal) */
.tp-reporte-preview-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.tp-reporte-preview-table {
    min-width: 1080px;
    width: max-content;
}

.tp-reporte-preview-table th {
    white-space: nowrap;
}

.tp-reporte-comprador {
    white-space: pre-line;
    word-break: break-word;
    max-width: 22rem;
}

/* Observaciones por pago — panel tienda_pedidos */
.tdp-payment-obs textarea {
    max-height: 14rem;
}

/* Panel tienda_pedidos — backorder vitrina */
.tdp-backorder-form-global .form-check.form-switch {
    padding-left: 2.5rem;
}

.tdp-backorder-form-global .form-check-input {
    margin-left: -2.5rem;
}

/* Panel reposicion (add-on módulo reposicion_backorder) */
.repo-panel-body .repo-panel-main {
    max-width: 100%;
}

.repo-dash .repo-kpi-card,
.repo-list .repo-table-wrap,
.repo-detail .card,
.repo-params .card {
    border-radius: 12px;
}

.repo-filter-form {
    min-width: 0;
}

.repo-dash-note {
    max-width: 52rem;
}

.repo-oc-from-sugerencia-banner {
    border-radius: 12px;
}

.repo-oc-link-oc {
    font-weight: 600;
}

/* Superuser — opciones tenant (banderas en editar empresa) */
.su-tenant-flag-item {
    padding: 0.75rem 1rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    background: var(--bs-body-bg, #fff);
}
.su-tenant-flag-item + .su-tenant-flag-item {
    margin-top: 0.75rem;
}
.su-tenant-flag-help {
    margin: 0.35rem 0 0 1.75rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* SENIAT PA 00121 — paneles informativos no invasivos */
.seniat-info-panel {
    border-left: 4px solid var(--bs-info, #0dcaf0);
}

.seniat-config-container .seniat-probar-resultado {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1 1 16rem;
    max-width: 36rem;
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    font-size: 0.9rem;
    line-height: 1.35;
    min-height: 1.5rem;
}

.seniat-config-container .seniat-probar-resultado__icon {
    font-size: 1.25rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.seniat-config-container .seniat-probar-resultado__texto {
    flex: 1 1 auto;
}

.seniat-config-container .seniat-probar-resultado--proceso {
    background-color: #eef5fb;
    border-color: #b6d4fe;
    color: #084298;
}

.seniat-config-container .seniat-probar-resultado--exito {
    background-color: #e8f6ee;
    border-color: #a3cfbb;
    color: #0f5132;
}

.seniat-config-container .seniat-probar-resultado--advertencia {
    background-color: #fff8e6;
    border-color: #ffe69c;
    color: #664d03;
}

.seniat-config-container .seniat-probar-resultado--error {
    background-color: #fdebec;
    border-color: #f1aeb5;
    color: #842029;
}

.seniat-config-container .seniat-imprenta-acciones {
    border-color: var(--bs-border-color, #dee2e6) !important;
}

.seniat-config-container .seniat-imprenta-acciones .btn .material-icons {
    font-size: 1.1rem;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.seniat-config-container .seniat-canal-deshabilitado {
    opacity: 0.55;
    pointer-events: none;
}

.seniat-config-container .seniat-canal-deshabilitado .seniat-probar-resultado {
    pointer-events: none;
}

.seniat-config-tabbed-card {
    margin-bottom: 2rem;
}

.seniat-config-tab-content {
    padding: 1rem 1.25rem 1.5rem;
}

.seniat-config-tab-content .cxc-guia-panel {
    border: none;
    box-shadow: none;
    margin-bottom: 0;
}

.seniat-config-tab-content .cxc-guia-panel .card-header {
    padding-left: 0;
    padding-right: 0;
}

.seniat-config-tab-content .cxc-guia-panel .card-body {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

.seniat-guia-panel .seniat-guia-ejemplo {
    font-size: 0.875rem;
    color: var(--bs-secondary-color, #6c757d);
}

.seniat-guia-panel .seniat-guia-lista {
    font-size: 0.875rem;
    color: var(--bs-body-color, #212529);
    padding-left: 1.25rem;
}

.seniat-guia-panel .seniat-guia-lista li {
    margin-bottom: 0.35rem;
}

.seniat-guia-panel .seniat-guia-nota {
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #6c757d);
}

.seniat-guia-panel code {
    font-size: 0.85em;
}

.seniat-config-form .form-text code {
    font-size: 0.85em;
}

.seniat-fiscal-bitacora-detalle {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seniat-fiscal-agente-hint {
    padding: 0.85rem 1rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(13, 110, 253, 0.25);
    background: rgba(13, 110, 253, 0.06);
}

.seniat-fiscal-pasos {
    padding-left: 1.25rem;
    margin: 0;
    font-size: 0.9rem;
}

.seniat-fiscal-pasos li {
    margin-bottom: 0.35rem;
}

@media (max-width: 767.98px) {
    .seniat-fiscal-agente-hint {
        padding: 0.75rem;
    }

    .seniat-fiscal-pasos {
        font-size: 0.85rem;
    }
}

.seniat-config-form .card-header .material-icons {
    vertical-align: middle;
    font-size: 1.25rem;
    margin-right: 0.25rem;
}

.seniat-estado-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.seniat-estado-transmitido {
    background-color: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.seniat-estado-pendiente,
.seniat-estado-encolado {
    background-color: rgba(13, 202, 240, 0.15);
    color: #0aa2c0;
}

.seniat-estado-pendiente_control {
    background-color: rgba(255, 193, 7, 0.2);
    color: #997404;
}

.seniat-estado-error,
.seniat-estado-rechazado {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.seniat-estado-omitido {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

.seniat-estado-emitida {
    background-color: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.seniat-retencion-monto-preview {
    background-color: var(--bs-secondary-bg, #f8f9fa);
    font-weight: 600;
}

.seniat-transmision-resumen .card-title .material-icons {
    vertical-align: middle;
    font-size: 1.25rem;
    margin-right: 0.25rem;
}

/* Guía operativa — paneles CxC, Compras, Director financiero y Analista de Almacén (clases compartidas cxc-guia-*) */
.cxc-guia-panel .cxc-guia-intro {
    font-size: 0.9375rem;
    color: var(--bs-secondary-color, #6c757d);
}

.cxc-guia-seccion {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.cxc-guia-seccion:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cxc-guia-seccion-titulo {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.cxc-guia-subseccion {
    margin-left: 0;
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--color-primary, #0d6efd);
}

@media (min-width: 768px) {
    .cxc-guia-subseccion {
        margin-left: 0.5rem;
        padding-left: 1rem;
    }
}

.cxc-guia-subseccion-titulo {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color, #212529);
}

.cxc-guia-item {
    background-color: var(--bs-secondary-bg, #f8f9fa);
    border-radius: 0.375rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
}

.cxc-guia-item:last-child {
    margin-bottom: 0;
}

.cxc-guia-item-titulo {
    font-size: 0.975rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cxc-guia-item-titulo a {
    text-decoration: none;
}

.cxc-guia-item-titulo a:hover {
    text-decoration: underline;
}

.cxc-guia-proposito,
.cxc-guia-acciones,
.cxc-guia-paso,
.cxc-guia-ejemplo {
    font-size: 0.875rem;
    line-height: 1.45;
}

.cxc-guia-etiqueta {
    font-weight: 600;
    color: var(--bs-body-color, #212529);
}

.cxc-guia-orden-lista {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.cxc-guia-orden-lista li {
    margin-bottom: 0.5rem;
    line-height: 1.45;
}

.cxc-guia-campos {
    font-size: 0.875rem;
    line-height: 1.45;
}

.cxc-guia-item-titulo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.cxc-guia-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1.2;
    white-space: nowrap;
}

.cxc-guia-badge--pruebas {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.cxc-guia-badge--imprenta {
    background: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

.cxc-guia-badge--fiscal {
    background: #e0cffc;
    color: #432874;
    border: 1px solid #d2b7f5;
}

.cxc-guia-badge--libre {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.cxc-guia-badge--ambos {
    background: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

.cxc-guia-item--pruebas,
.cxc-guia-item--imprenta,
.cxc-guia-item--fiscal,
.cxc-guia-item--libre,
.cxc-guia-item--ambos {
    padding: 0.85rem 1rem;
    border-radius: 0.4rem;
    border: 1px solid transparent;
    margin-bottom: 0.85rem;
}

.cxc-guia-item--pruebas {
    background: #fffbf0;
    border-color: #ffe69c;
}

.cxc-guia-item--imprenta {
    background: #f5f9ff;
    border-color: #b6d4fe;
}

.cxc-guia-item--fiscal {
    background: #f8f4ff;
    border-color: #d2b7f5;
}

.cxc-guia-item--libre {
    background: #f3faf6;
    border-color: #a3cfbb;
}

.cxc-guia-item--ambos {
    background: #f0fbfd;
    border-color: #9eeaf9;
}

.cxc-guia-campos-tabla-wrap {
    margin-top: 0.5rem;
}

.cxc-guia-campos-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.72);
}

.cxc-guia-campos-tabla th,
.cxc-guia-campos-tabla td {
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.4rem 0.55rem;
    vertical-align: top;
    text-align: left;
}

.cxc-guia-campos-tabla th {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

.cxc-guia-campos-tabla code {
    font-size: 0.8em;
    word-break: break-word;
    color: inherit;
}

@media (max-width: 576px) {
    .cxc-guia-campos-tabla th,
    .cxc-guia-campos-tabla td {
        display: block;
        width: 100%;
    }

    .cxc-guia-campos-tabla thead {
        display: none;
    }

    .cxc-guia-campos-tabla td:first-child {
        font-weight: 600;
        border-bottom: none;
        padding-bottom: 0.15rem;
    }
}

/* SuperUser — Seguridad (bitácora / auditoría) */
.su-seguridad-filtros-card .card-body {
    padding: 1rem 1.25rem;
}

.su-seguridad-desc-cell {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.su-seguridad-json {
    font-size: 0.8125rem;
    line-height: 1.45;
    padding: 1rem;
    margin: 0;
    max-height: 20rem;
    overflow: auto;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 0 0 0.375rem 0.375rem;
}

.su-seguridad-dl dt {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.su-seguridad-dl dd {
    margin-bottom: 0.75rem;
}

.su-seguridad-user-agent {
    word-break: break-word;
    font-size: 0.875rem;
}

.su-seguridad-kpi-label {
    font-size: 0.875rem;
    color: var(--bs-secondary-color, #6c757d);
}

.su-seguridad-kpi-value {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.su-seguridad-append-only {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 767.98px) {
    .su-seguridad-desc-cell {
        max-width: 8rem;
    }

    .su-seguridad-json {
        max-height: 14rem;
    }
}

/* WMS — Packing (panel analista_almacen) */
.wms-input-cantidad-sm {
    width: 5rem;
    min-width: 4.5rem;
}

.wms-select-bulto {
    width: auto;
    min-width: 7rem;
    max-width: 10rem;
}

.wms-icon-sm {
    font-size: 1rem;
    vertical-align: middle;
}

.wms-etiqueta-body {
    background: #f8f9fa;
    padding: 1rem;
}

.wms-etiqueta-container {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.25rem;
}

.wms-etiqueta-header {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

.wms-etiqueta-block {
    margin-bottom: 1rem;
}

.wms-etiqueta-footer {
    border-top: 1px solid #dee2e6;
    padding-top: 0.75rem;
    font-size: 0.875rem;
}

@media print {
    .wms-etiqueta-body {
        background: #fff;
        padding: 0;
    }

    .wms-etiqueta-container {
        border: none;
        max-width: 100%;
    }
}

/* Facturación LIBRE — panel fiscal y aviso legal (preview + PDF) */
.factura-libre-fiscal-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    font-size: 7pt;
}

.factura-libre-fiscal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1.25rem;
    align-items: start;
}

.factura-libre-fiscal-col {
    min-width: 0;
}

.factura-libre-fiscal-col p {
    margin: 0 0 0.35rem;
    font-size: 0.729rem;
    line-height: 1.35;
    color: #212529;
}

.factura-libre-hash {
    word-break: break-all;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.667rem;
}

.factura-libre-aviso-legal {
    margin: 0.75rem 0 0;
    font-size: 0.604rem;
    line-height: 1.4;
    color: #6c757d;
}

.factura-libre-titulo-documento {
    font-size: inherit;
}

.seniat-panel-libre {
    border-left: 4px solid #6c757d;
}

.seniat-libre-impresion-panel {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.seniat-libre-impresion-titulo {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.seniat-libre-impresion-icono {
    font-size: 1.15rem;
    color: #0d6efd;
}

.seniat-libre-formatos-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.seniat-libre-formato-opcion {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
}

.seniat-libre-formato-opcion:has(.form-check-input:checked) {
    border-color: #0d6efd;
    background: #f0f6ff;
}

.seniat-libre-formato-label {
    width: 100%;
    cursor: pointer;
}

.seniat-libre-formato-nombre {
    display: block;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.15rem;
}

.seniat-libre-formato-badge {
    font-size: 0.65rem;
    font-weight: 500;
    vertical-align: middle;
    margin-left: 0.35rem;
}

.seniat-libre-formato-medidas {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.seniat-libre-formato-guia {
    display: block;
    font-size: 0.78rem;
    color: #495057;
    line-height: 1.35;
    margin-bottom: 0.25rem;
}

.seniat-libre-formato-impresora {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #0d6efd;
    line-height: 1.35;
}

.seniat-libre-formato-impresora .material-icons {
    font-size: 1rem;
    flex-shrink: 0;
}

.seniat-libre-formato-capacidad {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #dee2e6;
    max-width: 16rem;
}

.seniat-libre-capacidad-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.seniat-libre-capacidad-input {
    max-width: 8rem;
}

.seniat-libre-capacidad-ayuda {
    display: block;
    font-size: 0.72rem;
    color: #6c757d;
    line-height: 1.35;
    margin-top: 0.2rem;
}

.seniat-libre-impresion-nota {
    font-size: 0.78rem;
    color: #6c757d;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    line-height: 1.4;
}

.seniat-libre-impresion-seccion {
    border-top: 1px solid #dee2e6;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.seniat-libre-plantilla-origen {
    border-left: 4px solid #0d6efd;
    padding-left: 0.85rem;
}

.seniat-libre-enrutado-agente {
    border-left: 4px solid #6c757d;
    padding-left: 0.85rem;
}

.seniat-libre-enrutado-agente .seniat-libre-impresion-icono {
    color: #6c757d;
}

.facturacion-preview-formato-impresion {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #495057;
    background: #e7f1ff;
    border: 1px solid #b6d4fe;
    border-radius: 4px;
    padding: 0.45rem 0.75rem;
    margin-bottom: 1rem;
}

.facturacion-preview-formato-impresion .material-icons {
    font-size: 1.1rem;
    color: #0d6efd;
}

@media (max-width: 767.98px) {
    .factura-libre-fiscal-grid {
        grid-template-columns: 1fr;
    }
}

/* PDF / preview — formatos LIBRE por tenant */
.facturacion-pdf-advertencia--anulada,
.facturacion-pdf-advertencia--cancelada {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.facturacion-pdf-footer-nota--emitida {
    background: #e7f1ff;
    border-color: #b8daff;
    color: #004085;
}

.factura-libre-fiscal--columna-unica .factura-libre-fiscal-grid {
    grid-template-columns: 1fr;
    display: block;
}

.factura-libre-fiscal--columna-unica .factura-libre-fiscal-col {
    display: block;
    width: 100%;
}

.facturacion-pdf-totales--apilado {
    display: block;
}

.facturacion-pdf-totales--apilado .facturacion-pdf-observaciones,
.facturacion-pdf-totales--apilado .facturacion-pdf-totales-box {
    display: block;
    width: 100%;
    padding-right: 0;
    margin-bottom: 0.5rem;
}

.facturacion-pdf-linea-meta {
    display: block;
    font-size: 6pt;
    color: #6c757d;
    font-weight: normal;
    margin-top: 1px;
}

.factura-papel-media-carta .facturacion-pdf-documento-titulo {
    font-size: 16pt;
}

.factura-papel-media-carta .facturacion-pdf-seccion-titulo {
    font-size: 8.5pt;
    margin-bottom: 6px;
}

.factura-papel-media-carta .facturacion-pdf-table th,
.factura-papel-media-carta .facturacion-pdf-table td {
    font-size: 7pt;
}

.factura-papel-cuartilla {
    font-size: 7pt;
}

.factura-papel-cuartilla .facturacion-pdf-documento-titulo {
    font-size: 12pt;
    margin-bottom: 6px;
}

.factura-papel-cuartilla .facturacion-pdf-encabezado {
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.factura-papel-cuartilla .facturacion-pdf-seccion-titulo {
    font-size: 7.5pt;
    margin-bottom: 4px;
}

.factura-papel-cuartilla .factura-libre-fiscal-panel {
    padding: 6px 8px;
    margin: 6px 0;
    font-size: 6pt;
}

.factura-papel-cuartilla .factura-libre-fiscal-col p,
.factura-papel-cuartilla .factura-libre-aviso-legal {
    font-size: 5.5pt;
}

.factura-papel-cuartilla .facturacion-pdf-table th,
.factura-papel-cuartilla .facturacion-pdf-table td {
    font-size: 6pt;
    padding: 1px 2px;
}

.factura-papel-cuartilla .facturacion-pdf-totales-row {
    font-size: 7pt;
}

.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-ejemplar-columna {
    width: 50%;
    max-width: 50%;
    font-size: 5.5pt;
    padding: 0;
    box-sizing: border-box;
    overflow: visible;
    border: none;
}

.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-ejemplar-columna:first-child {
    padding-left: 0;
    padding-right: 0.25mm;
    border-right: 0.25pt solid #ced4da;
}

.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-ejemplar-columna:last-child {
    padding-left: 0.25mm;
    padding-right: 0;
}

.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-documento-titulo {
    font-size: 8pt;
}

.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna {
    width: 50%;
    max-width: 50%;
    font-size: 6pt;
    padding: 0 0.5mm;
    overflow: hidden;
    border: none;
}

.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna:first-child {
    padding-left: 0.5mm;
    padding-right: 0.5mm;
    border-right: 0.25pt solid #ced4da;
}

.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna:last-child {
    padding-left: 0.5mm;
    padding-right: 0.5mm;
}

.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-documento-titulo {
    font-size: 10pt;
}

.factura-papel-termico-80 .facturacion-pdf-documento-titulo {
    font-size: 11pt;
    margin-bottom: 4px;
}

.factura-papel-termico-80 .facturacion-pdf-documento-info,
.factura-papel-termico-80 .facturacion-pdf-seccion-titulo {
    font-size: 6.5pt;
}

.factura-papel-termico-80 .factura-libre-fiscal-panel {
    padding: 4px 5px;
    margin: 4px 0;
    font-size: 5.5pt;
}

.factura-papel-termico-80 .factura-libre-fiscal-col p,
.factura-papel-termico-80 .factura-libre-aviso-legal {
    font-size: 5pt;
    line-height: 1.25;
}

.factura-papel-termico-80 .facturacion-pdf-table th,
.factura-papel-termico-80 .facturacion-pdf-table td {
    font-size: 6pt;
    padding: 1px 2px;
}

.factura-papel-termico-80 .facturacion-pdf-producto-nombre {
    font-size: 6pt;
    word-break: break-word;
}

.factura-papel-termico-80 .facturacion-pdf-totales-row {
    font-size: 6.5pt;
}

.factura-papel-termico-80 .facturacion-pdf-footer {
    margin-top: 8px;
    padding-top: 6px;
}

.facturacion-preview-document.factura-papel-media-carta {
    max-width: 52rem;
}

.facturacion-preview-document.factura-papel-cuartilla {
    max-width: 24rem;
}

.facturacion-preview-document.factura-papel-termico-80 {
    max-width: 20rem;
}

.facturacion-preview-totales--apilado .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

.factura-papel-media-carta .facturacion-preview-col-descuento,
.factura-papel-media-carta .facturacion-preview-col-iva,
.factura-papel-media-carta .facturacion-preview-col-monto-iva,
.factura-papel-cuartilla .facturacion-preview-col-descuento,
.factura-papel-cuartilla .facturacion-preview-col-iva,
.factura-papel-cuartilla .facturacion-preview-col-monto-iva {
    display: none;
}

.factura-papel-termico-80 .facturacion-preview-col-precio,
.factura-papel-termico-80 .facturacion-preview-col-descuento,
.factura-papel-termico-80 .facturacion-preview-col-iva,
.factura-papel-termico-80 .facturacion-preview-col-monto-iva {
    display: none;
}

@media (max-width: 767.98px) {
    .facturacion-preview-document.factura-papel-media-carta,
    .facturacion-preview-document.factura-papel-cuartilla,
    .facturacion-preview-document.factura-papel-termico-80 {
        max-width: 100%;
    }
}

/* Impresión directa POS — modal e iframe oculto */
.facturacion-impresion-modal-icono {
    font-size: 1.25rem;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.facturacion-impresion-modal-modo {
    font-size: 0.9rem;
    color: #495057;
}

.facturacion-impresion-modal-etiquetas {
    margin-bottom: 0.75rem;
}

.facturacion-impresion-modal-etiquetas .facturacion-impresion-modal-modo {
    margin-bottom: 0.35rem;
}

.facturacion-impresion-modal-etiquetas .facturacion-impresion-modal-modo:last-child {
    margin-bottom: 0;
}

.facturacion-impresion-advertencias-list {
    padding-left: 1.15rem;
    font-size: 0.85rem;
    line-height: 1.45;
}

.facturacion-impresion-modal-nota {
    font-size: 0.82rem;
    color: #6c757d;
    margin-top: 0.75rem;
}

.facturacion-impresion-iframe {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border: none;
    overflow: hidden;
}

.facturacion-impresion-iframe--visible {
    width: 1px;
    height: 1px;
    left: 0;
    top: 0;
    opacity: 0.01;
    pointer-events: none;
    z-index: -1;
}

.facturacion-impresion-iframe--activo {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 800px;
    height: 1100px;
    opacity: 0;
    border: none;
    pointer-events: none;
    z-index: -1;
    background: transparent;
}

/* Página intermedia — impresión tras emitir factura */
.facturacion-impresion-emitida-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 1rem;
}

.facturacion-impresion-emitida-card {
    max-width: 28rem;
    width: 100%;
}

.facturacion-impresion-emitida-icono {
    font-size: 2.5rem;
    color: #198754;
}

.facturacion-impresion-emitida-titulo {
    font-weight: 600;
}

.facturacion-impresion-emitida-numero {
    font-size: 1rem;
    color: #495057;
}

.facturacion-impresion-emitida-estado {
    font-size: 0.9rem;
    color: #6c757d;
}

.facturacion-impresion-emitida-spinner {
    width: 2rem;
    height: 2rem;
}

.facturacion-impresion-emitida-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* PDF — encabezado emisor / documento (2 columnas) */
.facturacion-pdf-encabezado-reserva-superior {
    display: block;
    width: 100%;
    height: 35mm;
    min-height: 35mm;
    flex-shrink: 0;
}

.facturacion-pdf-encabezado--emisor-dos-col {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 8px;
    padding-bottom: 6px;
    page-break-inside: avoid;
    width: 100%;
}

.facturacion-pdf-encabezado-emisor-grid {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.facturacion-pdf-encabezado-col {
    display: table-cell;
    vertical-align: top;
    width: 50%;
    padding: 0 2px;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.facturacion-pdf-encabezado-linea {
    margin: 0 0 2px;
    font-size: 7.5pt;
    line-height: 1.25;
    color: #495057;
}

.facturacion-pdf-encabezado-factura-num {
    font-size: 8.5pt;
    color: #212529;
}

.factura-libre-fiscal-grid--receptor .factura-libre-fiscal-col {
    width: 100%;
}

/* Cuartilla vertical ORIGINAL+COPIA — simetría 50/50 */
.facturacion-pdf-ejemplares-grid--cuartilla-vertical {
    width: 100%;
    table-layout: fixed;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-ejemplar-columna {
    width: 50%;
    max-width: 50%;
    padding: 0;
    box-sizing: border-box;
    overflow: visible;
    border: none;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-ejemplar-columna:first-child {
    padding-left: 0;
    padding-right: 0.25mm;
    border-right: 0.25pt solid #ced4da;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-ejemplar-columna:last-child {
    padding-left: 0.25mm;
    padding-right: 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-encabezado-col {
    padding: 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-encabezado-emisor-grid,
.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-totales-fiscales-grid,
.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-table {
    width: 100%;
    max-width: 100%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-table th,
.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-table td {
    font-size: 5pt;
    padding: 1px 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-encabezado-linea {
    font-size: 5pt;
    line-height: 1.15;
    margin-bottom: 1px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-encabezado-factura-num {
    font-size: 5.5pt;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-encabezado--emisor-dos-col {
    margin-bottom: 4px;
    padding-bottom: 4px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-encabezado-reserva-superior {
    height: 35mm;
    min-height: 35mm;
}

/* Cuartilla horizontal ORIGINAL+COPIA — ~137,5×108 mm por columna en hoja 275×108 mm */
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal {
    width: 100%;
    table-layout: fixed;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna {
    width: 50%;
    max-width: 50%;
    min-width: 0;
    padding: 0 0.5mm;
    box-sizing: border-box;
    overflow: hidden;
    border: none;
    vertical-align: top;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna:first-child {
    padding-left: 0.5mm;
    padding-right: 0.5mm;
    border-right: 0.25pt solid #ced4da;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna:last-child {
    padding-left: 0.5mm;
    padding-right: 0.5mm;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-encabezado-col {
    padding: 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-encabezado-emisor-grid,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-totales-fiscales-grid,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-table {
    width: 100%;
    max-width: 100%;
}

.facturacion-pdf-table--detalle-compacto {
    table-layout: fixed;
    width: 100%;
}

.facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--idx {
    width: 2.5%;
}

.facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--producto {
    width: 42.5%;
}

.facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--cant {
    width: 11%;
}

.facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--precio {
    width: 22%;
}

.facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--total {
    width: 18%;
}

.factura-papel-media-carta .facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--idx,
.factura-papel-media-carta .facturacion-pdf-col--idx {
    width: 2.5%;
}

.factura-papel-media-carta .facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--producto,
.factura-papel-media-carta .facturacion-pdf-col--producto {
    width: 42.5%;
}

.factura-papel-media-carta .facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--cant,
.factura-papel-media-carta .facturacion-pdf-col--cant {
    width: 11%;
}

.factura-papel-media-carta .facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--precio,
.factura-papel-media-carta .facturacion-pdf-col--precio {
    width: 22%;
}

.factura-papel-media-carta .facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--total,
.factura-papel-media-carta .facturacion-pdf-col--total {
    width: 18%;
}

.facturacion-pdf-table--ticket {
    table-layout: fixed;
    width: 100%;
}

.facturacion-pdf-table--ticket .facturacion-pdf-col--idx {
    width: 4%;
}

.facturacion-pdf-table--ticket .facturacion-pdf-col--producto {
    width: 56%;
}

.facturacion-pdf-table--ticket .facturacion-pdf-col--cant {
    width: 15%;
}

.facturacion-pdf-table--ticket .facturacion-pdf-col--total {
    width: 25%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-col--idx,
.factura-papel-cuartilla--apaisada .facturacion-pdf-col--idx {
    width: 2.5%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-col--producto,
.factura-papel-cuartilla--apaisada .facturacion-pdf-col--producto {
    width: 40.5%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-col--cant,
.factura-papel-cuartilla--apaisada .facturacion-pdf-col--cant {
    width: 10%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-col--precio,
.factura-papel-cuartilla--apaisada .facturacion-pdf-col--precio {
    width: 22%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-col--total,
.factura-papel-cuartilla--apaisada .facturacion-pdf-col--total {
    width: 18%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-col--idx {
    width: 2.5%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-col--producto {
    width: 42.5%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-col--cant {
    width: 11%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-col--precio {
    width: 22%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-col--total {
    width: 17%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-table th,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-table td {
    font-size: 5.5pt;
    padding: 1px 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-encabezado-linea {
    font-size: 5.5pt;
    line-height: 1.15;
    margin-bottom: 1px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-encabezado-factura-num {
    font-size: 6pt;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-encabezado--emisor-dos-col {
    margin-bottom: 4px;
    padding-bottom: 4px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-encabezado-reserva-superior {
    height: 22mm;
    min-height: 22mm;
}

/* PDF — totales fiscales Bs / USD / información legal */
.facturacion-pdf-totales-fiscales {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid #dee2e6;
    page-break-inside: avoid;
    width: 100%;
}

.facturacion-pdf-totales-fiscales-grid {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.facturacion-pdf-totales-fiscales-col {
    display: table-cell;
    vertical-align: top;
    padding: 0 4px;
    box-sizing: border-box;
}

.facturacion-pdf-totales-fiscales-col--ves {
    width: 34%;
}

.facturacion-pdf-totales-fiscales-col--usd {
    width: 33%;
}

.facturacion-pdf-totales-fiscales-col--info {
    width: 33%;
}

.facturacion-pdf-totales-fiscales-grid--sin-usd .facturacion-pdf-totales-fiscales-col--ves {
    width: 42%;
}

.facturacion-pdf-totales-fiscales-grid--sin-usd .facturacion-pdf-totales-fiscales-col--info {
    width: 58%;
}

.facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-grid {
    display: block;
}

.facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-col--ves,
.facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-col--usd {
    display: inline-block;
    width: 49%;
    vertical-align: top;
    box-sizing: border-box;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px 5px;
}

.facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-col--info {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 0 2px;
    box-sizing: border-box;
}

.facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-grid--sin-usd .facturacion-pdf-totales-fiscales-col--ves {
    display: block;
    width: 100%;
}

.facturacion-pdf-totales-fiscales--compacto .facturacion-pdf-totales-fiscales-grid {
    display: block;
}

.facturacion-pdf-totales-fiscales--compacto .facturacion-pdf-totales-fiscales-col--ves,
.facturacion-pdf-totales-fiscales--compacto .facturacion-pdf-totales-fiscales-col--usd {
    display: inline-block;
    width: 49%;
    vertical-align: top;
    background: #f8f9fa;
    border-radius: 3px;
    padding: 4px 3px;
    box-sizing: border-box;
}

.facturacion-pdf-totales-fiscales--compacto .facturacion-pdf-totales-fiscales-col--info {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 0 2px;
}

.facturacion-pdf-totales-fiscales--ticket {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #dee2e6;
}

.facturacion-pdf-totales-fiscales--ticket .facturacion-pdf-totales-fiscales-grid {
    display: block;
}

.facturacion-pdf-totales-fiscales--ticket .facturacion-pdf-totales-fiscales-col--ves,
.facturacion-pdf-totales-fiscales--ticket .facturacion-pdf-totales-fiscales-col--usd {
    display: block;
    width: 100%;
    background: #f8f9fa;
    border-radius: 3px;
    padding: 3px 2px;
    box-sizing: border-box;
    margin-bottom: 3px;
}

.facturacion-pdf-totales-fiscales--ticket .facturacion-pdf-totales-fiscales-col--info {
    display: block;
    width: 100%;
    padding: 0 2px;
}

.facturacion-pdf-totales-fiscales--ticket .facturacion-pdf-totales-row {
    font-size: 6.5pt;
    line-height: 1.25;
}

.facturacion-pdf-totales-fiscales--ticket .facturacion-pdf-totales-nota-legal {
    font-size: 5.5pt;
    line-height: 1.2;
}

/* Variante compacto-cuartilla — Bs/USD en fila + info legal debajo (ORIGINAL+COPIA) */
.facturacion-pdf-totales-fiscales--compacto-cuartilla {
    margin-top: 2px;
    padding-top: 2px;
    border-top-width: 1px;
    page-break-inside: auto;
    break-inside: auto;
}

.facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-fiscales-grid {
    display: block;
}

.facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-fiscales-col--ves,
.facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-fiscales-col--usd {
    display: inline-block;
    width: 49%;
    vertical-align: top;
    margin-top: 0;
    padding: 2px 1px;
    box-sizing: border-box;
    background: #f8f9fa;
    border-radius: 3px;
}

.facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-fiscales-col--info {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 0 2px;
    box-sizing: border-box;
}

.facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-fiscales-grid--sin-usd .facturacion-pdf-totales-fiscales-col--ves {
    display: block;
    width: 100%;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-detalle,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-detalle,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-detalle {
    margin-bottom: 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-detalle-titulo,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-detalle-titulo,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-detalle-titulo {
    margin-bottom: 2px;
    padding-bottom: 2px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-row,
.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-totales-row,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-row,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-totales-row {
    font-size: 4.5pt;
    line-height: 1.15;
    padding: 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-row,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-totales-row {
    font-size: 5pt;
    line-height: 1.2;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-totales-total,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-totales-total,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-totales-total {
    font-size: 5pt;
    margin-top: 1px;
    padding-top: 1px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-totales-total {
    font-size: 5.5pt;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-totales-nota-legal,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-totales-nota-legal,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-totales-nota-legal {
    font-size: 4pt;
    line-height: 1.2;
    margin: 1px 0 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-totales-row--info,
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-totales-row--info,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-totales-row--info {
    font-size: 4.5pt;
}

.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-table th,
.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-table td,
.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-table th,
.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-table td,
.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-table th,
.factura-papel-cuartilla .facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-table td {
    padding: 1px 0;
}

.facturacion-pdf-totales-row--info {
    font-size: 7.5pt;
    margin-bottom: 2px;
}

.facturacion-pdf-totales-nota-legal {
    font-size: 6.5pt;
    color: #495057;
    line-height: 1.3;
    margin: 4px 0 0;
}

.facturacion-pdf-totales-observaciones {
    margin-top: 4px;
}

.facturacion-pdf-totales-observaciones .facturacion-pdf-seccion-titulo {
    margin-bottom: 2px;
    padding-bottom: 2px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-footer,
.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-footer,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-footer {
    margin-top: 3px;
    padding-top: 3px;
    border-top-width: 1px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-footer-nota {
    padding: 3px 5px;
    font-size: 4.5pt;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-etiqueta {
    margin-bottom: 3px;
    padding: 2px 4px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-table tbody tr,
.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-table tbody tr {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Media carta — ORIGINAL arriba, COPIA abajo en hoja carta */
.facturacion-pdf-ejemplares-grid--media-carta-filas {
    display: block;
    width: 100%;
    page-break-inside: avoid;
}

.facturacion-pdf-ejemplares-grid--media-carta-filas .facturacion-pdf-ejemplar-fila {
    display: block;
    width: 100%;
    min-height: 128mm;
    box-sizing: border-box;
    padding-bottom: 4mm;
    border-bottom: 0.25pt solid #ced4da;
    page-break-inside: avoid;
}

.facturacion-pdf-ejemplares-grid--media-carta-filas .facturacion-pdf-ejemplar-fila:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.facturacion-pdf-ejemplares-grid--media-carta-filas .facturacion-pdf-ejemplar-etiqueta {
    font-size: 6pt;
    padding: 2px 3px;
    margin-bottom: 3px;
}

/* Térmico — ORIGINAL a todo el ancho; COPIA debajo (nunca columnas) */
.facturacion-pdf-ejemplares-grid--termico-filas {
    display: block;
    width: 100%;
    page-break-inside: avoid;
}

.facturacion-pdf-ejemplares-grid--termico-filas .facturacion-pdf-ejemplar-fila {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 3mm;
    border-bottom: 0.25pt dashed #adb5bd;
    page-break-inside: avoid;
}

.facturacion-pdf-ejemplares-grid--termico-filas .facturacion-pdf-ejemplar-fila:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.facturacion-pdf-ejemplares-grid--termico-filas .facturacion-pdf-ejemplar-etiqueta {
    font-size: 5pt;
    padding: 1px 2px;
    margin-bottom: 2px;
}

/* Cinturón: si HTML legado usa columnas en térmico, forzar apilado a todo el ancho */
.factura-papel-termico-80.facturacion-pdf--dos-ejemplares .facturacion-pdf-ejemplares-grid,
.factura-papel-termico-58.facturacion-pdf--dos-ejemplares .facturacion-pdf-ejemplares-grid {
    display: block;
    width: 100%;
}

.factura-papel-termico-80 .facturacion-pdf-ejemplar-columna,
.factura-papel-termico-58 .facturacion-pdf-ejemplar-columna {
    display: block;
    float: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Cuartilla vertical — ORIGINAL arriba, COPIA abajo en hoja 108×280 mm */
.facturacion-pdf-ejemplares-grid--cuartilla-filas {
    display: block;
    width: 100%;
    page-break-inside: avoid;
}

.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-ejemplar-fila {
    display: block;
    width: 100%;
    min-height: 132mm;
    box-sizing: border-box;
    padding-bottom: 3mm;
    border-bottom: 0.25pt solid #ced4da;
    page-break-inside: avoid;
    font-size: 5.5pt;
    line-height: 1.2;
}

.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-ejemplar-fila:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-ejemplar-etiqueta {
    font-size: 5pt;
    padding: 2px 3px;
    margin-bottom: 2px;
}

.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-documento-titulo {
    font-size: 8pt;
}

.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-table th,
.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-table td {
    font-size: 5pt;
    padding: 1px 0;
}

.facturacion-pdf-ejemplares-grid--cuartilla-filas .facturacion-pdf-table tbody tr {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* LIBRE compacto — una página: sin continuación automática del detalle */
.factura-libre-una-pagina .facturacion-pdf-table tbody {
    page-break-inside: avoid;
    break-inside: avoid;
}

.factura-libre-una-pagina .facturacion-pdf-detalle {
    page-break-inside: avoid;
    break-inside: avoid;
    overflow: hidden;
}

.facturacion-capacidad-libre-badge {
    margin-left: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    vertical-align: middle;
}

.facturacion-moneda-base-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.65rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #495057;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

.facturacion-moneda-base-badge-icon {
    font-size: 0.9rem;
    line-height: 1;
    color: #868e96;
}

.facturacion-moneda-base-badge-sec {
    color: #868e96;
    font-weight: 400;
}

.dashboard-monedas-indicador {
    display: flex;
    align-items: center;
    margin: 0 0 0.75rem;
}

.dashboard-monedas-badge {
    margin-left: 0;
}

.admin-empresa-details .dashboard-monedas-indicador {
    margin: 0.35rem 0 0;
}

.admin-dashboard-header .facturacion-moneda-base-badge {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(255, 255, 255, 0.65);
    color: #343a40;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    font-size: 0.8rem;
    padding: 0.28rem 0.65rem;
}

.admin-dashboard-header .facturacion-moneda-base-badge-icon {
    color: #5c6bc0;
}

.admin-dashboard-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.admin-dashboard-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.admin-dashboard-card-monedas .admin-card-value-monedas {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
}

.admin-dashboard-card-monedas .admin-card-monedas-sep {
    color: #adb5bd;
    font-weight: 400;
}

.admin-dashboard-card-monedas .admin-card-sublabel {
    margin-top: 2px;
    font-size: 0.8rem;
    color: #6c757d;
}

.licencias-list-header .dashboard-monedas-indicador {
    margin: 0.5rem 0 0;
}

.facturacion-capacidad-libre--ok {
    background: #d1e7dd;
    color: #0f5132;
}

.facturacion-capacidad-libre--warn {
    background: #fff3cd;
    color: #664d03;
}

.facturacion-capacidad-libre--danger {
    background: #f8d7da;
    color: #842029;
}

.facturacion-capacidad-libre-alerta {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.facturacion-capacidad-libre-alerta-icono {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* Cuartilla — evitar salto prematuro antes de totales */
.facturacion-pdf-ejemplares-grid--cuartilla-horizontal,
.facturacion-pdf-ejemplares-grid--cuartilla-vertical {
    page-break-inside: auto;
    break-inside: auto;
}

.facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna,
.facturacion-pdf-ejemplares-grid--cuartilla-vertical .facturacion-pdf-ejemplar-columna {
    page-break-inside: auto;
    break-inside: auto;
}

/* Cuartilla horizontal — simetría lienzo (anula reglas genéricas dos-ejemplares) */
.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal {
    width: 100%;
    margin: 0;
    padding: 0;
}

.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna {
    width: 50%;
    max-width: 50%;
    min-width: 0;
    padding: 0 0.5mm;
    border: none;
    overflow: hidden;
}

.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna:first-child {
    padding-left: 0.5mm;
    padding-right: 0.5mm;
    border-right: 0.25pt solid #ced4da;
}

.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-ejemplar-columna:last-child {
    padding-left: 0.5mm;
    padding-right: 0.5mm;
}

.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-table th,
.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-table td {
    padding: 1px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla--apaisada .facturacion-pdf-ejemplares-grid--cuartilla-horizontal .facturacion-pdf-totales-fiscales-col {
    padding: 0 1px;
}

.facturacion-pdf--dos-ejemplares .facturacion-pdf-totales-fiscales {
    page-break-inside: avoid;
}

.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla--apaisada .facturacion-pdf-totales-fiscales,
.facturacion-pdf--dos-ejemplares.factura-papel-cuartilla:not(.factura-papel-cuartilla--apaisada) .facturacion-pdf-totales-fiscales {
    page-break-inside: auto;
    break-inside: auto;
}

.factura-papel-cuartilla.facturacion-pdf--dos-ejemplares .facturacion-pdf-totales-fiscales {
    margin-top: 2px;
    padding-top: 2px;
}

.factura-papel-cuartilla:not(.facturacion-pdf--dos-ejemplares) .facturacion-pdf-totales-fiscales {
    margin-top: 6px;
    padding-top: 6px;
}

.factura-papel-cuartilla:not(.facturacion-pdf--dos-ejemplares) .facturacion-pdf-totales-row {
    font-size: 6pt;
}

.factura-papel-cuartilla:not(.facturacion-pdf--dos-ejemplares) .facturacion-pdf-totales-nota-legal {
    font-size: 5pt;
}

.factura-papel-termico-80 .facturacion-pdf-totales-fiscales,
.factura-papel-termico-58 .facturacion-pdf-totales-fiscales {
    margin-top: 4px;
}

/* Impresión local — aviso API key agente */
.imp-api-key-alert .imp-api-key-valor {
    word-break: break-all;
    font-size: 0.95rem;
}

.imp-api-key-copiada {
    opacity: 0.85;
}

/* Impresión local — plantillas activas */
.imp-plantilla-fila-activa {
    background-color: rgba(25, 135, 84, 0.06);
}

.imp-plantilla-badge-activa {
    background-color: #198754;
    color: #fff;
}

.imp-plantilla-badge-en-uso {
    background-color: #0d6efd;
    color: #fff;
}

.imp-plantilla-icono-en-uso {
    font-size: 1.1rem;
    color: #0d6efd;
    vertical-align: middle;
}

.imp-salud-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.imp-salud-badge--ok {
    background-color: #d1fae5;
    color: #065f46;
}

.imp-salud-badge--warning {
    background-color: #fef3c7;
    color: #92400e;
}

.imp-salud-badge--danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.imp-salud-badge--info {
    background-color: #e0f2fe;
    color: #075985;
}

.imp-salud-ayuda-enlace {
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
    font-weight: 500;
}

.imp-salud-ayuda-enlace:hover {
    text-decoration: underline;
}

.cxc-guia-badge--ok {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.cxc-guia-badge--warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.cxc-guia-badge--danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.cxc-guia-item--ok {
    border-left: 3px solid #059669;
}

.cxc-guia-item--warning {
    border-left: 3px solid #d97706;
}

.cxc-guia-item--danger {
    border-left: 3px solid #dc2626;
}

@media (max-width: 767.98px) {
    .facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-grid {
        display: block;
    }

    .facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-col {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* PDF reimpresión emitida — presentación (no altera preview/borrador) */
.facturacion-pdf-body--emitida .facturacion-pdf-encabezado--emitida .facturacion-pdf-empresa-logo {
    max-width: 90px;
    max-height: 45px;
}

.facturacion-pdf-body--emitida .facturacion-pdf-encabezado--emitida .facturacion-pdf-empresa-nombre {
    font-size: 8pt !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-encabezado--emitida .facturacion-pdf-empresa-comercial,
.facturacion-pdf-body--emitida .facturacion-pdf-encabezado--emitida .facturacion-pdf-empresa-info,
.facturacion-pdf-body--emitida .facturacion-pdf-encabezado--emitida .facturacion-pdf-documento-info,
.facturacion-pdf-body--emitida .facturacion-pdf-encabezado--emitida .facturacion-pdf-encabezado-linea {
    font-size: 8pt !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-encabezado--emitida .facturacion-pdf-documento-titulo {
    font-size: 8pt !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida {
    padding: 4px 6px !important;
    margin-bottom: 4px !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida,
.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida .facturacion-pdf-cliente-info,
.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida .facturacion-pdf-seccion-titulo,
.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida .facturacion-pdf-cliente-titulo {
    font-size: 7.5pt !important;
    line-height: 1 !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida .facturacion-pdf-cliente-info,
.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida .facturacion-pdf-seccion-titulo,
.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida .facturacion-pdf-cliente-titulo {
    margin: 0 !important;
    padding: 0 !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-cliente--emitida .facturacion-pdf-cliente-contenido {
    margin-top: 2px !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-detalle {
    margin-bottom: 4px !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-detalle-titulo {
    font-size: 7.5pt !important;
    line-height: 1 !important;
    margin: 0 0 2px !important;
    padding: 0 0 2px !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-detalle .facturacion-pdf-table th,
.facturacion-pdf-body--emitida .facturacion-pdf-detalle .facturacion-pdf-table td,
.facturacion-pdf-body--emitida .facturacion-pdf-detalle .facturacion-pdf-producto-nombre {
    font-size: 7.5pt !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 2px !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-detalle .facturacion-pdf-producto-nombre {
    font-weight: normal !important;
    color: #212529;
}

.facturacion-pdf-body--emitida .facturacion-pdf-detalle .facturacion-pdf-table {
    margin-bottom: 2px !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-fiscales--carta-pantalla {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #dee2e6;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-tabla-carta {
    width: 100%;
    table-layout: fixed;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-tabla-carta td {
    font-size: 8pt !important;
    line-height: 1 !important;
    padding: 0 2px !important;
    margin: 0 !important;
    vertical-align: top;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-tabla-carta .facturacion-pdf-totales-monto-ves,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-tabla-carta .facturacion-pdf-totales-monto-usd {
    white-space: nowrap;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-tabla-carta .facturacion-pdf-totales-etiqueta {
    white-space: normal;
}

.facturacion-pdf-body--emitida .facturacion-pdf-col--tot-etiqueta {
    width: 46%;
}

.facturacion-pdf-body--emitida .facturacion-pdf-col--tot-ves {
    width: 27%;
}

.facturacion-pdf-body--emitida .facturacion-pdf-col--tot-usd {
    width: 27%;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-tabla-carta tr.facturacion-pdf-totales-total td {
    font-weight: bold;
    border-top: 1px solid #dee2e6;
    padding-top: 1px !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-pie {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid #dee2e6;
    width: 100%;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-pie .facturacion-pdf-totales-row,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-pie .facturacion-pdf-totales-nota-legal,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-pie .facturacion-pdf-observaciones-texto,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-pie .facturacion-pdf-seccion-titulo {
    font-size: 8pt !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-pie .facturacion-pdf-totales-nota-legal {
    margin-top: 2px !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-pie .facturacion-pdf-totales-row {
    padding: 0 !important;
}

.facturacion-pdf-body--emitida .facturacion-pdf-celda-sku {
    font-size: 7.5pt !important;
    font-weight: normal !important;
    color: #495057;
    white-space: nowrap;
}

.facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--sku,
.facturacion-pdf-col--sku {
    width: 14%;
}

.facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--descripcion,
.facturacion-pdf-col--descripcion {
    width: 31%;
}

.facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--sku ~ .facturacion-pdf-col--descripcion ~ .facturacion-pdf-col--cant,
.facturacion-pdf-body--emitida .facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--cant {
    width: 11%;
}

.facturacion-pdf-body--emitida .facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--precio {
    width: 22%;
}

.facturacion-pdf-body--emitida .facturacion-pdf-table--detalle-compacto .facturacion-pdf-col--total {
    width: 18%;
}

.facturacion-pdf-body--emitida .facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-col--ves,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-fiscales--estandar .facturacion-pdf-totales-fiscales-col--usd,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-fiscales--compacto .facturacion-pdf-totales-fiscales-col--ves,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-fiscales--compacto .facturacion-pdf-totales-fiscales-col--usd,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-fiscales-col--ves,
.facturacion-pdf-body--emitida .facturacion-pdf-totales-fiscales--compacto-cuartilla .facturacion-pdf-totales-fiscales-col--usd {
    width: 49%;
}

/* Contingencia global tasas de cambio (superuser) */
.contingencia-tasas-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.contingencia-tasas-banner-icon {
    flex-shrink: 0;
    font-size: 1.5rem;
}

.contingencia-tasas-banner-meta {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.contingencia-tasas-banner-motivo {
    margin-top: 0.35rem;
    font-size: 0.9rem;
}

.contingencia-tasas-banner-link {
    display: inline-block;
    margin-left: 0.5rem;
    font-weight: 600;
}

.contingencia-tasas-card .card-header {
    background-color: var(--bs-light, #f8f9fa);
}

.contingencia-tasas-panel .btn .material-icons {
    vertical-align: middle;
    font-size: 1.1rem;
    margin-right: 0.15rem;
}

@media (max-width: 767.98px) {
    .contingencia-tasas-banner {
        flex-direction: column;
    }
}

.cxc-conciliacion-diferencial {
    font-weight: 600;
    color: var(--bs-warning-text-emphasis, #664d03);
}

/* --- ERP Data Base (SuperUser Seguridad) --- */
.erp-db-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.erp-db-banner .material-icons {
    font-size: 1.25rem;
    flex-shrink: 0;
}
.erp-db-search {
    display: flex;
    gap: 0.5rem;
    max-width: 36rem;
}

.erp-busqueda-automatica-card .form-text {
    color: #5f6368;
}

.erp-busqueda-automatica-form input[type="search"] {
    min-width: 0;
}
.erp-db-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.erp-db-metrics .facturacion-moneda-base-badge {
    margin-left: 0;
}
.erp-db-row-delicate {
    background: #fff5f5;
}
.erp-db-delicate-badge {
    font-size: 0.65rem;
    vertical-align: middle;
    margin-left: 0.35rem;
}
.erp-db-table-scroll {
    overflow-x: auto;
}
.erp-db-cell {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}
.erp-db-id {
    font-size: 0.75rem;
}
.erp-db-tablas-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.erp-db-tablas-filtro {
    flex: 1 1 16rem;
    max-width: 28rem;
}
.erp-db-tablas-con-datos {
    margin: 0;
}
.erp-db-tablas-empty-filtro[hidden] {
    display: none !important;
}
.erp-db-tabla-row[hidden] {
    display: none !important;
}
.erp-db-row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}
.erp-db-row-actions .btn-action {
    flex-shrink: 0;
}
.erp-db-detail-page .licencias-list-header {
    align-items: flex-start;
}
.erp-db-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.erp-db-detail-lead {
    font-size: 0.9rem;
}
.erp-db-detail-table-wrap {
    overflow-x: auto;
}
.erp-db-detail-table th.erp-db-detail-field {
    vertical-align: top;
    min-width: 10rem;
    max-width: 16rem;
    font-weight: 500;
}
.erp-db-detail-field code {
    display: block;
    font-size: 0.8rem;
    word-break: break-word;
}
.erp-db-detail-label {
    display: block;
    font-size: 0.75rem;
    color: #5f6368;
    margin-top: 0.15rem;
}
.erp-db-detail-value {
    vertical-align: top;
    word-break: break-word;
}
.erp-db-detail-value-text {
    font-size: 0.9rem;
}
.erp-db-detail-value-pre {
    margin: 0;
    padding: 0.5rem 0.65rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    overflow-x: auto;
}
.erp-db-detail-json {
    max-height: 16rem;
    overflow-y: auto;
}
.erp-db-detail-footnote {
    font-size: 0.85rem;
}
@media (max-width: 575.98px) {
    .erp-db-detail-table thead {
        display: none;
    }
    .erp-db-detail-table tbody tr {
        display: block;
        border-bottom: 1px solid #dee2e6;
        padding: 0.5rem 0;
    }
    .erp-db-detail-table tbody th,
    .erp-db-detail-table tbody td {
        display: block;
        width: 100%;
        max-width: none;
        border: 0;
        padding: 0.25rem 0.75rem;
    }
}

.erp-db-delete-page .licencias-list-header {
    align-items: flex-start;
}
.erp-db-delete-lead {
    margin-top: 0.35rem;
    font-size: 0.95rem;
}
.erp-db-delete-warning,
.erp-db-delete-gates {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.erp-db-delete-warning .material-icons,
.erp-db-delete-gates .material-icons {
    flex-shrink: 0;
    font-size: 1.25rem;
}
.erp-db-delete-code {
    font-size: 0.85rem;
    margin-top: 0.35rem;
}
.erp-db-delete-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.erp-db-delete-summary-wrap {
    overflow-x: auto;
}
.erp-db-delete-summary-title {
    padding: 0.75rem 1rem 0;
    margin: 0;
}
.erp-db-delete-summary td:last-child {
    white-space: nowrap;
}
.erp-db-delete-empty-summary {
    font-size: 0.9rem;
}
.erp-db-delete-form-card {
    border: 1px solid #f1b0b7;
    border-radius: 0.375rem;
    padding: 1rem 1.25rem;
    background: #fff5f5;
    max-width: 36rem;
}
.erp-db-delete-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}
.erp-db-delete-form-actions .btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.erp-db-delete-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
@media (max-width: 575.98px) {
    .erp-db-delete-form-card {
        max-width: none;
    }
    .erp-db-delete-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .erp-db-delete-form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.presentacion-sync-maestro-alerta {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.presentacion-sync-maestro-alerta .material-icons {
    flex-shrink: 0;
}

/* Categorías de gastos — admin Configuración */
.gastos-categorias-alerta-icono {
    flex-shrink: 0;
}

.gastos-categorias-predef-lista .badge {
    font-weight: 400;
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 575.98px) {
    .gastos-categorias-precarga-card .card-body .btn {
        width: 100%;
    }
}

/* Compras — política costo maestro (precio de compra) */
.compras-politica-costo-titulo {
    font-weight: 600;
}

.compras-politica-costo-intro {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.compras-politica-costo-modos .form-check-label {
    font-weight: 500;
}

.compras-politica-costo-modos .form-text {
    margin-left: 1.625rem;
}

.compras-politica-costo-formula-wrap .form-control.font-monospace {
    font-size: 0.875rem;
}

@media (max-width: 767.98px) {
    .compras-politica-costo-modos legend {
        font-size: 1rem;
    }
}

/* Mayoreo externo — catálogo sanitizado (portal vendedor) */
.tabla-mayoreo-catalogo {
    min-width: 640px;
}

.tabla-mayoreo-catalogo th,
.tabla-mayoreo-catalogo td {
    vertical-align: middle;
}

.mayoreo-catalogo-busqueda .form-label {
    font-weight: 500;
}

.mayoreo-catalogo-hint {
    font-size: 0.8125rem;
}

.mayoreo-catalogo-paginacion-oculta {
    display: none;
}

.mayoreo-dashboard-tasas {
    margin-bottom: 1rem;
}

.mayoreo-dashboard-tasas .tasa-dia-card {
    margin-bottom: 0.75rem;
}

.mayoreo-dashboard-tasas-nota {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.mayoreo-dashboard-tasas-vacio .h5 {
    margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
    .tabla-mayoreo-catalogo {
        min-width: 520px;
        font-size: 0.875rem;
    }

    .mayoreo-catalogo-busqueda .btn .material-icons {
        font-size: 1.125rem;
        vertical-align: middle;
    }

    .mayoreo-dashboard-tasas .tasa-dia-item {
        width: 100%;
    }
}

/* Mayoreo — cartera KYC */
.mayoreo-kyc-panel .mayoreo-kyc-docs-title {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.mayoreo-kyc-panel .status-asignado {
    background: #e8f0fe;
    color: #174ea6;
}

.mayoreo-kyc-panel .mayoreo-cartera-codigo {
    display: inline-block;
    word-break: break-word;
}

.mayoreo-kyc-form-card,
.mayoreo-kyc-decision {
    max-width: 960px;
}

.mayoreo-kyc-dl {
    display: grid;
    grid-template-columns: minmax(6rem, 8rem) 1fr;
    gap: 0.5rem 1rem;
    margin: 0;
}

.mayoreo-kyc-dl dt {
    font-weight: 600;
    color: #555;
}

.mayoreo-kyc-dl dd {
    margin: 0;
    word-break: break-word;
}

.mayoreo-kyc-docs-list .mayoreo-kyc-doc-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mayoreo-kyc-docs-list .mayoreo-kyc-doc-item:last-child {
    border-bottom: 0;
}

.mayoreo-kyc-doc-meta {
    margin-top: 0.35rem;
}

.mayoreo-kyc-rechazo {
    max-width: 960px;
}

@media (max-width: 575.98px) {
    .mayoreo-kyc-actions .btn {
        width: 100%;
    }

    .mayoreo-kyc-dl {
        grid-template-columns: 1fr;
        gap: 0.15rem 0;
    }

    .mayoreo-kyc-dl dt {
        margin-top: 0.5rem;
    }

    .mayoreo-kyc-panel .licencia-actions-cell {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.35rem;
    }

    .mayoreo-kyc-panel .licencias-list-actions .btn {
        width: 100%;
    }
}

/* Mayoreo — pedido POS-like */
.mayoreo-pedido-card {
    max-width: 100%;
}

.tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap {
    max-height: min(16.5rem, 42vh);
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap .tabla-mayoreo-pedido-catalogo {
    width: 100%;
    min-width: 36rem;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap .tabla-mayoreo-pedido-catalogo > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    background-clip: padding-box;
    box-shadow: 0 1px 0 #dee2e6;
}

.tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap .tabla-mayoreo-pedido-catalogo > tbody > tr > td {
    padding: 8px 12px;
}

.tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap .tabla-mayoreo-pedido-catalogo td:nth-child(2) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap .tabla-mayoreo-pedido-catalogo th:last-child,
.tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap .tabla-mayoreo-pedido-catalogo td:last-child {
    white-space: nowrap;
    width: 1%;
}

.mayoreo-pedido-catalogo-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
    position: relative;
    z-index: 1;
}

.mayoreo-pedido-catalogo-pager .btn {
    flex: 0 0 auto;
}

.mayoreo-pedido-cliente-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.mayoreo-pedido-cliente-selector {
    width: 100%;
}

.mayoreo-pedido-pos .mayoreo-pedido-ficha {
    margin-top: 0;
}

.mayoreo-pedido-pos .facturacion-acciones-pos .material-icons {
    font-size: 1.1rem;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.mayoreo-pedido-cliente-wrap {
    width: 100%;
}

.mayoreo-pedido-pos .facturacion-sugerencias-container.mayoreo-pedido-cliente-sugerencias {
    display: none;
    max-height: min(18rem, 50vh);
}

.mayoreo-pedido-pos .facturacion-sugerencias-container.mayoreo-pedido-cliente-sugerencias.is-open {
    display: block;
}

.mayoreo-pedido-cliente-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    text-align: left;
    width: 100%;
}

.mayoreo-pedido-cliente-item-nombre {
    font-weight: 600;
    word-break: break-word;
}

.mayoreo-pedido-cliente-item-meta {
    font-size: 0.8125rem;
    color: #6c757d;
    word-break: break-word;
}

.mayoreo-pedido-cliente-item .status-badge {
    flex-shrink: 0;
    margin-left: auto;
}

.mayoreo-pedido-cliente-vacio {
    cursor: default;
}

.mayoreo-pedido-cliente-select {
    width: 1px;
    min-height: 0;
    max-height: none;
}

.tabla-mayoreo-pedido-catalogo {
    min-width: 36rem;
}

.mayoreo-pedido-totales {
    margin-top: 0.75rem;
}

.mayoreo-pedido-pagos {
    margin-top: 0.25rem;
}

.mayoreo-pedido-pago-ayuda {
    margin-bottom: 0.75rem;
}

.mayoreo-pedido-pago-ficha {
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.mayoreo-pedido-pago-ficha .h6 {
    margin-bottom: 0.75rem;
}

.mayoreo-pedido-pago-acciones {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.mayoreo-pedido-pago-acciones .btn .material-icons {
    font-size: 1.1rem;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.mayoreo-pedido-pagos-registros {
    margin-top: 1rem;
}

.mayoreo-pedido-pagos-registros-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.5rem;
}

.tabla-erp-wrapper.mayoreo-pedido-pagos-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabla-mayoreo-pedido-pagos {
    min-width: 44rem;
}

.tabla-mayoreo-pedido-pagos td {
    overflow-wrap: anywhere;
    vertical-align: top;
}

.mayoreo-pago-instrumento-tasa {
    display: block;
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #6c757d);
}

.mayoreo-pedido-saldo-ficha {
    width: 100%;
    margin-top: 1rem;
    padding: 16px 20px;
    border: 2px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    background: var(--bs-body-bg, #fff);
    text-align: center;
}

.mayoreo-pedido-saldo-label {
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
}

.mayoreo-pedido-saldo-valor {
    margin-bottom: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--bs-body-color, #212529);
}

.mayoreo-pedido-saldo-iso {
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.mayoreo-pedido-saldo-detalle {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--bs-secondary-color, #6c757d);
}

.mayoreo-pedido-saldo-ficha.is-ok {
    border-color: var(--bs-success, #198754);
}

.mayoreo-pedido-saldo-ficha.is-ok .mayoreo-pedido-saldo-valor {
    color: var(--bs-success, #198754);
}

.mayoreo-pedido-saldo-ficha.is-exceso {
    border-color: var(--bs-danger, #dc3545);
    background: var(--bs-danger-bg-subtle, #f8d7da);
}

.mayoreo-pedido-saldo-ficha.is-exceso .mayoreo-pedido-saldo-valor {
    color: var(--bs-danger, #dc3545);
}

.mayoreo-pedido-saldo-ficha.is-pendiente {
    border-color: var(--bs-primary, #0d6efd);
}

.mayoreo-pedido-saldo-ficha.is-pendiente .mayoreo-pedido-saldo-valor {
    color: var(--bs-primary, #0d6efd);
}

.mayoreo-pedido-pago-hint {
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.mayoreo-pedido-monto-group {
    flex-wrap: nowrap;
    width: 100%;
}

.mayoreo-pedido-monto-group .input-group-text {
    font-weight: 600;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mayoreo-pedido-pago-acciones .mayoreo-pedido-pago-hint {
    flex: 1 1 12rem;
    min-width: 0;
}

.mayoreo-pedido-instrumento-ficha {
    margin-top: 0.75rem;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background-color: #fff;
    display: none;
}

.mayoreo-pedido-instrumento-ficha.is-visible {
    display: block;
}

.mayoreo-pedido-instrumento-title {
    margin-bottom: 0.35rem;
}

.mayoreo-pedido-tasa-wrap,
.mayoreo-pedido-monto-inst-wrap {
    display: none;
}

.mayoreo-pedido-tasa-wrap.is-visible,
.mayoreo-pedido-monto-inst-wrap.is-visible {
    display: block;
}

.mayoreo-pedido-tasa-preview {
    font-weight: 600;
    margin-bottom: 0;
}

.mayoreo-pedido-banco-orig-row,
.mayoreo-pedido-cuenta-orig-row {
    display: none;
}

.mayoreo-pedido-banco-orig-row.is-visible,
.mayoreo-pedido-cuenta-orig-row.is-visible {
    display: block;
}

#tablaCarritoMayoreo .mayoreo-qty,
#tablaCarritoMayoreo .mayoreo-desc {
    max-width: 5.5rem;
    margin-left: auto;
}

.mayoreo-pedido-ficha {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background-color: #f8f9fa;
}

.mayoreo-pedido-ficha .h6 {
    margin-bottom: 0.35rem;
}

.mayoreo-pedido-ficha-vacio {
    margin-bottom: 0;
}

.mayoreo-pedido-ficha-dl {
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .mayoreo-pedido-cliente-stack .mayoreo-pedido-ficha-dl {
        grid-template-columns: minmax(7.5rem, 10rem) minmax(0, 1fr)
            minmax(7.5rem, 10rem) minmax(0, 1fr);
        column-gap: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .mayoreo-pedido-actions .btn {
        width: 100%;
    }

    .mayoreo-pedido-pago-acciones .btn {
        width: 100%;
    }

    .mayoreo-pedido-pagos-registros-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .tabla-mayoreo-pedido-pagos {
        min-width: 36rem;
        font-size: 0.875rem;
    }

    .tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap {
        max-height: min(14rem, 38vh);
    }

    .tabla-erp-wrapper.mayoreo-pedido-catalogo-wrap .tabla-mayoreo-pedido-catalogo {
        min-width: 32rem;
        font-size: 0.875rem;
    }

    .mayoreo-pedido-pos .facturacion-sugerencias-container.mayoreo-pedido-cliente-sugerencias {
        max-height: min(14rem, 45vh);
    }

    .mayoreo-pedido-cliente-wrap .input-group .btn .material-icons {
        font-size: 1.25rem;
        vertical-align: middle;
    }

    .mayoreo-pedido-ficha-dl {
        grid-template-columns: 1fr;
        gap: 0.15rem 0;
    }

    .mayoreo-pedido-ficha-dl dt {
        margin-top: 0.4rem;
    }
}

/* Mayoreo — aprobación pedidos GV (Fase 4) */
.mayoreo-aprobacion-panel .mayoreo-aprobacion-ayuda {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.mayoreo-aprobacion-panel .licencia-actions-cell {
    white-space: nowrap;
}

.mayoreo-pedido-eliminar-form--boton {
    display: inline-block;
}

.mayoreo-aprobacion-sin-cajero {
    margin-bottom: 1rem;
}

.mayoreo-aprobacion-aprobar {
    margin-bottom: 0.25rem;
}

.mayoreo-aprobacion-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabla-mayoreo-aprobacion th,
.tabla-mayoreo-aprobacion td {
    white-space: nowrap;
}

.tabla-mayoreo-aprobacion td:first-child,
.tabla-mayoreo-aprobacion td.mayoreo-gv-cobertura-celda {
    white-space: normal;
    min-width: 10rem;
}

.mayoreo-cajero-borrador-label {
    margin-left: 0.35rem;
    font-size: 0.85rem;
    vertical-align: middle;
}

.tabla-erp-wrapper.mayoreo-cajero-pedidos-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mayoreo-cajero-pedidos-wrap .tabla-erp {
    min-width: 56rem;
}

.mayoreo-cajero-pedidos-wrap .mayoreo-cajero-monto {
    white-space: nowrap;
}

.mayoreo-cajero-monto-eq {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

@media (max-width: 767.98px) {
    .mayoreo-aprobacion-panel .mayoreo-kyc-actions .btn {
        width: 100%;
    }

    .mayoreo-pedido-eliminar-form--boton {
        width: 100%;
    }

    .mayoreo-pedido-eliminar-form--boton .btn {
        width: 100%;
    }

    .mayoreo-cajero-borrador-label {
        display: block;
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .mayoreo-cajero-pedidos-wrap .tabla-erp {
        min-width: 44rem;
        font-size: 0.875rem;
    }
}

/* Mayoreo — cobertura GV + POS cajero solo lectura (fases 4–7) */
.mayoreo-gv-bo {
    font-weight: 600;
    color: #b45309;
}

.mayoreo-gv-bo-nota,
.mayoreo-gv-cubierto-ok {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: normal;
    max-width: 11rem;
}

.mayoreo-gv-cubierto-ok {
    color: #0f766e;
}

.mayoreo-cobertura-reporte {
    border: 1px solid #f6ad55;
}

.mayoreo-cobertura-alerta,
.mayoreo-cobertura-ok {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    font-weight: 600;
}

.mayoreo-cobertura-alerta {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.mayoreo-cobertura-ok {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.mayoreo-cobertura-subtitulo {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tabla-mayoreo-cobertura {
    margin-bottom: 0;
}

.mayoreo-gv-bo-fila td {
    font-weight: 600;
    color: #9a3412;
}

.mayoreo-cobertura-pago {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.mayoreo-cobertura-pago-pendiente {
    font-weight: 700;
    color: #9a3412;
}

/* GV — trazabilidad cola CxC mayoreo (Petición F) */
.mayoreo-gv-cola-cxc {
    border-left: 4px solid #0d6efd;
}

.mayoreo-gv-cola-cxc-intro {
    font-size: 0.9rem;
    line-height: 1.45;
}

.mayoreo-gv-cola-cxc-pendiente-emision {
    color: #664d03;
}

.mayoreo-gv-cola-cxc-tabla td {
    vertical-align: middle;
}

.mayoreo-gv-cola-cxc-estado {
    font-weight: 500;
}

.mayoreo-gv-cola-cxc-estado--pendiente {
    background-color: #fff3cd;
    color: #664d03;
}

.mayoreo-gv-cola-cxc-estado--registrado {
    background-color: #d1e7dd;
    color: #0f5132;
}

.mayoreo-gv-cola-cxc-estado--anulado {
    background-color: #e2e3e5;
    color: #41464b;
}

.mayoreo-gv-cola-cxc-pie .badge {
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .mayoreo-gv-cola-cxc-tabla-wrap {
        overflow-x: auto;
    }

    .mayoreo-gv-cola-cxc-pie {
        flex-direction: column;
        align-items: flex-start;
    }
}

.mayoreo-pedido-obs {
    white-space: pre-wrap;
    word-break: break-word;
}

.mayoreo-aprobacion-cobertura-resumen {
    margin-bottom: 1rem;
}

.mayoreo-aprobacion-sin-cobertura,
.mayoreo-aprobacion-cubierto-total,
.mayoreo-aprobacion-habra-backorder {
    margin-bottom: 1rem;
}

.mayoreo-credito-cliente-panel {
    border-left: 4px solid #6366f1;
}

.mayoreo-credito-cliente-dl {
    margin-bottom: 0.75rem;
}

.mayoreo-credito-cliente-nota,
.mayoreo-credito-cliente-ok {
    color: #475569;
    font-size: 0.95rem;
}

.mayoreo-credito-cliente-alerta {
    margin-top: 0.75rem;
}

.mayoreo-pedido-credito-resumen {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.mayoreo-pedido-credito-resumen--bloqueado {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.mayoreo-pedido-credito-resumen--ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.cliente-credito-badge {
    font-weight: 600;
    font-size: 0.78rem;
}

.cliente-credito-badge--sin-credito {
    background-color: #212529;
    color: #fff;
}

.cliente-credito-badge--sin-tope {
    background-color: #6c757d;
    color: #fff;
}

.cliente-credito-badge--ok {
    background-color: #198754;
    color: #fff;
}

.cliente-credito-badge--exceso {
    background-color: #dc3545;
    color: #fff;
}

.cliente-credito-badge--indeterminado {
    background-color: #ffc107;
    color: #212529;
}

.cliente-credito-resumen {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.cliente-credito-resumen-titulo {
    margin-bottom: 0.65rem;
}

.cliente-credito-resumen-dl {
    display: grid;
    grid-template-columns: minmax(8rem, 34%) 1fr;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0;
}

.cliente-credito-resumen-dl dt {
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.cliente-credito-resumen-dl dd {
    margin: 0;
}

@media (max-width: 575.98px) {
    .cliente-credito-resumen-dl {
        grid-template-columns: 1fr;
    }

    .cliente-credito-resumen-dl dt {
        margin-top: 0.35rem;
    }
}

@media (max-width: 575.98px) {
    .mayoreo-credito-cliente-dl dt,
    .mayoreo-credito-cliente-dl dd {
        font-size: 0.9rem;
    }
}

.mayoreo-pos-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.8rem;
    font-weight: 600;
    vertical-align: middle;
}

.mayoreo-pos-badge-icon {
    font-size: 1rem;
}

.mayoreo-pos-devolver-form {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.mayoreo-pos-solo-lectura .facturacion-tabs {
    display: none;
}

.mayoreo-pos-solo-lectura .item-cantidad,
.mayoreo-pos-solo-lectura .item-precio,
.mayoreo-pos-solo-lectura .item-descuento,
.mayoreo-pos-solo-lectura .item-presentacion {
    background-color: #f8f9fa;
}

@media (max-width: 767.98px) {
    .mayoreo-pos-badge {
        display: flex;
        margin-left: 0;
        margin-top: 0.35rem;
        width: fit-content;
        max-width: 100%;
    }

    .mayoreo-pos-devolver-form {
        justify-content: stretch;
    }

    .mayoreo-pos-devolver-form .btn {
        width: 100%;
    }

    .tabla-mayoreo-aprobacion th,
    .tabla-mayoreo-aprobacion td {
        white-space: nowrap;
        font-size: 0.8rem;
    }
}

/* Mayoreo — comisiones portal (Fase 5) */
.mayoreo-comisiones-panel .mayoreo-comision-pct {
    font-size: 0.85rem;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .mayoreo-comisiones-panel .tabla-erp {
        font-size: 0.875rem;
    }
}

/* Mayoreo — comisiones / liquidación Fase 6 */
.mayoreo-politica-card {
    margin-bottom: 1.5rem;
}

.mayoreo-politica-h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.mayoreo-politica-actions {
    margin-top: 1.25rem;
}

.mayoreo-comision-sel-status {
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
}

.mayoreo-comision-col-sel {
    width: 3rem;
    min-width: 3rem;
    max-width: 3.5rem;
    vertical-align: middle;
    overflow: visible;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    position: relative;
    z-index: 1;
}

.mayoreo-comisiones-gv .tabla-erp thead th.mayoreo-comision-col-sel,
.mayoreo-comisiones-gv .tabla-erp tbody td.mayoreo-comision-col-sel {
    overflow: visible;
    pointer-events: auto;
}

.mayoreo-comision-sel-hit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    margin: 0;
    cursor: pointer;
}

.mayoreo-comision-sel-hit--off {
    cursor: not-allowed;
}

.mayoreo-comision-col-sel .form-check-input {
    margin: 0;
    float: none;
    position: relative;
    z-index: 1;
    cursor: pointer;
    pointer-events: auto;
}

.mayoreo-comision-col-sel .form-check-input:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    pointer-events: none;
}

.mayoreo-motivo-elegible {
    display: block;
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #6c757d);
}

.mayoreo-comision-elegible-cell {
    min-width: 7.5rem;
}

.mayoreo-comision-saldo {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mayoreo-liq-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

.mayoreo-liq-form-accion {
    display: inline-flex;
}

@media (max-width: 767.98px) {
    .mayoreo-comisiones-gv .tabla-erp,
    .mayoreo-liquidaciones-gv .tabla-erp,
    .mayoreo-liquidacion-detalle .tabla-erp {
        font-size: 0.875rem;
    }

    .mayoreo-comisiones-gv .tabla-erp {
        min-width: 60rem;
    }

    .mayoreo-politica-actions .btn,
    .mayoreo-liq-acciones .btn,
    .licencias-list-actions .btn {
        width: 100%;
    }

    .mayoreo-liq-form-accion {
        width: 100%;
    }

    .mayoreo-liq-form-accion .btn {
        width: 100%;
    }
}

/* --- Códigos de barras producto (Admin Fase 1) --- */
.producto-barcode-wrap {
    margin-bottom: 0.25rem;
}

.producto-barcode-input-group .producto-barcode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.producto-barcode-input-group .producto-barcode-btn .material-icons {
    font-size: 1.125rem;
    line-height: 1;
}

@media (max-width: 575.98px) {
    .producto-barcode-input-group {
        flex-wrap: wrap;
    }

    .producto-barcode-input-group .form-control {
        width: 100%;
        border-radius: 0.375rem;
        margin-bottom: 0.35rem;
    }

    .producto-barcode-input-group .producto-barcode-btn {
        flex: 1 1 auto;
        justify-content: center;
        border-radius: 0.375rem;
    }

    .producto-barcode-btn-label {
        font-size: 0.8125rem;
    }
}

/* --- Lote CB / etiquetas listado productos (Fases 2–3) --- */
.producto-cb-lote-toolbar-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.producto-cb-lote-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.producto-cb-lote-acciones .btn .material-icons {
    font-size: 1.125rem;
    line-height: 1;
}

.producto-cb-copias-label {
    margin: 0 0.25rem 0 0.5rem;
    font-size: 0.875rem;
}

.producto-cb-copias-input {
    width: 4.5rem;
    display: inline-block;
}

.producto-cb-col-sel {
    vertical-align: middle;
}

.producto-cb-lote-hint {
    font-size: 0.8125rem;
}

@media (max-width: 767.98px) {
    .producto-cb-lote-acciones {
        flex-direction: column;
        align-items: stretch;
    }

    .producto-cb-copias-input {
        width: 100%;
    }
}

/* --- Mayoreo GV: detalle lista / selección maestros (Fase B) --- */
.mayoreo-lista-section-title {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.mayoreo-lista-lote-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mayoreo-lista-lote-label {
    margin: 0;
    font-size: 0.875rem;
    white-space: nowrap;
}

.mayoreo-lista-lote-input {
    width: 7rem;
    display: inline-block;
}

.mayoreo-lista-lote-toolbar .btn .material-icons {
    font-size: 1.125rem;
    line-height: 1;
    vertical-align: middle;
}

.mayoreo-lista-hint {
    font-size: 0.8125rem;
}

.mayoreo-lista-lote-ayuda {
    max-width: 48rem;
    margin: 0 0 0.5rem;
}

.mayoreo-lista-col-sel {
    vertical-align: middle;
    width: 2.5rem;
}

.mayoreo-lista-ya-incluido {
    opacity: 0.85;
}

.mayoreo-lista-check-filtro {
    margin-top: 1.75rem;
}

.mayoreo-lista-quitar-form {
    display: inline;
    margin: 0;
}

.mayoreo-lista-paginacion-m {
    padding: 12px 16px;
}

.mayoreo-lista-items-card {
    margin-top: 0.5rem;
}

.mayoreo-lista-crear .mayoreo-lista-cabecera-card {
    margin-bottom: 1rem;
}

.mayoreo-lista-precio-input {
    max-width: 7.5rem;
    margin-left: auto;
    display: inline-block;
    text-align: right;
}

.mayoreo-lista-moneda-select {
    min-width: 0;
}

.mayoreo-lista-th-precio {
    white-space: nowrap;
}

.mayoreo-lista-precio-maestro {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tabla-mayoreo-lista-maestros .mayoreo-lista-col-moneda {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .mayoreo-lista-lote-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .mayoreo-lista-lote-input {
        width: 100%;
    }

    .mayoreo-lista-check-filtro {
        margin-top: 0.25rem;
    }

    .tabla-mayoreo-lista-maestros {
        font-size: 0.875rem;
    }

    .mayoreo-lista-precio-input {
        max-width: 100%;
        width: 100%;
    }

    .mayoreo-lista-moneda-select {
        width: 100%;
    }
}

.mayoreo-listas-acciones {
    flex-wrap: nowrap;
    white-space: nowrap;
    max-width: none;
    gap: 4px;
}

.mayoreo-listas-precio .tabla-erp th.tabla-erp-col-acciones-wide,
.mayoreo-listas-precio .tabla-erp td.tabla-erp-col-acciones-wide,
.mayoreo-listas-precio .tabla-erp td:has(> .mayoreo-listas-acciones) {
    min-width: 188px;
    width: 1%;
    white-space: nowrap;
    overflow: visible;
}

.mayoreo-lista-ver-filtros .form-label {
    margin-bottom: 0.25rem;
}

.mayoreo-lista-ver .licencias-list-actions .btn .material-icons {
    font-size: 1.125rem;
    line-height: 1;
    vertical-align: middle;
}

@media (max-width: 767.98px) {
    .mayoreo-lista-ver .licencias-list-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- Mayoreo GV: vendedores externos (Fases C+D) --- */
.mayoreo-vendedor-form-card {
    max-width: 52rem;
}

.mayoreo-vendedor-check {
    margin-top: 0.5rem;
}

.mayoreo-vendedor-politica-cobro {
    border: 0;
    padding: 0;
    margin: 0;
}

.mayoreo-vendedor-politica-ayuda {
    margin-bottom: 0.5rem;
}

.mayoreo-vendedor-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.mayoreo-vendedor-acciones .btn .material-icons {
    font-size: 1.125rem;
    line-height: 1;
    vertical-align: middle;
}

.mayoreo-vendedor-inactivo {
    opacity: 0.75;
}

.mayoreo-vendedores-panel .licencias-list-actions .btn .material-icons {
    font-size: 1.125rem;
    vertical-align: middle;
}

.mayoreo-vendedores-panel .tabla-erp td:has(> .licencia-actions-cell) {
    min-width: 9.5rem;
}

.mayoreo-vendedor-ficha-card {
    max-width: 52rem;
}

.mayoreo-vendedor-ficha-section {
    margin: 0 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mayoreo-vendedor-ficha-grid + .mayoreo-vendedor-ficha-section {
    margin-top: 1.25rem;
}

.mayoreo-vendedor-ficha .empresa-detail-field {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .mayoreo-vendedor-acciones {
        flex-direction: column;
        align-items: stretch;
    }

    .mayoreo-vendedor-form-card {
        max-width: none;
    }

    .mayoreo-vendedor-ficha-card {
        max-width: none;
    }

    .mayoreo-vendedor-ficha .licencias-list-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.mayoreo-vendedor-cartera-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: #00838f;
    color: #fff;
    font-size: 0.625rem;
    line-height: 1.05rem;
    text-align: center;
    font-weight: 600;
}

.mayoreo-vendedor-clientes .mayoreo-vendedor-section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mayoreo-vendedor-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #eceff1;
    color: #37474f;
    font-size: 0.75rem;
    font-weight: 600;
}

.mayoreo-vendedor-hint {
    color: #546e7a;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.mayoreo-vendedor-lote-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mayoreo-vendedor-sel-status {
    color: #455a64;
    font-size: 0.875rem;
}

.mayoreo-vendedor-lote-toolbar .btn .material-icons {
    font-size: 1.125rem;
    vertical-align: middle;
}

.mayoreo-vendedor-th-check {
    width: 2.5rem;
}

.mayoreo-vendedor-check-all {
    display: inline-flex;
    margin: 0;
}

.mayoreo-vendedor-quitar-form {
    display: inline-flex;
    margin: 0;
}

.mayoreo-vendedor-pager {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 0 0;
}

@media (max-width: 767.98px) {
    .mayoreo-vendedor-lote-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .mayoreo-vendedor-lote-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .mayoreo-vendedor-pager {
        justify-content: center;
    }
}

.mayoreo-bo-compras-alerta {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    font-weight: 600;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.mayoreo-bo-compras-alerta a {
    display: inline-block;
    margin-left: 0.35rem;
}

.mayoreo-bo-compras-vacio {
    margin: 0;
    padding: 1rem 0;
}

.mayoreo-bo-compras-lineas-wrap {
    margin: 0;
}

.mayoreo-bo-compras-lineas {
    margin-bottom: 0;
}

.mayoreo-bo-compras-ocultar {
    display: inline-flex;
    margin: 0;
}

.mayoreo-bo-compras-ocultar .btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: auto;
    min-height: 36px;
    padding: 0.25rem 0.5rem;
}

.mayoreo-bo-compras-cerrar-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.mayoreo-bo-compras-toolbar {
    align-items: center;
}

.mayoreo-bo-compras-oc-form {
    margin: 0;
}

.mayoreo-bo-compras-th-sel,
.mayoreo-bo-compras-td-sel {
    width: 2.5rem;
    text-align: center;
    vertical-align: middle;
}

.mayoreo-bo-compras-check-wrap {
    display: inline-flex;
    margin: 0;
}

.mayoreo-bo-oc-banner a {
    display: inline-block;
    margin-left: 0.35rem;
}

.mayoreo-bo-oc-cancelar-ayuda {
    margin: 0 0 0.75rem;
    color: #546e7a;
}

.mayoreo-bo-oc-cancelar-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.mayoreo-bo-oc-riesgo {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin: 0;
    font-weight: 600;
}

.mayoreo-bo-oc-riesgo input {
    margin-top: 0.2rem;
}

@media (max-width: 767.98px) {
    .mayoreo-bo-oc-cancelar-form,
    .mayoreo-bo-oc-cancelar-form .btn {
        width: 100%;
    }
}

.mayoreo-reaprobacion-panel .licencias-list-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mayoreo-reaprobacion-ayuda,
.mayoreo-reaprobacion-nota {
    font-size: 0.9rem;
    color: #546e7a;
    margin: 0 0 0.75rem;
}

.mayoreo-reaprobacion-nota {
    margin: 0.75rem 0 0;
}

.mayoreo-reaprobacion-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.mayoreo-reaprobacion-qty {
    max-width: 8rem;
    min-width: 4.5rem;
}

.mayoreo-reaprobacion-excluido {
    background: #fafafa;
}

.mayoreo-reaprobacion-vacio {
    margin: 0;
}

.mayoreo-reaprobacion-motivo-wrap {
    margin-top: 1rem;
}

.mayoreo-reaprobacion-motivo-wrap label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.mayoreo-reaprobacion-motivo {
    width: 100%;
    max-width: 40rem;
}

@media (max-width: 767.98px) {
    .mayoreo-bo-compras .tabla-erp thead {
        display: none;
    }

    .mayoreo-bo-compras .tabla-erp tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e9ecef;
        border-radius: 0.35rem;
        padding: 0.5rem 0.75rem;
    }

    .mayoreo-bo-compras .tabla-erp tbody td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        border: 0;
        padding: 0.35rem 0;
        text-align: left;
        white-space: normal;
    }

    .mayoreo-bo-compras .tabla-erp tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        flex: 0 0 42%;
    }

    .mayoreo-bo-compras-lineas-wrap {
        width: 100%;
        overflow-x: auto;
    }

    .mayoreo-bo-compras-ocultar,
    .mayoreo-bo-compras-ocultar .btn-action {
        width: 100%;
        justify-content: center;
    }

    .mayoreo-bo-compras-toolbar {
        width: 100%;
    }

    .mayoreo-bo-compras-oc-form,
    .mayoreo-bo-compras-oc-form .btn {
        width: 100%;
    }

    .mayoreo-reaprobacion-tabla thead {
        display: none;
    }

    .mayoreo-reaprobacion-tabla tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e9ecef;
        border-radius: 0.35rem;
        padding: 0.5rem 0.75rem;
    }

    .mayoreo-reaprobacion-tabla tbody td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        border: 0;
        padding: 0.35rem 0;
        text-align: left;
        white-space: normal;
        align-items: center;
    }

    .mayoreo-reaprobacion-tabla tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        flex: 0 0 42%;
    }

    .mayoreo-reaprobacion-qty {
        max-width: none;
        width: 100%;
    }

    .mayoreo-reaprobacion-motivo {
        max-width: none;
    }

    .mayoreo-reaprobacion-panel .licencias-list-actions,
    .mayoreo-reaprobacion-acciones {
        width: 100%;
    }

    .mayoreo-reaprobacion-panel .licencias-list-actions .btn,
    .mayoreo-reaprobacion-acciones .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Tesorería de efectivo (Caja nativa por ISO) */
.bancos-caja-page {
    width: 100%;
}

.bancos-caja-dash-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 8px;
}

.bancos-caja-arqueo {
    margin-bottom: 24px;
}

.bancos-caja-saldo-card,
.bancos-caja-transfer-card {
    height: 100%;
}

.bancos-caja-saldo-label {
    margin-bottom: 4px;
    color: #6c757d;
    font-size: 0.9rem;
}

.bancos-caja-saldo-valor {
    margin-bottom: 12px;
    font-size: 1.75rem;
    font-weight: 700;
}

.bancos-caja-equiv {
    list-style: none;
    margin: 0;
    padding: 0;
    color: #495057;
    font-size: 0.9rem;
}

.bancos-caja-equiv li {
    padding: 2px 0;
}

.bancos-caja-equiv-nota {
    margin: 8px 0 0;
    color: #6c757d;
    font-size: 0.8rem;
}

.bancos-caja-flag-nota {
    margin: 12px 0 8px;
    color: #6c757d;
    font-size: 0.85rem;
}

.bancos-caja-flag-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.bancos-caja-check {
    display: flex;
    align-items: flex-end;
}

.bancos-caja-form .form-actions,
.bancos-caja-transfer-form .form-actions,
.bancos-caja-ingreso-form .form-actions,
.bancos-caja-caja-form .form-actions {
    margin-top: 16px;
}

.bancos-caja-ingreso-card,
.bancos-caja-caja-card {
    height: 100%;
}

.bancos-caja-form-ayuda {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.bancos-caja-tasa-wrap {
    display: none;
}

.bancos-caja-tasa-wrap.is-visible {
    display: block;
}

.bancos-caja-otra-wrap {
    display: none;
}

.bancos-caja-otra-wrap.is-visible {
    display: block;
}

.bancos-caja-preview {
    min-height: 1.25rem;
    margin-bottom: 0;
}

.bancos-caja-mov-conv {
    display: block;
    color: #6c757d;
    font-size: 0.85rem;
}

.bancos-caja-movimientos {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .bancos-caja-page .licencias-list-header,
    .bancos-caja-page .licencias-list-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bancos-caja-page .licencias-list-actions .btn,
    .bancos-caja-form .form-actions .btn,
    .bancos-caja-transfer-form .form-actions .btn,
    .bancos-caja-ingreso-form .form-actions .btn,
    .bancos-caja-caja-form .form-actions .btn,
    .bancos-caja-flag-form .btn {
        width: 100%;
        justify-content: center;
    }

    .bancos-caja-tabla thead {
        display: none;
    }

    .bancos-caja-tabla tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 8px 12px;
    }

    .bancos-caja-tabla tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: 0;
    }

    .bancos-caja-tabla tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        flex: 0 0 42%;
    }

    .bancos-caja-saldo-valor {
        font-size: 1.5rem;
    }
}

/* CxC Resumen cobros — ficha auditoría por cliente */
.cxc-resumen-tabs {
    margin-bottom: 1rem;
}

.cxc-resumen-auditoria-kpis .cxc-resumen-kpi-valor {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

@media (max-width: 576px) {
    .cxc-resumen-auditoria-kpis .cxc-resumen-kpi-valor {
        font-size: 1.25rem;
    }
}

/* Admin — stock por bodega en Editar Producto */
.producto-stock-bodegas {
    width: 100%;
}

.producto-stock-bodegas-ayuda {
    margin-bottom: 0.75rem;
}

.producto-stock-bodegas .tabla-erp-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .producto-stock-bodegas .tabla-erp thead {
        display: none;
    }

    .producto-stock-bodegas .tabla-erp tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 8px 12px;
    }

    .producto-stock-bodegas .tabla-erp tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        border: 0;
        text-align: left;
    }

    .producto-stock-bodegas .tabla-erp tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        flex: 0 0 42%;
    }

    .producto-stock-bodegas .tabla-erp tbody td.text-end {
        text-align: left;
    }
}

/* Admin — ficha de producto (solo lectura) */
.producto-ficha .producto-ficha-card {
    margin-bottom: 1.25rem;
}

.producto-ficha-imagenes .empresa-detail-field {
    margin-bottom: 0;
}

.producto-ficha-figura {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    max-height: 280px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    overflow: hidden;
}

.producto-ficha-figura--vacio {
    flex-direction: column;
    gap: 8px;
    color: #6c757d;
}

.producto-ficha-figura--vacio .material-icons {
    font-size: 40px;
    color: #667eea;
}

.producto-ficha-img {
    display: block;
    max-width: 100%;
    max-height: 256px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.producto-ficha .empresa-detail-field {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .producto-ficha .licencias-list-actions .btn {
        width: 100%;
    }

    .producto-ficha-figura {
        min-height: 140px;
        max-height: 220px;
    }
}

/* POS — resumen crédito cliente */
.facturacion-credito-cliente-resumen {
    margin-bottom: 1rem;
}

.facturacion-credito-cliente-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
}

.facturacion-credito-cliente--ok .facturacion-credito-cliente-inner {
    border-color: #b7dfc9;
    background: #edf7f0;
}

.facturacion-credito-cliente--warning .facturacion-credito-cliente-inner {
    border-color: #f5c2c7;
    background: #fff5f5;
}

.facturacion-credito-cliente--bloqueado .facturacion-credito-cliente-inner {
    border-color: #ced4da;
    background: #e9ecef;
}

.facturacion-credito-cliente-icon {
    font-size: 22px;
    color: #495057;
    flex-shrink: 0;
    margin-top: 2px;
}

.facturacion-credito-cliente--ok .facturacion-credito-cliente-icon {
    color: #198754;
}

.facturacion-credito-cliente--warning .facturacion-credito-cliente-icon {
    color: #dc3545;
}

.facturacion-credito-cliente-titulo {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.facturacion-credito-cliente-detalle {
    font-size: 0.875rem;
    color: #495057;
    line-height: 1.4;
}

.facturacion-credito-cliente-alerta {
    margin-top: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #842029;
}

.facturacion-credito-mayoreo-alerta {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .facturacion-credito-cliente-inner {
        padding: 10px 12px;
        gap: 10px;
    }

    .facturacion-credito-cliente-titulo {
        font-size: 0.9rem;
    }

    .facturacion-credito-cliente-detalle {
        font-size: 0.8125rem;
    }
}

