:root {
    --pos-bg: #eef2f7;
    --pos-surface: #ffffff;
    --pos-ink: #152033;
    --pos-muted: #64748b;
    --pos-line: #d7dee8;
    --pos-top: #1e293b;
    --pos-accent: #2563eb;
    --pos-sale: #16a34a;
    --pos-danger: #dc2626;
    --pos-ok: #22c55e;
    --pos-stock: #15803d;
    --pos-radius: 12px;
    --pos-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body.pos-app {
    --ios-spring: cubic-bezier(0.32, 0.72, 0, 1);
    --pos-topbar-h: 56px;
    --pos-mode-nav-h: 48px;
    --pos-footer-h: 36px;
    --pos-checkout-w: 300px;
    margin: 0;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(1200px 500px at 10% -10%, #dbeafe 0%, transparent 55%),
        radial-gradient(900px 400px at 90% 0%, #e2e8f0 0%, transparent 50%),
        var(--pos-bg);
    color: var(--pos-ink);
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

.pos-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #243447 0%, var(--pos-top) 100%);
    color: #f8fafc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.pos-topbar__brand,
.pos-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pos-topbar__actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.pos-topbar__shift {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.pos-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pos-brand-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

.pos-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #334155;
}

.pos-pill--ok {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border: 1px solid rgba(134, 239, 172, 0.35);
}

.pos-shift-meta,
.pos-clock,
.pos-user {
    font-size: 0.9rem;
    color: #e2e8f0;
}

.pos-warehouse {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.pos-warehouse select {
    margin: 0;
    min-width: 150px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #f8fafc;
}

.pos-icon-btn,
.pos-btn,
.pos-link-btn {
    border: none;
    cursor: pointer;
    font: inherit;
}

.pos-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #334155;
    color: #f8fafc;
    text-decoration: none;
}

.pos-icon-btn:hover {
    background: #475569;
}

.pos-btn {
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
}

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

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

.pos-btn--sale {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #22c55e 0%, var(--pos-sale) 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}

.pos-btn--sale-card {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.pos-payment-block {
    margin: 10px 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--pos-line, #d7dee8);
}

.pos-payment-block__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.pos-payment-block__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.pos-payment-block__hint {
    font-size: 0.68rem;
    color: var(--pos-muted, #64748b);
    text-align: right;
}

.pos-payment-tabs {
    width: 100%;
}

.pos-payment-tabs .pos-segmented__btn {
    font-size: 0.92rem;
    padding: 10px 8px;
}

.pos-payment-tabs.is-cash .pos-segmented__thumb {
    background: #dcfce7;
}

.pos-payment-tabs.is-card .pos-segmented__thumb {
    background: #dbeafe;
}

.pos-payment-flash {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #166534;
}

.pos-payment-flash.is-card {
    color: #1d4ed8;
}

.pos-payment-flash.is-flash {
    animation: posPaymentFlash 0.8s ease;
}

@keyframes posPaymentFlash {
    0% { opacity: 0.2; transform: translateY(2px); }
    35% { opacity: 1; transform: translateY(0); }
    100% { opacity: 1; }
}

.pos-receipt-card__pay {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
}

.pos-receipt-card__pay.is-card {
    background: #dbeafe;
    color: #1d4ed8;
}

.pos-context-menu {
    position: fixed;
    z-index: 1400;
    min-width: 196px;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 12px 32px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.pos-context-menu__item {
    display: block;
    width: 100%;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #111827;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    padding: 9px 12px;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.pos-context-menu__item:hover:not(:disabled),
.pos-context-menu__item:focus-visible:not(:disabled) {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    outline: none;
}

.pos-context-menu__item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pos-context-menu__item[data-action="cancel-receipt"]:not(:disabled) {
    color: #b91c1c;
}

.pos-context-menu__item[data-action="cancel-receipt"]:hover:not(:disabled),
.pos-context-menu__item[data-action="cancel-receipt"]:focus-visible:not(:disabled) {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.pos-receipt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-receipt-card {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    overflow: hidden;
}

.pos-receipt-card.is-cancelled {
    opacity: 0.58;
}

.pos-receipt-card__head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    cursor: context-menu;
    list-style: none;
    padding: 12px 14px;
}

.pos-receipt-card__head::-webkit-details-marker {
    display: none;
}

.pos-receipt-card__time {
    font-size: 0.98rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.pos-receipt-card__id {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(60, 60, 67, 0.65);
    white-space: nowrap;
}

.pos-receipt-card__seller {
    font-size: 0.8rem;
    color: rgba(60, 60, 67, 0.72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-receipt-card__total {
    font-size: 0.98rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    white-space: nowrap;
}

.pos-receipt-card__total small {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(60, 60, 67, 0.6);
}

.pos-receipt-card.is-cancelled .pos-receipt-card__total {
    text-decoration: line-through;
}

.pos-receipt-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 12px 10px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.pos-receipt-card__action {
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.75);
    color: #1f2937;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.pos-receipt-card__action:hover {
    background: #fff;
    border-color: rgba(59, 130, 246, 0.5);
    color: #1d4ed8;
}

.pos-receipt-card__action.is-danger {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.35);
}

.pos-receipt-card__action.is-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.55);
    color: #991b1b;
}

.pos-receipt-card__meta {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
}

.pos-receipt-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #e2e8f0;
    color: #475569;
}

.pos-receipt-card__badge.is-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.pos-receipt-card__body {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    padding: 4px 0 6px;
}

.pos-receipt-line {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 14px;
    font-size: 0.82rem;
}

.pos-receipt-line:nth-child(odd) {
    background: rgba(15, 23, 42, 0.035);
}

.pos-receipt-line__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-receipt-line__article {
    color: rgba(60, 60, 67, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-receipt-line__qty {
    color: rgba(60, 60, 67, 0.72);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pos-receipt-line__sum {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pos-sale-row {
    cursor: context-menu;
}

.pos-cancel-dialog__label {
    display: block;
    margin-top: 12px;
    font-size: 0.88rem;
    font-weight: 500;
}

.pos-cancel-dialog__label input {
    display: block;
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--pos-line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}

.pos-btn--ghost {
    background: #e2e8f0;
    color: #1e293b;
}

.pos-btn--danger {
    background: #fee2e2;
    color: var(--pos-danger);
}

.pos-link-btn {
    background: transparent;
    color: var(--pos-accent);
    padding: 0;
}

.pos-toast {
    margin: 8px 16px 0;
    flex-shrink: 0;
}

.pos-mode-nav {
    display: flex;
    justify-content: center;
    padding: 10px 16px 0;
    flex-shrink: 0;
}

.pos-mode-nav__tabs {
    width: min(420px, 100%);
}

.pos-view:not(.is-active) {
    display: none;
}

.pos-view--sale.is-active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.pos-view--history.is-active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.pos-history-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.pos-history-page__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: var(--pos-surface);
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius);
    box-shadow: var(--pos-shadow);
    flex-shrink: 0;
}

.pos-history-page__head .pos-history-toolbar {
    flex: 1 1 320px;
}

.pos-history-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pos-history-search {
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font: inherit;
    font-size: 0.88rem;
    min-width: 180px;
    flex: 1 1 160px;
    max-width: 320px;
}

.pos-history-search:focus {
    outline: 2px solid #93c5fd;
    border-color: #60a5fa;
    background: #fff;
}

.pos-history-page__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

.pos-history-page__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.pos-history-page__analytics {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.pos-history-section--feed {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--pos-surface);
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius);
    box-shadow: var(--pos-shadow);
}

.pos-history-section--feed .pos-sales-feed {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.pos-history-page .pos-sales-today__reload {
    align-self: flex-start;
    flex-shrink: 0;
}

.pos-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    padding: 12px 16px;
    padding-right: calc(var(--pos-checkout-w) + 28px);
    min-height: 0;
    flex: 1 1 auto;
    align-items: stretch;
    overflow: hidden;
}

.pos-sidebar,
.pos-center,
.pos-cart-panel {
    background: var(--pos-surface);
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius);
    box-shadow: var(--pos-shadow);
    min-height: 0;
}

.pos-sidebar {
    padding: 12px;
    overflow: auto;
    max-height: calc(100vh - 140px);
}

.pos-panel-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pos-muted);
    margin-bottom: 10px;
}

.pos-categories {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pos-cat {
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--pos-ink);
    cursor: pointer;
}

.pos-cat.is-active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    font-weight: 600;
}

.pos-cat:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pos-center {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    min-height: 0;
    height: 100%;
    align-self: stretch;
}

.pos-main-cart {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 120px;
    min-width: 0;
    overflow: hidden;
}

.pos-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 28px;
}

.pos-cart-head h2 {
    margin: 0;
    font-size: 0.92rem;
}

.pos-center .pos-cart-list {
    flex: 1 1 auto;
    min-height: 100px;
    max-height: none;
    overflow-y: auto;
    border: 1px solid var(--pos-line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 4px;
}

.pos-cart-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 auto;
    min-height: 100px;
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.pos-cart-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 4px 6px;
    align-items: center;
    border-radius: 8px;
    background: #fff;
    transform-origin: center top;
    will-change: transform, opacity;
}

.pos-cart-item .pos-thumb,
.pos-cart-item .pos-thumb--photo img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.62rem;
}

.pos-cart-item__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pos-cart-item__title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.pos-cart-item .pos-sku {
    flex-shrink: 0;
    font-size: 0.68rem;
    line-height: 1.15;
}

.pos-cart-item .pos-name {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.pos-cart-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    min-width: 0;
}

.pos-cart-item .pos-cart-item__price {
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: nowrap;
}

.pos-cart-item__actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pos-cart-item__sum {
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    color: var(--pos-ink);
    white-space: nowrap;
    min-width: 3.8rem;
    text-align: right;
}

input.pos-cart-item__sum {
    border: 1px solid var(--pos-line);
    border-radius: 6px;
    padding: 2px 4px;
    background: transparent;
    font: inherit;
    font-weight: 600;
    width: 4.6rem;
}

.pos-cart-item .pos-qty {
    gap: 3px;
}

.pos-cart-item .pos-qty-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 7px;
    font-size: 1rem;
}

.pos-cart-item .pos-qty__input {
    width: 44px;
    min-width: 40px;
    max-width: 56px;
    padding: 2px 2px;
    font-size: 0.82rem;
    border-radius: 6px;
}

.pos-cart-item .pos-remove {
    font-size: 1rem;
    padding: 0 2px;
    margin-left: 0;
}

.pos-cart-item__stocks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0;
}

