/* ================================================================
   GLOBAL DATATABLES LOOK — same design language as the products page
   Applies to every table.dataTable in the app (single-table layout,
   .dt-scroll-wrap scroller, toolbar, pagination, scroll helpers).
   ================================================================ */

/* ----- Scroll container: card + horizontal scroll ----- */
.dataTables_wrapper .dt-scroll-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 75vh;
    overflow-x: scroll !important;
    overflow-y: auto !important;
    scrollbar-width: auto;
    scrollbar-color: #0a8f74 #dbe7ee;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    border: 1px solid #cfd9e3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(10, 37, 64, .10), 0 2px 6px rgba(10, 37, 64, .06);
}

.dataTables_wrapper {
    min-width: 0;
    max-width: 100%;
}

.dataTables_wrapper .dt-scroll-wrap > table,
table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    font-size: 13.5px;
}

.dataTables_wrapper .dt-scroll-wrap > table {
    width: max-content !important;
    min-width: 100% !important;
}

/* ----- Sticky header inside the scroller ----- */
.dataTables_wrapper .dt-scroll-wrap > table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* ----- Header: deep, high contrast ----- */
table.dataTable thead th,
.dataTables_wrapper .dt-scroll-wrap > table thead th {
    background: linear-gradient(180deg, #0c3b4a 0%, #0a2f3d 100%) !important;
    color: #ecfdf7 !important;
    border: none !important;
    border-inline-end: 1px solid rgba(255, 255, 255, .18) !important;
    border-bottom: 3px solid #14b892 !important;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 14px 14px !important;
    white-space: nowrap;
    vertical-align: middle !important;
    text-align: start !important;
}
table.dataTable thead th:last-child,
.dataTables_wrapper .dt-scroll-wrap > table thead th:last-child {
    border-inline-end: none !important;
}
table.dataTable thead th.sorting:before,
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_desc:after {
    color: rgba(255, 255, 255, .35) !important;
}
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:before {
    color: #34e0b5 !important;
}
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    background: linear-gradient(180deg, #0f4a5c 0%, #0c3b4a 100%) !important;
}

/* ----- Hidden sizing copies DataTables keeps inside the scroll body ----- */
.dataTables_wrapper .dataTables_scrollBody thead th,
.dataTables_wrapper .dataTables_scrollBody thead td,
.dataTables_wrapper .dataTables_scrollBody tfoot th,
.dataTables_wrapper .dataTables_scrollBody tfoot td {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    background: transparent !important;
    color: transparent !important;
}
.dataTables_wrapper .dataTables_scrollBody tfoot,
.dataTables_wrapper .dataTables_scrollBody tfoot * {
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* ----- Rows: zebra + separators + hover ----- */
table.dataTable tbody td {
    border: none !important;
    border-bottom: 1px solid #d5dee8 !important;
    border-inline-end: 1px solid #e2e9f1 !important;
    padding: 11px 14px !important;
    vertical-align: middle !important;
    color: #0f172a;
    font-weight: 500;
    background: transparent;
}
table.dataTable tbody td:last-child,
table.dataTable tfoot td:last-child {
    border-inline-end: none !important;
}
table.dataTable tfoot td,
table.dataTable tfoot th {
    border-inline-end: 1px solid #e2e9f1 !important;
    background: #e9f1f6 !important;
    font-weight: 700 !important;
}
table.dataTable tbody tr:nth-of-type(odd),
table.dataTable tbody tr.odd {
    background: #ffffff;
}
table.dataTable tbody tr:nth-of-type(even),
table.dataTable tbody tr.even {
    background: #e9f1f6;
}
table.dataTable tbody tr {
    transition: background .15s ease, box-shadow .15s ease;
}
table.dataTable tbody tr:hover {
    background: #cdeee3 !important;
    box-shadow: inset 4px 0 0 #0a8f74, inset -4px 0 0 #0a8f74;
}

/* ----- Toolbar: search / length / export buttons ----- */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 10px !important;
    border: 1.5px solid #b8c6d4 !important;
    padding: 8px 14px !important;
    min-width: 240px;
    outline: none;
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    transition: border-color .2s, box-shadow .2s;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #0a8f74 !important;
    box-shadow: 0 0 0 3px rgba(10, 143, 116, .18);
}
.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 1.5px solid #b8c6d4;
    padding: 5px 10px;
    background: #fff;
    font-weight: 600;
}
.dataTables_wrapper .dataTables_length label {
    font-weight: 600;
    color: #475569;
}

