/* ═══════════════════════════════════════════════════════════════════
   POS PAGE STYLESHEET (merged + deduplicated)
   resources/css/pos-page.css — loaded via panel ->assets()

   Contents:
   1. Colour tokens (light + dark)
   2. Layout (wrap, products column)
   3. Cart column (tabs, bills, customer, items, totals, checkout)
   4. Receipt modal
   5. POS additions (held/online lists, modals, void/comp,
      split/merge, hold button, badges)
   6. Cart fold, narrow screens (one side at a time), windows on phones
   ═══════════════════════════════════════════════════════════════════ */
[x-cloak] { display: none !important; }
/* ── 1. Colour tokens ─────────────────────────────────────────────── */
:root {
    --pos-bg: #f9fafb;
    --pos-surface: #ffffff;
    --pos-border: #e5e7eb;
    --pos-border-light: #f3f4f6;
    --pos-text: #111827;
    --pos-text-muted: #6b7280;
    --pos-text-faint: #9ca3af;
    --pos-input-bg: #f9fafb;
    --pos-primary: #6366f1;
    --pos-primary-dk: #4f46e5;
    --pos-primary-bg: #eef2ff;
    --pos-primary-text: #4338ca;
    --pos-success: #16a34a;
    --pos-success-bg: #f0fdf4;
    --pos-success-bd: #bbf7d0;
    --pos-success-text: #166534;
    --pos-danger: #dc2626;
    --pos-danger-bg: #fef2f2;
    --pos-danger-bd: #fecaca;
    --pos-warning: #d97706;
    --pos-warning-bg: #fffbeb;
    --pos-warning-bd: #fde68a;
}

html.dark {
    --pos-bg: #111827;
    --pos-surface: #1f2937;
    --pos-border: #374151;
    --pos-border-light: #2d3748;
    --pos-text: #f9fafb;
    --pos-text-muted: #9ca3af;
    --pos-text-faint: #6b7280;
    --pos-input-bg: #111827;
    --pos-primary: #818cf8;
    --pos-primary-dk: #6366f1;
    --pos-primary-bg: #1e1b4b;
    --pos-primary-text: #a5b4fc;
    --pos-success: #4ade80;
    --pos-success-bg: #052e16;
    --pos-success-bd: #166534;
    --pos-success-text: #86efac;
    --pos-danger: #f87171;
    --pos-danger-bg: #450a0a;
    --pos-danger-bd: #7f1d1d;
    --pos-warning: #fbbf24;
    --pos-warning-bg: #451a03;
    --pos-warning-bd: #78350f;
}
.fi-page .fi-page-content,
.fi-main {
    padding-top: 0 !important;
    gap: 0 !important;
}.pos-suspended-chip.active {
    border-color: var(--pos-primary, #0E4EB4);
    box-shadow: 0 0 0 1px var(--pos-primary, #0E4EB4);
    background: color-mix(in srgb, var(--pos-primary, #0E4EB4) 10%, transparent);
}
/* ── 2. Layout ────────────────────────────────────────────────────── */
.pos-wrap {
    max-width: none;
    width: 100%;
    margin: 0;
    display: grid;
    /* products | cart — products collapses to a thin rail */
    grid-template-columns: 1fr 485px;
    height: calc(100vh - 128px);
    min-height: 580px;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--pos-border);
    transition: grid-template-columns .22s ease;
}
/* The rail button that lives at the top of the products column */
.pos-catalog-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1.5px solid var(--pos-border);
    background: var(--pos-input-bg);
    color: var(--pos-text);
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.pos-catalog-toggle:hover {
    border-color: var(--pos-primary);
    color: var(--pos-primary);
    background: var(--pos-primary-bg);
}
 /* Collapsed: catalogue shrinks to a rail; cart is capped (not full-bleed).
   The whole card shrinks to rail + cart and centres — no empty gap. */
 /* Collapsed: catalogue shrinks to a rail; cart is a flat 750px cap.
   width:max-content sizes the card to rail + cart (no empty gap) and centres it. */
.pos-wrap.catalog-collapsed {
    grid-template-columns: 52px 800px;
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
}
/* Dedicated cashier (no build rights): no products column at all — cart owns
   the whole card. Overrides the normal two-column and the collapsed rule. */
.pos-wrap.no-catalog {
    grid-template-columns: 1fr;
    width: 100%;
}
/* Narrow screens (< ~820px): let the cart shrink to fit instead of overflowing. */
@media (max-width: 820px) {
    .pos-wrap.catalog-collapsed {
        grid-template-columns: 52px 1fr;
        width: 100%;
    }
}
/* When collapsed, hide everything in the products column except the rail,
   and turn the topbar into a vertical rail. */
.pos-wrap.catalog-collapsed .pos-products > *:not(.pos-rail) { display: none; }
.pos-rail {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
}
/* Only the products rail: the cart side has a rail of its own (section 6). */
.pos-wrap.catalog-collapsed .pos-products > .pos-rail { display: flex; }
.pos-rail-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--pos-text-faint);
    text-transform: uppercase;
    user-select: none;
}

/* ── Left: Products ── */
.pos-products {
    display: flex;
    flex-direction: column;
    background: var(--pos-surface);
    overflow: hidden;
    border-radius: 16px 0 0 16px;
}

.pos-topbar {
    padding: 14px 18px;
    border-bottom: 1px solid var(--pos-border-light);
    background: var(--pos-surface);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.pos-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--pos-input-bg);
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    padding: 6px ;
    transition: border-color .15s;
    margin-top: 10px !important;
}

