/**
 * Back-office list tables — shared column alignment & scrollX fixes
 */

#scrollable-container table.backoffice-data-table,
#scrollable-container table.backoffice-data-table.dataTable,
#scrollable-container .dataTables_scrollHead table.backoffice-data-table,
#scrollable-container .dataTables_scrollBody table.backoffice-data-table {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
}

#scrollable-container .dataTables_wrapper:has(table.backoffice-data-table) {
    width: 100% !important;
    max-width: 100% !important;
}

#scrollable-container .dataTables_wrapper:has(table.backoffice-data-table) .dataTables_scroll {
    width: 100% !important;
    clear: both;
}

#scrollable-container .dataTables_wrapper:has(table.backoffice-data-table) .dataTables_scrollHead {
    overflow: hidden !important;
}

#scrollable-container .dataTables_wrapper:has(table.backoffice-data-table) .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

#scrollable-container .dataTables_wrapper:has(table.backoffice-data-table) .dataTables_scrollBody::-webkit-scrollbar {
    height: 10px;
}

#scrollable-container .dataTables_wrapper:has(table.backoffice-data-table) .dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

#scrollable-container .dataTables_wrapper:has(table.backoffice-data-table) .dataTables_scrollBody::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

#scrollable-container table.backoffice-data-table thead th,
#scrollable-container table.backoffice-data-table tbody td,
#scrollable-container table.backoffice-data-table tfoot td,
#scrollable-container .dataTables_scrollHead table.backoffice-data-table thead th,
#scrollable-container .dataTables_scrollBody table.backoffice-data-table tbody td,
#scrollable-container .dataTables_scrollFoot table.backoffice-data-table tfoot td {
    display: table-cell !important;
    position: static !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

#scrollable-container table.backoffice-data-table thead th {
    white-space: nowrap !important;
}

/* First column: action dropdown (not checkbox) */
#scrollable-container table.backoffice-data-table thead > tr > th:first-child:not(:has(input[type="checkbox"])),
#scrollable-container table.backoffice-data-table tbody > tr > td:first-child:not(:has(input[type="checkbox"])),
#scrollable-container .dataTables_scrollHead table.backoffice-data-table thead > tr > th:first-child:not(:has(input[type="checkbox"])),
#scrollable-container .dataTables_scrollBody table.backoffice-data-table tbody > tr > td:first-child:not(:has(input[type="checkbox"])) {
    min-width: 8.5rem !important;
    width: auto !important;
    max-width: none !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Action / dropdown cells anywhere in row */
#scrollable-container table.backoffice-data-table tbody td:has(.btn-group),
#scrollable-container table.backoffice-data-table tbody td:has(> .dropdown),
#scrollable-container .dataTables_scrollBody table.backoffice-data-table tbody td:has(.btn-group) {
    min-width: 8.5rem !important;
    white-space: nowrap !important;
}

/* Wide transaction / contact list tables */
#scrollable-container #sell_table,
#scrollable-container #expense_table {
    min-width: 105rem;
}

#scrollable-container #draft_table,
#scrollable-container #quotation_table {
    min-width: 68rem;
}

#scrollable-container #contact_table {
    min-width: 120rem;
}

#scrollable-container #stock_adjustment_table {
    min-width: 80rem;
}

#scrollable-container #sell_return_table {
    min-width: 80rem;
}

#scrollable-container #stock_transfer_table {
    min-width: 85rem;
}

#scrollable-container #purchase_return_datatable {
    min-width: 72rem;
}

#scrollable-container #discounts_table {
    min-width: 85rem;
}

#scrollable-container #invoice_table,
#scrollable-container #business_location_table {
    min-width: 60rem;
}

#scrollable-container #all_subscriptions_table {
    min-width: 90rem;
}

#scrollable-container #account_sub_type_table,
#scrollable-container #detail_type_table,
#scrollable-container #journal_table,
#scrollable-container #transfer_table,
#scrollable-container #ledger {
    min-width: 55rem;
}

#scrollable-container #transaction_expense_table {
    min-width: 105rem;
}

#scrollable-container #purchase_table {
    min-width: 80rem;
}

#scrollable-container #sell_payment_table,
#scrollable-container #purchase_payment_table {
    min-width: 65rem;
}