.pos-cart-item .pos-cart-stock {
    padding: 1px 6px;
    font-size: 0.64rem;
}

.pos-cart-item__price.is-discounted .pos-discount-badge,
.pos-cart-item__price.is-changed .pos-markup-badge {
    font-size: 0.68rem;
    margin-left: 2px;
}

.pos-cart-item__price.is-discounted .pos-discount-badge {
    color: #b45309;
}

.pos-cart-item__price.is-changed .pos-markup-badge {
    color: #047857;
}

.pos-cart-item__price.is-discounted s {
    opacity: 0.65;
}

.pos-cart-item.pos-cart-item--enter {
    animation: pos-cart-enter 0.52s var(--ios-spring) both;
}

.pos-cart-item.pos-cart-item--qty-bump {
    animation: pos-cart-row-bump 0.42s var(--ios-spring) both;
}

.pos-cart-item__sum {
    transition: transform 0.32s var(--ios-spring), color 0.32s var(--ios-spring);
}

.pos-cart-item--qty-bump .pos-cart-item__sum {
    animation: pos-line-sum-bump 0.42s var(--ios-spring) both;
}

input.pos-cart-item__sum:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.pos-cart-empty {
    color: var(--pos-muted);
    text-align: center;
    padding: 16px 8px;
    border: 1px dashed var(--pos-line);
    border-radius: 10px;
    font-size: 0.85rem;
}

