/* ============ Noto POS — theme ============ */
:root {
    --brand: #da251c;
    --brand-600: #bd1d15;
    --brand-50: #fdecea;
    --ink: #1f1a17;          /* logo background */
    --ink-2: #2b2522;
    --ink-3: #3a3330;
    --bg: #f2efec;
    --surface: #ffffff;
    --surface-2: #f8f6f4;
    --line: #e7e2de;
    --line-strong: #d6cfc9;
    --text: #1f1a17;
    --muted: #7b716b;
    --ok: #16884a;
    --ok-50: #e7f6ee;
    --warn: #b86e00;
    --warn-50: #fff4e0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(31, 26, 23, .06), 0 4px 16px rgba(31, 26, 23, .06);
    --shadow-lg: 0 24px 64px rgba(31, 26, 23, .35);
    --right-w: clamp(360px, 31vw, 460px);
}

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

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

.icon { width: 20px; height: 20px; flex: none; }

kbd {
    font: 600 11px/1 "Inter", sans-serif;
    padding: 3px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .22);
    letter-spacing: .02em;
}

.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }

/* ============ Buttons ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 18px;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 600; white-space: nowrap;
    transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; }
.btn-lg { height: 52px; padding: 0 22px; font-size: 16px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--ink-3); }
.btn-danger { background: var(--brand); color: #fff; }
.btn-ghost { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: #efebe7; }
.btn-ghost kbd { background: #fff; border-color: var(--line-strong); color: var(--muted); }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: transparent; border: 1px solid transparent; color: var(--muted);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn--danger:hover:not(:disabled) { background: var(--brand-50); color: var(--brand); }

.chip-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 12px;
    border-radius: 999px; border: 1px solid var(--line-strong);
    background: var(--surface); font-weight: 600; font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.chip-btn .icon { width: 16px; height: 16px; color: var(--muted); }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ============ Shell ============ */
