/* ==========================================================================
   Kasir UMKM (Mini POS) — Tactile Retail Grid & Thermal Receipt Paper
   Palette:
     Warm Newsprint Paper : #F6F4EE
     Card Surface         : #FFFFFF
     Deep Ink             : #141414
     Emerald Safe / Pay   : #15803D
     Terracotta Low Stock : #C2410C
     Crimson Out / Error  : #B91C1C
   Strictly NO gradients and NO soft drop shadows.
   ========================================================================== */

:root {
    --bg-paper: #F6F4EE;
    --surface: #FFFFFF;
    --surface-muted: #EFECE3;
    --ink: #141414;
    --ink-muted: #52524D;
    --emerald: #15803D;
    --emerald-tint: #DCFCE7;
    --terracotta: #C2410C;
    --terracotta-tint: #FFEDD5;
    --crimson: #B91C1C;
    --crimson-tint: #FEE2E2;
    --border-w: 1.5px;
    --shadow-hard: 3px 3px 0px #141414;
    --shadow-pressed: 1px 1px 0px #141414;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button,
input {
    font-family: inherit;
    color: inherit;
}

/* ==========================================================================
   Top Header Bar
   ========================================================================== */
.pos-header {
    background-color: var(--surface);
    border-bottom: 2px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 40;
}

.pos-header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-tag {
    background-color: var(--ink);
    color: var(--surface);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 5px 8px;
    border: var(--border-w) solid var(--ink);
    white-space: nowrap;
}

.brand-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.brand-sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--ink-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sandbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    background-color: var(--bg-paper);
    border: var(--border-w) solid var(--ink);
    white-space: nowrap;
}

.pill-dot {
    width: 8px;
    height: 8px;
    background-color: var(--emerald);
    border: 1px solid var(--ink);
    display: inline-block;
}

.pill-sep {
    color: var(--ink-muted);
}

.header-btn-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Tactile Buttons (Hard Offset Shadow — Mechanical Feel) */
.btn-tactile {
    appearance: none;
    cursor: pointer;
    border: var(--border-w) solid var(--ink);
    box-shadow: var(--shadow-hard);
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    background-color: var(--surface);
    color: var(--ink);
    transition: transform 80ms ease, box-shadow 80ms ease, background-color 120ms ease;
    white-space: nowrap;
}

.btn-tactile:hover:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px var(--ink);
}

.btn-tactile:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-pressed);
}

.btn-tactile:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-neutral {
    background-color: var(--surface);
    color: var(--ink);
}

.btn-ink {
    background-color: var(--ink);
    color: var(--surface);
}

.btn-emerald {
    background-color: var(--emerald);
    color: var(--surface);
}

.btn-terracotta {
    background-color: var(--terracotta-tint);
    color: var(--terracotta);
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* ==========================================================================
   Main Page Shell
   ========================================================================== */
.pos-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px 20px 88px;
}

/* ==========================================================================
   Daily Summary Metric Strip
   ========================================================================== */
.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.metric-card {
    background-color: var(--surface);
    border: var(--border-w) solid var(--ink);
    box-shadow: var(--shadow-hard);
    padding: 14px 16px;
    transition: background-color 220ms ease, border-color 220ms ease;
}

.metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.metric-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
}

.metric-delta {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--emerald);
    min-height: 16px;
}

.metric-sku {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    background-color: var(--bg-paper);
    border: 1px solid var(--ink);
}

.metric-value {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.metric-value-text {
    font-family: var(--font-sans);
    font-size: 20px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-muted);
}

.metric-foot {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--ink-muted);
}

.metric-foot code {
    font-size: 11px;
    background-color: var(--bg-paper);
    padding: 1px 4px;
    border: 1px solid var(--ink);
    color: var(--ink);
}

/* Momentary Emerald Visual Feedback Flash after Checkout */
@keyframes emeraldFlash {
    0% {
        background-color: var(--emerald-tint);
        border-color: var(--emerald);
    }
    70% {
        background-color: var(--emerald-tint);
        border-color: var(--emerald);
    }
    100% {
        background-color: var(--surface);
        border-color: var(--ink);
    }
}

