:root {
  --bg: #f4f7fb;
  --surface: #fff;
  --surface-soft: #f8fafc;
  --border: #dbe3ee;
  --text: #172033;
  --muted: #68778c;
  --primary: #1264e3;
  --primary-dark: #0b4fba;
  --primary-soft: #e9f2ff;
  --success: #15803d;
  --success-soft: #eaf8ee;
  --warning: #b45309;
  --warning-soft: #fff5df;
  --danger: #c62828;
  --purple: #7c3aed;
  --shadow: 0 12px 32px rgba(15, 23, 42, .09);
  --radius: 18px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(18, 100, 227, .24); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; color: #dce8fa; background: linear-gradient(180deg, #0b1425 0%, #101e34 100%); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; color: #fff; }
.brand__mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 21px; font-weight: 900; background: linear-gradient(135deg, #2f80ff, #1264e3); box-shadow: 0 9px 24px rgba(18, 100, 227, .42); }
.brand__text { display: grid; line-height: 1.15; }
.brand__text strong { letter-spacing: -.02em; }
.brand__text small { margin-top: 4px; color: #8fa5c5; font-size: 11px; letter-spacing: .08em; }
.nav-list { display: grid; gap: 6px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 12px; color: #aebed5; background: transparent; cursor: pointer; text-align: left; transition: 150ms ease; }
.nav-item span { width: 22px; text-align: center; font-size: 19px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.is-active { color: #fff; background: linear-gradient(100deg, rgba(18,100,227,.95), rgba(29,116,239,.82)); box-shadow: 0 8px 22px rgba(18,100,227,.25); }
.sidebar__footer { margin-top: auto; }
.sync-card { padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; color: #afc1d9; background: rgba(255,255,255,.045); }
.sync-card__row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: #fff; font-size: 13px; }
.sync-card small { font-size: 11px; }
.status-dot { width: 9px; height: 9px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.status-dot.is-offline { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.16); }

.workspace { min-width: 0; }
.topbar { height: 80px; position: sticky; top: 0; display: flex; align-items: center; gap: 16px; padding: 0 32px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.93); backdrop-filter: blur(12px); z-index: 15; }
.topbar h1 { margin: 2px 0 0; font-size: 22px; letter-spacing: -.03em; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.eyebrow { margin: 0; color: var(--primary); font-weight: 800; font-size: 10px; letter-spacing: .12em; }
.latency-chip, .branch-chip, .mode-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.latency-chip { color: var(--success); background: var(--success-soft); }
.latency-chip.is-slow { color: var(--warning); background: var(--warning-soft); }
.branch-chip { color: #526176; background: #eef2f7; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #1264e3, #7048e8); font-size: 12px; font-weight: 800; }
.avatar.small { width: 35px; height: 35px; }
.menu-button { display: none; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 11px; background: #fff; cursor: pointer; }

main { padding: 28px 32px 48px; }
.view { display: none; animation: viewIn 180ms ease; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: .35; transform: translateY(4px); } }
.view h2 { margin: 4px 0 8px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.045em; }
.view h3 { margin: 3px 0; letter-spacing: -.025em; }

.hero-card { min-height: 190px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 34px 38px; overflow: hidden; position: relative; border-radius: 24px; color: #fff; background: linear-gradient(120deg, #0b4fba, #1264e3 58%, #2f80ff); box-shadow: 0 20px 45px rgba(18,100,227,.23); }
.hero-card::after { content: ""; position: absolute; width: 300px; height: 300px; right: -80px; top: -170px; border: 42px solid rgba(255,255,255,.09); border-radius: 50%; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card h2 { margin: 10px 0; max-width: 620px; font-size: clamp(30px, 4vw, 46px); }
.hero-card p { max-width: 670px; margin: 0; color: #dcecff; line-height: 1.55; }
.hero-card__badge { display: inline-block; padding: 7px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .12em; background: rgba(255,255,255,.12); }
.primary-button, .secondary-button, .checkout-button { border: 0; border-radius: 12px; font-weight: 800; cursor: pointer; }
.primary-button { min-width: 190px; display: flex; justify-content: space-between; gap: 16px; padding: 14px 17px; color: var(--primary); background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.13); }
.secondary-button { padding: 11px 16px; color: var(--primary); border: 1px solid #bed2ef; background: #fff; }
.text-button { padding: 5px; border: 0; color: var(--primary); background: transparent; font-weight: 750; font-size: 12px; cursor: pointer; }
.text-button.danger { color: var(--danger); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.kpi-card { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 19px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 16px rgba(15,23,42,.045); }
.kpi-card__icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; font-weight: 900; }
.kpi-card__icon.blue { color: var(--primary); background: var(--primary-soft); }
.kpi-card__icon.green { color: var(--success); background: var(--success-soft); }
.kpi-card__icon.amber { color: var(--warning); background: var(--warning-soft); }
.kpi-card__icon.purple { color: var(--purple); background: #f1eafe; }
.kpi-card div { min-width: 0; display: grid; }
.kpi-card small, .kpi-card span { color: var(--muted); font-size: 11px; }
.kpi-card strong { margin: 3px 0; font-size: 23px; letter-spacing: -.04em; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr); gap: 18px; margin-top: 18px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 18px rgba(15,23,42,.045); }
.panel__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 21px; border-bottom: 1px solid #e8edf4; }
.architecture-list { margin: 0; padding: 14px 20px 20px; list-style: none; }
.architecture-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf1f6; }
.architecture-list li:last-child { border: 0; }
.architecture-list li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--success); background: var(--success-soft); font-size: 12px; font-weight: 900; }
.architecture-list div { display: grid; }
.architecture-list small { margin-top: 3px; color: var(--muted); }
.activity-list { min-height: 220px; padding: 4px 20px 16px; }
.activity-row, .ledger-row { display: grid; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf1f6; }
.activity-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
.activity-row__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--success); background: var(--success-soft); }
.activity-row div, .ledger-row div { min-width: 0; display: grid; }
.activity-row small, .ledger-row small { color: var(--muted); }
.activity-row > strong { color: var(--success); }
.sale-link { width: max-content; padding: 0; border: 0; color: var(--primary); background: transparent; font-weight: 850; cursor: pointer; text-align: left; }
.sale-link:hover { text-decoration: underline; }
.sale-link:disabled { opacity: .55; cursor: wait; }
.empty-state { display: grid; place-items: center; color: var(--muted); text-align: center; }

.pos-heading, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.pos-context { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.pos-context .eyebrow { padding: 6px 8px; border-radius: 999px; background: var(--primary-soft); }
.pos-context strong { font-size: 14px; }
.section-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.mode-badge { color: var(--success); background: var(--success-soft); }
.mode-badge.is-offline { color: var(--warning); background: var(--warning-soft); }
.pos-layout { min-height: calc(100vh - 170px); display: grid; grid-template-columns: minmax(0, 1fr) 365px; gap: 18px; }
.catalog-panel, .cart-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 20px rgba(15,23,42,.05); }
.catalog-panel { min-width: 0; }
.catalog-toolbar { padding: 16px; border-bottom: 1px solid var(--border); }
.search-box { height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid #cbd6e4; border-radius: 12px; background: var(--surface-soft); }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,100,227,.1); }
.search-box span { color: var(--muted); font-size: 21px; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-box.compact { width: min(360px, 100%); height: 39px; }
.category-tabs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.category-tab { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; color: #59697e; background: #fff; white-space: nowrap; cursor: pointer; font-size: 12px; font-weight: 750; }
.category-tab.is-active { color: var(--primary); border-color: #bcd3f5; background: var(--primary-soft); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 13px; padding: 16px; }
.product-card { min-width: 0; padding: 0; overflow: hidden; text-align: left; border: 1px solid var(--border); border-radius: 15px; background: #fff; cursor: pointer; transition: 150ms ease; }
.product-card:hover { transform: translateY(-2px); border-color: #9fc1f4; box-shadow: 0 10px 22px rgba(15,23,42,.09); }
.product-card:active { transform: scale(.98); }
.product-card__visual { height: 82px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--product-color), color-mix(in srgb, var(--product-color) 66%, #0f172a)); font-size: 32px; }
.product-card__body { display: grid; padding: 12px; }
.product-card__body small { color: var(--muted); font-size: 10px; }
.product-card__body strong { min-height: 39px; margin: 4px 0 8px; font-size: 13px; }
.product-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-card__price { color: var(--primary); font-size: 16px; font-weight: 900; }
.stock-pill, .state-pill { padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.stock-pill { color: var(--success); background: var(--success-soft); }
.stock-pill.low, .state-pill.low { color: var(--warning); background: var(--warning-soft); }
.stock-pill.out, .state-pill.out { color: var(--danger); background: #fdecec; }
.loading-card { grid-column: 1 / -1; min-height: 150px; display: grid; place-items: center; color: var(--muted); }

.cart-panel { position: sticky; top: 98px; height: calc(100vh - 126px); display: flex; flex-direction: column; overflow: hidden; }
.cart-panel__header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cart-panel__header small, .customer-line small { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.customer-line { display: flex; align-items: center; gap: 10px; margin: 13px 16px 0; padding: 10px; border-radius: 12px; background: var(--surface-soft); }
.customer-line div { display: grid; }
.cart-items { min-height: 130px; flex: 1; overflow-y: auto; padding: 10px 16px; }
.cart-empty { height: 100%; min-height: 180px; display: grid; place-items: center; align-content: center; gap: 5px; color: var(--muted); }
.cart-empty > span { color: #a9b6c7; font-size: 38px; }
.cart-empty small { font-size: 11px; }
.cart-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 0; border-bottom: 1px solid #edf1f6; }
.cart-item__info { min-width: 0; display: grid; }
.cart-item__info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.cart-item__info small { margin-top: 3px; color: var(--muted); }
.cart-item__controls { display: flex; align-items: center; gap: 7px; }
.quantity-button { width: 27px; height: 27px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.quantity { min-width: 18px; text-align: center; font-size: 12px; font-weight: 800; }
.cart-summary { padding: 12px 18px; border-top: 1px solid var(--border); }
.cart-summary > div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); font-size: 12px; }
.cart-summary__total { align-items: end; margin-top: 5px; color: var(--text) !important; }
.cart-summary__total strong { color: var(--primary); font-size: 27px; letter-spacing: -.045em; }
.checkout-button { min-height: 52px; display: flex; align-items: center; justify-content: space-between; margin: 0 16px; padding: 0 17px; color: #fff; background: linear-gradient(100deg, #0b4fba, #1264e3); box-shadow: 0 10px 24px rgba(18,100,227,.24); }
.checkout-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.cart-note, .dialog-note { margin: 10px 18px 14px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.45; }

.table-panel { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 17px; border-bottom: 1px solid var(--border); }
.result-count { color: var(--muted); font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-bottom: 1px solid #edf1f6; text-align: left; white-space: nowrap; font-size: 13px; }
th { color: var(--muted); background: #f8fafc; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.product-cell { display: flex; align-items: center; gap: 10px; }
.product-cell__icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--product-color); }
.trace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ledger-list { min-height: 280px; padding: 5px 20px 18px; }
.ledger-row { grid-template-columns: minmax(0, 1fr) auto; }
.ledger-row__amount { text-align: right; }
.ledger-row__amount.negative { color: var(--danger); }
.user-grid, .settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 16px; }
.user-card { display: flex; align-items: center; gap: 14px; padding: 21px; }
.user-card div { display: grid; }
.user-card small, .setting-card small, .setting-card p { color: var(--muted); }
.role-pill { width: max-content; margin-top: 6px; padding: 4px 8px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 800; }
.setting-card { display: flex; align-items: flex-start; gap: 15px; padding: 22px; }
.setting-card__icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 20px; font-weight: 900; }
.setting-card p { margin: 5px 0 0; font-size: 12px; }
.pilot-warning { margin-top: 18px; padding: 17px 20px; border: 1px solid #f3d29b; border-radius: 14px; color: #7c4800; background: #fff9ed; }
.pilot-warning p { margin: 5px 0 0; line-height: 1.55; }

.checkout-dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 90px rgba(15,23,42,.3); }
.checkout-dialog::backdrop { background: rgba(9,18,33,.62); backdrop-filter: blur(4px); }
.checkout-dialog form { padding: 23px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.dialog-header h2 { margin: 4px 0 0; letter-spacing: -.04em; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.field input { height: 44px; padding: 0 12px; border: 1px solid #cbd6e4; border-radius: 11px; color: var(--text); }
.payment-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0; padding: 0; border: 0; }
.payment-options legend { grid-column: 1 / -1; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.payment-options input { position: absolute; opacity: 0; }
.payment-options span { display: grid; place-items: center; min-height: 58px; padding: 8px; border: 1px solid var(--border); border-radius: 11px; text-align: center; font-size: 11px; cursor: pointer; }
.payment-options input:checked + span { color: var(--primary); border-color: #9fc1f4; background: var(--primary-soft); box-shadow: inset 0 0 0 1px #9fc1f4; }
.dialog-total { display: flex; align-items: end; justify-content: space-between; padding: 15px 0; border-top: 1px solid var(--border); }
.dialog-total strong { color: var(--primary); font-size: 30px; }
.checkout-dialog .checkout-button { width: 100%; margin: 0; }

.receipt-dialog { width: min(470px, calc(100% - 28px)); max-height: calc(100vh - 30px); padding: 0; overflow: auto; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(15,23,42,.3); }
.receipt-dialog::backdrop { background: rgba(9,18,33,.62); backdrop-filter: blur(4px); }
.receipt-sheet { padding: 26px; background: #fff; }
.receipt-header { padding-bottom: 16px; border-bottom: 1px dashed #aeb8c6; text-align: center; }
.receipt-header h2 { margin: 5px 0; font-size: 24px; }
.receipt-header p:not(.eyebrow) { margin: 3px 0; color: var(--muted); font-size: 11px; }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; padding: 16px 0; border-bottom: 1px dashed #aeb8c6; }
.receipt-meta div { display: grid; gap: 2px; }
.receipt-meta span, .receipt-line small { color: var(--muted); font-size: 10px; }
.receipt-meta strong { font-size: 12px; }
.receipt-items { padding: 8px 0; }
.receipt-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1f6; }
.receipt-line div { min-width: 0; display: grid; gap: 3px; }
.receipt-line strong { font-size: 12px; }
.receipt-totals { padding: 11px 0; border-bottom: 1px dashed #aeb8c6; }
.receipt-totals div { display: flex; justify-content: space-between; gap: 15px; padding: 3px 0; font-size: 12px; }
.receipt-totals .receipt-total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 18px; }
.receipt-totals .receipt-total strong { color: var(--primary); }
.receipt-footer { margin: 14px 0; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.5; }
.receipt-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 12px; }
.receipt-actions .primary-button { min-width: 190px; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; }
.toast { width: min(390px, calc(100vw - 32px)); display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow); animation: toastIn 200ms ease; }
.toast__icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--success); background: var(--success-soft); font-weight: 900; }
.toast.is-warning .toast__icon { color: var(--warning); background: var(--warning-soft); }
.toast.is-error .toast__icon { color: var(--danger); background: #fdecec; }
.toast div { min-width: 0; display: grid; }
.toast small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.offline-banner { position: fixed; left: 50%; bottom: 14px; z-index: 90; transform: translateX(-50%); padding: 9px 14px; border-radius: 999px; color: #7c4800; background: #fff0cc; box-shadow: var(--shadow); font-size: 11px; font-weight: 750; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .pos-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (min-width: 861px) {
  body[data-active-view="pos"] { height: 100vh; overflow: hidden; }
  body[data-active-view="pos"] .app-shell { height: 100vh; min-height: 0; overflow: hidden; }
  body[data-active-view="pos"] .workspace { height: 100vh; min-height: 0; display: grid; grid-template-rows: 80px minmax(0, 1fr); }
  body[data-active-view="pos"] .topbar { position: static; }
  body[data-active-view="pos"] main { height: 100%; min-height: 0; padding: 12px 20px 16px; overflow: hidden; }
  body[data-active-view="pos"] #view-pos { height: 100%; min-height: 0; }
  body[data-active-view="pos"] .pos-heading { height: 34px; margin-bottom: 10px; align-items: center; }
  body[data-active-view="pos"] .pos-layout { height: calc(100% - 44px); min-height: 0; }
  body[data-active-view="pos"] .catalog-panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  body[data-active-view="pos"] .product-grid { min-height: 0; overflow-y: auto; align-content: start; }
  body[data-active-view="pos"] .cart-panel { position: static; top: auto; height: 100%; min-height: 0; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { width: 260px; position: fixed; left: 0; transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 20px 0 50px rgba(15,23,42,.22); }
  body.menu-open .sidebar { transform: translateX(0); }
  .menu-button { display: inline-grid; place-items: center; }
  .topbar { padding: 0 18px; }
  main { padding: 22px 18px 40px; }
  .latency-chip, .branch-chip { display: none; }
  .pos-layout { display: block; }
  .cart-panel { height: auto; min-height: 520px; position: static; margin-top: 16px; }
  .trace-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { height: 68px; }
  .topbar h1 { font-size: 18px; }
  .hero-card { min-height: 250px; align-items: flex-start; flex-direction: column; padding: 26px; }
  .hero-card h2 { font-size: 32px; }
  .primary-button { width: 100%; }
  .kpi-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 11px; }
  .product-card__visual { height: 65px; }
  .product-card__body { padding: 10px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .payment-options { grid-template-columns: 1fr; }
  .payment-options span { min-height: 44px; }
  .toast-region { right: 16px; bottom: 64px; }
}

@media print {
  @page { size: 80mm auto; margin: 5mm; }
  body { background: #fff; }
  body * { visibility: hidden !important; }
  #receipt-dialog, #receipt-dialog * { visibility: visible !important; }
  #receipt-dialog { position: absolute; inset: 0; width: 70mm; max-height: none; margin: 0; overflow: visible; border-radius: 0; box-shadow: none; }
  .receipt-sheet { padding: 0; }
  .no-print { display: none !important; }
}
