/* ==========================================================================
   UPDATED PAGE CSS (Extracted from cssHeader)
   ========================================================================== */

/* --- General Overrides --- */
kbd {
    color: #fff;
    background-color: #556;
}

.breadcrumb-item a {
    color: var(--theme-default);
}

svg.feather,
.feather {
    flex-shrink: 0;
}

.select2-container .select2-selection--single {
    height: 38px !important;
    padding: 5px;
}

/* Hide Previous/Next text on mobile — icon is shown via ::before in style.css */
@media (max-width: 575.98px) {
    div.dataTables_wrapper div.dataTables_paginate .paginate_button.previous,
    div.dataTables_wrapper div.dataTables_paginate .paginate_button.next {
        font-size: 0 !important;
    }
}

/* --- Universal Border Classes (Screen & Print) --- */
body .border-black-all {
    border: 1px solid #000 !important;
}

body .border-black-top {
    border-top: 1px solid #000 !important;
}

body .border-black-bottom {
    border-bottom: 1px solid #000 !important;
}

body .border-black-left {
    border-left: 1px solid #000 !important;
}

body .border-black-right {
    border-right: 1px solid #000 !important;
}

@media print {
    body .border-black-all {
        border: 1px solid #000 !important;
    }

    body .border-black-top {
        border-top: 1px solid #000 !important;
    }

    body .border-black-bottom {
        border-bottom: 1px solid #000 !important;
    }

    body .border-black-left {
        border-left: 1px solid #000 !important;
    }

    body .border-black-right {
        border-right: 1px solid #000 !important;
    }

    body .border-black-all,
    body .border-black-top,
    body .border-black-bottom,
    body .border-black-left,
    body .border-black-right {
        border-color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .container > div {
        min-width: auto !important;
        width: 100% !important;
    }

    /* Universal Font Size Overrides for Print */
    .font-xs {
        font-size: 9.5px !important;
    }

    .font-sm {
        font-size: 10.5px !important;
    }

    .font-md {
        font-size: 12px !important;
    }

    .font-lg {
        font-size: 14px !important;
    }
}

/* --- Universal Font Size Classes --- */
.font-xs {
    font-size: 11px !important;
}

.font-sm {
    font-size: 13px !important;
}

.font-md {
    font-size: 15px !important;
}

.font-lg {
    font-size: 18px !important;
}

/* --- Table Helper: Inner Cell Borders + Top/Bottom Outlines --- */
.table-bordered-light {
    border-collapse: collapse !important;
    border-top: 1px solid #333 !important;
    border-bottom: 1px solid #333 !important;
    border-left: none !important;
    border-right: none !important;
}

.table-bordered-light th,
.table-bordered-light td {
    border: 1px solid #666 !important;
    padding: 2px 4px !important;
}

.table-bordered-light tr th:first-child,
.table-bordered-light tr td:first-child {
    border-left: none !important;
}

.table-bordered-light tr th:last-child,
.table-bordered-light tr td:last-child {
    border-right: none !important;
}

/* --- Horizontal Sidebar: Link & Submenu Sizing --- */
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-link {
    padding-left: 8px !important;        
    padding-right: 8px !important;        
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-submenu {
    margin-top: -3px !important;
    top: calc(var(--ho-header-h, 44px) + var(--ho-sidebar-h, 34px)) !important;
}

/* ==========================================================================
   22. GENERALIZED PRODUCT ENTRY TABLES & REUSABLE MODULE SYSTEM
   Reusable classes for BT, Sales, Purchase & ANY Future Module:
   - Base Table: .product-entry-table, .entry-table (#addProductsTable, #editProductsTable)
   - 10-Col Variant: .table-10-col, .product-entry-table-10 (BT, Sales, Returns)
   - 12-Col Variant: .table-12-col, .product-entry-table-12 (Purchase, GRN)
   - Rows: tr.product-row, tr.entry-row
   - Active Highlight: tr.active-row
   - Semantic Columns: .col-item, .col-batch, .col-exp, .col-mrp, .col-rate,
     .col-pts, .col-ptr, .col-gst, .col-qty, .col-free, .col-discount, .col-action
   - Cell Value Formats: .input-qty, .input-free, .input-batch, .input-exp,
     .input-amount, .input-rate, .input-percentage
   - History Container: .entry-history-row, .entry-history-container, .entry-history-list
   ========================================================================== */

/* --- Base Product Entry Table --- */
.product-entry-table,
.entry-table,
#addProductsTable,
#editProductsTable {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    margin-bottom: 0 !important;
}

/* 10-Column Tables: Branch Transfer, Sales, Returns, Delivery (min 720px) */
.table-10-col,
.product-entry-table-10,
#addBranchTransferForm #addProductsTable,
#editBranchTransferForm #editProductsTable,
#addSalesForm #addProductsTable,
#editSalesForm #editProductsTable,
#addProductsTable:not(:has(th:nth-child(11))),
#editProductsTable:not(:has(th:nth-child(11))) {
    min-width: 720px !important;
}