.pos-search:focus-within {
    border-color: var(--pos-primary);
}

.pos-search input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: var(--pos-text);
}

.pos-search input::placeholder {
    color: var(--pos-text-faint);
}

.pos-cats {
    padding: 10px 18px 14px;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    border-bottom: 1px solid var(--pos-border-light);
    scrollbar-width: thin;
    scrollbar-color: var(--pos-border) transparent;
    flex-shrink: 0;
}

.pos-cats::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid var(--pos-border);
    background: var(--pos-surface);
    cursor: pointer;
    white-space: nowrap;
    color: var(--pos-text);
    transition: all .15s;
}

.cat-chip:hover {
    border-color: var(--pos-primary);
    color: var(--pos-primary);
}

.cat-chip.active {
    background: var(--pos-primary);
    border-color: var(--pos-primary);
    color: #fff;
}

.pos-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 10px;
    align-content: start;
    background: var(--pos-bg);
}

.pos-grid::-webkit-scrollbar {
    width: 4px;
}

.pos-grid::-webkit-scrollbar-thumb {
    background: var(--pos-border);
    border-radius: 4px;
}

.product-card {
    background: var(--pos-surface);
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all .18s ease;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    user-select: none;
}

.product-card:hover {
    border-color: var(--pos-primary);
    box-shadow: 0 4px 18px rgba(99, 102, 241, .13);
    transform: translateY(-2px);
}

.product-card:active {
    transform: scale(1);
}

.product-card.out-of-stock {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

.product-card.inactive {
    opacity: .45;
    filter: grayscale(.8);
}

.product-card.inactive:hover {
    opacity: .6;
}

.product-thumb {
    width: 100%;
    aspect-ratio: 1.5;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 6px;
    background: var(--pos-border-light);
}

.product-emoji-fallback {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    background: var(--pos-border-light);
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--pos-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--pos-primary);
}

.product-stock {
    font-size: 10px;
    color: var(--pos-text-faint);
}

.in-cart-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--pos-primary);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── 3. Right: Cart column ────────────────────────────────────────── */
/* ── Right: Cart column — 3-zone grid ──────────────────────────────── */
.pos-cart {
    background: var(--pos-bg);
    border-left: 1px solid var(--pos-border);
    display: grid;
    grid-template-rows: auto 1fr auto;   /* header | scroll body | footer */
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 0 16px 16px 0;
}

/* Zone 1 — fixed header (tabs). */
.pos-cart > .pos-tabs { grid-row: 1; }

/* Zone 2 — the ONE scroll region. Everything contextual lives here and
   scrolls together: held/online lists, customer, cart lines. */
.pos-cart-body {
    grid-row: 2;
    min-height: 0;
    overflow: hidden;                 /* children scroll, not the body itself */
    display: flex;
    flex-direction: column;
}
.pos-cart-body::-webkit-scrollbar { width: 4px; }
.pos-cart-body::-webkit-scrollbar-thumb { background: var(--pos-border); border-radius: 999px; }
/* When a held/online sale is loaded, the line-item list sizes to its
   content instead of stretching to the footer — so a 1-item sale is one
   row tall, not a screen of dead space. Still scrolls if a sale is long. */
 
/* Zone 3 — pinned action footer. Never scrolls; primary CTA always visible. */
.pos-cart-footer {
    grid-row: 3;
    background: var(--pos-surface);
    border-top: 1px solid var(--pos-border);
    box-shadow: 0 -6px 18px rgba(0,0,0,.05);
}

/* ── Browsing a tab list (held/online) with nothing selected yet ──
   Let the sales list claim the whole cart body so as many tabs as
   possible show; fold the empty-cart placeholder away entirely.
   Selecting a sale sets $activeOrderId → .browsing-list drops → the
   list returns to the 96px picker strip and the cart re-appears. */