.pos-center .pos-cart-empty {
    background: #fff;
}

.pos-cart-head__meta {
    margin-left: auto;
    margin-right: 8px;
    font-size: 0.78rem;
    color: var(--pos-muted);
    font-variant-numeric: tabular-nums;
}

.pos-checkout-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    justify-content: flex-end;
    padding: 8px 4px 12px;
    border-bottom: 1px solid var(--pos-line);
}

#posPanelCashier {
    overflow: hidden;
    padding-right: 2px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-end;
}

#posPanelCashier .pos-cart-actions {
    flex-shrink: 0;
}

#posPanelCashier .pos-cart-total {
    font-size: 1.45rem;
    line-height: 1.2;
}

.pos-search-block {
    position: relative;
    flex-shrink: 0;
    z-index: 30;
}

.pos-search {
    display: block;
    flex-shrink: 0;
}

.pos-search input {
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    background: #f8fafc;
}

.pos-search input:focus {
    outline: 2px solid #93c5fd;
    border-color: #60a5fa;
    background: #fff;
}

.pos-search-hint {
    margin: 6px 0 0;
    font-size: 0.82rem;
}

.pos-search-choices {
    border: 1px solid var(--pos-line);
    border-radius: 12px;
    background: #f8fafc;
    padding: 8px;
    max-height: 220px;
    overflow: auto;
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 132px);
    align-self: start;
}

.pos-choice {
    width: 100%;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    background: #fff;
    border: 1px solid var(--pos-line);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
}

.pos-choice:hover,
.pos-choice.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
}

.pos-choice.is-active {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.pos-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.pos-section-head h2 {
    margin: 0;
    font-size: 0.95rem;
}

.pos-section-head--tabs {
    margin-top: 4px;
}

.pos-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pos-tab {
    border: 1px solid var(--pos-line);
    background: #f8fafc;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--pos-muted);
}

.pos-tab.is-active {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}

.pos-recent {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
}

.pos-center .pos-quick {
    flex-shrink: 0;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.pos-center .pos-quick:not(.hidden) {
    display: flex;
}

.pos-center .pos-quick.hidden {
    display: none;
}

.pos-quick-panel {
    flex-shrink: 0;
    border-top: 1px solid var(--pos-line);
    margin-top: 4px;
    padding-top: 4px;
    min-height: 0;
}

.pos-quick-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--pos-line);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--pos-ink);
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
}

