/* ═══════════════════════════════════════════════════════════════════
   RETAIL POS PAGE STYLESHEET (merged + deduplicated)
   resources/css/retail-pos-page.css — loaded via panel ->assets()
   Used by the Retail point of sale (PointOfSale page). The Menu point of
   sale has its own file: resources/css/pos-page.css (.rpos-* classes).

   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: #eceff5;
    --pos-surface: #ffffff;
    --pos-card: #ffffff;
    --pos-hover: #e6e9f3;
    --pos-border: #c9cfdc;
    --pos-border-light: #e3e7ef;
    --pos-text: #0b1020;
    /* Muted and faint are kept dark and readable: nothing on the till is grey-on-grey. */
    --pos-text-muted: #1f2937;
    --pos-text-faint: #374151;
    --pos-input-bg: #f4f6fa;
    --pos-on-primary: #ffffff;
    --pos-primary: #4f46e5;
    --pos-primary-dk: #4338ca;
    --pos-primary-bg: #e4e6ff;
    --pos-primary-text: #3730a3;
    --pos-success: #15803d;
    --pos-success-bg: #dcfce7;
    --pos-success-bd: #86efac;
    --pos-success-text: #14532d;
    --pos-danger: #b91c1c;
    --pos-danger-bg: #fee2e2;
    --pos-danger-bd: #fca5a5;
    --pos-warning: #b45309;
    --pos-warning-bg: #fef3c7;
    --pos-warning-bd: #fcd34d;

    /* The rounded select and calendar (components/listings/nice-fields) read these
       names. Their lists open on <body>, outside the till, so they are defined on
       :root and follow the till's light and dark colours. */
    --text-main: var(--pos-text);
    --dt-card: var(--pos-surface);
    --dt-line: var(--pos-border);
    --dt-box: var(--pos-input-bg);
    --dt-soft: var(--pos-primary-bg);
    --dt-acc: var(--pos-primary);
    --dt-sub: var(--pos-text);
}

html.dark {
    --pos-bg: #050608;
    --pos-surface: #0b0d12;
    --pos-card: #151a24;
    --pos-hover: #1d2433;
    --pos-border: #2b3245;
    --pos-border-light: #1a1f2b;
    --pos-text: #ffffff;
    --pos-text-muted: #e6ebf7;
    --pos-text-faint: #c5cde0;
    --pos-input-bg: #05060a;
    --pos-on-primary: #0b0d12;
    --pos-primary: #8b8ff5;
    --pos-primary-dk: #a3a7ff;
    --pos-primary-bg: #1c1e48;
    --pos-primary-text: #c3c7ff;
    --pos-success: #4ee0a8;
    --pos-success-bg: #062a1e;
    --pos-success-bd: #0f5a40;
    --pos-success-text: #8bf0c8;
    --pos-danger: #ff8a8a;
    --pos-danger-bg: #3a1010;
    --pos-danger-bd: #6b2222;
    --pos-warning: #ffc04d;
    --pos-warning-bg: #3a2a08;
    --pos-warning-bd: #6b4d12;
}

/* Text on the main colour: white on the light theme, near-black on the light
   violet of the dark theme, so it stays readable in both. */
.cat-chip.active,
.in-cart-badge,
.pos-tab-badge,
.payment-btn.selected,
.place-order-btn,
.btn-filled,
.receipt-header,
.customer-avatar {
    color: var(--pos-on-primary);
}
html.dark .pos-tab-badge { color: var(--pos-on-primary); }

.fi-page .fi-page-content,
.fi-main {
    padding-top: 0 !important;
    gap: 0 !important;
}
/* A selected card is a tinted fill only: no border, no ring. */
.pos-suspended-chip.active {
    background: var(--pos-primary-bg);
}
/* ── 2. Layout ────────────────────────────────────────────────────── */
/* Edge to edge: square corners, no frame. The page gives the till the whole
   width (PointOfSale::getMaxContentWidth) and the padding around it is removed. */
.fi-main:has(.pos-shell) {
    /* a small margin each side: the till does not have to touch the screen edges */
    padding-inline: 1rem !important;
    padding-block: 0 !important;
    max-width: none !important;
}
/* Filament pads and spaces the page header and content (py-8, gap-y-8). The till
   has no title, so none of that is wanted: it starts right under the top bar and
   the page itself never scrolls. */
.fi-page:has(.pos-shell),
.fi-page:has(.pos-shell) .fi-page-header-main-ctn,
.fi-page:has(.pos-shell) .fi-page-main {
    padding-block: 0 !important;
    row-gap: 0 !important;
    gap: 0 !important;
}
.fi-page:has(.pos-shell) .fi-header {
    display: none !important;
}
.pos-wrap {
    max-width: none;
    width: 100%;
    margin: 0;
    display: grid;
    /* products | cart: the cart keeps its own width (a share of the SCREEN, 28.75rem to 37.5rem),
       so when the side menu opens it is the products side that gets narrower */
    grid-template-columns: minmax(0, 1fr) clamp(28.75rem, 31vw, 37.5rem);
    /* fills what is left of the page under the top bar (see .pos-shell) */
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 0;
    border: none;
    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: 0.375rem;
    flex-shrink: 0;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 0.5rem;
    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 46.875rem cap.
   width:max-content sizes the card to rail + cart (no empty gap) and centres it. */
.pos-wrap.catalog-collapsed {
    grid-template-columns: 3.25rem minmax(0, 56.25rem);
    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 (< ~51.25rem): let the cart shrink to fit instead of overflowing. */
@media (max-width: 820px) {
    .pos-wrap.catalog-collapsed {
        grid-template-columns: 3.25rem 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: 0.75rem;
    padding: 0.875rem 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: 0.6875rem;
    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: 0;
}

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

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

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

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

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

.pos-cats {
    padding: 0.625rem 1.125rem 0.875rem;
    display: flex;
    gap: 0.4375rem;
    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: 0.3125rem 0.875rem;
    border-radius: 1.25rem;
    font-size: 0.75rem;
    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 {
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
}

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

.pos-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.125rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5625rem, 1fr));
    gap: 0.625rem;
    align-content: start;
    background: var(--pos-bg);
}

.pos-grid::-webkit-scrollbar {
    width: 0.25rem;
}

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

.product-card {
    background: var(--pos-card);
    border: none;
    border-radius: 0.75rem;
    padding: 0.625rem;
    cursor: pointer;
    transition: all .18s ease;
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
    position: relative;
    user-select: none;
}

.product-card:hover {
    background: var(--pos-primary-bg);
    transform: translateY(-1px);
}

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

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

.product-card.inactive {
    opacity: .7;
    filter: grayscale(.5);
}

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

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

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

.product-name {
    font-size: 0.8125rem;
    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: 0.75rem;
    font-weight: 700;
    color: var(--pos-primary);
}

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

.in-cart-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--pos-primary);
    color: #fff;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.6875rem;
    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);
    display: grid;
    grid-template-rows: auto 1fr auto;   /* header | scroll body | footer */
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 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: 0.25rem; }
.pos-cart-body::-webkit-scrollbar-thumb { background: var(--pos-border); border-radius: 62.4375rem; }
/* 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 1.125rem 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 6rem 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: 0.3125rem 0.625rem;
    border-radius: 0.375rem;
}
.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 0.4375rem;
    font-size: 0.5625rem;
}
/* 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 10.5rem 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: 18.75rem;
    min-height: 4.125rem;
    overflow-y: auto;
}
html.dark .pos-cart-footer { box-shadow: 0 -6px 1.125rem 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: 11.25rem;                /* never collapses to nothing */
    overflow-y: auto;
    overscroll-behavior: contain;
}
.pos-cart-body > .cart-items::-webkit-scrollbar { width: 0.25rem; }
.pos-cart-body > .cart-items::-webkit-scrollbar-thumb { background: var(--pos-border); border-radius: 62.4375rem; }

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

.pos-cart-body > .pos-bills-section .pos-bills-list.has-active {
    max-height: 10.5rem;                /* was 6rem — ~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: 0.3125rem 1rem 0.25rem;
}
/* Checkout panel: less padding all round */
.pos-cart-footer .checkout-panel {
      padding: 0.375rem 0.875rem 0.4375rem;

}
/* 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: 0.5625rem 0.875rem;
    font-size: 0.8125rem;
}
/* Clear cart + New sale on ONE row, side by side */
.pos-cart-footer .pos-bottom-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.3125rem;
}
.pos-cart-footer .pos-bottom-links .clear-cart-btn {
    flex: 1;
    margin-top: 0;
    padding: 0.3125rem;
    border: 1px solid var(--pos-border-light);
    border-radius: 0.5rem;
}
.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: 0.3125rem;
}

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

    grid-template-columns: repeat(4, 1fr);
}
.pos-cart-footer .payment-btn {
    padding: 0.3125rem 0.25rem;
    font-size: 0.6875rem;
}
/* Change display: tighter */
.pos-cart-footer .change-display {
    padding: 0.375rem 0.75rem;
    margin-bottom: 0.4375rem;
}
/* Primary CTA row: slightly shorter button */
.pos-cart-footer .pos-action-row .place-order-btn {
    padding: 0.6875rem 0.875rem;
}
.pos-cart-footer .clear-cart-btn {
    margin-top: 0.25rem;
    padding: 0.25rem;
}
/* Tendered input: shorter */
.pos-cart-footer .tendered-input {
  padding: 0.375rem 0.75rem;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
 }
.pos-cart-footer .cart-totals .total-row.grand {
    font-size: 0.9375rem;
    margin-top: 0.3125rem;
    padding-top: 0.3125rem;
}
.pos-more-actions {
    margin-top: 0.5rem;
    border-top: 1px solid var(--pos-border-light);
    padding-top: 0.5rem;
}
.pos-more-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pos-text-faint);
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 0.25rem;
}
.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: 0.375rem; }



/* 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: 0.625rem;
}

.pos-tab {
    flex: 0 0 auto;
    padding: 0.6875rem 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.8125rem;
    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: 1.125rem;
    height: 1.125rem;
    padding: 0 0.3125rem;
    border-radius: 62.4375rem;
    font-size: 0.625rem;
    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: 0.5rem;
}

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

.pos-active-sale-tag {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 2px 0.625rem;
    border-radius: 62.4375rem;
    font-size: 0.6875rem;
    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: 1.25rem;
    padding: 2px 0.625rem;
    font-size: 0.75rem;
    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 0.875rem 0.625rem;
}

.pos-bills-list {
    overflow-y: auto;
    padding: 0 0.625rem 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 8.25rem;          /* ≈ 2 rows + gap */
    overscroll-behavior: contain;
}

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

 .pos-bill-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    padding: 0.625rem 0.6875rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--pos-card);
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}

.pos-bill-row:hover {
    background: var(--pos-primary-bg);
}

.pos-bill-row.active {
    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: 0.6875rem;
    color: var(--pos-text-muted);
    white-space: nowrap;
}

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

.pos-bill-meta {
    font-size: 0.625rem;
    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: 0.75rem;
    font-weight: 800;
    color: var(--pos-text);
}

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

.pos-bills-empty {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--pos-text-faint);
}

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

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

.customer-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--pos-input-bg);
    border: 1.5px solid var(--pos-border);
    border-radius: 0.625rem;
    padding: 0.4375rem 0.75rem;
    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: 0.8125rem;
    width: 100%;
    color: var(--pos-text);
}

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

.customer-selected {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    padding: 0.5rem 0.75rem;
    background: var(--pos-success-bg);
    border: none;
    border-radius: 0.75rem;
}

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

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

.customer-result {
    padding: 0.625rem 0.875rem;
    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: 0.8125rem;
    font-weight: 600;
    color: var(--pos-text);
}

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