.flash-emerald {
    animation: emeraldFlash 1.55s ease-out;
}

/* ==========================================================================
   3-Step HR Guide Banner
   ========================================================================== */
.guide-banner {
    background-color: var(--surface);
    border: var(--border-w) solid var(--ink);
    border-left: 6px solid var(--emerald);
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.guide-kicker {
    background-color: var(--emerald);
    color: var(--surface);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.guide-text {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.guide-arrow {
    color: var(--ink-muted);
    font-weight: 700;
}

/* ==========================================================================
   Alert / Feedback Strip
   ========================================================================== */
.pos-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 14px;
    border: var(--border-w) solid var(--ink);
    box-shadow: var(--shadow-hard);
    background-color: var(--surface);
}

.pos-alert[hidden] {
    display: none;
}

.pos-alert.alert-success {
    background-color: var(--emerald-tint);
    border-color: var(--emerald);
    color: var(--ink);
}

.pos-alert.alert-error {
    background-color: var(--crimson-tint);
    border-color: var(--crimson);
    color: var(--ink);
}

.pos-alert.alert-warning {
    background-color: var(--terracotta-tint);
    border-color: var(--terracotta);
    color: var(--ink);
}

.pos-alert-body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    font-size: 13.5px;
}

.pos-alert-title {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pos-alert-close {
    appearance: none;
    background: transparent;
    border: var(--border-w) solid var(--ink);
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

/* ==========================================================================
   Split View: Left Catalog Grid + Right Thermal Receipt
   ========================================================================== */
.pos-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 20px;
    align-items: start;
}

/* Catalog Toolbar */
.catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.category-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cat-tab {
    appearance: none;
    cursor: pointer;
    background-color: var(--surface);
    border: var(--border-w) solid var(--ink);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 100ms ease, color 100ms ease;
}

.cat-tab.active {
    background-color: var(--ink);
    color: var(--surface);
}

.catalog-search-wrap {
    flex: 1 1 210px;
    max-width: 280px;
}

.catalog-search {
    width: 100%;
    padding: 7px 11px;
    background-color: var(--surface);
    border: var(--border-w) solid var(--ink);
    font-size: 13.5px;
    outline: none;
}

.catalog-search:focus {
    box-shadow: 2px 2px 0px var(--ink);
}

.stock-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--ink-muted);
    margin-bottom: 12px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border: 1px solid var(--ink);
    display: inline-block;
}

.dot-available {
    background-color: var(--emerald);
}

.dot-low {
    background-color: var(--terracotta);
}

.dot-out {
    background-color: var(--crimson);
}

/* Product Tactile Retail Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 13px;
}

.product-card {
    appearance: none;
    text-align: left;
    cursor: pointer;
    background-color: var(--surface);
    border: var(--border-w) solid var(--ink);
    box-shadow: var(--shadow-hard);
    padding: 13px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 11px;
    position: relative;
    transition: transform 80ms ease, box-shadow 80ms ease, background-color 160ms ease;
    width: 100%;
}

.product-card:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px var(--ink);
}

.product-card:active,
.product-card.is-pressed {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-pressed);
}

.product-card.in-cart {
    border-color: var(--ink);
    outline: 2px solid var(--emerald);
    outline-offset: -4px;
}

.product-card.status-low {
    border-top: 4px solid var(--terracotta);
}

.product-card.status-out {
    background-color: var(--surface-muted);
    border-style: dashed;
}

.product-card.status-out .product-name,
.product-card.status-out .product-price {
    color: var(--ink-muted);
}

.product-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.product-sku {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-muted);
    letter-spacing: 0.03em;
}

.stock-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 7px;
    border: 1px solid var(--ink);
    white-space: nowrap;
}

.badge-available {
    background-color: var(--emerald-tint);
    color: var(--emerald);
    border-color: var(--emerald);
}

.badge-low {
    background-color: var(--terracotta-tint);
    color: var(--terracotta);
    border-color: var(--terracotta);
}

.badge-out {
    background-color: var(--crimson-tint);
    color: var(--crimson);
    border-color: var(--crimson);
}

.product-card-mid {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.product-name {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}

.product-category {
    font-size: 12px;
    color: var(--ink-muted);
}

.product-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 9px;
    border-top: 1px dashed #B5B1A6;
}

.product-price {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--ink);
}

.product-cta {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border: var(--border-w) solid var(--ink);
    background-color: var(--bg-paper);
    color: var(--ink);
}

.product-card.in-cart .product-cta {
    background-color: var(--emerald);
    color: var(--surface);
    border-color: var(--ink);
}

.product-card.status-out .product-cta {
    background-color: var(--crimson-tint);
    color: var(--crimson);
    border-color: var(--crimson);
}

.stock-delta-tag {
    position: absolute;
    top: -10px;
    right: 10px;
    background-color: var(--emerald);
    color: var(--surface);
    border: var(--border-w) solid var(--ink);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    z-index: 2;
}

.catalog-empty {
    background-color: var(--surface);
    border: var(--border-w) solid var(--ink);
    padding: 28px 18px;
    text-align: center;
}

.catalog-empty[hidden] {
    display: none;
}

/* ==========================================================================
   RIGHT: Interactive Thermal Receipt Paper (Signature UI)
   ========================================================================== */