.pos-cart-body.browsing-list > .pos-bills-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.pos-cart-body.browsing-list > .pos-bills-section .pos-bills-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
}
.pos-cart-body.browsing-list > .cart-items {
    display: none;
}
/* Compact rows while browsing a full-height list — keep them dense so
   as many tabs as possible fit before scrolling. */
.pos-cart-body.browsing-list .pos-bill-row {
    padding: 5px 10px;
    border-radius: 6px;
}
.pos-cart-body.browsing-list .pos-bill-row-right--stack {
    gap: 1px;
}
.pos-cart-body.browsing-list .pos-status-badge {
    margin-top: 0;
    padding: 1px 7px;
    font-size: 9px;
}
/* Resumed held/online sale: line items size to content, not to the
   whole column — kills the dead space under a short sale. New Sale is
   unaffected (no .active-sale), so its cart still grows to fill. */
.pos-cart-body.active-sale > .cart-items {
    flex: 1 1 auto;      /* was 0 0 auto — now grows to take the slack */
    min-height: 0;
    max-height: none;    /* the flex box bounds it; strip is already capped */
    overflow-y: auto;
    align-content: flex-start;   /* rows pack to the top of the grown box */
}
/* Strip grows to fill whatever the items don't use. has-active ⟺ active-sale,
   so this always co-applies; higher specificity beats the 168px cap. */
.pos-cart-body.active-sale > .pos-bills-section {
    flex: 0 1 auto;          /* was 1 1 auto somewhere — MUST be 0 grow */
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.pos-cart-body.active-sale > .pos-bills-section .pos-bills-list.has-active {
    flex: 0 1 auto;
    max-height: 300px;
    min-height: 66px;
    overflow-y: auto;
}
html.dark .pos-cart-footer { box-shadow: 0 -6px 18px rgba(0,0,0,.25); }
/* These are now plain blocks inside .pos-cart-body — the body scrolls, not them. */
 .pos-cart-body > .cart-items {
    flex: 1 1 auto;
    min-height: 180px;                /* never collapses to nothing */
    overflow-y: auto;
    overscroll-behavior: contain;
}
.pos-cart-body > .cart-items::-webkit-scrollbar { width: 4px; }
.pos-cart-body > .cart-items::-webkit-scrollbar-thumb { background: var(--pos-border); border-radius: 999px; }

.pos-cart-body > .pos-bills-section {
    flex: none;                       /* picker never grows */
}
.pos-cart-body > .pos-bills-section .pos-bills-list {
    max-height: 220px;                /* browsing: a few tabs, own scroll */
    overflow-y: auto;
}

.pos-cart-body > .pos-bills-section .pos-bills-list.has-active {
    max-height: 168px;                /* was 96px — ~3–4 compact rows */
    overflow-y: auto;
}

/* Totals now sit at the top of the pinned footer — compact, always visible. */
.pos-cart-footer .cart-totals {
    padding: 5px 16px 4px;
}
/* Checkout panel: less padding all round */
.pos-cart-footer .checkout-panel {
      padding: 6px 14px 7px;

}
/* Online confirm CTA: shorter than the settle button — it's a status
   advance, not a payment, so it doesn't need the full-height treatment. */
/* Slimmer footer CTAs */
.pos-cart-footer .pos-action-row .place-order-btn,
.pos-cart-footer .checkout-panel .place-order-btn {
    padding: 9px 14px;
    font-size: 13px;
}
/* Clear cart + New sale on ONE row, side by side */
.pos-cart-footer .pos-bottom-links {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}
.pos-cart-footer .pos-bottom-links .clear-cart-btn {
    flex: 1;
    margin-top: 0;
    padding: 5px;
    border: 1px solid var(--pos-border-light);
    border-radius: 8px;
}
.pos-cart-footer .pos-bottom-links .clear-cart-btn:hover {
    border-color: var(--pos-text-faint);
}
/* Payment method label: shrink and tighten */
.pos-cart-footer .checkout-panel .section-label {
    margin-bottom: 5px;
}

.pos-cart-footer .cart-totals .total-row {
    font-size: 12px;
    margin-bottom: 2px;
}
/* Payment buttons: shorter, tighter grid */
.pos-cart-footer .payment-methods {
        margin-bottom: 7px;

    grid-template-columns: repeat(4, 1fr);
}
.pos-cart-footer .payment-btn {
    padding: 5px 4px;
    font-size: 11px;
}
/* Change display: tighter */
.pos-cart-footer .change-display {
    padding: 6px 12px;
    margin-bottom: 7px;
}
/* Primary CTA row: slightly shorter button */
.pos-cart-footer .pos-action-row .place-order-btn {
    padding: 11px 14px;
}
.pos-cart-footer .clear-cart-btn {
    margin-top: 4px;
    padding: 4px;
}
/* Tendered input: shorter */
.pos-cart-footer .tendered-input {
  padding: 6px 12px;
    margin-bottom: 6px;
    font-size: 13px;
 }
.pos-cart-footer .cart-totals .total-row.grand {
    font-size: 15px;
    margin-top: 5px;
    padding-top: 5px;
}
.pos-more-actions {
    margin-top: 8px;
    border-top: 1px solid var(--pos-border-light);
    padding-top: 8px;
}
.pos-more-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pos-text-faint);
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 4px;
}
.pos-more-summary::-webkit-details-marker { display: none; }
.pos-more-summary:hover { color: var(--pos-text); }
.pos-more-actions[open] .pos-more-summary { color: var(--pos-text); margin-bottom: 6px; }