/* Editable qty input */
.qty-input {
    width: 2.5rem;
    text-align: center;
    font-size: 0.875rem;
    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: 0.375rem;
}
/* ── Cart items (claims leftover column height, scrolls) ── */
 .cart-items {
    flex: 1 1 auto;
    min-height: 10rem;
    padding: 0.625rem 0.875rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cart-item {
    background: var(--pos-card);
    border-radius: 0.75rem;
    padding: 0.375rem 0.625rem;          /* tighter */
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    border: none;
}
/* 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: 0.375rem;
}
.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: 0.1875rem 0.625rem;
    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: 0.3125rem;
    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: 0.25rem;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 0.7188rem;
    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: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    object-fit: cover;
    background: var(--pos-border-light);
    flex-shrink: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

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

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

.qty-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.4375rem;
    border: 1.5px solid var(--pos-border);
    background: var(--pos-input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
    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: 0.8125rem;
    font-weight: 700;
    color: var(--pos-text);
    min-width: 1.125rem;
    text-align: center;
}

.empty-cart {
    text-align: center;
    padding: 2.75rem 1.25rem;
}

.empty-cart-icon {
    font-size: 2.75rem;
    margin-bottom: 0.625rem;
    opacity: .4;
}

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

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

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

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

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
}

.payment-btn {
    padding: 0.4375rem 0.5rem;
    border-radius: 0.5625rem;
    border: 1.5px solid var(--pos-border);
    background: var(--pos-input-bg);
    font-size: 0.75rem;
    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: 0.5625rem 0.8125rem;
    border: 1.5px solid var(--pos-border);
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--pos-text);
    background: var(--pos-input-bg);
    outline: none;
    margin-bottom: 0.5rem;
    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: none;
    border-radius: 0.75rem;
    padding: 0.4375rem 0.8125rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--pos-success-text);
    margin-bottom: 0.5625rem;
}

/* Hold button */
.hold-sale-btn {
    width: 100%;
    padding: 0.6875rem;
    margin-bottom: 0.5rem;
    border: 1.5px dashed var(--pos-primary);
    border-radius: 0.625rem;
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
    font-size: 0.875rem;
    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: 0.75rem;
    background: var(--pos-primary);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.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: 0.5rem;
    align-items: stretch;
}

.pos-action-row .hold-sale-btn,
.pos-action-row .place-order-btn {
    width: auto;
    margin: 0;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
}

.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: 0.375rem;
    margin: 0.5rem 0;
}

.pos-secondary-btn {
    flex: 1;
    padding: 0.5rem 0.25rem;
    border: 1px solid var(--pos-border);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--pos-text);
    font-size: 0.75rem;
    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: 0.4375rem;
    padding: 0.375rem;
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--pos-text-faint);
    cursor: pointer;
    transition: color .15s;
}

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

/* ── Online status badges ── */
.pos-status-badge {
    font-size: 0.625rem;
    padding: 2px 0.5rem;
    border-radius: 62.4375rem;
    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: 0.375rem;
    padding: 1px 0.4375rem;
    border-radius: 62.4375rem;
    font-size: 0.5625rem;
    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: 0.1875rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    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: 1.25rem;
}

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: 1rem;
    width: 100%;
    max-width: 27.5rem;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1.25rem 3.75rem 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: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--pos-border);
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--pos-text);
    flex-shrink: 0;
}

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

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

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

.pos-modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.75rem 1.125rem;
    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: none;
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.pos-danger-box-title {
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--pos-danger);
    margin-bottom: 0.25rem;
}

/* Inputs inside modals & panels */
.pos-input {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--pos-border);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    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: 0.375rem;
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
}

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

.pos-vc-item-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--pos-bg);
    color: var(--pos-text);
}

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

.pos-split-item,
.pos-merge-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--pos-bg);
    cursor: pointer;
    transition: background .15s;
}

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

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

.pos-split-item-check,
.pos-merge-item-check {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
}

.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: 0.8125rem;
    font-weight: 600;
    color: var(--pos-text);
}

.pos-split-item-price {
    font-size: 0.8125rem;
    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: 1.25rem;
}

.receipt-modal {
    background: var(--pos-surface);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 25.625rem;
    overflow: hidden;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .3);
    border: 1px solid var(--pos-border);
}

.receipt-header {
    background: var(--pos-primary);
    padding: 1.625rem 1.5rem 1.25rem;
    text-align: center;
    color: #fff;
}

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

.receipt-body {
    padding: 1.125rem 1.375rem;
}

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

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

.receipt-row.total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pos-text);
    padding-top: 0.625rem;
    border-top: 1.5px dashed var(--pos-border);
    margin-top: 0.375rem;
}

.receipt-items {
    background: var(--pos-bg);
    border-radius: 0.625rem;
    padding: 0.6875rem 0.8125rem;
    margin: 0.625rem 0;
    border: none;
}

.receipt-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.3125rem;
    color: var(--pos-text);
}

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

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

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

.receipt-actions {
    padding: 0.875rem 1.375rem;
    display: flex;
    gap: 0.625rem;
    border-top: 1px solid var(--pos-border);
}

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

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

.btn-filled {
    flex: 1;
    padding: 0.625rem;
    background: var(--pos-primary);
    color: #fff;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    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: 0.25rem;
}

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

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

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

@keyframes posFadeIn {
    from { opacity: 0; transform: translateY(0.625rem); }
    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 {
    /* The till is not stretched across a very wide screen: it is centred, with room each side. */
    max-width: 97.5rem;
    margin-inline: auto;
    container-type: inline-size;
    container-name: pos-shell;
    width: 100%;
    /* The whole page height under Filament's 4rem top bar. The page title is
       empty and the padding is removed (see .fi-main:has(.pos-shell)). dvh follows
       a phone's moving address bar. */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 4rem);
    height: calc(100dvh - 4rem);
    min-height: 32.5rem;
}

/* ── Cart side folded to a rail (wide screens), like the products side ── */
.pos-wrap.cart-collapsed {
    grid-template-columns: 1fr 3.25rem;
}
.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: 1.75rem;
    height: 1.75rem;
}

/* ── Bar that chooses the side on narrow screens (hidden on wide ones) ── */
.pos-pane-switch {
    display: none;
    gap: 0.375rem;
    padding: 0.375rem;
    flex-shrink: 0;
    background: var(--pos-surface);
}
.pos-pane-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4375rem;
    padding: 0.5rem 0.625rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--pos-card);
    color: var(--pos-text);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, background .15s, color .15s;
}
.pos-pane-btn.active {
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
}
.pos-pane-btn:disabled {
    cursor: progress;
}
.pos-pane-total {
    font-size: 0.8125rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Narrow: the till has 53.75rem 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: 900px) {
    .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 shell is a column: the bar above takes what it needs, the till the rest */
        transition: none;
    }

    /* 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: 0;
        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: 0.625rem 0.75rem;
        gap: 0.5rem;
    }
    .pos-search {
        min-width: 0;
        margin-top: 0 !important;
    }
    .pos-cats {
        padding: 0.5rem 0.75rem 0.625rem;
    }
    .pos-grid {
        padding: 0.75rem;
        gap: 0.5rem;
        grid-template-columns: repeat(auto-fill, minmax(6rem, 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: 0.75rem 0.625rem;
        white-space: nowrap;
    }

    .customer-section {
        padding: 0.625rem 0.75rem;
    }
    .cart-items {
        padding: 0.5rem 0.625rem;
    }
    .pos-cart-footer .cart-totals,
    .pos-cart-footer .checkout-panel {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .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 - 2.5rem);
    max-height: calc(100dvh - 2.5rem);
}
.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: 0.625rem;
    }
    .pos-modal {
        max-height: calc(100vh - 1.25rem);
        max-height: calc(100dvh - 1.25rem);
        border-radius: 0.875rem;
    }
    .pos-modal-header {
        padding: 0.75rem 0.875rem;
    }
    .pos-modal-body {
        padding: 0.875rem;
    }
    .pos-modal-footer {
        padding: 0.625rem 0.875rem;
        flex-wrap: wrap;
    }
    .pos-modal-footer > * {
        flex: 1 1 auto;
    }
    .receipt-modal {
        max-height: calc(100vh - 1.25rem);
        max-height: calc(100dvh - 1.25rem);
        border-radius: 1rem;
    }
    .receipt-header {
        padding: 1.125rem 1rem 0.875rem;
    }
    .receipt-body {
        padding: 0.875rem 1rem;
    }
    .receipt-actions {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    .receipt-actions > * {
        flex: 1 1 30%;
    }
}



/* Settle-only cashier (cannot build sales, 11 Nov): no products side, so the
   cart and payment column is kept to a readable width and centred instead of
   stretching across the whole screen. Only .no-catalog is affected; the normal
   two-sided till is unchanged. */
.pos-shell .pos-wrap.no-catalog {
    max-width: 47.5rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1600px) {
    .pos-shell .pos-wrap.no-catalog {
        max-width: 53.75rem;
    }
}

/* ── Touch screens (tablets): larger tap targets ───────────────────── */
@media (pointer: coarse) {
    .qty-btn { width: 2.125rem; height: 2.125rem; font-size: 1.125rem; }
    .payment-btn { padding: 0.625rem 0.375rem; }
    .cat-chip { padding: 0.5625rem 1rem; }
    .pos-tab { padding: 0.875rem 0.875rem; }
    .pos-secondary-btn { padding: 0.6875rem 0.375rem; }
    .pos-bill-row { padding: 0.75rem 0.75rem; }
}

/* ── Products side: view switch, list rows, unit buttons ───────────── */
.pos-view-toggle {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}
.pos-vt-btn {
    padding: 0.5rem 0.6875rem;
    border: none;
    border-radius: 0.625rem;
    background: var(--pos-card);
    color: var(--pos-text);
    cursor: pointer;
    transition: background .15s;
}
.pos-vt-btn:hover { background: var(--pos-primary-bg); }
.pos-vt-btn.active {
    background: var(--pos-primary);
    color: var(--pos-on-primary);
}

/* A list row is a card: tinted fill, no border, no divider line. */
.pos-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.625rem 0.875rem;
    background: var(--pos-bg);
}
.pos-table-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.375rem;
    border-radius: 0.75rem;
    background: var(--pos-card);
    transition: background .15s;
}
.pos-table-row:hover { background: var(--pos-hover); }
.pos-row-thumb {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    object-fit: cover;
    flex-shrink: 0;
}
.pos-row-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    background: var(--pos-bg);
    color: var(--pos-text);
}

/* Unit buttons (Piece 175, Bale 1,995): a filled chip, no border. Chosen = tinted
   fill with a count. A unit that is out of stock stays readable, just struck back. */
.pos-unit,
.product-unit-btn {
    position: relative;
    border: none;
    color: var(--pos-text);
    background: var(--pos-input-bg);
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.pos-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 4.25rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.625rem;
}
.product-unit-btn {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.3125rem 0.5625rem;
    border-radius: 0.5rem;
}
.pos-unit:hover:not(:disabled),
.product-unit-btn:hover:not(:disabled) { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
/* Chosen unit: the solid main colour, so it stands out on a hovered row too. */
.pos-unit.sel,
.product-unit-btn.sel,
.pos-unit.sel:hover:not(:disabled),
.product-unit-btn.sel:hover:not(:disabled) {
    background: var(--pos-primary);
    color: var(--pos-on-primary);
}
.pos-unit.sel .pos-unit-name,
.product-unit-btn.sel .pos-unit-name { color: var(--pos-on-primary); }
.pos-unit.sel .pos-unit-count,
.product-unit-btn.sel .pos-unit-count {
    background: var(--pos-text);
    color: var(--pos-surface);
}
.pos-unit.is-out,
.product-unit-btn.is-out {
    cursor: not-allowed;
    background: var(--pos-danger-bg);
    color: var(--pos-text);
}
.pos-unit-name { font-size: 0.6875rem; font-weight: 600; color: var(--pos-text); }
.pos-unit-price { font-size: 0.8125rem; font-weight: 800; }
.pos-unit-count {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.3125rem;
    border-radius: 0.5625rem;
    background: var(--pos-primary);
    color: var(--pos-on-primary);
    font-size: 0.625rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-units {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0.25rem 0 2px;
}

/* ══════════════════════════════════════════════════════════════════
   CART CARDS (a line or a pack in the till cart)
   No border and no ring anywhere: a card is a filled shape, and a
   state (void, comp, held, open menu) is a tinted fill.
   ══════════════════════════════════════════════════════════════════ */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
}
.kc {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: 1rem;
    background: var(--pos-card);
}
.kc.held { background: var(--pos-card); }
.kc.voided { background: var(--pos-danger-bg); }
.kc.comped { background: var(--pos-warning-bg); }
.kc-main {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}
.kc-info { flex: 1; min-width: 0; }
.kc-name {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--pos-text);
    overflow-wrap: anywhere;
}
.kc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--pos-text);
}
.kc-total {
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 800;
    white-space: nowrap;
    color: var(--pos-text);
}
.kc .struck,
.kc-name.struck { text-decoration: line-through; }
.kc .cart-inline-price {
    cursor: default;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pos-text);
}
.kc .cart-inline-price.disc { color: var(--pos-warning); }
.kc-was {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--pos-text);
    text-decoration: line-through;
}
.kc .cart-unit-chip {
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
    margin-left: 0;
    padding: 2px 0.5rem;
    border-radius: 62.4375rem;
    font-size: 0.6875rem;
    font-weight: 700;
}
.pos-adj-disc {
    background: var(--pos-warning-bg);
    color: var(--pos-warning);
}
.kc .pos-adj-badge { border: none; margin-left: 0; }
.kc-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
}
.kc-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 62.4375rem;
    background: var(--pos-input-bg);
    color: var(--pos-text);
}
.kc-status.void { background: var(--pos-danger-bg); color: var(--pos-danger); }
.kc-status.comp { background: var(--pos-warning-bg); color: var(--pos-warning); }
.kc-actions { display: flex; align-items: center; gap: 0.375rem; margin-left: auto; }

