/* ============================================================
   form-create-modern.css
   Shared styling for "create" forms (purchase, sell/quote,
   purchase order, stock transfer, etc.). Include once from
   layouts/partials/css.blade.php so every create page looks
   identical instead of each blade file inlining its own copy.
   ============================================================ */

/* ── Select2 dropdown search box (force light theme) ── */
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-search--dropdown .select2-search__field {
    background: #fff !important;
    color: #0f172a !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    outline: none !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15) !important;
}
.select2-dropdown {
    background: #fff !important;
    border: 1px solid #dbe3ef !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 20px rgba(15,23,42,0.12) !important;
}
.select2-results__option { color: #0f172a !important; font-size: 13px !important; }
.select2-results__option--highlighted { background: #eef2ff !important; color: #4f46e5 !important; }

/* ── Hide bootstrap-filestyle auto-button on create forms (we use our own label) ── */
#upload_document + .bootstrap-filestyle { display: none !important; }

/* ── Cards ── */
.user-edit-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
}
.user-edit-card-header {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-edit-card-header i {
    font-size: 13px; width: 28px; height: 28px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-edit-card-header h3 { margin: 0; font-size: 13px; font-weight: 700; color: #0f172a; }
.user-edit-card-header p  { margin: 0; font-size: 11px; color: #94a3b8; display: none; }
.user-edit-card-body { padding: 12px 14px; }

/* ── Form fields ── */
.user-edit-card-body .form-group { margin-bottom: 10px; }
.user-edit-card-body .form-group label,
.user-edit-card-body label {
    font-weight: 600; font-size: 11px; color: #475569; margin-bottom: 3px;
}
.user-edit-card-body .form-control {
    border-radius: 7px; border: 1px solid #dbe3ef; padding: 6px 10px;
    font-size: 13px; height: 34px; transition: border-color 0.15s;
    background: #fff;
}
.user-edit-card-body textarea.form-control { height: auto; }
.user-edit-card-body .form-control:focus {
    border-color: #818cf8; box-shadow: 0 0 0 2px rgba(129,140,248,0.12); outline: none;
}
.user-edit-card-body .input-group-addon {
    border-radius: 7px 0 0 7px; border: 1px solid #dbe3ef;
    background: #f8fafc; color: #64748b; font-size: 12px; padding: 0 9px;
}
.user-edit-card-body .input-group .form-control { border-radius: 0 7px 7px 0; }
.user-edit-card-body .input-group-btn .btn {
    height: 34px; border-radius: 0 7px 7px 0; border: 1px solid #dbe3ef;
}
.user-edit-card-body .select2-container .select2-selection--single,
.user-edit-card-body .select2-container .select2-selection--multiple {
    border-radius: 7px !important; min-height: 34px !important; border: 1px solid #dbe3ef !important;
}
.user-edit-card-body .help-block { font-size: 10px; color: #94a3b8; margin-top: 2px; margin-bottom: 0; }
.user-edit-card-body .row { margin-left: -6px; margin-right: -6px; }
.user-edit-card-body .row > [class*="col-"] { padding-left: 6px; padding-right: 6px; }

/* Still hide the advanced per-line columns on purchase entry */
#purchase_entry_table .purchase-col-adv { display: none !important; }

/* ═══════════════════════════════════════════════
   COMPACT CART-STYLE LINE ITEM TABLES
   Shared look for sell (#pos_table) and purchase
   (#purchase_entry_table) create forms — inspired
   by the POS terminal cart.
   ═══════════════════════════════════════════════ */
.user-edit-card #pos_table,
.user-edit-card #purchase_entry_table {
    background: transparent !important;
    border: none !important;
    border-collapse: separate !important;
    border-spacing: 0 4px !important;
    width: 100% !important;
    margin-bottom: 0 !important;
}

/* Header row */
.user-edit-card #pos_table thead tr,
.user-edit-card #purchase_entry_table thead tr {
    background: transparent !important;
}
.user-edit-card #pos_table thead th,
.user-edit-card #purchase_entry_table thead th {
    background: transparent !important;
    color: #9ca3af !important;
    border: none !important;
    border-bottom: 1px solid #f3f4f6 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    padding: 4px 8px 6px !important;
    white-space: nowrap;
    vertical-align: middle;
}

/* Body rows — pill cards with rounded corners */
.user-edit-card #pos_table tbody tr,
.user-edit-card #purchase_entry_table tbody tr {
    background: #f9fafb !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    transition: background 0.15s;
}
.user-edit-card #pos_table tbody tr:hover,
.user-edit-card #purchase_entry_table tbody tr:hover {
    background: #ecfdf5 !important;
}
.user-edit-card #pos_table tbody td,
.user-edit-card #purchase_entry_table tbody td {
    color: #111827 !important;
    border: 0 !important;
    vertical-align: middle !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
}
.user-edit-card #pos_table tbody tr td:first-child,
.user-edit-card #purchase_entry_table tbody tr td:first-child {
    border-radius: 8px 0 0 8px !important;
}
.user-edit-card #pos_table tbody tr td:last-child,
.user-edit-card #purchase_entry_table tbody tr td:last-child {
    border-radius: 0 8px 8px 0 !important;
}