/* 12-Column Tables: Purchase, GRN, Bill of Materials (min 820px) */
.table-12-col,
.product-entry-table-12,
#addPurchaseForm #addProductsTable,
#editPurchaseForm #editProductsTable,
#addProductsTable:has(th:nth-child(12)),
#editProductsTable:has(th:nth-child(12)) {
    min-width: 820px !important;
}

/* --- Table Headers: Highlighted with Proper Contrast Color & Word Wrap --- */
.product-entry-table thead th,
.entry-table thead th,
#addProductsTable thead th,
#editProductsTable thead th,
.table thead th {
    padding: 6px 4px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px;
    vertical-align: middle !important;
    text-align: center !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.25 !important;
    background-color: #2b3548 !important;
    color: #ffffff !important;
    border: 1px solid #3c485d !important;
    text-transform: uppercase !important;
}

.product-entry-table thead th:first-child,
.entry-table thead th:first-child,
.product-entry-table thead th.col-item,
#addProductsTable thead th:first-child,
#editProductsTable thead th:first-child {
    text-align: left !important;
    padding-left: 8px !important;
}

/* --- Table Data Cells & Inputs (Clean, Readable & Compact) --- */
tr.product-row td,
tr.entry-row td,
.product-entry-table tbody td {
    padding: 2px 3px !important;
    vertical-align: middle !important;
    border: 1px solid #dee2e6 !important;
}

tr.product-row td .form-control,
tr.entry-row td .form-control,
.product-entry-table tbody td .form-control,
.table-input {
    padding: 2px 5px !important;
    height: 26px !important;
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    border: 1px solid #ced4da !important;
    width: 100% !important;
}