#scrollable-container #accounts_coa_table {
    min-width: 85rem;
}

#scrollable-container #assest_table {
    min-width: 100rem;
}

#scrollable-container #assest_allocated_table {
    min-width: 90rem;
}

#scrollable-container #assest_revoked_table {
    min-width: 85rem;
}

#scrollable-container #asset_maintenance_table {
    min-width: 80rem;
}

#scrollable-container #leads_table {
    min-width: 110rem;
}

#scrollable-container #lead_schedule_table,
#scrollable-container #follow_up_table,
#scrollable-container #recursive_follow_up_table {
    min-width: 85rem;
}

#scrollable-container #campaigns_table {
    min-width: 65rem;
}

#scrollable-container #contact_purchase_table,
#scrollable-container #contact_sell_table {
    min-width: 105rem;
}

#scrollable-container #all_contact_login_table,
#scrollable-container #contact_login_table {
    min-width: 60rem;
}

#scrollable-container #call_logs_table {
    min-width: 75rem;
}

#scrollable-container #commission_table {
    min-width: 80rem;
}

#scrollable-container #proposals {
    min-width: 65rem;
}

#scrollable-container #bookings_table {
    min-width: 55rem;
}

#scrollable-container #follow_ups_by_user_table,
#scrollable-container #follow_ups_by_contact_table {
    min-width: 70rem;
}

#scrollable-container #lead_to_customer_conversion,
#scrollable-container #all_users_call_log {
    min-width: 45rem;
}

#scrollable-container #superadmin_business_table {
    min-width: 120rem;
}

#scrollable-container #superadmin_business_table .bo-col-owner,
#scrollable-container .dataTables_scrollHead #superadmin_business_table .bo-col-owner,
#scrollable-container .dataTables_scrollBody #superadmin_business_table .bo-col-owner {
    min-width: 16rem !important;
    width: 16rem !important;
    max-width: none !important;
    white-space: normal !important;
}

#scrollable-container #superadmin_business_table .bo-col-address,
#scrollable-container .dataTables_scrollHead #superadmin_business_table .bo-col-address,
#scrollable-container .dataTables_scrollBody #superadmin_business_table .bo-col-address {
    min-width: 22rem !important;
    width: 22rem !important;
    max-width: none !important;
    white-space: normal !important;
}

#scrollable-container #superadmin_Coupons_table {
    min-width: 75rem;
}

#scrollable-container #superadmin_subscription_table {
    min-width: 95rem;
}

#scrollable-container #message-history {
    min-width: 50rem;
}

#scrollable-container #superadmin_business_table .sell-col-action,
#scrollable-container .dataTables_scrollHead #superadmin_business_table .sell-col-action,
#scrollable-container .dataTables_scrollBody #superadmin_business_table .sell-col-action,
#scrollable-container #superadmin_subscription_table .sell-col-action,
#scrollable-container .dataTables_scrollHead #superadmin_subscription_table .sell-col-action,
#scrollable-container .dataTables_scrollBody #superadmin_subscription_table .sell-col-action {
    min-width: 14rem !important;
    width: 14rem !important;
    max-width: none !important;
    white-space: normal !important;
    text-align: left !important;
}

#scrollable-container #task_table,
#scrollable-container #sales_target_table,
#scrollable-container #sales_targets_table,
#scrollable-container #documents_table,
#scrollable-container #memos_table,
#scrollable-container #my_payrolls {
    min-width: 55rem;
}

#scrollable-container #member_table {
    min-width: 85rem;
}

#scrollable-container #class_table,
#scrollable-container #package_table {
    min-width: 60rem;
}

#scrollable-container #subscription_table {
    min-width: 80rem;
}

#scrollable-container #health_table,
#scrollable-container #attendances_table {
    min-width: 55rem;
}

#scrollable-container #productions_table {
    min-width: 75rem;
}

#scrollable-container #recipe_table {
    min-width: 85rem;
}

#scrollable-container #my_task_table,
#scrollable-container #project_task_table {
    min-width: 90rem;
}

#scrollable-container #time_logs_table {
    min-width: 70rem;
}

#scrollable-container #project_invoice_table,
#scrollable-container #output_tax_project_invoice_table {
    min-width: 80rem;
}