.pos-quick-toggle:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.pos-quick-toggle.is-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: #eff6ff;
}

.pos-quick-toggle__label {
    flex: 1 1 auto;
    text-align: left;
}

.pos-quick-toggle__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
}

.pos-quick-toggle__chevron {
    transition: transform 0.2s ease;
    color: #64748b;
}

.pos-quick-toggle.is-open .pos-quick-toggle__chevron {
    transform: rotate(180deg);
}

.pos-quick-toggle.is-open + .pos-quick {
    border: 1px solid var(--pos-line);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 8px;
    background: #fff;
}

.pos-quick-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pos-quick-toolbar__hint {
    margin: 0;
    flex: 1 1 220px;
    font-size: 0.72rem;
    line-height: 1.3;
}

.pos-quick-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pos-quick-scan input {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #93c5fd;
    background: #eff6ff;
    font: inherit;
    font-size: 0.92rem;
}

.pos-quick-scan input:focus {
    outline: 2px solid #60a5fa;
    border-color: #3b82f6;
    background: #fff;
}

.pos-center .pos-quick-grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
    max-height: min(38vh, 340px);
    padding: 2px;
}

.pos-quick-empty {
    grid-column: 1 / -1;
    padding: 16px 8px;
    text-align: center;
    color: var(--pos-muted);
    font-size: 0.82rem;
}

.pos-recent-card,
.pos-product,
.pos-cart-item,
.pos-quick-item,
.pos-choice {
    border: 1px solid var(--pos-line);
    border-radius: 12px;
    background: #fff;
    color: var(--pos-ink);
}

.pos-recent-card {
    padding: 8px;
    cursor: pointer;
    min-height: 92px;
}

.pos-recent-card:hover,
.pos-product:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.pos-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #e2e8f0, #f8fafc);
    color: #475569;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.pos-sku {
    font-size: 0.75rem;
    color: var(--pos-muted);
}