/* ----- Info + pagination ----- */
.dataTables_wrapper .dataTables_info {
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    padding-top: 12px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button > a {
    border-radius: 8px !important;
    border: 1px solid #b8c6d4 !important;
    background: #fff !important;
    color: #1e293b !important;
    font-weight: 600;
    padding: 5px 12px;
    margin-inline-start: 4px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button > a:hover {
    border-color: #0a8f74 !important;
    color: #0a8f74 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.active > a,
.dataTables_wrapper .dataTables_paginate .paginate_button.active > a:hover {
    background: linear-gradient(135deg, #0a8f74, #065f73) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(10, 143, 116, .35);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled > a {
    opacity: .45;
    cursor: default;
}

/* ----- Processing overlay ----- */
.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, .92) !important;
    border: none !important;
    border-radius: 10px;
    color: #0a6b57;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(10, 37, 64, .15);
}

/* ----- Scrollbar styling ----- */
.dataTables_wrapper .dt-scroll-wrap::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}
.dataTables_wrapper .dt-scroll-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
}
.dataTables_wrapper .dt-scroll-wrap::-webkit-scrollbar-thumb {
    background: #7f93a8;
    border-radius: 8px;
}
.dataTables_wrapper .dt-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: #0a8f74;
}

/* ----- Toolbar rows pinned when they end up inside the scroller ----- */
.dt-scroll-wrap > .dataTables_wrapper > .row,
.dt-scroll-wrap > .dataTables_wrapper > .dataTables_info,
.dt-scroll-wrap > .dataTables_wrapper > .dataTables_paginate {
    position: sticky;
    inset-inline-start: 0;
    z-index: 4;
    max-width: calc(100vw - 50px);
}

/* ----- Column nav arrows + drag scrollbar ----- */
.pt-table-scroll-nav {
    display: none;
}
.pt-table-scrollbar {
    padding: 12px 8px 8px;
    background: #edf8f4;
}
.pt-table-scrollbar input[type="range"] {
    display: block;
    width: 100%;
    height: 12px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: #c7dbe5;
    border-radius: 12px;
    cursor: ew-resize;
    direction: ltr;
}
.pt-table-scrollbar input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #0a8f74;
    box-shadow: 0 2px 7px rgba(10, 37, 64, .35);
}
.pt-table-scrollbar input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #0a8f74;
    box-shadow: 0 2px 7px rgba(10, 37, 64, .35);
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
    .dataTables_wrapper .dt-scroll-wrap {
        touch-action: pan-y;
        cursor: grab;
    }
    .dataTables_wrapper .dt-scroll-wrap.pt-dragging {
        cursor: grabbing;
        user-select: none;
    }
    table.dataTable thead th,
    table.dataTable tbody td {
        white-space: nowrap;
    }
    .dataTables_wrapper .dataTables_filter input {
        min-width: 150px;
    }
    table.dataTable tbody td {
        padding: 9px 9px !important;
    }
    table.dataTable thead th {
        padding: 10px 9px !important;
        font-size: 10.5px;
    }
    .pt-table-scroll-nav {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        padding: 6px 2px;
        color: #385064;
        font-size: 12px;
        font-weight: 600;
    }
    .pt-table-scroll-nav button {
        min-width: 40px;
        min-height: 38px;
        border: 1px solid #9fc3d8;
        border-radius: 8px;
        background: #fff;
        color: #11648a;
        font-size: 22px;
        line-height: 1;
    }
}


/* ================================================================
   POS header forms (create + edit) - compact filter-style, v2
   Minimal intervention: uniform heights + compact margins +
   proportional flex packing. No width caps, no forced inner widths.
   Scoped strictly to .poshead rows inside .pdv / .pdvedit.
   ================================================================ */