.pos {
    height: 100vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.pos-header {
    display: flex; align-items: center; gap: 24px;
    height: 68px; padding: 0 20px;
    background: var(--ink); color: #fff;
    border-bottom: 3px solid var(--brand);
}
.pos-logo { height: 46px; width: auto; display: block; }

.pos-header__meta { display: flex; gap: 8px; flex: 1; min-width: 0; }
.hchip {
    display: inline-flex; align-items: center; gap: 7px;
    height: 32px; padding: 0 12px; border-radius: 999px;
    background: var(--ink-2); border: 1px solid var(--ink-3);
    font-size: 13px; font-weight: 500; color: #e9e3df; white-space: nowrap;
}
.hchip .icon { width: 16px; height: 16px; opacity: .8; }
.hchip--ok { color: #b9f0cf; }
.hchip--warn { color: #ffd68a; }
.dot {
    width: 8px; height: 8px; border-radius: 50%; background: #2fd47a;
    box-shadow: 0 0 0 0 rgba(47, 212, 122, .6);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    70% { box-shadow: 0 0 0 7px rgba(47, 212, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 212, 122, 0); }
}

.pos-header__right { display: flex; align-items: center; gap: 14px; }
.logout-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 14px; border-radius: 999px;
    background: var(--ink-2); border: 1px solid var(--ink-3);
    font-size: 13px; font-weight: 600; color: #e9e3df;
}
.logout-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.logout-btn .icon { width: 16px; height: 16px; }
.pos-user { display: flex; align-items: center; gap: 10px; }
.pos-user strong, .pos-clock strong { display: block; font-size: 14px; }
.pos-user small, .pos-clock small { display: block; font-size: 12px; color: #a99f99; }
.avatar {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand); font-weight: 700; font-size: 13px;
}
.pos-clock { text-align: right; padding-left: 22px; border-left: 1px solid var(--ink-3); }
.pos-clock strong { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pos-clock small::first-letter { text-transform: uppercase; }

.pos-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--right-w);
    gap: 16px; padding: 16px;
    min-height: 0;
}

.pos-left { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.pos-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

/* ============ Scan bar ============ */
.scan-bar {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 8px 16px;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color .15s, box-shadow .15s;
}
.scan-bar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(218, 37, 28, .12), var(--shadow); }
.scan-bar__icon { width: 28px; height: 28px; color: var(--brand); }
.scan-bar__input {
    flex: 1; min-width: 0; height: 48px;
    border: 0; outline: 0; background: transparent;
    font-size: 20px; font-weight: 600; letter-spacing: .02em;
}
.scan-bar__input::placeholder { color: #b2a9a3; font-weight: 500; font-size: 17px; letter-spacing: 0; }
.scan-bar.is-error { border-color: var(--brand); background: var(--brand-50); animation: shake .35s; }
@keyframes shake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 12px;
}

/* ============ SKU search ============ */
.sku-search {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px 8px 16px;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color .15s, box-shadow .15s;
}
.sku-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(31, 26, 23, .1), var(--shadow); }
.sku-search__icon { width: 24px; height: 24px; color: var(--ink-3); }
.sku-search__input {
    flex: 1; min-width: 0; height: 48px;
    border: 0; outline: 0; background: transparent;
    font-size: 18px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.sku-search__input::placeholder { color: #b2a9a3; font-weight: 500; font-size: 16px; letter-spacing: 0; text-transform: none; }
.sku-search__kbd { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }

.sku-results {
    position: absolute; z-index: 20; right: -2px; top: calc(100% + 8px);
    width: max(100%, 560px);
    padding: 6px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: 0 18px 48px rgba(31, 26, 23, .22);
    animation: pop .15s ease-out;
}
.sku-results ul { margin: 0; padding: 0; list-style: none; max-height: 52vh; overflow-y: auto; }
.sku-results li {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 8px 8px 10px; border-radius: 10px; cursor: pointer;
}
.sku-results li.is-active { background: #fff3f2; box-shadow: inset 3px 0 0 var(--brand); }
.sku-results__text { flex: 1; min-width: 0; }
.sku-results__text strong { display: block; font-size: 15px; letter-spacing: .02em; }
.sku-results__text small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sku-results__price { text-align: right; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sku-results__price small { display: block; font-size: 11px; font-weight: 700; color: var(--ok); }
.sku-results__price small.is-low { color: var(--warn); }
.sku-results__empty { padding: 18px; text-align: center; color: var(--muted); font-weight: 600; }
.sku-results__hint {
    display: flex; align-items: center; justify-content: flex-end; gap: 4px;
    padding: 8px 8px 2px; border-top: 1px solid var(--line); margin-top: 4px;
    font-size: 12px; color: var(--muted);
}
.sku-results__hint kbd { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }

/* ============ Cart ============ */
.cart {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cart-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 110px 132px 72px 130px 40px;
    align-items: center; gap: 12px;
    padding: 10px 14px 10px 16px;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.cart-row--head {
    padding-top: 12px; padding-bottom: 12px;
    background: var(--surface-2);
    font-size: 12px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em;
}
.cart-body { flex: 1; overflow-y: auto; min-height: 0; }
.cart-body .cart-row { cursor: pointer; transition: background .2s; }
.cart-body .cart-row:hover { background: #fbfaf9; }
.cart-row.is-selected { background: #fff7f6; }
.cart-row.is-selected::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand);
}
.cart-row.is-flash { animation: flash .9s ease-out; }
@keyframes flash { from { background: #ffe1dd; } }

.idx { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item__text { min-width: 0; }
.item__text strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__text small { display: flex; align-items: center; gap: 8px; margin-top: 2px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.thumb {
    display: grid; place-items: center; flex: none;
    width: 42px; height: 42px; border-radius: 10px;
    background: linear-gradient(145deg, #f6f1ed, #ebe4de);
    color: var(--ink-3);
}
.thumb--sm { width: 34px; height: 34px; }
.thumb--sm .icon { width: 18px; height: 18px; }
.thumb--lg { width: 64px; height: 64px; border-radius: 14px; }
.thumb--lg .icon { width: 34px; height: 34px; }

.stepper {
    display: inline-flex; align-items: center; justify-self: center;
    border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden;
    background: var(--surface);
}
.stepper button {
    display: grid; place-items: center;
    width: 38px; height: 38px; border: 0; background: var(--surface-2);
}
.stepper button:hover { background: #ece7e3; }
.stepper button .icon { width: 16px; height: 16px; }
.stepper span { min-width: 42px; text-align: center; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

.discount { color: var(--ok); font-weight: 700; }
.line-total { font-weight: 800; font-size: 16px; }
.line-total s { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }

.badge { padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.badge--warn { background: var(--warn-50); color: var(--warn); }

.empty {
    height: 100%; min-height: 260px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 24px; text-align: center;
}
.empty__icon {
    display: grid; place-items: center;
    width: 96px; height: 96px; border-radius: 28px;
    background: var(--brand-50); color: var(--brand);
    margin-bottom: 6px;
}
.empty__icon .icon { width: 52px; height: 52px; }
.empty h3 { font-size: 20px; }
.empty p { color: var(--muted); max-width: 420px; }
.empty__demo {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
    margin-top: 14px; max-width: 640px;
}
.empty__demo > span { width: 100%; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.cart-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px 10px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}
.cart-foot__count { color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.cart-foot__count strong { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 8px; }
.action {
    display: inline-flex; align-items: center; gap: 8px;
    height: 42px; padding: 0 14px;
    border-radius: 10px; border: 1px solid var(--line-strong);
    background: var(--surface); font-weight: 600; font-size: 14px;
}
.action .icon { width: 18px; height: 18px; color: var(--muted); }
.action kbd { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.action:hover:not(:disabled) { border-color: var(--ink-3); }
.action:disabled { opacity: .45; }
.action--danger { color: var(--brand); border-color: #f2c3bf; }
.action--danger .icon { color: var(--brand); }
.action--danger:hover:not(:disabled) { background: var(--brand-50); border-color: var(--brand); }

/* ============ Right column ============ */
.last-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 94px;
}
.last-item .thumb--lg { background: var(--brand-50); color: var(--brand); }
.last-item.is-empty .thumb--lg { background: var(--surface-2); color: #b2a9a3; }
.last-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.eyebrow { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.last-item__name { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.last-item__meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.stock { padding: 2px 7px; border-radius: 6px; background: var(--ok-50); color: var(--ok); font-weight: 700; }
.stock.is-low { background: var(--warn-50); color: var(--warn); }
.last-item__price { font-size: 20px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

.totals {
    flex: 1; min-height: 150px;
    display: flex; flex-direction: column;
    padding: 16px 18px;
    background: var(--ink); color: #e9e3df;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.totals__row {
    display: flex; justify-content: space-between;
    padding: 3px 0; font-size: 14px; color: #b8aea8;
    font-variant-numeric: tabular-nums;
}
.totals__row span:last-child { color: #f3eeea; font-weight: 600; }
.totals__grand {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: auto; padding-top: 12px;
    border-top: 1px dashed var(--ink-3);
}
.totals__grand span { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.totals__grand strong { color: #fff; font-size: clamp(34px, 3.2vw, 54px); font-weight: 800; text-align: right; white-space: nowrap; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }

.discount-card {
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.discount-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.discount-card__head .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.discount-card__head kbd { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.discount-card__target { font-size: 14px; min-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.discount-card__row { display: flex; gap: 10px; }
.discount-card__row .btn { flex: none; }

.seg {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.seg button {
    height: 30px; padding: 0 12px; border: 0; border-radius: 7px;
    background: transparent; font-size: 13px; font-weight: 700; color: var(--muted);
}
.seg button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(31, 26, 23, .14); }

.pct-field {
    flex: 1; min-width: 0;
    display: flex; align-items: center;
    padding: 0 14px;
    border: 2px solid var(--line-strong); border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}
.pct-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(218, 37, 28, .12); }
.pct-field.is-error { border-color: var(--brand); background: var(--brand-50); animation: shake .35s; }
.pct-field input {
    flex: 1; min-width: 0; height: 48px;
    border: 0; outline: 0; background: transparent;
    font-size: 24px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums;
}
.pct-field input:disabled { opacity: .5; }
.pct-field span { margin-left: 6px; font-size: 22px; font-weight: 800; color: var(--muted); }

.pay-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    height: 74px; border-radius: var(--radius); border: 0;
    color: #fff; font-size: 20px; font-weight: 800;
    transition: filter .15s, transform .05s;
}
.pay .icon { width: 28px; height: 28px; }
.pay span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.pay small { font-size: 11px; font-weight: 600; opacity: .7; letter-spacing: .06em; }
.pay--cash { background: var(--brand); box-shadow: 0 8px 20px rgba(218, 37, 28, .3); }
.pay--card { background: var(--ink); box-shadow: 0 8px 20px rgba(31, 26, 23, .25); }
.pay:hover:not(:disabled) { filter: brightness(1.08); }
.pay:active:not(:disabled) { transform: translateY(1px); }
.pay:disabled { opacity: .35; box-shadow: none; }

/* ============ Toasts ============ */
.toasts {
    position: fixed; z-index: 60; left: calc((100vw - var(--right-w)) / 2); bottom: 92px; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.toast {
    display: flex; align-items: flex-start; gap: 12px;
    min-width: 340px; max-width: 520px; padding: 12px 16px;
    background: var(--ink); color: #fff;
    border-radius: 12px; border-left: 4px solid #8f8580;
    box-shadow: 0 12px 32px rgba(31, 26, 23, .3);
    animation: toast-in .25s ease-out;
}
.toast strong { display: block; }
.toast span { display: block; font-size: 13px; color: #c9c0ba; margin-top: 2px; }
.toast .icon { margin-top: 1px; }
.toast--error { border-left-color: var(--brand); }
.toast--error .icon { color: #ff6a61; }
.toast--success { border-left-color: #2fd47a; }
.toast--success .icon { color: #2fd47a; }
.toast--warn { border-left-color: #ffb020; }
.toast--warn .icon { color: #ffb020; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ============ Modals ============ */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center; padding: 20px;
    background: rgba(20, 16, 14, .55);
    backdrop-filter: blur(3px);
    animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
    width: 100%; max-height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    animation: pop .2s ease-out;
    overflow: hidden;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal--payment { max-width: 560px; }
.modal--receipt { max-width: 600px; }
.modal--receipt .modal__foot { flex-wrap: wrap; }
.fiscal-status { width: 100%; padding: 10px 20px 0; font-size: 14px; text-align: right; background: var(--surface-2); border-top: 1px solid var(--line); }
.fiscal-status--ok { color: #15803d; }
.fiscal-status--error { color: #b91c1c; }
.fiscal-status + .modal__foot { border-top: 0; }
.modal--confirm { max-width: 420px; align-items: center; text-align: center; padding-top: 28px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px 24px; }
.modal__head h2 { font-size: 20px; }
.modal__foot {
    display: flex; justify-content: flex-end; gap: 10px; width: 100%;
    padding: 16px 20px; margin-top: auto;
    border-top: 1px solid var(--line); background: var(--surface-2);
}

.pay-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    margin: 10px 24px 0; padding: 5px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.pay-tab {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; border: 0; border-radius: 9px; background: transparent;
    font-weight: 700; color: var(--muted);
}
.pay-tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(31, 26, 23, .12); }
.pay-tab.is-active .icon { color: var(--brand); }

.pay-due {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    margin: 18px 24px 4px; padding: 16px;
    border-radius: 14px; background: var(--ink); color: #b8aea8;
}
.pay-due span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.pay-due strong { color: #fff; font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.field { display: block; margin: 16px 24px 0; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field__control {
    display: flex; align-items: center;
    border: 2px solid var(--line-strong); border-radius: 12px; padding: 0 16px;
}
.field__control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(218, 37, 28, .12); }
.field__control input {
    flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: transparent;
    font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.field__suffix { font-size: 22px; font-weight: 700; color: var(--muted); }

.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 24px 0; }

.change {
    display: flex; align-items: center; justify-content: space-between;
    margin: 16px 24px 20px; padding: 14px 18px; border-radius: 12px;
    font-weight: 700;
}
.change strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.change.is-ok { background: var(--ok-50); color: var(--ok); }
.change.is-short { background: var(--brand-50); color: var(--brand); }

.terminal {
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    margin: 16px 24px 20px; padding: 26px 20px;
    border: 2px dashed var(--line-strong); border-radius: 14px;
}
.terminal__icon {
    display: grid; place-items: center;
    width: 76px; height: 76px; border-radius: 50%;
    background: var(--surface-2); color: var(--ink);
    margin-bottom: 6px;
}
.terminal__icon .icon { width: 40px; height: 40px; }
.terminal small { color: var(--muted); }
.terminal.processing .terminal__icon { background: var(--brand-50); color: var(--brand); animation: ring 1.1s infinite; }
.terminal.approved { border-color: var(--ok); background: var(--ok-50); }
.terminal.approved .terminal__icon { background: var(--ok); color: #fff; }
@keyframes ring {
    0% { box-shadow: 0 0 0 0 rgba(218, 37, 28, .35); }
    100% { box-shadow: 0 0 0 18px rgba(218, 37, 28, 0); }
}

.spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success { display: flex; align-items: center; gap: 16px; padding: 22px 24px 16px; }
.success__badge {
    display: grid; place-items: center; flex: none;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--ok); color: #fff;
    animation: pop .3s ease-out;
}
.success__badge .icon { width: 28px; height: 28px; }
.success h2 { font-size: 20px; }
.success p { color: var(--muted); margin-top: 2px; }
.success p strong { color: var(--ok); }

.receipt-scroll { overflow-y: auto; padding: 4px 24px 20px; background: var(--bg); border-top: 1px solid var(--line); }
.receipt {
    width: 320px; margin: 16px auto 0; padding: 18px 18px 22px;
    background: #fff; color: #222;
    font: 13px/1.45 "Consolas", "Courier New", monospace;
    box-shadow: 0 2px 10px rgba(31, 26, 23, .12);
    --notch: radial-gradient(circle at 6px 0, transparent 5px, #fff 5.5px);
    position: relative;
}
.receipt::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
    background: var(--notch); background-size: 12px 10px;
}
.receipt__logo { display: block; width: 150px; margin: 0 auto 10px; border-radius: 6px; }
.receipt__center { text-align: center; }
.receipt__row { display: flex; justify-content: space-between; gap: 10px; }
.receipt__muted { color: #777; font-size: 12px; }
.receipt__item { margin-bottom: 6px; }
.receipt__total { font-size: 16px; font-weight: 700; margin: 2px 0; }
.receipt__thanks { margin-top: 12px; font-weight: 700; }
.receipt hr { border: 0; border-top: 1px dashed #bbb; margin: 10px 0; }

.confirm__icon {
    display: grid; place-items: center;
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--brand-50); color: var(--brand);
    margin-bottom: 14px;
}
.confirm__icon .icon { width: 32px; height: 32px; }
.modal--confirm h2 { font-size: 20px; }
.modal--confirm p { color: var(--muted); margin: 6px 24px 22px; }

/* ============ Stock source picker ============ */
.source-list { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 0 24px 20px; }
.source-option {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px;
    background: var(--surface); color: var(--text); font-size: 15px; text-align: left; cursor: pointer;
}
.source-option:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-50); }
.source-option:disabled { opacity: .45; cursor: not-allowed; }
.source-option small { display: block; color: var(--muted); font-size: 12px; }
.source-option__qty { font-weight: 700; white-space: nowrap; }

/* ============ PIN login ============ */
.pin-dots { display: flex; gap: 14px; margin-bottom: 8px; }
.pin-dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--line-strong); background: transparent;
    transition: background .12s ease, border-color .12s ease;
}
.pin-dot.is-filled { background: var(--brand); border-color: var(--brand); }
.pin-dots.is-error .pin-dot { border-color: var(--brand); }
.pin-error { color: var(--brand); font-weight: 700; margin: 0 0 12px; }

.pin-pad {
    display: grid; grid-template-columns: repeat(3, 64px); gap: 10px;
    margin: 4px 24px 24px;
}
.pin-key {
    height: 64px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--line);
    font-size: 22px; font-weight: 700; color: var(--text);
    display: grid; place-items: center;
}
.pin-key:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pin-key:disabled { opacity: .4; }
.pin-key--ghost { background: transparent; border-color: transparent; }
.pin-key--ghost .icon { width: 22px; height: 22px; color: var(--muted); }

/* ============ Smaller screens ============ */
@media (max-width: 1440px) {
    .pos-header__meta .hchip:first-child { display: none; }
    .cart-row { grid-template-columns: 28px minmax(0, 1fr) 96px 124px 60px 116px 38px; gap: 8px; }
    .sku-search__kbd, .scan-bar .btn kbd { display: none; }
    .discount-card__row .btn kbd { display: none; }
}
@media (max-height: 760px) {
    .pay { height: 62px; }
    .last-item { min-height: 0; padding: 10px; }
    .thumb--lg { width: 52px; height: 52px; }
}

/* ============ Print: only the receipt ============ */
@media print {
    @page { size: 80mm auto; margin: 0; }
    html, body { overflow: visible; background: #fff; }
    body * { visibility: hidden; }
    .receipt, .receipt * { visibility: visible; }
    .receipt { position: absolute; left: 0; top: 0; width: 80mm; margin: 0; box-shadow: none; }
    .receipt::after { display: none; }
}

/* ============ Blazor framework UI ============ */
#blazor-error-ui {
    display: none;
    position: fixed; bottom: 0; left: 0; z-index: 1000; width: 100%;
    padding: .6rem 1.25rem .7rem;
    background: #fff4c4; color: var(--text);
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { padding: 1rem; background: #b32121; color: #fff; }
.blazor-error-boundary::after { content: "Възникна грешка."; }