tr.product-row td .form-control:focus,
tr.entry-row td .form-control:focus,
.product-entry-table tbody td .form-control:focus,
.table-input:focus {
    border-color: var(--theme-default, #43B9B2) !important;
    box-shadow: 0 0 0 1px var(--theme-default, #43B9B2) !important;
}

/* Hide HTML5 number spin-buttons for clean appearance */
tr.product-row td input[type="number"]::-webkit-inner-spin-button,
tr.product-row td input[type="number"]::-webkit-outer-spin-button,
tr.entry-row td input[type="number"]::-webkit-inner-spin-button,
tr.entry-row td input[type="number"]::-webkit-outer-spin-button,
.product-entry-table input[type="number"]::-webkit-inner-spin-button,
.product-entry-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
tr.product-row td input[type="number"],
tr.entry-row td input[type="number"],
.product-entry-table input[type="number"] {
    -moz-appearance: textfield;
}

/* Value-based input alignment & sizing (Generalized Classes) */
tr.product-row td .product-quantity,
tr.product-row td .product-free,
tr.entry-row td .product-quantity,
tr.entry-row td .product-free,
.input-qty,
.input-free,
.cell-align-center {
    text-align: center !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
}

tr.product-row td .product-batchno,
tr.entry-row td .product-batchno,
.input-batch,
.cell-batch {
    text-align: center !important;
    font-size: 12px !important;
    letter-spacing: 0.3px !important;
    background-color: #f8f9fa !important;
}

tr.product-row td .exp,
tr.entry-row td .exp,
.input-exp,
.input-date,
.cell-exp {
    text-align: center !important;
    font-size: 11.5px !important;
    padding: 2px 2px !important;
}

tr.product-row td .mrp,
tr.product-row td .branchrate,
tr.product-row td .branch-rate,
tr.product-row td .rate,
tr.product-row td .purchaserate,
tr.product-row td .pts,
tr.product-row td .ptr,
tr.product-row td .gst,
tr.product-row td .discount,
tr.entry-row td .mrp,
tr.entry-row td .rate,
tr.entry-row td .discount,
.input-rate,
.input-amount,
.input-currency,
.input-percentage,
.cell-align-right {
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
    font-size: 12.5px !important;
}

/* Margin text under Rate in Sales */
tr.product-row td .margin-amount,
tr.entry-row td .margin-amount {
    font-size: 11px !important;
}

/* Select2 Product Dropdown in Column 1 */
tr.product-row td[id^="product_item_parent"] > div,
tr.entry-row td[id^="product_item_parent"] > div {
    top: 0 !important;
    position: static !important;
    margin: 0 !important;
}

tr.product-row td .select2-container,
tr.entry-row td .select2-container,
.product-entry-table .select2-container,
.table-select2 {
    margin: 0 !important;
    width: 100% !important;
}

tr.product-row td .select2-container .select2-selection--single,
tr.entry-row td .select2-container .select2-selection--single,
.product-entry-table .select2-container .select2-selection--single,
.table-select2 .select2-selection--single {
    height: 26px !important;
    line-height: 26px !important;
    padding: 0 !important;
    border-radius: 2px !important;
    display: flex !important;
    align-items: center !important;
    border: 1px solid #ced4da !important;
}

tr.product-row td .select2-container--default .select2-selection--single .select2-selection__rendered,
tr.entry-row td .select2-container--default .select2-selection--single .select2-selection__rendered,
.product-entry-table .select2-container--default .select2-selection--single .select2-selection__rendered,
.table-select2 .select2-selection__rendered {
    line-height: 24px !important;
    padding-left: 6px !important;
    padding-right: 18px !important;
    font-size: 12.5px !important;
}

tr.product-row td .select2-container--default .select2-selection--single .select2-selection__arrow,
tr.entry-row td .select2-container--default .select2-selection--single .select2-selection__arrow,
.product-entry-table .select2-container--default .select2-selection--single .select2-selection__arrow,
.table-select2 .select2-selection__arrow {
    height: 24px !important;
    width: 16px !important;
}

/* Action Icon Buttons */
tr.product-row td .btn-sm,
tr.entry-row td .btn-sm,
.product-entry-table td .btn-sm,
.table-action-btn {
    padding: 2px 5px !important;
    height: 24px !important;
    min-width: 22px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Footer Totals */
.product-entry-table tfoot td,
.entry-table tfoot td,
#addProductsTable tfoot td,
#editProductsTable tfoot td {
    padding: 4px 6px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    border: 1px solid #dee2e6 !important;
    background-color: #f8f9fa !important;
}

#addProductsTable tfoot td.total-quantity,
#editProductsTable tfoot td.total-quantity,
#addProductsTable tfoot td.total-free-quantity,
#editProductsTable tfoot td.total-free-quantity,
.total-quantity,
.total-free-quantity,
.tfoot-align-center {
    text-align: center !important;
}

#addProductsTable tfoot td.total-branch-rate,
#editProductsTable tfoot td.total-branch-rate,
#addProductsTable tfoot td.total-gst,
#editProductsTable tfoot td.total-gst,
#addProductsTable tfoot td.total-discount,
#editProductsTable tfoot td.total-discount,
#addProductsTable tfoot td.total-purchase-rate,
#editProductsTable tfoot td.total-purchase-rate,
.total-branch-rate,
.total-gst,
.total-discount,
.total-purchase-rate,
.total-rate,
.total-amount,
.tfoot-align-right {
    text-align: right !important;
}

/* --- COLUMN PERCENTAGES: 10-Column Tables (BT, Sales & Generalized 10-Col Modules) --- */
.table-10-col th:nth-child(1),
.product-entry-table-10 th:nth-child(1),
.table-10-col th.col-item,
.product-entry-table-10 th.col-item,
#addBranchTransferForm #addProductsTable th:nth-child(1),
#editBranchTransferForm #editProductsTable th:nth-child(1),
#addSalesForm #addProductsTable th:nth-child(1),
#editSalesForm #editProductsTable th:nth-child(1),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(1),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(1) {
    width: 31% !important;
    min-width: 180px !important;
}

.table-10-col th:nth-child(2),
.product-entry-table-10 th:nth-child(2),
.table-10-col th.col-batch,
.product-entry-table-10 th.col-batch,
#addBranchTransferForm #addProductsTable th:nth-child(2),
#editBranchTransferForm #editProductsTable th:nth-child(2),
#addSalesForm #addProductsTable th:nth-child(2),
#editSalesForm #editProductsTable th:nth-child(2),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(2),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(2) {
    width: 8% !important;
    min-width: 68px !important;
}