/* Quantity: a round stepper */
.kc-step {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0.1875rem;
    border-radius: 62.4375rem;
    background: var(--pos-input-bg);
}
.kc-step button {
    width: 1.875rem;
    height: 1.875rem;
    border: none;
    border-radius: 50%;
    background: var(--pos-card);
    color: var(--pos-text);
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s;
}
.kc-step button:hover { background: var(--pos-primary-bg); }
.kc-step .qty-input {
    width: 2.5rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--pos-text);
}

/* Round icon buttons: remove (the bin), the three dots, and the tray buttons.
   The label shows on hover (data-tip); on a touch screen it sits under the icon. */
.kc-ib {
    position: relative;
    width: 2.125rem;
    height: 2.125rem;
    border: none;
    border-radius: 50%;
    background: var(--pos-input-bg);
    color: var(--pos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, color .12s;
}
.kc-ib:hover,
.kc-ib.on { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.kc-ib.rm { color: var(--pos-danger); }
.kc-ib.rm:hover,
.kc-ib.danger:hover { background: var(--pos-danger-bg); color: var(--pos-danger); }
.kc-ib.danger { color: var(--pos-danger); }
.kc-ib.warn { color: var(--pos-warning); }
.kc-ib.warn:hover { background: var(--pos-warning-bg); color: var(--pos-warning); }
.kc-ib:disabled { cursor: progress; }
.kc-ib[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 0.375rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.1875rem 0.5625rem;
    border-radius: 0.4375rem;
    background: var(--pos-text);
    color: var(--pos-surface);
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
}
.kc-lbl { display: none; }
.kc-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--pos-border);
}

/* Pack contents */
.kc-sub {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    font-size: 0.75rem;
    color: var(--pos-text);
}
.kc-sub-row { display: flex; align-items: center; gap: 0.5rem; min-height: 1.375rem; }
.kc-sub-row::before { content: "\2022"; opacity: .6; }
.kc-sub-unit { margin-left: 0.25rem; }
.kc-takeout {
    flex-shrink: 0;
    border: none;
    border-radius: 62.4375rem;
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--pos-input-bg);
    color: var(--pos-text);
}
.kc-takeout:hover { background: var(--pos-danger-bg); color: var(--pos-danger); }

/* ══════════════════════════════════════════════════════════════════
   TOUCH MODE (switch in the cart header; remembered on this device;
   off by default). html.pos-touch is set by the switch.
   ══════════════════════════════════════════════════════════════════ */
.pos-touch-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 1.875rem;
    padding: 0 0.75rem;
    border: none;
    border-radius: 62.4375rem;
    background: var(--pos-input-bg);
    color: var(--pos-text);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.pos-touch-toggle:hover { background: var(--pos-primary-bg); }
.pos-touch-toggle.active {
    background: var(--pos-primary);
    color: var(--pos-on-primary);
}
.pos-tabs-right { padding-left: 0.5rem; }

html.pos-touch .pos-shell .kc { padding: 0.875rem 1rem; gap: 0.625rem; }
html.pos-touch .pos-shell .kc-name { font-size: 1rem; }
html.pos-touch .pos-shell .kc-total { font-size: 1rem; }
html.pos-touch .pos-shell .kc-step button { width: 2.75rem; height: 2.75rem; font-size: 1.375rem; }
html.pos-touch .pos-shell .kc-step .qty-input { width: 3.5rem; font-size: 1.125rem; }
html.pos-touch .pos-shell .kc-ib { width: 2.875rem; height: 2.875rem; }
html.pos-touch .pos-shell .kc-tray .kc-ib {
    width: auto;
    min-width: 4.75rem;
    height: 3.5rem;
    border-radius: 0.875rem;
    flex-direction: column;
    gap: 2px;
    padding: 0 0.625rem;
}
html.pos-touch .pos-shell .kc-lbl { display: block; font-size: 0.6875rem; font-weight: 700; }
html.pos-touch .pos-shell .kc-ib[data-tip]:hover::after { display: none; }
html.pos-touch .pos-shell .pos-tab { padding: 1rem 1rem; font-size: 0.875rem; }
html.pos-touch .pos-shell .cat-chip { padding: 0.6875rem 1.125rem; font-size: 0.875rem; }
html.pos-touch .pos-shell .pos-search,
html.pos-touch .pos-shell .customer-input-wrap { padding: 0.75rem 0.875rem; }
html.pos-touch .pos-shell .pos-search input,
html.pos-touch .pos-shell .customer-input-wrap input { font-size: 1rem; }
html.pos-touch .pos-shell .pos-table-row { padding: 0.75rem 0.875rem; }
html.pos-touch .pos-shell .pos-unit { min-width: 5.25rem; padding: 0.625rem 0.875rem; }
html.pos-touch .pos-shell .product-unit-btn { padding: 0.625rem 0.75rem; font-size: 0.8125rem; }
html.pos-touch .pos-shell .payment-btn { padding: 0.875rem 0.5rem; font-size: 0.875rem; }
html.pos-touch .pos-shell .tendered-input { padding: 0.875rem 1rem; font-size: 1.125rem; }
html.pos-touch .pos-shell .place-order-btn,
html.pos-touch .pos-shell .pos-action-row .place-order-btn,
html.pos-touch .pos-shell .pos-cart-footer .pos-action-row .place-order-btn { padding: 1.125rem 1rem; font-size: 1rem; }
html.pos-touch .pos-shell .hold-sale-btn,
html.pos-touch .pos-shell .pos-secondary-btn { padding: 1rem 0.75rem; font-size: 0.875rem; }
html.pos-touch .pos-shell .pos-bill-row { padding: 1rem 0.875rem; }
html.pos-touch .pos-shell .pos-vt-btn,
html.pos-touch .pos-shell .pos-catalog-toggle { min-width: 2.75rem; min-height: 2.75rem; }


/* ══════════════════════════════════════════════════════════════════
   DESIGN PASS 3 (one pass: cart size, footer, windows, bills,
   products side). Same rules as everywhere: no borders on cards,
   tinted fills for every state, no faded or invisible text.
   ══════════════════════════════════════════════════════════════════ */

/* A filled shape on a surface: light mode needs a grey (the card colour is white there) */
:root { --pos-fill: var(--pos-hover); }
html.dark { --pos-fill: var(--pos-card); }
.pos-vt-btn { background: var(--pos-fill); }
.pos-vt-btn.active { background: var(--pos-primary); }
.pos-touch-toggle { background: var(--pos-fill); }
.pos-touch-toggle.active { background: var(--pos-primary); }

/* ── Cart cards: compact unless Touch mode is on ── */
.cart-items { gap: 0.375rem; padding: 0.5rem 0.625rem; }
.kc { padding: 0.5625rem 0.75rem; gap: 0.25rem; border-radius: 0.875rem; }
.kc-name { font-size: 0.8125rem; }
.kc-name .pos-item-link { font-weight: 700; text-align: left; }
.kc-total { font-size: 0.8125rem; }
.kc-row2 { flex-wrap: wrap; gap: 0.375rem 0.5rem; }
.kc-left { flex: 1 1 9.375rem; min-width: 0; }
.kc-meta { margin-top: 0; }
.kc-step { padding: 2px; }
.kc-step button { width: 1.625rem; height: 1.625rem; font-size: 0.9375rem; }
.kc-step .qty-input { width: 2rem; font-size: 0.8125rem; }
.kc-ib { width: 1.75rem; height: 1.75rem; }
.kc-ib svg { width: 0.9375rem; height: 0.9375rem; }
.kc .cart-unit-chip { padding: 1px 0.4375rem; font-size: 0.6562rem; }
.kc-status { font-size: 0.6875rem; padding: 0.1875rem 0.5625rem; }