/* ----- compact vertical rhythm ----- */
.pdv .row.poshead .form-group,
.pdvedit .row.poshead .form-group {
    margin-bottom: 5px !important;
}

/* ----- uniform heights: inputs ----- */
.pdv .row.poshead input.form-control,
.pdvedit .row.poshead input.form-control,
.pdv .row.poshead select.form-control,
.pdvedit .row.poshead select.form-control {
    height: 33px !important;
    min-height: 33px !important;
    padding: 5px 12px !important;
    font-size: 13px !important;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    border: 1.5px solid #b8c6d4 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    transition: border-color .2s, box-shadow .2s;
}
.pdv .row.poshead input.form-control:focus,
.pdvedit .row.poshead input.form-control:focus {
    border-color: #0a8f74 !important;
    box-shadow: 0 0 0 3px rgba(10, 143, 116, .18) !important;
    outline: none;
}

/* ----- uniform heights: select2 single ----- */
.pdv .row.poshead .select2-container--default .select2-selection--single,
.pdvedit .row.poshead .select2-container--default .select2-selection--single {
    height: 33px !important;
    min-height: 33px !important;
    border: 1.5px solid #b8c6d4 !important;
    border-radius: 10px !important;
    background: #fff !important;
    transition: border-color .2s, box-shadow .2s;
}
.pdv .row.poshead .select2-container--default .select2-selection--single .select2-selection__rendered,
.pdvedit .row.poshead .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 30px !important;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.pdv .row.poshead .select2-container--default .select2-selection--single .select2-selection__arrow,
.pdvedit .row.poshead .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 31px !important;
}
.pdv .row.poshead .select2-container--default.select2-container--open .select2-selection--single,
.pdv .row.poshead .select2-container--default.select2-container--focus .select2-selection--single,
.pdvedit .row.poshead .select2-container--default.select2-container--open .select2-selection--single,
.pdvedit .row.poshead .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #0a8f74 !important;
    box-shadow: 0 0 0 3px rgba(10, 143, 116, .18) !important;
}

/* ----- uniform heights: addons + group buttons ----- */
.pdv .row.poshead .input-group-addon,
.pdvedit .row.poshead .input-group-addon {
    height: 33px !important;
    padding: 4px 10px !important;
    font-size: 13px;
    background: #f1f5f9 !important;
    border: 1.5px solid #b8c6d4 !important;
    color: #0a8f74;
}
.pdv .row.poshead .input-group-btn .btn,
.pdvedit .row.poshead .input-group-btn .btn,
.pdv .row.poshead .input-group-addon .btn,
.pdvedit .row.poshead .input-group-addon .btn {
    height: 33px !important;
    padding: 4px 10px !important;
    line-height: 1.4;
    border: 1.5px solid #b8c6d4 !important;
    background: #fff !important;
    transition: border-color .2s, background .2s;
}
.pdv .row.poshead .input-group-btn .btn:hover,
.pdvedit .row.poshead .input-group-btn .btn:hover {
    border-color: #0a8f74 !important;
    background: #f0faf7 !important;
}
.pdv .row.poshead .input-group-btn .btn i,
.pdvedit .row.poshead .input-group-btn .btn i,
.pdv .row.poshead .input-group-addon .btn i,
.pdvedit .row.poshead .input-group-addon .btn i {
    font-size: 14px !important;
}