.table-10-col th:nth-child(3),
.product-entry-table-10 th:nth-child(3),
.table-10-col th.col-exp,
.product-entry-table-10 th.col-exp,
#addBranchTransferForm #addProductsTable th:nth-child(3),
#editBranchTransferForm #editProductsTable th:nth-child(3),
#addSalesForm #addProductsTable th:nth-child(3),
#editSalesForm #editProductsTable th:nth-child(3),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(3),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(3) {
    width: 10% !important;
    min-width: 100px !important;
}

.table-10-col th:nth-child(4),
.product-entry-table-10 th:nth-child(4),
.table-10-col th.col-mrp,
.product-entry-table-10 th.col-mrp,
#addBranchTransferForm #addProductsTable th:nth-child(4),
#editBranchTransferForm #editProductsTable th:nth-child(4),
#addSalesForm #addProductsTable th:nth-child(4),
#editSalesForm #editProductsTable th:nth-child(4),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(4),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(4) {
    width: 8% !important;
    min-width: 60px !important;
}

.table-10-col th:nth-child(5),
.product-entry-table-10 th:nth-child(5),
.table-10-col th.col-rate,
.product-entry-table-10 th.col-rate,
#addBranchTransferForm #addProductsTable th:nth-child(5),
#editBranchTransferForm #editProductsTable th:nth-child(5),
#addSalesForm #addProductsTable th:nth-child(5),
#editSalesForm #editProductsTable th:nth-child(5),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(5),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(5) {
    width: 8.5% !important;
    min-width: 65px !important;
}

.table-10-col th:nth-child(6),
.product-entry-table-10 th:nth-child(6),
.table-10-col th.col-gst,
.product-entry-table-10 th.col-gst,
#addBranchTransferForm #addProductsTable th:nth-child(6),
#editBranchTransferForm #editProductsTable th:nth-child(6),
#addSalesForm #addProductsTable th:nth-child(6),
#editSalesForm #editProductsTable th:nth-child(6),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(6),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(6) {
    width: 6% !important;
    min-width: 48px !important;
}

.table-10-col th:nth-child(7),
.product-entry-table-10 th:nth-child(7),
.table-10-col th.col-qty,
.product-entry-table-10 th.col-qty,
#addBranchTransferForm #addProductsTable th:nth-child(7),
#editBranchTransferForm #editProductsTable th:nth-child(7),
#addSalesForm #addProductsTable th:nth-child(7),
#editSalesForm #editProductsTable th:nth-child(7),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(7),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(7) {
    width: 6.5% !important;
    min-width: 50px !important;
}

.table-10-col th:nth-child(8),
.product-entry-table-10 th:nth-child(8),
.table-10-col th.col-free,
.product-entry-table-10 th.col-free,
#addBranchTransferForm #addProductsTable th:nth-child(8),
#editBranchTransferForm #editProductsTable th:nth-child(8),
#addSalesForm #addProductsTable th:nth-child(8),
#editSalesForm #editProductsTable th:nth-child(8),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(8),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(8) {
    width: 5% !important;
    min-width: 42px !important;
}

.table-10-col th:nth-child(9),
.product-entry-table-10 th:nth-child(9),
.table-10-col th.col-discount,
.product-entry-table-10 th.col-discount,
#addBranchTransferForm #addProductsTable th:nth-child(9),
#editBranchTransferForm #editProductsTable th:nth-child(9),
#addSalesForm #addProductsTable th:nth-child(9),
#editSalesForm #editProductsTable th:nth-child(9),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(9),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(9) {
    width: 6% !important;
    min-width: 48px !important;
}