/* Column widths */
.user-edit-card #pos_table .pos-cart-qty-col,
.user-edit-card #pos_table .pos-cart-qty-cell { width: 118px !important; }
.user-edit-card #pos_table .pos-cart-price-col,
.user-edit-card #pos_table .pos-cart-price-cell { width: 118px !important; }
.user-edit-card #pos_table .pos-cart-subtotal-col,
.user-edit-card #pos_table .pos-cart-subtotal-cell { width: 90px !important; text-align: right; }
.user-edit-card #pos_table .pos-cart-remove-col,
.user-edit-card #pos_table .pos-cart-remove-cell { width: 34px !important; }
.user-edit-card #pos_table .pos-cart-product-col,
.user-edit-card #pos_table .pos-cart-product-cell { width: auto !important; }
/* Fallback X column for both tables */
.user-edit-card #pos_table thead th:last-child,
.user-edit-card #pos_table tbody td:last-child,
.user-edit-card #purchase_entry_table thead th:last-child,
.user-edit-card #purchase_entry_table tbody td:last-child {
    width: 40px !important;
    min-width: 40px;
    text-align: center;
}

/* Product cell: image thumbnail positioned on the left, title clamped */
.user-edit-card #pos_table tbody td:first-child,
.user-edit-card #purchase_entry_table tbody td:first-child {
    position: relative;
    padding-left: 56px !important;
    overflow: hidden;
}
.user-edit-card #pos_table tbody td > img[alt="product-img"],
.user-edit-card #purchase_entry_table tbody td > img[alt="product-img"] {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 6px !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    border: 1px solid #f3f4f6 !important;
}
.user-edit-card #pos_table tbody td > small.text-muted,
.user-edit-card #pos_table tbody td > br,
.user-edit-card #pos_table tbody td .fa-info-circle {
    display: none;
}
.user-edit-card #pos_table tbody .pos-cart-product-copy {
    display: block;
    min-width: 0;
    max-width: 100%;
    padding-right: 10px;
}
.user-edit-card #pos_table tbody .pos-cart-product-title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.28 !important;
    color: #111827 !important;
    text-decoration: none !important;
}
.user-edit-card #pos_table tbody .pos-cart-product-trigger {
    cursor: pointer;
    color: #111827 !important;
}
.user-edit-card #pos_table tbody .pos-cart-product-trigger:hover { color: #059669 !important; }
.user-edit-card #pos_table tbody .pos-cart-product-meta {
    margin-top: 2px;
    color: #9ca3af !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide the bulky sub-unit / lot number selects inside rows (still in DOM for pos.js) */
.user-edit-card #pos_table tbody td > select.sub_unit,
.user-edit-card #pos_table tbody td > select.lot_number,
.user-edit-card #pos_table tbody td > input[name*="secondary_unit_quantity"],
.user-edit-card #pos_table tbody td > span[style*="white-space"] { display: none; }
.user-edit-card #pos_table tbody tr.pos-row-expanded td > select.sub_unit,
.user-edit-card #pos_table tbody tr.pos-row-expanded td > select.lot_number {
    display: block;
    margin-top: 4px;
    font-size: 11px !important;
    height: 26px !important;
    padding: 2px 6px !important;
}
.user-edit-card #pos_table tbody tr.pos-row-expanded td > br { display: block; }
.user-edit-card #pos_table tbody tr.pos-row-expanded td > small.text-muted { display: block; font-size: 10px !important; margin-top: 2px; }

/* Quantity +/- input group */
.user-edit-card #pos_table tbody .input-group.input-number,
.user-edit-card #purchase_entry_table tbody .input-group.input-number {
    width: auto;
    max-width: 120px;
    min-width: 110px;
    margin: 0 auto;
}
.user-edit-card #pos_table tbody .input-group.input-number .btn,
.user-edit-card #purchase_entry_table tbody .input-group.input-number .btn {
    padding: 4px 8px !important;
    height: 30px !important;
    min-width: 28px;
    font-size: 13px !important;
    border-radius: 6px !important;
}
.user-edit-card #pos_table tbody .input-group.input-number .pos_quantity,
.user-edit-card #purchase_entry_table tbody .input-group.input-number input {
    height: 30px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: center;
    padding: 2px 4px !important;
}