/* Price: hover it, type, press Enter. A tinted box and a pencil say it can be changed. */
.kc .cart-price-edit {
    padding: 2px 0.375rem;
    border-radius: 0.5rem;
    transition: background .12s;
    cursor: text;
}
.kc .cart-price-edit:hover { background: var(--pos-input-bg); }
.kc .cart-price-edit:focus-within { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.kc .cart-price-input,
.kc .cart-price-input:hover,
.kc .cart-price-input:focus {
    border: 0;
    border-bottom: 0;
    box-shadow: none;
    outline: none;
}
.kc-pencil { opacity: 0; transition: opacity .12s; flex-shrink: 0; }
.kc .cart-price-edit:hover .kc-pencil,
.kc .cart-price-edit:focus-within .kc-pencil { opacity: 1; }
html.pos-touch .kc-pencil { opacity: 1; }
@media (pointer: coarse) { .kc-pencil { opacity: 1; } }

/* ── Header tabs and sections: no divider lines ── */
.pos-tabs { border-bottom: none; }
.pos-bills-section,
.customer-section { border-bottom: none; }
.pos-cart .pos-restore-btn { border: none; background: var(--pos-input-bg); }
.pos-cart .pos-restore-btn.primary { background: var(--pos-primary); color: var(--pos-on-primary); }
.pos-search-clear {
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--pos-fill);
    color: var(--pos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.pos-search-clear:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.customer-selected .pos-search-clear { margin-left: auto; }

/* ── Empty states ── */
.pos-empty-icon { display: flex; justify-content: center; margin-bottom: 0.625rem; color: var(--pos-text); }
.empty-cart-icon { opacity: .9; color: var(--pos-text); display: flex; justify-content: center; font-size: 0; }
.empty-cart-title { font-weight: 700; font-size: 0.875rem; margin-bottom: 0.25rem; color: var(--pos-text); }
.empty-cart-sub { font-size: 0.8125rem; color: var(--pos-text); }

/* ── Footer: totals, payment, buttons ── */
.pos-cart-footer {
    border-top: none;
    background: var(--pos-surface);
    box-shadow: 0 -8px 1.5rem rgba(0, 0, 0, .12);
}
html.dark .pos-cart-footer { box-shadow: 0 -8px 1.5rem rgba(0, 0, 0, .4); }
.pos-cart-footer .cart-totals { border-top: none; padding: 0.625rem 1rem 0; }
.pos-cart-footer .cart-totals .total-row { font-size: 0.7812rem; font-weight: 600; }
.pos-cart-footer .cart-totals .total-row.grand {
    border-top: none;
    margin-top: 2px;
    padding-top: 2px;
    font-size: 1.125rem;
    font-weight: 800;
}
.pos-cart-footer .checkout-panel { border-top: none; padding: 0.5rem 0.875rem 0.625rem; }
.pos-cart-footer .checkout-panel .section-label { margin-bottom: 0.375rem; }
.pos-cart-footer .payment-methods {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}
.pos-cart-footer .payment-btn {
    padding: 0.5rem 0.375rem;
    border: none;
    border-radius: 0.625rem;
    background: var(--pos-fill);
    color: var(--pos-text);
    font-size: 0.7812rem;
    font-weight: 700;
}
.pos-cart-footer .payment-btn:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-cart-footer .payment-btn.selected { background: var(--pos-primary); color: var(--pos-on-primary); }
.pos-cart-footer .tendered-input {
    border: none;
    background: var(--pos-input-bg);
    border-radius: 0.625rem;
    padding: 0.5625rem 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.pos-cart-footer .tendered-input:focus { box-shadow: inset 0 0 0 2px var(--pos-primary); }
.pos-cart-footer .tendered-input::placeholder { color: var(--pos-text); opacity: .75; }
.pos-cart-footer .change-display { border-radius: 0.625rem; padding: 0.4375rem 0.75rem; margin-bottom: 0.5rem; }

.pos-cart-footer .pos-action-row { gap: 0.375rem; align-items: stretch; }
.pos-cart-footer .pos-secondary-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 2.625rem;
    padding: 0 0.75rem;
    border: none;
    border-radius: 0.6875rem;
    background: var(--pos-fill);
    color: var(--pos-text);
    font-size: 0.7812rem;
    font-weight: 700;
    white-space: nowrap;
}
.pos-cart-footer .pos-secondary-btn:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-cart-footer .pos-secondary-btn:disabled { cursor: progress; }
.pos-cart-footer .pos-action-row .place-order-btn,
.pos-cart-footer .checkout-panel .place-order-btn {
    height: 2.625rem;
    padding: 0 0.875rem;
    border-radius: 0.6875rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--pos-on-primary);
}
.pos-cart-footer .place-order-btn:hover { transform: none; }
.pf-charge { display: inline-flex; align-items: center; gap: 0.4375rem; }
.pf-note { margin: 0.5rem 0 0; text-align: center; font-size: 0.75rem; color: var(--pos-text); }

.pf-links { display: flex; gap: 0.375rem; margin-top: 0.375rem; }
.pf-link {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.5rem;
    border: none;
    border-radius: 0.5625rem;
    background: transparent;
    color: var(--pos-text);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.pf-link:hover { background: var(--pos-fill); }
.pf-link.danger { color: var(--pos-danger); }
.pf-link.danger:hover { background: var(--pos-danger-bg); }
.pf-link:disabled { cursor: progress; }
.pf-rx { background: var(--pos-fill); border-radius: 0.75rem; padding: 0.5rem 0.625rem; margin-bottom: 0.5rem; }
.pf-rx.need { background: var(--pos-warning-bg); }

/* ── Windows: centred, rounded, no lines; X closes (also outside click and Escape) ── */
.pos-overlay { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
html.dark .pos-overlay { background: rgba(0, 0, 0, .72); }
.pos-modal {
    border: none;
    border-radius: 1.25rem;
    background: var(--pos-surface);
    box-shadow: 0 1.5rem 4.375rem rgba(0, 0, 0, .45);
}
.pos-modal-header { border-bottom: none; padding: 1rem 1.25rem 0.5rem; font-size: 1rem; }
.pos-modal-close {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
    background: var(--pos-input-bg);
    color: var(--pos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.pos-modal-close:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-modal-body { padding: 0.5rem 1.25rem 1rem; }
.pos-modal-footer { border-top: none; padding: 0.5rem 1.25rem 1.125rem; }
.pos-modal .btn-outline { border: none; background: var(--pos-fill); border-radius: 0.75rem; padding: 0.75rem; }
.pos-modal .btn-outline:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-modal .btn-filled { border-radius: 0.75rem; padding: 0.75rem; color: var(--pos-on-primary); }
.pos-modal-more { max-width: 26.25rem; }
.pf-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.pf-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 5.5rem;
    padding: 0.75rem 0.5rem;
    border: none;
    border-radius: 0.875rem;
    background: var(--pos-fill);
    color: var(--pos-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.pf-tile:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pf-tile.warn { color: var(--pos-warning); }
.pf-tile.warn:hover { background: var(--pos-warning-bg); color: var(--pos-warning); }
.pf-tile.danger { background: var(--pos-danger-bg); color: var(--pos-danger); }
.pf-tile.danger:hover { background: var(--pos-danger); color: var(--pos-on-primary); }
.pf-tile:disabled { cursor: progress; }

/* ── Bills: held sales and online orders as cards ── */
.pos-bills-search { padding: 0.25rem 0.875rem 0.5rem; }
.pos-bills-list { padding: 0 0.625rem 0.625rem; gap: 0.375rem; }
.pos-bill-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.875rem;
    background: var(--pos-card);
    color: var(--pos-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    user-select: none;
    transition: background .12s;
}
.pos-bill-card:hover,
.pos-bill-card.active { background: var(--pos-primary-bg); }
.pos-bill-card.active .pbc-num { color: var(--pos-primary-text); }
.pbc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.pbc-num { font-size: 0.8125rem; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbc-total { font-size: 0.8125rem; font-weight: 800; white-space: nowrap; }
.pbc-bot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1875rem 0.625rem; font-size: 0.75rem; font-weight: 600; }
.pbc-cust { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbc-warn {
    align-self: flex-start;
    padding: 2px 0.5rem;
    border-radius: 62.4375rem;
    background: var(--pos-warning-bg);
    color: var(--pos-warning);
    font-size: 0.6875rem;
    font-weight: 700;
}
.pos-bills-empty { color: var(--pos-text); font-weight: 600; }
.pos-bills-empty-big { padding: 2.5rem 1rem; font-size: 0.875rem; }
/* In the cart side: a compact list */
/* On the products side: a grid of cards that scrolls on its own */
.pos-bills-pane {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--pos-bg);
}
.pos-bills-title { font-size: 0.9375rem; font-weight: 800; color: var(--pos-text); padding: 0 0.25rem; }
.pos-bills-side { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--pos-bg); }
.pos-bills-side .pos-bills-search { padding: 0.25rem 0.875rem 0.5rem; }
.pos-bills-side .pos-bills-list,
.pos-bills-side .pos-bills-list.has-active {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}
.pos-bill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13.125rem, 1fr));
    gap: 0.5rem;
    padding: 0.25rem 0.875rem 0.875rem;
    align-content: start;
}
.pos-bills-side .pos-bills-empty { grid-column: 1 / -1; padding: 1.875rem 1rem; }

/* ── Products side ── */
.pos-products { container-type: inline-size; container-name: pos-products; }
.pos-topbar { border-bottom: none; }
.pos-cats-wrap {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    padding: 0 0.75rem;
    background: var(--pos-surface);
}
.pos-cats { flex: 1 1 auto; min-width: 0; padding: 0.5rem 2px 0.75rem; border-bottom: none; scrollbar-width: none; }
.cat-chip {
    padding: 0.4375rem 0.875rem;
    border: none;
    border-radius: 62.4375rem;
    background: var(--pos-fill);
    color: var(--pos-text);
    font-size: 0.7812rem;
    font-weight: 700;
}
.cat-chip:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.cat-chip.active { background: var(--pos-primary); color: var(--pos-on-primary); }
.pos-cats-arrow {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    margin-bottom: 0.25rem;
    border: none;
    border-radius: 50%;
    background: var(--pos-fill);
    color: var(--pos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .12s;
}
.pos-cats-arrow:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }

/* Grid: 5 tiles a row, fewer as the products side narrows */
.pos-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.625rem;
    padding: 0.75rem 0.875rem 1rem;
}
@container pos-products (max-width: 900px) { .pos-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container pos-products (max-width: 680px) { .pos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container pos-products (max-width: 460px) { .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.product-card {
    min-height: 11.625rem;
    padding: 0.625rem;
    gap: 0.375rem;
    border-radius: 0.875rem;
}
.product-thumb {
    height: 4.5rem;
    aspect-ratio: auto;
    margin-bottom: 0;
    object-fit: cover;
    border-radius: 0.625rem;
}
.product-emoji-fallback {
    height: 4.5rem;
    aspect-ratio: auto;
    margin-bottom: 0;
    border-radius: 0.625rem;
    background: var(--pos-input-bg);
    color: var(--pos-text);
}
.product-name { display: block; font-size: 0.8125rem; font-weight: 700; line-height: 1.25; }
.product-name .pos-item-link {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    font-weight: 700;
    text-align: left;
}
.product-card .product-price,
.product-card .product-units { margin-top: auto; }
.product-price { font-size: 0.8125rem; font-weight: 800; color: var(--pos-primary-text); }
.product-stock { font-size: 0.6875rem; font-weight: 600; color: var(--pos-text); }
.product-units { margin-bottom: 0; }
/* Out of stock stays fully readable: a red tint and the words, no fading */
.product-card.out-of-stock,
.product-card.out-of-stock:hover {
    opacity: 1;
    background: var(--pos-danger-bg);
    transform: none;
    cursor: not-allowed;
}
.st-out { color: var(--pos-danger); font-weight: 700; }
.st-low { color: var(--pos-warning); font-weight: 700; }
.st-ok { color: var(--pos-primary-text); font-weight: 600; }

/* List: the units sit next to the name, not at the far edge */
.pos-table-row {
    display: grid;
    grid-template-columns: 2.5rem minmax(9.375rem, 18.75rem) minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
}
.pos-row-main { min-width: 0; }
.pos-row-name { font-size: 0.8125rem; font-weight: 700; color: var(--pos-text); min-width: 0; }
.pos-row-name .pos-item-link {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}
.pos-row-stock { font-size: 0.7188rem; font-weight: 600; margin-top: 2px; color: var(--pos-text); }
.pos-row-units { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-start; }
@container pos-products (max-width: 560px) {
    .pos-table-row { grid-template-columns: 2.5rem minmax(0, 1fr); }
    .pos-row-units { grid-column: 1 / -1; }
}
.pos-loadmore-wrap { grid-column: 1 / -1; display: flex; justify-content: center; padding: 0.875rem; }
.pos-loadmore {
    padding: 0.5625rem 1.625rem;
    border: none;
    border-radius: 62.4375rem;
    background: var(--pos-fill);
    color: var(--pos-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}
.pos-loadmore:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-loadmore:disabled { cursor: progress; }

/* Products side folded (wide screens only): the rail sits right next to the cart and
   the two are centred together, so there is no empty strip between them */
@container pos-shell (min-width: 901px) {
    .pos-wrap.catalog-collapsed {
        grid-template-columns: 3.25rem minmax(0, 62.5rem);
        justify-content: center;
        width: 100%;
        max-width: none;
        margin-inline: 0;
    }
}

/* ── Touch mode for the new parts ── */
html.pos-touch .pos-shell .pos-cart-footer .pos-secondary-btn,
html.pos-touch .pos-shell .pos-cart-footer .pos-action-row .place-order-btn { height: 3.375rem; font-size: 0.9375rem; }
html.pos-touch .pos-shell .pf-link { padding: 0.8125rem 0.625rem; font-size: 0.875rem; }
html.pos-touch .pos-shell .pos-bill-card { padding: 0.875rem; }
html.pos-touch .pos-shell .pos-cats-arrow { width: 2.5rem; height: 2.5rem; }
html.pos-touch .pos-shell .pos-search-clear { width: 2rem; height: 2rem; }
html.pos-touch .pos-shell .kc-ib svg { width: 1.25rem; height: 1.25rem; }
html.pos-touch .pos-shell .kc { gap: 0.5rem; }
html.pos-touch .pf-tile { min-height: 6.875rem; font-size: 0.9375rem; }
html.pos-touch .pos-modal-close { width: 2.75rem; height: 2.75rem; }

/* ══════════════════════════════════════════════════════════════════
   DESIGN PASS 3b (fixes after the first look in the real page)
   ══════════════════════════════════════════════════════════════════ */

/* Held / online in the cart side: the same cards as on the products side,
   in a grid, never one card stretched across the whole width */
.pos-bills-cart { background: var(--pos-bg); }
.pos-bills-cart .pos-bills-list,
.pos-cart-body > .pos-bills-cart .pos-bills-list,
.pos-cart-body.browsing-list > .pos-bills-cart .pos-bills-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13.125rem, 1fr));
    gap: 0.5rem;
    align-content: start;
    padding: 0.25rem 0.875rem 0.875rem;
}
.pos-bills-cart .pos-bills-empty { grid-column: 1 / -1; }

/* Product tiles a little smaller; the picture keeps its size */
.product-card { min-height: 10.625rem; padding: 0.5rem; gap: 0.3125rem; }

/* List rows hug the picture: same height as it, units at the end of the row */
.pos-table-row {
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    gap: 0.625rem;
    padding: 0.3125rem 0.625rem;
    margin-bottom: 0.3125rem;
}
.pos-row-units { justify-content: flex-end; gap: 0.375rem; }
.pos-unit { min-width: 3.75rem; padding: 0.1875rem 0.625rem; border-radius: 0.5625rem; }
.pos-unit-name { font-size: 0.6562rem; }
.pos-unit-price { font-size: 0.7812rem; }
@container pos-products (max-width: 560px) {
    .pos-table-row { grid-template-columns: 2.5rem minmax(0, 1fr); }
    .pos-row-units { grid-column: 1 / -1; justify-content: flex-start; }
}
html.pos-touch .pos-shell .pos-table-row { padding: 0.5rem 0.75rem; }
html.pos-touch .pos-shell .pos-unit { min-width: 4.75rem; padding: 0.5rem 0.75rem; }

/* All categories dropdown (nice-fields), at the start of the chip row */
.pos-cat-select { flex: 0 0 11.25rem; margin-bottom: 0.25rem; }
.pos-cat-select .nf-btn {
    min-height: 2rem;
    padding: 0 0.75rem;
    border-radius: 62.4375rem;
    background: var(--pos-fill);
    color: var(--pos-text);
    font-size: 0.7812rem;
    font-weight: 700;
}
.pos-cat-select .nf-btn:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-cat-select .nf-btn .nf-ph { color: var(--pos-text); opacity: 1; }
.nf-pop .nf-opt { color: var(--pos-text); }
html.pos-touch .pos-shell .pos-cat-select { flex-basis: 13.75rem; }
html.pos-touch .pos-shell .pos-cat-select .nf-btn { min-height: 2.75rem; font-size: 0.875rem; }

/* Touch mode: cart cards a little smaller than before, still finger sized */
html.pos-touch .pos-shell .kc { padding: 0.6875rem 0.8125rem; gap: 0.4375rem; }
html.pos-touch .pos-shell .kc-name,
html.pos-touch .pos-shell .kc-total { font-size: 0.9375rem; }
html.pos-touch .pos-shell .kc-step button { width: 2.375rem; height: 2.375rem; font-size: 1.1875rem; }
html.pos-touch .pos-shell .kc-step .qty-input { width: 2.875rem; font-size: 1rem; }
html.pos-touch .pos-shell .kc-ib { width: 2.5rem; height: 2.5rem; }
html.pos-touch .pos-shell .kc-ib svg { width: 1.125rem; height: 1.125rem; }
html.pos-touch .pos-shell .kc-tray .kc-ib { min-width: 4.375rem; height: 3.125rem; }

/* ══════════════════════════════════════════════════════════════════
   DESIGN PASS 3c
   ══════════════════════════════════════════════════════════════════ */

/* Cart card in one band: name and price on the left, quantity, total and
   buttons on the right (pack contents and the tray go under it) */
.kc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas:
        "name step total act"
        "meta step total act"
        "sub  sub  sub   sub"
        "tray tray tray  tray";
    align-items: center;
    column-gap: 0.625rem;
    row-gap: 0;
    padding: 0.4375rem 0.625rem 0.4375rem 0.75rem;
    border-radius: 0.75rem;
}
.kc-main,
.kc-row2 { display: contents; }
.kc-info { grid-area: name; min-width: 0; }
.kc-left { grid-area: meta; min-width: 0; }
.kc-total { grid-area: total; text-align: right; min-width: 4.625rem; }
.kc-step,
.kc-status { grid-area: step; justify-self: end; }
.kc-actions { grid-area: act; margin-left: 0; gap: 0.25rem; }
.kc-sub { grid-area: sub; margin-top: 0.25rem; }
.kc-tray { grid-area: tray; margin-top: 0.375rem; }
.kc-name {
    font-size: 0.8125rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kc-name .pos-item-link { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-meta { margin-top: 2px; gap: 0.3125rem; font-size: 0.7188rem; }
.kc .cart-unit-chip { padding: 0 0.375rem; font-size: 0.625rem; line-height: 1rem; }
.kc .cart-inline-price { font-size: 0.7188rem; }
.kc .cart-price-edit { padding: 0 0.25rem; }
.kc-step { padding: 2px; }
.kc-step button { width: 1.5rem; height: 1.5rem; font-size: 0.875rem; }
.kc-step .qty-input { width: 1.875rem; font-size: 0.7812rem; }
.kc-ib { width: 1.625rem; height: 1.625rem; }
.kc-ib svg { width: 0.875rem; height: 0.875rem; }
.kc-status { font-size: 0.6562rem; padding: 2px 0.5rem; }
.cart-items { gap: 0.3125rem; padding: 0.375rem 0.625rem; }

html.pos-touch .pos-shell .kc { padding: 0.5625rem 0.75rem; column-gap: 0.75rem; gap: 0 0.75rem; }
html.pos-touch .pos-shell .kc-name,
html.pos-touch .pos-shell .kc-total { font-size: 0.9062rem; }
html.pos-touch .pos-shell .kc-meta { font-size: 0.7812rem; margin-top: 0.1875rem; }
html.pos-touch .pos-shell .kc-step button { width: 2.25rem; height: 2.25rem; font-size: 1.125rem; }
html.pos-touch .pos-shell .kc-step .qty-input { width: 2.625rem; font-size: 0.9375rem; }
html.pos-touch .pos-shell .kc-ib { width: 2.375rem; height: 2.375rem; }
html.pos-touch .pos-shell .kc-ib svg { width: 1.0625rem; height: 1.0625rem; }
html.pos-touch .pos-shell .kc-status { font-size: 0.75rem; padding: 0.3125rem 0.625rem; }
html.pos-touch .pos-shell .kc-tray .kc-ib { min-width: 4.375rem; height: 3.125rem; }

/* Narrow cart: the controls go under the name */
@container pos-shell (max-width: 520px) {
    .kc {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "name name total"
            "meta step act"
            "sub  sub  sub"
            "tray tray tray";
        row-gap: 0.25rem;
    }
}

/* Held / online list with a sale open: it keeps its height (about two rows of
   cards, scrolls on its own) and is never pushed under the sale's lines */
.pos-cart-body.active-sale > .pos-bills-section {
    flex: 0 0 auto;
    overflow: hidden;
}
.pos-cart-body.active-sale > .pos-bills-section .pos-bills-list.has-active {
    flex: 0 0 auto;
    min-height: 0;
    max-height: 9.375rem;
    overflow-y: auto;
}
.pos-cart-body.active-sale > .cart-items { min-height: 7.5rem; }

/* Bill card, second line: customer left, items in the middle, time right */
.pbc-bot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
}
.pbc-items { justify-self: center; white-space: nowrap; }
.pbc-right { justify-self: end; display: inline-flex; align-items: center; gap: 0.375rem; white-space: nowrap; }
.pos-bill-card .pos-status-badge { align-self: flex-start; }
/* No ring after a click (no borders anywhere); keyboard focus still shows */
.pos-bill-card:focus { outline: none; }
.pos-bill-card:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--pos-primary); }