/* ----- flex packing: fields share rows proportionally ----- */
@media (min-width: 768px) {
    .pdv .row.poshead,
    .pdvedit .row.poshead {
        display: flex !important;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .pdv .row.poshead:before,
    .pdv .row.poshead:after,
    .pdvedit .row.poshead:before,
    .pdvedit .row.poshead:after {
        display: none !important;
    }
    .pdv .row.poshead > [class*="col-"],
    .pdvedit .row.poshead > [class*="col-"] {
        float: none !important;
        width: auto !important;
        max-width: 100%;
        flex: 1 1 0;
        min-width: 140px;
        padding-inline: 4px !important;
    }
    /* search keeps its naturally larger share (was col-md-8) */
    .pdv .row.poshead > .col-md-8,
    .pdvedit .row.poshead > .col-md-8 {
        flex: 2 1 0;
        min-width: 260px;
    }
}

/* ----- mobile: compact + stacked ----- */
@media (max-width: 767px) {
    .pdv .row.poshead .form-group,
    .pdvedit .row.poshead .form-group {
        margin-bottom: 4px !important;
    }
    .pdv .row.poshead input.form-control,
    .pdvedit .row.poshead input.form-control,
    .pdv .row.poshead select.form-control,
    .pdvedit .row.poshead select.form-control {
        height: 31px !important;
        min-height: 31px !important;
        font-size: 12.5px !important;
    }
    .pdv .row.poshead .select2-container--default .select2-selection--single,
    .pdvedit .row.poshead .select2-container--default .select2-selection--single {
        height: 31px !important;
        min-height: 31px !important;
    }
    .pdv .row.poshead .select2-container--default .select2-selection--single .select2-selection__rendered,
    .pdvedit .row.poshead .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 28px !important;
        font-size: 12.5px;
    }
    .pdv .row.poshead .select2-container--default .select2-selection--single .select2-selection__arrow,
    .pdvedit .row.poshead .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 29px !important;
    }
    .pdv .row.poshead .input-group-addon,
    .pdvedit .row.poshead .input-group-addon {
        height: 31px !important;
        padding: 3px 8px !important;
    }
    .pdv .row.poshead .input-group-btn .btn,
    .pdvedit .row.poshead .input-group-btn .btn,
    .pdv .row.poshead .input-group-addon .btn,
    .pdvedit .row.poshead .input-group-addon .btn {
        height: 31px !important;
        padding: 3px 8px !important;
    }
}


/* ----- REF invoice-number column (edit form): label + input on one aligned line ----- */
.pdvedit .row.poshead > [class*="col-"]:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}
.pdvedit .row.poshead input.reffact {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0 !important;
}

/* ----- customer credit note: compact, does not stretch the row ----- */
.pdv .row.poshead small.contact_due_text,
.pdvedit .row.poshead small.contact_due_text {
    display: block;
    font-size: 10px;
    line-height: 1.2;
    margin-top: 1px;
}

/* ----- select2 inside input-group: clean continuous border ----- */
.pdv .row.poshead .input-group .select2-container--default .select2-selection--single,
.pdvedit .row.poshead .input-group .select2-container--default .select2-selection--single {
    border-radius: 0 !important;
}
/* single visible control fills its whole column width evenly */
.pdv .row.poshead .form-group,
.pdvedit .row.poshead .form-group {
    width: 100%;
}
.pdv .row.poshead .form-group > .select2-container,
.pdvedit .row.poshead .form-group > .select2-container {
    width: 100% !important;
}
.pdv .row.poshead .form-group > input.form-control,
.pdvedit .row.poshead .form-group > input.form-control,
.pdv .row.poshead .form-group > select.form-control,
.pdvedit .row.poshead .form-group > select.form-control {
    width: 100% !important;
}


/* ----- input-group internal mechanics: kill the up/down drift ----- */

/* every direct child of the input-group aligns to the same middle line */
.pdv .row.poshead .input-group > *,
.pdvedit .row.poshead .input-group > * {
    vertical-align: middle !important;
}

/* select2 container is NOT a bootstrap table-cell by default -> floats on
   the baseline and drifts up. Make it a real cell that fills the space
   exactly like .form-control does in bootstrap input-groups. */
.pdv .row.poshead .input-group > .select2-container,
.pdvedit .row.poshead .input-group > .select2-container {
    display: table-cell !important;
    vertical-align: middle !important;
    width: 100% !important;
    float: none !important;
    position: relative;
    top: auto;
}
.pdv .row.poshead .input-group > .select2-container .select2-selection--single,
.pdvedit .row.poshead .input-group > .select2-container .select2-selection--single {
    display: flex !important;
    align-items: center;
}
.pdv .row.poshead .input-group > .select2-container .select2-selection__rendered,
.pdvedit .row.poshead .input-group > .select2-container .select2-selection__rendered {
    line-height: 1.4 !important;
    flex: 1 1 auto;
    padding-block: 0;
}

/* the addon that WRAPS a button (edit-customer icon): button must not
   add its own height on top of the addon padding - keep the pair at 33px */
