/* ═══ Global Checkbox — No black tick, BillPosware green project-wide ═══ */
input[type="checkbox"] {
    accent-color: #4CAF50 !important;
}
input[type="radio"] {
    accent-color: #4CAF50 !important;
}

/* ===== Validation error — below field, prominent (not in box, not small) ===== */
label.error,
.bp-validation-error {
    display: block !important;
    margin: 8px 0 0 0 !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #dc2626 !important;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 10px !important;
    line-height: 1.4 !important;
}

/* Khmer font: Noto Sans Khmer (Google Fonts) - renders Khmer script correctly */
.bp-font-khmer {
    font-family: 'Noto Sans Khmer', 'Battambang', 'Khmer OS Content', sans-serif !important;
}

/* ═══ Checkbox Tick — Print Kot style (green checked, white checkmark) ═══
   Use for native checkboxes without iCheck. Same look as SmartMenu checkout-tick.
   HTML: <label class="bp-checkbox-tick"><input type="checkbox" class="bp-tick-input"><span class="bp-tick-box"></span><span class="bp-tick-label">Label</span></label> */
.bp-checkbox-tick {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    transition: transform 0.2s ease;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif;
}
.bp-checkbox-tick:hover { transform: translateY(-1px); }
.bp-checkbox-tick:active { transform: scale(0.98); }
.bp-tick-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.bp-tick-box {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    position: relative;
}
.bp-tick-box::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 7px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    left: 50%;
    top: 50%;
    margin-left: -7px;
    margin-top: -5px;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bp-tick-input:checked + .bp-tick-box {
    background: #4CAF50;
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.35);
}
.bp-tick-input:checked + .bp-tick-box::after {
    transform: rotate(-45deg) scale(1);
}
.bp-tick-input:focus-visible + .bp-tick-box {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}
.bp-tick-label {
    user-select: none;
    color: #6B7280;
    transition: color 0.2s ease;
}
.bp-tick-input:checked ~ .bp-tick-label { color: #374151; }

/* Fix legacy AdminLTE content-wrapper inside new flex layout.
   Without this, pages that still use .content-wrapper get double left offset. */
#scrollable-container > .content-wrapper,
#scrollable-container .content-wrapper {
    margin-left: 0 !important;
    min-height: auto !important;
}

/* Global standard spacing for all Admin pages (full project).
   Applies to legacy pages that use .content-wrapper + .content-header/.content sections. */
#scrollable-container > .content-wrapper {
    padding: 0 !important;
}
#scrollable-container > .content-wrapper .content-header {
    padding: 18px 20px 0 !important;
}
#scrollable-container > .content-wrapper .content {
    margin: 0 !important;
    padding: 0 20px 20px !important;
}

/* Also cover pages that render content sections directly (no .content-wrapper),
   e.g. Accounting reports: Profit & Loss, Balance Sheet, A/P Aging, A/R Aging. */
#scrollable-container > .content-header {
    padding: 18px 20px 0 !important;
}
#scrollable-container > .content {
    margin: 0 !important;
    padding: 0 20px 20px !important;
}

@media (max-width: 768px) {
    #scrollable-container > .content-wrapper .content-header {
        padding: 12px 14px 0 !important;
    }
    #scrollable-container > .content-wrapper .content {
        padding: 0 14px 14px !important;
    }
    #scrollable-container > .content-header {
        padding: 12px 14px 0 !important;
    }
    #scrollable-container > .content {
        padding: 0 14px 14px !important;
    }
}

/* Sidebar submenu normalization (covers Accounting and any remaining groups
   even if module-specific CSS overrides exist). */
#main-sidebar .bp-nav .nav-group.open > .nav-sub {
    padding-left: 6px !important;
}
#main-sidebar .bp-nav .nav-sub .nav-sub-item {
    padding: 9px 12px !important;
}
#main-sidebar .bp-nav .nav-sub .nav-sub-item::before {
    left: 4px !important;
    right: 4px !important;
}

/* Fine-tune submenu alignment (HR & KPI / Attendance and similar groups) */
#main-sidebar .bp-nav .nav-group.open > .nav-sub {
    padding-left: 0 !important;
}
#main-sidebar .bp-nav .nav-group.open .nav-sub .nav-sub-item:hover {
    /* one-shot "peek": slide right then return (even if still hovering) */
    animation: bpSidebarPeek .48s cubic-bezier(0.34,1.56,0.64,1) 1 both !important;
    color: #4CAF50 !important;
}
#main-sidebar .bp-nav .nav-sub .nav-sub-item.active {
    transform: translateX(0) !important;
}

/* Fine-tune top-level menu alignment (e.g. Target Setting and similar items) */
#main-sidebar .bp-nav .nav-item,
#main-sidebar .bp-nav .nav-item-parent {
    padding: 9px 12px !important;
}
#main-sidebar .bp-nav .nav-item::before,
#main-sidebar .bp-nav .nav-item-parent::before {
    left: 4px !important;
    right: 4px !important;
}
#main-sidebar .bp-nav .nav-item:hover,
#main-sidebar .bp-nav .nav-item-parent:hover {
    /* one-shot "peek": slide right then return (even if still hovering) */
    animation: bpSidebarPeek .48s cubic-bezier(0.34,1.56,0.64,1) 1 both !important;
    color: #4CAF50 !important;
}
#main-sidebar .bp-nav .nav-item.active,
#main-sidebar .bp-nav .nav-item-parent.active {
    transform: translateX(0) !important;
}

/* Sidebar hover motion: right → back to normal (no loop) */
@keyframes bpSidebarPeek {
    0% { transform: translateX(0); }
    45% { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

/* Sidebar (actual container id is #side-bar) — same hover peek behavior */
#side-bar .bp-nav .nav-item:hover,
#side-bar .bp-nav .nav-item-parent:hover,
#side-bar .bp-nav .nav-sub .nav-sub-item:hover,
#side-bar .bp-nav .nav-group.open .nav-sub .nav-sub-item:hover {
    animation: bpSidebarPeek .48s cubic-bezier(0.34,1.56,0.64,1) 1 both !important;
    color: #4CAF50 !important;
    transform: none !important; /* let animation control transform */
}

/* Extra guard for legacy report/accounting pages where sections may be wrapped
   in additional containers (not direct children). */
#scrollable-container .content-header {
    padding: 18px 20px 0 !important;
}
#scrollable-container .content {
    margin: 0 !important;
    padding: 0 20px 20px !important;
}
@media (max-width: 768px) {
    #scrollable-container .content-header {
        padding: 12px 14px 0 !important;
    }
    #scrollable-container .content {
        padding: 0 14px 14px !important;
    }
}

/* ===== Global input visibility guard (Mac/Chrome dark autofill fix) =====
   Keep form fields readable across OS/browser color-scheme differences. */
html,
body {
    color-scheme: light !important;
}

