/* ════════════════════════════════════════════════════════════════════════
   POS terminal — a dedicated commercial point-of-sale UI. Deliberately does
   not look like the admin panel: own top bar, image product grid, app canvas.
   ════════════════════════════════════════════════════════════════════════ */
[x-cloak] { display: none !important; }

/* Full-screen takeover: hide ALL panel chrome so only the terminal shows. */
body.fi-pos-active { overflow: hidden; }
body.fi-pos-active .fi-sidebar,
body.fi-pos-active .fi-topbar,
body.fi-pos-active .fi-header,
body.fi-pos-active .fi-breadcrumbs,
body.fi-pos-active .fi-page-header { display: none !important; }
body.fi-pos-active .fi-main-ctn,
body.fi-pos-active .fi-main { padding: 0 !important; max-width: 100% !important; }
body.fi-pos-active .fi-page { gap: 0 !important; padding: 0 !important; height: 100%; }
body.fi-pos-active .fi-pos-page { padding: 0 !important; }

:root {
    --pos-canvas: #eef0f4;
    --pos-surface: #ffffff;
    --pos-line: #e8eaee;
    --pos-ink: #1a1d23;
    --pos-muted: #8b90a0;
    --pos-accent: #ea580c;
    --pos-accent-soft: #fff5ee;
    --pos-link-hover-bg: #fef2f2;
    --pos-link-hover-ink: #b91c1c;
}
/* The panel palette is oklch(), which Chrome 109 (the last on Windows 7) cannot parse: the
   colour turned transparent and the white "Charge" button vanished on the white ticket. */
@supports (color: oklch(0 0 0)) {
    :root {
        --pos-accent: var(--primary-600, #ea580c);
        --pos-accent-soft: var(--primary-50, #fff5ee);
        --pos-link-hover-bg: var(--primary-50, #fef2f2);
        --pos-link-hover-ink: var(--primary-700, #b91c1c);
    }
}
.dark {
    --pos-canvas: #0c0e13;
    --pos-surface: #15181f;
    --pos-line: rgb(255 255 255 / .07);
    --pos-ink: #f3f4f6;
    --pos-muted: #6b7280;
    --pos-accent-soft: rgb(234 88 12 / .14);
}

.pos {
    height: 100dvh; display: flex; flex-direction: column;
    background: var(--pos-canvas); color: var(--pos-ink);
    font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}

/* Desktop: pinned to the viewport. Inside the panel page something above it pushed it down,
   so the bottom of the product grid and the ticket fell off screen. */
@media (min-width: 1025px) {
    body.fi-pos-active .pos { position: fixed; inset: 0; height: auto; }
}

/* Demo copy: its banner gets a one-line strip above the terminal and the terminal starts
   below it, so the banner never covers the top bar and the ticket footer keeps its place. */
body.fi-pos-active .fi-demo-banner {
    position: fixed !important; inset: 0 0 auto 0; height: 2rem; line-height: 2rem;
    padding-block: 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 60 !important;
}
@media (min-width: 1025px) {
    body.fi-pos-active:has(.fi-demo-banner) .pos { top: 2rem; }
}
@media (max-width: 1024px) {
    body.fi-pos-active:has(.fi-demo-banner) .pos { padding-top: 2rem; }
}

/* ── Top bar ─────────────────────────────────────────────────────────── */
.pos-topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 1.1rem; background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-line); flex: none;
}
.pos-brand { display: flex; align-items: center; gap: .65rem; }
.pos-brand img { height: 26px; width: auto; }
.pos-brand span { font-weight: 700; letter-spacing: -.01em; color: var(--pos-ink); }
.pos-topbar-meta { display: flex; align-items: center; gap: .6rem; }
.pos-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .65rem;
    border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--pos-ink);
    background: var(--pos-canvas);
}
.pos-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; color: var(--pos-muted); padding: 0 .35rem; }
.pos-exit {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
    color: var(--pos-muted); background: var(--pos-canvas);
}
.pos-exit:hover { color: var(--danger-600, #dc2626); background: var(--danger-50, #fef2f2); }

.pos-chip-link { text-decoration: none; transition: background .15s, color .15s; }
.pos-chip-link:hover { background: var(--pos-link-hover-bg); color: var(--pos-link-hover-ink); }
.pos-topbar-meta .fi-btn { border-radius: 999px; }
/* The register's ticket printer would not print now (agent offline, out of paper, ...). */
.pos-chip-warning { color: #92400e; background: #fffbeb; box-shadow: inset 0 0 0 1px #fcd34d; }

/* ── Body grid ───────────────────────────────────────────────────────── */
.pos-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 420px); min-height: 0; }

/* ── Catalogue ───────────────────────────────────────────────────────── */
.pos-catalogue { display: flex; flex-direction: column; min-height: 0; padding: 1rem 1.1rem; gap: 1rem; }
.pos-toolbar { display: flex; gap: .85rem; align-items: stretch; }
.pos-searchbar {
    flex: 1; display: flex; align-items: center; gap: .65rem; padding: 0 1.1rem; height: 52px;
    border-radius: 14px; background: var(--pos-surface); box-shadow: 0 1px 2px rgb(0 0 0 / .04);
}
.pos-search-icon { color: var(--pos-muted); }
.pos-search-input { flex: 1; background: transparent; border: 0; outline: 0; font-size: 1rem; color: var(--pos-ink); }
.pos-search-input::placeholder { color: var(--pos-muted); }
.pos-stats { display: flex; gap: .6rem; }
.pos-stat {
    display: flex; flex-direction: column; justify-content: center; padding: 0 1rem; min-width: 92px;
    border-radius: 14px; background: var(--pos-surface); box-shadow: 0 1px 2px rgb(0 0 0 / .04);
}
.pos-stat span { font-size: .68rem; font-weight: 600; color: var(--pos-muted); text-transform: uppercase; letter-spacing: .03em; }
.pos-stat strong { font-size: 1rem; font-weight: 700; color: var(--pos-ink); }

.pos-grid {
    flex: 1; overflow-y: auto; display: grid; gap: .6rem; align-content: start;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); padding: 0 .25rem .75rem 0;
}
/* Text-first cards: most products have no photo, so name and price get the room. */
.pos-card {
    /* Photo (or placeholder) on the left, name and price beside it. Rows sized by their
       content: a flexible row with overflow hidden collapsed the name. */
    display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; align-content: space-between;
    column-gap: .75rem; row-gap: .5rem; min-height: 104px; padding: .7rem; text-align: start;
    border-radius: 14px; background: var(--pos-surface); cursor: pointer;
    box-shadow: 0 1px 2px rgb(0 0 0 / .05); border: 1px solid var(--pos-line);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.pos-card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -12px rgb(0 0 0 / .28); border-color: var(--pos-accent); }
