/*!
 * ==========================================================================
 *  Modern UI — Capa de mejora visual para SimplePOS
 * ==========================================================================
 *  Solo estilos. No modifica HTML de negocio ni JavaScript funcional.
 *  Se carga DESPUÉS de styles.css para refinar la apariencia general:
 *  colores, tipografía, iconos, tarjetas, formularios, tablas y responsive.
 * ==========================================================================
 */

/* ==========================================================================
   1. TOKENS DE DISEÑO
   ========================================================================== */
:root {
    --m-primary: #4f46e5;
    --m-primary-dark: #4338ca;
    --m-accent: #7c3aed;
    --m-cyan: #06b6d4;
    --m-success: #10b981;
    --m-success-dark: #059669;
    --m-warning: #f59e0b;
    --m-warning-dark: #d97706;
    --m-danger: #ef4444;
    --m-danger-dark: #dc2626;
    --m-info: #3b82f6;

    --m-ink: #0f172a;
    --m-ink-2: #334155;
    --m-muted: #64748b;
    --m-soft: #94a3b8;
    --m-line: #e2e8f0;
    --m-line-2: #f1f5f9;

    --m-bg: #f1f5f9;
    --m-surface: #ffffff;

    --m-radius-lg: 18px;
    --m-radius: 14px;
    --m-radius-sm: 10px;
    --m-radius-xs: 8px;

    --m-shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --m-shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --m-shadow: 0 6px 18px rgba(15, 23, 42, .08);
    --m-shadow-lg: 0 18px 40px rgba(15, 23, 42, .14);

    --m-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --m-gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --m-gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --m-gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --m-gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);

    --m-ease: cubic-bezier(.4, 0, .2, 1);
    --m-transition: all .2s var(--m-ease);
}

/* ==========================================================================
   2. BASE / TIPOGRAFÍA
   ========================================================================== */
body {
    font-family: 'Inter', 'Lato', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    color: var(--m-ink-2);
    background-color: var(--m-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--m-ink);
    font-weight: 700;
    letter-spacing: -.01em;
}

h1 { font-weight: 800; }
h2 { font-weight: 800; }

a {
    color: var(--m-primary);
    transition: color .15s var(--m-ease);
}

a:hover,
a:focus {
    color: var(--m-primary-dark);
    text-decoration: none;
}

::selection {
    background: rgba(79, 70, 229, .18);
    color: var(--m-ink);
}

*:focus-visible {
    outline: 2px solid rgba(79, 70, 229, .55);
    outline-offset: 2px;
}

.text-muted { color: var(--m-muted) !important; }
.text-primary { color: var(--m-primary) !important; }
.text-success { color: var(--m-success) !important; }
.text-warning { color: var(--m-warning) !important; }
.text-danger { color: var(--m-danger) !important; }
.text-info { color: var(--m-info) !important; }

/* Números alineados (precios, totales, tablas) */
#gtotal, #total, #total-payable, .totals, .table td, .table th,
.format-money, .price {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   3. HEADER PRINCIPAL
   ========================================================================== */
.main-header .logo,
.main-header .navbar {
    background: var(--m-gradient) !important;
    border: 0 !important;
    box-shadow: 0 4px 18px rgba(79, 70, 229, .22);
}

.main-header .logo {
    font-weight: 800 !important;
    letter-spacing: -.02em;
    border-right: 1px solid rgba(255, 255, 255, .12) !important;
}

.main-header .logo:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
}

.main-header .navbar .nav > li > a,
.main-header .navbar-nav > li > a {
    color: rgba(255, 255, 255, .92) !important;
    transition: var(--m-transition);
    border-radius: var(--m-radius-sm);
}

.main-header .navbar .nav > li > a:hover,
.main-header .navbar .nav > li > a:focus,
.main-header .navbar-nav > .open > a,
.main-header .navbar-nav > .open > a:hover,
.main-header .navbar-nav > .open > a:focus {
    background: rgba(255, 255, 255, .16) !important;
    color: #fff !important;
}

.main-header .navbar-custom-menu .dropdown-menu {
    border: 0;
    border-radius: var(--m-radius);
    box-shadow: var(--m-shadow-lg);
    overflow: hidden;
}

.main-header .navbar-custom-menu .dropdown-menu > li > a {
    padding: 10px 18px;
    transition: background .15s var(--m-ease);
}

.main-header .sidebar-toggle {
    color: #fff !important;
}

/* ==========================================================================
   4. SIDEBAR (rediseño SaaS: navy, agrupada, accesible)
   ========================================================================== */
.main-sidebar,
.left-side {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
    border-right: 1px solid #334155;
    box-shadow: 6px 0 28px rgba(15, 23, 42, .32);
    transition: width .28s var(--m-ease), transform .28s var(--m-ease);
}

/* Encabezados de sección */
.sidebar-menu > li.header {
    background: transparent !important;
    color: #64748b !important;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 18px 18px 7px !important;
    margin-top: 4px;
    border-top: 1px solid rgba(51, 65, 85, .6);
}

.sidebar-menu > li.header:first-child {
    border-top: 0;
    margin-top: 0;
}

/* Ítems principales */
.sidebar-menu > li > a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 2px 8px;
    padding: 9px 12px !important;
    color: #cbd5e1 !important;
    border-left: 0 !important;
    border-radius: var(--m-radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.25;
    transition: var(--m-transition);
}

.sidebar-menu > li > a > span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu > li > a:hover,
.sidebar-menu > li:hover > a {
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
}

.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a {
    background: linear-gradient(135deg, rgba(99, 102, 241, .95) 0%, rgba(139, 92, 246, .95) 100%) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .35);
}

.sidebar-menu > li.active > a::before,
.sidebar-menu > li.menu-open > a::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: #a5b4fc;
    box-shadow: 0 0 10px rgba(165, 180, 252, .8);
}

/* Iconos unificados */
.sidebar-menu > li > a > i[class*="fa-"]:not(.pull-right) {
    width: 22px;
    min-width: 22px;
    margin-right: 11px !important;
    font-size: 16px !important;
    text-align: center;
    color: rgba(203, 213, 225, .85) !important;
    transition: var(--m-transition);
}

.sidebar-menu > li > a:hover > i[class*="fa-"]:not(.pull-right),
.sidebar-menu > li.active > a > i[class*="fa-"]:not(.pull-right),
.sidebar-menu > li.menu-open > a > i[class*="fa-"]:not(.pull-right) {
    color: #fff !important;
}