input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='file']),
textarea,
select,
.form-control {
    background-color: #ffffff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    caret-color: #111827 !important;
}

/* Standard placeholder — faded/muted (not bold), per UX best practice */
input::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: #9ca3af !important;
    -webkit-text-fill-color: #9ca3af !important;
    opacity: 1 !important;
}
input::-webkit-input-placeholder { color: #9ca3af !important; -webkit-text-fill-color: #9ca3af !important; }
input::-moz-placeholder { color: #9ca3af !important; opacity: 1; }
input:-ms-input-placeholder { color: #9ca3af !important; }
textarea::-webkit-input-placeholder { color: #9ca3af !important; -webkit-text-fill-color: #9ca3af !important; }
textarea::-moz-placeholder { color: #9ca3af !important; opacity: 1; }
textarea:-ms-input-placeholder { color: #9ca3af !important; }
.form-control::-webkit-input-placeholder { color: #9ca3af !important; -webkit-text-fill-color: #9ca3af !important; }
.form-control::-moz-placeholder { color: #9ca3af !important; opacity: 1; }
.form-control:-ms-input-placeholder { color: #9ca3af !important; }

/* Select2 "Please Select" — placeholder style (faded) */
.select2-container--default .select2-selection--single .select2-selection__placeholder,
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #9ca3af !important;
}

/* ===== BillPosware standard: icon field — icon left with gray bg ===== */
.bp-field-icon {
    display: flex !important;
    align-items: stretch !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    min-height: 48px !important;
    background: #fff !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.bp-field-icon:focus-within {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12) !important;
}
.bp-field-icon .bp-fi {
    width: 48px !important;
    min-width: 48px !important;
    background: #f3f4f6 !important;
    color: #6B7280 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    border-right: 1px solid #e5e7eb !important;
    border-radius: 9px 0 0 9px !important;
    pointer-events: none;
}
.bp-field-icon .form-control {
    border: none !important;
    border-radius: 0 10px 10px 0 !important;
    padding: 12px 14px !important;
    flex: 1 !important;
    min-width: 0 !important;
    min-height: 46px !important;
    font-size: 14px !important;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif !important;
}
.bp-field-icon .form-control:focus {
    box-shadow: none !important;
}
.bp-field-icon.bp-field-dds .select2-container .select2-selection--single,
.bp-field-icon.bp-field-dds .select2-container .select2-selection--multiple {
    border: none !important;
}
.bp-field-icon.bp-field-dds .bp-dds-wrap .select2-container .select2-selection--single {
    border-radius: 10px 0 0 10px !important;
}
.bp-field-icon.bp-field-dds .bp-dds-add {
    border-radius: 0 10px 10px 0 !important;
}
.bp-field-icon .bp-scan-addon {
    border-radius: 0 10px 10px 0 !important;
}

/* Standalone form field (no icon) — BillPosware standard */
.bp-field .form-control {
    height: 48px !important;
    border-radius: 10px !important;
    border: 1px solid #d1d5db !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif !important;
}
.bp-field .form-control:focus {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12) !important;
}

/* Product form: no broken line — form-control & bp-margin-display full-width, no divider */
#product_add_form .bp-field-icon .bp-fi {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}
#product_add_form .bp-field-icon .form-control,
#product_add_form .bp-field-icon .bp-margin-display {
    border-radius: 10px !important;
    border-left: none !important;
    padding-left: 14px !important;
}
#product_add_form .bp-field-dds .bp-dds-wrap .select2-container .select2-selection--single,
#product_add_form .bp-field-dds .bp-dds-wrap .select2-container .select2-selection--multiple {
    border-radius: 10px 0 0 10px !important;
}
#product_add_form .bp-field-dds .bp-dds-wrap:not(:has(.bp-dds-add)) .select2-container .select2-selection--single,
#product_add_form .bp-field-dds .bp-dds-wrap:not(:has(.bp-dds-add)) .select2-container .select2-selection--multiple {
    border-radius: 10px !important;
}

/* First / Second Conversion Unit — single line only (title + all fields in one row, label + input inline) */
.fu-su-single-line .fu-su-single-line-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.fu-su-single-line .fu-su-title {
    flex-shrink: 0;
    color: #6b7280;
    font-size: 14px;
    margin-right: 4px;
}
.fu-su-single-line .fu-su-fields {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.fu-su-single-line .fu-su-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-bottom: 0;
    flex-shrink: 0;
    min-width: 0;
}
.fu-su-single-line .fu-su-field .fu-su-label {
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}
.fu-su-single-line .fu-su-field .form-control,
.fu-su-single-line .fu-su-field .bp-field-icon {
    min-width: 64px;
}
.fu-su-single-line .fu-su-field .bp-field-icon {
    flex: 1;
    min-width: 64px;
}
.fu-su-single-line .fu-su-field .bp-field-icon .form-control {
    width: 100%;
}

/* Install wizard bp-input-group — remove left icon */
.bp-input-group .bp-addon {
    display: none !important;
}
.bp-input-group .bp-control {
    border-radius: 10px !important;
    padding-left: 14px !important;
}
/* Custom dropdown triggers — remove left icon */
.bp-dds-trigger .bp-dds-icon,
.mp-qr-trigger .mp-qr-icon {
    display: none !important;
}
.bp-dds-trigger .bp-dds-label,
.mp-qr-trigger .mp-qr-label {
    padding-left: 14px !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active,
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-text-fill-color: #111827 !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    caret-color: #111827 !important;
    transition: background-color 5000s ease-in-out 0s;
}
body,
p,
span,
div,
table tr td,
h1,
h2,
h3,
h4,
h5,
h6,
.dataTable,
tbody,
th,
td,
b,
.modal {
    font-family: 'Noto Sans Khmer', 'Battambang', 'Khmer OS Content', 'Segoe UI', Inter, ui-sans-serif, system-ui, sans-serif,
        Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}
/* ═══ BillPosware Modal Branding — Green header, rounded, branded buttons ═══ */
.modal.in .modal-dialog,
.modal.show .modal-dialog {
    animation: bpModalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes bpModalIn {
    0%   { opacity: 0; transform: scale(0.94) translateY(16px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-content {
    border-radius: 14px !important;
    border: none !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18) !important;
    overflow: hidden !important;
}
.modal-header {
    background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
    color: #fff !important;
    border-bottom: none !important;
    padding: 18px 24px !important;
}
.modal-header .modal-title {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 17px !important;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif !important;
}
.modal-header .modal-title i {
    color: rgba(255, 255, 255, 0.95) !important;
    margin-right: 10px;
    font-size: 16px;
}
.modal-header .close {
    color: #fff !important;
    opacity: 1 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}
.modal-header .close:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}
.modal-header .close span {
    font-size: 20px !important;
    line-height: 1 !important;
}
.modal-body {
    background: #fff !important;
    padding: 24px !important;
}
/* Modal form controls (BillPosware branded) */
.modal-body .form-control {
    height: 48px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 12px 14px;
    font-size: 14px;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif;
}
.modal-body .form-control:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}
.modal-body .form-group label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
/* Modal option-div (format cards — BillPosware green) */
.modal-body .option-div {
    padding: 16px;
    background: #f0fdf4;
    color: #334155;
    border: 2px solid #bbf7d0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.modal-body .option-div:hover {
    border-color: #4CAF50;
    background: #dcfce7;
}
.modal-body .option-div-group .option-div.active,
.modal-body .option-div-group .option-div:has(input:checked) {
    border-color: #4CAF50;
    background: #dcfce7;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}
.modal-body .option-div-group .icon {
    color: #4CAF50;
}
.modal-body .input-group-addon {
    background: #f3f4f6 !important;
    color: #6B7280 !important;
    border: 1px solid #d1d5db;
    border-radius: 10px 0 0 10px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-body .input-group .form-control {
    border-radius: 0 10px 10px 0;
    height: 48px;
}
.modal-footer {
    background: #fff !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 14px 20px !important;
}
.modal-footer .btn-default {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
}
.modal-footer .btn-default:hover {
    background: #e5e7eb !important;
}
.modal-footer .btn-danger {
    background: #dc2626 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
}
.modal-footer .btn-danger:hover {
    background: #b91c1c !important;
}
.modal-footer .btn-primary {
    background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
}
.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #66BB6A, #4CAF50) !important;
}
/* Modal tw-dw-btn overrides (BillPosware green for Save, grey for Close) */
.modal-footer .tw-dw-btn-primary {
    background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
}
.modal-footer .tw-dw-btn-primary:hover {
    background: linear-gradient(135deg, #66BB6A, #4CAF50) !important;
    color: #fff !important;
}
.modal-footer .tw-dw-btn-neutral {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
}
.modal-footer .tw-dw-btn-neutral:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}
/* Modal password field with padlock icon */
.modal-body .bp-modal-password-wrap {
    display: flex;
    align-items: stretch;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
}
.modal-body .bp-modal-password-wrap .bp-modal-password-icon {
    width: 42px;
    min-width: 42px;
    background: #f3f4f6;
    color: #4CAF50;
    border-right: 1px solid #e5e7eb;
    border-radius: 9px 0 0 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-body .bp-modal-password-wrap input {
    border: none;
    border-radius: 0 10px 10px 0;
    padding: 10px 14px;
    flex: 1;
}
.modal-body .bp-modal-password-wrap:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}
.dataTable tbody,
table tbody {
    font-size: clamp(12px, 0.8rem + 0.3vw, 15px);
}
aside.side-bar {
    position: sticky;
    height: 100vh;
}
/* ═══ BillPosware Swipe Technology — No Scrollbars, Touch Swipe Only ═══ */
/* Vertical & Horizontal scroll via touch/swipe — scrollbar hidden globally for scroll containers */
aside.side-bar div,
.dataTables_scrollBody,
.dataTables_scroll,
.dataTables_scrollHead,
.dataTables_scrollFoot,
.bp-table-card .dataTables_scrollBody,
.bp-table-card .dataTables_scroll,
.bp-docs-card .dataTables_scrollBody,
.bp-docs-card .bp-table-body,
#contact_ledger_div,
.bp-col-vis-panel,
.bp-col-vis-panel-inner,
.select2-container--default .select2-results__options,
.category-grid,
.brand-grid,
.table-status-scroll,
.product-grid,
.cart-list,
.smart-menu-left-nav,
.smart-menu-sidebar,
.invoice-list-modal-body,
.bp-dropdown-search-list,
.order-edit-dropdown-customer-list,
.table-service-grid,
.reservation-view .reservation-grid,
.table-management-view .table-mgmt-grid,
.tax-setting-view .tax-list-wrap,
.driver-management-view .driver-list-wrap,
.driver-dashboard-view,
.exchange-rate-view,
.invoice-setting-view,
.driver-form-modal-box,
.khqr-upload-modal .khqr-upload-box,
#upload-qr-modal .modal-box,
.bp-filter-panel .bp-filter-grid,
.order-type-tabs,
.checkout-receipt-options-swipe,
.bp-tabs-nav,
.pos-right-wrapper .pos-sidebar-scroll-area,
#contact_payments_div,
.bp-table-body .dataTables_scroll,
.bp-table-body .dataTables_scrollBody,
.bp-table-body .dataTables_scrollHead,
.table-responsive {
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
aside.side-bar div::-webkit-scrollbar,
.dataTables_scrollBody::-webkit-scrollbar,
.dataTables_scroll::-webkit-scrollbar,
.dataTables_scrollHead::-webkit-scrollbar,
.dataTables_scrollFoot::-webkit-scrollbar,
.bp-table-card .dataTables_scrollBody::-webkit-scrollbar,
.bp-table-card .dataTables_scroll::-webkit-scrollbar,
.bp-docs-card .dataTables_scrollBody::-webkit-scrollbar,
.bp-docs-card .bp-table-body::-webkit-scrollbar,
#contact_ledger_div::-webkit-scrollbar,
.bp-col-vis-panel::-webkit-scrollbar,
.bp-col-vis-panel-inner::-webkit-scrollbar,
.select2-container--default .select2-results__options::-webkit-scrollbar,
.category-grid::-webkit-scrollbar,
.brand-grid::-webkit-scrollbar,
.table-status-scroll::-webkit-scrollbar,
.product-grid::-webkit-scrollbar,
.cart-list::-webkit-scrollbar,
.smart-menu-left-nav::-webkit-scrollbar,
.smart-menu-sidebar::-webkit-scrollbar,
.invoice-list-modal-body::-webkit-scrollbar,
.bp-dropdown-search-list::-webkit-scrollbar,
.order-edit-dropdown-customer-list::-webkit-scrollbar,
.table-service-grid::-webkit-scrollbar,
.reservation-view .reservation-grid::-webkit-scrollbar,
.table-management-view .table-mgmt-grid::-webkit-scrollbar,
.tax-setting-view .tax-list-wrap::-webkit-scrollbar,
.driver-management-view .driver-list-wrap::-webkit-scrollbar,
.driver-dashboard-view::-webkit-scrollbar,
.exchange-rate-view::-webkit-scrollbar,
.invoice-setting-view::-webkit-scrollbar,
.driver-form-modal-box::-webkit-scrollbar,
.khqr-upload-modal .khqr-upload-box::-webkit-scrollbar,
#upload-qr-modal .modal-box::-webkit-scrollbar,
.bp-filter-panel .bp-filter-grid::-webkit-scrollbar,
.order-type-tabs::-webkit-scrollbar,
.checkout-receipt-options-swipe::-webkit-scrollbar,
.bp-tabs-nav::-webkit-scrollbar,
.pos-right-wrapper .pos-sidebar-scroll-area::-webkit-scrollbar,
#contact_payments_div::-webkit-scrollbar,
.modal-box::-webkit-scrollbar,
.settings-iframe-modal-box::-webkit-scrollbar,
.tax-form-modal-box::-webkit-scrollbar,
.table-form-modal-box::-webkit-scrollbar,
.reservation-modal-box::-webkit-scrollbar,
.reservation-details-modal-box::-webkit-scrollbar,
.table-info-modal-box::-webkit-scrollbar,
.invoice-list-modal-box::-webkit-scrollbar,
#settings-iframe::-webkit-scrollbar,
.bp-table-body .dataTables_scroll::-webkit-scrollbar,
.bp-table-body .dataTables_scrollBody::-webkit-scrollbar,
.bp-table-body .dataTables_scrollHead::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
/* Horizontal swipe containers */
.bp-filter-panel .bp-filter-grid,
.order-type-tabs,
.checkout-receipt-options-swipe,
.category-grid,
.brand-grid,
.table-status-scroll,
.cat-tabs,
.bp-sub-menu {
    touch-action: pan-x !important;
}
/* Vertical swipe containers */
aside.side-bar div,
.dataTables_scrollBody,
.product-grid,
.cart-list,
.smart-menu-left-nav,
.smart-menu-sidebar,
.table-service-grid,
.reservation-view .reservation-grid,
.table-management-view .table-mgmt-grid,
.bp-col-vis-panel,
.select2-container--default .select2-results__options,
#contact_ledger_div,
#contact_payments_div {
    touch-action: pan-x pan-y !important;
}
/* Both directions */
#scrollable-container,
.tax-setting-view .tax-list-wrap,
.driver-management-view .driver-list-wrap,
.bp-table-body .dataTables_scrollBody,
.table-responsive {
    touch-action: pan-x pan-y !important;
}

#scrollable-container {
    flex: unset !important;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}
#scrollable-container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
#scrollable-container.bp-main-dragging {
    cursor: grabbing;
    user-select: none;
}
#scrollable-container.bp-main-dragging * {
    pointer-events: none;
}

/* Filter dropdown when floated to body (Product, Sell, Purchase, etc.) — above card/scroll */
.bp-filter-dropdown-floating {
    z-index: 102001 !important;
}
/* ═══ BillPosware Action Dropdown Standard (Source of Truth)
   Sales, Purchase, Purchase Order, Contact, Expense — កែទីនេះ = កែទាំងអស់
   HTML: <div class="btn-group" data-bp-*-action><button data-bp-*-action-trigger><i class="fas fa-ellipsis-v"></i></button><ul class="dropdown-menu bp-expense-dropdown">...</ul></div>
   JS: Append to #bp-action-dropdown-portal, position fixed, close on outside click ═══ */

/* Action column: overflow visible, btn-group z-index */
.bp-table-card table tbody td:first-child,
.bp-table-card .dataTables_scrollBody td:first-child { overflow: visible !important; }
.bp-table-card table tbody tr .btn-group,
.bp-table-card .dataTables_scrollBody tr .btn-group { position: relative; z-index: 1; }
.bp-table-card table tbody tr .btn-group.open,
.bp-table-card .dataTables_scrollBody tr .btn-group.open { z-index: 100; }

/* Trigger button */
.bp-expense-action-btn {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 36px !important; height: 36px !important; border-radius: 10px !important;
    background: #dcfce7 !important; border: 1px solid #bbf7d0 !important;
    color: #16a34a !important; font-size: 14px !important; cursor: pointer !important;
    transition: all 0.3s ease-in-out !important; padding: 0 !important;
    position: relative !important; z-index: 5;
}
.bp-expense-action-btn:hover {
    background: #bbf7d0 !important; border-color: #86efac !important;
    transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(16,185,129,0.2);
    z-index: 15;
}
.bp-expense-action-btn:active { transform: translateY(0) scale(0.95); }
.bp-expense-action-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(76,175,80,0.2); }

/* Dropdown base (before float) */
.bp-expense-dropdown {
    left: 0 !important; right: auto !important; top: 100% !important; margin-top: 4px !important; min-width: 200px;
    border-radius: 14px !important; box-shadow: 0 8px 28px rgba(0,0,0,0.12) !important;
    border: 1px solid #e5e7eb !important; padding: 6px 0 8px 0 !important;
    background: #fff !important; z-index: 9999 !important;
    overflow: visible !important; position: absolute !important;
}

/* Action dropdown floated to body — នៅក្រោមប៊ូតុង, អណ្តែតលើគ្រប់ផ្នែក */
.bp-action-dropdown-floated {
    position: fixed !important; display: block !important; visibility: visible !important; opacity: 1 !important;
    z-index: 2147483647 !important; pointer-events: auto !important;
}
ul.bp-expense-dropdown.bp-action-dropdown-floated {
    list-style: none !important; margin: 0 !important;
    max-height: min(65vh, 420px) !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
    border: 1px solid #e5e7eb !important;
    padding-bottom: 0 !important;
}
ul.bp-expense-dropdown.bp-action-dropdown-floated::-webkit-scrollbar { display: none; width: 0; height: 0; }
.bp-expense-dropdown::after {
    content: ''; display: block; position: absolute; bottom: 0; left: 0; right: 0;
    height: 8px; background: #4CAF50; border-radius: 0 0 12px 12px;
    pointer-events: none; box-shadow: none;
}
ul.bp-expense-dropdown.bp-action-dropdown-floated::after {
    position: sticky !important; display: block !important; bottom: 0 !important;
    height: 10px !important; min-height: 10px !important; margin: 0 !important;
    flex-shrink: 0 !important; border-radius: 0 0 12px 12px !important;
    background: #4CAF50 !important; background-color: #4CAF50 !important;
}

/* Options: li structure, divider, links */
.bp-expense-dropdown > li:not(.divider) {
    background: transparent; margin: 0 4px 2px; overflow: visible; border-radius: 8px;
}
.bp-expense-dropdown > li.divider {
    background: transparent !important; margin: 4px 8px; height: 1px; min-height: 1px; padding: 0 !important;
    border-top: 1px solid #e5e7eb;
}
.bp-expense-dropdown li a {
    display: block; padding: 10px 14px 10px 18px !important; font-size: 13px !important;
    background: transparent !important; color: #333 !important;
    border-radius: 8px; margin: 0 2px 2px; border-left: 3px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-left 0.2s ease !important;
}
.bp-expense-dropdown li a i { margin-right: 8px !important; width: 16px; color: #4CAF50; }
.bp-expense-dropdown li a:hover {
    background: #DBF5DC !important; color: #4CAF50 !important;
    transform: translateX(4px); border-left-color: #4CAF50 !important;
}
.bp-expense-dropdown li a:hover i { color: #4CAF50 !important; }

/* Animation: រត់ពីស្តាំមកឆ្វេង */
.bp-expense-dropdown li { animation: bpDropdownItemRtl 0.28s ease-out backwards; }
.bp-expense-dropdown li:nth-child(1) { animation-delay: 0.02s; }
.bp-expense-dropdown li:nth-child(2) { animation-delay: 0.05s; }
.bp-expense-dropdown li:nth-child(3) { animation-delay: 0.08s; }
.bp-expense-dropdown li:nth-child(4) { animation-delay: 0.11s; }
.bp-expense-dropdown li:nth-child(5) { animation-delay: 0.14s; }
.bp-expense-dropdown li:nth-child(6) { animation-delay: 0.17s; }
.bp-expense-dropdown li:nth-child(7) { animation-delay: 0.20s; }
.bp-expense-dropdown li:nth-child(8) { animation-delay: 0.23s; }
.bp-expense-dropdown li:nth-child(9) { animation-delay: 0.26s; }
.bp-expense-dropdown li:nth-child(n+10) { animation-delay: 0.29s; }
@keyframes bpDropdownItemRtl {
    0% { opacity: 0; transform: translateX(14px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Column Visibility dropdown — All Sales style: sub animation + green footer */
.bp-col-vis-wrap { position: relative; }
.bp-col-vis-panel {
    display: none;
    position: fixed;
    z-index: 99999;
    flex-direction: column;
    background: #fff;
    border: none;
    border-radius: 14px;
    min-width: 220px;
    max-height: 400px;
    overflow: hidden;
    padding-bottom: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.14);
}
.bp-col-vis-panel.open {
    display: flex;
    animation: bpColVisSlide 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.bp-col-vis-panel.open.bp-col-vis-panel-up {
    animation: bpColVisSlideUp 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes bpColVisSlide {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bpColVisSlideUp {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.bp-col-vis-panel-inner {
    background: #fff;
    border-radius: 10px 10px 0 0;
    padding: 4px 4px 14px 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
.bp-col-vis-panel label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    font-family: 'Noto Sans Khmer', 'Inter', sans-serif;
    border-radius: 8px;
    margin: 0 4px 2px;
    border-left: 3px solid transparent;
    transition: background .2s ease, color .2s ease, transform .2s ease, border-left .2s ease;
    animation: bpColVisItemSlideRtl .35s cubic-bezier(.34,1.56,.64,1) forwards;
}
.bp-col-vis-panel label:nth-child(1) { animation-delay: .03s; }
.bp-col-vis-panel label:nth-child(2) { animation-delay: .06s; }
.bp-col-vis-panel label:nth-child(3) { animation-delay: .10s; }
.bp-col-vis-panel label:nth-child(4) { animation-delay: .14s; }
.bp-col-vis-panel label:nth-child(5) { animation-delay: .19s; }
.bp-col-vis-panel label:nth-child(6) { animation-delay: .24s; }
.bp-col-vis-panel label:nth-child(7) { animation-delay: .30s; }
.bp-col-vis-panel label:nth-child(8) { animation-delay: .36s; }
.bp-col-vis-panel label:nth-child(n+9) { animation-delay: .42s; }
@keyframes bpColVisItemSlideRtl {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.bp-col-vis-panel label:hover {
    background: #f0fdf4;
    transform: translateX(4px);
    border-left-color: #4CAF50;
}
.bp-col-vis-panel label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bp-col-vis-panel label input[type="checkbox"]:checked {
    background-color: #4CAF50;
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76,175,80,0.35);
}
.bp-col-vis-panel-footer {
    padding: 10px 14px;
    border-top: 1px solid #e5e7eb;
    background: #fafbfc;
    border-radius: 0 0 14px 14px;
}
.bp-col-vis-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: var(--bp-primary, #4CAF50);
    border-radius: 0 0 14px 14px;
}
.bp-col-vis-reset {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s ease;
}
.bp-col-vis-reset:hover {
    color: #4CAF50;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.dataTable th {
    white-space: nowrap;
    background-color: #d2d6de !important;
}
.dataTables_scrollHeadInner .dataTable {
    width: 100% !important;
    margin-top: 0 !important;
}

.dataTables_scroll,
.table {
    border-radius: 10px;
    width: 100% !important;
}
/* .table tbody tr:last-child td:first-child, */
.table thead tr:first-child th:first-child {
    border-top-left-radius: 10px;
}
.table thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
}

.table tfoot tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}
.dataTables_scrollFootInner .dataTable {
    margin-bottom: 0 !important;
}
.dataTables_scroll .dataTables_scrollHead {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.dataTables_scrollHeadInner {
    padding-right: 0 !important;
}

.dataTables_scrollBody .table {
    border-radius: 0 !important;
}
.dataTables_scrollHead .dataTables_scrollHeadInner .table {
    border-radius: 0 !important;
}
.dataTables_scrollFoot .dataTables_scrollFootInner .table {
    border-radius: 0 !important;
}

/* ═══ List Product table header format — hide sort/filter icons (all product submenu tables) ═══ */
.bp-table-card table.dataTable thead th.sorting,
.bp-table-card table.dataTable thead th.sorting_asc,
.bp-table-card table.dataTable thead th.sorting_desc,
.bp-table-card table.dataTable thead th.sorting_disabled,
.bp-table-card .dataTables_scrollHead th.sorting,
.bp-table-card .dataTables_scrollHead th.sorting_asc,
.bp-table-card .dataTables_scrollHead th.sorting_desc,
.bp-table-card .dataTables_scrollHead th.sorting_disabled {
    background-image: none !important;
}
.bp-table-card table.dataTable thead th.sorting::before,
.bp-table-card table.dataTable thead th.sorting::after,
.bp-table-card table.dataTable thead th.sorting_asc::before,
.bp-table-card table.dataTable thead th.sorting_asc::after,
.bp-table-card table.dataTable thead th.sorting_desc::before,
.bp-table-card table.dataTable thead th.sorting_desc::after,
.bp-table-card .dataTables_scrollHead th.sorting::before,
.bp-table-card .dataTables_scrollHead th.sorting::after,
.bp-table-card .dataTables_scrollHead th.sorting_asc::before,
.bp-table-card .dataTables_scrollHead th.sorting_asc::after,
.bp-table-card .dataTables_scrollHead th.sorting_desc::before,
.bp-table-card .dataTables_scrollHead th.sorting_desc::after {
    display: none !important;
    content: none !important;
}
.bp-table-card table.dataTable thead th.sorting_disabled::before,
.bp-table-card table.dataTable thead th.sorting_disabled::after,
.bp-table-card .dataTables_scrollHead th.sorting_disabled::before,
.bp-table-card .dataTables_scrollHead th.sorting_disabled::after {
    display: none !important;
    content: none !important;
}

/**
 * BillPosware Standard Dropdown (bp-select)
 * ប្រើ class="bp-select" នៅពេលចង់ដាក់ Droplist តាមស្តង់ដារ
 * Usage: <select class="bp-select">...</select>
 */
.bp-select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 1px solid var(--bp-border, #e5e7eb);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background-color: var(--bp-sidebar-bg, #fff);
    color: var(--bp-menu-text, #333);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.bp-select:hover {
    border-color: var(--bp-btn-color, #228B22);
    box-shadow: 0 0 0 1px rgba(34, 139, 34, 0.1);
}
.bp-select:focus {
    outline: none;
    border-color: var(--bp-btn-color, #228B22);
    box-shadow: 0 0 0 3px rgba(34, 139, 34, 0.15);
}
.bp-select:active {
    transform: scale(0.995);
}

/* ═══ Table Footer (bp-footage-row) — aligned with columns, no green, swipe-safe ═══ */
.bp-footage-row {
    background: #f8fafc !important;
    border-top: 2px solid #e2e8f0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}
.bp-footage-row td {
    padding: 14px 16px !important;
    background: #f8fafc !important;
    border-top: none !important;
    vertical-align: middle !important;
}
.bp-footage-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bp-footage-label i {
    font-size: 13px;
    color: #6B7280;
}
/* DataTables scrollFoot — syncs with body on horizontal swipe */
.dataTables_scrollFoot .bp-footage-row,
.dataTables_scrollFoot tr.bp-footage-row {
    background: #f8fafc !important;
}
.dataTables_scrollFoot .bp-footage-row td,
.dataTables_scrollFoot tr.bp-footage-row td {
    background: #f8fafc !important;
}

/* ═══ Modal Dropdown — BillPosware Style (Apply in Modal) — like Expense Category ═══ */
/* When modal is open, ensure Select2 dropdown appears above modal + branded trigger */
body.modal-open .select2-container--default .select2-dropdown,
body.modal-open .select2-dropdown {
    z-index: 1060 !important;
    background: #4CAF50 !important;
    padding-bottom: 8px !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12) !important;
    overflow: hidden !important;
}
body.modal-open .select2-container--default .select2-dropdown .select2-search--dropdown {
    background: #fff !important;
    padding: 8px !important;
    border-bottom: 1px solid rgba(76, 175, 80, 0.15) !important;
}
body.modal-open .select2-container--default .select2-dropdown .select2-results {
    background: #fff !important;
}
body.modal-open .select2-container--default .select2-results__option {
    border-left: 3px solid transparent !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-left 0.2s ease !important;
}
body.modal-open .select2-container--default .select2-results__option--highlighted[aria-selected],
body.modal-open .select2-container--default .select2-results__option:hover {
    background: #DBF5DC !important;
    color: #4CAF50 !important;
    transform: translateX(4px) !important;
    border-left: 3px solid #4CAF50 !important;
}
body.modal-open .select2-container--default .select2-results__option[aria-selected="true"] {
    background: #4CAF50 !important;
    color: #fff !important;
    font-weight: 600 !important;
}
body.modal-open .select2-container--default .select2-results__option[aria-selected="true"]:hover {
    background: #388E3C !important;
    color: #fff !important;
}
.modal-body .select2-container .select2-selection--single {
    height: 48px !important;
    border-radius: 10px !important;
    border: 1px solid #d1d5db !important;
    padding: 12px 14px !important;
    line-height: 24px !important;
}
.bp-field-icon .select2-container .select2-selection--single {
    height: 46px !important;
    min-height: 46px !important;
    border: none !important;
    border-radius: 0 10px 10px 0 !important;
    padding: 0 14px !important;
    line-height: 46px !important;
}
.bp-field-icon .select2-container .select2-selection--multiple {
    min-height: 46px !important;
    padding: 8px 12px !important;
    border: none !important;
    border-radius: 0 10px 10px 0 !important;
}
.modal-body .select2-container--default .select2-selection--single:focus,
.modal-body .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12) !important;
}
.modal-body .form-group .select2-container {
    width: 100% !important;
}
/* Option slide animation (bpSubOptSlideRtl) for modal dropdowns */
@keyframes bpModalDropdownOptSlide {
    from { opacity: 0; transform: translateX(14px); }
    to { opacity: 1; transform: translateX(0); }
}
body.modal-open .select2-container--default .select2-results__option {
    animation: bpModalDropdownOptSlide 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) backwards !important;
}
body.modal-open .select2-container--default .select2-results__option:nth-child(1) { animation-delay: 0.02s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(2) { animation-delay: 0.05s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(3) { animation-delay: 0.08s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(4) { animation-delay: 0.11s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(5) { animation-delay: 0.14s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(6) { animation-delay: 0.17s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(7) { animation-delay: 0.20s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(8) { animation-delay: 0.23s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(9) { animation-delay: 0.26s !important; }
body.modal-open .select2-container--default .select2-results__option:nth-child(n+10) { animation-delay: 0.29s !important; }

/* ═══ Select2 — BillPosware Dropdown Style (Apply All) — same as Expense bp-dds ═══ */
/* Panel: no border, green only at bottom (padding-bottom shows green) */
.select2-dropdown {
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12) !important;
    overflow: hidden !important;
    background: #4CAF50 !important;
    padding-bottom: 8px !important;
}
.select2-container--default .select2-search--dropdown {
    padding: 8px !important;
    border-bottom: 1px solid rgba(76, 175, 80, 0.15) !important;
    background: #fff !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    background: #F8F8F8 !important;
    font-size: 13px !important;
    color: #333 !important;
    padding: 8px 10px 8px 32px !important;
    font-family: inherit !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #4CAF50 !important;
    outline: none !important;
}
.select2-container--default .select2-results > .select2-results__options {
    max-height: 220px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px !important;
    background: #fff !important;
}
.select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar {
    display: none !important;
}
.select2-container--default .select2-results__option {
    padding: 10px 14px !important;
    font-size: 14px !important;
    color: #333 !important;
    border-radius: 8px !important;
    margin-bottom: 2px !important;
    border-left: 3px solid transparent !important;
    transition: background 0.2s, color 0.2s, transform 0.2s, border-left 0.2s !important;
    font-weight: 500 !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #DBF5DC !important;
    color: #4CAF50 !important;
    transform: translateX(4px);
    border-left: 3px solid #4CAF50 !important;
}
.select2-container--default .select2-results__option[aria-selected="true"] {
    background: #DBF5DC !important;
    color: #4CAF50 !important;
    font-weight: 600 !important;
    transform: translateX(4px);
    border-left: 3px solid #4CAF50 !important;
}
.select2-container--default .select2-results__option[aria-selected="true"].select2-results__option--highlighted {
    background: #dcfce7 !important;
    color: #4CAF50 !important;
    transform: translateX(4px);
    border-left-color: #4CAF50 !important;
}
.select2-container--default .select2-results__message {
    padding: 12px !important;
    font-size: 13px !important;
    color: #6B7280 !important;
}

/* ═══ Add Product — Full-Width Symmetrical Layout (w-full, equal padding p-10) ═══ */
body.bp-page-product-add #scrollable-container {
    width: 100% !important;
    flex: 1 !important;
    padding: 32px 40px !important; /* p-8/p-10 — equal all sides, premium */
    box-sizing: border-box;
}
body.bp-page-product-add .bp-add-product-page {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}
body.bp-page-product-add .bp-add-product-page .content-header {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 16px;
}
body.bp-page-product-add #product_add_form .box-primary,
body.bp-page-product-add .bp-add-product-widget.box-primary {
    padding: 28px 40px !important; /* symmetric, premium */
}
body.bp-page-product-add .bp-add-product-grid {
    display: flex !important;
    gap: 32px !important; /* gap-8 — symmetric */
    width: 100% !important;
}
body.bp-page-product-add .bp-add-product-grid > .col-md-8 {
    flex: 7 1 0 !important;
    min-width: 0;
}
body.bp-page-product-add .bp-add-product-grid > .col-md-4 {
    flex: 3 1 0 !important;
    min-width: 0;
}
body.bp-page-product-add #product_add_form .col-md-8 {
    padding-right: 24px !important;
}
body.bp-page-product-add #product_add_form .col-md-4 {
    padding-left: 24px !important;
    padding-right: 0 !important;
}
body.bp-page-product-add #product_add_form .bp-section-card {
    width: 100% !important;
    min-width: 0;
}
@media (max-width: 991px) {
    body.bp-page-product-add .bp-add-product-grid {
        flex-direction: column !important;
    }
    body.bp-page-product-add .bp-add-product-grid > .col-md-8,
    body.bp-page-product-add .bp-add-product-grid > .col-md-4 {
        flex: 1 1 100% !important;
    }
}
@media (max-width: 768px) {
    body.bp-page-product-add #scrollable-container {
        padding: 16px 20px !important;
    }
    body.bp-page-product-add #product_add_form .box-primary,
    body.bp-page-product-add .bp-add-product-widget.box-primary {
        padding: 16px 20px !important;
    }
}

/* ═══ BillPosware Toolbar Buttons (Export, Print, Visibility) — Representative Colors ═══ */
/* Export: green (Excel), Print: purple, Visibility: blue — each has its own color */
.bp-tool-excel {
    background: #dcfce7 !important;
    border: 1.5px solid #16a34a !important;
    color: #166534 !important;
}
.bp-tool-excel i { color: #16a34a !important; }
.bp-tool-excel:hover {
    background: #bbf7d0 !important;
    border-color: #22c55e !important;
    color: #15803d !important;
    box-shadow: 0 4px 14px rgba(22,163,74,0.2) !important;
}
.bp-tool-excel:hover i { color: #16a34a !important; }

.bp-tool-print {
    background: #f3e8ff !important;
    border: 1.5px solid #7c3aed !important;
    color: #6d28d9 !important;
}
.bp-tool-print i { color: #7c3aed !important; }
.bp-tool-print:hover {
    background: #ede9fe !important;
    border-color: #8b5cf6 !important;
    color: #5b21b6 !important;
    box-shadow: 0 4px 14px rgba(124,58,237,0.2) !important;
}
.bp-tool-print:hover i { color: #7c3aed !important; }

.bp-tool-vis {
    background: #eff6ff !important;
    border: 1.5px solid #2563eb !important;
    color: #1d4ed8 !important;
}
.bp-tool-vis i { color: #2563eb !important; }
.bp-tool-vis:hover {
    background: #dbeafe !important;
    border-color: #3b82f6 !important;
    color: #1e40af !important;
    box-shadow: 0 4px 14px rgba(37,99,235,0.2) !important;
}
.bp-tool-vis:hover i { color: #2563eb !important; }

/* Global mobile fix: keep Add button square in table toolbars */
@media (max-width: 768px) {
    .bp-toolbar-actions .bp-add-btn,
    .bp-table-toolbar .bp-add-btn {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        gap: 0 !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        border: none !important;
        background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
        color: #fff !important;
    }

    .bp-toolbar-actions .bp-add-btn .bp-btn-text,
    .bp-table-toolbar .bp-add-btn .bp-btn-text {
        display: none !important;
    }

    .bp-toolbar-actions .bp-add-btn i,
    .bp-table-toolbar .bp-add-btn i {
        margin: 0 !important;
        color: #fff !important;
    }
}

/* Print schedule modal: remove all black/gray borders */
#bp_installment_print_modal .modal-content,
#bp_installment_print_modal .modal-dialog,
#bp_installment_print_modal .modal-header {
    border: none !important;
}
#bp_installment_print_modal #installment_section.invoice,
#bp_installment_print_modal .invoice {
    border: none !important;
}

/* ═══ BillPosware Brand Buttons (Global) ═══ */
.bp-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(76,175,80,.3);
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.bp-add-btn i { color: #fff !important; }
.bp-add-btn:hover {
    background: linear-gradient(135deg, #66BB6A, #4CAF50);
    box-shadow: 0 8px 24px rgba(76,175,80,.4);
    transform: translateY(-2px);
}
.bp-add-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(76,175,80,.28);
}
.bp-add-btn:focus { outline: none; }

/* Toolbar: equal spacing between Export, Print, Visibility, + Add */
.bp-toolbar-actions {
    gap: 10px !important;
}
.bp-toolbar-actions .bp-add-btn,
.pd-wrap .bp-toolbar-actions .bp-add-btn,
.bp-table-card .bp-toolbar-actions .bp-add-btn {
    margin-left: 0 !important;
}

/* ═══ BillPosware Brand Input Groups (Global) ═══ */
.bp-input-group {
    display: flex;
    align-items: stretch;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.bp-input-group:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76,175,80,.12);
}
.bp-input-group .bp-input-group-left,
.bp-input-group .bp-input-group-mid,
.bp-input-group .bp-input-group-right {
    height: 100%;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}
.bp-input-group .bp-input-group-left {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif;
}
.bp-input-group .bp-input-group-mid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: #f3f4f6;
    color: #6B7280;
    font-weight: 700;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    white-space: nowrap;
}
.bp-input-group .bp-input-group-right {
    flex: 0 0 auto;
    min-width: 92px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif;
    background: #fff;
}
.bp-input-group select.bp-input-group-right {
    padding-right: 28px;
}
.bp-input-group .bp-ig-addon {
    min-width: 72px;
}
@media (max-width: 768px) {
    .bp-input-group {
        flex-direction: column;
        height: auto;
    }
    .bp-input-group .bp-input-group-left {
        border-bottom: 1px solid #e5e7eb !important;
    }
    .bp-input-group .bp-input-group-mid {
        display: none;
    }
    .bp-input-group .bp-input-group-right {
        min-width: 0;
        padding: 10px 14px;
        height: 42px;
    }
}

/* Purchase entry table: compact Quantity & Discount columns (standard width) */
#purchase_entry_table th.bp-col-qty,
#purchase_entry_table td.bp-col-qty {
    max-width: 160px;
    width: 160px;
}
#purchase_entry_table th.bp-col-discount,
#purchase_entry_table td.bp-col-discount {
    max-width: 190px;
    width: 190px;
}
#purchase_entry_table td.bp-col-qty .bp-input-group,
#purchase_entry_table td.bp-col-discount .bp-input-group {
    max-width: 100%;
}

/* Purchase entry table: hide repeated columns (keep logic running) */
#purchase_entry_table th.bp-col-ucbt,
#purchase_entry_table td.bp-col-ucbt,
#purchase_entry_table th.bp-col-subbt,
#purchase_entry_table td.bp-col-subbt {
    display: none !important;
}

/* Purchase entry table: hide Profit Margin % column (optional UI) */
#purchase_entry_table th.bp-col-profit,
#purchase_entry_table td.bp-col-profit {
    display: none !important;
}

/* Purchase entry table: hide Net Cost column (optional UI) */
#purchase_entry_table th.bp-col-netcost,
#purchase_entry_table td.bp-col-netcost {
    display: none !important;
}

/* Purchase entry table: match compact Qty group standard */
#purchase_entry_table td.bp-col-qty .bp-input-group {
    border-radius: 8px;
    border-color: #e5e7eb;
    box-shadow: none;
}
#purchase_entry_table td.bp-col-qty .bp-input-group:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76,175,80,.10);
}
#purchase_entry_table td.bp-col-qty .bp-input-group .bp-input-group-left {
    min-width: 64px;
    padding: 0 10px;
    text-align: center;
    font-weight: 600;
}
#purchase_entry_table td.bp-col-qty .bp-input-group .bp-input-group-right {
    flex: 0 0 78px;
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    padding: 0 10px;
    font-weight: 600;
    min-width: 0;
}

/* Purchase entry table: match compact Discount group standard */
#purchase_entry_table td.bp-col-discount .bp-input-group {
    border-radius: 8px;
    border-color: #e5e7eb;
    box-shadow: none;
}
#purchase_entry_table td.bp-col-discount .bp-input-group:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76,175,80,.10);
}
#purchase_entry_table td.bp-col-discount .bp-input-group .bp-input-group-left {
    min-width: 78px;
    padding: 0 10px;
    text-align: left;
    font-weight: 600;
}
#purchase_entry_table td.bp-col-discount .bp-input-group .bp-input-group-mid {
    padding: 0 8px;
    background: #f8fafc;
}
#purchase_entry_table td.bp-col-discount .bp-input-group .bp-input-group-right {
    flex: 0 0 92px;
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    padding: 0 10px;
    font-weight: 600;
    min-width: 0;
}