html.pos-touch .pos-shell .pos-bill-grid,
html.pos-touch .pos-shell .pos-bills-cart .pos-bills-list { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }

/* ══════════════════════════════════════════════════════════════════
   DESIGN PASS 3d
   ══════════════════════════════════════════════════════════════════ */

/* Held / Online with the products side folded: the bills open on the left as on
   the products side, next to the cart. Wide screens only; on narrow ones the
   bar above still switches between the two sides. */
@container pos-shell (min-width: 901px) {
    .pos-wrap.catalog-collapsed.bills-open {
        grid-template-columns: minmax(0, 1fr) clamp(28.75rem, 31vw, 37.5rem);
        justify-content: stretch;
    }
    .pos-wrap.catalog-collapsed.bills-open .pos-products > .pos-topbar,
    .pos-wrap.catalog-collapsed.bills-open .pos-products > .pos-bills-pane { display: flex; }
    .pos-wrap.catalog-collapsed.bills-open .pos-products > .pos-rail { display: none; }
}

/* Grid tile hover: like a list row (a light change), so the unit buttons on it
   never take the same colour as the tile */
.product-card:hover { background: var(--pos-hover); transform: none; }
.product-card .product-unit-btn:hover:not(:disabled) { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.product-card .product-unit-btn.sel,
.product-card .product-unit-btn.sel:hover:not(:disabled) { background: var(--pos-primary); color: var(--pos-on-primary); }
/* Out-of-stock tile is red already: its unit buttons keep their own fill */
.product-card.out-of-stock .product-unit-btn,
.product-card.out-of-stock .product-unit-btn.is-out { background: var(--pos-input-bg); color: var(--pos-text); }

/* ══════════════════════════════════════════════════════════════════
   DESIGN PASS 3e
   Cart lines (new, held, online, voided, comped, packs): more room between
   the cards and a little more line height inside them, and a softer fill so
   the list reads as separate lines, not one dark block. Text keeps full
   colour in both themes; the stepper and round buttons keep their own fills.
   ══════════════════════════════════════════════════════════════════ */
:root {
    --pos-line-bg: #f8f9fc;
    --pos-line-held: #f3f5fa;
}
html.dark {
    --pos-line-bg: #0e1219;
    --pos-line-held: #0c1016;
}

.cart-items { gap: 0.5rem; padding: 0.5rem 0.625rem; }

.kc {
    background: var(--pos-line-bg);
    padding: 0.5625rem 0.625rem 0.5625rem 0.8125rem;
    row-gap: 0.125rem;
}
.kc.held { background: var(--pos-line-held); }
.kc.voided { background: color-mix(in srgb, var(--pos-danger-bg) 60%, var(--pos-line-bg)); }
.kc.comped { background: color-mix(in srgb, var(--pos-warning-bg) 60%, var(--pos-line-bg)); }

.kc-name { line-height: 1.35; }
.kc-meta { margin-top: 0.1875rem; line-height: 1.4; }
.kc .cart-unit-chip { line-height: 1.125rem; }
.kc-sub { line-height: 1.45; }

/* The light theme's white cards stood out on their own; the stepper buttons
   keep a white fill so they still show on the softer card */
.kc-step button { background: var(--pos-surface); }
html.dark .kc-step button { background: var(--pos-card); }

html.pos-touch .pos-shell .cart-items { gap: 0.625rem; }
html.pos-touch .pos-shell .kc { padding: 0.6875rem 0.75rem 0.6875rem 0.875rem; row-gap: 0.1875rem; }

@container pos-shell (max-width: 520px) {
    .kc { row-gap: 0.375rem; }
}

/* ══════════════════════════════════════════════════════════════════
   DESIGN PASS 3f
   Light mode cart lines, the inside of every window, the Sale complete
   window, the cart-side bits that had inline styles (restore banner,
   suspended carts, customer), empty states and the station picker.
   The styles that were inline in point-of-sale.blade.php now live here.
   No borders anywhere: filled shapes, tinted states, readable text.
   ══════════════════════════════════════════════════════════════════ */
:root {
    /* a soft fill on a white surface (rows, boxes and inputs inside windows) */
    --pos-soft: #f1f3f8;
    --pos-soft-hover: #e7eaf2;
}
html.dark {
    --pos-soft: #151a24;
    --pos-soft-hover: #1d2433;
}

/* ── Light mode: white cart lines on the grey cart, a hairline shadow, and the
      stepper, round buttons and Held tag on a grey fill so they show on white ── */
:root {
    --pos-line-bg: #ffffff;
    --pos-line-held: #ffffff;
}
html:not(.dark) .kc { box-shadow: 0 1px 2px rgba(16, 24, 40, .07), 0 0 0 1px rgba(16, 24, 40, .03); }
html:not(.dark) .kc.held { background: #fbfcfe; }
html:not(.dark) .kc-step,
html:not(.dark) .kc-ib,
html:not(.dark) .kc-status { background: var(--pos-soft); }
html:not(.dark) .kc-step button { background: #ffffff; box-shadow: 0 1px 1px rgba(16, 24, 40, .08); }
html:not(.dark) .kc-ib:hover,
html:not(.dark) .kc-ib.on { background: var(--pos-primary-bg); }
html:not(.dark) .kc-ib.rm:hover,
html:not(.dark) .kc-ib.danger:hover { background: var(--pos-danger-bg); }
html:not(.dark) .kc.voided { background: #fff1f1; }
html:not(.dark) .kc.comped { background: #fff8e6; }
html:not(.dark) .kc .cart-price-edit:hover { background: var(--pos-soft); }
html:not(.dark) .pos-cart-body > .cart-items { background: var(--pos-bg); }

/* ── Moved from the blade: item name link, price box, restore banner,
      suspended carts, locked till ── */
.pos-item-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: inherit;
    cursor: pointer;
    max-width: 100%;
    pointer-events: auto;
}
.pos-item-link:hover,
.pos-item-link:focus-visible { text-decoration: underline; }

.cart-price-edit { display: inline-flex; align-items: center; gap: 0.25rem; }
.cart-price-input {
    width: 4rem;
    padding: 1px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: text;
}

.pos-restore-banner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0.625rem 0.75rem 0;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.875rem;
    background: var(--pos-primary-bg);
    flex-shrink: 0;
}
.pos-restore-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    background: var(--pos-primary);
    color: var(--pos-on-primary);
    flex-shrink: 0;
}
.pos-restore-text { flex: 1; min-width: 0; }
.pos-restore-title { font-size: 0.8125rem; font-weight: 800; color: var(--pos-text); }
.pos-restore-sub { font-size: 0.6875rem; font-weight: 500; color: var(--pos-text); margin-top: 2px; }
.pos-restore-actions { display: flex; gap: 0.375rem; flex-shrink: 0; }
.pos-restore-btn {
    padding: 0.4375rem 0.75rem;
    border: none;
    border-radius: 0.625rem;
    background: var(--pos-surface);
    color: var(--pos-text);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.pos-restore-btn:hover { background: var(--pos-soft-hover); }
.pos-restore-btn.primary { background: var(--pos-primary); color: var(--pos-on-primary); }
.pos-restore-btn.primary:hover { background: var(--pos-primary-dk); }
.pos-restore-btn:disabled { cursor: progress; opacity: .7; }
.pos-cart .pos-restore-btn { background: var(--pos-surface); }
.pos-cart .pos-restore-btn.primary { background: var(--pos-primary); color: var(--pos-on-primary); }

.pos-suspended-strip { padding: 0.5rem 0.75rem 0.25rem; border-bottom: none; flex-shrink: 0; }
.pos-suspended-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pos-text);
    margin-bottom: 0.375rem;
}
.pos-suspended-chips { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.pos-suspended-chip {
    display: flex;
    align-items: stretch;
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--pos-line-bg, var(--pos-card));
}
html:not(.dark) .pos-suspended-chip { box-shadow: 0 1px 2px rgba(16, 24, 40, .07); }
.pos-suspended-chip.active { background: var(--pos-primary-bg); }
.pos-suspended-resume {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    color: var(--pos-text);
    font-family: inherit;
}
.pos-suspended-resume:hover { background: var(--pos-soft-hover); }
.pos-suspended-name {
    font-size: 0.75rem;
    font-weight: 700;
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-suspended-count { font-size: 0.6875rem; font-weight: 500; color: var(--pos-text); }
.pos-suspended-discard {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--pos-text);
    padding: 0;
}
.pos-suspended-discard:hover { color: var(--pos-danger); background: var(--pos-danger-bg); }

.pos-till-locked {
    text-align: center;
    padding: 3.75rem 1.5rem;
    margin: 1.25rem;
    border: none;
    border-radius: 1rem;
    background: var(--pos-soft);
}
.pos-till-locked-icon { margin-bottom: 1rem; }
.pos-till-locked-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--pos-text); }
.pos-till-locked-text { font-size: 0.8125rem; color: var(--pos-text); max-width: 21.25rem; margin: 0 auto; line-height: 1.5; }