/* Flecha de submenú */
.sidebar-menu > li > a > .pull-right {
    margin: 2px 0 0 !important;
    font-size: 12px !important;
    color: #64748b !important;
    transition: transform .25s var(--m-ease), color .2s var(--m-ease);
}

.sidebar-menu > li.menu-open > a > .pull-right {
    transform: rotate(-90deg);
    color: #fff !important;
}

/* Submenús */
.sidebar-menu .treeview-menu {
    background: rgba(255, 255, 255, .04) !important;
    border-radius: var(--m-radius-sm);
    margin: 2px 8px 8px !important;
    padding: 5px !important;
}

.sidebar-menu .treeview-menu > li > a {
    display: flex;
    align-items: center;
    min-height: 36px;
    color: #94a3b8 !important;
    font-size: 12.5px;
    font-weight: 500;
    padding: 7px 10px !important;
    border-radius: var(--m-radius-xs);
    margin: 1px 0;
    transition: var(--m-transition);
}

.sidebar-menu .treeview-menu > li > a:hover {
    background: rgba(255, 255, 255, .09) !important;
    color: #fff !important;
}

.sidebar-menu .treeview-menu > li.active > a {
    background: rgba(99, 102, 241, .22) !important;
    color: #c7d2fe !important;
    font-weight: 600;
}

.sidebar-menu .treeview-menu > li > a > i[class*="fa-"] {
    width: 18px;
    min-width: 18px;
    margin-right: 8px !important;
    font-size: 13px !important;
    text-align: center;
    color: rgba(148, 163, 184, .8) !important;
    transition: var(--m-transition);
}

.sidebar-menu .treeview-menu > li > a:hover > i[class*="fa-"],
.sidebar-menu .treeview-menu > li.active > a > i[class*="fa-"] {
    color: #e2e8f0 !important;
}

/* Divisores */
.sidebar-menu .divider,
.sidebar-menu .treeview-menu .divider {
    background: #334155 !important;
    height: 1px;
    margin: 6px 14px !important;
}

/* Accesibilidad: foco visible por teclado */
.sidebar-menu > li > a:focus-visible,
.sidebar-menu .treeview-menu > li > a:focus-visible,
.sidebar-user-logout:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: -2px;
    border-radius: var(--m-radius-sm);
}

/* ==========================================================================
   4-B. SIDEBAR COLAPSADA (rail de iconos + flyouts)
   ========================================================================== */