#scrollable-container #documents_and_notes_table {
    min-width: 60rem;
}

#scrollable-container #pending_repair_table,
#scrollable-container #pending_job_sheets_table,
#scrollable-container #completed_job_sheets_table {
    min-width: 95rem;
}

#scrollable-container #status_table,
#scrollable-container #model_table {
    min-width: 50rem;
}

#scrollable-container #assest_table .sell-col-action,
#scrollable-container .dataTables_scrollHead #assest_table .sell-col-action,
#scrollable-container .dataTables_scrollBody #assest_table .sell-col-action,
#scrollable-container #assest_allocated_table .sell-col-action,
#scrollable-container .dataTables_scrollHead #assest_allocated_table .sell-col-action,
#scrollable-container .dataTables_scrollBody #assest_allocated_table .sell-col-action {
    min-width: 10rem !important;
    width: 10rem !important;
    max-width: none !important;
    white-space: normal !important;
    text-align: left !important;
}

#scrollable-container .budget-matrix-table,
#scrollable-container #trial_balance_table,
#scrollable-container #ar_ageing_report_table,
#scrollable-container #ap_ageing_report_table,
#scrollable-container #ar_ageing_details_table,
#scrollable-container #ap_ageing_details_table {
    min-width: 70rem;
}

#scrollable-container #budget_monthly_table {
    min-width: 90rem;
}

#scrollable-container .bo-static-table-scroll {
    width: 100%;
    max-height: 75vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

#scrollable-container .bo-static-table-scroll::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

#scrollable-container .bo-static-table-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

#scrollable-container .bo-static-table-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

/* Medium list tables */
#scrollable-container #variation_table,
#scrollable-container #unit_table,
#scrollable-container #category_table,
#scrollable-container #brands_table,
#scrollable-container #warranty_table,
#scrollable-container #selling_price_group_table,
#scrollable-container #customer_groups_table,
#scrollable-container #users_table,
#scrollable-container #roles_table,
#scrollable-container #sales_commission_agent_table {
    min-width: 48rem;
}

/* Date / ref columns on transaction tables */
#scrollable-container #sell_table .bo-col-date,
#scrollable-container #sell_table .bo-col-ref,
#scrollable-container #expense_table .bo-col-date,
#scrollable-container #expense_table .bo-col-ref,
#scrollable-container #draft_table .bo-col-date,
#scrollable-container #draft_table .bo-col-ref,
#scrollable-container #quotation_table .bo-col-date,
#scrollable-container #quotation_table .bo-col-ref,
#scrollable-container #stock_adjustment_table .bo-col-date,
#scrollable-container #stock_adjustment_table .bo-col-ref,
#scrollable-container #stock_transfer_table .bo-col-date,
#scrollable-container #stock_transfer_table .bo-col-ref,
#scrollable-container #sell_return_table .bo-col-date,
#scrollable-container #sell_return_table .bo-col-ref,
#scrollable-container #purchase_return_datatable .bo-col-date,
#scrollable-container #purchase_return_datatable .bo-col-ref {
    white-space: nowrap !important;
}

#scrollable-container table.backoffice-data-table .bo-col-amount {
    text-align: right !important;
    white-space: nowrap !important;
    min-width: 8rem !important;
}

#scrollable-container table.backoffice-data-table .bo-col-center {
    text-align: center !important;
    white-space: nowrap !important;
}

#scrollable-container table.backoffice-data-table .bo-col-name {
    min-width: 12rem !important;
    white-space: normal !important;
}

/* Contacts — suppliers / customers */
#scrollable-container #contact_table .contact-col-action,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-action,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-action {
    min-width: 8.5rem !important;
    width: 8.5rem !important;
    white-space: nowrap !important;
}

#scrollable-container #contact_table .contact-col-id,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-id,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-id {
    min-width: 7rem !important;
    white-space: nowrap !important;
}

#scrollable-container #contact_table .contact-col-business,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-business,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-business {
    min-width: 12rem !important;
    white-space: normal !important;
}

#scrollable-container #contact_table .contact-col-name,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-name,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-name {
    min-width: 10rem !important;
    white-space: normal !important;
}