/* ── Customer ── */
.pos-search-icon { color: var(--pos-text); flex-shrink: 0; }
.customer-input-wrap { border: none; background: var(--pos-fill); }
.customer-input-wrap:focus-within { box-shadow: inset 0 0 0 2px var(--pos-primary); }
.customer-selected { background: var(--pos-success-bg); }
.customer-info { flex: 1; min-width: 0; }
.customer-name {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--pos-success-text);
}
.customer-tag {
    padding: 1px 0.4375rem;
    border-radius: 62.4375rem;
    background: var(--pos-surface);
    color: var(--pos-text);
    font-size: 0.625rem;
    font-weight: 700;
}
.customer-phone { font-size: 0.6875rem; font-weight: 600; color: var(--pos-success-text); margin-top: 1px; }
.customer-dropdown {
    border: none;
    border-radius: 0.875rem;
    padding: 0.375rem;
    background: var(--pos-surface);
    box-shadow: 0 1rem 2.5rem -0.5rem rgba(0, 0, 0, .35);
}
.customer-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: none;
    border-radius: 0.625rem;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.customer-result:hover,
.customer-result:focus-visible { background: var(--pos-primary-bg); outline: none; }
.customer-result:disabled { cursor: progress; }
.customer-result-name { color: var(--pos-text); }
.customer-result-sub { color: var(--pos-text); font-weight: 500; }
.customer-result-new { margin-top: 0.25rem; background: var(--pos-soft); }

/* ── Empty states and the prescription box in the footer ── */
.pos-empty { text-align: center; padding: 3.75rem 1.25rem; }
.pos-empty-grid { grid-column: 1 / -1; }
.pos-empty-title { font-size: 0.9375rem; font-weight: 700; color: var(--pos-text); }
.pos-empty-sub { font-size: 0.8125rem; font-weight: 500; margin-top: 0.25rem; color: var(--pos-text); }
.pos-row-none { font-size: 0.6875rem; font-weight: 600; color: var(--pos-text); }
.pf-rx-title { font-size: 0.75rem; font-weight: 800; color: var(--pos-text); }
.pf-rx-items { font-size: 0.6875rem; color: var(--pos-text); margin-top: 2px; }
.pf-rx-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.375rem; }
.pf-rx-state { font-size: 0.6875rem; font-weight: 700; color: var(--pos-text); }

/* ══ Windows: the inside ══ */
.pos-modal { max-width: 28.75rem; }
.pos-modal-wide { max-width: 33.75rem; }
.pos-modal-narrow { max-width: 25rem; }
.pos-modal-header { gap: 0.75rem; }
.pos-modal-close svg { display: block; }
.pos-modal-close:disabled { cursor: progress; opacity: .6; }
.pos-title-danger { color: var(--pos-danger); }
.pos-title-warn { color: var(--pos-warning); }
/* pos-stack: the windows rewritten in 3f (the credit and unpaid-bill windows keep their own spacing) */
.pos-modal-body.pos-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.pos-modal-body.pos-stack > * { margin: 0; }

.pos-lead { font-size: 0.8125rem; line-height: 1.45; color: var(--pos-text); }
.pos-note { font-size: 0.75rem; line-height: 1.45; color: var(--pos-text); }
.pos-note.small { font-size: 0.6875rem; font-weight: 600; }
.pos-note.strong { font-weight: 700; }
.pos-note.danger { color: var(--pos-danger); font-weight: 700; }

.pos-notice {
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.45;
}
.pos-notice.warn { background: var(--pos-warning-bg); color: var(--pos-text); }
html.dark .pos-notice.warn { color: var(--pos-warning); }

.pos-danger-box { margin-bottom: 0; border-radius: 0.875rem; padding: 0.75rem 0.875rem; }
.pos-danger-box-text { font-size: 0.75rem; line-height: 1.45; color: var(--pos-text); margin-top: 0.125rem; }
.pos-danger-box.warn { background: var(--pos-warning-bg); }
.pos-danger-box.warn .pos-danger-box-title { color: var(--pos-warning); }

.pos-tag {
    display: inline-block;
    padding: 1px 0.4375rem;
    border-radius: 62.4375rem;
    font-size: 0.5938rem;
    font-weight: 800;
    letter-spacing: .03em;
    vertical-align: middle;
}
.pos-tag.danger { background: var(--pos-danger-bg); color: var(--pos-danger); }
.pos-tag.warn { background: var(--pos-warning-bg); color: var(--pos-warning); }

/* Fields: a label, then a filled box (no border); focus is an inner ring */
.pos-fld { display: flex; flex-direction: column; gap: 0.3125rem; min-width: 0; }
.pos-vc-label {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pos-text);
}
.pos-form-row { display: flex; gap: 0.625rem; }
.pos-form-row > .pos-fld { flex: 1 1 0; }
.pos-form-row > .pos-fld.grow2 { flex: 2 1 0; }
.pos-modal .pos-input,
.pos-modal .pos-pin-input {
    min-height: 2.625rem;
    margin: 0;
    padding: 0.5625rem 0.75rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    font-size: 0.875rem;
    box-sizing: border-box;
}
html.dark .pos-modal .pos-input,
html.dark .pos-modal .pos-pin-input { background: var(--pos-input-bg); }
.pos-modal .pos-input:focus,
.pos-modal .pos-pin-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--pos-primary); }
.pos-modal .pos-input::placeholder { color: var(--pos-text); opacity: .65; }
.pos-upper { text-transform: uppercase; }

/* The rounded nice-fields select and date inside a window */
.pos-field { position: relative; }
.pos-field .nf-btn {
    min-height: 2.625rem;
    padding: 0 0.75rem;
    border-radius: 0.75rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    font-size: 0.875rem;
    font-weight: 600;
}
html.dark .pos-field .nf-btn { background: var(--pos-input-bg); }
.pos-field .nf-btn:hover { background: var(--pos-soft-hover); }
.pos-field .nf-btn[aria-expanded="true"],
.pos-field .nf-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--pos-primary); }
.pos-field .nf-btn .nf-ph { color: var(--pos-text); opacity: .7; }
.pos-field .nf-btn svg { opacity: 1; }
.nf-pop { border: none; }

/* Item shown at the top of a window */
.pos-vc-item-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: 0.875rem;
    background: var(--pos-soft);
}
.pos-vc-item-preview.col { flex-direction: column; align-items: stretch; gap: 0.1875rem; }
.pos-pv-info { min-width: 0; }
.pos-pv-name { font-size: 0.875rem; font-weight: 800; color: var(--pos-text); overflow-wrap: anywhere; }
.pos-pv-sub { font-size: 0.75rem; font-weight: 500; color: var(--pos-text); margin-top: 1px; }
.pos-pv-amt { flex-shrink: 0; font-size: 0.875rem; font-weight: 800; color: var(--pos-text); }
.pos-price-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--pos-text);
}
.pos-price-from { text-decoration: line-through; text-decoration-thickness: 1.5px; font-weight: 600; }
.pos-price-to { padding: 0.125rem 0.5rem; border-radius: 0.5rem; background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-price-to.lower { background: var(--pos-warning-bg); color: var(--pos-warning); }

/* Totals block inside a window */
.pos-sum {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.875rem;
    background: var(--pos-soft);
}
.pos-sum:empty { display: none; }
.pos-sum-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--pos-text);
}
.pos-sum-row > span:last-child { font-weight: 700; white-space: nowrap; }
.pos-sum-row.total { font-size: 0.9375rem; font-weight: 800; }
.pos-sum-row.total > span:last-child { font-weight: 800; }
.pos-sum-row + .pos-sum-row.total { margin-top: 0.25rem; padding-top: 0.375rem; box-shadow: 0 -1px 0 var(--pos-border-light); }
.pos-sum-row.is-due { color: var(--pos-danger); }
.pos-sum-row.is-ok { color: var(--pos-success); }