.table-10-col th:nth-child(10),
.product-entry-table-10 th:nth-child(10),
.table-10-col th.col-action,
.product-entry-table-10 th.col-action,
#addBranchTransferForm #addProductsTable th:nth-child(10),
#editBranchTransferForm #editProductsTable th:nth-child(10),
#addSalesForm #addProductsTable th:nth-child(10),
#editSalesForm #editProductsTable th:nth-child(10),
#addProductsTable:not(:has(th:nth-child(11))) th:nth-child(10),
#editProductsTable:not(:has(th:nth-child(11))) th:nth-child(10) {
    width: 5% !important;
    min-width: 46px !important;
}

/* --- COLUMN PERCENTAGES: 12-Column Tables (Purchase & Generalized 12-Col Modules) --- */
.table-12-col th:nth-child(1),
.product-entry-table-12 th:nth-child(1),
.table-12-col th.col-item,
.product-entry-table-12 th.col-item,
#addPurchaseForm #addProductsTable th:nth-child(1),
#editPurchaseForm #editProductsTable th:nth-child(1),
#addProductsTable:has(th:nth-child(12)) th:nth-child(1),
#editProductsTable:has(th:nth-child(12)) th:nth-child(1) {
    width: 25% !important;
    min-width: 170px !important;
}

.table-12-col th:nth-child(2),
.product-entry-table-12 th:nth-child(2),
.table-12-col th.col-pts,
.product-entry-table-12 th.col-pts,
#addPurchaseForm #addProductsTable th:nth-child(2),
#editPurchaseForm #editProductsTable th:nth-child(2),
#addProductsTable:has(th:nth-child(12)) th:nth-child(2),
#editProductsTable:has(th:nth-child(12)) th:nth-child(2) {
    width: 5.5% !important;
    min-width: 50px !important;
}

.table-12-col th:nth-child(3),
.product-entry-table-12 th:nth-child(3),
.table-12-col th.col-ptr,
.product-entry-table-12 th.col-ptr,
#addPurchaseForm #addProductsTable th:nth-child(3),
#editPurchaseForm #editProductsTable th:nth-child(3),
#addProductsTable:has(th:nth-child(12)) th:nth-child(3),
#editProductsTable:has(th:nth-child(12)) th:nth-child(3) {
    width: 5.5% !important;
    min-width: 50px !important;
}

.table-12-col th:nth-child(4),
.product-entry-table-12 th:nth-child(4),
.table-12-col th.col-mrp,
.product-entry-table-12 th.col-mrp,
#addPurchaseForm #addProductsTable th:nth-child(4),
#editPurchaseForm #editProductsTable th:nth-child(4),
#addProductsTable:has(th:nth-child(12)) th:nth-child(4),
#editProductsTable:has(th:nth-child(12)) th:nth-child(4) {
    width: 5.5% !important;
    min-width: 50px !important;
}

.table-12-col th:nth-child(5),
.product-entry-table-12 th:nth-child(5),
.table-12-col th.col-purchase-rate,
.product-entry-table-12 th.col-purchase-rate,
#addPurchaseForm #addProductsTable th:nth-child(5),
#editPurchaseForm #editProductsTable th:nth-child(5),
#addProductsTable:has(th:nth-child(12)) th:nth-child(5),
#editProductsTable:has(th:nth-child(12)) th:nth-child(5) {
    width: 7% !important;
    min-width: 58px !important;
}

.table-12-col th:nth-child(6),
.product-entry-table-12 th:nth-child(6),
.table-12-col th.col-qty,
.product-entry-table-12 th.col-qty,
#addPurchaseForm #addProductsTable th:nth-child(6),
#editPurchaseForm #editProductsTable th:nth-child(6),
#addProductsTable:has(th:nth-child(12)) th:nth-child(6),
#editProductsTable:has(th:nth-child(12)) th:nth-child(6) {
    width: 6% !important;
    min-width: 48px !important;
}

.table-12-col th:nth-child(7),
.product-entry-table-12 th:nth-child(7),
.table-12-col th.col-free,
.product-entry-table-12 th.col-free,
#addPurchaseForm #addProductsTable th:nth-child(7),
#editPurchaseForm #editProductsTable th:nth-child(7),
#addProductsTable:has(th:nth-child(12)) th:nth-child(7),
#editProductsTable:has(th:nth-child(12)) th:nth-child(7) {
    width: 6% !important;
    min-width: 48px !important;
}