/* Inputs inside row cells — small & tidy */
.user-edit-card #pos_table tbody .form-control,
.user-edit-card #pos_table tbody input[type="text"],
.user-edit-card #purchase_entry_table tbody .form-control,
.user-edit-card #purchase_entry_table tbody input[type="text"] {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    color: #111827 !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    height: 30px !important;
    font-size: 12px !important;
    padding: 4px 8px !important;
}
.user-edit-card #pos_table tbody .form-control:focus,
.user-edit-card #purchase_entry_table tbody .form-control:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16,185,129,0.1) !important;
}

/* Unit-price display button (pos.js renders this as a pseudo-button) */
.user-edit-card #pos_table tbody .pos-cart-unit-price-display {
    width: 100%;
    min-height: 30px;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #111827 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.user-edit-card #pos_table tbody .pos-cart-unit-price-display:hover {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16,185,129,0.08) !important;
}

/* Delete button: compact rose circle */
.user-edit-card #pos_table tbody .pos_remove_row,
.user-edit-card #pos_table tbody .btn-danger,
.user-edit-card #purchase_entry_table tbody .pos_remove_row,
.user-edit-card #purchase_entry_table tbody .btn-danger,
.user-edit-card #purchase_entry_table tbody a.pos_remove_row,
.user-edit-card #purchase_entry_table tbody .remove_purchase_entry_row {
    background: rgba(244, 63, 94, 0.08) !important;
    color: #f43f5e !important;
    border: none !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
}
.user-edit-card #pos_table tbody .pos_remove_row:hover,
.user-edit-card #pos_table tbody .btn-danger:hover,
.user-edit-card #purchase_entry_table tbody .pos_remove_row:hover,
.user-edit-card #purchase_entry_table tbody .remove_purchase_entry_row:hover {
    background: rgba(244, 63, 94, 0.18) !important;
    transform: scale(1.12);
}

/* ── Sell POS line-item table (lightweight alignment only — don't fight pos.js layout) ── */
.user-edit-card #pos_table > thead > tr > th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 6px !important;
    vertical-align: middle;
    border-bottom: 2px solid #e2e8f0 !important;
    border-top: 0 !important;
}
.user-edit-card #pos_table > tbody > tr > td {
    vertical-align: middle;
    padding: 8px 6px;
}
/* Last column = delete X → fixed narrow width so header and body align */
.user-edit-card #pos_table > thead > tr > th:last-child,
.user-edit-card #pos_table > tbody > tr > td:last-child {
    width: 40px;
    min-width: 40px;
    text-align: center;
}

/* ── Sell totals layout: 2-col grid (inputs | summary panel) ── */
.sell-totals-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    align-items: start;
}
.sell-totals-summary .purchase-totals {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    gap: 6px;
}
@media (max-width: 991px) {
    .sell-totals-layout { grid-template-columns: 1fr; }
}