#scrollable-container #contact_table .contact-col-email,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-email,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-email {
    min-width: 11rem !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

#scrollable-container #contact_table .contact-col-address,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-address,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-address {
    min-width: 20rem !important;
    width: 20rem !important;
    max-width: none !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
    text-align: left !important;
    vertical-align: top !important;
}

#scrollable-container #contact_table .contact-col-mobile,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-mobile,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-mobile {
    min-width: 9rem !important;
    white-space: nowrap !important;
}

#scrollable-container #contact_table .contact-col-date,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-date,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-date {
    min-width: 9.5rem !important;
    white-space: nowrap !important;
}

#scrollable-container #contact_table .contact-col-amount,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-amount,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-amount {
    min-width: 8.5rem !important;
    text-align: right !important;
    white-space: nowrap !important;
}

#scrollable-container #contact_table .contact-col-compact,
#scrollable-container .dataTables_scrollHead #contact_table .contact-col-compact,
#scrollable-container .dataTables_scrollBody #contact_table .contact-col-compact {
    min-width: 7.5rem !important;
    white-space: nowrap !important;
}

#scrollable-container #contact_table colgroup col.contact-col-address {
    width: 20rem !important;
}

/* Sales, expenses & stock adjustments — shared transaction list columns */
#scrollable-container #sell_table .sell-col-location,
#scrollable-container #expense_table .sell-col-location,
#scrollable-container #draft_table .sell-col-location,
#scrollable-container #quotation_table .sell-col-location,
#scrollable-container #stock_adjustment_table .sell-col-location,
#scrollable-container #stock_transfer_table .sell-col-location,
#scrollable-container #sell_return_table .sell-col-location,
#scrollable-container #discounts_table .sell-col-location,
#scrollable-container .dataTables_scrollHead #sell_table .sell-col-location,
#scrollable-container .dataTables_scrollHead #expense_table .sell-col-location,
#scrollable-container .dataTables_scrollHead #draft_table .sell-col-location,
#scrollable-container .dataTables_scrollHead #quotation_table .sell-col-location,
#scrollable-container .dataTables_scrollHead #stock_adjustment_table .sell-col-location,
#scrollable-container .dataTables_scrollHead #stock_transfer_table .sell-col-location,
#scrollable-container .dataTables_scrollHead #sell_return_table .sell-col-location,
#scrollable-container .dataTables_scrollHead #discounts_table .sell-col-location,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-location,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-location,
#scrollable-container .dataTables_scrollBody #draft_table .sell-col-location,
#scrollable-container .dataTables_scrollBody #quotation_table .sell-col-location,
#scrollable-container .dataTables_scrollBody #stock_adjustment_table .sell-col-location,
#scrollable-container .dataTables_scrollBody #stock_transfer_table .sell-col-location,
#scrollable-container .dataTables_scrollBody #sell_return_table .sell-col-location,
#scrollable-container .dataTables_scrollBody #discounts_table .sell-col-location {
    min-width: 14rem !important;
    width: 14rem !important;
    max-width: none !important;
    white-space: normal !important;
    text-align: left !important;
}

#scrollable-container #sell_table .sell-col-status,
#scrollable-container #expense_table .sell-col-status,
#scrollable-container #stock_adjustment_table .sell-col-status,
#scrollable-container #stock_transfer_table .sell-col-status,
#scrollable-container #sell_return_table .sell-col-status,
#scrollable-container .dataTables_scrollHead #sell_table .sell-col-status,
#scrollable-container .dataTables_scrollHead #expense_table .sell-col-status,
#scrollable-container .dataTables_scrollHead #stock_adjustment_table .sell-col-status,
#scrollable-container .dataTables_scrollHead #stock_transfer_table .sell-col-status,
#scrollable-container .dataTables_scrollHead #sell_return_table .sell-col-status,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-status,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-status,
#scrollable-container .dataTables_scrollBody #stock_adjustment_table .sell-col-status,
#scrollable-container .dataTables_scrollBody #stock_transfer_table .sell-col-status,
#scrollable-container .dataTables_scrollBody #sell_return_table .sell-col-status {
    min-width: 7rem !important;
    width: 8rem !important;
    max-width: 8.5rem !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#scrollable-container #sell_table .sell-col-shipping-status,