.table-12-col th:nth-child(8),
.product-entry-table-12 th:nth-child(8),
.table-12-col th.col-discount,
.product-entry-table-12 th.col-discount,
#addPurchaseForm #addProductsTable th:nth-child(8),
#editPurchaseForm #editProductsTable th:nth-child(8),
#addProductsTable:has(th:nth-child(12)) th:nth-child(8),
#editProductsTable:has(th:nth-child(12)) th:nth-child(8) {
    width: 7% !important;
    min-width: 58px !important;
}

.table-12-col th:nth-child(9),
.product-entry-table-12 th:nth-child(9),
.table-12-col th.col-exp,
.product-entry-table-12 th.col-exp,
#addPurchaseForm #addProductsTable th:nth-child(9),
#editPurchaseForm #editProductsTable th:nth-child(9),
#addProductsTable:has(th:nth-child(12)) th:nth-child(9),
#editProductsTable:has(th:nth-child(12)) th:nth-child(9) {
    width: 9.5% !important;
    min-width: 100px !important;
}

.table-12-col th:nth-child(10),
.product-entry-table-12 th:nth-child(10),
.table-12-col th.col-batch,
.product-entry-table-12 th.col-batch,
#addPurchaseForm #addProductsTable th:nth-child(10),
#editPurchaseForm #editProductsTable th:nth-child(10),
#addProductsTable:has(th:nth-child(12)) th:nth-child(10),
#editProductsTable:has(th:nth-child(12)) th:nth-child(10) {
    width: 7.5% !important;
    min-width: 65px !important;
}

.table-12-col th:nth-child(11),
.product-entry-table-12 th:nth-child(11),
.table-12-col th.col-gst,
.product-entry-table-12 th.col-gst,
#addPurchaseForm #addProductsTable th:nth-child(11),
#editPurchaseForm #editProductsTable th:nth-child(11),
#addProductsTable:has(th:nth-child(12)) th:nth-child(11),
#editProductsTable:has(th:nth-child(12)) th:nth-child(11) {
    width: 6% !important;
    min-width: 50px !important;
}

.table-12-col th:nth-child(12),
.product-entry-table-12 th:nth-child(12),
.table-12-col th.col-action,
.product-entry-table-12 th.col-action,
#addPurchaseForm #addProductsTable th:nth-child(12),
#editPurchaseForm #editProductsTable th:nth-child(12),
#addProductsTable:has(th:nth-child(12)) th:nth-child(12),
#editProductsTable:has(th:nth-child(12)) th:nth-child(12) {
    width: 3.5% !important;
    min-width: 34px !important;
}

/* --- Universal Standalone Column Width Classes (Mix-and-Match for ANY Custom Table) --- */
.col-w-item     { width: 28% !important; min-width: 170px !important; }
.col-w-batch    { width: 8% !important;  min-width: 65px !important; }
.col-w-exp      { width: 10% !important; min-width: 100px !important; }
.col-w-mrp      { width: 6% !important;  min-width: 50px !important; }
.col-w-rate     { width: 8% !important;  min-width: 60px !important; }
.col-w-pts      { width: 5.5% !important; min-width: 50px !important; }
.col-w-ptr      { width: 5.5% !important; min-width: 50px !important; }
.col-w-qty      { width: 6.5% !important; min-width: 50px !important; }
.col-w-free     { width: 5.5% !important; min-width: 44px !important; }
.col-w-gst      { width: 6% !important;  min-width: 48px !important; }
.col-w-discount { width: 6% !important;  min-width: 48px !important; }
.col-w-action   { width: 4% !important;  min-width: 40px !important; }

/* --- Hide Theme Customizer floating gear button and panel --- */
.sidebar-pannle-main,
.setting-sidebar,
#cog-click {
    display: none !important;
}

/* ==========================================================================
   [REVIVABLE] Horizontal Sidebar Arrow Navigation CSS
   Uncomment this block if returning to single-row arrow scrolling.
   ========================================================================== */