.sidebar-mini.sidebar-collapse .main-sidebar {
    border-right: 1px solid #334155;
    box-shadow: 6px 0 28px rgba(15, 23, 42, .32);
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu {
    padding: 8px 0;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a {
    width: 44px;
    min-height: 44px;
    margin: 3px auto !important;
    padding: 0 !important;
    justify-content: center;
    border-radius: 12px;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a::before {
    display: none;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a > i[class*="fa-"]:not(.pull-right) {
    margin: 0 !important;
    font-size: 17px !important;
}

/* Flyout de etiqueta al pasar el mouse (colapsada) */
.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li:hover > a > span:not(.pull-right) {
    display: block !important;
    position: absolute !important;
    left: 50px !important;
    top: 0 !important;
    width: auto !important;
    min-width: 160px;
    margin: 0 !important;
    padding: 13px 16px !important;
    background: #0f172a !important;
    color: #f1f5f9 !important;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #334155;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    box-shadow: 12px 12px 30px rgba(2, 6, 23, .55);
    z-index: 1060;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li.active:hover > a > span:not(.pull-right) {
    background: #312e81 !important;
    color: #fff !important;
}

/* Flyout de submenú (colapsada) */
.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li:hover > .treeview-menu {
    display: block !important;
    position: absolute !important;
    left: 50px !important;
    top: 46px !important;
    width: 220px !important;
    margin: 0 !important;
    padding: 8px !important;
    background: #0f172a !important;
    border: 1px solid #334155;
    border-radius: 0 12px 12px 12px;
    box-shadow: 14px 16px 36px rgba(2, 6, 23, .6);
    z-index: 1060;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li:hover > .treeview-menu > li > a {
    padding-left: 12px !important;
    font-size: 12.5px;
}

/* ==========================================================================
   4-C. TARJETA DE USUARIO (pie de la sidebar)
   ========================================================================== */
.sidebar-user {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 10px 10px;
    padding: 10px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: var(--m-radius-sm);
}

.sidebar-user-avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .5);
}

.sidebar-user-info {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-user-name {
    display: block;
    color: #f1f5f9;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-mail {
    display: block;
    color: #94a3b8;
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-logout {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #94a3b8 !important;
    border-radius: 8px;
    transition: var(--m-transition);
}

.sidebar-user-logout:hover {
    color: #fff !important;
    background: rgba(239, 68, 68, .3);
}

/* Colapsada: solo avatar */
.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-user {
    justify-content: center;
    margin: 8px 3px;
    padding: 6px;
    background: transparent;
    border: 0;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-user-info,
.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-user-logout {
    display: none;
}

/* ==========================================================================
   4-D. SIDEBAR EN MÓVIL (drawer + overlay)
   ========================================================================== */
@media (max-width: 767px) {
    .main-sidebar {
        z-index: 1050 !important;
        box-shadow: 12px 0 40px rgba(2, 6, 23, .5) !important;
    }

    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .55);
        z-index: 1040;
        pointer-events: none;
        animation: m-fade-in .2s ease-out;
    }

    @keyframes m-fade-in {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .sidebar-menu > li > a,
    .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a {
        min-height: 46px;
    }
}

/* Botón hamburguesa del POS */
.pos .main-header .navbar > .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 6px 0 0;
    padding: 0 !important;
    border-radius: 10px;
    color: #fff !important;
    background: rgba(255, 255, 255, .12);
    transition: var(--m-transition);
}

.pos .main-header .navbar > .sidebar-toggle:hover {
    background: rgba(255, 255, 255, .24);
}

.pos .main-header .navbar > .sidebar-toggle::before {
    font-size: 15px;
}

/* ==========================================================================
   5. CONTENIDO / BREADCRUMB
   ========================================================================== */
.content-wrapper,
.right-side {
    background-color: var(--m-bg) !important;
}

.content-header > h1 {
    font-weight: 800;
    color: var(--m-ink);
}

.content-header > .breadcrumb {
    background: var(--m-surface);
    border-radius: 999px;
    padding: 7px 18px;
    box-shadow: var(--m-shadow-sm);
    border: 1px solid var(--m-line);
}

.breadcrumb > li > a {
    color: var(--m-muted);
    font-weight: 500;
}

.breadcrumb > .active {
    color: var(--m-ink);
    font-weight: 600;
}

/* ==========================================================================
   6. TARJETAS / BOXES
   ========================================================================== */
.box {
    border-radius: var(--m-radius) !important;
    border: 1px solid var(--m-line) !important;
    box-shadow: var(--m-shadow) !important;
    overflow: hidden;
    background: var(--m-surface);
}

.box.box-primary,
.box.box-success,
.box.box-warning,
.box.box-danger,
.box.box-info {
    border-top-width: 3px !important;
}

.box-header {
    background: var(--m-surface);
    border-bottom: 1px solid var(--m-line) !important;
    padding: 16px 18px;
}

.box-header .box-title {
    font-weight: 700;
    color: var(--m-ink);
    font-size: 16px;
}

.box-body {
    padding: 18px;
}

.box-footer {
    background: #f8fafc;
    border-top: 1px solid var(--m-line);
}

.well {
    background: var(--m-surface);
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow-sm);
}

/* ==========================================================================
   7. BOTONES
   ========================================================================== */
.btn {
    border-radius: var(--m-radius-sm) !important;
    font-weight: 600;
    letter-spacing: .01em;
    transition: var(--m-transition);
    border-width: 1px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-flat {
    border-radius: var(--m-radius-sm) !important;
}

.btn-xs {
    border-radius: var(--m-radius-xs) !important;
    padding: 4px 9px;
}

.btn-primary {
    background: var(--m-gradient) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(79, 70, 229, .25);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .35);
}

.btn-success {
    background: var(--m-gradient-success) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(16, 185, 129, .25);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 10px 22px rgba(16, 185, 129, .35);
}

.btn-warning {
    background: var(--m-gradient-warning) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(245, 158, 11, .25);
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    box-shadow: 0 10px 22px rgba(245, 158, 11, .35);
}

.btn-danger {
    background: var(--m-gradient-danger) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(239, 68, 68, .25);
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    box-shadow: 0 10px 22px rgba(239, 68, 68, .35);
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(59, 130, 246, .25);
}

.btn-default {
    background: var(--m-surface) !important;
    border-color: var(--m-line) !important;
    color: var(--m-ink-2) !important;
    box-shadow: var(--m-shadow-xs);
}

.btn-default:hover,
.btn-default:focus {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: var(--m-ink) !important;
}

.btn-link {
    color: var(--m-primary);
    box-shadow: none;
}

/* ==========================================================================
   8. FORMULARIOS
   ========================================================================== */
.form-control {
    border-radius: var(--m-radius-sm) !important;
    border: 1px solid var(--m-line);
    box-shadow: none;
    color: var(--m-ink);
    background: var(--m-surface);
    padding: 7px 12px;
    height: auto;
    min-height: 38px;
    transition: var(--m-transition);
}

.form-control:focus {
    border-color: var(--m-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12) !important;
}

.form-control::placeholder {
    color: var(--m-soft);
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
    background: #f8fafc;
    color: var(--m-muted);
}

label {
    font-weight: 600;
    color: var(--m-ink-2);
    font-size: 13px;
}

.help-block {
    color: var(--m-muted);
    font-size: 12px;
}

.input-group-addon {
    background: #f8fafc;
    border-color: var(--m-line);
    border-radius: 0 var(--m-radius-sm) var(--m-radius-sm) 0;
    color: var(--m-muted);
}

/* Select2 */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius-sm);
    min-height: 38px;
    transition: var(--m-transition);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    color: var(--m-ink);
    padding-left: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--m-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

.select2-dropdown {
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius-sm);
    box-shadow: var(--m-shadow-lg);
    overflow: hidden;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--m-primary) !important;
}

.select2-search--dropdown .select2-search__field {
    border-radius: var(--m-radius-xs);
    border-color: var(--m-line);
    padding: 6px 10px;
}

/* Checkbox / radio */
.checkbox label,
.radio label {
    font-weight: 500;
}

/* ==========================================================================
   9. TABLAS
   ========================================================================== */
.table {
    background: var(--m-surface);
}

.table > thead > tr > th,
.table > thead > tr.success > th {
    background: #f8fafc !important;
    color: var(--m-muted) !important;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .06em;
    font-weight: 700;
    border-bottom: 1px solid var(--m-line) !important;
    border-top: 0 !important;
    padding: 11px 10px;
}

.table > tbody > tr > td {
    border-top: 1px solid var(--m-line-2);
    vertical-align: middle;
    color: var(--m-ink-2);
    padding: 10px;
}

.table-hover > tbody > tr:hover {
    background-color: #f8fafc !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fcfdff;
}

.table-bordered {
    border-color: var(--m-line);
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
    border-color: var(--m-line);
}

/* DataTables */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--m-radius-xs) !important;
    border: 1px solid var(--m-line);
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--m-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
    outline: 0;
}

.table td:last-child .btn-group .btn {
    margin: 0 1px;
}

/* Paginación */
.pagination > li > a,
.pagination > li > span {
    border-radius: var(--m-radius-xs) !important;
    margin: 0 2px;
    border-color: var(--m-line);
    color: var(--m-ink-2);
    transition: var(--m-transition);
}

.pagination > li > a:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: var(--m-primary-dark);
}

.pagination > .active > a,
.pagination > .active > a:focus,
.pagination > .active > a:hover {
    background: var(--m-gradient) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(79, 70, 229, .3);
}

/* ==========================================================================
   10. ALERTAS, BADGES, LABELS, PROGRESS
   ========================================================================== */
.alert {
    border-radius: var(--m-radius-sm) !important;
    border: 0 !important;
    box-shadow: var(--m-shadow-sm);
    padding: 14px 16px;
}

