@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Global Modern Adjustments (2027 Style) */
body {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    background-color: #f1f5f9 !important; /* Soft Tailwind slate-100 */
    letter-spacing: -0.01em;
}

/* Glassmorphism Navbar */
.main-header {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02) !important;
}

/* Sidebar Ultra Modern */
@media (min-width: 768px) {
    body:not(.sidebar-collapse):not(.pos-fullscreen-page) .main-sidebar,
    body:not(.sidebar-collapse):not(.pos-fullscreen-page) .main-sidebar::before {
        width: 265px !important;
    }
    body:not(.sidebar-collapse):not(.pos-fullscreen-page) .content-wrapper,
    body:not(.sidebar-collapse):not(.pos-fullscreen-page) .main-footer,
    body:not(.sidebar-collapse):not(.pos-fullscreen-page) .main-header {
        margin-left: 265px !important;
    }
}
.main-sidebar {
    background: #0f172a !important; /* Tailwind slate-900 */
    box-shadow: 4px 0 24px rgba(0,0,0,0.06) !important;
    border-right: none !important;
}

/* ========================================================
   POS FULLSCREEN CASH REGISTER (MODO CAJA 100% LIMPIO)
   ======================================================== */
body.pos-fullscreen-page .main-sidebar,
body.pos-fullscreen-page .main-sidebar::before {
    display: none !important;
}

body.pos-fullscreen-page .content-wrapper,
body.pos-fullscreen-page .main-header,
body.pos-fullscreen-page .main-footer {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Menú Drawer Flotante en POS cuando se abre */
body.pos-fullscreen-page.pos-sidebar-open .main-sidebar,
body.pos-fullscreen-page.pos-sidebar-open .main-sidebar::before {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin-left: 0 !important;
    transform: translate(0, 0) !important;
    height: 100vh !important;
    z-index: 1060 !important;
    width: 285px !important;
    max-width: 85vw !important;
    box-shadow: 12px 0 40px rgba(0,0,0,0.5) !important;
    animation: posDrawerSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.pos-fullscreen-page.pos-sidebar-open .brand-link {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 57px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 1rem !important;
    background: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-sizing: border-box !important;
}

body.pos-fullscreen-page.pos-sidebar-open .main-sidebar .sidebar {
    margin-top: 0 !important;
    height: calc(100vh - 57px) !important;
    overflow-y: auto !important;
}

@keyframes posDrawerSlideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.pos-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1055;
    display: none;
    cursor: pointer;
}
body.pos-sidebar-open {
    overflow: hidden !important;
}
.brand-link {
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    padding-top: 1.2rem !important;
    padding-bottom: 1.2rem !important;
}
.brand-text {
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-pills .nav-link {
    border-radius: 12px !important;
    margin-bottom: 4px !important;
    color: #94a3b8 !important;
    transition: all 0.25s ease;
    font-size: 0.92rem !important;
    font-weight: 500 !important;
    position: relative !important;
    padding-right: 2.8rem !important; /* Espacio para que el badge y la flecha nunca toquen el texto */
}
.nav-sidebar .nav-link > p {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
}
.nav-sidebar .nav-link .right,
.nav-sidebar .nav-link p .right {
    position: absolute !important;
    right: 0.85rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}
.nav-sidebar .nav-link .badge.right {
    position: absolute !important;
    right: 0.85rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 0.70rem !important;
    font-weight: 700 !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 6px !important;
}
.nav-pills .nav-link:hover {
    background-color: rgba(255,255,255,0.06) !important;
    color: #f8fafc !important;
}
/* Parent con submenu abierto (evita el pegote de doble azul brillante) */
.nav-sidebar .menu-is-opening > .nav-link,
.nav-sidebar .menu-open > .nav-link {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-weight: 600 !important;
}
/* Item activo directo */
.nav-pills > .nav-item > .nav-link.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}
/* Submenus / Desplegables con jerarquía visual refinada */
.nav-sidebar .nav-treeview {
    padding-left: 0.25rem !important;
    margin-top: 2px !important;
    margin-bottom: 6px !important;
    border-left: 1.5px solid rgba(255, 255, 255, 0.08) !important;
    margin-left: 1.25rem !important;
}
.nav-sidebar .nav-treeview .nav-link {
    font-size: 0.85rem !important;
    padding: 0.42rem 0.75rem !important;
    border-radius: 8px !important;
    margin-bottom: 2px !important;
    color: #94a3b8 !important;
}
.nav-sidebar .nav-treeview .nav-link:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}
.nav-sidebar .nav-treeview .nav-link.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}
/* Encabezados de Sección (Headers) */
.nav-header {
    font-size: 0.70rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    color: #64748b !important;
    padding: 0.85rem 0.75rem 0.25rem !important;
    text-transform: uppercase !important;
}