.pdv .row.poshead .input-group-addon,
.pdvedit .row.poshead .input-group-addon {
    padding: 0 !important;
    overflow: hidden;
}
.pdv .row.poshead .input-group-addon .btn,
.pdvedit .row.poshead .input-group-addon .btn {
    height: 31px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px !important;
}
/* pure-icon addons (calendar, paste...) center their icon */
.pdv .row.poshead .input-group-addon > i,
.pdvedit .row.poshead .input-group-addon > i {
    line-height: 31px;
    display: inline-block;
    vertical-align: middle;
}

/* buttons cell: exact same 33px, no extra slack */
.pdv .row.poshead .input-group-btn,
.pdvedit .row.poshead .input-group-btn {
    vertical-align: middle !important;
    font-size: 0;
}
.pdv .row.poshead .input-group-btn .btn,
.pdvedit .row.poshead .input-group-btn .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    border-radius: 0 !important;
}


/* ----- input-groups must FILL their flex column (bootstrap tables shrink-to-fit otherwise) ----- */
.pdv .row.poshead .input-group,
.pdvedit .row.poshead .input-group {
    width: 100% !important;
}
/* the text/select cell inside the group takes all remaining space */
.pdv .row.poshead .input-group > .form-control,
.pdvedit .row.poshead .input-group > .form-control {
    width: 100% !important;
}
/* plain (non-select2) selects inside groups: same 33px strict + flex fill */
.pdv .row.poshead .input-group select.form-control,
.pdvedit .row.poshead .input-group select.form-control {
    height: 33px !important;
    min-height: 33px !important;
    max-height: 33px !important;
    -webkit-appearance: none;
    appearance: none;
}
/* bare select2 outside groups: strict height including container */
.pdv .row.poshead .form-group > .select2-container,
.pdvedit .row.poshead .form-group > .select2-container {
    height: 33px !important;
    display: block;
}


/* user-specified: compact icon addons + camera button */
span.input-group-addon.icone, span.input-group-addon, button.btn.btn-default.bg-white.btn-flat.camera-barcode-scanner-btn {
    min-width: 30px !important;
    color: #025f4a !important;
}



/* select2 containers in poshead MUST fill their cell/column (they freeze at
   a measured px width at init otherwise) */
.pdv .row.poshead .select2-container,
.pdvedit .row.poshead .select2-container {
    width: 100% !important;
}


/* ================================================================
   input-group as FLEXBOX (bootstrap4/5 style) - the table layout
   mis-distributes widths; flex gives exact control.
   ================================================================ */
.pdv .row.poshead .input-group,
.pdvedit .row.poshead .input-group {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
}
/* hidden original select must leave the flex flow entirely */
.pdv .row.poshead .input-group > select.select2-hidden-accessible,
.pdvedit .row.poshead .input-group > select.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    border: 0 !important;
    flex: 0 0 0 !important;
}
/* the flexible middle: select2 or plain input grows to fill leftover space */
.pdv .row.poshead .input-group > .select2-container,
.pdvedit .row.poshead .input-group > .select2-container {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    display: block !important;
}
.pdv .row.poshead .input-group > input.form-control,
.pdvedit .row.poshead .input-group > input.form-control,
.pdv .row.poshead .input-group > select.form-control,
.pdvedit .row.poshead .input-group > select.form-control {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
}
/* addons and button-cells keep natural size, centered content */
.pdv .row.poshead .input-group > .input-group-addon,
.pdvedit .row.poshead .input-group > .input-group-addon,
.pdv .row.poshead .input-group > .input-group-btn,
.pdvedit .row.poshead .input-group > .input-group-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
}


/* FINAL override: hidden original select wins over the flex-grow rule
   (equal specificity - later in file wins) */
.pdv .row.poshead .input-group > select.select2-hidden-accessible,
.pdvedit .row.poshead .input-group > select.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    max-height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    border: 0 !important;
    flex: 0 0 0 !important;
}