/* Rows to tick: split, merge, refund. Selected = tinted fill and a filled tick. */
.pos-pick-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 20rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.pos-pick {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.875rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
    flex-shrink: 0;
}
.pos-pick:hover { background: var(--pos-soft-hover); }
.pos-pick.selected,
.pos-pick:has(.pos-pick-input:checked) { background: var(--pos-primary-bg); }
.pos-pick:focus-visible,
.pos-pick:has(.pos-pick-input:focus-visible) { outline: none; box-shadow: inset 0 0 0 2px var(--pos-primary); }
.pos-pick:disabled { cursor: progress; }
.pos-pick.is-off { cursor: not-allowed; opacity: .6; }
.pos-pick-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pos-check {
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--pos-surface);
    color: transparent;
    box-shadow: inset 0 0 0 2px var(--pos-border);
}
.pos-check.on,
.pos-pick:has(.pos-pick-input:checked) .pos-check {
    background: var(--pos-primary);
    color: var(--pos-on-primary);
    box-shadow: none;
}
.pos-pick-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pos-pick-name { font-size: 0.8125rem; font-weight: 700; color: var(--pos-text); overflow-wrap: anywhere; }
.pos-pick-sub { font-size: 0.6875rem; font-weight: 500; color: var(--pos-text); }
.pos-pick-amt { flex-shrink: 0; font-size: 0.8125rem; font-weight: 800; color: var(--pos-text); white-space: nowrap; }

/* Bill discount: amount box with a KES / % switch */
.pos-amount-row { display: flex; gap: 0.5rem; align-items: stretch; }
.pos-amount-row .pos-input { flex: 1; min-width: 0; }
.pos-seg {
    display: flex;
    flex-shrink: 0;
    padding: 0.1875rem;
    gap: 0.1875rem;
    border-radius: 0.75rem;
    background: var(--pos-soft);
}
html.dark .pos-seg { background: var(--pos-input-bg); }
.pos-seg button {
    min-width: 2.75rem;
    padding: 0 0.75rem;
    border: none;
    border-radius: 0.5625rem;
    background: transparent;
    color: var(--pos-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 800;
    cursor: pointer;
}
.pos-seg button:hover { background: var(--pos-soft-hover); }
.pos-seg button.on { background: var(--pos-primary); color: var(--pos-on-primary); }
.pos-seg button:disabled { cursor: progress; }

/* Split payment */
.pos-due {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.75rem 0.875rem;
    border-radius: 0.875rem;
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
    font-size: 0.8125rem;
    font-weight: 700;
}
.pos-due > span:last-child { font-size: 1.0625rem; font-weight: 800; }
.pos-payline {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.75rem;
    border-radius: 0.875rem;
    background: var(--pos-soft);
}
html:not(.dark) .pos-payline .pos-input,
html:not(.dark) .pos-payline .nf-btn { background: #ffffff; }
.pos-payline-head { display: flex; gap: 0.5rem; align-items: center; }
.pos-payline-head .pos-field { flex: 1; min-width: 0; }
.pos-line-x {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--pos-danger-bg);
    color: var(--pos-danger);
    cursor: pointer;
}
.pos-line-x:hover { background: var(--pos-danger); color: var(--pos-on-primary); }
.pos-line-x:disabled { cursor: progress; }
.pos-add-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.625rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}
.pos-add-line:hover { filter: brightness(.97); }
html.dark .pos-add-line:hover { filter: brightness(1.15); }
.pos-add-line:disabled { cursor: progress; }

/* Open a taped pack: one big choice per pack */
.pos-option-list { display: flex; flex-direction: column; gap: 0.5rem; }
.pos-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: 0.875rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.pos-option:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-option:disabled { cursor: progress; opacity: .7; }
.pos-option-name { font-size: 0.8125rem; font-weight: 800; }
.pos-option-sub { font-size: 0.6875rem; font-weight: 500; }

/* Window buttons */
.pos-modal-footer { gap: 0.5rem; }
.pos-modal .btn-outline,
.receipt-modal .btn-outline {
    border: none;
    background: var(--pos-soft);
    color: var(--pos-text);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-weight: 700;
}
.pos-modal .btn-outline:hover,
.receipt-modal .btn-outline:hover { background: var(--pos-soft-hover); color: var(--pos-text); }
.pos-modal .btn-outline.danger,
.receipt-modal .btn-outline.danger { background: var(--pos-danger-bg); color: var(--pos-danger); }
.pos-modal .btn-outline.danger:hover,
.receipt-modal .btn-outline.danger:hover { background: var(--pos-danger); color: var(--pos-on-primary); }
.pos-modal .btn-filled,
.receipt-modal .btn-filled { font-weight: 800; color: var(--pos-on-primary); }
.pos-modal .btn-outline:disabled,
.pos-modal .btn-filled:disabled,
.receipt-modal .btn-outline:disabled,
.receipt-modal .btn-filled:disabled { opacity: .5; cursor: not-allowed; }
.pos-btn-left { margin-right: auto; flex: 0 0 auto; }
.pos-modal-footer .btn-outline:not(.pos-btn-left) { flex: 0 0 auto; }
.pos-modal-footer .btn-filled { flex: 1 1 auto; }
.pos-btn-void { background: var(--pos-danger) !important; color: var(--pos-on-primary) !important; }
.pos-btn-comp { background: var(--pos-warning) !important; color: var(--pos-on-primary) !important; }
html.dark .pos-btn-void,
html.dark .pos-btn-comp { color: #0b0d12 !important; }

/* ══ Sale complete ══ */
.receipt-overlay { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
html.dark .receipt-overlay { background: rgba(0, 0, 0, .72); }
.receipt-modal {
    max-width: 26.25rem;
    border: none;
    border-radius: 1.25rem;
    background: var(--pos-surface);
    box-shadow: 0 1.5rem 4.375rem rgba(0, 0, 0, .45);
    animation: posFadeIn .2s ease;
}
.receipt-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.5rem;
    background: none;
    color: var(--pos-text);
    text-align: left;
}
.receipt-success-icon {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--pos-success-bg);
    color: var(--pos-success);
}
.receipt-head-text { flex: 1; min-width: 0; }
.receipt-title { font-size: 1.0625rem; font-weight: 800; color: var(--pos-text); }
.receipt-number { font-size: 0.75rem; font-weight: 600; color: var(--pos-text); margin-top: 1px; }
.receipt-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem 1rem;
}
.receipt-total-card {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.875rem;
    background: var(--pos-success-bg);
    color: var(--pos-success-text);
    font-size: 0.8125rem;
    font-weight: 700;
}
.receipt-total-card strong { font-size: 1.375rem; font-weight: 800; }
.receipt-meta,
.receipt-totals,
.receipt-change { display: flex; flex-direction: column; gap: 0.3125rem; }
.receipt-row { margin: 0; font-size: 0.8125rem; font-weight: 500; color: var(--pos-text); gap: 0.75rem; }
.receipt-row strong { font-weight: 700; text-align: right; }
.receipt-row.total {
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: none;
    box-shadow: 0 -1px 0 var(--pos-border-light);
    font-size: 0.9375rem;
    font-weight: 800;
}
.receipt-items {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0;
    padding: 0.75rem 0.875rem;
    border-radius: 0.875rem;
    background: var(--pos-soft);
}
.receipt-item { margin: 0; font-size: 0.8125rem; color: var(--pos-text); align-items: flex-start; }
.receipt-item-label { flex-wrap: wrap; gap: 0.375rem; }
.receipt-item-name { font-weight: 600; overflow-wrap: anywhere; }
.receipt-item-unit { font-size: 0.6875rem; font-weight: 600; margin-left: 0.25rem; }
.receipt-item-amt { flex-shrink: 0; font-weight: 700; white-space: nowrap; }
.receipt-item-name.struck,
.receipt-item-amt.struck { text-decoration: line-through; }
.receipt-sub { padding-left: 0.875rem; font-size: 0.6875rem; font-weight: 500; color: var(--pos-text); }
.receipt-sub::before { content: "\2022"; margin-right: 0.375rem; }
.receipt-change {
    padding: 0.75rem 0.875rem;
    border-radius: 0.875rem;
    background: var(--pos-primary-bg);
}
.receipt-change .receipt-row { color: var(--pos-primary-text); }
.receipt-row.big { font-size: 1rem; font-weight: 800; }
.receipt-row.big strong { font-weight: 800; }
.receipt-change .receipt-row strong,
.receipt-total-card strong { color: inherit; }
.receipt-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem 1.125rem;
    border-top: none;
}
.receipt-actions .btn-outline,
.receipt-actions .btn-filled { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; }
.receipt-actions .btn-filled { flex: 1.4 1 0; border-radius: 0.75rem; padding: 0.75rem 1rem; }
.receipt-modal .pos-modal-close { align-self: flex-start; }

/* ══ Station picker ══ */
.pos-station { position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; padding: 1.25rem; }
.pos-station-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
.pos-station-card {
    position: relative;
    z-index: 1;
    width: min(25rem, 100%);
    max-height: calc(100dvh - 2.5rem);
    overflow-y: auto;
    padding: 1.5rem;
    border: none;
    border-radius: 1.25rem;
    background: var(--pos-surface);
    box-shadow: 0 1.5rem 4.375rem rgba(0, 0, 0, .45);
}
.pos-station-head { text-align: center; margin-bottom: 1.25rem; }
.pos-station-icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--pos-primary-bg);
    color: var(--pos-primary-text);
}
.pos-station-icon-svg { width: 1.625rem; height: 1.625rem; }
.pos-station-title { margin: 0; font-size: 1.125rem; font-weight: 800; color: var(--pos-text); }
.pos-station-sub { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--pos-text); }
.pos-station-list { display: flex; flex-direction: column; gap: 0.5rem; }
.pos-station-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.875rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
}
.pos-station-btn:hover { background: var(--pos-soft-hover); }
.pos-station-btn.selected { background: var(--pos-success-bg); color: var(--pos-success-text); }
.pos-station-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--pos-primary); }
.pos-station-name { font-size: 0.875rem; font-weight: 800; }
.pos-station-line { font-size: 0.75rem; font-weight: 500; margin-top: 2px; }
.pos-station-line.strong { font-weight: 700; }
.pos-station-info {
    padding: 0.75rem;
    border-radius: 0.875rem;
    background: var(--pos-warning-bg);
    color: var(--pos-text);
    font-size: 0.8125rem;
    font-weight: 600;
}
.pos-station-status { margin-top: 1rem; text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--pos-text); }

/* Touch mode: bigger rows and boxes in windows */
html.pos-touch .pos-pick { padding: 0.875rem 0.875rem; }
html.pos-touch .pos-check { width: 1.75rem; height: 1.75rem; }
html.pos-touch .pos-modal .pos-input,
html.pos-touch .pos-field .nf-btn { min-height: 3.125rem; font-size: 1rem; }
html.pos-touch .pos-seg button { min-width: 3.5rem; font-size: 0.9375rem; }
html.pos-touch .pos-modal .btn-outline,
html.pos-touch .pos-modal .btn-filled,
html.pos-touch .receipt-modal .btn-outline,
html.pos-touch .receipt-modal .btn-filled { padding: 1rem 1.125rem; font-size: 0.9375rem; }
html.pos-touch .pos-option { padding: 1rem; }
html.pos-touch .pos-line-x { width: 2.75rem; height: 2.75rem; }
html.pos-touch .pos-station-btn { padding: 1rem; }

/* Phones: two fields side by side become one under the other */
@media (max-width: 520px) {
    .pos-form-row { flex-direction: column; gap: 0.75rem; }
    .receipt-header { padding: 0.875rem 1rem 0.375rem; }
    .receipt-body { padding: 0.375rem 1rem 0.875rem; }
    .receipt-actions { padding: 0.375rem 1rem 0.875rem; flex-wrap: wrap; }
    .pos-modal-footer .btn-outline:not(.pos-btn-left) { flex: 1 1 auto; }
}

/* ══════════════════════════════════════════════════════════════════
   DESIGN PASS 3g
   Cart side: a line on its left to set it apart from the products side, and
   one left edge for everything in it (bills, customer, cart lines, totals,
   payment buttons) so the lines start on the same line as "Subtotal".
   Split payment: method and amount on one row. Item information window
   (moved here from partials/pos-item-info).
   ══════════════════════════════════════════════════════════════════ */
.pos-cart { border-left: 1px solid var(--pos-border); }
.pos-wrap.no-catalog .pos-cart { border-left: none; }
@container pos-shell (max-width: 900px) {
    .pos-cart { border-left: none; }
}