.pos-name {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--pos-ink);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pos-catalog {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.pos-product {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    color: var(--pos-ink);
}

.pos-product-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pos-product-side {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.pos-stock {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: var(--pos-stock);
    font-size: 0.78rem;
    font-weight: 700;
}

.pos-stock.is-low {
    background: #ffedd5;
    color: #c2410c;
}

.pos-stock.is-zero {
    background: #fee2e2;
    color: #b91c1c;
}

.pos-price {
    font-size: 1rem;
    font-weight: 700;
}

.pos-load-more {
    align-self: center;
    flex-shrink: 0;
}

.pos-cart-panel,
.pos-checkout-dock {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.pos-checkout-dock {
    position: fixed;
    right: 12px;
    bottom: calc(var(--pos-footer-h) + 8px);
    width: var(--pos-checkout-w);
    max-height: calc(100vh - var(--pos-topbar-h) - var(--pos-mode-nav-h) - var(--pos-footer-h) - 20px);
    z-index: 45;
    background: var(--pos-surface);
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius);
    box-shadow: var(--pos-shadow);
    overflow-y: auto;
}

.pos-qty__value--bump {
    animation: pos-qty-pop 0.38s var(--ios-spring) both;
}

.pos-cart-item__sum {
    transition: transform 0.32s var(--ios-spring), color 0.32s var(--ios-spring);
}

.pos-cart-item--qty-bump .pos-cart-item__sum {
    animation: pos-line-sum-bump 0.42s var(--ios-spring) both;
}

.pos-cart-total.is-total-bump strong,
.pos-cart-total.is-total-bump #cartTotal {
    display: inline-block;
    transform-origin: center center;
    animation: pos-total-bump 0.48s var(--ios-spring) both;
}

@keyframes pos-cart-enter {
    0% {
        opacity: 0;
        transform: translateY(-14px) scale(0.94);
    }
    55% {
        opacity: 1;
        transform: translateY(2px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pos-cart-row-bump {
    0% {
        background: #fff;
        transform: scale(1);
    }
    35% {
        background: rgba(0, 122, 255, 0.1);
        transform: scale(1.01);
    }
    100% {
        background: #fff;
        transform: scale(1);
    }
}

@keyframes pos-qty-pop {
    0% {
        transform: scale(1);
        color: var(--pos-ink);
    }
    40% {
        transform: scale(1.28);
        color: #007aff;
    }
    100% {
        transform: scale(1);
        color: var(--pos-ink);
    }
}

@keyframes pos-line-sum-bump {
    0% {
        transform: scale(1);
        color: var(--pos-ink);
    }
    40% {
        transform: scale(1.08);
        color: #16a34a;
    }
    100% {
        transform: scale(1);
        color: var(--pos-ink);
    }
}

@keyframes pos-total-bump {
    0% {
        transform: scale(1);
        color: var(--pos-ink);
    }
    38% {
        transform: scale(1.08);
        color: #16a34a;
    }
    100% {
        transform: scale(1);
        color: var(--pos-ink);
    }
}

.pos-qty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pos-app button.pos-qty-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.pos-app button.pos-qty-btn:hover {
    background: #eff6ff;
    border-color: #60a5fa;
    color: #1d4ed8;
}

.pos-app button.pos-qty-btn:active {
    transform: scale(0.96);
}

.pos-qty__value {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    color: var(--pos-ink);
}

.pos-qty__input {
    width: 56px;
    min-width: 48px;
    max-width: 72px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 5px 4px;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    background: #fff;
    color: var(--pos-ink);
    -moz-appearance: textfield;
}

.pos-qty__input::-webkit-outer-spin-button,
.pos-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-qty__input:focus {
    outline: 2px solid #93c5fd;
    border-color: #60a5fa;
}

.pos-qty__input--bump {
    animation: pos-qty-pop 0.38s var(--ios-spring) both;
}

.pos-cart-item__stocks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pos-cart-stock {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pos-cart-stock--active {
    background: #dcfce7;
    color: #15803d;
}

.pos-cart-stock--active.is-low {
    background: #ffedd5;
    color: #c2410c;
}

.pos-cart-stock--active.is-zero {
    background: #fee2e2;
    color: #b91c1c;
}

.pos-cart-stock--other {
    background: #e0e7ff;
    color: #3730a3;
}

.pos-cart-stock--other.is-low {
    background: #ffedd5;
    color: #9a3412;
}

.pos-cart-stock--other.is-zero {
    background: #f1f5f9;
    color: #94a3b8;
}

.pos-remove {
    border: none;
    background: transparent;
    color: var(--pos-danger);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 2px 4px;
    margin-left: 2px;
}

.pos-cart-summary {
    border-top: 1px solid var(--pos-line);
    padding-top: 10px;
    flex-shrink: 0;
}

.pos-cart-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--pos-muted);
}

.pos-cart-total {
    margin-top: 6px;
    font-size: 1.25rem;
}

.pos-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.pos-cart-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pos-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 8px;
}

.pos-quick-tile {
    position: relative;
    aspect-ratio: 1;
    padding: 6px;
    text-align: left;
    cursor: pointer;
    border: 1px solid var(--pos-line);
    border-radius: 12px;
    background: #fff;
    color: var(--pos-ink);
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.pos-quick-tile:hover {
    border-color: #86efac;
    background: #f0fdf4;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.12);
}

.pos-quick-tile__media {
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-quick-tile__media .pos-thumb,
.pos-quick-tile__media .pos-thumb--photo {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.pos-quick-tile__media .pos-thumb--photo img,
.pos-quick-tile__media .pos-thumb {
    width: 100%;
    height: 100%;
    min-height: 72px;
    object-fit: cover;
    font-size: 1rem;
}

.pos-quick-tile__price {
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #15803d;
    line-height: 1.1;
}

.pos-quick-tile__name {
    font-size: 0.68rem;
    line-height: 1.15;
    color: #334155;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
}

.pos-quick-tile__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
}

.pos-quick-tile__remove:hover {
    background: #dc2626;
}

.pos-quick-item {
    padding: 10px;
    text-align: left;
    cursor: pointer;
    min-height: 56px;
}

.pos-quick-item:hover {
    border-color: #86efac;
    background: #f0fdf4;
}

.pos-quick-add {
    border-style: dashed;
    color: var(--pos-muted);
}

.pos-sales-today {
    --ios-spring: cubic-bezier(0.32, 0.72, 0, 1);
    margin-top: 10px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.42) 48%, rgba(255, 255, 255, 0.28) 100%);
    backdrop-filter: blur(28px) saturate(185%);
    -webkit-backdrop-filter: blur(28px) saturate(185%);
    box-shadow:
        0 10px 34px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        inset 0 -1px 0 rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.pos-sales-today__summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.28s var(--ios-spring);
}

.pos-sales-today__summary::-webkit-details-marker {
    display: none;
}

.pos-sales-today__summary:hover {
    background: rgba(255, 255, 255, 0.22);
}

.pos-sales-today__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pos-sales-today__label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1c2430;
}

.pos-sales-today__chevron {
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(60, 60, 67, 0.72);
    border-bottom: 2px solid rgba(60, 60, 67, 0.72);
    transform: rotate(-45deg);
    transform-origin: 50% 45%;
    transition: transform 0.48s var(--ios-spring);
}

.pos-sales-today[open] .pos-sales-today__chevron {
    transform: rotate(45deg);
}

.pos-sales-today__stats {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    color: #1c2430;
}

.pos-sales-today__stats strong {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.pos-sales-today__currency {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(60, 60, 67, 0.72);
}

.pos-sales-today__count {
    font-size: 0.82rem;
    color: rgba(60, 60, 67, 0.62);
}

.pos-sales-today__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.52s var(--ios-spring);
}

.pos-sales-today[open] .pos-sales-today__body {
    grid-template-rows: 1fr;
}

.pos-sales-today__inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 12px 12px;
    opacity: 0;
    transform: translateY(-6px);
    transition:
        opacity 0.38s var(--ios-spring),
        transform 0.52s var(--ios-spring);
}