.receipt-column {
    position: sticky;
    top: 84px;
}

.receipt-drawer-bar {
    display: none;
}

.receipt-paper-wrap {
    display: flex;
    flex-direction: column;
}

.receipt-paper {
    background-color: var(--surface);
    border-top: var(--border-w) solid var(--ink);
    border-left: var(--border-w) solid var(--ink);
    border-right: var(--border-w) solid var(--ink);
    border-bottom: none;
    padding: 18px 18px 14px;
}

.receipt-serrated {
    display: block;
    width: 100%;
    height: 14px;
    margin-top: -1px;
}

.receipt-header {
    text-align: center;
}

.receipt-store {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.receipt-meta {
    margin: 3px 0 0;
    font-size: 10.5px;
    color: var(--ink-muted);
}

.receipt-dashed {
    border-top: 1.5px dashed var(--ink);
    margin: 11px 0;
}

.receipt-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    text-align: left;
    flex-wrap: wrap;
}

.receipt-body[hidden] {
    display: none;
}

/* Cart Empty State */
.cart-empty {
    padding: 22px 8px;
    text-align: center;
}

.cart-empty[hidden] {
    display: none;
}

.cart-empty-code {
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.cart-empty-hint {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-muted);
}

/* Cart Line Items */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 290px;
    overflow-y: auto;
    padding-right: 2px;
}

.cart-items-list[hidden] {
    display: none;
}

.cart-line {
    border-bottom: 1px dashed #C7C3B8;
    padding-bottom: 9px;
}

.cart-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-line-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.cart-line-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
}

.cart-line-sku {
    display: block;
    font-size: 10.5px;
    color: var(--ink-muted);
    margin-top: 2px;
}

.cart-line-remove {
    appearance: none;
    background: transparent;
    border: 1px solid var(--ink);
    width: 24px;
    height: 24px;
    line-height: 1;
    cursor: pointer;
    font-size: 15px;
    flex-shrink: 0;
}

.cart-line-remove:hover {
    background-color: var(--crimson-tint);
    color: var(--crimson);
    border-color: var(--crimson);
}

.cart-line-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: var(--border-w) solid var(--ink);
    background-color: var(--bg-paper);
}

.qty-btn {
    appearance: none;
    border: none;
    background: transparent;
    width: 30px;
    height: 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.qty-btn:hover {
    background-color: var(--surface-muted);
}

.qty-val {
    min-width: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    border-left: 1px solid var(--ink);
    border-right: 1px solid var(--ink);
    padding: 3px 4px;
    background-color: var(--surface);
}

.cart-line-sub {
    font-size: 13.5px;
    font-weight: 700;
}

/* Totals */
.receipt-totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
}

.total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.total-grand {
    font-size: 16.5px;
    padding-top: 4px;
}