.alert-success { background: #ecfdf5 !important; color: #065f46 !important; }
.alert-info    { background: #eff6ff !important; color: #1e40af !important; }
.alert-warning { background: #fffbeb !important; color: #92400e !important; }
.alert-danger  { background: #fef2f2 !important; color: #991b1b !important; }

.badge {
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    padding: 4px 9px;
    background: var(--m-primary);
}

.label,
.label-default { border-radius: 999px; padding: 4px 10px; font-weight: 600; }
.label-primary { background: var(--m-primary); }
.label-success { background: var(--m-success); }
.label-warning { background: var(--m-warning); }
.label-danger  { background: var(--m-danger); }
.label-info    { background: var(--m-info); }

.progress {
    border-radius: 999px;
    height: 8px;
    box-shadow: none;
    background: var(--m-line-2);
}

.progress-bar { background: var(--m-gradient); }

/* ==========================================================================
   11. TABS, DROPDOWNS, MODALES, TOOLTIPS, POPOVERS
   ========================================================================== */
.nav-tabs {
    border-bottom: 1px solid var(--m-line);
}

.nav-tabs > li > a {
    border-radius: var(--m-radius-sm) var(--m-radius-sm) 0 0 !important;
    color: var(--m-muted);
    font-weight: 600;
    transition: var(--m-transition);
}

.nav-tabs > li > a:hover {
    background: #f8fafc;
    color: var(--m-ink);
    border-color: transparent;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--m-primary-dark);
    border-color: var(--m-line) var(--m-line) transparent;
    font-weight: 700;
}

.dropdown-menu {
    border: 0;
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow-lg) !important;
    padding: 6px;
    overflow: hidden;
}

.dropdown-menu > li > a {
    border-radius: var(--m-radius-xs);
    padding: 9px 14px;
    color: var(--m-ink-2);
    transition: var(--m-transition);
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    background: #eef2ff;
    color: var(--m-primary-dark);
}

.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
    background: var(--m-gradient) !important;
    color: #fff;
}

.modal-content {
    border: 0;
    border-radius: var(--m-radius-lg) !important;
    box-shadow: var(--m-shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--m-line);
    padding: 16px 20px;
}

.modal-title {
    font-weight: 700;
    color: var(--m-ink);
}

.modal-footer {
    border-top: 1px solid var(--m-line);
    background: #f8fafc;
}

.bootbox .modal-header {
    background: transparent;
}

.tooltip-inner {
    background: var(--m-ink);
    border-radius: var(--m-radius-xs);
    padding: 6px 10px;
    font-weight: 500;
}

.tooltip.top .tooltip-arrow { border-top-color: var(--m-ink); }
.tooltip.bottom .tooltip-arrow { border-bottom-color: var(--m-ink); }
.tooltip.left .tooltip-arrow { border-left-color: var(--m-ink); }
.tooltip.right .tooltip-arrow { border-right-color: var(--m-ink); }

.popover {
    border: 0;
    border-radius: var(--m-radius);
    box-shadow: var(--m-shadow-lg);
}

/* ==========================================================================
   12. LOGIN
   ========================================================================== */
.login-page {
    background: radial-gradient(1200px 600px at 15% 20%, rgba(124, 58, 237, .35), transparent 60%),
                radial-gradient(1000px 600px at 85% 80%, rgba(6, 182, 212, .25), transparent 55%),
                linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    min-height: 100vh;
}

.login-logo,
.login-logo a {
    color: #fff !important;
    font-weight: 800;
    letter-spacing: -.02em;
    text-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

.login-box-body {
    border-radius: var(--m-radius-lg) !important;
    box-shadow: var(--m-shadow-lg);
    border: 1px solid rgba(255, 255, 255, .35);
    padding: 28px 26px !important;
}

.login-box-msg {
    color: var(--m-muted);
    font-weight: 600;
    letter-spacing: .01em;
}

/* ==========================================================================
   13. PUNTO DE VENTA (POS)
   ========================================================================== */
.pos {
    background: var(--m-bg);
}

.pos .content-wrapper {
    background: var(--m-bg) !important;
}

/* ============================================================
   PANEL IZQUIERDO: CAJA / CARRITO (compacto y moderno)
   ============================================================ */

/* Tarjeta contenedora del panel */
.pos #leftdiv {
    background: var(--m-surface);
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .05);
    padding: 12px !important;
    font-size: 12.5px;
}

/* Campos superiores: cliente, referencia y búsqueda */
.pos #lefttop .form-group {
    margin-bottom: 6px !important;
}

.pos #spos_customer,
.pos #hold_ref,
.pos #add_item {
    border-radius: var(--m-radius-sm) !important;
    border: 1px solid var(--m-line) !important;
    box-shadow: var(--m-shadow-xs);
    font-size: 12.5px !important;
    min-height: 34px;
    transition: var(--m-transition);
}

.pos #hold_ref {
    padding: 6px 11px;
    color: var(--m-ink);
}

.pos #add_item {
    border: 2px solid #dbe3f0 !important;
    font-size: 13px !important;
    font-weight: 600;
    padding: 7px 12px;
    box-shadow: var(--m-shadow-sm);
}

.pos #add_item::placeholder,
.pos #hold_ref::placeholder {
    color: var(--m-soft);
    font-weight: 500;
}

.pos #add_item:focus,
.pos #hold_ref:focus,
.pos #spos_customer:focus {
    border-color: var(--m-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .14) !important;
}

/* Select2 del cliente (compacto) */
.pos #lefttop .select2-container--default .select2-selection--single {
    min-height: 34px;
}

.pos #lefttop .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px;
    font-size: 12.5px;
}

.pos #lefttop .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px;
}

/* Contenedor de la lista del carrito */
.pos #print.fixed-table-container {
    border: 1px solid var(--m-line) !important;
    border-radius: var(--m-radius-sm) !important;
    background: var(--m-surface);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
}

.pos .list-table {
    border-radius: var(--m-radius-sm);
    overflow: hidden;
}

/* Cabecera de la tabla del carrito */
.pos .fixed-table-header .list-table > thead > tr > th,
.pos #posTable > thead > tr > th {
    font-size: 10px !important;
    padding: 7px 6px !important;
    letter-spacing: .05em;
}

/* Filas del carrito: compactas y con separadores sutiles */
.pos #posTable > tbody > tr > td {
    border-top: 1px solid var(--m-line-2);
    padding: 5px 6px;
    font-size: 12px;
    vertical-align: middle;
}

.pos #posTable > tbody > tr:hover {
    background: #f8fbff;
}

.pos #posTable > tbody > tr.danger {
    background: #fef2f2;
}

/* Badge de producto (morado) */
.pos #posTable .edit.btn {
    border-radius: 8px !important;
    font-size: 11px !important;
    line-height: 1.25;
    padding: 4px 8px !important;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    border: 0 !important;
    box-shadow: 0 3px 8px rgba(124, 58, 237, .22);
    transition: var(--m-transition);
}

.pos #posTable .edit.btn.bg-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
}

.pos #posTable .edit.btn.bg-purple:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%) !important;
    box-shadow: 0 5px 12px rgba(124, 58, 237, .32);
}

/* Badge naranja: producto con stock insuficiente */
.pos #posTable .edit.btn.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(245, 158, 11, .28);
}