/* ── Totals cards ── */
.purchase-totals {
    display: flex; flex-direction: column; gap: 4px;
    padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
}
.purchase-totals-row { display: flex; justify-content: space-between; font-size: 12px; color: #475569; }
.purchase-totals-row--grand {
    padding-top: 6px; border-top: 1px solid #e2e8f0;
    font-size: 14px; font-weight: 800; color: #0f172a;
}

/* ── Save button ── */
.section-divider { border: none; border-top: 1px dashed #e5e7eb; margin: 10px 0; }
.btn-save-user {
    background: linear-gradient(135deg, #4f46e5, #4338ca); color: #fff; border: none;
    padding: 10px 36px; border-radius: 10px; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}
.btn-save-user:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,70,229,0.35); color: #fff; }

/* ── Override legacy table-th-green inside create cards ── */
.user-edit-card .table-th-green th {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

/* ── File upload ── */
.user-edit-card-body input[type="file"] { font-size: 12px; padding: 4px 0; }

/* Shared styled file label — replaces per-page .sell-file-* / .sb-file-* classes. */
.form-file-label {
    display: flex; align-items: center; gap: 8px;
    padding: 0 12px; height: 34px; margin: 0;
    border: 1px dashed #c7d2fe; border-radius: 7px;
    background: #f8fafc; color: #4f46e5;
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
}
.form-file-label:hover { background: #eef2ff; border-color: #6366f1; }
.form-file-label .form-file-name {
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.form-file-label .form-file-clear {
    display: none; color: #94a3b8; font-size: 10px; background: none; border: none; padding: 0;
}

/* Shared prominent product search bar — replaces .sell-search-bar / inline purchase bar. */
.form-search-bar {
    margin: 6px 0 14px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 12px 14px;
}
.form-search-bar-row { display: flex; align-items: center; gap: 10px; }
.form-search-bar-row > i.fa-search { color: #6366f1; font-size: 16px; }
.form-search-bar .form-control,
.form-search-bar #search_product {
    flex: 1; border: 1px solid #c7d2fe; border-radius: 8px;
    height: 44px; font-size: 15px; padding: 0 14px; background: #fff;
    box-shadow: 0 1px 3px rgba(99,102,241,0.08);
}
.form-search-bar .input-group-btn .btn {
    height: 44px; border-radius: 8px; border: 1px solid #c7d2fe; background: #fff;
}
.form-search-tip {
    margin-top: 6px; font-size: 11px; color: #6366f1;
    display: flex; align-items: center; gap: 6px;
}
.form-search-tip i { font-size: 10px; }

/* ── Multi-input pay term ── */
/* Legacy markup is: <label> <br> <input.width-40.pull-left> <select.width-60.pull-left>.
   .form-control is display:block so the inputs stack unless we flex the container. */
.multi-input { display: flex; flex-wrap: wrap; }
.multi-input > label { flex: 0 0 100%; }
.multi-input > br { display: none; }
.multi-input .width-40 { flex: 0 0 40%; width: 40%; border-radius: 7px 0 0 7px; }
.multi-input .width-60 { flex: 0 0 60%; width: 60%; border-radius: 0 7px 7px 0; border-left: 0; }

/* ── Responsive: stack adjustments grid on small screens ── */
@media (max-width: 991px) {
    .user-edit-card-body [style*="grid-template-columns:1fr 1fr; gap:16px"] {
        grid-template-columns: 1fr !important;
    }
}

/* ══════════════════════════════════════════════════════════════════
   Inline POS-style checkout panel (Add Payment on sell/create)
   Mirrors the POS payment_modal but lives inside a .user-edit-card.
   ══════════════════════════════════════════════════════════════════ */
.checkout-inline {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    align-items: start;
    position: relative;
    z-index: 5;
}
.checkout-inline button,
.checkout-inline .pay-method-tab {
    position: relative;
    z-index: 6;
}
@media (max-width: 991px) {
    .checkout-inline { grid-template-columns: 1fr; }
}
.checkout-inline-left {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 20px;
}
.checkout-inline-right {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pay-section-label {
    font-size: 11px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}

/* Method tabs */
.pay-method-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.pay-method-tab {
    flex: 1; padding: 14px 12px;
    border: 2px solid #e2e8f0; border-radius: 12px;
    background: #fff; cursor: pointer; text-align: center;
    transition: all 0.2s; font-size: 13px; font-weight: 600; color: #64748b;
    font-family: inherit; outline: none;
}
button.pay-method-tab { -webkit-appearance: none; appearance: none; }
.pay-method-tab:hover { border-color: #10b981; background: #f0fdf4; }
.pay-method-tab.active {
    border-color: #10b981; background: #ecfdf5; color: #059669;
    box-shadow: 0 2px 8px rgba(16,185,129,0.15);
}
.pay-method-tab i { display: block; font-size: 22px; margin-bottom: 4px; }

/* Quick cash buttons */
.quick-cash-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px;
}
.quick-cash-btn {
    padding: 12px 8px; border: 2px solid #e2e8f0; border-radius: 10px;
    background: #fff; cursor: pointer; text-align: center;
    font-weight: 700; font-size: 15px; color: #334155; transition: all 0.15s;
}
.quick-cash-btn:hover {
    border-color: #10b981; background: #f0fdf4; transform: translateY(-1px);
}
.quick-cash-btn.exact-btn {
    background: #ecfdf5; color: #059669; border-color: #10b981;
}
.quick-cash-btn.selected {
    border-color: #10b981 !important; background: #ecfdf5 !important; color: #059669 !important;
}

/* Amount input */
.amount-input-wrapper { margin-bottom: 0; }
.amount-input-wrapper label {
    font-size: 12px; font-weight: 600; color: #64748b;
    margin-bottom: 6px; display: block;
}
.amount-display {
    width: 100%; padding: 14px 18px; border: 2px solid #e2e8f0; border-radius: 12px;
    background: #fff; min-height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    transition: all 0.2s;
}
.amount-display:focus-within { border-color: #10b981; background: #f0fdf4; }
.amount-display input[type="text"] {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 28px; font-weight: 700; color: #1e293b;
    font-family: 'SF Mono','Cascadia Code','Consolas',monospace;
    letter-spacing: -0.5px; padding: 0; text-align: left;
}
.amount-display .amount-prefix {
    font-size: 22px; font-weight: 700; color: #94a3b8; margin-right: 6px;
}

/* Split pay */
#checkout-inline-split-container { margin-top: 4px; }
/* Hide the raw legacy payment_row_form markup — only the injected .split-row-card stays visible. */
#checkout-inline-split-container .payment_row > .row,
#checkout-inline-split-container .payment_row > .clearfix,
#checkout-inline-split-container .payment_row .box-body,
#checkout-inline-split-container .payment_row .box-header { display: none !important; }
#checkout-inline-split-container .payment_row { margin: 0; padding: 0; background: transparent; border: none; box-shadow: none; }
#checkout-inline-split-container .payment_row.bg-lightgray {
    background: transparent; border: none; box-shadow: none; margin: 0; padding: 0;
}
.split-row-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 14px 16px; margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    display: flex; align-items: center; gap: 12px;
}
.split-row-card .split-row-num {
    font-size: 12px; font-weight: 800; color: #94a3b8; min-width: 18px;
}
.split-row-card .split-amount-wrap {
    flex: 1; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 6px 12px; display: flex; align-items: center;
}
.split-row-card .split-amount-wrap:focus-within { border-color: #10b981; background: #f0fdf4; }
.split-row-card .split-amount-wrap .amount-prefix { font-size: 14px; font-weight: 700; color: #94a3b8; margin-right: 4px; }
.split-row-card .split-amount-wrap input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 16px; font-weight: 700; color: #1e293b; padding: 6px 0; min-width: 0;
}
.split-method-toggle {
    display: flex; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0;
}
.split-method-btn {
    padding: 8px 14px; border: none; background: #f8fafc; color: #64748b;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 6px;
}
.split-method-btn + .split-method-btn { border-left: 1px solid #e2e8f0; }
.split-method-btn.active { background: #10b981; color: #fff; }
.split-method-btn:hover:not(.active) { background: #f1f5f9; }
.split-row-remove {
    background: #fee2e2; color: #ef4444; border: none; border-radius: 8px;
    width: 32px; height: 32px; display: flex; align-items: center;
    justify-content: center; padding: 0; cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.split-row-remove:hover { background: #fecaca; color: #dc2626; }
#add-payment-row-inline {
    width: 100%; padding: 10px; border: 2px dashed #cbd5e1; border-radius: 10px;
    background: transparent; color: #64748b; font-weight: 600; font-size: 13px;
    cursor: pointer; transition: all 0.2s; margin-top: 4px;
}
#add-payment-row-inline:hover { border-color: #10b981; color: #10b981; background: #f0fdf4; }

/* Right: order summary */
.checkout-inline .order-summary { padding: 18px 20px; flex: 1; }
.checkout-inline .order-summary h5 {
    font-size: 13px; font-weight: 800; color: #334155;
    margin: 0 0 14px; text-transform: uppercase; letter-spacing: 0.5px;
}
.checkout-inline .summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0; font-size: 14px; color: #64748b;
}
.checkout-inline .summary-row.total-row {
    font-size: 19px; font-weight: 800; color: #1e293b;
    border-top: 2px solid #e5e7eb; padding-top: 12px; margin-top: 6px;
}
.checkout-inline .summary-row.change-row {
    font-size: 15px; font-weight: 700; color: #10b981;
    background: #f0fdf4; margin: 8px -20px 0; padding: 11px 20px;
}
.checkout-inline .summary-row.balance-row {
    font-size: 13px; font-weight: 600; color: #ef4444;
    background: #fef2f2; margin: 0 -20px; padding: 10px 20px;
}

/* Advance balance notice */
.checkout-inline .advance-notice {
    background: #fffbeb; border: 1px solid #fbbf24; border-radius: 10px;
    padding: 10px 14px; font-size: 13px; color: #92400e;
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}

/* Hidden legacy payment rows — kept in DOM for form submission.
   Plain display:none: jQuery .val() reads still work on hidden inputs/selects,
   and this guarantees the hidden subtree can't overlay the visible checkout UI. */
.payment-rows-hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   Variable Product → Variation groups (redesigned)
   The underlying DOM is a <table> nested inside <table> (preserved for JS
   compatibility); we flatten it visually to a card-list of groups with a
   clean value list inside. Advanced price fields collapse behind a toggle.
   ═══════════════════════════════════════════════════════════════════════════ */

.variations-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
}
.variations-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.variations-panel-header h4 {
    margin: 0; font-size: 15px; font-weight: 800; color: #0f172a;
    display: flex; align-items: center; gap: 8px;
}
.variations-panel-header h4 i { color: #2563eb; }
.variations-panel-actions {
    display: flex; align-items: center; gap: 10px;
}
.vp-toggle-advanced {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: #64748b; font-weight: 600; cursor: pointer;
    padding: 6px 10px; border-radius: 6px; user-select: none;
    border: 1px solid #e2e8f0; background: #f8fafc;
}
.vp-toggle-advanced input { margin: 0; }
.vp-add-group-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    background: #2563eb; color: #fff; border: none;
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: background 0.15s;
}
.vp-add-group-btn:hover { background: #1d4ed8; }

/* SKU format pill group */
.vp-sku-format {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 10px 14px; background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; margin-bottom: 14px; font-size: 13px;
}
.vp-sku-format-label {
    font-weight: 700; color: #475569; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.vp-sku-format label {
    display: inline-flex; align-items: center; gap: 6px; margin: 0;
    cursor: pointer; color: #334155; font-weight: 500;
}

/* Outer variation table → flat card list.
   Scope `thead { display:none }` to the OUTER table only, otherwise the
   nested .variation_value_table headers disappear too. */
#product_variation_form_part {
    border: none; background: transparent; margin: 0;
}
#product_variation_form_part > thead { display: none; }
#product_variation_form_part > tbody,
#product_variation_form_part > tbody > tr,
#product_variation_form_part > tbody > tr > td {
    display: block; width: 100%; padding: 0; border: none; background: transparent;
}
#product_variation_form_part > tbody > tr.variation_row {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 16px 18px; margin-bottom: 12px; position: relative;
    display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
}
#product_variation_form_part > tbody > tr.variation_row > td:first-child {
    order: 3; grid-column: 1; grid-row: 1;
    width: 32px; justify-self: start;
}
#product_variation_form_part > tbody > tr.variation_row > td:nth-child(2) {
    grid-column: 2; grid-row: 1;
    min-width: 0;
}
#product_variation_form_part > tbody > tr.variation_row > td:nth-child(3) {
    grid-column: 1 / -1; grid-row: 2;
}

.variation_row .delete_complete_row {
    width: 32px; height: 32px; border-radius: 8px;
    background: #fff; border: 1px solid #fecaca;
    color: #dc2626; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.variation_row .delete_complete_row:hover {
    background: #fef2f2; border-color: #f87171;
}

.variation_row > td:nth-child(2) .variation_template,
.variation_row > td:nth-child(2) .variation_name {
    font-size: 15px; font-weight: 700; height: 38px;
    max-width: 340px;
}
.variation_row .variation_template_values_div {
    margin-top: 10px; max-width: 560px;
}
.variation_row .variation_template_values_div label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
    color: #64748b; font-weight: 700; margin-bottom: 4px; display: block;
}

/* Inner variation_value_table → clean row list */
.variation_value_table {
    background: #fff; border: 1px solid #e2e8f0 !important;
    border-radius: 10px; overflow: hidden; margin: 0 !important;
}
.variation_value_table > thead { background: #f1f5f9; }
.variation_value_table > thead > tr > th {
    border: none !important; border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 12px !important;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
    color: #64748b; font-weight: 700; background: #f1f5f9 !important;
}
.variation_value_table > tbody > tr > td {
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 10px 12px !important; vertical-align: middle !important;
    background: #fff;
}
.variation_value_table > tbody > tr:last-child > td {
    border-bottom: none !important;
}
.variation_value_table > tbody > tr:hover > td {
    background: #f8fafc;
}

.variation_value_table .input_sub_sku,
.variation_value_table .variation_value_name {
    height: 34px; font-size: 13px;
}
.variation_value_table .variation_value_name {
    font-weight: 600; color: #0f172a;
}

/* Hide advanced columns by default (purchase price, profit, selling price).
   "Show advanced" toggle flips the .show-advanced class on the panel. */
.variations-panel:not(.show-advanced) .variation_value_table > thead > tr > th:nth-child(3),
.variations-panel:not(.show-advanced) .variation_value_table > thead > tr > th:nth-child(4),
.variations-panel:not(.show-advanced) .variation_value_table > tbody > tr > td:nth-child(3),
.variations-panel:not(.show-advanced) .variation_value_table > tbody > tr > td:nth-child(4) {
    display: none !important;
}
/* Keep selling price (5th) compact when advanced hidden: stack inc/exc tax tightly */
.variations-panel:not(.show-advanced) .variation_value_table .variable_dpp_inc_tax { display: none; }
.variations-panel:not(.show-advanced) .variation_value_table .variable_dsp_inc_tax { display: none; }
.variations-panel:not(.show-advanced) .variation_value_table .variable_dpp_inc_tax ~ .input-group-btn { display: none; }

.variation_value_table .variable_dpp,
.variation_value_table .variable_dpp_inc_tax,
.variation_value_table .variable_dsp,
.variation_value_table .variable_dsp_inc_tax,
.variation_value_table .variable_profit_percent {
    height: 34px; font-size: 13px;
}

.variation_value_table .add_variation_value_row,
.variation_value_table .remove_variation_value_row {
    width: 30px; height: 30px; border-radius: 7px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.variation_value_table .add_variation_value_row {
    background: #eff6ff; border: 1px solid #bfdbfe; color: #2563eb;
    font-size: 18px; font-weight: 800;
}
.variation_value_table .add_variation_value_row:hover {
    background: #dbeafe;
}
.variation_value_table .remove_variation_value_row {
    background: #fff; border: 1px solid #fecaca; color: #dc2626;
}
.variation_value_table .remove_variation_value_row:hover {
    background: #fef2f2;
}

/* Variation image upload — compact & obvious */
.variation-image-cell { width: 90px; }
.variation-image-upload .variation-upload-btn {
    width: 36px; height: 36px; padding: 0; border-radius: 8px;
    background: #f1f5f9 !important; border: 1.5px dashed #94a3b8 !important;
    color: #475569 !important; font-size: 14px;
    display: inline-flex !important; align-items: center; justify-content: center;
    position: relative;
}
.variation-image-upload .variation-upload-btn:hover {
    background: #e2e8f0 !important; border-color: #64748b !important;
}
.variation-image-upload .variation-upload-btn .image-count-badge {
    position: absolute; top: -6px; right: -6px;
    background: #2563eb; color: #fff; font-size: 9px; font-weight: 800;
    border-radius: 99px; min-width: 16px; height: 16px;
    padding: 0 4px; display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}
.variation-image-upload .existing-images .img-thumbnail {
    border-radius: 6px; overflow: hidden; padding: 2px; border: 1px solid #e2e8f0;
}
.variation-image-upload .existing-images .img-thumbnail img {
    width: 32px; height: 32px; object-fit: cover; border-radius: 4px;
}
.variation-image-upload .delete-media {
    background: #dc2626 !important; border: 2px solid #fff;
    width: 18px; height: 18px; border-radius: 99px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 8px; line-height: 1; padding: 0;
}
.variation-image-preview img {
    width: 32px; height: 32px; object-fit: cover; border-radius: 4px;
    margin-right: 2px; border: 1px solid #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Combo Product → POS-ticket-style item list + sticky summary
   ═══════════════════════════════════════════════════════════════════════════ */

.combo-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
}
.combo-panel-header {
    margin-bottom: 14px;
}
.combo-panel-header h4 {
    margin: 0; font-size: 15px; font-weight: 800; color: #0f172a;
    display: flex; align-items: center; gap: 8px;
}
.combo-panel-header h4 i { color: #2563eb; }
.combo-panel-subtitle {
    font-size: 12px; color: #64748b; margin-top: 4px;
}

.combo-search-box {
    position: relative; margin-bottom: 12px;
}
.combo-search-box .input-group {
    border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden;
    background: #f8fafc; transition: all 0.15s;
}
.combo-search-box .input-group:focus-within {
    border-color: #2563eb; background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.combo-search-box .input-group-addon {
    background: transparent !important; border: none !important;
    color: #64748b; padding: 0 12px;
}
.combo-search-box #search_product {
    border: none !important; background: transparent !important;
    box-shadow: none !important; height: 40px; font-size: 13px;
}

/* Combo column headers */
.combo-col-headers {
    display: grid;
    grid-template-columns: 1fr 160px 80px 80px 28px;
    gap: 8px;
    padding: 0 12px 6px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: #94a3b8;
}
.combo-col-headers > div:nth-child(n+2) { text-align: right; }

.combo_product_table {
    background: transparent; border: none !important; margin-bottom: 10px !important;
}
.combo_product_table > thead { display: none; }
.combo_product_table > tbody > tr,
.combo_product_table > tbody > tr > td {
    border: none !important; background: transparent;
}
.combo_product_table > tbody > tr {
    display: grid !important;
    grid-template-columns: 1fr 160px 80px 80px 28px;
    align-items: center; gap: 8px;
    padding: 8px 12px; background: #f8fafc;
    border: 1px solid #e2e8f0 !important; border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.15s;
}
.combo_product_table > tbody > tr:hover {
    background: #fff; border-color: #cbd5e1 !important;
}
.combo_product_table > tbody > tr > td {
    padding: 0 !important;
    text-align: right !important;
}
.combo_product_table > tbody > tr > td:first-child {
    text-align: left !important;
}

/* Product info cell */
.combo-product-info { display: flex; flex-direction: column; gap: 1px; }
.combo-product-name {
    font-weight: 700; color: #0f172a; font-size: 13px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    line-height: 1.3;
}
.combo-variation-badge {
    display: inline-block; padding: 1px 7px;
    background: #ede9fe; color: #6d28d9;
    border-radius: 5px; font-size: 10px; font-weight: 600;
}
.combo-product-sku {
    font-size: 10px; color: #94a3b8; font-weight: 500; font-family: monospace;
}

/* Qty + Unit inline */
.combo-qty-unit {
    display: flex; align-items: center; gap: 4px;
}
.combo-qty-unit .quantity {
    height: 32px !important; width: 60px !important; min-width: 60px; flex-shrink: 0;
    text-align: center; font-size: 13px; font-weight: 700;
    border-radius: 6px; padding: 0 4px;
}
.combo-qty-unit .sub_unit {
    height: 32px; font-size: 11px; border-radius: 6px;
    flex: 1; min-width: 70px;
}
.combo-unit-tag {
    font-size: 12px; color: #475569; font-weight: 600;
    white-space: nowrap; padding: 0 4px;
}

/* Price displays */
.combo_product_table .purchase_price_text {
    font-size: 12px; color: #475569; font-weight: 600;
}
.combo_product_table .item_level_purchase_price {
    font-size: 13px; color: #0f172a; font-weight: 800;
}

/* Remove button */
.combo-remove-btn {
    width: 26px; height: 26px; border-radius: 6px;
    background: transparent; border: none;
    display: inline-flex; align-items: center; justify-content: center;
    color: #dc2626; font-size: 13px; cursor: pointer;
    transition: all 0.15s; opacity: 0.5;
}
.combo_product_table > tbody > tr:hover .combo-remove-btn { opacity: 1; }
.combo-remove-btn:hover {
    background: #fef2f2;
}

.combo_product_table > tfoot { display: none; }

.combo-empty-state {
    text-align: center; padding: 24px 16px;
    background: #f8fafc; border: 2px dashed #e2e8f0; border-radius: 8px;
    color: #94a3b8; font-size: 12px; margin-bottom: 10px;
}
.combo-empty-state i {
    font-size: 28px; display: block; margin-bottom: 6px; opacity: 0.4;
}

.combo-summary-panel {
    border: 1px solid #e2e8f0; border-radius: 10px;
    overflow: hidden; margin-top: 6px;
}
.combo-summary-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
}
.combo-summary-row.net-total {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-bottom: 1px solid #a7f3d0;
}
.combo-summary-row.net-total .lbl {
    font-size: 11px; font-weight: 700; color: #065f46;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.combo-summary-row.net-total .val {
    font-size: 16px; font-weight: 800; color: #064e3b;
}
.combo-summary-inputs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    background: #fff;
}
.combo-summary-inputs .combo-field {
    padding: 12px 16px;
}
.combo-summary-inputs .combo-field:first-child {
    border-right: 1px solid #e2e8f0;
}
.combo-summary-inputs .combo-field label {
    display: block; font-size: 11px; color: #64748b;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
    margin-bottom: 6px;
}
.combo-summary-inputs .combo-field .form-control {
    height: 40px; font-size: 16px; font-weight: 700;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
}
.combo-summary-inputs .combo-field .form-control:focus {
    border-color: #2563eb; background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ═══════════ VARIABLE PRODUCT STOCK EXPLAINER ═══════════ */
.kasa-variable-stock-explainer {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
}
.kasa-variable-stock-explainer .kv-ex-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: #2563eb; color: #fff;
    border-radius: 8px;
    font-size: 16px;
}
.kasa-variable-stock-explainer .kv-ex-body { flex: 1; min-width: 0; }
.kasa-variable-stock-explainer .kv-ex-title {
    font-size: 14px; font-weight: 700; color: #1e3a8a;
    margin-bottom: 4px;
}
.kasa-variable-stock-explainer .kv-ex-text {
    font-size: 12.5px; line-height: 1.5; color: #1e40af;
}