/* Payment Method Selector */
.payment-block {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1.5px dashed var(--ink);
}

.payment-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 7px;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.pay-opt {
    appearance: none;
    cursor: pointer;
    border: var(--border-w) solid var(--ink);
    background-color: var(--surface);
    padding: 7px 6px;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
}

.pay-opt.active {
    background-color: var(--ink);
    color: var(--surface);
}

.cash-quick-wrap {
    margin-top: 10px;
    padding: 9px 10px;
    background-color: var(--bg-paper);
    border: 1px solid var(--ink);
}

.cash-quick-wrap[hidden] {
    display: none;
}

.cash-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 700;
}

.cash-input {
    width: 145px;
    padding: 5px 8px;
    border: var(--border-w) solid var(--ink);
    background-color: var(--surface);
    font-size: 13px;
    text-align: right;
    outline: none;
}

.cash-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 7px;
}

.cash-preset-btn {
    appearance: none;
    cursor: pointer;
    border: 1px solid var(--ink);
    background-color: var(--surface);
    padding: 4px 4px;
    font-size: 11px;
    font-weight: 600;
}

.cash-preset-btn:hover {
    background-color: var(--ink);
    color: var(--surface);
}

.change-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

/* Primary Pay Button */
.checkout-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-pay {
    appearance: none;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    background-color: var(--emerald);
    color: var(--surface);
    border: var(--border-w) solid var(--ink);
    box-shadow: var(--shadow-hard);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: transform 80ms ease, box-shadow 80ms ease;
}

.btn-pay:hover:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px var(--ink);
}

.btn-pay:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-pressed);
}

.btn-pay:disabled {
    background-color: #9CA3AF;
    color: #F9FAFB;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-clear-cart {
    appearance: none;
    cursor: pointer;
    width: 100%;
    padding: 6px;
    font-size: 11.5px;
    background: transparent;
    border: 1px dashed var(--ink);
    color: var(--ink-muted);
}

.btn-clear-cart[hidden] {
    display: none;
}

.btn-clear-cart:hover {
    color: var(--crimson);
    border-color: var(--crimson);
}

/* Paid Receipt + LUNAS Stamp */
@keyframes stampPop {
    0% {
        transform: rotate(-7deg) scale(1.35);
        opacity: 0;
    }
    100% {
        transform: rotate(-4deg) scale(1);
        opacity: 1;
    }
}

.lunas-stamp-wrap {
    display: flex;
    justify-content: center;
    margin: 4px 0 12px;
}

.lunas-stamp {
    display: inline-block;
    border: 2.5px solid var(--emerald);
    color: var(--emerald);
    background-color: var(--emerald-tint);
    padding: 5px 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    transform: rotate(-4deg);
    animation: stampPop 220ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.paid-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}

.paid-line-name {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 13px;
}

.paid-line-calc {
    display: flex;
    justify-content: space-between;
    color: var(--ink-muted);
    margin-top: 2px;
}

.paid-line-calc strong {
    color: var(--ink);
}

.snapshot-note {
    margin-top: 12px;
    padding: 8px 10px;
    background-color: var(--bg-paper);
    border: 1px solid var(--ink);
    font-size: 11px;
    line-height: 1.45;
}

.paid-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.paid-sub-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.receipt-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1.5px dashed var(--ink);
    text-align: center;
    font-size: 10.5px;
    color: var(--ink-muted);
}

.receipt-footer p {
    margin: 2px 0;
}

/* ==========================================================================
   Corner System Log / Proof Indicator
   ========================================================================== */
.proof-panel {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 410px;
    max-width: calc(100vw - 36px);
    background-color: var(--surface);
    border: var(--border-w) solid var(--ink);
    box-shadow: var(--shadow-hard);
    z-index: 60;
}

.proof-header {
    appearance: none;
    cursor: pointer;
    width: 100%;
    background-color: var(--ink);
    color: var(--surface);
    border: none;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 600;
}

.proof-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.proof-led {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    border: 1px solid var(--surface);
}