/* ========================================================
   COLLAPSED SIDEBAR (MINI-SIDEBAR) REFINEMENTS
   ======================================================== */
@media (min-width: 768px) {
    /* Estado Colapsado Normal (Mini Barra sin Hover) */
    body.sidebar-collapse .nav-sidebar .nav-header {
        font-size: 0 !important;
        height: 1px !important;
        padding: 0 !important;
        margin: 10px 14px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        overflow: hidden !important;
        color: transparent !important;
        line-height: 0 !important;
    }
    body.sidebar-collapse .nav-sidebar .nav-link .badge.right,
    body.sidebar-collapse .nav-sidebar .nav-link .right,
    body.sidebar-collapse .nav-sidebar .nav-link p .right {
        display: none !important;
    }
    body.sidebar-collapse .nav-sidebar .nav-link {
        padding-right: 0 !important;
        padding-left: 0 !important;
        text-align: center !important;
    }
    body.sidebar-collapse .nav-sidebar .nav-link .nav-icon {
        margin-right: 0 !important;
        float: none !important;
        display: inline-block !important;
        font-size: 1.15rem !important;
    }
    body.sidebar-collapse .brand-text {
        display: none !important;
    }
    body.sidebar-collapse .brand-link {
        text-align: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    body.sidebar-collapse .brand-link .brand-image {
        margin-left: auto !important;
        margin-right: auto !important;
        float: none !important;
    }

    /* Expansión Fluida al pasar el mouse (Hover) */
    body.sidebar-collapse .main-sidebar:hover {
        width: 265px !important;
        box-shadow: 10px 0 30px rgba(0,0,0,0.3) !important;
        transition: width 0.25s ease-in-out !important;
    }
    body.sidebar-collapse .main-sidebar:hover .brand-text {
        display: inline-block !important;
    }
    body.sidebar-collapse .main-sidebar:hover .brand-link {
        text-align: left !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    body.sidebar-collapse .main-sidebar:hover .nav-sidebar .nav-header {
        font-size: 0.70rem !important;
        height: auto !important;
        padding: 0.85rem 0.75rem 0.25rem !important;
        margin: 0 !important;
        background: transparent !important;
        color: #64748b !important;
        line-height: normal !important;
    }
    body.sidebar-collapse .main-sidebar:hover .nav-sidebar .nav-link {
        padding-right: 2.8rem !important;
        padding-left: 1rem !important;
        text-align: left !important;
    }
    body.sidebar-collapse .main-sidebar:hover .nav-sidebar .nav-link .nav-icon {
        margin-right: 0.5rem !important;
    }
    body.sidebar-collapse .main-sidebar:hover .nav-sidebar .nav-link .badge.right,
    body.sidebar-collapse .main-sidebar:hover .nav-sidebar .nav-link .right,
    body.sidebar-collapse .main-sidebar:hover .nav-sidebar .nav-link p .right {
        display: block !important;
    }
}

/* Floating Cards (Neumorphism / Modern) */
.card {
    background: #ffffff;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.05) !important;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}
.card:hover {
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px);
}
.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.03) !important;
    background-color: transparent !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    padding: 1.5rem 1.5rem 1rem !important;
}
.card-title {
    font-weight: 700 !important;
    color: #1e293b !important;
}

/* Soft Tables */
.table {
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
    margin-bottom: 0;
}
.table thead th {
    border: none !important;
    background: transparent !important;
    color: #64748b !important;
    font-weight: 700 !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 4px !important;
}
.table tbody tr {
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02) !important;
    border-radius: 12px !important;
    transition: all 0.2s ease;
}
.table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.04) !important;
}
.table tbody td {
    border: none !important;
    vertical-align: middle !important;
    padding: 1rem !important;
    color: #475569;
    font-weight: 500;
}
.table tbody td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.table tbody td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