/* fixed sections never grow/shrink; .cart-items claims the leftover */
.pos-tabs,
.pos-bills-section,
.customer-section,
.cart-totals,
.checkout-panel {
    flex: 0 0 auto;
}

/* ── Top tabs (New Sale | Held | Online + right-side pills) ── */
.pos-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--pos-border);
    background: var(--pos-surface);
    padding-right: 10px;
}

.pos-tab {
    flex: 0 0 auto;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--pos-text);
    transition: color .15s, border-color .15s, background .15s;
}

.pos-tab:hover {
    color: var(--pos-text);
}

.pos-tab.active {
    color: var(--pos-primary-text);
    border-bottom-color: var(--pos-primary);
    background: var(--pos-primary-bg);
}

.pos-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    background: var(--pos-primary);
    color: #fff;
}

html.dark .pos-tab-badge {
    color: var(--pos-bg);
}

.pos-tabs-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-tabs-right .cart-count,
.pos-active-sale-tag {
    white-space: nowrap;
}

.pos-active-sale-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
    vertical-align: middle;
}

.cart-count {
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

/* ── Held / Online lists ── */
.pos-bills-section {
    border-bottom: 1px solid var(--pos-border);
    background: var(--pos-surface);
}

.pos-bills-search {
    padding: 0 14px 10px;
}

.pos-bills-list {
    overflow-y: auto;
    padding: 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 132px;          /* ≈ 2 rows + gap */
    overscroll-behavior: contain;
}

/* collapse further once a sale is loaded into the cart */
.pos-bills-list.collapsed {
    max-height: 66px;
}

 .pos-bill-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 11px;
    border: 1px solid var(--pos-border);
    border-radius: 7px;
    background: var(--pos-surface);
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, background .15s;
}

.pos-bill-row:hover {
    border-color: var(--pos-primary);
}

.pos-bill-row.active {
    border-color: var(--pos-primary);
    background: var(--pos-primary-bg);
}

.pos-bill-row-left {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 0 1 auto;
    min-width: 0;
}



.pos-bill-row-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
 
.pos-bill-row-mid {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;   /* was center — now hugs the order number */
    min-width: 0;
    margin-left: 2px;              /* small breathing gap after the number block */
}

.pos-bill-row-mid .pos-bill-items {
    font-size: 11px;
    color: var(--pos-text-muted);
    white-space: nowrap;
}

.pos-bill-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--pos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-bill-meta {
    font-size: 10px;
    color: var(--pos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pos-bill-row-right--stack {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.pos-bill-total {
    font-size: 12px;
    font-weight: 800;
    color: var(--pos-text);
}

.pos-bill-items {
    font-size: 10px;
    color: var(--pos-text-faint);
}

.pos-bills-empty {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--pos-text-faint);
}

/* ── Customer section ── */
.customer-section {
    padding: 11px 14px;
    border-bottom: 1px solid var(--pos-border);
    background: var(--pos-surface);
    position: relative;
}

.section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--pos-text-faint);
    margin-bottom: 6px;
}

.customer-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--pos-input-bg);
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    padding: 7px 12px;
    transition: border-color .15s;
}

.customer-input-wrap:focus-within {
    border-color: var(--pos-primary);
}

.customer-input-wrap input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 13px;
    width: 100%;
    color: var(--pos-text);
}

.customer-input-wrap input::placeholder {
    color: var(--pos-text-faint);
}

.customer-selected {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    background: var(--pos-success-bg);
    border: 1.5px solid var(--pos-success-bd);
    border-radius: 10px;
}

.customer-avatar {
    width: 30px;
    height: 30px;
    background: var(--pos-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.customer-dropdown {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(100% - 2px);
    background: var(--pos-surface);
    border: 1.5px solid var(--pos-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    z-index: 50;
    overflow: hidden;
}

.customer-result {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--pos-border-light);
    transition: background .12s;
}

.customer-result:hover {
    background: var(--pos-primary-bg);
}

.customer-result:last-child {
    border-bottom: none;
}

.customer-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--pos-text);
}