/* Purchase entry table: make all boxes equal height + align to top */
#purchase_entry_table tbody td {
    vertical-align: top;
    padding-top: 6px;
    padding-bottom: 6px;
}
#purchase_entry_table tbody .form-control.input-sm,
#purchase_entry_table tbody select.form-control.input-sm {
    height: 42px !important;
    min-height: 42px !important;
    line-height: 1.2 !important; /* avoid baseline weirdness */
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 13px !important;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif !important;
    font-weight: 600 !important;
    text-align: center !important;
}
/* selects need slightly different padding for caret */
#purchase_entry_table tbody select.form-control.input-sm {
    padding-top: 8px;
    padding-bottom: 8px;
}
#purchase_entry_table tbody textarea.form-control.input-sm { min-height: 42px !important; }
#purchase_entry_table tbody .input-group,
#purchase_entry_table tbody .bp-input-group {
    height: 42px !important;
}
#purchase_entry_table tbody .input-group .input-group-addon {
    height: 42px !important;
    line-height: 42px !important;
}
#purchase_entry_table tbody .input-group.bp-tax-group {
    display: flex;
    align-items: stretch;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
#purchase_entry_table tbody .input-group.bp-tax-group:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76,175,80,.10);
}
#purchase_entry_table tbody .input-group.bp-tax-group > .form-control {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
#purchase_entry_table tbody .input-group.bp-tax-group .select2-container {
    flex: 1 1 auto;
    min-width: 0;
}
#purchase_entry_table tbody .input-group.bp-tax-group .select2-container .select2-selection--single {
    height: 42px !important;
    border: 0 !important;
    border-radius: 0 !important;
}
#purchase_entry_table tbody .input-group.bp-tax-group .select2-container .select2-selection__rendered {
    line-height: 42px !important;
    padding-left: 10px;
    padding-right: 28px;
}
#purchase_entry_table tbody .input-group.bp-tax-group .select2-container .select2-selection__arrow {
    height: 42px !important;
}
#purchase_entry_table tbody .input-group.bp-tax-group .input-group-addon.purchase_product_unit_tax_text {
    min-width: 66px;
    text-align: right;
    padding: 0 10px;
    border: 0;
    border-left: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #6B7280;
    font-weight: 700;
    font-size: 13px !important;
}
#purchase_entry_table tbody .select2-container .select2-selection--single {
    height: 42px !important;
}
#purchase_entry_table tbody .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 1.2 !important;
    font-size: 13px !important;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif !important;
    font-weight: 600 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#purchase_entry_table tbody .select2-container .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
}