/* ----- seamless input-groups: share borders, no double seams ----- */
/* every segment after the first drops its leading border */
.pdv .row.poshead .input-group > * + *,
.pdvedit .row.poshead .input-group > * + * {
    border-inline-start: none !important;
}
/* keep buttons inside the button-cell seamless too */
.pdv .row.poshead .input-group-btn .btn + .btn,
.pdvedit .row.poshead .input-group-btn .btn + .btn {
    border-inline-start: none !important;
}
/* radius only on the true outer ends of the group */
.pdv .row.poshead .input-group > *:first-child,
.pdvedit .row.poshead .input-group > *:first-child {
    border-start-start-radius: 10px !important;
    border-end-start-radius: 10px !important;
}
.pdv .row.poshead .input-group > *:last-child,
.pdvedit .row.poshead .input-group > *:last-child,
.pdv .row.poshead .input-group > *:last-child .btn:last-child,
.pdvedit .row.poshead .input-group > *:last-child .btn:last-child {
    border-start-end-radius: 10px !important;
    border-end-end-radius: 10px !important;
}


/* ================================================================
   CLUSTER layout: fields keep compact natural widths and group
   together - they must NOT stretch across the whole screen.
   ================================================================ */
@media (min-width: 768px) {
    .pdv .row.poshead > [class*="col-"],
    .pdvedit .row.poshead > [class*="col-"] {
        flex: 0 1 200px !important;
        min-width: 140px !important;
    }
    /* product search: wider but still bounded */
    .pdv .row.poshead > .col-md-8,
    .pdvedit .row.poshead > .col-md-8 {
        flex: 0 1 340px !important;
        min-width: 240px !important;
    }
    /* customer column carries 3 buttons - needs a bit more room */
    .pdv .row.poshead > [class*="col-"]:has(.add_new_customer),
    .pdvedit .row.poshead > [class*="col-"]:has(.add_new_customer) {
        flex-basis: 250px !important;
    }
}


/* ================================================================
   Unified input-group look: ONE rounded bordered pill per group.
   No double borders between cells, subtle separators, :focus-within
   teal ring around the whole group. Scoped to poshead rows only.
   ================================================================ */

