:root {
    --ink: #15211d;
    --muted: #6d7772;
    --line: #dfe4dc;
    --paper: #ffffff;
    --canvas: #f3f5ef;
    --green: #1e5b43;
    --green-dark: #123d2f;
    --lime: #dff34a;
    --danger: #a53c32;
    --shadow: 0 18px 55px rgba(19, 42, 32, .12);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(30, 91, 67, .28); outline-offset: 2px; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: -.6px; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--green-dark); background: var(--lime); font-weight: 900; transform: skew(-5deg); }
.brand--light { color: #fff; }
.eyebrow { margin: 0 0 9px; color: #768079; font-size: 11px; font-weight: 800; letter-spacing: 1.8px; }
.button { border: 0; border-radius: 12px; font-weight: 750; transition: transform .15s ease, background .15s ease, opacity .15s ease; }
.button:not(:disabled):active { transform: scale(.985); }
.button:disabled { cursor: not-allowed; opacity: .4; }
.button--primary { color: white; background: var(--green); }
.button--primary:not(:disabled):hover { background: var(--green-dark); }
.button--large { display: flex; width: 100%; min-height: 55px; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 16px; }
.button--ghost { min-height: 48px; color: var(--danger); background: transparent; }
.button--ghost:not(:disabled):hover { background: #fff3f0; }

/* Авторизация */
.login-page { background: var(--green-dark); }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.1fr); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(36px, 5vw, 72px); color: #fff; background: radial-gradient(circle at 20% 86%, rgba(223, 243, 74, .15), transparent 27%), linear-gradient(145deg, #143f31, #0c251d); }
.login-intro .eyebrow { color: var(--lime); }
.login-intro h1 { max-width: 630px; margin: 0 0 26px; font-size: clamp(45px, 5.2vw, 76px); line-height: .99; letter-spacing: -4px; }
.intro-copy { max-width: 470px; color: #b8c8c0; font-size: 18px; line-height: 1.6; }
.login-footnote { color: #718e82; font-size: 13px; }
.login-panel { display: grid; place-items: center; padding: 32px; background: #f2f4ee; }
.login-card { width: min(450px, 100%); padding: 45px; border: 1px solid #e6eae3; border-radius: 24px; background: white; box-shadow: var(--shadow); }
.login-card__head { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 35px; padding: 7px 11px; border-radius: 99px; color: var(--green); background: #edf6ee; font-size: 12px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #43a65d; box-shadow: 0 0 0 4px rgba(67, 166, 93, .13); }
.login-card h2 { margin: 0 0 8px; font-size: 32px; letter-spacing: -1.2px; }
.login-card > p { margin: 0 0 28px; color: var(--muted); }
.alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; color: #8b2e27; background: #fff0ed; font-size: 14px; }
.login-form { display: grid; gap: 20px; }
.login-form label > span:first-child, .split-fields label > span:first-child { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.login-form select, .login-form input { width: 100%; height: 52px; padding: 0 14px; border: 1px solid #d9dfd7; border-radius: 11px; color: var(--ink); background: #fafbf8; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 95px; }
.password-toggle { position: absolute; top: 50%; right: 12px; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 750; transform: translateY(-50%); }

/* Касса */
.pos-page { overflow: hidden; background: var(--canvas); }
.topbar { display: flex; height: 70px; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); }
.topbar__right, .cashier { display: flex; align-items: center; }
.topbar__right { gap: 24px; }
.cashier { gap: 10px; }
.cashier__avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; color: var(--green); background: #e9f0e9; font-weight: 800; }
.cashier small, .cashier strong { display: block; }
.cashier small { margin-bottom: 2px; color: var(--muted); font-size: 10px; }
.cashier strong { font-size: 13px; }
.logout-link { color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.logout-link:hover { color: var(--danger); }
.pos-layout { display: grid; height: calc(100vh - 70px); grid-template-columns: minmax(0, 1fr) 410px; }
.catalog { overflow-y: auto; padding: 30px clamp(24px, 3vw, 48px) 60px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading h1 { margin: 0; font-size: 38px; letter-spacing: -1.6px; }
.search-box { display: flex; width: min(290px, 40%); height: 45px; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.search-box span { color: var(--muted); font-size: 21px; transform: rotate(-18deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.category-tabs { display: flex; gap: 8px; margin: 25px 0 30px; overflow-x: auto; scrollbar-width: none; }
.category-tab { flex: 0 0 auto; min-height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 99px; color: #5b6761; background: #fff; font-size: 13px; font-weight: 700; }
.category-tab.is-active { border-color: var(--green); color: #fff; background: var(--green); }
.product-group + .product-group { margin-top: 0; }
.product-group:not([hidden]) ~ .product-group:not([hidden]) { margin-top: 34px; }
.product-group__title { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.product-group__title h2 { margin: 0; font-size: 18px; letter-spacing: -.35px; }
.product-group__title span { padding: 3px 8px; border-radius: 99px; color: var(--muted); background: #e6eae3; font-size: 10px; font-weight: 800; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(135px, 1fr)); gap: 12px; }
.product-card { display: flex; min-height: 160px; flex-direction: column; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: #fff; text-align: left; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.product-card:hover { border-color: #b9c7bc; box-shadow: 0 9px 24px rgba(20, 45, 34, .08); transform: translateY(-2px); }
.product-card.is-added { animation: productAdded .28s ease; }
.product-card__name { flex: 1; line-height: 1.3; font-size: 14px; font-weight: 720; }
.product-card__bottom { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 11px; }
.product-card__bottom strong { font-size: 15px; }
.add-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: #fff; background: var(--green); font-size: 18px; font-weight: 400; }
.empty-search { padding: 50px 0; color: var(--muted); text-align: center; }

.receipt-panel { display: flex; min-width: 0; flex-direction: column; border-left: 1px solid var(--line); background: var(--paper); box-shadow: -16px 0 45px rgba(24, 43, 34, .035); }
.receipt-heading { display: flex; align-items: flex-end; justify-content: space-between; padding: 28px 26px 22px; border-bottom: 1px solid var(--line); }
.receipt-heading h2 { margin: 0; font-size: 28px; letter-spacing: -.8px; }
.receipt-count { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.receipt-heading__meta { display: flex; align-items: center; gap: 9px; }
.receipt-toggle { display: none; }
.receipt-void {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    border: 0;
    border-radius: 11px;
    color: #d34b5f;
    background: #fff0f2;
    font-size: 22px;
    font-weight: 800;
    transition: transform .15s ease, background .15s ease;
}
.receipt-void:hover { background: #ffe1e6; transform: rotate(-12deg); }
.receipt-backdrop { display: none; }
.receipt-items { flex: 1; overflow-y: auto; padding: 8px 26px; }
.empty-receipt { display: flex; height: 100%; min-height: 300px; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); text-align: center; }
.empty-receipt__icon { display: grid; width: 52px; height: 52px; place-items: center; margin-bottom: 17px; border: 1px dashed #bfc8c1; border-radius: 50%; color: #91a096; font-size: 27px; }
.empty-receipt strong { color: #526059; }
.empty-receipt p { margin: 8px 0; font-size: 13px; line-height: 1.5; }
.receipt-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 18px 23px 18px 0; border-bottom: 1px solid #edf0eb; }
.receipt-item__info strong, .receipt-item__info span { display: block; }
.receipt-item__info strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.receipt-item__info span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.quantity-control { display: flex; height: 29px; align-items: center; gap: 10px; }
.quantity-control button { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--green); background: #f7f8f5; font-size: 17px; }
.quantity-control span { min-width: 16px; font-size: 13px; font-weight: 800; text-align: center; }
.receipt-item__sum { align-self: end; font-size: 14px; }
.remove-item { position: absolute; top: 14px; right: 0; border: 0; color: #a8b0ab; background: transparent; font-size: 18px; }
.remove-item:hover { color: var(--danger); }
.receipt-footer { padding: 21px 26px 20px; border-top: 1px solid var(--line); background: #fbfcf9; }
.receipt-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.receipt-total span { color: var(--muted); font-size: 14px; font-weight: 700; }
.receipt-total strong { font-size: 28px; letter-spacing: -1px; }
.receipt-discount { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: rgba(255,255,255,.82); font-size: 12px; }
.receipt-discount b { color: #ffe26c; }
.receipt-discount strong { color: #fff; }
.receipt-discount-button { width: 100%; min-height: 40px; margin-bottom: 8px; color: #fff; background: rgba(255,255,255,.13); }
.receipt-discount-button:not(:disabled):hover { background: rgba(255,255,255,.22); }
.button--pay { display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: space-between; padding: 0 18px; font-size: 15px; }
.receipt-footer .button--ghost { width: 100%; margin-top: 4px; }

/* Модальные окна */
.modal { width: min(470px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 22px; background: transparent; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(7, 22, 16, .62); backdrop-filter: blur(3px); }
.modal__body { position: relative; margin: 0; padding: 32px; border-radius: 22px; background: #fff; }
.modal__body h2 { margin: 0 0 8px; font-size: 29px; letter-spacing: -1px; }
.modal__close { position: absolute; top: 20px; right: 20px; display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; color: #637069; background: #f0f2ed; font-size: 22px; }
.modal__total { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.modal__total strong { color: var(--ink); font-size: 23px; }
.payment-options { display: grid; gap: 10px; }
.payment-option { display: grid; min-height: 72px; grid-template-columns: 45px 1fr auto; align-items: center; gap: 13px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; text-align: left; }
.payment-option:hover { border-color: var(--green); background: #f5f9f3; }
.payment-option__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: var(--green); background: #e9f1e6; font-weight: 900; }
.payment-option strong, .payment-option small { display: block; }
.payment-option strong { margin-bottom: 4px; font-size: 14px; }
.payment-option small { color: var(--muted); }
.back-button { margin: -5px 0 24px; padding: 0; border: 0; color: var(--green); background: transparent; font-size: 13px; font-weight: 750; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.money-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.money-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 91, 67, .1); }
.money-input input { width: 100%; height: 49px; min-width: 0; padding: 0 10px; border: 0; outline: 0; background: transparent; font-weight: 700; }
.money-input b { padding-right: 12px; color: var(--muted); }
.split-status { min-height: 20px; margin: 15px 0; color: var(--green); font-size: 12px; font-weight: 700; }
.split-status.is-error { color: var(--danger); }
.button--danger { color: #fff; background: #d84c61; }
.button--danger:not(:disabled):hover { background: #bd394e; }
.modal-description { margin: -1px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.modal--sales { width: min(560px, calc(100% - 30px)); }
.sales-list { display: grid; max-height: 440px; gap: 9px; overflow-y: auto; padding-right: 3px; }
.sales-list__loading, .sales-list__empty {
    padding: 38px 15px;
    border-radius: 16px;
    color: var(--muted);
    background: #f7f5fb;
    font-size: 13px;
    text-align: center;
}
.sales-list__empty.is-error { color: var(--danger); background: #fff1f3; }
.closed-sale {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 15px;
    width: 100%;
    padding: 15px 16px;
    border: 0;
    border-radius: 17px;
    color: var(--ink);
    background: #f7f5fb;
    text-align: left;
}
.closed-sale:not(:disabled):hover { background: #eeeafd; }
.closed-sale__main strong, .closed-sale__main small,
.closed-sale__amount strong, .closed-sale__amount small { display: block; }
.closed-sale__main strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.closed-sale__main small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.closed-sale__amount { text-align: right; }
.closed-sale__amount strong { font-size: 15px; }
.closed-sale__amount small { margin-top: 5px; color: #6554c0; font-size: 10px; font-weight: 800; }
.closed-sale.is-cancelled { cursor: default; opacity: .68; }
.closed-sale.is-cancelled .closed-sale__amount small { color: var(--danger); }
.closed-sale__reason { grid-column: 1 / -1; color: #a25864; font-size: 11px; line-height: 1.4; }
.cancel-sale-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.cancel-sale-summary span { padding: 13px 14px; border-radius: 14px; background: #f5f2fb; }
.cancel-sale-summary small, .cancel-sale-summary strong { display: block; }
.cancel-sale-summary small { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.cancel-sale-summary strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.reason-field > span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.reason-field textarea {
    width: 100%;
    padding: 13px 14px;
    resize: vertical;
    border: 1px solid #e4dfed;
    border-radius: 14px;
    outline: 0;
    color: var(--ink);
    background: #faf9fc;
    font: inherit;
    line-height: 1.45;
}
.reason-field textarea:focus { border-color: #8174db; box-shadow: 0 0 0 3px rgba(101, 84, 192, .12); }
.form-error { min-height: 18px; margin: 8px 0 11px; color: var(--danger); font-size: 12px; font-weight: 700; }
.discount-percent-field { display: block; margin-bottom: 14px; }
.discount-percent-field > span:first-child { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.discount-comment-field { display: block; }
.discount-preview { min-height: 18px; margin: 12px 0 0; color: #5d4bbb; font-size: 12px; font-weight: 800; }
.discount-actions { display: grid; grid-template-columns: auto 1fr; gap: 9px; }
.discount-actions .button { min-height: 50px; padding: 0 17px; }
.discount-actions .admin-button-ghost { color: #d14459; background: #fff0f2; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 28px; padding: 13px 18px; border-radius: 11px; color: white; background: var(--green-dark); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .2s ease; }
.toast[data-type="error"] { background: #8d302a; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }
@keyframes productAdded { 50% { border-color: var(--green); transform: scale(.97); } }

@media (max-width: 1100px) {
    .product-grid { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
    .pos-layout { grid-template-columns: minmax(0, 1fr) 365px; }
}

@media (max-width: 820px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { min-height: 310px; padding: 32px; }
    .login-intro h1 { margin-top: 50px; font-size: 48px; letter-spacing: -2.5px; }
    .login-footnote { display: none; }
    .login-panel { padding: 25px 16px 50px; }
    .login-card { margin-top: -35px; padding: 30px 24px; }
    .pos-page { overflow: auto; }
    .topbar { padding: 0 16px; }
    .cashier span:last-child { display: none; }
    .pos-layout { display: block; height: auto; }
    .catalog { overflow: visible; padding: 24px 16px 320px; }
    .product-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .receipt-panel { position: fixed; z-index: 4; right: 0; bottom: 0; left: 0; max-height: 47vh; border-top: 1px solid var(--line); border-left: 0; box-shadow: 0 -15px 40px rgba(19, 42, 32, .13); }
    .receipt-heading { padding: 14px 18px 12px; }
    .receipt-heading .eyebrow { display: none; }
    .receipt-heading h2 { font-size: 20px; }
    .receipt-items { min-height: 0; padding: 0 18px; }
    .empty-receipt { min-height: 75px; flex-direction: row; gap: 12px; }
    .empty-receipt__icon { width: 35px; height: 35px; margin: 0; }
    .empty-receipt p { display: none; }
    .receipt-footer { padding: 13px 18px 10px; }
    .receipt-total { margin-bottom: 10px; }
    .receipt-total strong { font-size: 22px; }
    .receipt-footer .button--ghost { min-height: 35px; }
}

@media (max-width: 520px) {
    .brand { font-size: 19px; }
    .brand-mark { width: 32px; height: 32px; }
    .topbar__right { gap: 12px; }
    .section-heading { display: block; }
    .search-box { width: 100%; margin-top: 17px; }
    .product-card { min-height: 145px; padding: 13px; }
    .split-fields { grid-template-columns: 1fr; }
    .modal__body { padding: 27px 22px; }
}

/* Визуальная тема: playful food app */
:root {
    --ink: #111116;
    --muted: #8b8992;
    --line: #e8e5f0;
    --paper: #ffffff;
    --canvas: #f2f0f8;
    --green: #6554c0;
    --green-dark: #5041ab;
    --lime: #ffc900;
    --purple: #8d82e6;
    --purple-soft: #ddd7fb;
    --coral: #ff6659;
    --danger: #dd4e64;
    --shadow: 0 22px 60px rgba(77, 66, 132, .13);
}

.pos-page {
    background:
        radial-gradient(circle at 8% 21%, rgba(255, 255, 255, .95) 0 7px, transparent 8px),
        radial-gradient(circle at 72% 9%, rgba(255, 102, 89, .72) 0 6px, transparent 7px),
        var(--canvas);
}

.topbar {
    position: relative;
    z-index: 5;
    height: 76px;
    padding: 0 34px;
    border: 0;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 5px 24px rgba(72, 60, 125, .04);
    backdrop-filter: blur(18px);
}

.brand { color: #17161b; font-weight: 900; letter-spacing: -1px; }
.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    color: #151419;
    background: var(--lime);
    box-shadow: 0 8px 20px rgba(255, 201, 0, .24);
}

.cashier__avatar {
    color: #fff;
    background: linear-gradient(145deg, #ffbc22, #ff705a);
    box-shadow: 0 6px 16px rgba(255, 111, 85, .23);
}

.logout-link { color: #77747f; }
.logout-link:hover { color: var(--green); }

.pos-layout {
    height: calc(100vh - 76px);
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 18px;
    padding: 18px;
}

.catalog {
    padding: 0 clamp(6px, 2vw, 30px) 55px;
    scrollbar-gutter: stable;
    scrollbar-color: #c8c1ec transparent;
}

.section-heading {
    position: relative;
    min-height: 148px;
    align-items: center;
    margin-bottom: 22px;
    padding: 25px 30px;
    overflow: hidden;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(125deg, #7e71dc 0%, #988ee9 76%);
    box-shadow: 0 18px 35px rgba(105, 87, 193, .18);
}

.section-heading::after {
    content: '🥤';
    position: absolute;
    top: -15px;
    right: 320px;
    font-size: 122px;
    filter: drop-shadow(0 18px 15px rgba(52, 37, 118, .22));
    transform: rotate(11deg);
}

.section-heading .eyebrow { color: rgba(255, 255, 255, .68); }
.section-heading h1 { position: relative; z-index: 1; color: #fff; font-size: 40px; letter-spacing: -2px; }

.search-box {
    position: relative;
    z-index: 1;
    width: min(300px, 42%);
    height: 50px;
    border: 0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(69, 54, 148, .13);
}

.category-tabs { margin: 0 0 27px; gap: 10px; }
.category-tab {
    min-height: 43px;
    padding: 0 18px;
    border-color: #e2dfea;
    color: #77747f;
    background: rgba(255, 255, 255, .78);
}

.category-tab:hover { border-color: #bdb5e7; }
.category-tab.is-active {
    border-color: var(--lime);
    color: #17161b;
    background: var(--lime);
    box-shadow: 0 8px 18px rgba(255, 201, 0, .2);
}

.product-group__title h2 { font-size: 21px; letter-spacing: -.8px; }
.product-group__title span { color: #706a8e; background: #e5e0f4; }
.product-grid { gap: 15px; }

.product-card {
    position: relative;
    min-height: 132px;
    padding: 17px;
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 11px 30px rgba(76, 62, 139, .085);
}

.product-card:nth-child(4n + 1) { background: linear-gradient(155deg, #fff 50%, #e3f5fb); }
.product-card:nth-child(4n + 2) { background: linear-gradient(155deg, #fff 50%, #fbe0e7); }
.product-card:nth-child(4n + 3) { background: linear-gradient(155deg, #fff 50%, #e6e0fb); }
.product-card:nth-child(4n + 4) { background: linear-gradient(155deg, #fff 50%, #fff0bf); }

.product-card:hover {
    border-color: transparent;
    box-shadow: 0 18px 34px rgba(76, 62, 139, .15);
    transform: translateY(-5px);
}

.product-card__name { position: relative; z-index: 1; font-size: 15px; font-weight: 800; }
.product-card__bottom strong { font-size: 16px; }
.add-icon {
    width: 33px;
    height: 33px;
    border-radius: 11px;
    color: #151419;
    background: var(--lime);
    box-shadow: 0 7px 16px rgba(255, 201, 0, .26);
}

.receipt-panel {
    overflow: hidden;
    border: 0;
    border-radius: 30px;
    background: #fff;
    box-shadow: var(--shadow);
}

.receipt-heading {
    padding: 29px 28px 22px;
    border-bottom-color: #efedf3;
}

.receipt-heading .eyebrow { color: #958ee0; }
.receipt-heading h2 { font-size: 32px; letter-spacing: -1.5px; }
.receipt-count { color: #8f8b96; }
.receipt-items { padding: 9px 26px; }

.empty-receipt__icon {
    width: 62px;
    height: 62px;
    border: 0;
    color: #6a5bc1;
    background: #eeeafe;
    font-size: 30px;
}

.empty-receipt strong { color: #38353e; font-size: 16px; }
.receipt-item {
    margin: 9px 0;
    padding: 16px 28px 16px 15px;
    border: 0;
    border-radius: 17px;
    background: #f8f6fc;
}

.quantity-control button {
    border: 0;
    color: #17161b;
    background: #fff;
    box-shadow: 0 3px 10px rgba(72, 57, 130, .08);
}

.quantity-control button:last-child { background: #e7e1ff; }
.receipt-footer {
    margin: 0 12px 12px;
    padding: 22px 18px 13px;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(125deg, #7768d7, #9287e6);
}

.receipt-total span { color: rgba(255, 255, 255, .72); }
.receipt-total strong { color: #fff; font-size: 30px; }
.button--primary { color: #17161b; background: var(--lime); }
.button--primary:not(:disabled):hover { background: #ffd52e; }
.button--pay { min-height: 58px; border-radius: 16px; box-shadow: 0 12px 22px rgba(76, 54, 0, .14); }
.receipt-footer .button--ghost { color: rgba(255, 255, 255, .82); }
.receipt-footer .button--ghost:not(:disabled):hover { color: #fff; background: rgba(255, 255, 255, .1); }

.modal { border-radius: 30px; box-shadow: 0 28px 80px rgba(40, 30, 85, .25); }
.modal::backdrop { background: rgba(34, 27, 63, .58); backdrop-filter: blur(7px); }
.modal__body { padding: 36px; border-radius: 30px; }
.modal__body h2 { font-size: 32px; }
.modal__close { background: #f0edf8; }
.modal__total { border-color: #ece8f3; }
.modal__total strong { color: #5948b8; }
.payment-option { min-height: 78px; border: 0; border-radius: 18px; background: #f7f5fb; }
.payment-option:hover { border-color: transparent; background: #eeeafd; transform: translateY(-2px); }
.payment-option__icon { color: #17161b; background: var(--lime); }
.money-input { border: 0; border-radius: 15px; background: #f5f3fa; }
.split-status { color: #5d4bbb; }

/* Авторизация в той же теме */
.login-page { background: var(--canvas); }
.login-intro {
    color: #fff;
    background:
        radial-gradient(circle at 79% 20%, rgba(255, 201, 0, .95) 0 8px, transparent 9px),
        radial-gradient(circle at 18% 78%, rgba(255, 112, 93, .9) 0 7px, transparent 8px),
        linear-gradient(145deg, #7567d5, #978de8);
}

.login-intro::after {
    content: '🥤';
    position: absolute;
    right: 8%;
    bottom: 9%;
    font-size: clamp(100px, 15vw, 230px);
    filter: drop-shadow(0 24px 20px rgba(51, 36, 117, .25));
    transform: rotate(12deg);
}

.login-intro { position: relative; overflow: hidden; }
.login-intro > * { position: relative; z-index: 1; }
.login-intro .eyebrow { color: #ffe36d; }
.intro-copy { color: rgba(255, 255, 255, .74); }
.login-footnote { color: rgba(255, 255, 255, .5); }
.login-panel { background: var(--canvas); }
.login-card { border: 0; border-radius: 30px; box-shadow: var(--shadow); }
.login-card__head { color: #5b4ab4; background: #eeeafd; }
.status-dot { background: var(--lime); box-shadow: 0 0 0 4px rgba(255, 201, 0, .18); }
.login-form select, .login-form input { border: 0; border-radius: 14px; background: #f5f3f9; }
.password-toggle { color: #5b4ab4; }

@media (max-width: 1100px) {
    .pos-layout { grid-template-columns: minmax(0, 1fr) 380px; }
    .section-heading::after { right: 280px; font-size: 100px; }
}

@media (max-width: 820px) {
    .topbar { height: 68px; padding: 0 17px; }
    .pos-layout { height: auto; padding: 0; }
    .catalog { padding: 16px 15px 350px; }
    .section-heading { min-height: 164px; padding: 22px; border-radius: 24px; }
    .section-heading::after { top: -18px; right: 15px; font-size: 92px; opacity: .95; }
    .section-heading .search-box { position: absolute; right: 20px; bottom: 18px; left: 20px; width: auto; }
    .section-heading h1 { align-self: flex-start; font-size: 34px; }
    .category-tabs { margin-top: 18px; }
    .receipt-panel { max-height: 48vh; border-radius: 25px 25px 0 0; }
    .receipt-footer { margin: 0; border-radius: 22px 22px 0 0; }
    .receipt-heading { padding: 15px 19px 12px; }
    .receipt-items { padding: 0 18px; }
}

@media (max-width: 520px) {
    .product-grid { gap: 11px; }
    .product-card { min-height: 112px; padding: 14px; border-radius: 19px; }
    .login-intro::after { right: -10px; bottom: -12px; font-size: 125px; opacity: .8; }
}

/* Облегчённый кассовый режим для телефона */
@media (max-width: 820px) {
    .pos-page { background: #f5f3fa; }
    .pos-page.receipt-open { overflow: hidden; }

    .receipt-backdrop {
        position: fixed;
        z-index: 8;
        inset: 0;
        display: block;
        background: rgba(24, 19, 44, .54);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
        backdrop-filter: blur(2px);
    }

    .pos-page.receipt-open .receipt-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .topbar {
        position: sticky;
        top: 0;
        height: 56px;
        padding: 0 14px;
        box-shadow: 0 2px 12px rgba(72, 60, 125, .06);
    }

    .brand { gap: 8px; font-size: 17px; }
    .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
    .cashier__avatar { width: 32px; height: 32px; }
    .logout-link { font-size: 12px; }

    .catalog { padding: 12px 12px 132px; scrollbar-gutter: auto; }

    .section-heading {
        display: block;
        min-height: 0;
        margin: 0;
        padding: 3px 2px 0;
        overflow: visible;
        border-radius: 0;
        color: var(--ink);
        background: transparent;
        box-shadow: none;
    }

    .section-heading::after { display: none; }
    .section-heading .eyebrow { display: none; }
    .section-heading h1 { color: var(--ink); font-size: 27px; letter-spacing: -1.2px; }
    .section-heading .search-box {
        position: static;
        width: 100%;
        height: 44px;
        margin: 10px 0 0;
        border: 1px solid #e4e0ec;
        border-radius: 13px;
        box-shadow: none;
    }

    .category-tabs {
        position: sticky;
        z-index: 3;
        top: 56px;
        margin: 10px -12px 18px;
        padding: 8px 12px;
        gap: 7px;
        background: rgba(245, 243, 250, .94);
        backdrop-filter: blur(12px);
    }

    .category-tab { min-height: 38px; padding: 0 14px; font-size: 12px; }
    .product-group + .product-group { margin-top: 0; }
    .product-group:not([hidden]) ~ .product-group:not([hidden]) { margin-top: 25px; }
    .product-group__title { margin-bottom: 9px; }
    .product-group__title h2 { font-size: 18px; }
    .product-grid { gap: 9px; }

    .product-card {
        min-height: 98px;
        padding: 11px 12px;
        border-radius: 17px;
        box-shadow: 0 6px 18px rgba(76, 62, 139, .07);
    }

    .product-card:hover { transform: none; }
    .product-card__name { font-size: 13px; line-height: 1.2; }
    .product-card__bottom { margin-top: 5px; }
    .product-card__bottom strong { font-size: 14px; }
    .add-icon { width: 30px; height: 30px; border-radius: 10px; }

    .receipt-panel {
        z-index: 9;
        display: flex;
        max-height: none;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 30px rgba(43, 33, 86, .16);
        transition: max-height .22s ease;
    }

    .receipt-heading {
        flex: 0 0 auto;
        min-height: 43px;
        padding: 8px 15px 6px;
        cursor: default;
    }

    .receipt-heading h2 { font-size: 19px; }
    .receipt-heading__meta { gap: 7px; }
    .receipt-count { margin: 0; font-size: 11px; }
    .receipt-void { width: 34px; height: 34px; font-size: 20px; }
    .receipt-toggle {
        display: grid;
        width: 34px;
        height: 34px;
        place-items: center;
        border: 0;
        border-radius: 11px;
        color: #5d4db5;
        background: #eeeafd;
        font-size: 19px;
        font-weight: 800;
    }

    .receipt-panel:not(.is-expanded) .receipt-items { display: none; }
    .receipt-panel:not(.is-expanded) .receipt-footer {
        display: grid;
        grid-template-columns: minmax(68px, auto) auto minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        margin: 0;
        padding: 9px 12px 11px;
        border-radius: 0;
        background: #fff;
    }

    .receipt-panel:not(.is-expanded) .receipt-total {
        display: block;
        margin: 0;
    }

    .receipt-panel:not(.is-expanded) .receipt-total span { color: var(--muted); font-size: 10px; }
    .receipt-panel:not(.is-expanded) .receipt-total strong { display: block; margin-top: 1px; color: var(--ink); font-size: 20px; }
    .receipt-panel:not(.is-expanded) .receipt-discount { display: none; }
    .receipt-panel:not(.is-expanded) .receipt-discount-button { width: auto; min-height: 42px; margin: 0; padding: 0 11px; color: #6554c0; background: #eeeafd; font-size: 11px; }
    .receipt-panel:not(.is-expanded) .button--pay { min-height: 46px; border-radius: 13px; font-size: 13px; }
    .receipt-panel:not(.is-expanded) .button--ghost { display: none; }

    .receipt-panel.is-expanded { max-height: 72vh; }
    .receipt-panel.is-expanded .receipt-items { display: block; min-height: 90px; }
    .receipt-panel.is-expanded .receipt-items { overscroll-behavior: contain; }
    .receipt-panel.is-expanded .receipt-footer {
        flex: 0 0 auto;
        margin: 0;
        padding: 14px 15px 8px;
        border-radius: 20px 20px 0 0;
    }

    .receipt-panel.is-expanded .empty-receipt { min-height: 88px; }
    .receipt-panel.is-expanded .receipt-item { margin: 7px 0; padding: 12px 26px 12px 12px; }
    .receipt-panel.is-expanded .button--pay { min-height: 49px; }
}

@media (max-width: 520px) {
    .modal {
        width: 100%;
        max-width: none;
        max-height: 92vh;
        margin: auto 0 0;
        border-radius: 26px 26px 0 0;
    }

    .modal__body { padding: 27px 20px 22px; border-radius: 26px 26px 0 0; }
    .modal__body h2 { font-size: 27px; }
    .modal__total { margin: 15px 0; padding: 13px 0; }
    .payment-options { gap: 8px; }
    .payment-option { min-height: 64px; border-radius: 15px; }
    .payment-option__icon { width: 38px; height: 38px; }
    .modal--sales { width: 100%; }
    .sales-list { max-height: 58vh; }
    .closed-sale { padding: 13px; }
}