.pos-sales-today[open] .pos-sales-today__inner {
    opacity: 1;
    transform: translateY(0);
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 140px;
    max-height: min(380px, 46vh);
}

.pos-segmented {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 2px;
    margin-bottom: 0;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(118, 118, 128, 0.14);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pos-segmented__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition:
        transform 0.48s var(--ios-spring),
        width 0.48s var(--ios-spring);
    pointer-events: none;
    z-index: 0;
}

.pos-segmented__btn {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    border: none;
    background: transparent;
    color: rgba(60, 60, 67, 0.72);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 6px 6px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.28s var(--ios-spring);
    -webkit-tap-highlight-color: transparent;
}

.pos-segmented__btn.is-active {
    color: #111827;
}

.pos-segmented__btn:active {
    transform: scale(0.98);
}

.pos-sales-feed {
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding-right: 0;
}

.pos-sales-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pos-sales-list__head,
.pos-sale-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(56px, 0.7fr) minmax(52px, 0.55fr);
    gap: 8px;
    align-items: center;
}

.pos-sales-list__head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 4px 8px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(60, 60, 67, 0.55);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pos-sales-list__head span:last-child,
.pos-sale-row__sum {
    text-align: right;
}

.pos-sale-row {
    padding: 7px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    animation: pos-sale-enter 0.42s var(--ios-spring) both;
}

.pos-sale-row__name {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-sale-row__article {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(60, 60, 67, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-sale-row__sum {
    font-size: 0.76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #111827;
}

.pos-sale-row.is-cancelled {
    opacity: 0.55;
}

.pos-sale-row.is-cancelled .pos-sale-row__sum {
    text-decoration: line-through;
}

.pos-app .pos-sale-card {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    overflow: hidden;
    animation: pos-sale-enter 0.52s var(--ios-spring) both;
}

.pos-app .pos-sale-card summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1f2937;
    transition: background-color 0.24s var(--ios-spring);
}

.pos-app .pos-sale-card summary::-webkit-details-marker {
    display: none;
}

.pos-app .pos-sale-card summary:hover {
    background: rgba(255, 255, 255, 0.35);
}

.pos-app .pos-sale-card[open] summary {
    border-bottom: 1px solid rgba(120, 120, 128, 0.16);
}

.pos-app .pos-sale-card .sale-items {
    margin: 0;
    padding: 8px 12px 10px;
}

.pos-app .pos-sale-card .sale-item-row {
    padding: 6px 0;
    border-bottom: none;
    font-size: 0.78rem;
    color: rgba(60, 60, 67, 0.88);
}

.pos-app .pos-sale-card .sale-item-row + .sale-item-row {
    border-top: 1px solid rgba(120, 120, 128, 0.12);
}

.pos-app .pos-sale-card .pos-btn {
    margin-bottom: 6px;
    width: 100%;
    border-radius: 12px;
    background: rgba(118, 118, 128, 0.12);
    font-size: 0.78rem;
}

.pos-sales-today__reload {
    width: 100%;
    margin-top: 0;
    flex-shrink: 0;
    border: none;
    border-radius: 14px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #007aff;
    background: rgba(0, 122, 255, 0.1);
    cursor: pointer;
    transition:
        background-color 0.24s var(--ios-spring),
        transform 0.24s var(--ios-spring);
    -webkit-tap-highlight-color: transparent;
}

.pos-sales-today__reload:hover {
    background: rgba(0, 122, 255, 0.16);
}

.pos-sales-today__reload:active {
    transform: scale(0.985);
}

.pos-sales-feed .pos-muted {
    text-align: center;
    padding: 18px 8px;
    font-size: 0.82rem;
}

@keyframes pos-sale-enter {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pos-sales-today__body,
    .pos-sales-today__inner,
    .pos-sales-today__chevron,
    .pos-segmented__thumb,
    .pos-segmented__btn,
    .pos-app .pos-sale-card,
    .pos-cart-item.pos-cart-item--enter,
    .pos-cart-item.pos-cart-item--qty-bump,
    .pos-qty__value--bump,
    .pos-cart-item--qty-bump .pos-cart-item__sum,
    .pos-cart-total.is-total-bump strong,
    .pos-cart-total.is-total-bump #cartTotal {
        transition: none;
        animation: none;
    }
}

.pos-footer {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 16px;
    background: #0f172a;
    color: #cbd5e1;
    font-size: 0.82rem;
    flex-shrink: 0;
    z-index: 40;
}

.pos-footer a {
    color: #93c5fd;
    text-decoration: none;
}

.pos-muted {
    color: var(--pos-muted);
}

.pos-dialog--receipt-settings form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: min(420px, calc(100vw - 2rem));
}

