/* ============================================================
   ============================================================
   TSPRO - HOJA DE ESTILOS GLOBAL ORGANIZADA POR MÓDULO
   ============================================================
   ÍNDICE GENERAL
   ------------------------------------------------------------
   01. BASE GLOBAL Y RESET
   02. LAYOUT PRINCIPAL (SIDEBAR / TOPBAR / CONTENIDO)
   03. MÓDULO LOGIN (SAAS)
   04. MÓDULO INICIO (PANEL TÁCTIL)
   05. MÓDULO VENTAS (POS)
   06. MÓDULO COTIZACIONES + EDICIÓN
   07. MÓDULO HISTORIAL DE COTIZACIONES
   08. MÓDULO COMPRAS
   09. MÓDULO GARANTÍAS
   10. MÓDULO MI NEGOCIO
   11. MÓDULOS CRUD (Clientes, Proveedores, Categorías,
       Productos, Usuarios, Perfiles, Empresas, Licencias,
       Configuración)
   12. MÓDULO INVENTARIO
   13. MÓDULO HISTORIAL DE COMPRAS
   14. MÓDULO CUENTAS POR PAGAR
   15. MÓDULO CRÉDITOS
   16. MÓDULO APARTADOS
   17. MÓDULO CUADRE DE CAJA
   18. MÓDULO GASTOS
   19. MÓDULO REPORTES
   20. FICHA COMERCIAL WHATSAPP
   21. CLASES LEGACY (SB Admin 2) Y UTILIDADES
   22. RESPONSIVE MAESTRO (TABLETS Y CELULARES)
   ============================================================
   ============================================================ */

/* ============================================================
   01. BASE GLOBAL Y RESET
   ============================================================ */
* {
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    background-color: #f4f7f6;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    overflow-y: auto !important;
}

@media (min-width: 768px) {
    body {
        display: flex;
        height: 100vh;
        overflow: hidden;
    }
}

img {
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
}

/* Scrollbar personalizado global */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   02. LAYOUT PRINCIPAL (SIDEBAR / TOPBAR / CONTENIDO)
   ============================================================ */

/* --- SIDEBAR CLARO Y ELEGANTE (AUTO-OCULTABLE AL PASAR EL MOUSE) --- */
#sidebar {
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    left: -290px; /* 300px menos 10px para que quede la pestañita visible */
    top: 0;
    z-index: 2500;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar:hover {
    left: 0 !important;
}

#content {
    margin-left: 0;
    width: 100% !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

/* --- TARJETA DEL USUARIO --- */
.user-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
    margin: 0 15px 20px 15px;
    display: flex;
    align-items: center;
}

/* --- BOTONES DEL MENÚ INDIVIDUALES --- */
.nav-item { margin: 0 15px 10px 15px; }