.pos-cart { --pos-cart-x: 1rem; }
.pos-cart-body > .cart-items,
.pos-cart .pos-bills-list { padding-left: var(--pos-cart-x); padding-right: var(--pos-cart-x); }
.pos-cart .pos-bills-search,
.pos-cart .customer-section,
.pos-cart .pos-suspended-strip,
.pos-cart-footer .cart-totals,
.pos-cart-footer .checkout-panel { padding-left: var(--pos-cart-x); padding-right: var(--pos-cart-x); }
.pos-cart .pos-restore-banner { margin-left: var(--pos-cart-x); margin-right: var(--pos-cart-x); }
.pos-cart .customer-dropdown { left: var(--pos-cart-x); right: var(--pos-cart-x); }
html.pos-touch .pos-cart { --pos-cart-x: 1.125rem; }

/* Split payment: method | amount | remove on one row, tendered or reference under them */
.pos-payline-head { align-items: flex-end; gap: 0.5rem; }
.pos-payline-method { flex: 1.15 1 0; }
.pos-payline-amount { flex: 1 1 0; }
.pos-payline-head .pos-line-x { width: 2.625rem; height: 2.625rem; border-radius: 0.75rem; }
html.pos-touch .pos-payline-head .pos-line-x { width: 3.125rem; height: 3.125rem; }
@media (max-width: 380px) {
    .pos-payline-head { flex-wrap: wrap; }
    .pos-payline-method { flex-basis: 100%; }
}

/* ══ Item information window ══ */
.pos-modal-xl { width: 100%; max-width: 41.25rem; }
.pii-title { min-width: 0; overflow-wrap: anywhere; }
.pii .pii-body { max-height: 72vh; overflow-y: auto; color: var(--pos-text); }
.pii .pii-id { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.875rem; }
.pii .pii-id-text { min-width: 0; flex: 1; }
.pii .pii-thumb {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--pos-soft);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pos-text);
}
.pii .pii-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pii .pii-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.3125rem 0.5625rem;
    border: none;
    border-radius: 62.4375rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    white-space: nowrap;
}
.pii .pii-chip.is-kind { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pii .pii-chip.is-off { background: var(--pos-danger-bg); color: var(--pos-danger); }
.pii .pii-chip.is-code { letter-spacing: .04em; }
.pii .pii-about { font-size: 0.8125rem; line-height: 1.45; margin: 0.5rem 0 0; color: var(--pos-text); }
.pii .pii-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.375rem, 1fr)); gap: 0.5rem; margin-bottom: 0.875rem; }
.pii .pii-tile { border: none; border-radius: 0.875rem; padding: 0.625rem 0.75rem; background: var(--pos-soft); min-width: 0; }
.pii .pii-tile-label { font-size: 0.6875rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--pos-text); }
.pii .pii-tile-value { font-size: 1.0625rem; font-weight: 800; line-height: 1.25; margin-top: 0.1875rem; color: var(--pos-text); overflow-wrap: anywhere; }
.pii .pii-tile-note { font-size: 0.6875rem; font-weight: 500; margin-top: 2px; color: var(--pos-text); }
.pii .is-low { color: var(--pos-warning); }
.pii .is-out { color: var(--pos-danger); }
.pii .pii-card { border: none; border-radius: 0.875rem; overflow: hidden; margin-bottom: 0.75rem; background: var(--pos-soft); }
.pii .pii-card.last { margin-bottom: 0; }
.pii .pii-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--pos-text);
    background: none;
    border-bottom: none;
}
.pii .pii-card-head span + span { font-weight: 600; }
.pii .pii-scroll { overflow-x: auto; }
.pii .pii-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; color: var(--pos-text); }
.pii .pii-table th,
.pii .pii-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    white-space: nowrap;
    color: var(--pos-text);
    border-bottom: none;
    box-shadow: inset 0 -1px 0 var(--pos-border-light);
}
html:not(.dark) .pii .pii-table th,
html:not(.dark) .pii .pii-table td { box-shadow: inset 0 -1px 0 #e1e5ee; }
.pii .pii-table th { font-size: 0.6875rem; font-weight: 800; }
.pii .pii-table td.wrap { white-space: normal; }
.pii .pii-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pii .pii-table tbody td.strong { font-weight: 700; }
.pii .pii-table tfoot td { font-weight: 800; box-shadow: none; background: var(--pos-soft-hover); }
.pii .pii-sub { display: block; font-size: 0.625rem; font-weight: 500; color: var(--pos-text); }
.pii .pii-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--pos-text);
    border-top: none;
}
.pii .pii-pager { display: flex; align-items: center; gap: 0.375rem; }
.pii .pii-page-btn {
    padding: 0.3125rem 0.75rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--pos-surface);
    color: var(--pos-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.pii .pii-page-btn:hover:not(:disabled) { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pii .pii-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.pii .pii-empty { padding: 0.25rem 0.75rem 0.75rem; font-size: 0.75rem; font-weight: 600; color: var(--pos-text); }
.pii .pii-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 700;
    color: var(--pos-text);
    text-align: left;
    cursor: pointer;
}
.pii .pii-link:hover,
.pii .pii-link:focus-visible { text-decoration: underline; color: var(--pos-primary-text); }
.pii .pii-rel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    padding: 0.5625rem 0.75rem;
    font-size: 0.75rem;
    color: var(--pos-text);
    border-bottom: none;
    box-shadow: inset 0 -1px 0 var(--pos-border-light);
}
.pii .pii-rel:last-child { box-shadow: none; }
.pii .pii-rel-name { min-width: 0; }
.pii .pii-rel-price { flex-shrink: 0; font-weight: 800; font-variant-numeric: tabular-nums; }

/* The PIN box in a till window takes the window's input look */
.pos-modal .pin-wrap { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════════
   DESIGN PASS 3h
   One header height for both sides: the products search bar (or the
   "Held sales" / "Online orders" title) and the cart tabs (New Sale,
   Held, Online) are the same height, so the parts under them start on
   the same line. More actions opens over the cart side. The footer links
   lose the click ring (the keyboard ring stays).
   ══════════════════════════════════════════════════════════════════ */
:root { --pos-head-h: 3.25rem; }
html.pos-touch { --pos-head-h: 3.875rem; }

.pos-shell .pos-tabs,
.pos-shell .pos-topbar {
    height: var(--pos-head-h);
    min-height: var(--pos-head-h);
    box-sizing: border-box;
    flex-shrink: 0;
}
.pos-shell .pos-tabs { align-items: stretch; border-bottom: none; }
.pos-shell .pos-tabs .pos-tab,
html.pos-touch .pos-shell .pos-tabs .pos-tab { padding-top: 0; padding-bottom: 0; }
.pos-shell .pos-tabs-right { align-self: center; }
.pos-shell .pos-topbar,
html.pos-touch .pos-shell .pos-topbar { padding-top: 0; padding-bottom: 0; align-items: center; }

/* The search box, the view buttons and the fold button fill the bar evenly */
.pos-shell .pos-topbar .pos-search,
html.pos-touch .pos-shell .pos-topbar .pos-search {
    height: calc(var(--pos-head-h) - 1rem);
    margin-top: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0.75rem;
    box-sizing: border-box;
    border: none;
    background: var(--pos-fill);
}
.pos-shell .pos-topbar .pos-search:focus-within { box-shadow: inset 0 0 0 2px var(--pos-primary); }
.pos-shell .pos-topbar .pos-vt-btn,
html.pos-touch .pos-shell .pos-topbar .pos-vt-btn {
    height: calc(var(--pos-head-h) - 1rem);
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.pos-shell .pos-topbar .pos-catalog-toggle { border: none; background: var(--pos-fill); }
.pos-shell .pos-topbar .pos-catalog-toggle:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pos-shell .pos-bills-title { line-height: 1.2; }

/* More actions over the cart side (the page sets left / top / size of the cart) */
.pos-anchor { display: contents; }
.pos-anchor.on {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}
.pos-anchor.on > .pos-modal { max-height: 100%; }

.pf-link:focus { outline: none; }
.pf-link:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--pos-primary); }

/* ══════════════════════════════════════════════════════════════════
   PRODUCT LIST COMPONENT (App\Livewire\Pos\ProductGrid)
   The list is its own Livewire component inside .pos-products. Its host
   (page) and its root (component) take no box of their own, so the bar,
   the category row and the grid / table lay out exactly as before. While
   the held or online bills show on the left, the list stays loaded but
   hidden (.is-away), so its search and category are kept.
   ══════════════════════════════════════════════════════════════════ */
.pos-grid-host,
.pos-grid-root { display: contents; }
.pos-grid-host.is-away { display: none; }

/* Windows over the cart side (script in point-of-sale.blade.php sets the cart's
   edges as --pc-*). The overlay still covers the screen, so an outside click closes
   the window; only the space the window is centred in becomes the cart. */
.pos-on-cart {
    padding: calc(var(--pc-t, 0px) + 1rem) calc(var(--pc-r, 0px) + 1rem)
             calc(var(--pc-b, 0px) + 1rem) calc(var(--pc-l, 0px) + 1rem) !important;
    box-sizing: border-box;
}
.pos-on-cart > * { max-height: 100% !important; }

/* Customer box: credit customers found with the shop's customers, and the chosen
   credit customer (tag + what they owe) */
.customer-group {
    padding: 0.375rem 0.75rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--pos-text);
}
.customer-result-credit .customer-result-name::after {
    content: "Credit";
    margin-left: 0.375rem;
    padding: 1px 0.4375rem;
    border-radius: 62.4375rem;
    background: var(--pos-warning-bg);
    color: var(--pos-warning);
    font-size: 0.625rem;
    font-weight: 800;
    vertical-align: middle;
}
.customer-tag.credit { background: var(--pos-warning-bg); color: var(--pos-warning); }
.customer-credit-line { font-size: 0.6875rem; font-weight: 700; color: var(--pos-success-text); margin-top: 1px; }

/* ══════════════════════════════════════════════════════════════════
   SELL AN AMOUNT (1.5 kg, 2.5 m, or a shilling amount)
   The scale button on a product tile (top left; the in-cart count is top
   right), "Amount" in the table view, the wider quantity box on a cart line
   (it holds 0.667), and the "How much?" window (.pam). Tinted fills, no
   borders; text in --pos-text.
   ══════════════════════════════════════════════════════════════════ */
.product-amount-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--pos-soft);
    color: var(--pos-text);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.product-amount-btn:hover { background: var(--pos-primary); color: var(--pos-on-primary); }
.product-amount-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--pos-primary); }
html.pos-touch .pos-shell .product-amount-btn { width: 2.25rem; height: 2.25rem; }

.pos-unit.pos-unit-amount { background: var(--pos-soft); color: var(--pos-text); border: none; cursor: pointer; font-family: inherit; }
.pos-unit.pos-unit-amount:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }

.kc-step .qty-input { width: 3.25rem; }

.pam-name { font-size: 0.9375rem; font-weight: 800; color: var(--pos-text); overflow-wrap: anywhere; }
.pam-units { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pam-unit {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 800;
    cursor: pointer;
}
.pam-unit:hover { background: var(--pos-soft-hover); }
.pam-unit.on { background: var(--pos-primary); color: var(--pos-on-primary); }
.pam-unit-price { font-size: 0.6875rem; font-weight: 600; }
.pam-price {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pos-text);
}
.pam-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.pam-input { font-size: 1.0625rem; font-weight: 800; }
.pam-quick { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pam-chip {
    min-width: 2.75rem;
    padding: 0.4375rem 0.75rem;
    border: none;
    border-radius: 62.4375rem;
    background: var(--pos-soft);
    color: var(--pos-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 800;
    cursor: pointer;
}
.pam-chip:hover { background: var(--pos-primary-bg); color: var(--pos-primary-text); }
.pam-problem {
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: var(--pos-danger-bg, rgba(185, 28, 28, .1));
    color: var(--pos-danger);
    font-size: 0.8125rem;
    font-weight: 700;
}
html.pos-touch .pam-unit,
html.pos-touch .pam-chip { padding: 0.75rem 1rem; font-size: 0.9375rem; }
html.pos-touch .pam-input { font-size: 1.25rem; }
@media (max-width: 420px) { .pam-fields { grid-template-columns: 1fr; } }

/* The three-dots tray of a cart line (Return, Void, Comp) opens on the right,
   under the button that opened it. */
.kc-tray { justify-content: flex-end; }