/*
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .left-arrow,
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .right-arrow {
    width: 26px !important;
    height: 100% !important;
    top: 0 !important;
    bottom: 0 !important;
    padding: 0 !important;
    background: var(--card-color, #fff) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    cursor: pointer !important;
    border: none !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15) !important;
}
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .left-arrow { left: 0 !important; }
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .right-arrow { right: 0 !important; }
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .left-arrow.disabled,
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .right-arrow.disabled { display: none !important; }
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .left-arrow svg,
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .right-arrow svg {
    width: 14px !important;
    height: 14px !important;
    stroke: var(--body-font-color, #333) !important;
}
*/

/* Arrows hidden in wrapped sidebar design */
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .left-arrow,
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .right-arrow {
    display: none !important;
}

/* --- Solid Opaque Header: Sleek Single-Row Bar (Never wraps to 2 rows) --- */
header.page-header,
.page-header.row,
.page-wrapper.horizontal-sidebar .page-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* STRICTLY 1 ROW - NEVER WRAP */
    align-items: center !important;
    justify-content: space-between !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    z-index: 1000 !important;
    border-bottom: 1px solid #dcdcdc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
}

header.page-header .logo-wrapper,
header.page-header .page-main-header {
    background-color: transparent !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

/* --- Completely Hide Sidebar Toggle Icon / Arrow Box --- */
.page-header .close-btn,
.page-header .toggle-sidebar,
.page-header .logo-wrapper .close-btn {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Header Brand Group (Logo + Title + Divider + Branch) - Single Line */
.page-header .header-brand-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
}

.page-header .header-logo-img,
.page-header .logo-wrapper img {
    width: 38px !important;
    height: 38px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

.page-header .header-brand-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #1e293b !important;
    margin: 0 !important;
    letter-spacing: -0.2px !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

/* Clean vertical divider between brand and branch */
.page-header .header-branch-divider {
    width: 2px !important;
    height: 20px !important;
    background-color: #cbd5e1 !important;
    margin: 0 14px !important;
    flex-shrink: 0 !important;
}

/* Branch / Head Office Title */
.page-header .header-branch-title {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Header Right Nav (Profile Dropdown, Admin Button) */
.page-header .nav-right {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

.page-header .header-right {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
    list-style: none !important;
}

/* Bigger Desktop Screens (>= 1200px) */
@media (min-width: 1200px) {
    .page-header .header-brand-title {
        font-size: 18px !important;
        letter-spacing: -0.3px !important;
    }

    .page-header .header-branch-title {
        font-size: 15px !important;
    }

    .page-header .header-logo-img {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Responsive (< 768px) */
@media (max-width: 767.98px) {
    .page-header {
        padding: 0 10px !important;
    }

    .page-header .header-brand-title {
        font-size: 14px !important;
    }

    .page-header .header-branch-title {
        font-size: 12.5px !important;
    }

    .page-header .header-branch-divider {
        margin: 0 8px !important;
    }

    .page-header .header-logo-img {
        width: 32px !important;
        height: 32px !important;
    }
}

/* ==========================================================================
   NEW WRAPPED HORIZONTAL SIDEBAR DESIGN
   - Sidebar container expands naturally when menu items exceed screen width
   - Items wrap cleanly onto multiple rows under the same container
   - Modern pill navigation design with clear hover & active states
   - Dropdown submenus positioned cleanly below parent
   ========================================================================== */
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar {
    display: flex !important;
    position: fixed !important;
    top: var(--ho-header-h, 44px) !important;
    margin-top: -1px !important; /* 1px overlap eliminates hairline seam */
    left: 0 !important;
    width: 100% !important;
    height: auto !important; /* Expands height automatically when wrapped */
    min-height: 32px !important;
    max-height: none !important;
    z-index: 999 !important;
    overflow: visible !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-bottom: 1px solid #dcdcdc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 3px 12px !important;
    box-sizing: border-box !important;
}

/* Container for wrapped menu */
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar #sidebar-menu {
    display: flex !important;
    align-items: center !important;
    height: auto !important;
    width: 100% !important;
    margin-left: 0 !important;
    position: relative !important;
    overflow: visible !important;
}

/* Menu list: Wraps items under the same container */
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important; /* WRAPS UNDER THE SAME CONTAINER */
    align-items: center !important;
    height: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 3px 6px !important;
    list-style: none !important;
    white-space: normal !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
}

/* Modern Pill / Tab Link Styling */
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-link {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    color: #334155 !important;
    background-color: transparent !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
    cursor: pointer !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-link:hover {
    background-color: #f1f5f9 !important;
    color: var(--theme-default, #43B9B2) !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-link.active,
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list.active .sidebar-link {
    background-color: #e6f7f6 !important;
    color: #0d7a71 !important;
    font-weight: 600 !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-link svg {
    width: 13px !important;
    height: 13px !important;
    margin-right: 4px !important;
    flex-shrink: 0 !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-link i {
    font-size: 12px !important;
    margin-right: 4px !important;
    flex-shrink: 0 !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .pin-title,
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .line,
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .pinned-icon {
    display: none !important;
}

/* Dropdown Submenus in Horizontal Wrapped Layout */
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-submenu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1050 !important;
    min-width: 175px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
    padding: 4px 0 !important;
    margin: 2px 0 0 0 !important;
    list-style: none !important;
    display: none;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list:hover > .sidebar-submenu,
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list.hover > .sidebar-submenu {
    display: block !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-submenu li {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-submenu li a {
    display: flex !important;
    align-items: center !important;
    padding: 5px 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    transition: background 0.15s ease !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-sidebar .sidebar-menu .sidebar-list .sidebar-submenu li a:hover {
    background-color: #f1f5f9 !important;
    color: #0d7a71 !important;
}

/* Page body sits directly below the horizontal sidebar with minimal gap */
.page-wrapper.horizontal-sidebar .page-body-wrapper .page-body {
    margin-top: var(--ho-sidebar-h, 34px) !important;
    padding: 6px 12px 16px 12px !important;
}

.page-wrapper.horizontal-sidebar .page-body-wrapper .page-title {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    padding: 0 !important;
}

.page-wrapper.horizontal-sidebar .card {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

/* Remove wasted empty space from empty card-header */
.page-wrapper.horizontal-sidebar .card-header.card-no-border:has(h4:empty):not(:has(> :not(h4))),
.card-header.card-no-border:has(h4:empty):not(:has(> :not(h4))) {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.page-wrapper.horizontal-sidebar .card .card-body {
    padding: 10px 14px !important;
}

/* Active Product Row Highlight - clean background color only, NO vertical strip */
tr.product-row,
tr.entry-row {
    transition: background-color 0.15s ease-in-out;
}
tr.product-row.active-row,
tr.product-row.active-row > td,
tr.entry-row.active-row,
tr.entry-row.active-row > td,
tr.active-row,
tr.active-row > td {
    background-color: #e6f7f6 !important;
    box-shadow: none !important;
}
tr.product-row.active-row td .form-control:not(:focus),
tr.entry-row.active-row td .form-control:not(:focus),
tr.active-row td .form-control:not(:focus) {
    background-color: #f7fcfa !important;
}

/* --- History Containers: Strict No-Horizontal-Scrollbar (BT, Sales, Purchase & Generalized Modules) --- */
.prev-transfers-row td,
.prev-sales-row td,
.prev-purchase-row td,
.entry-history-row td {
    overflow: hidden !important;
}

.prev-transfers-container,
.prev-sales-container,
.prev-purchase-container,
.entry-history-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
}

.prev-transfers-list,
.prev-sales-list,
.prev-purchase-list,
.entry-history-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    scrollbar-width: thin !important;
}

.prev-transfers-list .row,
.prev-sales-list .row,
.prev-purchase-list .row,
.entry-history-list .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Strictly hide horizontal scrollbar */
.prev-transfers-list::-webkit-scrollbar,
.prev-sales-list::-webkit-scrollbar,
.prev-purchase-list::-webkit-scrollbar,
.entry-history-list::-webkit-scrollbar {
    width: 4px !important;
    height: 0px !important;
}

.prev-transfers-list::-webkit-scrollbar-thumb,
.prev-sales-list::-webkit-scrollbar-thumb,
.prev-purchase-list::-webkit-scrollbar-thumb,
.entry-history-list::-webkit-scrollbar-thumb {
    background: #bbb !important;
    border-radius: 2px !important;
}