.nav-link {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    color: #475569 !important;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.nav-link .menu-icon {
    font-size: 1.2rem;
    width: 35px;
    color: #3b82f6;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link[aria-expanded="true"],
.nav-link.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8 !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.nav-link:hover .menu-icon,
.nav-link[aria-expanded="true"] .menu-icon {
    color: #2563eb;
    transform: scale(1.1);
}

/* --- SUBMENÚS --- */
.submenu {
    margin-left: 15px;
    margin-right: 15px;
    border-left: 2px solid #e2e8f0;
    padding-left: 5px;
    margin-top: 5px;
    margin-bottom: 15px;
}

.submenu .nav-link {
    font-size: 0.85rem;
    padding: 8px 15px;
    margin: 4px 0;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #64748b !important;
}

.submenu .nav-link:hover {
    color: #2563eb !important;
    background: rgba(59, 130, 246, 0.05) !important;
    border-radius: 8px;
    transform: translateX(4px);
}

/* Flecha animada */
.nav-link[aria-expanded="true"] .arrow-icon { transform: rotate(180deg); }
.arrow-icon { transition: transform 0.3s ease; font-size: 0.75rem; color: #94a3b8; }

/* --- TOPBAR --- */
.topbar {
    background: #ffffff;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-divider {
    border-top: 2px dashed #e2e8f0;
    margin: 1.2rem 15px;
}

#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
#sidebar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   03. MÓDULO LOGIN (SAAS)
   ============================================================ */
.login-body {
    background-color: #f4f7f6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Formulario e Interfaz Izquierda */
.login-side {
    background-color: #ffffff;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    box-shadow: 15px 0 30px rgba(0,0,0,0.08);
    z-index: 10;
    overflow-y: auto;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-logo-img {
    max-width: 100%;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    animation: logoFlotar 3s ease-in-out infinite;
}

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

.login-rocket-icon {
    color: #0d6efd;
    transform: rotate(-10deg);
}

.login-title-text {
    color: #0d6efd;
    letter-spacing: 1px;
    font-weight: 900 !important;
}

.login-subtitle-text {
    font-size: 0.9rem;
}

.login-input-group .input-group-text {
    background-color: #f8f9fa;
    border-right: none;
    color: #0d6efd;
}

.login-input-group .form-control {
    border-left: none;
    padding-left: 0;
    font-weight: 500;
}

.login-input-group .form-control:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

.login-input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    border-radius: 0.375rem;
}

.btn-ver-clave {
    border-left: none !important;
    background: #fff;
    color: #6c757d;
    cursor: pointer;
}

.login-caps-alert {
    font-size: 0.85rem;
    border-radius: 8px;
}

.login-submit-btn {
    border-radius: 10px;
}

/* Textos del banner (antes huérfanos) */
.promo-headline {
    font-weight: 700;
    line-height: 1.2;
}

.promo-subheadline {
    color: rgba(255, 255, 255, 0.85);
}

/* Lado Derecho - Banner de Promoción y Planes */
.promo-side {
    background: linear-gradient(135deg, #0d6efd 0%, #00225e 100%);
    min-height: 100vh;
    height: 100vh;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3rem;
    position: relative;
    overflow: hidden;
}

.promo-side::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
}

.plans-container {
    position: relative;
    z-index: 1;
}

/* Diseño de Tarjetas Glassmorphism */
.plan-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.plan-card-active {
    border-color: #ffc107;
    background: rgba(255, 255, 255, 0.15);
}

.active-plan-badge {
    z-index: 2;
}

.plan-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.plan-description {
    color: rgba(255,255,255,0.8);
    min-height: 40px;
}

.plan-divider {
    border-color: rgba(255, 255, 255, 0.2);
}

.plan-features {
    font-size: 0.85rem;
    text-align: left;
    margin-top: auto;
    color: rgba(255, 255, 255, 0.9);
}

.plan-features li {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
}

.plan-features i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

.footer-creditos {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    z-index: 1;
    left: 0;
}

/* Ajuste por altura de pantalla: el login siempre cabe en el viewport */
@media (max-height: 900px) {
    .promo-side {
        padding: 1.5rem 2.5rem;
    }
    .plans-container .display-4 {
        font-size: 2.2rem;
    }
    .plans-container .lead {
        margin-bottom: 1.5rem !important;
        font-size: 1rem;
    }
    .plans-container .row {
        --bs-gutter-y: 1rem;
    }
    .plan-card {
        padding: 1.5rem 1.25rem;
    }
    .plan-icon {
        font-size: 2rem;
        margin-bottom: 0.6rem;
    }
    .plan-card h3 {
        font-size: 1.2rem;
    }
    .plan-description {
        min-height: 32px;
    }
    .plan-features {
        font-size: 0.8rem;
    }
    .plan-features li {
        margin-bottom: 0.45rem;
    }
    .footer-creditos {
        position: static;
        margin-top: 1rem;
        padding-top: 0.5rem;
    }
}

@media (max-height: 700px) {
    .promo-side {
        padding: 1rem 2rem;
    }
    .plans-container .display-4 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem !important;
    }
    .plans-container .lead {
        margin-bottom: 1rem !important;
        font-size: 0.95rem;
    }
    .plan-card {
        padding: 1rem 1rem;
        border-radius: 14px;
    }
    .plan-icon {
        font-size: 1.6rem;
        margin-bottom: 0.4rem;
    }
    .plan-card h3 {
        font-size: 1.05rem;
    }
    .plan-card .badge {
        font-size: 0.7rem;
    }
    .plan-description {
        min-height: 24px;
        font-size: 0.75rem;
        margin-bottom: 0.5rem !important;
    }
    .plan-features {
        font-size: 0.72rem;
    }
    .plan-features li {
        margin-bottom: 0.25rem;
    }
    .login-side {
        padding: 2rem 2.5rem;
    }
    .login-form-wrapper .mb-4.mb-md-5 {
        margin-bottom: 1.5rem !important;
    }
    .login-form-wrapper .mb-3.mb-md-4 {
        margin-bottom: 1rem !important;
    }
}

@media (max-height: 600px) {
    .plans-container .display-4 {
        font-size: 1.5rem;
    }
    .plans-container .lead {
        display: none;
    }
    .plan-description {
        display: none;
    }
    .plan-features li {
        font-size: 0.68rem;
    }
    .footer-creditos {
        display: none;
    }
}

/* ============================================================
   04. MÓDULO INICIO (PANEL TÁCTIL)
   ============================================================ */
.welcome-banner {
    background: linear-gradient(135deg, #0d6efd 0%, #0043a6 100%);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.3);
}

.section-title {
    font-size: 1rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

/* Tarjeta táctil principal (PC) */
.card-tactil {
    height: 180px;
    border: none;
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 1.2rem 1rem;
    text-decoration: none !important;
    color: white !important;
    text-align: left;

    /* El truco maestro: El fondo es el doble de grande para poder moverlo */
    background-size: 200% auto;
}

.card-tactil::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    z-index: -1;
}

.card-tactil:hover {
    transform: translateY(-6px);
    background-position: right center;
}

.card-tactil:active {
    transform: scale(0.97);
}

.card-tactil i.main-icon {
    font-size: 2.2rem;
    margin-right: 1.2rem;
    color: rgba(255,255,255,0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-tactil:hover i.main-icon {
    transform: scale(1.15) rotate(5deg);
}

.card-tactil span {
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: left;
    line-height: 1.2;
}

/* Tarjetas deshabilitadas */
.disabled-card {
    background-image: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%) !important;
    opacity: 0.6;
    cursor: not-allowed;
}

.disabled-card:hover {
    transform: none !important;
    background-position: left center !important;
}

.disabled-card:hover i.main-icon {
    transform: none !important;
}

.candado-seguridad {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 15px;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
}

/* Paleta innovadora (gradientes de 3 tonos) */
.grad-ventas { background-image: linear-gradient(to right, #3b82f6 0%, #1d4ed8 51%, #3b82f6 100%); }
.grad-ventas:hover { box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3) !important; }

.grad-comercial { background-image: linear-gradient(to right, #0ea5e9 0%, #0284c7 51%, #0ea5e9 100%); }
.grad-comercial:hover { box-shadow: 0 10px 20px rgba(2, 132, 199, 0.3) !important; }

.grad-caja { background-image: linear-gradient(to right, #10b981 0%, #047857 51%, #10b981 100%); }
.grad-caja:hover { box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3) !important; }

.grad-logistica { background-image: linear-gradient(to right, #6366f1 0%, #4338ca 51%, #6366f1 100%); }
.grad-logistica:hover { box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3) !important; }

.grad-contactos { background-image: linear-gradient(to right, #f59e0b 0%, #b45309 51%, #f59e0b 100%); }
.grad-contactos:hover { box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3) !important; }

.grad-gastos { background-image: linear-gradient(to right, #f43f5e 0%, #be123c 51%, #f43f5e 100%); }
.grad-gastos:hover { box-shadow: 0 10px 20px rgba(244, 63, 94, 0.3) !important; }

.grad-restaurante { background-image: linear-gradient(to right, #f97316 0%, #c2410c 51%, #f97316 100%); }
.grad-restaurante:hover { box-shadow: 0 10px 20px rgba(249, 115, 22, 0.3) !important; }

.grad-sistema { background-image: linear-gradient(to right, #64748b 0%, #334155 51%, #64748b 100%); }
.grad-sistema:hover { box-shadow: 0 10px 20px rgba(71, 85, 105, 0.3) !important; }

.grad-especial { background-image: linear-gradient(to right, #a855f7 0%, #7e22ce 51%, #a855f7 100%); }
.grad-especial:hover { box-shadow: 0 10px 20px rgba(168, 85, 247, 0.3) !important; }

.grad-noche { background-image: linear-gradient(to right, #0d2447 0%, #081426 51%, #0d2447 100%); }
.grad-noche:hover { box-shadow: 0 10px 20px rgba(13, 36, 71, 0.45) !important; }

.grad-esmeralda { background-image: linear-gradient(to right, #10b981 0%, #059669 51%, #10b981 100%); }
.grad-esmeralda:hover { box-shadow: 0 10px 20px rgba(16, 185, 129, 0.35) !important; }

.grad-master { background-image: linear-gradient(to right, #1e1b4b 0%, #312e81 51%, #1e1b4b 100%); }
.grad-master:hover { box-shadow: 0 10px 20px rgba(49, 46, 129, 0.4) !important; }

/* ============================================================
   05. MÓDULO VENTAS (POS)
   ============================================================ */
.pos-wrapper {
    height: calc(100vh - 80px);
    min-height: 650px;
    background-color: #f4f6f9;
}

.pos-left-col {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.pos-right-col {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    padding: 20px;
}

/* Caja de total grande en PC */
.pos-right-col > .flex-grow-1 {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background-color: #ffffff !important;
    border: 2px solid #0d6efd !important;
    border-radius: 8px !important;
    min-height: 250px;
}

.pos-table-container {
    flex-grow: 1;
    overflow-y: auto;
}

/* Barra superior del POS */
.pos-top-bar {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 100;
    flex-shrink: 0;
}

.search-container {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.pos-search-input {
    width: 100%;
    font-size: 1.1rem;
    padding: 8px 15px 8px 45px;
    border: 2px solid #0d6efd;
    border-radius: 8px;
    background: #f8fafc;
    font-weight: bold;
    color: #1e293b;
}

.pos-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    background: white;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #0d6efd;
}

.floating-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 5px;
    border: 1px solid #e2e8f0;
    z-index: 1050;
}

.result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item:hover,
.result-item.active {
    background: #eff6ff;
    border-left: 4px solid #0d6efd;
}

.item-agotado {
    opacity: 0.5;
    background-color: #f8d7da;
    cursor: not-allowed;
}

.client-selector {
    width: 100%;
    max-width: 100%;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    background: white;
    font-weight: bold;
}

.client-selector:focus {
    border-color: #0d6efd;
    outline: none;
}

/* Evita que el selector de cliente del POS se desborde sobre los métodos de pago */
#modalCobrarVenta .flex-grow-1 {
    min-width: 0;
    overflow: hidden;
}

.factura-badge {
    background: #1e293b;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 1rem;
}

/* Tabla del carrito */
.table-pos {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-pos thead th {
    position: sticky;
    top: 0;
    background: #0d6efd !important;
    color: white !important;
    padding: 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: bold;
    border-bottom: 3px solid #0a58ca;
    z-index: 10;
}

.table-pos tbody td {
    padding: 6px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.table-pos tbody tr:hover { background-color: #f8fafc; }

/* Controles dentro de la tabla */
.tbl-select {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 4px;
    font-weight: bold;
    color: #0d6efd;
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}

.tbl-input {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 4px;
    font-weight: bold;
    text-align: center;
    width: 70px;
    outline: none;
    font-size: 1rem;
}

.tbl-select:focus,
.tbl-input:focus {
    border-color: #0d6efd;
    background: white;
}

/* Select2 global del proyecto (todos los módulos) */
.select2-container {
    max-width: 100%;
}
.select2-container .select2-selection--single {
    height: 45px !important;
    border: 2px solid #0d6efd !important;
    border-radius: 6px !important;
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #0d6efd;
    overflow: hidden;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 43px !important;
}

/* Evita que nombres largos se salgan del Select2 (ej: cliente en Punto de Venta) */
.select2-container .select2-selection--single .select2-selection__rendered {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.select2-container--default .select2-results__option {
    white-space: normal;
    word-break: break-word;
}

/* Barra inferior (totales y pago) */
.pos-bottom-bar {
    background: white;
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.03);
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 15px;
    align-items: center;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.panel-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.panel-title {
    font-size: 0.7rem;
    font-weight: bold;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-pills-container {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.payment-pill {
    flex: 1;
    background-color: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.payment-pill:hover { background-color: #e9ecef; }

.payment-pill.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.pill-mixto {
    background-color: #343a40;
    color: white;
    border: 2px solid #343a40;
    flex-basis: 100%;
    margin-top: 8px;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-weight: bold;
}

.pill-mixto.active {
    background-color: #ffc107;
    color: #000;
    border-color: #ffc107;
}

.input-money {
    font-size: 1.2rem;
    font-weight: 900;
    color: #198754;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    width: 100%;
    outline: none;
}

.input-money:focus {
    border-color: #198754;
    background: #f6fcf9;
}

.text-cambio {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0d6efd;
    margin: 0;
    line-height: 1;
}

.text-total-gigante {
    font-size: 2.5rem;
    font-weight: 900;
    color: #0d6efd;
    text-align: right;
    line-height: 1;
    margin: 0;
}

.btn-checkout-mega {
    background: #198754;
    color: white;
    border: none;
    width: 100%;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 900;
    padding: 10px;
    margin-top: 5px;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(25, 135, 84, 0.2);
    text-transform: uppercase;
}

.btn-checkout-mega:hover {
    background: #157347;
    transform: translateY(-1px);
}

.badge-sn {
    font-size: 0.75rem;
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shadow-inner {
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.08);
}

.stock-restante-badge {
    font-size: 0.7rem;
    font-weight: bold;
}

.contenedor-seriales-fila {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cursor-pointer {
    cursor: pointer;
}

.pos-table-area::-webkit-scrollbar,
.floating-results::-webkit-scrollbar {
    width: 6px;
}

.pos-table-area::-webkit-scrollbar-thumb,
.floating-results::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

/* ============================================================
   06. MÓDULO COTIZACIONES + EDICIÓN
   ============================================================ */
.modulo-cotizaciones.cot-master {
    background: #f4f6f9;
    height: calc(100vh - 70px);
    min-height: 600px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Barra Superior Flex con Wrap para Pantallas Pequeñas */
.modulo-cotizaciones .cot-top-bar {
    background: #fff;
    padding: 12px 18px;
    border-bottom: 3px solid #36b9cc;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    z-index: 100;
}

.modulo-cotizaciones .search-box {
    position: relative;
    flex: 1 1 300px;
}

.modulo-cotizaciones .cot-search-input {
    width: 100%;
    border: 2px solid #36b9cc;
    border-radius: 30px;
    padding: 9px 20px 9px 42px;
    outline: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.modulo-cotizaciones .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #36b9cc;
}

/* Resultados Flotantes */
.modulo-cotizaciones .floating-results {
    position: absolute;
    width: 100%;
    background: white;
    z-index: 2000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px;
    display: none;
    margin-top: 4px;
    border: 1px solid #cbd5e1;
    max-height: 280px;
    overflow-y: auto;
}

.modulo-cotizaciones .result-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.modulo-cotizaciones .result-item:hover,
.modulo-cotizaciones .result-item.active {
    background: #e0f7fa;
    border-left: 4px solid #36b9cc;
}

.modulo-cotizaciones .cliente-select-container {
    flex: 1 1 250px;
    max-width: 400px;
}

/* Contenido Principal (Layout Adaptable) */
.modulo-cotizaciones .cot-content {
    display: flex;
    flex: 1 1 auto;
    gap: 15px;
    padding: 15px;
    overflow: hidden;
}

.modulo-cotizaciones .cot-table-area {
    flex: 1 1 auto;
    background: white;
    border-radius: 12px;
    overflow-y: auto;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

/* Envoltura responsive de la tabla (antes huérfana) */
.modulo-cotizaciones .table-responsive-cel {
    width: 100%;
    overflow-x: auto;
}

.modulo-cotizaciones .cot-sidebar {
    width: 340px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.modulo-cotizaciones .total-card {
    background: #1a202c;
    color: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.modulo-cotizaciones .total-huge {
    font-size: 2.2rem;
    font-weight: 800;
    color: #38b2ac;
    text-align: right;
    margin: 0;
    word-break: break-all;
}

/* ============================================================
   07. MÓDULO HISTORIAL DE COTIZACIONES
   ============================================================ */
.header-cotizaciones {
    border-bottom: 4px solid #36b9cc;
}

.title-cotizaciones {
    letter-spacing: 1px;
}

.tabla-cotizaciones-global {
    width: 100%;
}

.th-id-size {
    width: 10px;
}

.th-actions-size {
    width: 180px;
}

.btn-whatsapp-color {
    background-color: #25D366;
    border-color: #25D366;
}

.btn-whatsapp-color:hover {
    background-color: #1ebe57;
    border-color: #1ebe57;
}

/* Controladores y cuadro de búsqueda de DataTables */
.card-cotizaciones-main .dataTables_wrapper {
    overflow-x: hidden !important;
}

.dataTables_wrapper .dataTables_filter {
    float: right !important;
    text-align: right !important;
    margin-top: 15px;
    width: auto !important;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5em !important;
    display: inline-block !important;
    width: 200px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.375rem 0.75rem !important;
}

/* ============================================================
   08. MÓDULO COMPRAS
   ============================================================ */
/* Paleta corporativa TecnoSystems */
.tsp-bg { background-color: #0d427d !important; color: white !important; }
.tsp-border { border-color: #0d427d !important; }
.tsp-text { color: #0d427d !important; }

/* Ajustes milimétricos para Select2 del módulo de compras (escopeado) */
.formularioCompra .input-group-sm > .select2-container--default {
    flex: 1 1 auto !important;
    width: 1% !important;
}

.formularioCompra .select2-container .select2-selection--single {
    height: 31px !important;
    min-height: 31px !important;
    border: 1px solid #0d427d !important;
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.formularioCompra .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1 !important;
    font-weight: bold;
    color: #6c757d !important;
    padding-left: 8px !important;
}

.formularioCompra .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 29px !important;
    top: 0 !important;
}

/* Carrito de compras */
.caja-productos-compras {
    min-height: 45vh;
    max-height: 55vh;
    overflow-y: auto;
    border: 2px dashed #0d427d;
    border-radius: 10px;
    background-color: #fcfcfd;
}

.caja-productos-compras::-webkit-scrollbar { width: 8px; }
.caja-productos-compras::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.caja-productos-compras::-webkit-scrollbar-thumb { background: #0d427d; border-radius: 10px; }

/* Fila de producto del carrito de compras */
.fila-producto {
    font-size: 13px;
    transition: background-color 0.3s;
}

.fila-producto .descProd {
    font-size: 11px;
}

.fila-producto .precioProd {
    font-size: 13px;
}

.fila-producto .subtotalFila {
    font-size: 14px;
    color: #0d427d;
    font-weight: bold;
}

.selectMedida {
    font-size: 11px;
    max-width: 85px;
    cursor: pointer;
}

.shadow-inner-compra {
    box-shadow: inset 0 2px 8px rgba(13, 66, 125, 0.08);
}

/* ============================================================
   09. MÓDULO GARANTÍAS
   ============================================================ */
.card-kpi {
    border: none;
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-kpi:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
}

.icon-shape {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================================
   10. MÓDULO MI NEGOCIO
   ============================================================ */
.card-moderna {
    border: none;
    border-radius: 15px;
    box-shadow: 0 0.5rem 1.5rem rgba(26, 58, 138, 0.15);
    overflow: hidden;
}

.header-gradiente {
    background: linear-gradient(135deg, #1a3a8a 0%, #4e73df 100%);
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.titulo-seccion {
    color: #1a3a8a;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed #eaecf4;
}

.caja-logo-preview {
    border: 2px dashed #4e73df;
    border-radius: 15px;
    padding: 15px;
    background-color: #f8f9fc;
    transition: all 0.3s ease;
}

.caja-logo-preview:hover {
    background-color: #eaecf4;
    border-color: #1a3a8a;
}

.input-moderno {
    border-radius: 0 8px 8px 0;
    border: 1px solid #d1d3e2;
    padding: 0.75rem 1rem;
    height: auto;
    font-weight: 500;
    color: #5a5c69;
    transition: all 0.2s ease-in-out;
}

.input-moderno:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.icono-input-moderno {
    background-color: transparent;
    border: 1px solid #d1d3e2;
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #1a3a8a;
    padding: 0.75rem 1rem;
}

.input-group:focus-within .icono-input-moderno {
    border-color: #4e73df;
    color: #4e73df;
}

.btn-tecnosystems {
    background: linear-gradient(to right, #1a3a8a, #224abe);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.btn-tecnosystems:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(26, 58, 138, 0.3);
    color: #fff;
}

.btn-outline-tecno {
    color: #1a3a8a;
    border: 2px solid #1a3a8a;
    background-color: transparent;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-outline-tecno:hover {
    background-color: #1a3a8a;
    color: #fff;
}

.etiqueta-input {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

/* ============================================================
   11. MÓDULOS CRUD (Clientes, Proveedores, Categorías,
       Productos, Usuarios, Perfiles, Empresas, Licencias,
       Configuración)
   ============================================================ */

/* Tarjetas principales de los módulos CRUD */
.card-crud-main {
    border-radius: 15px;
    overflow: hidden;
}

.card-crud-main .card-header {
    border-radius: 15px 15px 0 0;
}

/* Tablas DataTables de los módulos de listado */
.tabla-crud-global {
    width: 100% !important;
}

/* Selector múltiple de la tabla de productos */
.checkbox-masivo {
    transform: scale(1.3);
    cursor: pointer;
}

/* Imagen de producto/logo en tablas */
.imagen-thumb-mini {
    width: 50px;
    max-height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}

/* Fila de usuario inactivo */
.fila-usuario-inactivo {
    opacity: 0.6;
    background-color: #f8d7da;
}

/* Fila de licencia vencida / por vencer */
.fila-licencia-vencida {
    border-left: 6px solid #dc3545 !important;
}

.fila-licencia-proxima {
    border-left: 6px solid #ffc107 !important;
}

/* Permisos de usuario (checkboxes compactos) */
.contenedor-permisos {
    font-size: 0.9rem;
}

/* Gestor de seriales en producto (scroll interno) */
.caja-seriales-scroll {
    max-height: 250px;
    overflow-y: auto;
}

/* Modales de licencias redondeados */
.modal-redondeado {
    border-radius: 20px;
}

.modal-redondeado .modal-header {
    border-radius: 20px 20px 0 0;
}

/* ============================================================
   12. MÓDULO INVENTARIO
   ============================================================ */
.caja-imagen-tspro {
    height: 260px !important;
    width: 100% !important;
    background-color: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 12px !important;
    overflow: hidden !important;
    display: block !important;
}

.img-tspro-ajustada {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Header de la ficha comercial */
.header-ficha-comercial {
    background: linear-gradient(135deg, #0d6efd 0%, #0043a6 100%);
}

.titulo-ficha-comercial {
    letter-spacing: 1px;
    max-width: 200px;
}

/* Tarjetas de precio con acento lateral */
.card-precio-acento {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.pie-ficha-comercial {
    font-size: 0.75rem;
}

/* ============================================================
   13. MÓDULO HISTORIAL DE COMPRAS
   ============================================================ */
.btn-imprimir-carta-compra {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-imprimir-carta-compra:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* ============================================================
   14. MÓDULO CUENTAS POR PAGAR
   ============================================================ */
.cuenta-celda-productos {
    font-size: 0.85rem;
}

.cuenta-celda-fecha {
    min-width: 120px;
}

.modal-secundario-cxp {
    z-index: 1060;
}

/* ============================================================
   15. MÓDULO CRÉDITOS
   ============================================================ */
.modal-secundario-creditos {
    z-index: 1060;
}

.monto-input-credito {
    font-size: 1.5rem;
}

/* ============================================================
   16. MÓDULO APARTADOS
   ============================================================ */
.modal-secundario-apartados {
    z-index: 1060;
}

.monto-input-apartado {
    font-size: 2rem;
    height: 60px;
    border: 2px solid #ffc107;
}

/* ============================================================
   17. MÓDULO CUADRE DE CAJA
   ============================================================ */
.tarjeta-ganancias-reales {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
    color: white;
}

.tarjeta-ganancias-reales h4 {
    color: rgba(255,255,255,0.9);
    letter-spacing: 1px;
}

.aviso-cajero-alerta {
    border-left: 4px solid #ffc107 !important;
}

.movimientos-tabla {
    border-bottom: none;
}

.movimientos-tabla thead {
    font-size: 12px;
}

.movimientos-tabla tbody {
    font-size: 14px !important;
}

.transition-all {
    transition: all 0.3s ease;
}

/* ============================================================
   18. MÓDULO GASTOS
   ============================================================ */
.subtitulo-tarjeta-mes {
    font-size: 0.85rem;
}

/* ============================================================
   19. MÓDULO REPORTES
   ============================================================ */
.contenedor-reportes {
    min-height: 80vh;
}

.contenedor-grafico {
    height: 200px;
    width: 100%;
}

.lista-scroll-reporte {
    max-height: 350px;
    overflow-y: auto;
}

.avatar-posicion {
    width: 48px;
    height: 48px;
}

.medalla-oro { color: #ffd700; }
.medalla-plata { color: #c0c0c0; }
.medalla-bronce { color: #cd7f32; }

/* ============================================================
   20. FICHA COMERCIAL WHATSAPP (SOLAPADA CON INVENTARIO)
   ============================================================ */
/* Esta sección se fusionó con la 12 (MÓDULO INVENTARIO),
   porque la ficha comercial vive dentro de ese módulo.
   Ver: .caja-imagen-tspro y .img-tspro-ajustada */

/* ============================================================
   21. CLASES LEGACY (SB Admin 2) Y UTILIDADES
   ============================================================ */

/* Bordes izquierdos de tarjetas (tema SB Admin 2 / Bootstrap 4) */
.border-left-primary { border-left: 0.25rem solid #4e73df !important; }
.border-left-secondary { border-left: 0.25rem solid #858796 !important; }
.border-left-success { border-left: 0.25rem solid #1cc88a !important; }
.border-left-info { border-left: 0.25rem solid #36b9cc !important; }
.border-left-warning { border-left: 0.25rem solid #f6c23e !important; }
.border-left-danger { border-left: 0.25rem solid #e74a3b !important; }
.border-left-dark { border-left: 0.25rem solid #5a5c69 !important; }

/* Utilidades de texto heredadas de SB Admin 2 */
.text-gray-800 { color: #5a5c69 !important; }
.text-gray-700 { color: #6e707e !important; }
.text-gray-600 { color: #858796 !important; }
.text-gray-400 { color: #d1d3e2 !important; }
.text-gray-300 { color: #dddfeb !important; }
.text-xs { font-size: 0.7rem !important; }
.font-weight-bold { font-weight: 700 !important; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }

/* Utilidades de texto del proyecto */
.text-darken {
    color: #343a40;
    font-weight: 600;
}

/* Espaciado legacy (Bootstrap 4) */
.no-gutters {
    margin-right: 0;
    margin-left: 0;
}

.no-gutters > .col,
.no-gutters > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
}

.mr-2 { margin-right: 0.5rem !important; }
.ml-2 { margin-left: 0.5rem !important; }

/* ============================================================
   22. RESPONSIVE MAESTRO (TABLETS Y CELULARES)
   ============================================================

   BREAKPOINTS:
   - >1400px : PC grande (diseño completo)
   - 1200-1399px : PC estándar
   - 992-1199px : Laptop / tablet apaisada
   - 768-991px : Tablet vertical
   - 576-767px : Teléfono grande / tablet pequeña
   - <576px : Teléfono
   ============================================================ */

/* ---------- Adaptación para tablets (≤ 991px) ---------- */
@media (max-width: 991px) {

    /* Login */
    .login-side {
        padding: 3rem 1.5rem;
        min-height: 100vh;
        box-shadow: none;
    }
    .login-form-wrapper {
        max-width: 100%;
    }
    .promo-side {
        display: none !important;
    }

    /* Tarjetas táctiles del inicio */
    .card-tactil {
        height: 160px;
        padding: 1rem;
    }
    .card-tactil i.main-icon {
        font-size: 1.9rem;
        margin-right: 1rem;
    }

    /* Ventas POS: apilar columnas */
    .pos-wrapper {
        height: auto !important;
        min-height: 100vh;
    }
    .pos-left-col,
    .pos-right-col {
        height: auto !important;
    }
}

/* ---------- Adaptación para tablets y móviles (≤ 768px) ---------- */
@media (max-width: 768px) {

    /* Layout principal */
    #sidebar {
        display: none;
    }
    #content {
        margin-left: 0;
        width: 100%;
    }
    .topbar {
        padding: 0 1.2rem;
    }
    .topbar h5 {
        font-size: 1.05rem;
    }

    /* Contenido más compacto en móvil */
    #content > .p-4 {
        padding: 0.75rem !important;
    }

    /* Blindaje de tablas: nunca desbordan horizontalmente */
    .table-responsive {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .table-responsive > table {
        width: 100% !important;
        white-space: nowrap; /* tablas planas: scroll horizontal cómodo */
    }
    /* Tablas DataTables responsive: permiten salto de línea y colapso de columnas */
    .table-responsive > table.dataTable,
    .table-responsive > table.dt-responsive,
    table.dataTable {
        white-space: normal !important;
        word-break: break-word;
    }
    /* Tablas fuera de un contenedor: ancho controlado, sin forzar nowrap */
    table {
        width: 100% !important;
        max-width: 100%;
    }

    /* Login */
    .login-title-text {
        font-size: 1.8rem;
    }
    .login-subtitle-text {
        font-size: 0.8rem;
    }

    /* Inicio: tarjetas táctiles más compactas */
    .card-tactil {
        height: 130px;
    }
    .card-tactil i.main-icon {
        font-size: 1.7rem;
    }
    .card-tactil span {
        font-size: 0.95rem;
    }
    .welcome-banner {
        padding: 1.2rem !important;
    }
    .welcome-banner h3 {
        font-size: 1.25rem;
    }

    /* =========================================
       VENTAS POS: tabla a tarjetas
       ========================================= */
    .pos-wrapper {
        height: auto !important;
        min-height: 100vh;
        padding: 5px !important;
    }

    .pos-left-col,
    .pos-right-col {
        height: auto !important;
        overflow: visible !important;
    }

    .pos-right-col > .flex-grow-1 {
        min-height: 150px;
    }

    /* Ocultar encabezado de la tabla del POS */
    .table-pos thead,
    .table-pos thead tr,
    .table-pos thead th {
        display: none !important;
    }

    /* Destruir formato tabla y volverlo bloque */
    .table-pos,
    .table-pos tbody,
    .table-pos tr,
    .table-pos td {
        display: block !important;
        width: 100% !important;
    }

    /* Tarjeta del producto */
    .table-pos tr.productoCargado {
        margin-bottom: 15px !important;
        background: #f8f9fa !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
        overflow: hidden !important;
    }

    /* Ocultar columna # */
    .table-pos td:nth-child(1) {
        display: none !important;
    }

    /* Estructura de celdas dentro de la tarjeta */
    .table-pos td {
        text-align: right !important;
        padding: 10px 15px 10px 125px !important;
        position: relative !important;
        border-bottom: 1px solid #e9ecef !important;
        min-height: 50px !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        background-color: #ffffff !important;
    }

    .table-pos td:last-child {
        border-bottom: none !important;
    }

    /* Título del producto resalta arriba */
    .table-pos td:nth-child(2) {
        background-color: #e2e8f0 !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 15px 10px !important;
        border-bottom: 2px solid #cbd5e1 !important;
        flex-direction: column !important;
    }

    .table-pos td:nth-child(2) .nombre-producto-txt {
        font-size: 1.05rem !important;
        color: #1e293b !important;
    }

    /* Textos guía inyectados automáticamente */
    .table-pos td:nth-child(3)::before { content: "TIPO:"; }
    .table-pos td:nth-child(4)::before { content: "CANTIDAD:"; }
    .table-pos td:nth-child(5)::before { content: "PRECIO BASE:"; }
    .table-pos td:nth-child(6)::before { content: "DESCUENTO %:"; }
    .table-pos td:nth-child(7)::before { content: "SUBTOTAL:"; }

    .table-pos td::before {
        position: absolute !important;
        left: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-weight: 800 !important;
        color: #475569 !important;
        font-size: 0.85rem !important;
        text-transform: uppercase !important;
        pointer-events: none !important;
    }

    .table-pos td:nth-child(2)::before,
    .table-pos td:nth-child(8)::before {
        display: none !important;
    }

    .table-pos td select,
    .table-pos td input {
        width: 100% !important;
        max-width: 130px !important;
        height: 40px !important;
        font-size: 1rem !important;
        text-align: center !important;
        margin: 0 !important;
        border-radius: 4px !important;
        border: 1px solid #ced4da !important;
    }

    /* Botón eliminar */
    .table-pos td:nth-child(8) {
        justify-content: center !important;
        background-color: #f8d7da !important;
        padding: 10px !important;
    }

    .table-pos td:nth-child(8) .d-flex {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    .table-pos td:nth-child(8) button.btnQuitar {
        flex-grow: 1 !important;
        padding: 8px !important;
        font-size: 1.1rem !important;
        color: #dc3545 !important;
        background-color: transparent !important;
        border: 1px solid #dc3545 !important;
        border-radius: 6px !important;
    }

    .table-pos td:nth-child(8) button.btnAbrirModalSeriales {
        flex-grow: 1 !important;
        padding: 8px !important;
        font-size: 1rem !important;
    }

    .table-pos tr#filaVaciaMensaje {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .table-pos tr#filaVaciaMensaje td {
        justify-content: center !important;
        padding: 30px 10px !important;
        border: none !important;
        background: transparent !important;
    }

    /* =========================================
       COTIZACIONES + EDICIÓN: tabla a tarjetas
       ========================================= */
    .modulo-cotizaciones.cot-master {
        height: auto;
        min-height: 100vh;
    }

    .modulo-cotizaciones .cot-top-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    .modulo-cotizaciones .cliente-select-container {
        max-width: 100%;
    }

    .modulo-cotizaciones .cot-content {
        padding: 8px;
    }

    /* Transformación de Tabla a Tarjetas */
    .modulo-cotizaciones .table thead {
        display: none;
    }

    .modulo-cotizaciones .table,
    .modulo-cotizaciones .table tbody,
    .modulo-cotizaciones .table tr,
    .modulo-cotizaciones .table td {
        display: block;
        width: 100%;
    }

    .modulo-cotizaciones .table tr.itemCot {
        margin-bottom: 12px;
        background: #fff;
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        box-shadow: 0 3px 8px rgba(0,0,0,0.05);
        overflow: hidden;
    }

    .modulo-cotizaciones .table td {
        text-align: right;
        padding: 8px 12px 8px 110px;
        position: relative;
        border-bottom: 1px solid #f1f5f9;
        min-height: 48px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .modulo-cotizaciones .table td:nth-child(1) {
        background-color: #f8fafc;
        text-align: center;
        justify-content: center;
        font-size: 1rem;
        color: #0d6efd;
        border-bottom: 2px solid #e2e8f0;
        padding: 12px 10px;
    }

    .modulo-cotizaciones .table td:nth-child(2)::before { content: "Tipo:"; }
    .modulo-cotizaciones .table td:nth-child(3)::before { content: "Cantidad:"; }
    .modulo-cotizaciones .table td:nth-child(4)::before { content: "Precio Base:"; }
    .modulo-cotizaciones .table td:nth-child(5)::before { content: "Subtotal:"; }

    .modulo-cotizaciones .table td::before {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-weight: 800;
        color: #64748b;
        font-size: 0.8rem;
        text-transform: uppercase;
        pointer-events: none;
    }

    .modulo-cotizaciones .table td select,
    .modulo-cotizaciones .table td input {
        width: 100%;
        max-width: 160px;
        height: 38px;
        font-size: 1rem;
        text-align: center;
    }

    .modulo-cotizaciones .table td:nth-child(6) {
        justify-content: center;
        background-color: #fff0f0;
        padding: 8px;
    }

    .modulo-cotizaciones .table td:nth-child(6) button {
        width: 100%;
        font-size: 0.95rem;
        padding: 6px;
    }

    .modulo-cotizaciones .table tr#filaVaciaMensaje {
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .modulo-cotizaciones .table tr#filaVaciaMensaje td {
        justify-content: center;
        border: none;
        padding: 30px 10px;
    }

    /* =========================================
       HISTORIAL DE COTIZACIONES
       ========================================= */
    .container-historial {
        padding: 0.4rem !important;
    }

    .title-cotizaciones {
        font-size: 1.1rem !important;
        text-align: center !important;
        width: 100% !important;
    }

    .btn-nueva-cotizacion {
        width: 100% !important;
        text-align: center !important;
        padding: 10px !important;
    }

    .container-fechas-grid {
        padding: 12px 10px !important;
    }

    .item-filtro-fecha {
        flex: 1 1 40% !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }

    .input-fecha-filtro {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.85rem !important;
        padding: 6px !important;
    }

    .container-btn-limpiar {
        width: 100% !important;
        margin-top: 5px !important;
    }

    .w-100-mobile {
        width: 100% !important;
        padding: 8px !important;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left !important;
        float: none !important;
        width: 100% !important;
        margin-bottom: 10px !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-top: 5px !important;
    }

    .wrapper-acciones-buttons .btn {
        padding: 6px 10px !important;
    }

    /* =========================================
       COMPRAS: apilar buscador y formulario
       ========================================= */
    .caja-productos-compras {
        min-height: 35vh;
        max-height: 50vh;
    }

    .selectMedida {
        max-width: 100%;
    }

    /* =========================================
       MÓDULOS CRUD: botones de acción a pantalla completa
       ========================================= */
    .wrapper-acciones-buttons,
    .acciones-tabla {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .acciones-tabla .btn {
        flex: 1 1 auto;
    }
}

/* ---------- Adaptación para tablets verticales y celulares (≤ 767px) ---------- */
@media (max-width: 767px) {

    /* Ventas POS: total gigante más pequeño */
    .text-total-gigante {
        font-size: 1.8rem;
    }

    /* Cotizaciones: sidebar total a ancho completo */
    .modulo-cotizaciones .cot-sidebar {
        width: 100%;
    }
}

/* ---------- Adaptación para teléfonos (≤ 576px) ---------- */
@media (max-width: 576px) {

    /* Login */
    .login-submit-btn {
        font-size: 1rem;
        padding: 10px;
    }
    .login-input-group .form-control {
        font-size: 1rem;
    }

    /* Ficha comercial / inventario */
    .caja-imagen-tspro {
        height: 220px !important;
        padding: 8px !important;
    }

    /* Mi negocio */
    .btn-tecnosystems {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Inicio */
    .welcome-banner {
        text-align: center;
    }
    .welcome-banner .badge {
        font-size: 0.85rem;
    }

    /* Topbar compacto */
    .topbar {
        height: 60px;
        gap: 0.5rem;
    }
    .topbar form[style*="min-width"] {
        min-width: 130px !important;
        max-width: 42vw;
    }
    .topbar .btn {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
        white-space: nowrap;
    }

    /* Tablas: quitar nowrap para evitar cortes en móviles muy pequeños */
    .table-pos td,
    .modulo-cotizaciones .table td {
        white-space: normal;
    }
}

/* ---------- Adaptación para monitores medianos / tablets grandes (≤ 1024px) ---------- */
@media (max-width: 1024px) {

    /* Cotizaciones: apilar contenido */
    .modulo-cotizaciones .cot-content {
        flex-direction: column;
        overflow: visible;
    }

    .modulo-cotizaciones .cot-sidebar {
        width: 100%;
    }

    .modulo-cotizaciones.cot-master {
        height: auto;
    }

    /* Ventas POS: botones y búsqueda más flexibles */
    .pos-top-bar {
        flex-wrap: wrap;
    }
}
/* ============================================================
   24. M�DULO RESTAURANTE
   ============================================================ */
.mesa-libre { border: 2px solid #198754 !important; }
.mesa-ocupada { border: 2px solid #dc3545 !important; }
.border-azure { border-color: #bfdbfe !important; }
.mesa-libre:hover, .mesa-ocupada:hover { box-shadow: 0 8px 18px rgba(0,0,0,0.15) !important; transform: translateY(-2px); }

.card-menu-item { cursor: pointer; border: 2px solid #e9ecef !important; transition: all 0.15s ease; }
.card-menu-item:hover { border-color: #f97316 !important; box-shadow: 0 6px 14px rgba(249,115,22,0.2) !important; }
.card-menu-item.seleccionado { border-color: #c2410c !important; background-color: #fff7ed; box-shadow: 0 0 0 2px rgba(249,115,22,0.35) !important; }

.nav-pills .nav-link.active.bg-danger { background-color: #dc3545 !important; }

.nav-pills-rest .nav-link,
.nav-pills-rest .nav-link:hover,
.nav-pills-rest .nav-link:focus,
.nav-pills-rest .nav-link:focus-visible,
.nav-pills-rest .nav-link.active {
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
}

.nav-pills-rest .nav-link.active {
    border-color: transparent !important;
    color: #ffffff !important;
}

.nav-pills-rest .nav-link:not(.active):hover,
.nav-pills-rest .nav-link:not(.active):focus,
.nav-pills-rest .nav-link:not(.active):focus-visible {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* ============================================================
   SWITCHES DE PERMISOS BLOQUEADOS (Usuarios)
   ============================================================ */
.switch-bloqueado {
    opacity: 0.55;
}

.switch-bloqueado .form-check-input {
    cursor: not-allowed;
}

.switch-bloqueado .form-check-label {
    cursor: not-allowed;
}

/* ============================================================
   BOTÓN IMPRIMIR (Inventario) - azul pizarra oscuro
   ============================================================ */
.btn-imprimir {
    background-color: #334155;
    color: #ffffff;
    border: 1px solid #334155;
}

.btn-imprimir:hover,
.btn-imprimir:focus,
.btn-imprimir:active {
    background-color: #475569;
    border-color: #475569;
    color: #ffffff;
}