#scrollable-container .dataTables_scrollHead #sell_table .sell-col-shipping-status,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-shipping-status,
#scrollable-container #expense_table .sell-col-shipping-status,
#scrollable-container .dataTables_scrollHead #expense_table .sell-col-shipping-status,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-shipping-status {
    min-width: 7.5rem !important;
    width: 8.5rem !important;
    max-width: 9rem !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#scrollable-container #sell_table .sell-col-added-by,
#scrollable-container #expense_table .sell-col-added-by,
#scrollable-container #draft_table .sell-col-added-by,
#scrollable-container #quotation_table .sell-col-added-by,
#scrollable-container #stock_adjustment_table .sell-col-added-by,
#scrollable-container .dataTables_scrollHead #sell_table .sell-col-added-by,
#scrollable-container .dataTables_scrollHead #expense_table .sell-col-added-by,
#scrollable-container .dataTables_scrollHead #draft_table .sell-col-added-by,
#scrollable-container .dataTables_scrollHead #quotation_table .sell-col-added-by,
#scrollable-container .dataTables_scrollHead #stock_adjustment_table .sell-col-added-by,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-added-by,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-added-by,
#scrollable-container .dataTables_scrollBody #draft_table .sell-col-added-by,
#scrollable-container .dataTables_scrollBody #quotation_table .sell-col-added-by,
#scrollable-container .dataTables_scrollBody #stock_adjustment_table .sell-col-added-by {
    min-width: 10rem !important;
    width: 10rem !important;
    max-width: none !important;
    white-space: nowrap !important;
    text-align: left !important;
}

#scrollable-container #sell_table .sell-col-customer,
#scrollable-container #expense_table .sell-col-customer,
#scrollable-container #draft_table .sell-col-customer,
#scrollable-container #quotation_table .sell-col-customer,
#scrollable-container #sell_return_table .sell-col-customer,
#scrollable-container #discounts_table .sell-col-customer,
#scrollable-container .dataTables_scrollHead #sell_table .sell-col-customer,
#scrollable-container .dataTables_scrollHead #expense_table .sell-col-customer,
#scrollable-container .dataTables_scrollHead #draft_table .sell-col-customer,
#scrollable-container .dataTables_scrollHead #quotation_table .sell-col-customer,
#scrollable-container .dataTables_scrollHead #sell_return_table .sell-col-customer,
#scrollable-container .dataTables_scrollHead #discounts_table .sell-col-customer,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-customer,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-customer,
#scrollable-container .dataTables_scrollBody #draft_table .sell-col-customer,
#scrollable-container .dataTables_scrollBody #quotation_table .sell-col-customer,
#scrollable-container .dataTables_scrollBody #sell_return_table .sell-col-customer,
#scrollable-container .dataTables_scrollBody #discounts_table .sell-col-customer {
    min-width: 11rem !important;
    white-space: normal !important;
}

#scrollable-container #sell_table .sell-col-notes,
#scrollable-container #expense_table .sell-col-notes,
#scrollable-container #stock_adjustment_table .sell-col-notes,
#scrollable-container #stock_transfer_table .sell-col-notes,
#scrollable-container #discounts_table .sell-col-notes,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-notes,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-notes,
#scrollable-container .dataTables_scrollBody #stock_adjustment_table .sell-col-notes,
#scrollable-container .dataTables_scrollBody #stock_transfer_table .sell-col-notes,
#scrollable-container .dataTables_scrollBody #discounts_table .sell-col-notes {
    min-width: 12rem !important;
    white-space: normal !important;
}