.customer-result-sub {
    font-size: 11px;
    color: var(--pos-text-faint);
}
.cart-unit-chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--pos-primary, #0E4EB4)22;
    color: var(--pos-primary, #0E4EB4);
    vertical-align: middle;
    margin-left: 2px;
}

/* Editable qty input */
.qty-input {
    width: 40px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--pos-text, #e5e5e5);
    font-family: inherit;
    padding: 0;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-input:focus {
    outline: none;
    background: var(--pos-surface, #26262e);
    border-radius: 6px;
}
/* ── Cart items (claims leftover column height, scrolls) ── */
 .cart-items {
    flex: 1 1 auto;
    min-height: 160px;
    padding: 10px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cart-item {
    background: var(--pos-surface);
    border-radius: 10px;
    padding: 6px 10px;          /* tighter */
    gap: 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    border: 1px solid var(--pos-border);
}
/* Held line: name sizes to content so the ×2 · Held badge sits right
   after it; the badge then pushes buttons to the far right via margin-auto. */
.cart-item .pos-held-badge {
    flex-shrink: 0;
    margin-left: 6px;
}
.cart-item .pos-held-actions {
    margin-left: auto;   /* buttons to the right edge, badge stays by the name */
}
/* Tighter cart lines: name + unit + price share one flowing row */
/* Expanded held/online sale lines: flat rows, no radius, only a divider
   between them (border-bottom), collapsed margins so they stack tight. */
/* Expanded held/online sale lines: flat rows, no radius, only a divider
   between them. Tighter vertical padding so they don't sit so tall. */
.cart-items .cart-item {
    padding: 3px 10px;
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid var(--pos-border);
    border-radius: 0;
    background: transparent;
    min-height: 0;
}
.cart-items .cart-item:first-child {
    border-top: 1px solid var(--pos-border);
}
.cart-items .cart-item-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    white-space: normal;        /* was nowrap+ellipsis — now flows to price */
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
}
/* Inline price — sits right after the unit chip */
.cart-inline-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--pos-text);
    font-family: inherit;
}
.cart-inline-price:hover {
    color: var(--pos-primary);
}
/* Held/voided/comped: NO left border bar, just subtle differentiation */
.cart-item.held {
    background: var(--pos-bg);
    /* border-left removed */
}

.cart-item.voided {
    opacity: .65;
    /* border-left removed */
}

.cart-item.comped {
    /* border-left removed */
}
 

.cart-item-emoji {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--pos-border-light);
    flex-shrink: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--pos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 11px;
    color: var(--pos-text);
    margin-top: 1px;
}

.pos-held-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--pos-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1.5px solid var(--pos-border);
    background: var(--pos-input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--pos-text);
    transition: all .12s;
    line-height: 1;
    padding: 0;
}

.qty-btn:hover {
    border-color: var(--pos-primary);
    color: var(--pos-primary);
    background: var(--pos-primary-bg);
}

.qty-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--pos-text);
    min-width: 18px;
    text-align: center;
}

.empty-cart {
    text-align: center;
    padding: 44px 20px;
}

.empty-cart-icon {
    font-size: 44px;
    margin-bottom: 10px;
    opacity: .4;
}

/* ── Totals ── */
.cart-totals {
    background: var(--pos-surface);
    border-top: 1px solid var(--pos-border);
    padding: 12px 16px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--pos-text);
    margin-bottom: 5px;
}

.total-row.grand {
    font-size: 17px;
    font-weight: 700;
    color: var(--pos-text);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1.5px solid var(--pos-border);
}

/* ── Checkout panel ── */
.checkout-panel {
    background: var(--pos-surface);
    border-top: 1px solid var(--pos-border);
    padding: 12px 14px;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.payment-btn {
    padding: 7px 8px;
    border-radius: 9px;
    border: 1.5px solid var(--pos-border);
    background: var(--pos-input-bg);
    font-size: 12px;
    font-weight: 600;
    color: var(--pos-text);
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}

.payment-btn:hover {
    border-color: var(--pos-primary);
    color: var(--pos-primary);
}

.payment-btn.selected {
    background: var(--pos-primary);
    border-color: var(--pos-primary);
    color: #fff;
}

.tendered-input {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pos-text);
    background: var(--pos-input-bg);
    outline: none;
    margin-bottom: 8px;
    transition: border .15s;
    box-sizing: border-box;
}

.tendered-input:focus {
    border-color: var(--pos-primary);
}

.tendered-input::placeholder {
    color: var(--pos-text-faint);
    font-weight: 400;
}