/* Cantidad */
.pos #posTable .rquantity {
    width: 54px;
    min-height: 26px;
    padding: 3px 4px;
    margin: 0 auto;
    display: block;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px !important;
    border: 1px solid var(--m-line) !important;
    box-shadow: var(--m-shadow-xs);
}

.pos #posTable .rquantity:focus {
    border-color: var(--m-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12) !important;
}

/* Precio y subtotal */
.pos #posTable .sprice {
    font-size: 11.5px;
    color: var(--m-muted);
    font-weight: 600;
}

.pos #posTable .ssubtotal {
    font-size: 12.5px;
    color: var(--m-ink);
    font-weight: 800;
}

/* Botón eliminar fila */
.pos #posTable .posdel {
    color: var(--m-soft);
    font-size: 14px;
    padding: 4px;
    border-radius: 6px;
    transition: var(--m-transition);
}

.pos #posTable .posdel:hover {
    color: var(--m-danger);
    background: #fef2f2;
}

/* ============================================================
   RESUMEN / TOTALES (tarjeta limpia)
   ============================================================ */
.pos #totaltbl {
    background: var(--m-surface);
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius-sm);
    overflow: hidden;
    margin-top: 8px !important;
    box-shadow: var(--m-shadow-xs);
}

.pos #totaltbl td {
    border-top: 1px solid var(--m-line-2);
    padding: 6px 10px;
    font-size: 11.5px;
    color: var(--m-muted);
    font-weight: 600;
    vertical-align: middle;
}

.pos #totaltbl tr:first-child td {
    border-top: 0;
}

/* Filas informativas neutras: el protagonismo lo tiene "Total a Pagar" */
.pos #totaltbl tr.info td {
    background: transparent !important;
}

.pos #totaltbl tr.info td span {
    color: var(--m-ink);
    font-weight: 700;
    font-size: 12.5px;
}

.pos #totaltbl a {
    color: var(--m-primary);
    font-weight: 600;
    border-bottom: 1px dashed rgba(79, 70, 229, .4);
}

.pos #totaltbl a:hover {
    color: var(--m-primary-dark);
    border-bottom-color: transparent;
}

/* Fila destacada: Total a Pagar */
.pos #totaltbl tr.success td,
.pos #totaltbl tr:last-child td {
    background: #eef2ff !important;
    color: var(--m-primary-dark) !important;
    font-size: 12.5px;
    font-weight: 800 !important;
    border-top: 1px solid #c7d2fe;
    padding: 9px 10px;
}

.pos #totaltbl tr.success td span,
.pos #totaltbl tr:last-child td span {
    font-size: 16px;
    font-weight: 900;
    color: var(--m-primary-dark);
}

/* ============================================================
   BOTONES DE ACCIÓN (consistentes y compactos)
   ============================================================ */
.pos #botbuttons {
    margin-top: 6px;
}

.pos #botbuttons .row {
    margin-left: -3px;
    margin-right: -3px;
}

.pos #botbuttons .row > div {
    padding-left: 3px !important;
    padding-right: 3px !important;
}

.pos #botbuttons .btn {
    min-height: 30px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    border-radius: 9px !important;
    padding: 6px 5px;
    margin-bottom: 6px;
    box-shadow: var(--m-shadow-xs);
    transition: var(--m-transition);
    white-space: normal;
}

.pos #botbuttons .btn:hover {
    transform: translateY(-1px);
}

.pos #botbuttons .btn:active {
    transform: translateY(0);
}

/* Cancelar: acción destructiva pero discreta */
.pos #botbuttons #reset {
    background: #fff !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    box-shadow: none;
}

.pos #botbuttons #reset:hover {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
}

.pos #botbuttons .bg-purple {
    box-shadow: 0 4px 10px rgba(124, 58, 237, .25);
}

.pos #botbuttons .bg-navy {
    box-shadow: 0 4px 10px rgba(15, 23, 42, .20);
}

/* PAGO: acción principal destacada */
.pos #payment,
.pos #submit-sale {
    height: 66px !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    letter-spacing: .06em;
    border-radius: 12px !important;
    box-shadow: 0 10px 24px rgba(16, 185, 129, .38) !important;
}

.pos #payment:hover,
.pos #submit-sale:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(16, 185, 129, .48) !important;
}

/* Botones genéricos reutilizados por el POS */
.pos .bg-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}

.pos .bg-navy {
    background: linear-gradient(135deg, #334155 0%, #0f172a 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}

.pos .btn-group-vertical > .btn {
    margin-bottom: 6px;
    border-radius: var(--m-radius-sm) !important;
}

/* Alinear la altura de la columna de botones con el botón PAGO */
.pos #botbuttons .btn-group-vertical > .btn:last-child {
    margin-bottom: 0;
}

/* Grilla de productos */
.pos .contents {
    padding: 15px 15px 0 0;
}

.pos .contents #item-list .items {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 10px;
    overflow: visible;
    height: auto;
    min-height: 100%;
}

.pos .contents #item-list .btn {
    width: 122px;
    border-radius: var(--m-radius) !important;
    border: 1px solid var(--m-line) !important;
    background: var(--m-surface) !important;
    box-shadow: var(--m-shadow-sm);
    padding: 6px;
    transition: var(--m-transition);
    overflow: hidden;
}

.pos .contents #item-list .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--m-shadow);
    border-color: #c7d2fe !important;
    background: #fdfdff !important;
}

.pos .contents #item-list .btn-name {
    width: 122px;
    height: 84px;
    line-height: 17px;
    white-space: normal;
    word-break: break-word;
    margin: 0;
    color: var(--m-ink) !important;
    font-weight: 600;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px !important;
}

.pos .contents #item-list .btn-img,
.pos .contents #item-list .btn-both {
    background: var(--m-surface);
    padding: 6px;
}

.pos .contents #item-list .btn-img:hover,
.pos .contents #item-list .btn-both:hover {
    background: #fdfdff !important;
}

.pos .contents #item-list .btn-img img {
    width: 100% !important;
    height: 108px !important;
    object-fit: cover;
    border-radius: var(--m-radius-xs);
}

.pos .contents #item-list .btn-both .bg-img {
    background: #f8fafc;
    height: 108px;
    padding: 0;
    border-radius: var(--m-radius-xs);
    overflow: hidden;
    display: block;
}

.pos .contents #item-list .btn-both .bg-img img {
    width: 100% !important;
    height: 108px !important;
    object-fit: cover;
    border-radius: var(--m-radius-xs);
}

.pos .contents #item-list .btn-both > span {
    display: block;
    width: 100% !important;
    height: 42px;
    background: transparent !important;
    margin: 0 !important;
    overflow: hidden;
}