/* Purchase entry table: keep "previous ..." hints close to inputs */
#purchase_entry_table tbody .bp-prev-hint {
    display: block;
    margin-top: 4px;
    line-height: 1.2;
    font-size: 11px;
}

/* Edit / Delete buttons — brand colors, no movement (easy click) */
.bp-btn-edit, .bp-btn-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans Khmer', 'Battambang', sans-serif;
    text-decoration: none !important;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.bp-btn-edit {
    background: #dcfce7;
    color: #333 !important;
    border: 1px solid #bbf7d0;
}
.bp-btn-edit i { color: #333 !important; }
.bp-btn-edit:hover {
    background: #bbf7d0;
    color: #16a34a !important;
    border-color: #86efac;
    box-shadow: 0 4px 12px rgba(76,175,80,.18);
}
.bp-btn-edit:hover i { color: #16a34a !important; }

.bp-btn-del {
    background: #fee2e2;
    color: #333 !important;
    border: 1px solid #fecaca;
}
.bp-btn-del i { color: #333 !important; }
.bp-btn-del:hover {
    background: #fecaca;
    color: #dc2626 !important;
    border-color: #fca5a5;
    box-shadow: 0 4px 12px rgba(220,38,38,.16);
}
.bp-btn-del:hover i { color: #dc2626 !important; }