/* Forms & Inputs */
.form-control {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 0.75rem 1rem !important;
    height: auto !important;
    box-shadow: none !important;
    background-color: #f8fafc !important;
    font-weight: 500;
    color: #334155 !important;
    transition: all 0.3s ease;
}
.form-control:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
}
.input-group-text {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    font-weight: 600;
}
.input-group > .form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > .input-group-prepend > .input-group-text {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Buttons */
.btn {
    border-radius: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
    padding: 0.6rem 1.2rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1) !important;
}
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
}
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

/* Modals */
.modal-content {
    border-radius: 24px !important;
    border: none !important;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25) !important;
    overflow: hidden;
}
.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    padding: 1.5rem !important;
}
.modal-body {
    padding: 1.5rem !important;
}

/* Stacking modal fix for WhatsApp Debt Modal over Debt Modal */
#whatsappDebtModal {
    z-index: 1065 !important;
}
#whatsappDebtModal .modal-dialog {
    z-index: 1070 !important;
}
body.modal-open .modal-backdrop ~ .modal-backdrop {
    z-index: 1060 !important;
}

/* Badges */
.badge {
    border-radius: 8px !important;
    padding: 0.5em 0.8em !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}
.badge-success { background-color: #d1fae5 !important; color: #065f46 !important; }
.badge-danger { background-color: #fee2e2 !important; color: #991b1b !important; }
.badge-warning { background-color: #fef3c7 !important; color: #92400e !important; }
.badge-info { background-color: #dbeafe !important; color: #1e40af !important; }

/* Topnav POS Button Special */
.navbar-nav .nav-item a[href*="pos"] {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border-radius: 12px !important;
    padding: 0.5rem 1.2rem !important;
    margin-right: 15px;
    font-weight: 800 !important;
    box-shadow: 0 4px 12px rgba(16,185,129,0.3) !important;
}
.navbar-nav .nav-item a[href*="pos"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16,185,129,0.4) !important;
}
@media (max-width: 767.98px) {
    .navbar-nav .nav-item a[href*="pos"] {
        padding: 0.35rem 0.65rem !important;
        margin-right: 4px !important;
        font-size: 0.85rem !important;
    }
}

/* DataTables Styling Overrides */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 0.5rem 1rem !important;
    background-color: #f8fafc !important;
    transition: all 0.3s ease !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59,130,246,.15) !important;
    outline: none !important;
}
.page-item.active .page-link {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(59,130,246,.3) !important;
}
.page-link {
    border: none !important;
    color: #64748b !important;
    border-radius: 8px !important;
    margin: 0 2px !important;
    font-weight: 600 !important;
}

/* ========================================================
   DATATABLES RESPONSIVE FIXES (PREVENT OVERLAPPING TEXT)
   ======================================================== */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child,
#receivablesTable.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child {
    padding-left: 46px !important;
    position: relative !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child:before,
#receivablesTable.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child:before {
    top: 50% !important;
    left: 12px !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
    height: 22px !important;
    width: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4) !important;
    box-sizing: border-box !important;
    text-align: center !important;
    text-indent: 0 !important;
    font-family: inherit !important;
    line-height: 1 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    content: '+' !important;
    background-color: #3b82f6 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 5 !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before,
#receivablesTable.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before {
    content: '−' !important;
    background-color: #ef4444 !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4) !important;
}

/* Child details row when expanded */
table.dataTable > tbody > tr.child {
    background-color: #f8fafc !important;
}
table.dataTable > tbody > tr.child > td.child {
    padding: 12px 16px !important;
}
table.dataTable > tbody > tr.child ul.dtr-details {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
table.dataTable > tbody > tr.child ul.dtr-details > li {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
    border-bottom: none !important;
    padding-bottom: 4px !important;
}
table.dataTable > tbody > tr.child ul.dtr-details .dtr-title {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #64748b !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 6px !important;
}
table.dataTable > tbody > tr.child ul.dtr-details .dtr-data {
    font-size: 0.95rem !important;
    color: #1e293b !important;
    display: block !important;
    width: 100% !important;
}
@media (max-width: 767.98px) {
    table.dataTable > tbody > tr.child ul.dtr-details .dtr-data .btn {
        width: 100% !important;
        margin-bottom: 6px !important;
        padding: 0.65rem 1rem !important;
        border-radius: 10px !important;
        font-size: 0.95rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Legacy POS Fixes */
.pos-product-card {
    border-radius: 16px !important;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04) !important;
}
.pos-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.1) !important;
}
.btn-sq {
    width: 40px !important;
    height: 40px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
}