/* the group itself is the visible control */
.pdv .row.poshead .input-group,
.pdvedit .row.poshead .input-group {
    display: flex !important;
    align-items: stretch;
    width: 100% !important;
    height: 33px;
    background: #fff;
    border: 1.5px solid #b8c6d4 !important;
    border-radius: 10px !important;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
/* teal ring around the WHOLE group when anything inside is focused */
.pdv .row.poshead .input-group:focus-within,
.pdvedit .row.poshead .input-group:focus-within {
    border-color: #0a8f74 !important;
    box-shadow: 0 0 0 3px rgba(10, 143, 116, .18) !important;
}

/* strip every inner cell border - the group border is the only one */
.pdv .row.poshead .input-group .form-control,
.pdvedit .row.poshead .input-group .form-control,
.pdv .row.poshead .input-group .select2-selection--single,
.pdvedit .row.poshead .input-group .select2-selection--single,
.pdv .row.poshead .input-group .input-group-addon,
.pdvedit .row.poshead .input-group .input-group-addon,
.pdv .row.poshead .input-group .input-group-btn .btn,
.pdvedit .row.poshead .input-group .input-group-btn .btn,
.pdv .row.poshead .input-group .input-group-addon .btn,
.pdvedit .row.poshead .input-group .input-group-addon .btn {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* subtle inner separators between cells */
.pdv .row.poshead .input-group > *:not(:first-child),
.pdvedit .row.poshead .input-group > *:not(:first-child) {
    border-inline-start: 1px solid #e2e8f0 !important;
}

/* the editable part fills all remaining space */
.pdv .row.poshead .input-group > .form-control,
.pdvedit .row.poshead .input-group > .form-control,
.pdv .row.poshead .input-group > .select2-container,
.pdvedit .row.poshead .input-group > .select2-container {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center;
    background: #fff !important;
}
.pdv .row.poshead .input-group > .select2-container .select2-selection--single,
.pdvedit .row.poshead .input-group > .select2-container .select2-selection--single {
    flex: 1 1 auto;
    height: 100% !important;
    display: flex !important;
    align-items: center;
    background: transparent !important;
}
/* individual focus shadows off - the group ring handles it */
.pdv .row.poshead .input-group .form-control:focus,
.pdvedit .row.poshead .input-group .form-control:focus,
.pdv .row.poshead .input-group .select2-container--default.select2-container--open .select2-selection--single,
.pdvedit .row.poshead .input-group .select2-container--default.select2-container--open .select2-selection--single {
    box-shadow: none !important;
    border: none !important;
}

/* icon addons: quiet light-gray chips, vertically centered */
.pdv .row.poshead .input-group > .input-group-addon,
.pdvedit .row.poshead .input-group > .input-group-addon {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 100% !important;
    background: #f1f5f9 !important;
    padding: 0 !important;
}
/* buttons: full-height flat segments, gentle teal hover */
.pdv .row.poshead .input-group > .input-group-btn,
.pdvedit .row.poshead .input-group > .input-group-btn {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: stretch;
    height: 100% !important;
    font-size: 0;
}
.pdv .row.poshead .input-group .input-group-btn .btn,
.pdvedit .row.poshead .input-group .input-group-btn .btn {
    height: 100% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px !important;
    background: #fff !important;
    color: #025f4a !important;
}
.pdv .row.poshead .input-group .input-group-btn .btn:hover,
.pdvedit .row.poshead .input-group .input-group-btn .btn:hover,
.pdv .row.poshead .input-group .input-group-addon .btn:hover,
.pdvedit .row.poshead .input-group .input-group-addon .btn:hover {
    background: #e6f7f1 !important;
    color: #0a8f74 !important;
}
/* small gap between adjacent buttons inside a cell */
.pdv .row.poshead .input-group .input-group-btn .btn + .btn,
.pdvedit .row.poshead .input-group .input-group-btn .btn + .btn {
    border-inline-start: 1px solid #e2e8f0 !important;
}

/* select2 arrow aligned with the new flex selection */
.pdv .row.poshead .input-group .select2-selection__arrow,
.pdvedit .row.poshead .input-group .select2-selection__arrow {
    position: static !important;
    height: auto !important;
    display: inline-flex;
    align-items: center;
    padding-inline-end: 8px;
}

/* mobile: same unified pill, smaller */
@media (max-width: 767px) {
    .pdv .row.poshead .input-group,
    .pdvedit .row.poshead .input-group {
        height: 31px;
    }
}


/* ----- custom caret for plain selects in poshead (native arrow was removed) ----- */
.pdv .row.poshead select.form-control:not(.select2-hidden-accessible),
.pdvedit .row.poshead select.form-control:not(.select2-hidden-accessible) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23025f4a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 11px center !important;
    padding-inline-end: 28px !important;
}
html[dir="rtl"] .pdv .row.poshead select.form-control:not(.select2-hidden-accessible),
html[dir="rtl"] .pdvedit .row.poshead select.form-control:not(.select2-hidden-accessible) {
    background-position: left 11px center !important;
}


/* ----- product search column absorbs all leftover space in its row ----- */
@media (min-width: 768px) {
    .pdv .row.poshead > .col-md-8,
    .pdvedit .row.poshead > .col-md-8 {
        flex-grow: 1 !important;
    }
}

/* ================================================================
   Small-screen POS layout fixes (tablets / small laptops).
   Large desktop screens (1601px+) are untouched on purpose.
   ================================================================ */

/* margins fix: stray +5/-5 margins on .d1 pull the products panel
   under the table column - applies wherever the two columns coexist */
@media (min-width: 768px) and (max-width: 1600px) {
    .d1.no-padding.pr-12 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* products panel content must not bleed sideways into the table column */
    .d2.no-padding {
        overflow-x: hidden !important;
    }
}

/* fixed bottom action bar overlap: only relevant where the bar is visible (>=1024px) */
@media (min-width: 1024px) and (max-width: 1600px) {

    /* lift the totals footer above the fixed action bar (~78px bar + margins) */
    div#pos_table_footer {
        bottom: 92px !important;
    }

    /* scrollable clearance so the last table rows can pass above the bar */
    .d1.no-padding.pr-12 {
        padding-bottom: 96px !important;
    }
}