#scrollable-container #sell_table .sell-col-date,
#scrollable-container #sell_table .sell-col-ref,
#scrollable-container #sell_table .sell-col-mobile,
#scrollable-container #sell_table .sell-col-compact,
#scrollable-container #expense_table .sell-col-date,
#scrollable-container #expense_table .sell-col-ref,
#scrollable-container #expense_table .sell-col-compact,
#scrollable-container #draft_table .sell-col-date,
#scrollable-container #draft_table .sell-col-ref,
#scrollable-container #draft_table .sell-col-mobile,
#scrollable-container #draft_table .sell-col-compact,
#scrollable-container #quotation_table .sell-col-date,
#scrollable-container #quotation_table .sell-col-ref,
#scrollable-container #quotation_table .sell-col-mobile,
#scrollable-container #quotation_table .sell-col-compact,
#scrollable-container #sell_return_table .sell-col-date,
#scrollable-container #sell_return_table .sell-col-ref,
#scrollable-container #discounts_table .sell-col-date,
#scrollable-container #discounts_table .sell-col-compact,
#scrollable-container #stock_adjustment_table .sell-col-date,
#scrollable-container #stock_adjustment_table .sell-col-ref,
#scrollable-container #stock_transfer_table .sell-col-date,
#scrollable-container #stock_transfer_table .sell-col-ref,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-date,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-ref,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-mobile,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-compact,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-date,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-ref,
#scrollable-container .dataTables_scrollBody #expense_table .sell-col-compact,
#scrollable-container .dataTables_scrollBody #draft_table .sell-col-date,
#scrollable-container .dataTables_scrollBody #draft_table .sell-col-ref,
#scrollable-container .dataTables_scrollBody #draft_table .sell-col-mobile,
#scrollable-container .dataTables_scrollBody #draft_table .sell-col-compact,
#scrollable-container .dataTables_scrollBody #quotation_table .sell-col-date,
#scrollable-container .dataTables_scrollBody #quotation_table .sell-col-ref,
#scrollable-container .dataTables_scrollBody #quotation_table .sell-col-mobile,
#scrollable-container .dataTables_scrollBody #quotation_table .sell-col-compact,
#scrollable-container .dataTables_scrollBody #sell_return_table .sell-col-date,
#scrollable-container .dataTables_scrollBody #sell_return_table .sell-col-ref,
#scrollable-container .dataTables_scrollBody #discounts_table .sell-col-date,
#scrollable-container .dataTables_scrollBody #discounts_table .sell-col-compact,
#scrollable-container .dataTables_scrollBody #stock_adjustment_table .sell-col-date,
#scrollable-container .dataTables_scrollBody #stock_adjustment_table .sell-col-ref,
#scrollable-container .dataTables_scrollBody #stock_transfer_table .sell-col-date,
#scrollable-container .dataTables_scrollBody #stock_transfer_table .sell-col-ref {
    white-space: nowrap !important;
}

#scrollable-container #sell_table .sell-col-payment-method,
#scrollable-container .dataTables_scrollBody #sell_table .sell-col-payment-method {
    min-width: 9rem !important;
    white-space: normal !important;
}

/* Horizontal scroll buttons — fixed on header row, independent of column scroll */
#scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .dataTables_scroll.bo-table-scroll-anchor {
    position: relative;
}

#scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .bo-table-scroll-nav {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 2.75rem;
    z-index: 8;
    pointer-events: none;
    margin: 0;
}

#scrollable-container .dataTables_wrapper.bo-table-scrollable .bo-table-scroll-nav {
    display: block;
}

#scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .bo-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.96);
    color: #334155;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .bo-scroll-left {
    left: 0.4rem;
    right: auto;
}

#scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .bo-scroll-right {
    right: 0.4rem;
    left: auto;
}

#scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .bo-scroll-btn:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

#scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .bo-scroll-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#scrollable-container .dataTables_wrapper.bo-table-scrollable.bo-can-scroll-left .dataTables_scrollBody {
    box-shadow: inset 12px 0 10px -10px rgba(15, 23, 42, 0.12);
}

#scrollable-container .dataTables_wrapper.bo-table-scrollable.bo-can-scroll-right .dataTables_scrollBody {
    box-shadow: inset -12px 0 10px -10px rgba(15, 23, 42, 0.12);
}

#scrollable-container .dataTables_wrapper.bo-table-scrollable.bo-can-scroll-left.bo-can-scroll-right .dataTables_scrollBody {
    box-shadow:
        inset 12px 0 10px -10px rgba(15, 23, 42, 0.12),
        inset -12px 0 10px -10px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] #scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .bo-scroll-btn {
    background: rgba(30, 41, 59, 0.92);
    border-color: var(--ot-border, #334155);
    color: var(--ot-text, #e2e8f0);
}

[data-theme="dark"] #scrollable-container .dataTables_wrapper.bo-table-has-scroll-nav .bo-scroll-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
    color: #93c5fd;
}