.change-display {
    background: var(--pos-success-bg);
    border: 1.5px solid var(--pos-success-bd);
    border-radius: 10px;
    padding: 7px 13px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--pos-success-text);
    margin-bottom: 9px;
}

/* Hold button */
.hold-sale-btn {
    width: 100%;
    padding: 11px;
    margin-bottom: 8px;
    border: 1.5px dashed var(--pos-primary);
    border-radius: 10px;
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s;
}

.hold-sale-btn:hover {
    filter: brightness(.97);
}

html.dark .hold-sale-btn:hover {
    filter: brightness(1.15);
}

.hold-sale-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Charge / place order */
.place-order-btn {
    width: 100%;
    padding: 12px;
    background: var(--pos-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.place-order-btn:hover {
    background: var(--pos-primary-dk);
    transform: translateY(-1px);
}

.place-order-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

/* Hold + Charge on one row */
.pos-action-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.pos-action-row .hold-sale-btn,
.pos-action-row .place-order-btn {
    width: auto;
    margin: 0;
    padding: 12px 14px;
    font-size: 13px;
}

.pos-action-row .hold-sale-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.pos-action-row .place-order-btn {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Secondary actions (Split / Merge / Void Sale) */
.pos-secondary-actions {
    display: flex;
    gap: 6px;
    margin: 8px 0;
}

.pos-secondary-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    background: transparent;
    color: var(--pos-text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.pos-secondary-btn:hover {
    border-color: var(--pos-text);
    color: var(--pos-text);
}

.pos-secondary-btn.danger {
    border-color: var(--pos-danger);
    color: var(--pos-danger);
}

.pos-secondary-btn.danger:hover {
    background: var(--pos-danger);
    color: #fff;
}

html.dark .pos-secondary-btn.danger:hover {
    color: var(--pos-bg);
}

.clear-cart-btn {
    width: 100%;
    margin-top: 7px;
    padding: 6px;
    background: none;
    border: none;
    font-size: 12px;
    color: var(--pos-text-faint);
    cursor: pointer;
    transition: color .15s;
}

.clear-cart-btn:hover {
    color: #ef4444;
}

/* ── Online status badges ── */
.pos-status-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    margin-top: 2px;
}

.pos-status-pending   { background: #fef3c7; color: #92400e; }
.pos-status-confirmed { background: #dbeafe; color: #1e40af; }
.pos-status-preparing { background: #fce7f3; color: #9d174d; }
.pos-status-ready     { background: #d1fae5; color: #065f46; }

html.dark .pos-status-pending   { background: #451a03; color: #fbbf24; }
html.dark .pos-status-confirmed { background: #172554; color: #93c5fd; }
html.dark .pos-status-preparing { background: #500724; color: #f9a8d4; }
html.dark .pos-status-ready     { background: #052e16; color: #86efac; }

/* ── Adjustment badges (VOID / COMP) ── */
.pos-adj-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .5px;
    vertical-align: middle;
    text-decoration: none !important;
}

.pos-adj-void {
    background: var(--pos-danger-bg);
    border: 1px solid var(--pos-danger-bd);
    color: var(--pos-danger);
}

.pos-adj-comp {
    background: var(--pos-warning-bg);
    border: 1px solid var(--pos-warning-bd);
    color: var(--pos-warning);
}

/* ── Void / Comp mini-buttons on held cart lines ── */
.pos-void-btn,
.pos-comp-btn {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    transition: background .15s, color .15s;
}

.pos-void-btn {
    border: 1px solid var(--pos-danger);
    color: var(--pos-danger);
}

.pos-void-btn:hover {
    background: var(--pos-danger);
    color: #fff;
}

html.dark .pos-void-btn:hover {
    color: var(--pos-bg);
}

.pos-comp-btn {
    border: 1px solid var(--pos-warning);
    color: var(--pos-warning);
}

.pos-comp-btn:hover {
    background: var(--pos-warning);
    color: #fff;
}

html.dark .pos-comp-btn:hover {
    color: var(--pos-bg);
}

/* ── 4. Generic modal (split / merge / void / comp) ─────────────── */
.pos-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

html.dark .pos-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.pos-modal {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: posFadeIn .2s ease;
}

.pos-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--pos-border);
    font-size: 15px;
    font-weight: 800;
    color: var(--pos-text);
    flex-shrink: 0;
}

.pos-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--pos-text-faint);
    padding: 2px 6px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.pos-modal-close:hover {
    color: var(--pos-text);
    background: var(--pos-bg);
}

.pos-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
    color: var(--pos-text);
}

.pos-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 18px;
    border-top: 1px solid var(--pos-border);
    flex-shrink: 0;
}

.pos-modal-footer .btn-filled:disabled,
.pos-modal-footer .btn-filled[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

/* Modal confirm variants */
.pos-btn-void {
    background: var(--pos-danger) !important;
    border-color: var(--pos-danger) !important;
    color: #fff !important;
}

html.dark .pos-btn-void {
    color: var(--pos-bg) !important;
}

.pos-btn-comp {
    background: var(--pos-warning) !important;
    border-color: var(--pos-warning) !important;
    color: #fff !important;
}

html.dark .pos-btn-comp {
    color: var(--pos-bg) !important;
}

.pos-danger-box {
    background: var(--pos-danger-bg);
    border: 1px solid var(--pos-danger-bd);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.pos-danger-box-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--pos-danger);
    margin-bottom: 4px;
}

/* Inputs inside modals & panels */
.pos-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--pos-input-bg);
    color: var(--pos-text);
    outline: none;
    transition: border-color .15s;
}

.pos-input:focus {
    border-color: var(--pos-primary);
}

.pos-input::placeholder {
    color: var(--pos-text-faint);
}

html.dark .pos-input option {
    background: var(--pos-surface);
    color: var(--pos-text);
}

.pos-pin-input {
    letter-spacing: 6px;
    font-weight: 800;
    font-size: 16px;
    text-align: center;
}

.pos-vc-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--pos-text);
    margin-bottom: 5px;
}

.pos-vc-item-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-bg);
    color: var(--pos-text);
}