/* ========================================================
   DARK MODE OVERRIDES (2027)
   ======================================================== */
body.dark-mode {
    background-color: #0f172a !important; /* Slate 900 */
}
body.dark-mode .product-card {
    background: rgba(30, 41, 59, 0.7) !important; /* Slate 800 */
    border: 1px solid rgba(255,255,255,0.1) !important;
}
body.dark-mode .product-title {
    color: #f1f5f9 !important;
}
body.dark-mode .product-price {
    background: #1e293b !important;
    color: #60a5fa !important;
}
body.dark-mode .search-bar {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
body.dark-mode .cat-pill:not(.active) {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}
body.dark-mode .cat-pill.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}
body.dark-mode .action-icon-btn {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}
body.dark-mode .action-icon-btn:hover {
    background: #334155 !important;
    color: #ffffff !important;
}
body.dark-mode .cart-table td {
    color: #e2e8f0 !important;
    border-bottom: 1px solid #334155 !important;
}
body.dark-mode .qty-control {
    background: #1e293b !important;
    border-color: #334155 !important;
}
body.dark-mode .qty-btn {
    background: #334155 !important;
    color: #e2e8f0 !important;
}
body.dark-mode .qty-btn:hover {
    background: #3b82f6 !important;
}
body.dark-mode .qty-val {
    color: #f8fafc !important;
}
body.dark-mode .pos-container .bg-white {
    background-color: #0f172a !important; /* Fix cart bottom area */
}
body.dark-mode .pos-container .border-top {
    border-top-color: #1e293b !important;
}
body.dark-mode [wire\:loading] {
    background: rgba(15, 23, 42, 0.7) !important;
}

/* ========================================================
   GLOBAL DARK MODE FIXES (ADMINLTE OVERRIDES)
   ======================================================== */