#scrollable-container #invoice_table .sell-col-action,
#scrollable-container .dataTables_scrollHead #invoice_table .sell-col-action,
#scrollable-container .dataTables_scrollBody #invoice_table .sell-col-action {
    min-width: 18rem !important;
    width: 18rem !important;
    max-width: none !important;
    white-space: normal !important;
    text-align: left !important;
}

/* Reports section — match purchases / back-office list tables */
#scrollable-container #supplier_report_tbl,
#scrollable-container #stock_report_table,
#scrollable-container #register_report_table,
#scrollable-container #stock_expiry_report_table,
#scrollable-container #product_purchase_report_table,
#scrollable-container #product_sell_report_table {
    min-width: 115rem;
}

#scrollable-container #product_sell_report_with_purchase_table,
#scrollable-container #product_sell_grouped_report_table,
#scrollable-container #product_sell_report_by_category,
#scrollable-container #product_sell_report_by_brand,
#scrollable-container #lot_report,
#scrollable-container #purchase_payment_report_table,
#scrollable-container #sell_payment_report_table,
#scrollable-container #items_report_table,
#scrollable-container #sale_report_table,
#scrollable-container #purchase_report_table,
#scrollable-container #gst_purchase_report,
#scrollable-container #gst_sales_report,
#scrollable-container #service_staff_report,
#scrollable-container #service_staff_line_orders,
#scrollable-container #sr_sales_report,
#scrollable-container #sr_expenses_report,
#scrollable-container #sr_sales_with_commission_table,
#scrollable-container #sr_payments_with_commission_table {
    min-width: 80rem;
}

#scrollable-container #input_tax_table,
#scrollable-container #output_tax_table,
#scrollable-container #expense_tax_table,
#scrollable-container #cg_report_table,
#scrollable-container #table_report,
#scrollable-container #activity_log_table,
#scrollable-container #expense_report_table,
#scrollable-container #profit_by_products_table,
#scrollable-container #profit_by_categories_table,
#scrollable-container #profit_by_brands_table,
#scrollable-container #profit_by_locations_table,
#scrollable-container #profit_by_invoice_table,
#scrollable-container #profit_by_date_table,
#scrollable-container #profit_by_customer_table,
#scrollable-container #profit_by_day_table,
#scrollable-container #profit_by_service_staff_table {
    min-width: 55rem;
}

#scrollable-container section.content .table-responsive:has(table.backoffice-data-table) {
    overflow: visible;
}

/* Action dropdowns floated to body from scrollable DataTables (drafts, quotations, list POS, etc.) */
.dropdown-menu.bo-table-dropdown-menu {
    z-index: 1060 !important;
    min-width: 12rem;
    border: 1px solid var(--ot-border, #e2e8f0) !important;
    border-radius: var(--ot-radius-sm, 6px) !important;
    box-shadow: var(--ot-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)) !important;
    padding: 6px 0 !important;
    background: var(--ot-surface, #fff) !important;
    margin: 0 !important;
}

.dropdown-menu.bo-table-dropdown-menu > li > a {
    padding: 8px 16px !important;
    color: var(--ot-text, #334155) !important;
    white-space: nowrap;
}

.dropdown-menu.bo-table-dropdown-menu > li > a:hover,
.dropdown-menu.bo-table-dropdown-menu > li > a:focus {
    background: var(--ot-surface-muted, #f1f5f9) !important;
    color: var(--ot-primary, #2563eb) !important;
}

.dropdown-menu.bo-table-dropdown-menu > li.divider {
    margin: 6px 0;
    background-color: var(--ot-border, #e2e8f0);
}

.dropdown-menu.bo-table-dropdown-menu > li > a > i,
.dropdown-menu.bo-table-dropdown-menu > li > a > .fas,
.dropdown-menu.bo-table-dropdown-menu > li > a > .fa {
    margin-right: 6px;
    width: 1.1em;
    text-align: center;
}

#scrollable-container section.content table.backoffice-data-table tfoot tr.footer-total,
#scrollable-container section.content table.backoffice-data-table tfoot tr.bg-gray {
    background-color: #f4f4f4;
    font-weight: 600;
}
