:root {
  --ink: #1d2223;
  --ink-2: #343a3c;
  --paper: #f3f0e9;
  --surface: #fffdf8;
  --surface-2: #e9e5dc;
  --line: #d7d1c5;
  --muted: #747873;
  --orange: #ee5a2d;
  --orange-dark: #cc421c;
  --orange-soft: #ffe4d8;
  --green: #2d8b65;
  --green-soft: #dcefe5;
  --yellow: #e5b632;
  --blue: #3e6f84;
  --plum: #765067;
  --red: #bd3f3f;
  --shadow: 0 18px 45px rgba(30, 34, 33, .10);
  --radius: 18px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(238, 90, 45, .28);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; padding: 10px 14px; background: #fff; border-radius: 8px; font-weight: 800; }
.skip-link:focus { top: 10px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 74px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 24px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,.08);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 176px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand b { font-size: 16px; letter-spacing: .16em; }
.brand small { margin-top: 5px; color: #aeb4b2; font: 700 8px/1 var(--mono); letter-spacing: .22em; }
.brand-mark { width: 33px; height: 35px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; transform: skew(-7deg); }
.brand-mark i { display: block; background: var(--orange); border-radius: 2px 2px 0 0; }
.brand-mark i:nth-child(1) { height: 18px; }
.brand-mark i:nth-child(2) { height: 31px; }
.brand-mark i:nth-child(3) { height: 24px; }

.primary-nav { height: 100%; display: flex; align-items: stretch; gap: 3px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 15px; color: #adb3b1; font-size: 13px; font-weight: 750; }
.nav-link span { font-size: 18px; color: #d4d8d6; }
.nav-link em { min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border-radius: 99px; background: #424849; color: #fff; font: normal 700 10px var(--mono); }
.nav-link::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; background: transparent; }
.nav-link:hover { color: #fff; }
.nav-link.is-active { color: #fff; }
.nav-link.is-active::after { background: var(--orange); }
.nav-link.is-active span { color: var(--orange); }

.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sync-state { display: flex; align-items: center; gap: 7px; color: #bfc4c2; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sync-state i { width: 8px; height: 8px; border-radius: 50%; background: #65ca96; box-shadow: 0 0 0 4px rgba(101,202,150,.12); }
.clock { display: flex; min-width: 77px; flex-direction: column; padding-left: 13px; border-left: 1px solid #424849; }
.clock strong { font: 700 14px var(--mono); }
.clock small { margin-top: 3px; color: #9ea4a2; font: 600 8px var(--mono); letter-spacing: .08em; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #484f50; border-radius: 10px; background: #2b3032; color: #d8dcda; cursor: pointer; }
.icon-button:hover { border-color: #676e6f; background: #373d3f; }
.operator { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; cursor: pointer; color: #fff; }
.operator > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--orange); font: 800 12px var(--mono); }
.operator i { display: flex; min-width: 65px; flex-direction: column; align-items: flex-start; font-style: normal; }
.operator b { font-size: 11px; }
.operator small { margin-top: 3px; color: #9da3a1; font-size: 9px; }

.app-view { min-height: calc(100vh - 74px); }
.terminal-view { display: grid; grid-template-columns: minmax(0, 1fr) 430px; }
.terminal-view[hidden] { display: none !important; }
.catalog-pane { min-width: 0; padding: 28px 30px 48px; }
.checkout-pane { position: sticky; top: 74px; height: calc(100vh - 74px); display: flex; flex-direction: column; padding: 24px 24px 17px; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -10px 0 32px rgba(44,47,45,.04); overflow-y: auto; }
.terminal-title-row, .page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--orange-dark); font: 800 10px/1.2 var(--mono); letter-spacing: .13em; }
h1, h2, h3, p { margin-top: 0; }
.terminal-title-row h1, .page-header h1 { margin-bottom: 0; font-size: clamp(28px, 3.2vw, 43px); line-height: 1; letter-spacing: -.045em; }
.shift-summary { min-width: 160px; padding: 0 0 2px 18px; border-left: 1px solid var(--line); }
.shift-summary span, .shift-summary small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.shift-summary strong { display: block; margin: 4px 0 3px; font: 800 20px var(--mono); }

.catalog-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 26px; }
.search-box { min-height: 49px; display: flex; align-items: center; gap: 10px; padding: 0 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); transition: border-color .18s, box-shadow .18s; }
.search-box:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(238,90,45,.11); }
.search-box > span:first-child { color: var(--ink); font-size: 23px; transform: translateY(-1px); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-box input::placeholder { color: #999c98; }
.search-box kbd { flex: 0 0 auto; padding: 4px 6px; background: var(--surface-2); border: 1px solid #d9d4ca; border-bottom-width: 2px; border-radius: 5px; color: #787c78; font: 700 9px var(--mono); }
.scan-button { min-width: 100px; border: 1px solid var(--ink); border-radius: 12px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.scan-button span { margin-right: 5px; color: var(--orange); font-size: 17px; }
.scan-button:hover { background: #303638; }

.category-row { display: flex; gap: 8px; margin-top: 17px; padding-bottom: 3px; overflow-x: auto; scrollbar-width: none; }
.category-row::-webkit-scrollbar { display: none; }
.category-pill { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; min-height: 35px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: #626763; font-size: 11px; font-weight: 800; cursor: pointer; }
.category-pill span { font-size: 13px; }
.category-pill:hover { background: #ebe7df; }
.category-pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.category-pill.is-active span { color: var(--orange); }

.catalog-meta { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 12px; }
.catalog-meta p { margin: 0; color: var(--muted); font-size: 11px; }
.catalog-meta p strong { color: var(--ink); }
.catalog-meta label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
select { height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 13px; }
.product-card { position: relative; width: 100%; min-width: 0; display: block; padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; color: inherit; text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.product-card:hover { transform: translateY(-3px); border-color: #beb7aa; box-shadow: 0 12px 28px rgba(32,35,34,.09); }
.product-card:active { transform: translateY(0) scale(.985); }
.product-card.is-out { opacity: .62; cursor: not-allowed; }
.product-card.is-out:hover { transform: none; box-shadow: none; }
.product-image { position: relative; height: 124px; display: grid; place-items: center; overflow: hidden; background: #e6ded3; }
.product-image::before, .product-image::after { content: ""; position: absolute; border: 2px solid rgba(29,34,35,.16); transform: rotate(14deg); }
.product-image::before { width: 80px; height: 80px; right: -18px; top: -26px; border-radius: 20px; }
.product-image::after { width: 48px; height: 48px; left: -12px; bottom: -16px; border-radius: 50%; }
.product-image[data-tone="orange"] { background: #f3b29c; }
.product-image[data-tone="blue"] { background: #b8d0d8; }
.product-image[data-tone="green"] { background: #bbd6c6; }
.product-image[data-tone="yellow"] { background: #ead58e; }
.product-image[data-tone="plum"] { background: #cfb7c5; }
.product-icon { position: relative; z-index: 2; width: 70px; height: 70px; display: grid; place-items: center; border: 2px solid rgba(29,34,35,.12); border-radius: 24px 9px 24px 9px; background: rgba(255,255,255,.76); box-shadow: 7px 7px 0 rgba(29,34,35,.09); font-size: 37px; font-style: normal; }
.stock-flag { position: absolute; z-index: 3; left: 9px; top: 9px; padding: 5px 7px; border-radius: 5px; background: rgba(255,253,248,.88); color: var(--ink); font: 800 8px var(--mono); letter-spacing: .04em; backdrop-filter: blur(5px); }
.stock-flag.low { background: #fff2c9; color: #795800; }
.stock-flag.out { background: #f6dddd; color: #962c2c; }
.product-add { position: absolute; z-index: 3; right: 9px; bottom: 9px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-size: 18px; font-weight: 500; box-shadow: 0 4px 10px rgba(29,34,35,.18); }
.product-card:hover .product-add { background: var(--orange); }
.product-card.is-out .product-add { background: #888d89; }
.product-copy { display: block; padding: 12px 12px 13px; text-align: left; }
.product-copy small { display: block; margin-bottom: 5px; color: var(--muted); font: 700 8px var(--mono); text-transform: uppercase; letter-spacing: .09em; }
.product-copy h3 { min-height: 36px; margin-bottom: 8px; overflow: hidden; font-size: 13px; line-height: 1.35; }
.product-copy strong { font: 800 14px var(--mono); }
.catalog-empty { grid-column: 1/-1; display: grid; min-height: 290px; place-items: center; text-align: center; border: 1px dashed #c8c1b5; border-radius: var(--radius); }
.catalog-empty span { display: block; margin-bottom: 10px; font-size: 36px; }
.catalog-empty h2 { margin-bottom: 6px; font-size: 19px; }
.catalog-empty p { color: var(--muted); font-size: 12px; }

.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px dashed #c9c3b8; }
.ticket-number { display: block; margin-bottom: 6px; color: var(--muted); font: 700 9px var(--mono); letter-spacing: .1em; }
.ticket-number b { color: var(--orange-dark); }
.ticket-head h2 { margin-bottom: 0; font-size: 23px; letter-spacing: -.03em; }
.text-button { padding: 7px 0; border: 0; background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.text-button.danger { color: var(--red); }
.text-button:disabled { opacity: .35; cursor: default; }
.order-type { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.order-type button { height: 33px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; }
.order-type button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 7px rgba(35,38,36,.10); }
.customer-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0 2px 10px; border-bottom: 1px solid var(--line); }
.customer-line > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 15px; }
.customer-line input { min-width: 0; flex: 1; height: 32px; border: 0; outline: 0; background: transparent; font-size: 11px; }
.customer-line button { height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; cursor: pointer; }
.customer-line button.has-note { background: var(--orange-soft); border-color: #f2b39b; color: var(--orange-dark); }

.cart-lines { min-height: 160px; flex: 1; margin: 5px -7px 0 0; padding: 4px 7px 5px 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cfc8bc transparent; }
.empty-cart { min-height: 100%; display: grid; align-content: center; justify-items: center; padding: 25px; text-align: center; }
.empty-cart-art { position: relative; width: 78px; height: 78px; display: grid; place-items: center; margin-bottom: 15px; border: 1px dashed #bbb4a8; border-radius: 50%; color: #979a96; font-size: 28px; }
.empty-cart-art::after { content: "+"; position: absolute; right: 0; bottom: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: #fff; font-size: 16px; }
.empty-cart h3 { margin-bottom: 6px; font-size: 15px; }
.empty-cart p { max-width: 210px; margin-bottom: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.cart-line { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #ebe6dc; animation: lineIn .18s ease; }
@keyframes lineIn { from { opacity: 0; transform: translateX(8px); } }
.cart-thumb { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); font-size: 18px; }
.cart-line-copy { min-width: 0; }
.cart-line-copy h3 { margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.cart-line-copy small { color: var(--muted); font: 700 9px var(--mono); }
.cart-line-end { display: grid; grid-template-columns: auto auto; gap: 9px; align-items: center; }
.qty-control { display: grid; grid-template-columns: 25px 28px 25px; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.qty-control button { height: 27px; border: 0; background: var(--surface-2); font-weight: 800; cursor: pointer; }
.qty-control button:hover { background: #ddd8ce; }
.qty-control span { text-align: center; font: 800 10px var(--mono); }
.line-total { min-width: 56px; text-align: right; font: 800 10px var(--mono); }
.remove-line { grid-column: 1/-1; justify-self: end; margin-top: -3px; border: 0; background: transparent; color: #9e615b; font-size: 9px; font-weight: 700; cursor: pointer; }

.ticket-summary { padding: 13px 0 9px; border-top: 1px dashed #c9c3b8; }
.ticket-summary > div { display: flex; align-items: center; justify-content: space-between; min-height: 25px; color: var(--muted); font-size: 10px; }
.ticket-summary strong { color: var(--ink); font: 800 11px var(--mono); }
.discount-row button { padding: 0; border: 0; background: transparent; color: var(--orange-dark); font-size: 10px; font-weight: 800; cursor: pointer; }
.total-row { min-height: 45px !important; margin-top: 7px; padding-top: 10px; border-top: 2px solid var(--ink); color: var(--ink) !important; }
.total-row span { font-size: 15px; font-weight: 850; }
.total-row strong { font-size: 21px; }
.checkout-button { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 19px; border: 0; border-radius: 12px; background: var(--orange); color: #fff; box-shadow: 0 8px 0 #be3f1d; font-weight: 900; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.checkout-button:hover { background: #f26539; }
.checkout-button:active { transform: translateY(5px); box-shadow: 0 3px 0 #be3f1d; }
.checkout-button:disabled { background: #b5b4ae; box-shadow: 0 7px 0 #92918c; cursor: default; }
.checkout-button strong { font: 900 16px var(--mono); }
.checkout-hints { display: flex; justify-content: space-between; padding-top: 12px; color: #92958f; font: 600 8px var(--mono); }

.page-view { padding: 36px clamp(20px, 4vw, 58px) 80px; }
.page-header { align-items: center; }
.page-header p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.page-actions, .modal-actions { display: flex; gap: 9px; }
.outline-button, .solid-button { min-height: 43px; padding: 0 16px; border-radius: 9px; font-size: 11px; font-weight: 850; cursor: pointer; }
.outline-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.outline-button:hover { border-color: #aba499; }
.solid-button { border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.solid-button:hover { background: #323738; }
.solid-button.wide { width: 100%; margin-top: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.stat-card { position: relative; min-height: 112px; overflow: hidden; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.stat-card::after { content: ""; position: absolute; width: 52px; height: 52px; right: -10px; top: -10px; border: 10px solid var(--stat, var(--orange)); border-radius: 50%; opacity: .12; }
.stat-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.stat-card strong { display: block; margin-top: 17px; font: 850 25px var(--mono); letter-spacing: -.04em; }
.stat-card small { color: var(--green); font-size: 9px; font-weight: 800; }
.history-toolbar { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.search-box.compact { width: min(320px, 100%); min-height: 41px; }
.history-table-wrap { margin-top: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { padding: 12px 15px; background: #e8e4db; color: var(--muted); text-align: left; font: 800 9px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.history-table td { padding: 15px; border-top: 1px solid #e6e1d7; font-size: 11px; }
.history-table tbody tr:hover { background: #faf7f1; }
.history-table td strong { font: 800 11px var(--mono); }
.type-chip, .status-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 99px; background: var(--surface-2); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.type-chip.Pickup { background: #dce9ee; color: #315d70; }
.type-chip.Delivery { background: #eadfea; color: #67455f; }
.status-chip { background: var(--green-soft); color: #216d4f; }
.row-action { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 7px; background: transparent; cursor: pointer; }
.empty-history { min-height: 360px; display: grid; place-items: center; align-content: center; padding: 30px; text-align: center; }
.empty-history > span { font-size: 36px; color: #aaa9a3; }
.empty-history h2 { margin: 12px 0 4px; font-size: 18px; }
.empty-history p { margin-bottom: 15px; color: var(--muted); font-size: 11px; }
.empty-history a { color: var(--orange-dark); font-size: 11px; font-weight: 850; }

.inventory-list { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.inventory-row { display: grid; grid-template-columns: minmax(220px, 1.4fr) .7fr .6fr .7fr auto; gap: 18px; align-items: center; min-height: 76px; padding: 12px 16px; border-top: 1px solid #e6e1d7; }
.inventory-row:first-child { border-top: 0; }
.inventory-product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inventory-icon { width: 45px; height: 45px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); font-size: 22px; }
.inventory-product div { min-width: 0; }
.inventory-product h3 { margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.inventory-product small, .inventory-cell span { color: var(--muted); font-size: 9px; }
.inventory-cell strong { display: block; margin-top: 3px; font: 800 11px var(--mono); }
.stock-meter { width: 100%; max-width: 105px; height: 5px; margin-top: 6px; overflow: hidden; border-radius: 9px; background: #e6e1d7; }
.stock-meter i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.stock-meter i.low { background: var(--yellow); }
.stock-meter i.out { background: var(--red); }
.stock-adjust { display: grid; grid-template-columns: 29px 40px 29px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.stock-adjust button { height: 32px; border: 0; background: var(--surface-2); font-weight: 850; cursor: pointer; }
.stock-adjust span { display: grid; place-items: center; font: 800 10px var(--mono); }
.empty-inventory { padding: 60px 20px; color: var(--muted); text-align: center; font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(18,22,23,.68); backdrop-filter: blur(5px); }
.modal { position: fixed; z-index: 110; left: 50%; top: 50%; width: min(460px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 29px; overflow-y: auto; transform: translate(-50%, -50%); background: var(--surface); border: 1px solid #d4cdc1; border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.28); animation: modalIn .18s ease; }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -47%) scale(.97); } }
.modal-close { position: absolute; right: 13px; top: 13px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.modal-eyebrow { display: block; margin-bottom: 7px; color: var(--orange-dark); font: 800 9px var(--mono); letter-spacing: .13em; }
.modal h2 { margin-bottom: 8px; font-size: 25px; letter-spacing: -.035em; }
.modal-subtitle { margin-bottom: 20px; color: var(--muted); font-size: 11px; }
.success-seal { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 25px; font-weight: 900; }
.printed-receipt { position: relative; margin: 19px 0; padding: 22px 20px; background: #f0ece4; border-top: 1px dashed #bcb5a8; border-bottom: 1px dashed #bcb5a8; font-family: var(--mono); }
.printed-receipt::before, .printed-receipt::after { content: ""; position: absolute; left: 0; right: 0; height: 6px; background: radial-gradient(circle at 3px -1px, transparent 4px, #f0ece4 4.5px) repeat-x; background-size: 8px 6px; }
.printed-receipt::before { top: -6px; transform: rotate(180deg); }
.printed-receipt::after { bottom: -6px; }
.receipt-brand { text-align: center; }
.receipt-brand b { display: block; font-size: 15px; letter-spacing: .15em; }
.receipt-brand small { font-size: 8px; color: var(--muted); }
.receipt-rule { margin: 15px 0; border-top: 1px dashed #afa89d; }
.receipt-meta, .receipt-total-line, .receipt-item { display: flex; justify-content: space-between; gap: 12px; font-size: 9px; line-height: 1.6; }
.receipt-item span:first-child { flex: 1; }
.receipt-total-line.grand { margin-top: 8px; padding-top: 8px; border-top: 2px solid var(--ink); font-size: 13px; font-weight: 900; }
.receipt-note { margin: 13px 0 0; text-align: center; color: var(--muted); font-size: 8px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 21px; }
.choice-grid button { height: 58px; border: 1px solid var(--line); border-radius: 10px; background: #f2eee6; font: 850 15px var(--mono); cursor: pointer; }
.choice-grid button:hover { border-color: var(--orange); color: var(--orange-dark); }
.payment-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.payment-grid button { min-height: 126px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: #f2eee6; cursor: pointer; }
.payment-grid button:hover { border-color: var(--orange); background: var(--orange-soft); transform: translateY(-2px); }
.payment-grid button > span { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 5px; border-radius: 10px; background: var(--ink); color: #fff; font: 850 19px var(--mono); }
.payment-grid button b { font-size: 13px; }
.payment-grid button small { color: var(--muted); font-size: 9px; }
.field-label { display: flex; flex-direction: column; gap: 7px; margin-top: 15px; color: var(--muted); font-size: 10px; font-weight: 800; }
.field-label input, .field-label select, .field-label textarea { width: 100%; min-height: 43px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fff; color: var(--ink); }
.field-label textarea { min-height: 105px; resize: vertical; }
.field-label input:focus, .field-label textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(238,90,45,.1); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
.toggle-line { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.toggle-line span { display: flex; flex-direction: column; }
.toggle-line b { font-size: 11px; }
.toggle-line small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.toggle-line input { width: 18px; height: 18px; accent-color: var(--orange); }
.detail-list { margin-top: 18px; }
.detail-list .receipt-item { padding: 7px 0; border-bottom: 1px solid #e5e0d6; font-family: var(--mono); }
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 16px; }
.detail-grid div { padding: 11px; background: var(--surface-2); border-radius: 9px; }
.detail-grid span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.detail-grid strong { display: block; margin-top: 4px; font-size: 11px; }

.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 240px; max-width: 350px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--ink); border: 1px solid #444a4b; border-radius: 10px; color: #fff; box-shadow: var(--shadow); font-size: 10px; font-weight: 750; animation: toastIn .2s ease; }
.toast i { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); font-style: normal; }
@keyframes toastIn { from { opacity: 0; transform: translateY(9px); } }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .terminal-view { grid-template-columns: minmax(0, 1fr) 385px; }
  .catalog-pane { padding-left: 22px; padding-right: 22px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .primary-nav { gap: 0; }
  .nav-link { padding: 0 10px; }
  .sync-state { display: none; }
}

@media (max-width: 930px) {
  body { padding-bottom: 66px; }
  .topbar { height: 66px; padding: 0 16px; }
  .primary-nav, .clock, .operator i { display: none; }
  .brand { min-width: 0; }
  .topbar-tools { gap: 8px; }
  .operator > span, .icon-button { width: 36px; height: 36px; }
  .app-view { min-height: calc(100vh - 66px); }
  .terminal-view { grid-template-columns: minmax(0, 1fr) 350px; }
  .catalog-pane { padding: 23px 18px 26px; }
  .checkout-pane { top: 66px; height: calc(100vh - 132px); padding: 20px 18px 16px; }
  .mobile-nav { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; height: 66px; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--ink); color: #aeb4b2; box-shadow: 0 -5px 20px rgba(0,0,0,.14); }
  .mobile-nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 9px; font-weight: 800; }
  .mobile-nav a span { font-size: 18px; }
  .mobile-nav a.is-active { color: #fff; }
  .mobile-nav a.is-active::before { content: ""; position: absolute; top: 0; width: 40px; height: 3px; background: var(--orange); }
  .page-view { padding: 28px 18px 35px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .history-table-wrap { overflow-x: auto; }
  .history-table { min-width: 820px; }
  .inventory-list { overflow-x: auto; }
  .inventory-row { min-width: 780px; }
}

@media (max-width: 760px) {
  .terminal-view { display: block; }
  .checkout-pane { position: relative; top: auto; height: auto; min-height: 650px; padding: 24px 20px 20px; border-top: 2px solid var(--ink); border-left: 0; box-shadow: none; }
  .cart-lines { min-height: 220px; max-height: 420px; }
}

@media (max-width: 620px) {
  .brand b { font-size: 14px; }
  .brand small { font-size: 7px; }
  .brand-mark { width: 28px; height: 31px; }
  .terminal-title-row { align-items: flex-start; }
  .terminal-title-row h1, .page-header h1 { font-size: 31px; }
  .shift-summary { min-width: 128px; }
  .shift-summary strong { font-size: 16px; }
  .catalog-controls { grid-template-columns: 1fr; }
  .scan-button { min-height: 44px; }
  .search-box kbd { display: none; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product-image { height: 112px; }
  .product-icon { width: 61px; height: 61px; font-size: 31px; }
  .product-copy { padding: 10px; }
  .product-copy h3 { font-size: 11px; }
  .checkout-pane { min-height: 610px; }
  .cart-line { grid-template-columns: 34px minmax(0, 1fr); }
  .cart-line-end { grid-column: 2; justify-content: space-between; }
  .remove-line { grid-column: 1/-1; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions button { flex: 1; padding: 0 8px; }
  .history-toolbar { flex-direction: column; }
  .search-box.compact { width: 100%; }
  .history-toolbar select { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 25px 20px; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 100px; padding: 14px; }
  .stat-card strong { font-size: 20px; }
}

@media (max-width: 390px) {
  .brand > span:last-child { display: none; }
  .shift-summary span, .shift-summary small { display: none; }
  .shift-summary { min-width: auto; padding-left: 12px; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .product-image { height: 100px; }
}

@media print {
  body * { visibility: hidden !important; }
  #receipt-modal, #receipt-modal * { visibility: visible !important; }
  #receipt-modal { position: static; width: 340px; max-height: none; margin: 0 auto; padding: 0; transform: none; border: 0; box-shadow: none; }
  #receipt-modal > :not(.printed-receipt) { display: none !important; }
  .printed-receipt { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