.pos .contents #item-list .btn-both > span > span {
    display: table-cell;
    vertical-align: middle;
    line-height: 15px;
    padding: 4px 2px;
    color: var(--m-ink);
    font-weight: 600;
    font-size: 12.5px;
    white-space: normal;
    word-break: break-word;
}

/* Navegación de productos */
.pos .contents .product-nav {
    position: static;
    padding: 12px 0 0 !important;
    margin-top: 8px;
}

.pos .contents .product-nav .btn {
    border-radius: var(--m-radius-sm) !important;
    font-weight: 700;
}

/* Categorías (control-sidebar) */
.control-sidebar-dark,
.control-sidebar-dark + .control-sidebar-bg {
    background: var(--m-gradient-dark) !important;
    box-shadow: -8px 0 30px rgba(15, 23, 42, .25);
}

.control-sidebar-dark .tab-content {
    padding: 8px;
}

.control-sidebar-menu > li > a {
    border-radius: var(--m-radius-sm);
    margin: 4px 6px;
    padding: 10px 12px !important;
    transition: var(--m-transition);
}

.control-sidebar-menu > li > a:hover,
.control-sidebar-menu > li > a.category.active {
    background: var(--m-gradient) !important;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .35);
}

.control-sidebar-dark .control-sidebar-subheading {
    color: #f1f5f9 !important;
    font-weight: 700;
}

.control-sidebar-menu > li > a p {
    color: #94a3b8;
}

.control-sidebar-menu > li > a:hover p,
.control-sidebar-menu > li > a.category.active p {
    color: rgba(255, 255, 255, .85);
}

.control-sidebar-menu .menu-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--m-radius-xs);
    overflow: hidden;
}

.control-sidebar-menu .menu-icon img,
.control-sidebar-menu .menu-icon.fa-solid,
.control-sidebar-menu .menu-icon.fa,
.control-sidebar-menu .menu-icon.fas {
    width: 34px !important;
    height: 34px !important;
    object-fit: cover;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#filter-categories-con,
#filter-categories {
    border-radius: var(--m-radius-sm) !important;
}

/* Scrollbars delgados y modernos */
.slimScrollBar {
    background: rgba(148, 163, 184, .6) !important;
    border-radius: 999px !important;
    opacity: .9 !important;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* Spinner de carga */
#ajaxCall {
    background: rgba(15, 23, 42, .35) !important;
    backdrop-filter: blur(2px);
}

#ajaxCall i {
    color: var(--m-primary) !important;
}

/* ==========================================================================
   13-B. BARRA SUPERIOR DEL POS (compacta, agrupada y moderna)
   ========================================================================== */

/* Estructura: logo fijo + navbar flexible */
.pos .main-header {
    display: flex;
    align-items: stretch;
    height: 46px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.pos .main-header .logo,
.pos .main-header .navbar {
    background: linear-gradient(120deg, #4338ca 0%, #6d28d9 60%, #7c3aed 100%) !important;
    height: 46px !important;
    min-height: 46px !important;
}

.pos .main-header .logo {
    float: none !important;
    flex: 0 0 50px;
    width: 50px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-right: 1px solid rgba(255, 255, 255, .14) !important;
}

.pos .main-header .navbar {
    float: none !important;
    flex: 1 1 auto;
    width: auto !important;
    margin: 0 !important;
    position: static !important;
    display: flex;
    align-items: center;
    padding: 0 6px;
}

/* Alinear la barra lateral con la nueva altura del header */
.pos .main-sidebar {
    padding-top: 46px !important;
}

/* Contenedor de ítems ocupando el ancho disponible */
.pos .main-header .navbar-custom-menu {
    float: none !important;
    position: static !important;
    flex: 1 1 auto;
    display: flex;
    min-width: 0;
}

.pos .main-header .navbar-custom-menu > .navbar-nav {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    float: none !important;
    width: 100%;
    margin: 0;
}

.pos .main-header .navbar-custom-menu .navbar-nav > li {
    float: none !important;
    display: flex;
    align-items: center;
    margin: 0 1px;
}

/* Ítem base de la barra */
.pos .main-header .navbar-custom-menu .navbar-nav > li > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 10px !important;
    line-height: 1;
    border-radius: 10px;
    font-size: 11.5px !important;
    font-weight: 600;
    color: rgba(255, 255, 255, .96) !important;
    background: transparent;
    transition: var(--m-transition);
}

.pos .main-header .navbar-custom-menu .navbar-nav > li > a:hover,
.pos .main-header .navbar-custom-menu .navbar-nav > li.open > a {
    background: rgba(255, 255, 255, .16) !important;
    color: #fff !important;
}

/* Grupo izquierdo: versión + fecha/hora */
.pos .nav-version > a {
    padding: 0 6px !important;
}

.pos .nav-version > a > .fa-solid,
.pos .nav-version > a > .fa {
    color: rgba(255, 255, 255, .85) !important;
    font-size: 12px !important;
}

.pos .software-version {
    background: #ffffff;
    color: var(--m-primary-dark);
    border: 0;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .20);
}

.pos .software-version strong {
    font-weight: 800;
}

.pos .nav-datetime {
    margin-right: auto !important; /* deja versión + fecha a la izquierda */
}

.pos .nav-datetime > a {
    background: rgba(255, 255, 255, .12) !important;
    border-radius: 999px !important;
    padding: 0 12px !important;
    font-size: 10.5px !important;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .95) !important;
}

/* Iconos de acción: mismo tamaño y fondo sutil */
.pos .nav-icon > a {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    justify-content: center;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, .12);
}

.pos .nav-icon > a:hover {
    background: rgba(255, 255, 255, .24) !important;
    transform: translateY(-1px);
}

.pos .nav-icon > a i {
    color: #fff !important;
    font-size: 14px !important;
    margin: 0 !important;
}

/* Acciones de caja: misma altura, radio y padding */
.pos .nav-action {
    margin: 0 2px !important;
}

.pos .nav-action-first {
    margin-left: auto !important; /* centra el bloque de iconos */
}

.pos .nav-action > a,
.pos .notifications-menu#suspended_sales > a {
    height: 32px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff !important;
    border: 0 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .20);
    transform: none !important;
    transition: var(--m-transition);
}

.pos .nav-action > a i,
.pos .notifications-menu#suspended_sales > a i {
    font-size: 13px !important;
    margin: 0 !important;
    color: #fff !important;
}