.led-ok {
    background-color: #22C55E;
}

.led-error {
    background-color: #EF4444;
}

.led-busy {
    background-color: #F59E0B;
}

.proof-title {
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.proof-badge {
    background-color: var(--emerald);
    color: var(--surface);
    padding: 2px 6px;
    font-size: 10.5px;
    white-space: nowrap;
}

.proof-badge.badge-err {
    background-color: var(--crimson);
}

.proof-latency {
    color: #D4D4CE;
    font-size: 10.5px;
    white-space: nowrap;
}

.proof-body {
    border-top: var(--border-w) solid var(--ink);
    background-color: var(--surface);
}

.proof-body[hidden] {
    display: none;
}

.proof-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 7px 12px;
    background-color: var(--bg-paper);
    border-bottom: 1px solid var(--ink);
    font-size: 10.5px;
    color: var(--ink-muted);
}

.proof-specs strong {
    color: var(--ink);
}

.proof-log-list {
    list-style: none;
    margin: 0;
    padding: 10px 12px;
    max-height: 230px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 11px;
}

.proof-log-item {
    border-left: 3px solid var(--ink);
    padding-left: 8px;
    line-height: 1.38;
}

.proof-log-item.step-ok {
    border-left-color: var(--emerald);
}

.proof-log-item.step-error {
    border-left-color: var(--crimson);
    background-color: var(--crimson-tint);
    padding: 4px 6px 4px 8px;
}

.proof-log-item.step-info {
    border-left-color: var(--terracotta);
}

.proof-step-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-weight: 700;
}

.proof-step-time {
    color: var(--ink-muted);
    font-weight: 400;
}

.proof-step-detail {
    color: var(--ink);
    word-break: break-word;
}

.proof-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--ink);
    background-color: var(--bg-paper);
}

.btn-proof-action {
    appearance: none;
    cursor: pointer;
    border: 1px solid var(--ink);
    background-color: var(--terracotta-tint);
    color: var(--terracotta);
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 700;
}

.btn-proof-clear {
    appearance: none;
    cursor: pointer;
    border: 1px solid var(--ink);
    background-color: var(--surface);
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================================================
   Recent Transactions History Modal
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(20, 20, 20, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 80;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-sheet {
    width: 100%;
    max-width: 660px;
    max-height: 85vh;
    background-color: var(--bg-paper);
    border: 2px solid var(--ink);
    box-shadow: 5px 5px 0px var(--ink);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 14px 18px;
    background-color: var(--surface);
    border-bottom: var(--border-w) solid var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-kicker {
    margin: 0 0 2px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--emerald);
}

.modal-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.history-list {
    padding: 14px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background-color: var(--surface);
    border: var(--border-w) solid var(--ink);
    box-shadow: 2px 2px 0px var(--ink);
    padding: 12px 14px;
}

.history-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--ink);
}

.history-inv {
    font-weight: 700;
    font-size: 13px;
}

.history-meta {
    font-size: 11.5px;
    color: var(--ink-muted);
}

.history-items {
    margin: 8px 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.history-items li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.history-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--ink);
}

/* ==========================================================================
   Mobile Docked Checkout Bar (Hidden on Desktop)
   ========================================================================== */
.mobile-cart-bar,
.receipt-backdrop {
    display: none;
}

/* ==========================================================================
   Responsive Breakpoints — Consistent Desktop, Tablet & Mobile Experience
   ========================================================================== */