/* Split / Merge item rows */
.pos-split-items,
.pos-merge-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.pos-split-item,
.pos-merge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-surface);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.pos-split-item:hover,
.pos-merge-item:hover {
    border-color: var(--pos-primary);
}

.pos-split-item.selected,
.pos-merge-item.selected {
    border-color: var(--pos-primary);
    background: var(--pos-primary-bg);
}

.pos-split-item-check,
.pos-merge-item-check {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.pos-split-item-check span,
.pos-merge-item-check span {
    color: var(--pos-primary) !important;
}

.pos-split-item-info,
.pos-merge-item-info {
    flex: 1;
    min-width: 0;
}

.pos-split-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--pos-text);
}

.pos-split-item-price {
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--pos-text);
}

/* ── 5. Receipt modal ─────────────────────────────────────────────── */
.receipt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.receipt-modal {
    background: var(--pos-surface);
    border-radius: 20px;
    width: 100%;
    max-width: 410px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
    border: 1px solid var(--pos-border);
}

.receipt-header {
    background: var(--pos-primary);
    padding: 26px 24px 20px;
    text-align: center;
    color: #fff;
}

.receipt-success-icon {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, .2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.receipt-body {
    padding: 18px 22px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 7px;
    color: var(--pos-text);
}

.receipt-row strong {
    color: var(--pos-text);
}

.receipt-row.total {
    font-size: 16px;
    font-weight: 700;
    color: var(--pos-text);
    padding-top: 10px;
    border-top: 1.5px dashed var(--pos-border);
    margin-top: 6px;
}

.receipt-items {
    background: var(--pos-bg);
    border-radius: 10px;
    padding: 11px 13px;
    margin: 10px 0;
    border: 1px solid var(--pos-border);
}

.receipt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 5px;
    color: var(--pos-text);
}

.receipt-item:last-child {
    margin-bottom: 0;
}

.receipt-item-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--pos-border-light);
    flex-shrink: 0;
}

.receipt-item-label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.receipt-actions {
    padding: 14px 22px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--pos-border);
}

.btn-outline {
    flex: 1;
    padding: 10px;
    border: 1.5px solid var(--pos-border);
    background: var(--pos-input-bg);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--pos-text);
    transition: all .15s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-outline:hover {
    border-color: var(--pos-primary);
    color: var(--pos-primary);
}