.pos .nav-action > a:hover,
.pos .notifications-menu#suspended_sales > a:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.06);
    box-shadow: 0 7px 18px rgba(15, 23, 42, .26);
}

/* Colores modernos por acción (sobreescriben estilos inline) */
.pos .nav-action-register > a { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important; }
.pos .nav-action-today > a    { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; }
.pos .nav-action-close > a    { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important; }
.pos .notifications-menu#suspended_sales > a { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; }

.pos #suspended_sales .label-dark {
    background: rgba(15, 23, 42, .85) !important;
    border-radius: 999px !important;
    padding: 3px 8px !important;
    font-size: 10px;
    line-height: 1.2;
}

/* Desplegable de ventas suspendidas */
.pos #suspended_sales .dropdown-menu {
    width: 300px;
    padding: 0;
    margin-top: 6px;
    border-radius: var(--m-radius) !important;
    overflow: hidden;
}

.pos #suspended_sales .dropdown-menu .menu {
    max-height: 300px;
    overflow-y: auto;
}

.pos #suspended_sales .dropdown-menu .menu li a:hover {
    background: #f8fafc !important;
}

.pos #suspended_sales .dropdown-menu .footer a {
    background: var(--m-gradient) !important;
    border-radius: 0 !important;
    font-weight: 700;
}

/* Separador y menú de usuario */
.pos .nav-user {
    margin-left: 8px !important;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .24);
}

.pos .nav-user > a {
    height: 36px !important;
    padding: 0 12px 0 4px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .12);
}

.pos .nav-user > a:hover,
.pos .nav-user.open > a {
    background: rgba(255, 255, 255, .22) !important;
}

.pos .nav-user .user-image {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, .65);
    object-fit: cover;
}

.pos .nav-user > a > span {
    font-size: 11.5px;
    font-weight: 600;
    color: #fff;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos .nav-user .dropdown-menu {
    border-radius: var(--m-radius) !important;
    overflow: hidden;
    margin-top: 8px;
}

.pos .nav-user .user-header {
    background: var(--m-gradient) !important;
    padding: 18px;
}

.pos .nav-user .user-footer {
    background: #f8fafc;
}

/* Toggle de categorías (último icono) */
.pos .nav-toggle > a {
    margin-right: 2px;
}

/* Responsive: la barra se envuelve en pantallas pequeñas (sin recortar desplegables) */
@media (max-width: 767px) {
    .pos .main-header {
        height: auto !important;
        min-height: 46px;
        flex-wrap: wrap;
    }

    .pos .main-header .logo {
        height: 46px !important;
        min-height: 46px !important;
    }

    .pos .main-header .navbar {
        height: auto !important;
        min-height: 46px !important;
        flex-wrap: wrap;
        padding: 4px 6px;
    }

    .pos .main-header .navbar-custom-menu > .navbar-nav {
        flex-wrap: wrap;
        row-gap: 4px;
        justify-content: flex-end;
    }

    .pos .nav-datetime,
    .pos .nav-action-first {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */

/* Tablets grandes: el POS deja de forzar ancho mínimo */
@media only screen and (max-width: 1199px) {
    .pos,
    .pos-wrapper {
        min-width: 0 !important;
    }

    .pos .content-wrapper .layout-table {
        position: static !important;
        min-width: 0 !important;
    }
}

/* Tablets / móvil horizontal: apilar columnas del POS */
@media only screen and (max-width: 991px) {
    .layout-table,
    .layout-table > tbody,
    .layout-table > tbody > tr,
    .layout-table > tbody > tr > td {
        display: block !important;
        width: 100% !important;
    }

    .pos .content-wrapper .layout-table {
        position: static !important;
        min-width: 0 !important;
        border-spacing: 0;
    }

    /* Carrito primero (ancho completo) y luego los productos */
    .pos .content-wrapper .layout-table > tbody > tr > td:first-child {
        width: 100% !important;
        padding: 8px !important;
    }

    .pos .content-wrapper .layout-table > tbody > tr > td:last-child {
        padding: 8px !important;
    }

    .pos .contents {
        padding: 8px !important;
        min-height: 0 !important;
    }

    .pos #leftdiv {
        margin-bottom: 10px;
    }

    .pos #list-table-div {
        min-height: 120px;
    }

    .pos .contents #item-list .items {
        justify-content: flex-start;
    }

    .pos .contents #item-list .btn,
    .pos .contents #item-list .btn-name {
        width: calc(25% - 8px);
        min-width: 96px;
    }

    .pos .contents #item-list .btn-img img,
    .pos .contents #item-list .btn-both .bg-img img {
        height: 92px !important;
    }

    .pos .contents #item-list .btn-both .bg-img {
        height: 92px;
    }
}

/* Móvil */
@media only screen and (max-width: 767px) {
    body {
        font-size: 13.5px;
    }

    .main-header .logo {
        width: 60px !important;
    }

    .main-header .logo .logo-lg {
        display: none;
    }

    .main-header .logo .logo-mini {
        display: block;
    }

    .content-header {
        padding: 12px 12px 0 !important;
    }

    .content-header > h1 {
        font-size: 20px;
    }

    .content-wrapper {
        padding-left: 10px;
        padding-right: 10px;
    }

    .box-body {
        padding: 12px;
    }

    .pos .contents #item-list .btn,
    .pos .contents #item-list .btn-name {
        width: calc(33.333% - 8px);
        min-width: 88px;
    }

    .pos .contents #item-list .btn-img img,
    .pos .contents #item-list .btn-both .bg-img img,
    .pos .contents #item-list .btn-both .bg-img {
        height: 84px !important;
    }

    .pos #payment,
    .pos #submit-sale {
        height: 60px !important;
        font-size: 14px !important;
    }

    /* Tablas con scroll horizontal táctil */
    .box-body .table-responsive,
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .login-box {
        width: auto !important;
        margin: 8vh 16px 16px !important;
    }
}

/* Móvil pequeño */
@media only screen and (max-width: 480px) {
    .pos .contents #item-list .btn,
    .pos .contents #item-list .btn-name {
        width: calc(50% - 8px);
        min-width: 0;
    }

    .pos .contents #item-list .btn-name {
        height: 72px;
        font-size: 12px;
    }

    .content-header > .breadcrumb {
        float: none !important;
        position: static !important;
        display: inline-block;
        margin-top: 8px;
    }

    .hidden-xxs {
        display: none !important;
    }
}

/* Impresión: no alterar la salida de tickets */
@media print {
    .main-header,
    .main-sidebar,
    .content-header,
    .control-sidebar,
    .control-sidebar-bg,
    .product-nav,
    #ajaxCall {
        display: none !important;
    }

    body,
    .content-wrapper,
    .pos {
        background: #fff !important;
    }
}