.pos-dialog--receipt-settings label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.pos-dialog--receipt-settings select {
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--pos-border, #d8dee9);
}

.pos-dialog {
    border: 1px solid var(--pos-line);
    border-radius: 14px;
    padding: 16px;
    width: min(480px, 92vw);
    box-shadow: var(--pos-shadow);
}

.pos-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.pos-dialog textarea {
    width: 100%;
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid var(--pos-line);
    padding: 10px;
    font: inherit;
}

.pos-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.pos-post-sale-toast {
    position: fixed;
    right: calc(var(--pos-checkout-w) + 28px);
    bottom: calc(var(--pos-footer-h) + 12px);
    z-index: 1200;
    width: min(420px, calc(100vw - 32px));
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    background: var(--pos-surface, #fff);
    border: 1px solid var(--pos-line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateX(calc(100% + 24px));
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.pos-post-sale-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.pos-post-sale-toast.is-hiding {
    opacity: 0;
    transform: translateX(calc(100% + 24px));
    pointer-events: none;
}

.pos-post-sale-toast__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--pos-line);
    font-size: 0.95rem;
}

.pos-post-sale-toast__close {
    border: none;
    background: transparent;
    color: var(--pos-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.pos-post-sale-toast__footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px 12px;
    border-top: 1px solid var(--pos-line);
}

.pos-btn--sm {
    padding: 6px 12px;
    font-size: 0.88rem;
}

.pos-discount-dialog {
    width: min(420px, 92vw);
}

.pos-discount-dialog__label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.92rem;
}

.pos-discount-dialog__label select,
.pos-discount-dialog__label input {
    border: 1px solid var(--pos-line);
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
}

.pos-discount-dialog__mode {
    margin-top: 12px;
}

.pos-post-sale-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding: 10px 12px;
    flex: 1;
    min-height: 0;
}

.pos-post-sale-card {
    border: 1px solid var(--pos-line);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--pos-surface, #fff);
}

.pos-post-sale-card.is-alert {
    border-color: #f59e0b;
    background: #fffbeb;
}

.pos-post-sale-card__head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.pos-post-sale-card__title {
    font-weight: 600;
    line-height: 1.3;
}

.pos-post-sale-card__article {
    color: var(--pos-muted);
    font-size: 0.85rem;
}

.pos-post-sale-stocks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 8px;
    font-size: 0.92rem;
}

.pos-post-sale-stocks span.is-zero {
    color: #dc2626;
    font-weight: 600;
}

.pos-post-sale-stocks span.is-low {
    color: #d97706;
    font-weight: 600;
}

.pos-post-sale-meta {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--pos-muted);
}

.pos-post-sale-reason {
    margin-top: 6px;
    font-size: 0.88rem;
    color: #b45309;
}

.pos-post-sale-card__actions {
    margin-top: 8px;
}