.dark-mode .content-wrapper {
    background-color: #0f172a !important; /* Slate 900 background */
    color: #f8fafc !important;
}
.dark-mode .card {
    background-color: #1e293b !important; /* Slate 800 cards */
    border: 1px solid rgba(255,255,255,0.05) !important;
}
.dark-mode .card-title {
    color: #f8fafc !important; /* White text for titles in dark mode */
}
.dark-mode .card-header {
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
.dark-mode .table tbody tr {
    background-color: #1e293b !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
}
.dark-mode .table tbody td {
    color: #cbd5e1 !important;
}
.dark-mode .table thead th {
    color: #94a3b8 !important;
}
.dark-mode .form-control {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
.dark-mode .form-control:focus {
    background-color: #1e293b !important;
    border-color: #3b82f6 !important;
}
.dark-mode .input-group-text {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
.dark-mode .main-header {
    background: rgba(15, 23, 42, 0.8) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
.dark-mode .text-muted {
    color: #94a3b8 !important;
}
.dark-mode .btn-outline-secondary {
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
.dark-mode .btn-outline-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* FIX NAVBAR TEXT IN DARK MODE */
.dark-mode .main-header .nav-link {
    color: #cbd5e1 !important; /* Light slate text for icons */
}
.dark-mode .main-header .nav-link:hover {
    color: #ffffff !important;
}
.dark-mode .main-header,
.dark-mode .main-header span,
.dark-mode .main-header i,
.dark-mode .main-header a {
    color: #cbd5e1 !important;
}
.dark-mode .main-header .navbar-nav .nav-item a[href*="pos"] {
    color: white !important; /* Keep the POS button text bright white */
}
.dark-mode .main-header .navbar-nav .nav-item a[href*="pos"] i {
    color: white !important;
}

/* ========================================================
   GLOBAL MOBILE RESPONSIVENESS & TOUCH ENHANCEMENTS
   ======================================================== */
@media (max-width: 767.98px) {
    /* Navbar compact padding on mobile */
    .main-header .navbar-nav .nav-link {
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }

    /* Smooth touch scrolling for tables */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0.5rem;
    }

    /* Form controls touch optimization */
    .form-control, .btn {
        touch-action: manipulation;
    }

    /* Modal full usability on mobile */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    .modal-content {
        max-height: 92vh;
        overflow-y: auto;
    }

    /* Content wrapper compact side padding on phone */
    .content-wrapper > .content {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Page headers font balance */
    .content-header h1 {
        font-size: 1.35rem !important;
    }
}


/* ========================================================
   SISTEMA MULTI-TEMA PROFESIONAL (CLARO / OSCURO / AZUL MARINO NOC)
   ======================================================== */
.theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.theme-option-btn {
    transition: background-color 0.15s ease;
    font-size: 0.9rem;
}
.theme-option-btn.active-theme-choice {
    background-color: rgba(56, 189, 248, 0.12) !important;
}

/* ---------- 1. MODO OSCURO PROFUNDO (.theme-dark) ---------- */
html.theme-dark body.theme-dark,
body.theme-dark .wrapper,
body.theme-dark .content-wrapper {
    background-color: #0b0f17 !important;
    color: #e5e7eb !important;
}
body.theme-dark .main-header {
    background: rgba(15, 20, 30, 0.92) !important;
    border-bottom: 1px solid #1f2937 !important;
}
body.theme-dark .main-sidebar {
    background-color: #090d14 !important;
    border-right: 1px solid #1f2937 !important;
}
body.theme-dark .card,
body.theme-dark .card-stats,
body.theme-dark .card-stats-custom,
body.theme-dark .chart-card,
body.theme-dark .modal-content,
body.theme-dark .dropdown-menu,
body.theme-dark .list-group-item {
    background-color: #131824 !important;
    color: #e5e7eb !important;
    border-color: #232b3b !important;
}
body.theme-dark .card-header.bg-white,
body.theme-dark .card-footer.bg-white,
body.theme-dark .bg-white {
    background-color: #131824 !important;
    color: #e5e7eb !important;
}
body.theme-dark .bg-light,
body.theme-dark .modal-footer.bg-light,
body.theme-dark .modal-header.bg-light,
body.theme-dark .table thead.bg-light th,
body.theme-dark .card-header.bg-light {
    background-color: #1a2130 !important;
    color: #cbd5e1 !important;
    border-color: #263042 !important;
}
body.theme-dark .text-dark,
body.theme-dark .text-gray-900,
body.theme-dark .text-secondary,
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3,
body.theme-dark h4, body.theme-dark h5, body.theme-dark h6 {
    color: #f3f4f6 !important;
}
body.theme-dark .text-muted {
    color: #9ca3af !important;
}
body.theme-dark .border,
body.theme-dark .border-top,
body.theme-dark .border-bottom {
    border-color: #232b3b !important;
}
body.theme-dark .badge-light {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
}
body.theme-dark .form-control,
body.theme-dark .custom-select,
body.theme-dark .select2-container--default .select2-selection--single {
    background-color: #0b0f17 !important;
    border-color: #2a3447 !important;
    color: #f3f4f6 !important;
}
body.theme-dark .input-group-text {
    background-color: #1a2130 !important;
    border-color: #2a3447 !important;
    color: #cbd5e1 !important;
}
body.theme-dark .table td,
body.theme-dark .table th {
    border-color: #232b3b !important;
}
body.theme-dark .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}
body.theme-dark .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}
body.theme-dark .dropdown-item {
    color: #e5e7eb !important;
}
body.theme-dark .dropdown-item:hover {
    background-color: #1f2937 !important;
}
body.theme-dark .swal2-popup {
    background: #131824 !important;
    color: #f3f4f6 !important;
    border: 1px solid #263042 !important;
}
body.theme-dark .btn-light,
body.theme-dark .btn-outline-dark {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

/* ---------- 2. MODO AZUL MARINO NOC (.theme-noc) ---------- */
html.theme-noc body.theme-noc,
body.theme-noc .wrapper,
body.theme-noc .content-wrapper {
    background-color: #071224 !important;
    color: #e2ecf8 !important;
}
body.theme-noc .main-header {
    background: rgba(10, 24, 46, 0.94) !important;
    border-bottom: 1px solid #1e3a5f !important;
    box-shadow: 0 2px 14px rgba(2, 8, 20, 0.5) !important;
}
body.theme-noc .main-sidebar {
    background-color: #061020 !important;
    border-right: 1px solid #173052 !important;
}
body.theme-noc .main-sidebar .nav-link.active {
    background: linear-gradient(90deg, #0284c7, #2563eb) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25) !important;
}
body.theme-noc .card,
body.theme-noc .card-stats,
body.theme-noc .card-stats-custom,
body.theme-noc .chart-card,
body.theme-noc .modal-content,
body.theme-noc .dropdown-menu,
body.theme-noc .list-group-item {
    background-color: #0c1b33 !important;
    color: #e2ecf8 !important;
    border: 1px solid #1a3356 !important;
    box-shadow: 0 6px 20px rgba(3, 10, 24, 0.45) !important;
}
body.theme-noc .card-header.bg-white,
body.theme-noc .card-footer.bg-white,
body.theme-noc .bg-white {
    background-color: #0c1b33 !important;
    color: #e2ecf8 !important;
}
body.theme-noc .bg-light,
body.theme-noc .modal-footer.bg-light,
body.theme-noc .modal-header.bg-light,
body.theme-noc .table thead.bg-light th,
body.theme-noc .card-header.bg-light {
    background-color: #102444 !important;
    color: #bae6fd !important;
    border-color: #1e3a5f !important;
}
body.theme-noc .text-dark,
body.theme-noc .text-gray-900,
body.theme-noc .text-secondary,
body.theme-noc h1, body.theme-noc h2, body.theme-noc h3,
body.theme-noc h4, body.theme-noc h5, body.theme-noc h6 {
    color: #f0f7ff !important;
}
body.theme-noc .text-muted {
    color: #8ba8cc !important;
}
body.theme-noc .border,
body.theme-noc .border-top,
body.theme-noc .border-bottom {
    border-color: #1a3356 !important;
}
body.theme-noc .badge-light {
    background-color: #12294d !important;
    color: #bae6fd !important;
    border-color: #1e4273 !important;
}
body.theme-noc .form-control,
body.theme-noc .custom-select,
body.theme-noc .select2-container--default .select2-selection--single {
    background-color: #071224 !important;
    border-color: #1e3a5f !important;
    color: #f0f7ff !important;
}
body.theme-noc .form-control:focus {
    background-color: #0b1930 !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18) !important;
}
body.theme-noc .input-group-text {
    background-color: #102444 !important;
    border-color: #1e3a5f !important;
    color: #7dd3fc !important;
}
body.theme-noc .table tbody tr {
    background-color: #0c1b33 !important;
}
body.theme-noc .table td,
body.theme-noc .table th {
    border-color: #1a3356 !important;
    color: #dbeafe !important;
}
body.theme-noc .table-striped tbody tr:nth-of-type(odd) {
    background-color: #0f213d !important;
}
body.theme-noc .table-hover tbody tr:hover {
    background-color: #142a4d !important;
}
body.theme-noc .dropdown-item {
    color: #e2ecf8 !important;
}
body.theme-noc .dropdown-item:hover {
    background-color: #13294b !important;
    color: #38bdf8 !important;
}
body.theme-noc .swal2-popup {
    background: #0c1b33 !important;
    color: #f0f7ff !important;
    border: 1px solid #1e3a5f !important;
}
body.theme-noc .btn-light,
body.theme-noc .btn-outline-dark {
    background-color: #102444 !important;
    border-color: #1e3a5f !important;
    color: #bae6fd !important;
}
body.theme-noc .pos-container .bg-white,
body.theme-noc .product-card {
    background-color: #0c1b33 !important;
    border-color: #1e3a5f !important;
}
body.theme-noc .product-price {
    background-color: #102444 !important;
    color: #38bdf8 !important;
}
body.theme-noc .cat-pill:not(.active),
body.theme-noc .search-bar {
    background-color: #0c1b33 !important;
    border-color: #1e3a5f !important;
    color: #e2ecf8 !important;
}
body.theme-noc .cat-pill.active {
    background-color: #0284c7 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}
body.theme-noc #themeSelectorToggle,
body.theme-dark #themeSelectorToggle {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* ---------- 3. AJUSTES POS EN MODOS OSCURO Y NOC ---------- */
.pos-view-switcher {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
.pos-btn-fiao {
    border: 1px solid #f87171 !important;
    background: #fff5f5 !important;
}
.pos-btn-arqueo {
    border: 1px solid #38bdf8 !important;
    background: #f0f9ff !important;
}

body.theme-dark .pos-view-switcher {
    background: #131824 !important;
    border-color: #2a3447 !important;
}
body.theme-noc .pos-view-switcher {
    background: #0c1b33 !important;
    border-color: #1e3a5f !important;
}
body.theme-dark .pos-btn-fiao,
body.theme-noc .pos-btn-fiao {
    background: rgba(239, 68, 68, 0.14) !important;
    border: 1px solid rgba(248, 113, 113, 0.5) !important;
    color: #fecaca !important;
}
body.theme-dark .pos-btn-fiao:hover,
body.theme-noc .pos-btn-fiao:hover {
    background: rgba(239, 68, 68, 0.24) !important;
    color: #ffffff !important;
}
body.theme-dark .pos-btn-arqueo,
body.theme-noc .pos-btn-arqueo {
    background: rgba(56, 189, 248, 0.14) !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    color: #bae6fd !important;
}
body.theme-dark .pos-btn-arqueo:hover,
body.theme-noc .pos-btn-arqueo:hover {
    background: rgba(56, 189, 248, 0.24) !important;
    color: #ffffff !important;
}
body.theme-dark .btn-cancel-pos,
body.theme-noc .btn-cancel-pos {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(248, 113, 113, 0.45) !important;
    color: #fca5a5 !important;
}
body.theme-dark .btn-cancel-pos:hover,
body.theme-noc .btn-cancel-pos:hover {
    background: rgba(239, 68, 68, 0.28) !important;
    color: #ffffff !important;
}
body.theme-dark .btn-pay:disabled,
body.theme-noc .btn-pay:disabled {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
    opacity: 0.85 !important;
}
body.theme-noc .action-icon-btn {
    background: #0c1b33 !important;
    border-color: #1e3a5f !important;
    color: #dbeafe !important;
}
body.theme-noc .action-icon-btn:hover {
    background: #13294b !important;
    color: #ffffff !important;
}
body.theme-noc .kbd-badge,
body.theme-dark .kbd-badge {
    background: rgba(15, 23, 42, 0.8) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* ---------- 4. AJUSTES FINOS DE TABLAS, PILLS Y BADGES EN OSCURO Y NOC ---------- */
.dataTables_length select {
    min-width: 68px !important;
    padding: 0.25rem 1.4rem 0.25rem 0.5rem !important;
}
body.theme-dark .filter-pill:not(.active),
body.theme-noc .filter-pill:not(.active) {
    background: #102444 !important;
    border-color: #1e3a5f !important;
    color: #cbd5e1 !important;
}
body.theme-dark .filter-pill:not(.active) {
    background: #1a2130 !important;
    border-color: #2a3447 !important;
}
body.theme-dark .filter-pill:not(.active):hover,
body.theme-noc .filter-pill:not(.active):hover {
    color: #ffffff !important;
    border-color: #38bdf8 !important;
}
body.theme-dark .badge-debt,
body.theme-noc .badge-debt {
    background: rgba(239, 68, 68, 0.16) !important;
    border-color: rgba(248, 113, 113, 0.45) !important;
    color: #fecaca !important;
}
body.theme-dark .badge-solvent,
body.theme-noc .badge-solvent {
    background: rgba(16, 185, 129, 0.16) !important;
    border-color: rgba(52, 211, 153, 0.45) !important;
    color: #a7f3d0 !important;
}
body.theme-dark .badge-points,
body.theme-noc .badge-points {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(251, 191, 36, 0.45) !important;
    color: #fde68a !important;
}
body.theme-dark .btn-icon-soft,
body.theme-noc .btn-icon-soft {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}
body.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button,
body.theme-noc .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #cbd5e1 !important;
}

/* ---------- 5. NAVBAR ANTI-DESBORDE EN TABLETS / VENTANAS MEDIANAS ---------- */
.main-header .navbar-nav {
    flex-wrap: nowrap !important;
}
.main-header .navbar-nav .nav-link {
    white-space: nowrap !important;
}
@media (max-width: 1199.98px) {
    .main-header .navbar-nav .nav-link {
        padding-left: 0.45rem !important;
        padding-right: 0.45rem !important;
    }
}

body.theme-dark .price-check-usd,
body.theme-noc .price-check-usd {
    color: #38bdf8 !important;
}
body.theme-dark .price-check-bs,
body.theme-noc .price-check-bs {
    color: #4ade80 !important;
}