@media (max-width: 1023px) {
    .pos-shell {
        padding: 14px 14px 104px;
    }

    .pos-split {
        grid-template-columns: 1fr;
    }

    /* Turn Right Thermal Receipt into Slide-Up Sheet on Mobile/Tablet */
    .receipt-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background-color: rgba(20, 20, 20, 0.55);
        z-index: 65;
    }

    .receipt-backdrop[hidden] {
        display: none;
    }

    .receipt-column {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        max-height: 88vh;
        background-color: var(--bg-paper);
        border-top: 2px solid var(--ink);
        z-index: 70;
        display: flex;
        flex-direction: column;
        transform: translateY(105%);
        transition: transform 200ms ease;
    }

    .receipt-column.is-open {
        transform: translateY(0);
    }

    .receipt-drawer-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        background-color: var(--ink);
        color: var(--surface);
        font-size: 12px;
        font-weight: 700;
        flex-shrink: 0;
    }

    .btn-drawer-close {
        appearance: none;
        cursor: pointer;
        border: 1px solid var(--surface);
        background: transparent;
        color: var(--surface);
        padding: 4px 10px;
        font-size: 12px;
        font-weight: 600;
    }

    .receipt-paper-wrap {
        padding: 14px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cart-items-list {
        max-height: none;
    }

    /* Docked Bottom Bar on Mobile */
    .mobile-cart-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 10px 14px;
        background-color: var(--surface);
        border-top: 2px solid var(--ink);
        z-index: 55;
    }

    .mobile-cart-meta {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .mobile-cart-count {
        font-size: 11px;
        font-weight: 700;
        color: var(--ink-muted);
    }

    .mobile-cart-total {
        font-size: 17px;
        font-weight: 700;
        color: var(--ink);
    }

    .mobile-cart-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .btn-mobile-log {
        appearance: none;
        cursor: pointer;
        border: var(--border-w) solid var(--ink);
        background-color: var(--bg-paper);
        color: var(--ink);
        padding: 10px 10px;
        font-size: 12px;
        font-weight: 700;
    }

    .btn-mobile-checkout {
        appearance: none;
        cursor: pointer;
        border: var(--border-w) solid var(--ink);
        box-shadow: 2px 2px 0px var(--ink);
        background-color: var(--emerald);
        color: var(--surface);
        padding: 10px 14px;
        font-size: 13.5px;
        font-weight: 700;
        white-space: nowrap;
    }

    /* Proof Panel docks cleanly above Mobile Bar when expanded */
    .proof-panel {
        left: 12px;
        right: 12px;
        bottom: 72px;
        width: auto;
        max-width: none;
    }

    .proof-panel.is-collapsed {
        display: none;
    }
}

@media (max-width: 767px) {
    .pos-header-inner {
        padding: 10px 14px;
        gap: 10px;
    }

    .brand-title {
        font-size: 16px;
    }

    .brand-sub {
        display: none;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .sandbox-pill {
        font-size: 10.5px;
        padding: 4px 8px;
    }

    .header-btn-row {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .header-btn-row .btn-tactile {
        padding: 7px 6px;
        font-size: 12px;
        text-align: center;
    }

    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .metric-card {
        padding: 11px 12px;
    }

    .metric-card-wide {
        grid-column: 1 / -1;
    }

    .metric-value {
        font-size: 20px;
    }

    .metric-value-text {
        font-size: 16.5px;
    }

    .guide-banner {
        padding: 9px 11px;
        gap: 6px;
    }

    .guide-text {
        font-size: 12.5px;
        gap: 5px;
    }

    .catalog-search-wrap {
        max-width: none;
        width: 100%;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .product-card {
        padding: 12px;
        gap: 8px;
    }
}

/* Print Styles — Exact 1-Page Clean Thermal Receipt (No Blank Pages) */
@media print {
    @page {
        margin: 8mm;
    }

    html,
    body {
        background: #FFFFFF !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    .pos-header,
    .summary-strip,
    .guide-banner,
    .pos-alert,
    .catalog-section,
    .mobile-cart-bar,
    .proof-panel,
    .modal-overlay,
    .receipt-backdrop,
    .receipt-drawer-bar,
    .receipt-serrated,
    .paid-actions,
    .checkout-actions {
        display: none !important;
    }

    .pos-shell,
    .pos-split {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .receipt-column {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        max-height: none !important;
        width: 100% !important;
        border: none !important;
        background: transparent !important;
        display: block !important;
    }

    .receipt-paper-wrap {
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
    }

    #receiptPaper {
        position: static !important;
        width: 80mm;
        max-width: 100%;
        margin: 0 auto;
        padding: 4mm;
        border: 1px dashed #141414 !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