/* ==========================================================================
   15. REFINAMIENTOS FINALES
   ========================================================================== */

/* Chip de versión y reloj en la barra superior */
.software-version {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    display: inline-block;
}

#datetime {
    font-weight: 500 !important;
    color: rgba(255, 255, 255, .95) !important;
}

/* Encabezado fijo de la tabla del carrito */
.pos .fixed-table-header {
    background: #f8fafc;
    border-radius: var(--m-radius-sm) var(--m-radius-sm) 0 0;
    overflow: hidden;
}

/* Inputs compactos del POS */
.pos .form-control.input-sm {
    min-height: 30px;
    padding: 4px 8px;
    border-radius: var(--m-radius-xs) !important;
}

/* Botones de iconos (tablas de acciones) */
.btn-group > .btn > .fa,
.btn-group > .btn > .fas,
.btn-group > .btn > .glyphicon {
    font-size: 13px;
}

/* Notificaciones del menú superior */
.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a:hover {
    background: #eef2ff !important;
}

.navbar-nav > .notifications-menu > .dropdown-menu > li.header {
    background: #fff;
    color: var(--m-ink);
    font-weight: 700;
    border-radius: var(--m-radius) var(--m-radius) 0 0;
}

/* Área de filtros/búsqueda superior */
.box-header .box-tools .input-group-sm > .form-control {
    border-radius: var(--m-radius-xs) 0 0 var(--m-radius-xs) !important;
}

/* Enlaces de acción en tablas */
.table tbody tr td a:not(.btn) {
    font-weight: 600;
}

/* Resumen del carrito (el contenedor ya se estiliza en la sección POS) */
#print #totaldiv {
    box-shadow: 0 -10px 24px rgba(15, 23, 42, .08) !important;
    background: var(--m-surface) !important;
    border-radius: var(--m-radius-sm);
}

/* Tarjetas de estadísticas (dashboard) */
.small-box {
    border-radius: var(--m-radius) !important;
    box-shadow: var(--m-shadow) !important;
    overflow: hidden;
    transition: var(--m-transition);
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--m-shadow-lg) !important;
}

.small-box .icon {
    opacity: .22;
    transition: var(--m-transition);
}

.small-box:hover .icon {
    opacity: .35;
    transform: scale(1.08);
}

.info-box {
    border-radius: var(--m-radius-sm);
    box-shadow: var(--m-shadow-sm);
    border: 1px solid var(--m-line);
    min-height: 80px;
}

.info-box-icon {
    border-radius: var(--m-radius-sm) 0 0 var(--m-radius-sm);
}

/* ==========================================================================
   15. POS — LAYOUT FLUIDO
   Carrito hasta el fondo de la pantalla y grilla de productos siempre en
   columnas completas (sin cortar la última columna). Solo escritorio; en
   <=991px se mantiene el apilado responsive existente.
   ========================================================================== */
@media (min-width: 992px) {

    /* La pantalla del POS ocupa todo el alto disponible (header ~50px) */
    .pos .content-wrapper {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 50px);
        min-height: 0;
        overflow: hidden;
    }

    /* Tabla de 2 columnas convertida en flex: caja 460px + productos fluidos */
    .pos .content-wrapper .layout-table {
        position: static !important;
        min-width: 0 !important;
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        margin: 0;
    }

    .pos .content-wrapper .layout-table > tbody {
        display: flex;
        width: 100%;
    }

    .pos .content-wrapper .layout-table > tbody > tr {
        display: flex;
        align-items: stretch;
        width: 100%;
    }

    .pos .content-wrapper .layout-table > tbody > tr > td {
        display: flex;
        flex-direction: column;
        min-width: 0 !important;
        padding: 10px !important;
    }

    .pos .content-wrapper .layout-table > tbody > tr > td:first-child {
        flex: 0 0 460px;
        width: 460px !important;
    }

    .pos .content-wrapper .layout-table > tbody > tr > td:last-child {
        flex: 1 1 auto;
    }

    /* ---- Caja / carrito ---- */
    .pos #pos,
    .pos #pos-sale-form,
    .pos #leftdiv {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

    .pos #leftdiv {
        height: auto !important;
    }

    .pos #print.fixed-table-container {
        display: flex !important;
        flex-direction: column;
        flex: 1 1 auto;
        /* Neutraliza el tope de 350px de las reglas inline del POS:
           el carrito ahora llena todo el alto disponible y hace scroll interno */
        max-height: none !important;
        min-height: 0 !important;
    }

    /* El contenedor real del scroll es #print (diseño original del POS);
       la lista mantiene su alto natural y #totaldiv queda sticky al pie. */
    .pos #list-table-div {
        flex: 0 0 auto;
        min-height: 120px !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Cabecera del carrito: se superpone al thead real de #posTable
       (igual que el diseño original) para no mostrarlo duplicado. */
    .pos .fixed-table-header {
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 3;
        background: var(--m-surface);
    }

    .pos #totaldiv {
        flex: 0 0 auto;
    }

    /* ---- Grilla de productos ---- */
    .pos .contents#right-col {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0 !important;   /* anula el min-height:440px original */
        height: auto !important;
        overflow: hidden;
        padding: 10px 10px 0;
    }

    .pos .contents #item-list {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

    .pos .contents #item-list .items {
        display: block;
        height: auto !important;
        flex: 1 1 auto;
        min-height: 120px;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 2px 6px 2px 2px;
        -webkit-overflow-scrolling: touch;
    }

    /* Los botones de producto vienen dentro de un <div> envoltorio:
       el grid va en él para que las columnas siempre se completen
       (nunca queda la última columna cortada a la mitad). */
    .pos .contents #item-list .items > div {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
        align-content: flex-start;
        gap: 10px;
        width: 100%;
    }

    /* El grid define el ancho: sin anchos fijos que corten la última columna */
    .pos .contents #item-list .btn,
    .pos .contents #item-list .btn-name {
        width: 100% !important;
    }

    .pos .contents .product-nav {
        flex: 0 0 auto;
        margin-top: 8px;
    }
}

/* ==========================================================================
   16. AJUSTES SEGUROS DE VISUALIZACIÓN (todas las pantallas)
   ========================================================================== */

/* Modales: contenido con scroll interno si excede el alto de la pantalla */
.modal-body {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tablas responsivas: scroll horizontal suave en pantallas pequeñas */
@media (max-width: 991px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}