@media (max-width: 1400px), (max-height: 820px) {
    body.pos-app {
        --pos-topbar-h: 44px;
        --pos-mode-nav-h: 42px;
        --pos-checkout-w: 280px;
    }

    .pos-topbar {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        padding: 6px 12px;
    }

    .pos-topbar__brand {
        flex: 0 1 auto;
        min-width: 0;
        gap: 8px;
    }

    .pos-brand-title {
        font-size: 0.92rem;
        white-space: nowrap;
    }

    .pos-brand-sub {
        display: none;
    }

    .pos-topbar__shift {
        flex: 0 0 auto;
        gap: 6px;
        justify-content: center;
    }

    .pos-pill {
        font-size: 0.68rem;
        padding: 2px 8px;
    }

    .pos-shift-meta {
        display: none;
    }

    .pos-clock {
        font-size: 0.82rem;
    }

    .pos-topbar__actions {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        min-width: 0;
        gap: 4px;
        overflow: hidden;
    }

    .pos-warehouse {
        gap: 4px;
    }

    .pos-warehouse > span:first-child {
        display: none;
    }

    .pos-warehouse select {
        min-width: 108px;
        max-width: 120px;
        padding: 4px 6px;
        font-size: 0.76rem;
    }

    .pos-user {
        display: none;
    }

    .pos-icon-btn {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .pos-topbar__actions .pos-btn--ghost {
        padding: 6px 10px;
        font-size: 0.78rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .pos-mode-nav {
        padding: 6px 12px 0;
    }

    .pos-search input {
        padding: 11px 12px;
        font-size: 0.95rem;
    }

    .pos-search-hint {
        font-size: 0.76rem;
    }
}

@media (max-width: 1200px) {
    .pos-shell {
        padding-right: calc(var(--pos-checkout-w) + 20px);
    }

    .pos-recent,
    .pos-center .pos-quick-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* История: на планшете — одна колонка, аналитика под лентой. */
    .pos-history-page__body {
        grid-template-columns: minmax(0, 1fr);
        overflow-y: auto;
    }

    .pos-history-page__analytics {
        flex-direction: row;
        flex-wrap: wrap;
        overflow: visible;
    }

    .pos-history-page__analytics .pos-history-section {
        flex: 1 1 260px;
    }

    .pos-history-search {
        max-width: none;
        order: 5;
        flex-basis: 100%;
    }
}

@media (max-width: 960px) {
    /* Компактная шапка чека на узком экране: время и итог крупно, остальное короче. */
    .pos-receipt-card__head {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        gap: 8px;
        padding: 10px 12px;
    }

    .pos-receipt-card__id,
    .pos-receipt-card__seller {
        display: none;
    }

    .pos-receipt-line {
        grid-template-columns: minmax(0, 1.5fr) auto auto;
        padding: 8px 12px;
    }

    .pos-receipt-line__article {
        display: none;
    }

    .pos-receipt-card__actions {
        justify-content: stretch;
    }

    .pos-receipt-card__action {
        flex: 1 1 0;
    }

    .pos-history-page__body {
        overflow: visible;
    }
    body.pos-app {
        --pos-checkout-w: 100%;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .pos-view--sale.is-active,
    .pos-view--history.is-active {
        overflow: visible;
    }

    .pos-shell {
        overflow: visible;
    }

    .pos-topbar {
        flex-wrap: wrap;
    }

    .pos-topbar__actions {
        flex-wrap: wrap;
    }

    .pos-shell {
        grid-template-columns: 1fr;
        padding-right: 16px;
    }

    .pos-checkout-dock {
        position: static;
        width: auto;
        max-height: none;
        right: auto;
        bottom: auto;
        z-index: auto;
    }

    .pos-post-sale-toast {
        right: 16px;
        bottom: 72px;
    }

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

    .pos-center,
    .pos-cart-panel {
        max-height: none;
        height: auto;
        position: static;
    }

    .pos-center {
        overflow: visible;
        max-height: none;
    }

    .pos-main-cart {
        min-height: 160px;
    }

    .pos-center .pos-cart-list {
        max-height: min(320px, 38vh);
        flex: none;
    }

    .pos-recent,
    .pos-center .pos-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-search-choices {
        max-height: min(420px, 60vh);
    }

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

    .pos-checkout-summary {
        justify-content: flex-start;
        padding-top: 0;
    }

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

    .pos-history-page {
        max-height: none;
    }

    .pos-history-page__analytics {
        max-height: none;
    }
}

.pos-thumb--photo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.pos-thumb--photo img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #f3f4f6;
}

.pos-cart-item .pos-thumb--photo img {
    width: 32px;
    height: 32px;
}

.pos-choice .pos-thumb--photo img {
    width: 44px;
    height: 44px;
}

.pos-product .pos-thumb--photo img {
    width: 56px;
    height: 56px;
}

.pos-product-preview {
    position: fixed;
    z-index: 1500;
    width: min(360px, calc(100vw - 360px));
    max-height: min(80vh, 640px);
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
    pointer-events: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-product-preview.hidden {
    display: none;
}

.pos-product-preview__media {
    position: relative;
    flex-shrink: 0;
    min-height: 160px;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-product-preview img {
    display: block;
    width: 100%;
    max-height: min(360px, 48vh);
    object-fit: contain;
}

.pos-product-preview img.hidden {
    display: none;
}

.pos-product-preview__fallback {
    color: #64748b;
    font-size: 0.82rem;
    padding: 24px 12px;
    text-align: center;
}

.pos-product-preview__caption {
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.25;
}

.pos-product-preview__attrs {
    margin: 0;
    padding: 0 2px 0 0;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(240px, 34vh);
    overflow-y: auto;
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 4px 10px;
    font-size: 0.72rem;
}

.pos-product-preview__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

.pos-product-preview__link:hover {
    background: #dbeafe;
}

.pos-product-preview__attrs dt {
    margin: 0;
    color: #64748b;
    font-weight: 600;
}

.pos-product-preview__attrs dd {
    margin: 0;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.pos-product-preview__more {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    font-size: 0.68rem;
    color: #64748b;
}

.pos-thumb--photo {
    cursor: zoom-in;
}

.admin-product-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
}

.admin-product-row--inactive {
    opacity: 0.72;
    background: #fff7ed;
}

.admin-product-row--inactive td:nth-child(9) {
    color: #c2410c;
    font-weight: 600;
}

.pos-archive-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #c2410c;
    background: #ffedd5;
    vertical-align: middle;
}