.btn-filled {
    flex: 1;
    padding: 10px;
    background: var(--pos-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.btn-filled:hover {
    background: var(--pos-primary-dk);
}

/* ── Shared scrollbars & animations ──────────────────────────────── */
.pos-bills-list::-webkit-scrollbar,
.cart-items::-webkit-scrollbar {
    width: 4px;
}

.pos-bills-list::-webkit-scrollbar-thumb,
.cart-items::-webkit-scrollbar-thumb {
    background: var(--pos-border);
    border-radius: 999px;
}

.pos-bills-list::-webkit-scrollbar-track,
.cart-items::-webkit-scrollbar-track {
    background: transparent;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes posFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── 6. Cart fold, narrow screens, windows on phones ──────────────── */

/* The till sits in .pos-shell so its rules can follow the width it really
   has (the screen less the side menu), not the width of the whole screen. */
.pos-shell {
    container-type: inline-size;
    container-name: pos-shell;
    width: 100%;
}

/* ── Cart side folded to a rail (wide screens), like the products side ── */
.pos-wrap.cart-collapsed {
    grid-template-columns: 1fr 52px;
}
.pos-wrap.cart-collapsed .pos-cart {
    display: block;
}
.pos-wrap.cart-collapsed .pos-cart > *:not(.pos-rail) { display: none; }
.pos-wrap.cart-collapsed .pos-cart > .pos-rail { display: flex; }

/* The "hide cart" button at the right end of the tabs */
.pos-cart-toggle {
    width: 28px;
    height: 28px;
}

/* ── Bar that chooses the side on narrow screens (hidden on wide ones) ── */
.pos-pane-switch {
    display: none;
    gap: 6px;
    margin-bottom: 8px;
}
.pos-pane-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1.5px solid var(--pos-border);
    border-radius: 12px;
    background: var(--pos-surface);
    color: var(--pos-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, background .15s, color .15s;
}
.pos-pane-btn.active {
    border-color: var(--pos-primary);
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
}
.pos-pane-btn:disabled {
    cursor: progress;
}
.pos-pane-total {
    font-size: 13px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Narrow: the till has 860px or less. One side at a time, full width. ──
   Products show unless the products side is folded; then the cart shows.
   The bar above switches between them (PointOfSale::showPane()). A cashier
   with no products side (.no-catalog) always sees the cart. */
@container pos-shell (max-width: 860px) {
    .pos-pane-switch {
        display: flex;
    }

    .pos-wrap,
    .pos-wrap.catalog-collapsed,
    .pos-wrap.cart-collapsed {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        margin-inline: 0;
        /* the bar above takes 52px; dvh follows a phone's moving address bar */
        height: calc(100vh - 180px);
        height: calc(100dvh - 180px);
        min-height: 520px;
        transition: none;
    }
    .pos-wrap.no-catalog {
        height: calc(100vh - 128px);
        height: calc(100dvh - 128px);
    }

    /* Products showing: the cart side is away */
    .pos-wrap:not(.catalog-collapsed):not(.no-catalog) > .pos-cart {
        display: none;
    }
    /* Cart showing: the products side is away, rail and all */
    .pos-wrap.catalog-collapsed > .pos-products {
        display: none;
    }

    .pos-wrap > .pos-products,
    .pos-wrap > .pos-cart {
        border-radius: 16px;
        border-left: none;
        min-width: 0;
    }

    /* The fold buttons belong to wide screens; the bar does their job here */
    .pos-topbar > .pos-catalog-toggle,
    .pos-cart-toggle {
        display: none;
    }

    /* Tighter padding, and nothing that can push the page sideways */
    .pos-topbar {
        padding: 10px 12px;
        gap: 8px;
    }
    .pos-search {
        min-width: 0;
        margin-top: 0 !important;
    }
    .pos-cats {
        padding: 8px 12px 10px;
    }
    .pos-grid {
        padding: 12px;
        gap: 8px;
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }
    .pos-table {
        flex: 1 1 auto;
        min-height: 0;
    }

    .pos-tabs {
        padding-right: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .pos-tabs::-webkit-scrollbar {
        display: none;
    }
    .pos-tab {
        flex: 1 1 auto;
        padding: 12px 10px;
        white-space: nowrap;
    }

    .customer-section {
        padding: 10px 12px;
    }
    .cart-items {
        padding: 8px 10px;
    }
    .pos-cart-footer .cart-totals,
    .pos-cart-footer .checkout-panel {
        padding-left: 12px;
        padding-right: 12px;
    }
    .pos-secondary-actions {
        flex-wrap: wrap;
    }
    .pos-secondary-btn {
        flex: 1 1 30%;
    }
}

/* ── Sale complete window: a long receipt scrolls inside the window ── */
.receipt-modal {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
}
.receipt-header,
.receipt-actions {
    flex-shrink: 0;
}
.receipt-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* ── Windows on a phone: more of the screen, buttons that wrap ── */
@media (max-width: 520px) {
    .pos-overlay,
    .receipt-overlay {
        padding: 10px;
    }
    .pos-modal {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 14px;
    }
    .pos-modal-header {
        padding: 12px 14px;
    }
    .pos-modal-body {
        padding: 14px;
    }
    .pos-modal-footer {
        padding: 10px 14px;
        flex-wrap: wrap;
    }
    .pos-modal-footer > * {
        flex: 1 1 auto;
    }
    .receipt-modal {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        border-radius: 16px;
    }
    .receipt-header {
        padding: 18px 16px 14px;
    }
    .receipt-body {
        padding: 14px 16px;
    }
    .receipt-actions {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .receipt-actions > * {
        flex: 1 1 30%;
    }
}