.pos-card:active { transform: translateY(0); }
.pos-card-thumb { grid-row: 1 / span 2; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; align-self: center; background: var(--pos-canvas); }
.pos-card-thumb.is-placeholder { display: grid; place-items: center; color: var(--pos-muted); opacity: .7; }
/* Up to three lines, capped by height: -webkit-line-clamp inside a grid shows a single line
   in Safari. */
.pos-card-name { display: block; max-height: calc(1.3em * 3); overflow: hidden; font-weight: 600; font-size: .95rem;
    line-height: 1.3; color: var(--pos-ink); overflow-wrap: anywhere; }
.pos-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.pos-card-price { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; color: var(--pos-accent); white-space: nowrap; }
.pos-card-tag {
    padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap;
    background: var(--pos-canvas); color: var(--pos-muted);
}
.pos-card-tag.is-out { background: var(--danger-50, #fef2f2); color: var(--danger-600, #dc2626); }

.pos-empty, .pos-lines-empty { grid-column: 1 / -1; text-align: center; color: var(--pos-muted); padding: 3rem 1rem; }

/* ── Ticket ──────────────────────────────────────────────────────────── */
.pos-ticket {
    display: flex; flex-direction: column; min-height: 0;
    background: var(--pos-surface); border-left: 1px solid var(--pos-line);
}
.pos-ticket-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem .7rem; }
.pos-ticket-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: var(--pos-ink); }
.pos-ticket-sub { font-size: .75rem; color: var(--pos-muted); }
.pos-ticket-actions { display: flex; align-items: center; gap: .4rem; }
.pos-icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--pos-muted); }
.pos-icon-btn:hover { background: var(--danger-50, #fef2f2); color: var(--danger-600, #dc2626); }
.pos-held-badge {
    display: inline-flex; align-items: center; gap: .25rem; padding: .3rem .6rem; border-radius: 999px;
    font-weight: 700; font-size: .78rem; color: var(--warning-700, #b45309); background: var(--warning-50, #fffbeb);
}

/* Customer */
.pos-customer { padding: 0 1.2rem .6rem; }
.pos-customer-add {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem;
    border-radius: 12px; font-size: .82rem; font-weight: 500; color: var(--pos-muted);
    border: 1.5px dashed var(--pos-line);
}
.pos-customer-add:hover { color: var(--pos-accent); border-color: var(--pos-accent); }
.pos-seller { display: flex; align-items: center; gap: .45rem; padding: 0 1.2rem .5rem; font-size: .8rem; font-weight: 500; color: var(--pos-muted); }
.pos-seller .pos-input { flex: 1; min-width: 0; padding-block: .35rem; }
.pos-customer-chip {
    display: flex; align-items: center; gap: .45rem; padding: .55rem .75rem; border-radius: 12px;
    background: var(--pos-accent-soft); color: var(--pos-accent); font-size: .85rem; font-weight: 600;
}
.pos-customer-chip button { margin-left: auto; }
.pos-customer-email { display: flex; gap: .4rem; margin-top: .4rem; }
.pos-customer-email .pos-input { flex: 1; min-width: 0; border-color: var(--pos-accent); }
.pos-customer-email-error { margin-top: .25rem; font-size: .75rem; color: #dc2626; }
.pos-customer-email-value { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; padding-inline: .25rem; font-size: .75rem; color: var(--pos-muted); }
.pos-customer-credit { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; padding-inline: .25rem; font-size: .75rem; font-weight: 600; color: var(--pos-accent); }
.pos-customer-search { margin-top: .5rem; }
.pos-customer-search ul { margin-top: .25rem; max-height: 320px; overflow-y: auto; }
.pos-customer-search li button { width: 100%; display: flex; flex-direction: column; text-align: start; padding: .5rem .65rem; border-radius: 10px; font-size: .85rem; }
.pos-customer-search li button:hover,
.pos-customer-search li button.is-active { background: var(--pos-accent-soft); }
.pos-customer-search li button.is-active span:first-child { color: var(--pos-accent); font-weight: 600; }
.pos-customer-search li button small { font-size: .72rem; color: var(--pos-muted); font-family: ui-monospace, monospace; }
.pos-customer-none { padding: .6rem .65rem; font-size: .82rem; color: var(--pos-muted); }

/* Lines */
.pos-lines { flex: 1; overflow-y: auto; padding: .25rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.pos-line { display: flex; gap: .65rem; padding: .55rem; border-radius: 14px; background: var(--pos-canvas); }
.pos-line-thumb {
    flex: none; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
    background: var(--pos-surface); font-weight: 800; color: var(--pos-muted);
}
.pos-line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pos-line-info { flex: 1; min-width: 0; }
.pos-line-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.pos-line-name { font-weight: 600; font-size: .85rem; color: var(--pos-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-line-total { font-weight: 800; font-size: .9rem; color: var(--pos-ink); white-space: nowrap; }
.pos-line-controls { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; }
.pos-stepper { display: flex; align-items: center; gap: .1rem; }
.pos-stepper button { width: 1.6rem; height: 1.6rem; border-radius: 8px; font-weight: 700; line-height: 1; background: var(--pos-surface); color: var(--pos-ink); box-shadow: 0 1px 1px rgb(0 0 0 / .05); }
.pos-stepper button:hover { background: var(--pos-accent); color: #fff; }
.pos-stepper span { min-width: 1.8rem; text-align: center; font-weight: 700; font-size: .82rem; }
.pos-line-unit { font-size: .72rem; color: var(--pos-muted); }
.pos-price { display: flex; align-items: center; gap: .2rem; padding: .15rem .4rem; border-radius: 8px; background: var(--pos-surface); box-shadow: inset 0 0 0 1px transparent; }
.pos-price span { font-size: .68rem; color: var(--pos-muted); }
.pos-price input { width: 5.5rem; background: transparent; border: 0; outline: 0; text-align: right; font-size: .72rem; font-weight: 700; color: var(--pos-ink); }
.pos-price.is-missing { box-shadow: inset 0 0 0 1px var(--danger-500, #ef4444); }
.pos-price.is-missing input::placeholder { color: var(--danger-500, #ef4444); }
.pos-disc { display: flex; align-items: center; gap: .05rem; padding: .15rem .4rem; border-radius: 8px; background: var(--pos-surface); margin-left: auto; }
.pos-disc input { width: 2rem; background: transparent; border: 0; outline: 0; text-align: right; font-size: .72rem; font-weight: 700; color: var(--pos-ink); }
.pos-disc span { font-size: .68rem; color: var(--pos-muted); }
.pos-line-x { color: var(--pos-muted); padding: .15rem; }
.pos-line-x:hover { color: var(--danger-500, #ef4444); }

/* Summary */
.pos-summary { padding: 1rem 1.2rem calc(2.25rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--pos-line); }
.pos-summary-rows { display: flex; flex-direction: column; gap: .15rem; }
.pos-summary-rows > div { display: flex; justify-content: space-between; font-size: .85rem; color: var(--pos-muted); }
.pos-summary-rows .is-discount { color: var(--success-600, #16a34a); }
.pos-grand { display: flex; align-items: baseline; justify-content: space-between; margin: .55rem 0 .9rem; }
.pos-grand span:first-child { font-weight: 700; font-size: 1rem; color: var(--pos-ink); }
.pos-grand span:last-child { font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em; color: var(--pos-ink); }

.pos-actions { display: flex; gap: .6rem; }
.pos-btn-hold {
    display: flex; align-items: center; gap: .35rem; padding: .85rem 1.1rem; border-radius: 14px;
    font-weight: 700; font-size: .85rem; color: var(--pos-ink); background: var(--pos-canvas);
}
.pos-btn-hold:hover:not(:disabled) { background: var(--pos-line); }
.pos-btn-hold:disabled, .pos-btn-charge:disabled { opacity: .4; cursor: not-allowed; }
.pos-btn-charge {
    flex: 1; display: flex; align-items: center; gap: .6rem; padding: .85rem 1.25rem; border-radius: 14px;
    color: #fff; background: var(--pos-accent); box-shadow: 0 10px 22px -10px var(--pos-accent);
    transition: filter .12s, transform .08s;
}
.pos-btn-charge:hover:not(:disabled) { filter: brightness(1.07); }
.pos-btn-charge:active:not(:disabled) { transform: scale(.99); }
.pos-charge-lbl { font-weight: 700; white-space: nowrap; }
.pos-charge-lbl small { opacity: .85; font-weight: 600; }
.pos-charge-amt { margin-left: auto; font-weight: 800; font-size: 1.1rem; white-space: nowrap; }

/* ── Open register ───────────────────────────────────────────────────── */
.pos-open { height: 100dvh; display: grid; place-items: center; background: var(--pos-canvas); }
.pos-open-card { width: 100%; max-width: 380px; padding: 2.25rem; text-align: center; border-radius: 22px; background: var(--pos-surface); box-shadow: 0 24px 60px -20px rgb(0 0 0 / .25); }
.pos-open-logo { height: 44px; margin: 0 auto 1.25rem; }
.pos-open-card h2 { font-size: 1.2rem; font-weight: 800; color: var(--pos-ink); }
.pos-open-card p { font-size: .85rem; color: var(--pos-muted); margin-bottom: 1.25rem; }
.pos-field-label { display: block; text-align: start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--pos-muted); margin: .75rem 0 .35rem; }
.pos-open-btn { width: 100%; margin-top: 1.25rem; }

/* ── Inputs / buttons ────────────────────────────────────────────────── */
.pos-input { width: 100%; padding: .7rem .85rem; border-radius: 12px; font-size: .92rem; background: var(--pos-canvas); color: var(--pos-ink); border: 1px solid transparent; outline: 0; }
.pos-input:focus { border-color: var(--pos-accent); }
.pos-btn-primary { padding: .8rem 1rem; border-radius: 12px; font-weight: 700; color: #fff; background: var(--pos-accent); }
.pos-btn-primary:hover { filter: brightness(1.07); }

/* ── Overlays / modal ────────────────────────────────────────────────── */
.pos-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; background: rgb(10 12 18 / .55); backdrop-filter: blur(2px); }
.pos-modal { width: 100%; max-width: 440px; max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.4rem; border-radius: 22px; background: var(--pos-surface); box-shadow: 0 30px 70px -20px rgb(0 0 0 / .5); }
.pos-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.pos-modal-head h3 { font-size: 1.15rem; font-weight: 800; color: var(--pos-ink); }
.pos-modal-head button { color: var(--pos-muted); }
.pos-due { display: flex; align-items: baseline; justify-content: space-between; padding: 1rem 1.1rem; border-radius: 16px; background: var(--pos-accent-soft); margin-bottom: 1.1rem; }
.pos-due span { font-size: .8rem; font-weight: 600; color: var(--pos-accent); }
.pos-due strong { font-size: 1.6rem; font-weight: 800; color: var(--pos-accent); }
/* The amount due with its dollar equivalent under it; taking dollars, the dollars lead and the bills to collect follow. */
.pos-due { align-items: center; }
.pos-due-amounts { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-feature-settings: "tnum" 1; }
.pos-due-amounts small { font-size: .78rem; font-weight: 600; color: var(--pos-muted); }
.pos-due-amounts .pos-due-collect { margin-top: .2rem; padding: .15rem .55rem; border-radius: 8px; background: var(--pos-surface); color: var(--pos-accent); font-size: .85rem; font-weight: 800; }
.pos-denoms { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .85rem; }
.pos-denom { padding: .7rem .35rem; border-radius: 12px; font-weight: 700; font-size: .82rem; background: var(--pos-canvas); color: var(--pos-ink); white-space: nowrap; }
.pos-denom:hover { background: var(--pos-line); }
.pos-denom.is-exact { background: var(--success-50, #f0fdf4); color: var(--success-700, #15803d); }
.dark .pos-denom.is-exact { background: rgb(34 197 94 / .14); color: var(--success-300, #86efac); }
.pos-denom.is-nav { background: var(--pos-accent-soft); color: var(--pos-accent); box-shadow: inset 0 0 0 2px var(--pos-accent); transform: scale(1.05); }
.pos-confirm.is-nav { outline: 3px solid #fff; outline-offset: -4px; box-shadow: 0 0 0 4px var(--pos-accent); }
.pos-kbd-hint { text-align: center; font-size: .72rem; color: var(--pos-muted); margin: -.35rem 0 .85rem; }
.pos-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: .9rem; }
.pos-method { padding: .75rem; border-radius: 12px; font-weight: 600; font-size: .85rem; background: var(--pos-canvas); color: var(--pos-ink); border: 2px solid transparent; }
.pos-method.is-active { background: var(--pos-accent-soft); color: var(--pos-accent); border-color: var(--pos-accent); }
.pos-method.is-nav { box-shadow: 0 0 0 3px var(--pos-accent); }
.pos-amount-row { display: flex; gap: .5rem; margin-bottom: .9rem; }
.pos-pay-details { display: flex; gap: .5rem; margin-bottom: .9rem; }
.pos-pay-details select, .pos-pay-details input { flex: 1; min-width: 0; padding: .6rem .75rem; border-radius: 12px; background: var(--pos-canvas); color: var(--pos-ink); border: 2px solid transparent; font-size: .85rem; font-weight: 600; }
.pos-pay-details select:focus, .pos-pay-details input:focus { outline: 0; border-color: var(--pos-accent); }
.pos-pay-date { flex: 1; min-width: 0; display: flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 600; color: var(--pos-ink); }
.pos-pay-date span { white-space: nowrap; opacity: .7; }
.pos-credit-terms > span { display: block; font-size: .72rem; color: var(--pos-muted); margin-bottom: .35rem; }
.pos-fi-fields { margin-bottom: .9rem; }
.pos-seller-field { flex: 1; min-width: 0; }
.pos-credit-schedule { display: flex; flex-direction: column; gap: .2rem; margin: 0 0 .9rem; padding: .5rem .75rem; border-radius: 11px; background: var(--pos-canvas); font-size: .8rem; font-feature-settings: "tnum" 1; }
.pos-credit-schedule li, .pos-advance-note li, .pos-done-invoices li { display: flex; justify-content: space-between; gap: .75rem; }
.pos-credit-schedule li span { color: var(--pos-muted); }
.pos-advance-note { margin: 0 0 .9rem; padding: .65rem .8rem; border-radius: 12px; background: var(--pos-accent-soft); font-size: .82rem; font-feature-settings: "tnum" 1; }
.pos-advance-note strong { display: block; margin-bottom: .3rem; color: var(--pos-accent); }
.pos-advance-note ul { display: flex; flex-direction: column; gap: .2rem; }
.pos-advance-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-bottom: .55rem; }
.pos-advance-choice button { padding: .45rem .5rem; border-radius: 9px; border: 1px solid var(--pos-accent); background: transparent; color: var(--pos-accent); font-weight: 600; font-size: .8rem; }
.pos-advance-choice button.is-active { background: var(--pos-accent); color: #fff; }
.pos-advance-hint { margin: 0 0 .9rem; font-size: .78rem; color: var(--pos-muted); }
.pos-amount-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; padding: .65rem .9rem; border-radius: 12px; background: var(--pos-canvas); border: 2px solid transparent; }
.pos-amount-field:focus-within { border-color: var(--pos-accent); }
.pos-amount-field span { color: var(--pos-muted); font-weight: 700; }
.pos-amount-input { flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; outline: 0; text-align: right; font-size: 1.2rem; font-weight: 800; color: var(--pos-ink); }
.pos-pay-list { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .9rem; }
.pos-pay-list li { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-radius: 11px; background: var(--pos-canvas); font-size: .85rem; }
.pos-pay-list li span:nth-child(2) { margin-left: auto; font-weight: 700; }
.pos-pay-list li button { color: var(--pos-muted); }
.pos-pay-list li button:hover { color: var(--danger-500, #ef4444); }
.pos-pay-summary { display: flex; justify-content: space-between; padding: .4rem 0 1rem; }
.pos-pay-summary div { display: flex; flex-direction: column; }
.pos-pay-summary span { font-size: .72rem; color: var(--pos-muted); }
.pos-pay-summary strong { font-size: 1.1rem; font-weight: 800; color: var(--pos-ink); }
.pos-pay-summary .is-change strong { color: var(--success-600, #16a34a); }
.pos-pay-summary .is-change small { font-size: .72rem; font-weight: 600; color: var(--pos-muted); font-feature-settings: "tnum" 1; }
.pos-confirm { width: 100%; padding: 1rem; font-size: 1.02rem; }

/* Held list */
.pos-held-list { display: flex; flex-direction: column; gap: .45rem; max-height: 62vh; overflow-y: auto; }
.pos-held-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem .9rem; border-radius: 14px; text-align: start; background: var(--pos-canvas); border: 1px solid transparent; }
.pos-held-item:hover { border-color: var(--pos-accent); }
.pos-held-ref { display: block; font-weight: 700; font-size: .88rem; color: var(--pos-ink); }
.pos-held-meta { display: block; font-size: .72rem; color: var(--pos-muted); }
.pos-held-total { font-weight: 800; color: var(--pos-accent); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .pos-body { grid-template-columns: 1fr; }
    .pos-ticket { border-left: 0; border-top: 1px solid var(--pos-line); }
    body.fi-pos-active { overflow: auto; }
    .pos { height: auto; min-height: 100dvh; }
}

/* Manual line (sold without a product: no stock) */
.pos-manual { position: relative; }
.pos-manual-btn { display: inline-flex; align-items: center; gap: .4rem; height: 100%; min-height: 2.6rem; padding: 0 .9rem; border-radius: 12px; border: 1.5px dashed var(--pos-line); color: var(--pos-muted); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.pos-manual-btn:hover { color: var(--pos-accent); border-color: var(--pos-accent); }
.pos-manual-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 23, 42, .45); }
.pos-manual-card { width: min(520px, 100%); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: 1.25rem; border-radius: 16px; background: var(--pos-surface, #fff); box-shadow: 0 24px 60px rgba(15, 23, 42, .25); }
.pos-manual-card h3 { grid-column: 1 / -1; margin: 0; font-size: 1.05rem; font-weight: 700; }
.pos-manual-hint { grid-column: 1 / -1; margin: -.4rem 0 .2rem; font-size: .78rem; color: var(--pos-muted); }
.pos-manual-field { display: grid; gap: .3rem; font-size: .78rem; font-weight: 600; color: var(--pos-muted); }
.pos-manual-wide { grid-column: 1 / -1; }
.pos-manual-error { color: #dc2626; font-weight: 500; }
.pos-manual-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .5rem; margin-top: .25rem; }
.pos-manual-cancel { padding: .55rem .9rem; border-radius: 10px; font-weight: 600; color: var(--pos-muted); }
.pos-manual-add { padding: .55rem 1rem; border-radius: 10px; font-weight: 700; color: #fff; background: var(--pos-accent); }
@media (max-width: 640px) { .pos-manual-card { grid-template-columns: 1fr; } }

/* Charging an order at the register */
.pos-order-results { display: grid; gap: .3rem; max-height: 320px; overflow-y: auto; }
.pos-order-results button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 10px; text-align: left; font-size: .85rem; }
.pos-order-results button:hover { background: var(--pos-accent-soft); }
.pos-order-results small { color: var(--pos-muted); white-space: nowrap; }
.pos-order-none { padding: .6rem .75rem; font-size: .82rem; color: var(--pos-muted); }
.pos-order-banner { display: flex; align-items: center; gap: .45rem; margin: 0 1.2rem .6rem; padding: .55rem .75rem; border-radius: 12px; background: var(--pos-accent-soft); color: var(--pos-accent); font-size: .85rem; }
.pos-order-banner button { margin-left: auto; }

/* New customer at the register */
.pos-customer-new-btn { display: flex; align-items: center; gap: .4rem; width: 100%; margin-top: .4rem; padding: .55rem .75rem; border-radius: 10px; font-size: .85rem; font-weight: 600; color: var(--pos-accent); background: var(--pos-accent-soft); }
.pos-customer-new { display: grid; gap: .55rem; margin-top: .5rem; padding: .75rem; border-radius: 12px; background: var(--pos-surface-2, rgba(0,0,0,.03)); }
.pos-customer-new label { display: grid; gap: .25rem; font-size: .75rem; font-weight: 600; color: var(--pos-muted); }
.pos-customer-new-note { font-size: .8rem; color: var(--pos-muted); }
.pos-customer-new-note.is-found { color: #15803d; font-weight: 600; }
.pos-customer-new-note.is-warning { color: #b45309; font-weight: 600; }
.pos-customer-new-suggestion { display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start; padding: .35rem .6rem; border: 1px solid #f59e0b; border-radius: .5rem; background: #fffbeb; color: #b45309; font-size: .8rem; font-weight: 600; text-align: left; }
.pos-customer-new-suggestion.is-existing { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.pos-customer-new-similar { display: flex; flex-direction: column; gap: .35rem; }
.pos-customer-new-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.pos-btn-ghost { padding: .55rem .9rem; border-radius: 10px; font-size: .85rem; font-weight: 600; color: var(--pos-muted); }
.pos-btn-ghost:hover { background: var(--pos-accent-soft); }

/* Payment: two columns when there is width (tender on the left, amounts on the right), so
   it fits short screens; one column and scrolling otherwise. */
.pos-pay-modal { max-width: 460px; }
@media (min-width: 900px) {
    .pos-pay-modal { max-width: 860px; }
    .pos-pay-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
}
.pos-pay-col { min-width: 0; }

/* Charging without a customer */
.pos-walkin { max-width: 400px; text-align: center; }
.pos-walkin-icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; margin: 0 auto .75rem; border-radius: 999px; background: var(--warning-50, #fffbeb); color: var(--warning-600, #d97706); }
.pos-walkin h3 { font-size: 1.15rem; font-weight: 800; color: var(--pos-ink); }
.pos-walkin p { margin: .4rem 0 1.2rem; font-size: .9rem; color: var(--pos-muted); }
.pos-walkin-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }

/* Cash in guaraníes or dollars */
.pos-currency-choice { display: flex; gap: .5rem; flex-wrap: wrap; margin: -.3rem 0 .85rem; }
.pos-currency-choice button { display: flex; flex-direction: column; align-items: flex-start; padding: .45rem .8rem; border-radius: 10px; background: var(--pos-canvas); color: var(--pos-ink); font-weight: 700; font-size: .85rem; border: 2px solid transparent; }
.pos-currency-choice button small { font-weight: 500; font-size: .72rem; color: var(--pos-muted); font-feature-settings: "tnum" 1; }
.pos-currency-choice button.is-active { border-color: var(--pos-accent); background: var(--pos-accent-soft); }
.pos-invoice-currency { align-items: center; margin: 0 0 .85rem; }
.pos-invoice-currency-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--pos-muted); margin-right: .25rem; }
.pos-currency-missing { font-size: .8rem; color: var(--pos-muted); align-self: center; }

/* No payment method preselected: ask for it */
.pos-method-prompt { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; padding: .45rem .75rem; border-radius: 10px; background: var(--warning-50, #fffbeb); color: var(--warning-700, #b45309); font-size: .85rem; font-weight: 700; }
.pos-methods.is-required .pos-method { box-shadow: 0 0 0 2px var(--warning-400, #fbbf24); }

/* Charging all of it on credit, without a down payment */
.pos-no-down-payment .pos-walkin-icon { background: var(--danger-50, #fef2f2); color: var(--danger-600, #dc2626); }
.pos-no-down-payment p strong { color: var(--pos-ink); }
.pos-preview-credit { margin-top: .4rem; display: inline-block; padding: .3rem .7rem; border-radius: 999px; font-size: .85rem; background: var(--pos-canvas); color: var(--pos-ink); font-feature-settings: "tnum" 1; }
.pos-preview-credit.is-none { background: var(--danger-50, #fef2f2); color: var(--danger-700, #b91c1c); font-weight: 700; }

/* Invoice preview before confirming, and the closing panel, above the payment overlay. */
.pos-overlay-top { z-index: 60; }
/* The panel's action modals opened from the terminal (request a regalía from the payment, close
   the register) go above its own overlays, payment included. */
body:has(.fi-pos-page) .fi-modal > .fi-modal-close-overlay,
body:has(.fi-pos-page) .fi-modal > .fi-modal-window-ctn { z-index: 70; }
.pos-preview-modal { width: min(96vw, 1180px); max-width: none; max-height: 96vh; display: flex; flex-direction: column; gap: .75rem; }
.pos-preview-hint { margin-top: .2rem; font-size: .8rem; color: var(--pos-muted); }
.pos-preview-frame { width: 100%; height: calc(96vh - 13rem); min-height: 420px; border: 0; border-radius: 14px; background: #f3f4f6; }
.pos-preview-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .5rem; }
.pos-preview-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .6rem .9rem; border-radius: 12px; background: var(--pos-canvas); color: var(--pos-ink); font-weight: 700; font-size: .9rem; text-align: left; border: 2px solid transparent; }
.pos-preview-tabs button small { font-weight: 500; font-size: .78rem; color: var(--pos-muted); font-feature-settings: "tnum" 1; }
.pos-preview-tabs button.is-active { border-color: var(--pos-accent); background: var(--pos-accent-soft); }
.pos-preview-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.pos-preview-actions kbd, .pos-done kbd { margin-left: .35rem; padding: 0 .3rem; border-radius: 4px; font-size: .7rem; opacity: .7; box-shadow: inset 0 0 0 1px currentColor; }
.pos-done-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0 auto .75rem; border-radius: 999px; background: var(--success-50, #ecfdf5); color: var(--success-600, #059669); }
.pos-done-ref { margin: .3rem 0 .8rem; font-size: .9rem; color: var(--pos-muted); font-feature-settings: "tnum" 1; }
.pos-done-notes { display: flex; align-items: center; justify-content: center; gap: .45rem; margin: 0 0 1rem; padding: .7rem 1rem; border-radius: 12px; background: var(--pos-accent-soft); color: var(--pos-accent); font-weight: 700; font-size: .9rem; }
.pos-done-notes:hover { filter: brightness(.97); }
.pos-step-title { margin: 0 0 .5rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--pos-muted); }
.pos-step-hint { margin: .2rem 0 .9rem; font-size: .8rem; color: var(--pos-muted); }
.pos-step-actions { display: flex; gap: .5rem; margin-top: auto; }
.pos-step-actions button { flex: 1; min-height: 3rem; border-radius: 12px; font-weight: 700; }
.pos-step-actions .pos-btn-ghost { flex: 0 0 auto; padding-inline: 1.2rem; box-shadow: inset 0 0 0 1px var(--pos-line); }
.pos-plan { width: 100%; border-collapse: collapse; font-size: .85rem; font-feature-settings: "tnum" 1; }
.pos-plan th { padding: .4rem .6rem; text-align: left; font-size: .72rem; font-weight: 600; color: var(--pos-muted); border-bottom: 1px solid var(--pos-line); }
.pos-plan td { padding: .45rem .6rem; border-bottom: 1px solid var(--pos-line); }
.pos-plan .num { text-align: right; }
.pos-plan tfoot td { border-bottom: 0; font-weight: 700; }
.pos-done-invoices { display: flex; flex-direction: column; gap: .35rem; margin: 0 0 1rem; text-align: left; font-feature-settings: "tnum" 1; }
.pos-done-invoices li { align-items: center; padding: .55rem .8rem; border-radius: 11px; background: var(--pos-canvas); font-size: .88rem; }
.pos-done-invoices li span { display: flex; flex-direction: column; font-weight: 600; }
.pos-done-invoices li small { font-weight: 500; color: var(--pos-muted); }
.pos-done-change { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 12px; background: var(--pos-accent-soft); }
.pos-done-change strong { font-size: 1.6rem; color: var(--pos-accent); }
.pos-done .pos-input { margin-bottom: 1rem; text-align: center; }
/* Closing panel: a plain-sentence label, and two buttons of the same size with the icon
   beside its text (the primary button is otherwise a block and stacked the icon on top). */
.pos-done .pos-field-label { text-align: center; text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 500; }
.pos-done .pos-walkin-actions { flex-wrap: nowrap; }
.pos-done .pos-walkin-actions button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 3rem; padding: .8rem 1rem; border-radius: 12px; font-size: .95rem; }
.pos-done .pos-btn-ghost { color: var(--pos-ink); box-shadow: inset 0 0 0 1px var(--pos-line); }
@media (max-width: 420px) { .pos-done .pos-walkin-actions { flex-wrap: wrap; } }
.pos-walkin-actions button { flex: 1; min-width: 9rem; }

/* Short or low-resolution screens (1366×768, 1280×720…): tighter chrome, same legibility. */
@media (max-height: 820px) {
    .pos-topbar { height: 48px; }
    .pos-catalogue { padding: .75rem .85rem; gap: .75rem; }
    .pos-searchbar { height: 44px; }
    .pos-ticket-head { padding: .75rem 1rem .5rem; }
    .pos-customer, .pos-seller { padding-inline: 1rem; }
    .pos-lines { padding-inline: 1rem; }
    .pos-summary { padding: .7rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
    .pos-grand { margin: .35rem 0 .6rem; }
    .pos-grand span:last-child { font-size: 1.45rem; }
    .pos-btn-charge, .pos-btn-hold { padding-block: .7rem; }
    .pos-modal { padding: 1.1rem; }
    .pos-due { padding: .7rem .9rem; margin-bottom: .8rem; }
    .pos-due strong { font-size: 1.35rem; }
    .pos-denom, .pos-method { padding-block: .55rem; }
    .pos-confirm { padding: .8rem; }
}

/* An order charged at the register: one total per order (the invoice carries its lines). */
.pos-order-line { background: var(--pos-accent-soft); }
.pos-order-line .pos-line-thumb { color: var(--pos-accent); }
.pos-order-line .pos-line-controls { justify-content: space-between; }

/* An order on credit: the first question, an anticipo now or the pick-up now on credit. */
.pos-charge-choice { display: flex; flex-direction: column; gap: .6rem; }
.pos-charge-options { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.pos-charge-options button { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.1rem; border-radius: 14px; text-align: left; background: var(--pos-canvas); box-shadow: inset 0 0 0 1px var(--pos-line); transition: box-shadow .15s, background .15s; }
.pos-charge-options button:hover, .pos-charge-options button:focus-visible { background: var(--pos-accent-soft); box-shadow: inset 0 0 0 2px var(--pos-accent); outline: 0; }
.pos-charge-options strong { font-size: 1rem; color: var(--pos-ink); }
.pos-charge-options span { font-size: .8rem; line-height: 1.35; color: var(--pos-muted); }
.pos-charge-picked { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 .9rem; padding: .55rem .8rem; border-radius: 12px; background: var(--pos-accent-soft); font-size: .82rem; font-weight: 600; color: var(--pos-accent); }
.pos-charge-picked button { font-size: .75rem; font-weight: 600; text-decoration: underline; color: var(--pos-ink); }
@media (max-width: 640px) { .pos-charge-options { grid-template-columns: 1fr; } }
