/* ============================================================
   MARTISOL POS — till styles
   File: css/martisol-pos.css
   Orange + deep navy. Big touch targets (≥ 44px), numbers in mono,
   motion kept short (≤ 220 ms) and disabled for reduced-motion users.
   ============================================================ */
:root {
  --ink: #0F1B2E; --navy: #13233D; --navy2: #1A3E6F; --navy3: #2253A0;
  --navy-soft: #EAF1FF; --navy-glow: rgba(26,62,111,.22);
  /* Orange is an accent, not a theme: Pay button, qty badge, low-stock dot. */
  --o: #F2690F; --o2: #D4540A; --o3: #F2690F; --o-soft: #FEF0E6; --o-glow: rgba(242,105,15,.26);
  --bg: #EEF2F8; --card: #FFFFFF; --panel: #F6F8FC; --line: #DFE5EF; --line2: #ECF0F7;
  --tx: #0F1B2E; --tx2: #4A5771; --tx3: #8C97AC;
  --ok: #0E9F6E; --ok-soft: rgba(14,159,110,.12);
  --warn: #D97706; --warn-soft: rgba(217,119,6,.12);
  --bad: #DC2626; --bad-soft: rgba(220,38,38,.10);
  --r: 0; --r-sm: 0;
  --fd: 'Outfit', system-ui, sans-serif; --fb: 'Plus Jakarta Sans', system-ui, sans-serif; --fm: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
  --shadow: 0 1px 2px rgba(15,27,46,.05), 0 2px 10px rgba(15,27,46,.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { font-family: var(--fb); color: var(--tx); background: var(--bg); overflow: hidden; font-size: 13px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: inherit; }
kbd { font-family: var(--fm); font-size: 10px; padding: 1px 5px; border-radius: 0; background: rgba(10,22,40,.06); color: var(--tx3); border: 1px solid rgba(10,22,40,.08); font-weight: 600; }
.pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 0; background: var(--o-soft); color: var(--o2); font: 700 12px var(--fm); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 0; color: var(--tx3); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--line2); color: var(--tx); }
:focus-visible { outline: 3px solid var(--o-glow); outline-offset: 2px; }

/* ══════════════════════ LOCK / PIN ══════════════════════ */
.lock { position: fixed; inset: 0; display: flex; z-index: 50; background: var(--bg); transition: opacity .25s var(--ease), visibility .25s; }
body.is-unlocked .lock { opacity: 0; visibility: hidden; pointer-events: none; }
.lock-brand { flex: 1 1 55%; position: relative; overflow: hidden; color: #fff; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 85% 12%, rgba(255,106,26,.28), transparent 46%), radial-gradient(circle at 5% 95%, rgba(255,138,61,.14), transparent 45%), linear-gradient(160deg, var(--navy) 0%, var(--ink) 70%); }
.lock-grid { position: absolute; inset: 0; background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.07) 1px, transparent 0); background-size: 26px 26px; }
.lock-glow { position: absolute; width: 520px; height: 520px; right: -160px; bottom: -200px; border-radius: 50%; border: 1px solid rgba(255,255,255,.07); box-shadow: 0 0 0 60px rgba(255,255,255,.015), 0 0 0 130px rgba(255,255,255,.012); }
.lock-top, .lock-mid, .lock-foot { position: relative; z-index: 1; }
.lock-logo { height: 46px; }
.lock-clock { font: 800 76px/1 var(--fd); letter-spacing: -.03em; }
.lock-date { color: rgba(255,255,255,.55); font-size: 15px; margin: 8px 0 38px; }
.lock-mid h1 { font: 800 clamp(28px, 3vw, 40px)/1.1 var(--fd); letter-spacing: -.02em; }
.lock-mid h1 em { font-style: normal; background: linear-gradient(90deg, var(--o), #FFB27A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lock-mid p { max-width: 430px; color: rgba(255,255,255,.6); margin-top: 14px; line-height: 1.6; }
.lock-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.lock-chips span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 0; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.85); }
.lock-chips i { color: var(--o3); }
.lock-foot { font-size: 12px; color: rgba(255,255,255,.4); }

.lock-pad { flex: 1 1 45%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px;
  background: radial-gradient(circle at 90% 0%, rgba(255,106,26,.07), transparent 40%), var(--bg); }
.pad-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 0; padding: 30px 30px 26px; box-shadow: 0 30px 70px -30px rgba(10,22,40,.35); border: 1px solid var(--line); text-align: center; }
.pad-avatar { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 0; display: grid; place-items: center; font-size: 26px; color: #fff; background: linear-gradient(135deg, var(--o3), var(--o2)); box-shadow: 0 12px 26px -10px var(--o-glow); }
.pad-card h2 { font: 700 22px var(--fd); }
.pad-sub { color: var(--tx3); font-size: 13px; margin-top: 4px; }
.pad-dots { display: flex; gap: 16px; justify-content: center; margin: 24px 0 8px; }
.pad-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #CBD3E1; transition: all .15s var(--ease); }
.pad-dots i.on { background: var(--o); border-color: var(--o); transform: scale(1.12); box-shadow: 0 0 0 5px var(--o-soft); }
.pad-dots.ok i { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); }
.pad-msg { min-height: 20px; font-size: 13px; color: var(--bad); font-weight: 600; }
.pad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.pad-keys button { height: 64px; border-radius: 0; background: var(--bg); font: 600 24px var(--fd); transition: transform .08s, background .15s, box-shadow .15s; border: 1px solid var(--line2); }
.pad-keys button:hover { background: #E9EDF4; }
.pad-keys button:active, .pad-keys button.hit { transform: scale(.94); background: var(--o-soft); color: var(--o2); border-color: rgba(255,106,26,.3); }
.pad-keys .k-soft { font-size: 18px; color: var(--tx3); background: transparent; }
.shake { animation: shake .38s var(--ease); }
@keyframes shake { 20%,60% { transform: translateX(-9px); } 40%,80% { transform: translateX(9px); } }
.pad-branches { margin-top: 18px; text-align: left; }
.pad-branches-title { font-weight: 700; margin-bottom: 10px; }
.pad-branches-list { display: grid; gap: 8px; }
.pad-branches-list button { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 0; border: 1.5px solid var(--line); background: #fff; text-align: left; font-weight: 600; transition: border-color .15s, background .15s; }
.pad-branches-list button:hover { border-color: var(--o); background: var(--o-soft); }
.pad-branches-list i { color: var(--o); font-size: 18px; }
.pad-branches-list small { margin-left: auto; color: var(--tx3); font-family: var(--fm); }
.pad-mgmt { color: var(--tx3); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.pad-mgmt:hover { color: var(--o2); }

/* ══════════════════════ APP SHELL ══════════════════════ */
.app { height: 100vh; display: flex; flex-direction: column; }
body.is-locked .app { filter: blur(3px); pointer-events: none; }
.top { height: 52px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--ink); color: #fff; position: relative; z-index: 5; }
.top-brand { display: flex; align-items: center; gap: 10px; }
.top-brand img { width: 26px; height: 26px; border-radius: 0; }
.top-brand b { font: 800 14.5px var(--fd); letter-spacing: .01em; display: block; line-height: 1; }
.top-brand span { font: 700 8.5px var(--fm); color: rgba(255,255,255,.5); letter-spacing: .25em; }
.top-branch { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 0; background: rgba(255,255,255,.07); font-size: 11.5px; font-weight: 600; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.top-branch i { color: var(--o3); }
.search { flex: 1; max-width: 640px; position: relative; display: flex; align-items: center; }
.search > i { position: absolute; left: 12px; font-size: 15px; color: var(--o3); pointer-events: none; }
.search input { width: 100%; height: 34px; border-radius: 0; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.07); color: #fff; padding: 0 50px 0 36px; outline: none; font-size: 12.5px; transition: background .15s, border-color .15s, box-shadow .15s; }
.search input::placeholder { color: rgba(255,255,255,.45); }
.search input:focus { background: #fff; color: var(--tx); border-color: var(--o); box-shadow: 0 0 0 4px var(--o-glow); }
.search input:focus::placeholder { color: var(--tx3); }
.search kbd { position: absolute; right: 12px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.6); border-color: transparent; }
.search input:focus ~ kbd { background: var(--line2); color: var(--tx3); }
.search.flash input { animation: flash .45s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(18,183,106,.6); } 100% { box-shadow: 0 0 0 10px rgba(18,183,106,0); } }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.net { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 0; color: #5BE3A3; }
.net.off { color: #fff; background: var(--bad); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.tbtn { position: relative; display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 0; background: rgba(255,255,255,.07); font-weight: 600; font-size: 11.5px; transition: background .15s; }
.tbtn:hover { background: rgba(255,255,255,.14); }
.tbtn i { font-size: 13px; }
.tbtn em { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 0; background: var(--o); color: #fff; font: 700 11px/19px var(--fm); text-align: center; font-style: normal; padding: 0 5px; box-shadow: 0 0 0 2px var(--ink); }
.who { position: relative; display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 0; cursor: pointer; transition: background .15s; }
.who:hover, .who.open { background: rgba(255,255,255,.08); }
.who-av { width: 24px; height: 24px; border-radius: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy3), var(--navy2)); font: 700 10px var(--fd); overflow: hidden; }
.who-av img { width: 100%; height: 100%; object-fit: cover; }
.who-txt { display: flex; flex-direction: column; line-height: 1.15; }
.who-txt b { font-size: 11px; } .who-txt small { font-size: 9px; color: rgba(255,255,255,.5); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: #fff; color: var(--tx); border-radius: 0; box-shadow: 0 24px 60px -20px rgba(10,22,40,.45); padding: 6px; display: none; z-index: 20; border: 1px solid var(--line); }
.who.open .menu { display: block; animation: pop .16s var(--ease); }
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 0; font-size: 13.5px; font-weight: 500; text-decoration: none; color: inherit; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--bg); }
.menu i { font-size: 17px; color: var(--tx3); }
.menu kbd { margin-left: auto; }
.menu .danger { color: var(--bad); } .menu .danger i { color: var(--bad); }
.clock { font: 600 13px var(--fm); color: rgba(255,255,255,.75); min-width: 50px; text-align: right; }

.fkeys { flex: none; display: flex; gap: 2px; padding: 4px 12px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.fkeys::-webkit-scrollbar { display: none; }
.fkeys button { flex: none; display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 4px; border-radius: 0; font-size: 10.5px; font-weight: 600; color: var(--tx2); transition: background .15s, color .15s; }
.fkeys button b { font: 700 9px var(--fm); padding: 1px 4px; border-radius: 0; background: var(--bg); color: var(--tx3); }
.fkeys button:hover { background: var(--bg); color: var(--tx); }
.fkeys .fk-pay { margin-left: auto; color: var(--o2); } .fkeys .fk-pay b { background: var(--o-soft); color: var(--o2); }

.main { flex: 1; min-height: 0; display: flex; gap: 0; padding: 0; }

/* ── Catalog ── */
.catalog { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; padding: 11px 12px 0; }
.cats { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 10px; border-bottom: 1px solid var(--line); scrollbar-width: thin; flex: none; }
.cats button { flex: none; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 0; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 11.5px; color: var(--tx2); transition: all .15s var(--ease); }
.cats button i { font-size: 12px; color: var(--tx3); }
.cats button small { font: 700 9.5px var(--fm); color: var(--tx3); }
.cats button:hover { border-color: #cfd6e3; color: var(--tx); }
.cats button.on { background: var(--navy2); border-color: var(--navy2); color: #fff; }
.cats button.on i, .cats button.on small { color: rgba(255,255,255,.85); }
.grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); grid-auto-rows: min-content; gap: 9px; padding: 11px 2px 12px 0; align-content: start; scroll-behavior: smooth; }
.tile { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: 0; border: 1px solid var(--line); overflow: hidden; text-align: left; transition: transform .14s var(--ease), box-shadow .14s var(--ease), border-color .14s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d6dce8; }
.tile:active { transform: scale(.97); }
.tile.added { animation: added .35s var(--ease); }
@keyframes added { 0% { box-shadow: 0 0 0 0 var(--o-glow); } 100% { box-shadow: 0 0 0 12px rgba(255,106,26,0); } }
.tile.out { opacity: .55; }
.tile-img { height: 64px; display: grid; place-items: center; font-size: 22px; position: relative; border-bottom: 1px solid var(--line2); }
/* 2px department stripe — currentColor comes from the .c0–.c7 class */
.tile-img::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: currentColor; }
.tile-img img { width: 100%; height: 100%; object-fit: contain; padding: 5px; background: #fff; }
.tile-body { padding: 7px 8px 8px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.tile-name { font-weight: 600; font-size: 11.5px; line-height: 1.3; min-height: 30px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-price { font: 700 12.5px var(--fm); letter-spacing: -.2px; color: var(--navy2); display: flex; align-items: baseline; gap: 6px; }
.tile-price s { font: 500 10px var(--fb); color: var(--tx3); }
.tile-price small { font: 600 9px var(--fb); color: var(--tx3); }
.tile-stock { font-size: 9.5px; font-weight: 600; color: var(--tx3); display: flex; align-items: center; gap: 5px; }
.tile-stock::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.tile-stock.low::before { background: var(--warn); } .tile-stock.none::before { background: var(--bad); }
.tile-add { position: absolute; right: 8px; bottom: 8px; width: 20px; height: 20px; display: grid; place-items: center; background: var(--navy-soft); color: var(--navy2); font-size: 13px; }
.tile:hover .tile-add { background: var(--navy2); color: #fff; }
.tile-badge { position: absolute; top: 6px; left: 6px; font: 700 8.5px var(--fm); padding: 1px 5px; border-radius: 0; background: var(--bad); color: #fff; letter-spacing: .04em; }
.tile-badge.kg { background: var(--navy); }
.tile-qty { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--o); color: #fff; font: 700 9.5px/17px var(--fm); text-align: center; box-shadow: 0 0 0 2px #fff; }
.grid-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--tx3); }
.grid-empty i { font-size: 42px; display: block; margin-bottom: 8px; opacity: .5; }
.grid-more { text-align: center; } .grid-more button { padding: 10px 18px; border-radius: 0; background: var(--card); border: 1px solid var(--line); font-weight: 600; }

/* tile palette per category — flat panel, the colour lives in the stripe
   and the icon only (currentColor), so the grid reads as one calm surface. */
.c0 { background: var(--panel); color: #E55300; }
.c1 { background: var(--panel); color: #2563EB; }
.c2 { background: var(--panel); color: #0E9F5A; }
.c3 { background: var(--panel); color: #7C3AED; }
.c4 { background: var(--panel); color: #B7791F; }
.c5 { background: var(--panel); color: #E11D48; }
.c6 { background: var(--panel); color: #0891B2; }
.c7 { background: var(--panel); color: #46546E; }

/* ── Cart ── */
.cart { width: 320px; flex: none; display: flex; flex-direction: column; background: var(--card); border-radius: 0; border: 0; border-left: 1px solid var(--line); overflow: hidden; }
.cart-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 12px 9px; border-bottom: 1px solid var(--line2); }
.cart-head h3 { font: 700 12.5px var(--fd); display: flex; align-items: center; gap: 8px; }
.cart-head h3 i { color: var(--navy2); font-size: 14px; }
.cart-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 0; font-size: 10.5px; font-weight: 600; background: var(--panel); border: 1px solid var(--line); color: var(--tx2); max-width: 240px; }
.tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-held { background: var(--warn-soft); color: #B54708; }
.tag-cust:hover { background: #E7EBF2; }
.tag-cust.set { background: var(--navy-soft); color: var(--navy2); border-color: #CFE0FA; }
.lines { flex: 1; min-height: 0; overflow-y: auto; padding: 0; }
.line { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "n q t" "m q x"; column-gap: 8px; align-items: center; padding: 8px 12px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line2); border-left: 2px solid transparent; transition: background .12s, border-color .12s; }
.line + .line { margin-top: 0; }
.line:hover { background: var(--bg); }
.line.sel { border-left-color: var(--o); background: var(--o-soft); }
.line.bump { animation: bump .3s var(--ease); }
@keyframes bump { 0% { background: rgba(255,106,26,.18); } 100% { background: transparent; } }
.line-n { grid-area: n; font-weight: 600; font-size: 11.5px; line-height: 1.25; }
.line-m { grid-area: m; font-size: 10px; color: var(--tx3); font-family: var(--fm); }
.line-m .d { color: var(--ok); font-weight: 600; }
.line-t { grid-area: t; text-align: right; font: 700 12px var(--fm); }
.line-x { grid-area: x; justify-self: end; color: var(--tx3); width: 26px; height: 22px; border-radius: 0; display: grid; place-items: center; }
.line-x:hover { color: var(--bad); background: var(--bad-soft); }
.qty { grid-area: q; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 0; padding: 0; }
.qty button { width: 21px; height: 21px; border-radius: 0; display: grid; place-items: center; font-size: 12px; color: var(--tx2); transition: background .12s; }
.qty button:hover { background: #fff; color: var(--o2); }
.qty input { width: 28px; text-align: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-top: 0; border-bottom: 0; background: transparent; font: 700 11px var(--fm); outline: none; }
.empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--tx3); gap: 4px; padding: 20px; }
.empty-ic { width: 54px; height: 54px; border-radius: 0; display: grid; place-items: center; font-size: 24px; background: var(--navy-soft); color: var(--navy2); margin-bottom: 10px; }
.empty b { color: var(--tx); font-size: 12.5px; }
.sums { padding: 9px 12px; border-top: 1px solid var(--line); background: var(--panel); display: grid; gap: 2px; }
.sum-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--tx2); }
.sum-row b { font-family: var(--fm); font-size: 11.5px; font-weight: 600; color: var(--tx); }
.sum-row.disc b, .sum-row.disc span { color: var(--ok); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding: 9px 11px; border-radius: 0; background: var(--navy); align-items: center; }
.sum-total span { font: 700 10px var(--fb); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.sum-total b { font: 700 19px var(--fm); color: #fff; letter-spacing: -.4px; }
.cart-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 0; background: var(--line); border-top: 1px solid var(--line); }
.cart-actions button { height: 40px; border-radius: 0; background: var(--card); font-weight: 600; font-size: 10.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; transition: background .15s, border-color .15s; }
.cart-actions button:hover { background: #fff; border-color: #cfd6e3; }
.cart-actions kbd { display: none; }
.pay { margin: 0; height: 46px; border-radius: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #fff; background: var(--o); transition: transform .12s var(--ease), box-shadow .15s, opacity .15s; }
.pay span { font: 700 12.5px var(--fb); display: flex; align-items: center; gap: 7px; }
.pay kbd { background: rgba(255,255,255,.2); color: #fff; border-color: transparent; }
.pay b { font: 700 15px var(--fm); }
.pay:hover:not(:disabled) { background: var(--o2); }
.pay:active:not(:disabled) { transform: scale(.985); }
.pay:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.cart-fab { display: none; }
.cart-close { display: none; }

/* ══════════════════════ OVERLAYS ══════════════════════ */
.scrim { position: fixed; inset: 0; background: rgba(10,22,40,.5); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; z-index: 30; }
.scrim.on { opacity: 1; visibility: visible; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.98); opacity: 0; visibility: hidden; transition: all .2s var(--ease); z-index: 40; background: #fff; border-radius: 0; box-shadow: 0 40px 100px -30px rgba(10,22,40,.55); max-height: calc(100vh - 32px); overflow: auto; }
.modal.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-pay { width: min(900px, calc(100vw - 32px)); display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; }
.pay-left { padding: 26px 28px; }
.pay-right { padding: 22px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.pay-due-lbl { font-size: 13px; color: var(--tx3); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.pay-due { font: 800 32px var(--fd); color: var(--ink); letter-spacing: -.02em; margin: 2px 0 18px; }
.pay-due small { font-size: 18px; color: var(--tx3); margin-left: 6px; }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-methods button { height: 54px; border-radius: 0; border: 1.5px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 13px; color: var(--tx2); transition: all .15s var(--ease); }
.pay-methods i { font-size: 18px; }
.pay-methods button.on { border-color: var(--o); background: var(--o-soft); color: var(--o2); box-shadow: 0 0 0 3px var(--o-soft); }
.pay-in { display: block; margin-top: 16px; }
.pay-in span { font-size: 12px; font-weight: 700; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; }
.pay-in input { width: 100%; margin-top: 6px; height: 48px; border-radius: 0; border: 1.5px solid var(--line); padding: 0 14px; font: 700 21px var(--fm); outline: none; transition: border-color .15s, box-shadow .15s; }
.pay-in input:focus { border-color: var(--o); box-shadow: 0 0 0 4px var(--o-soft); }
.pay-ref { width: 100%; margin-top: 8px; height: 44px; border-radius: 0; border: 1.5px solid var(--line); padding: 0 14px; outline: none; }
.pay-ref:focus { border-color: var(--o); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick button { height: 40px; padding: 0 14px; border-radius: 0; background: var(--bg); font: 700 13px var(--fm); border: 1px solid var(--line2); transition: background .12s, border-color .12s; }
.quick button:hover { border-color: var(--o); background: #fff; }
.quick button.exact { background: var(--ink); color: #fff; border-color: var(--ink); }
.tenders { margin-top: 14px; display: grid; gap: 6px; }
.tender { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 0; background: var(--ok-soft); font-weight: 600; }
.tender i { color: var(--ok); } .tender b { margin-left: auto; font-family: var(--fm); } .tender button { color: var(--tx3); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 44px; border-radius: 0; background: #fff; font: 700 16px var(--fd); border: 1px solid var(--line); transition: transform .08s, background .12s; }
.keypad button:active { transform: scale(.95); background: var(--o-soft); }
.pay-change { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 0; background: #fff; border: 1px solid var(--line); }
.pay-change span { font-weight: 700; color: var(--tx3); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.pay-change b { font: 700 20px var(--fm); color: var(--ok); }
.pay-change.short b { color: var(--bad); } .pay-change.short span::after { content: ' — still due'; }
.btn-split { height: 42px; border-radius: 0; border: 1.5px dashed #c7cfdd; color: var(--tx2); font-weight: 600; }
.btn-split:hover { border-color: var(--o); color: var(--o2); }
.btn-complete { height: 48px; border-radius: 0; background: linear-gradient(135deg, #1CC47A, #0E9F5A); color: #fff; font: 700 13.5px var(--fb); display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .15s, transform .1s; }
.btn-complete kbd { background: rgba(255,255,255,.22); color: #fff; border: 0; }
.btn-complete:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-complete:active:not(:disabled) { transform: scale(.985); }
.btn-ghost { height: 40px; border-radius: 0; color: var(--tx3); font-weight: 600; }

.done { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 45; width: min(760px, calc(100vw - 24px)); display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 14px; border-radius: 0; background: var(--ink); color: #fff; box-shadow: 0 30px 70px -20px rgba(10,22,40,.6); transition: transform .28s var(--ease); }
.done.on { transform: translate(-50%, 0); }
.done-ic { width: 52px; height: 52px; border-radius: 0; display: grid; place-items: center; font-size: 28px; background: linear-gradient(135deg, #1CC47A, #0E9F5A); flex: none; }
.done-txt { display: flex; flex-direction: column; min-width: 0; }
.done-txt b { font: 700 16px var(--fd); } .done-txt span { font-size: 12.5px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done-change { margin-left: auto; text-align: right; padding: 0 8px; }
.done-change small { display: block; font-size: 11px; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .08em; }
.done-change b { font: 700 22px var(--fm); color: #FFB27A; }
.done-actions { display: flex; gap: 8px; }
.done-actions button { height: 44px; padding: 0 14px; border-radius: 0; background: rgba(255,255,255,.1); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.done-actions .primary { background: var(--o); }
.done-actions kbd { background: rgba(255,255,255,.2); color: #fff; border: 0; }

.modal-sm { width: min(460px, calc(100vw - 32px)); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.dlg-head h3 { font: 700 18px var(--fd); }
.dlg-body { padding: 8px 20px 4px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px 20px; }
.dlg-foot button { height: 46px; padding: 0 18px; border-radius: 0; font-weight: 700; background: var(--bg); }
.dlg-foot .primary { background: var(--o); color: #fff; box-shadow: 0 10px 20px -12px var(--o-glow); }
.dlg-foot .danger { background: var(--bad); color: #fff; }
.dlg-foot button:disabled { opacity: .5; }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 11.5px; font-weight: 700; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.fld input, .fld select, .fld textarea { width: 100%; height: 46px; border-radius: 0; border: 1.5px solid var(--line); padding: 0 14px; outline: none; font-size: 15px; background: #fff; }
.fld textarea { height: 80px; padding: 10px 14px; resize: none; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--o); box-shadow: 0 0 0 4px var(--o-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips button { height: 40px; padding: 0 14px; border-radius: 0; border: 1.5px solid var(--line); font-weight: 600; }
.chips button.on, .chips button:hover { border-color: var(--o); background: var(--o-soft); color: var(--o2); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 0; background: var(--bg); margin-bottom: 14px; }
.seg button { height: 38px; border-radius: 0; font-weight: 600; color: var(--tx2); }
.seg button.on { background: #fff; color: var(--tx); box-shadow: 0 2px 6px rgba(10,22,40,.08); }
.note { font-size: 12.5px; color: var(--tx3); line-height: 1.5; }
.pin-mini { display: flex; gap: 12px; justify-content: center; margin: 10px 0 6px; }
.pin-mini input { width: 54px; height: 60px; text-align: center; font: 800 26px var(--fm); border-radius: 0; border: 2px solid var(--line); outline: none; -webkit-text-security: disc; }
.pin-mini input:focus { border-color: var(--o); box-shadow: 0 0 0 4px var(--o-soft); }
.cust-list { display: grid; gap: 6px; max-height: 220px; overflow: auto; margin-bottom: 10px; }
.cust-list button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 0; border: 1px solid var(--line); text-align: left; }
.cust-list button:hover { border-color: var(--o); background: var(--o-soft); }
.cust-list small { color: var(--tx3); font-family: var(--fm); margin-left: auto; }
.report { display: grid; gap: 6px; }
.report .r-row { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 0; background: var(--bg); font-size: 14px; }
.report .r-row b { font-family: var(--fm); }
.report .r-row.big { background: var(--ink); color: #fff; font-weight: 700; }
.report .r-row.good b { color: var(--ok); } .report .r-row.bad b { color: var(--bad); }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; z-index: 40; transform: translateX(104%); transition: transform .24s var(--ease); display: flex; flex-direction: column; box-shadow: -30px 0 80px -30px rgba(10,22,40,.45); }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; border-bottom: 1px solid var(--line2); }
.drawer-head h3 { font: 700 18px var(--fd); display: flex; align-items: center; gap: 8px; }
.drawer-body { flex: 1; overflow: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.card-row { border: 1px solid var(--line); border-radius: 0; padding: 12px 14px; display: grid; gap: 6px; transition: border-color .15s, box-shadow .15s; }
.card-row:hover { border-color: #d3dae6; box-shadow: var(--shadow); }
.card-row .top-line { display: flex; align-items: center; gap: 8px; }
.card-row .top-line b { font-size: 14.5px; }
.card-row .top-line .amt { margin-left: auto; font: 800 16px var(--fd); color: var(--o2); }
.card-row .meta { font-size: 12px; color: var(--tx3); display: flex; gap: 10px; flex-wrap: wrap; }
.card-row .prev { font-size: 12.5px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-row .acts { display: flex; gap: 8px; margin-top: 4px; }
.card-row .acts button { height: 38px; padding: 0 12px; border-radius: 0; font-weight: 600; font-size: 13px; background: var(--bg); display: inline-flex; align-items: center; gap: 6px; }
.card-row .acts .primary { background: var(--o); color: #fff; }
.card-row .acts .warn { color: var(--bad); }
.badge { font: 700 10.5px var(--fm); padding: 3px 8px; border-radius: 0; background: var(--bg); color: var(--tx2); letter-spacing: .03em; }
.badge.ok { background: var(--ok-soft); color: #067647; } .badge.bad { background: var(--bad-soft); color: #B42318; } .badge.warn { background: var(--warn-soft); color: #B54708; } .badge.o { background: var(--o-soft); color: var(--o2); }
.drawer-empty { text-align: center; color: var(--tx3); padding: 60px 20px; }
.drawer-empty i { font-size: 40px; display: block; margin-bottom: 8px; opacity: .5; }

.toasts { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; pointer-events: none; justify-items: center; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 0; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: 0 14px 34px -14px rgba(10,22,40,.6); animation: tin .2s var(--ease); max-width: min(560px, 92vw); }
.toast i { font-size: 18px; } .toast.ok i { color: #5BE3A3; } .toast.err { background: #B42318; } .toast.warn i { color: #FFC266; }
.toast.out { animation: tout .2s var(--ease) forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } } @keyframes tout { to { opacity: 0; transform: translateY(-8px); } }

/* ══════════════════════ RESPONSIVE ══════════════════════ */
@media (max-width: 1280px) { .cart { width: 380px; } .who-txt, .tbtn span { display: none; } }
@media (max-width: 1100px) { .fkeys { display: none; } .top-branch { display: none; } }
@media (max-width: 900px) {
  .lock-brand { display: none; }
  .top { gap: 8px; padding: 0 10px; } .top-brand div, .clock { display: none; }
  .main { padding: 10px; }
  .cart { position: fixed; left: 0; right: 0; bottom: 0; top: 70px; width: auto; z-index: 35; border-radius: 0 22px 0 0; transform: translateY(105%); transition: transform .25s var(--ease); }
  body.cart-open .cart { transform: none; }
  .cart-close { display: grid; background: var(--bg); }
  .cart-fab { display: flex; position: fixed; right: 14px; bottom: 14px; z-index: 34; align-items: center; gap: 10px; height: 58px; padding: 0 20px 0 16px; border-radius: 0; color: #fff; background: linear-gradient(135deg, var(--o3), var(--o2)); box-shadow: 0 16px 30px -12px var(--o-glow); font-size: 20px; }
  .cart-fab em { font: 700 12px var(--fm); font-style: normal; background: rgba(255,255,255,.25); border-radius: 0; padding: 2px 8px; }
  .cart-fab b { font: 800 17px var(--fd); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding-bottom: 90px; }
  .modal-pay { grid-template-columns: 1fr; }
  .pay-due { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* ══════════════════ SUPERMARKET EDITION — shape exceptions ══════════════════
   Everything is square except the handful of marks that read as dots. */
.pill, .tbtn em, .net, .pad-dots i { border-radius: 99px; }
.cats button.on small { background: rgba(255,255,255,.16); color: #fff; }
.search input:focus { background: #fff; color: var(--tx); border-color: var(--navy3); box-shadow: none; }
.pad-keys button:active, .pad-keys button.hit { background: var(--navy-soft); color: var(--navy2); border-color: #CFE0FA; }
.pad-dots i.on { background: var(--navy2); border-color: var(--navy2); box-shadow: 0 0 0 4px var(--navy-soft); }
.pad-avatar { background: linear-gradient(135deg, var(--navy3), var(--navy2)); box-shadow: none; }
.pad-branches-list button:hover { border-color: var(--navy2); background: var(--navy-soft); }
.pad-branches-list i { color: var(--navy2); }
.lock-chips i { color: #F2690F; }
.quick button:hover { border-color: var(--navy2); }
.pay-methods button.on { border-color: var(--navy2); background: var(--navy-soft); color: var(--navy2); box-shadow: none; }
.pay-in input:focus { border-color: var(--navy2); box-shadow: none; }
.btn-split:hover { border-color: var(--navy2); color: var(--navy2); }
.keypad button:active { background: var(--navy-soft); }
:focus-visible { outline: 2px solid var(--navy3); outline-offset: 1px; }


/* ══════════════════ SAMPLE DESIGN — light, orange-led till ══════════════════
   Follows the approved POS sample: white header, pill departments, borderless
   product cards (picture, name, price, stock, orange add button) and a clean
   "Current sale" card. Change --rx to 0 to go back to square corners. */
:root { --rx: 14px; --rb: 10px; --bg: #F4F6FA; --card-shadow: 0 1px 2px rgba(15,27,46,.05), 0 6px 18px -6px rgba(15,27,46,.10); }
body { background: var(--bg); }

/* Header */
.top { background: #fff; color: var(--tx); height: 60px; box-shadow: 0 1px 0 var(--line2), 0 4px 14px -10px rgba(15,27,46,.25); }
.top-brand img { width: 32px; height: 32px; }
.top-brand b { font-size: 16px; color: var(--ink); }
.top-brand span { color: var(--tx3); }
.top-branch { background: var(--bg); color: var(--tx2); border-radius: var(--rb); }
.top-branch i { color: var(--o); }
.search > i { color: var(--tx3); }
.search input { height: 40px; background: #fff; color: var(--tx); border: 1.5px solid var(--o); border-radius: var(--rb); padding-left: 40px; font-size: 13px; }
.search input::placeholder { color: var(--tx3); }
.search input:focus { background: #fff; border-color: var(--o); box-shadow: 0 0 0 4px var(--o-soft); }
.search kbd { background: var(--bg); color: var(--tx3); }
.tbtn { background: var(--bg); color: var(--tx2); border-radius: var(--rb); height: 34px; }
.tbtn:hover { background: var(--line2); color: var(--tx); }
.tbtn em { box-shadow: 0 0 0 2px #fff; }
.net { color: var(--ok); }
.who:hover, .who.open { background: var(--bg); }
.who-av { background: var(--o); color: #fff; border-radius: 50%; width: 30px; height: 30px; }
.who-txt b { color: var(--ink); font-size: 12px; } .who-txt small { color: var(--tx3); }
.who > i { color: var(--tx3); }
.clock { color: var(--tx2); }
.menu { border-radius: var(--rx); border: 0; box-shadow: var(--card-shadow), 0 24px 50px -20px rgba(10,22,40,.35); }
.menu button, .menu a { border-radius: var(--rb); }
.fkeys { background: #fff; padding: 3px 14px; }

/* Departments */
.cats { border-bottom: 0; gap: 8px; padding-bottom: 14px; }
.cats button { height: 40px; padding: 0 18px; border: 0; border-radius: var(--rb); background: #E9EDF4; color: var(--tx); font-size: 13px; font-weight: 600; }
.cats button i { display: none; }
.cats button small { color: var(--tx3); }
.cats button:hover { background: #DDE3EE; }
.cats button.on { background: var(--o); color: #fff; box-shadow: 0 6px 14px -6px var(--o-glow); }
.cats button.on small { background: rgba(255,255,255,.22); color: #fff; }

/* Product cards: no border, picture first */
.grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; padding: 2px 4px 16px 2px; }
.tile { border: 0; border-radius: var(--rx); background: #fff; box-shadow: var(--card-shadow); padding-bottom: 6px; }
.tile:hover { border: 0; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,27,46,.06), 0 14px 28px -10px rgba(15,27,46,.18); }
.tile.out { opacity: .6; }
.tile-img { flex: none; height: 124px; border-bottom: 0; background: #fff; color: inherit; position: relative; }
.tile-img::after { display: none; }
/* Pinned inside the frame so a big source photo can never push the name and price out of the card */
.tile-img img { position: absolute; inset: 10px 10px 0; width: calc(100% - 20px); height: calc(100% - 10px); padding: 0; object-fit: contain; background: transparent; }
.tile-body { padding: 8px 14px 8px; gap: 4px; }
.tile-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; min-height: 0; -webkit-line-clamp: 1; color: var(--ink); }
.tile-price { font: 800 16px var(--fb); letter-spacing: -.01em; color: var(--ink); align-items: baseline; flex-wrap: wrap; }
.tile-price small { font: 600 11px var(--fb); color: var(--tx2); }
.tile-price s { font: 500 11px var(--fb); color: var(--tx3); }
.tile-stock { font-size: 11.5px; font-weight: 600; color: var(--ok); gap: 6px; }
.tile-stock::before { width: 8px; height: 8px; }
.tile-stock.low { color: var(--warn); } .tile-stock.none { color: var(--bad); }
.tile-add { right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--o); color: #fff; font-size: 20px; box-shadow: 0 6px 14px -6px var(--o-glow); transition: transform .12s var(--ease), background .12s; }
.tile:hover .tile-add { background: var(--o2); transform: scale(1.06); }
.tile-badge { top: 10px; left: 10px; padding: 3px 8px; border-radius: 99px; font: 700 10px var(--fb); letter-spacing: .02em; background: var(--o); color: #fff; }
.tile-badge.kg { background: var(--navy); }
.tile-qty { top: 10px; right: 10px; border-radius: 99px; background: var(--ink); min-width: 22px; height: 22px; line-height: 22px; font-size: 11px; }
.grid-more button { border-radius: var(--rb); }

/* Current sale */
.line { grid-template-columns: 44px 1fr auto auto; grid-template-areas: "i n q t" "i m q x"; column-gap: 10px; padding: 10px 14px; border-left: 0; }
.line.sel { background: var(--o-soft); box-shadow: inset 3px 0 0 var(--o); }
.line-i { grid-area: i; width: 44px; height: 44px; background: #fff; border-radius: 8px; overflow: hidden; display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line2); }
.line-i { position: relative; }
.line-i img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; }
.line-n { font-size: 13px; color: var(--ink); }
.line-m { font-size: 11px; }
.line-m .d { color: var(--o2); } .line-m .d s { color: var(--tx3); font-weight: 500; }
.line-t { font: 700 13px var(--fm); }
.qty { border-radius: 8px; overflow: hidden; background: #fff; }
.qty button { width: 26px; height: 26px; }
.qty input { width: 32px; font-size: 12px; }
.line-x { color: #E5484D; border-radius: 6px; }
.sum-row.promo span, .sum-row.promo b { color: var(--o2); }
.sums { background: #fff; padding: 12px 14px 10px; }
.sum-row { font-size: 12.5px; }
.sum-row b { font-size: 12.5px; }
.sum-total { background: var(--o-soft); border-radius: var(--rb); padding: 12px 14px; margin-top: 10px; }
.sum-total span { font: 800 17px var(--fd); letter-spacing: 0; text-transform: uppercase; color: var(--o2); }
.sum-total b { font: 800 24px var(--fb); color: var(--o2); letter-spacing: -.02em; }
.cart-actions { gap: 8px; padding: 4px 14px 10px; background: #fff; border-top: 0; }
.cart-actions button { height: 44px; border-radius: var(--rb); background: var(--bg); flex-direction: row; gap: 6px; font-size: 12px; }
.cart-actions button:hover { background: var(--line2); }
.pay { margin: 0 14px 14px; height: 54px; border-radius: var(--rb); background: var(--o); box-shadow: 0 10px 20px -10px var(--o-glow); }
.pay span { font-size: 15px; }
.pay b { font-size: 16px; }
.pay:hover:not(:disabled) { background: var(--o2); }
.empty-ic { border-radius: 50%; background: var(--o-soft); color: var(--o); }

@media (min-width: 901px) {
  .main { padding: 4px 16px 16px; gap: 16px; }
  .catalog { padding: 10px 0 0; }
  .cart { width: 360px; border: 0; border-radius: var(--rx); box-shadow: var(--card-shadow); }
  .cart-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line2); }
  .cart-head h3 { font-size: 18px; }
  .cart-head h3 i { color: var(--o); font-size: 20px; }
}
@media (max-width: 900px) {
  .cart { border-radius: 20px 20px 0 0; }
  .cart-fab { border-radius: var(--rb); background: var(--o); }
}
.tag, .pill { border-radius: 99px; }
.tag-cust.set { background: var(--o-soft); color: var(--o2); border-color: transparent; }
.cats button:focus-visible, .tile:focus-visible, .pay:focus-visible { outline: 2px solid var(--o); outline-offset: 2px; }

/* ── Portions: a tile that sells a slice of a carton, sack or cut ── */
.tile-badge.pt { display: inline-flex; align-items: center; gap: 4px; background: var(--navy); color: #fff; letter-spacing: 0; }
.tile-badge.pt i { font-size: 12px; color: var(--o); }
.cats button[data-cat="portions"]:not(.on) { background: var(--o-soft); color: var(--o2); }
.cats button[data-cat="portions"] i { display: inline-block; margin-right: 5px; font-size: 14px; }
.cats button[data-cat="portions"].on i { color: #fff; }

/* ── Two product rows only; the customer bill takes the space below ── */
.catalog .grid { flex: none; max-height: 282px; min-height: 0; }
@media (max-width: 900px) { .catalog .grid { max-height: 240px; } }
.brk { flex: 1; min-height: 120px; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); margin: 4px 2px 10px 0; }
.brk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; border-bottom: 2px solid var(--navy2); font-size: 12px; }
.brk-head i { color: var(--navy2); }
.brk-momo { font-size: 11px; color: var(--tx2); }
.brk-momo code { font: 700 13px var(--fm); background: #FFF3EB; color: #C2410C; padding: 2px 7px; margin-left: 4px; }
.brk-scroll { flex: 1; min-height: 0; overflow: auto; }
.brk-t { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.brk-t th { position: sticky; top: 0; background: #f6f8fb; text-align: left; font: 700 9.5px var(--fb); text-transform: uppercase; letter-spacing: .05em; color: var(--tx3); padding: 5px 10px; }
.brk-t td { padding: 5px 10px; border-bottom: 1px solid var(--line2); }
.brk-t .r { text-align: right; font-family: var(--fm); white-space: nowrap; }
.brk-empty { text-align: center; color: var(--tx3); padding: 18px 10px !important; font-family: var(--fb); }
.brk-tx { font: 700 9px var(--fm); font-style: normal; padding: 1px 5px; margin-left: 4px; }
.brk-b { background: #FFF3EB; color: #C2410C; } .brk-a { background: #E8F5EE; color: #15803d; }
.brk-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--tx2); }
.brk-foot div { display: flex; gap: 6px; align-items: baseline; } .brk-foot b { font-family: var(--fm); color: var(--navy2); }
.brk-foot .brk-total { margin-left: auto; font-size: 13px; } .brk-foot .brk-total b { font-size: 15px; color: #C2410C; }
@media (max-width: 760px) { .brk { display: none; } } /* phones: the cart drawer already shows it */

/* ============================================================
   COMPACT TILL (final layer): small category buttons that match the
   F-key bar, small product cards so many are visible at once, and a
   customer bill that starts folded at the bottom. Remove this block to
   go back to the larger design.
   ============================================================ */
.top { height: 52px; }
.top-brand img { width: 28px; height: 28px; } .top-brand b { font-size: 15px; }
.search input { height: 34px; font-size: 12.5px; }
.tbtn { height: 30px; }
.fkeys { padding: 2px 14px; }

/* Departments: same size as the F-key buttons */
.cats { gap: 4px; padding-bottom: 7px; }
.cats button { height: 22px; padding: 0 9px; font-size: 10.5px; font-weight: 600; border-radius: 6px; gap: 4px; }
.cats button small { font: 700 9px var(--fm); }
.cats button.on { box-shadow: none; }
.cats button[data-cat="portions"] i { font-size: 11px; margin-right: 3px; }

/* Products: many small cards */
.grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; padding: 2px 4px 10px 2px; }
.catalog .grid { flex: 1; max-height: none; min-height: 0; }
.tile { border-radius: 10px; padding-bottom: 0; box-shadow: 0 1px 2px rgba(15,27,46,.06), 0 3px 10px -6px rgba(15,27,46,.14); }
.tile:hover { transform: translateY(-1px); }
.tile-img { height: 68px; }
.tile-img img { inset: 6px 6px 0; width: calc(100% - 12px); height: calc(100% - 6px); }
.tile-body { padding: 5px 8px 7px; gap: 2px; }
.tile-name { font-size: 11px; line-height: 1.25; min-height: 28px; -webkit-line-clamp: 2; }
.tile-price { font: 800 12.5px var(--fb); }
.tile-price small { font-size: 9px; } .tile-price s { font-size: 9.5px; }
.tile-stock { font-size: 9.5px; gap: 4px; padding-right: 24px; } .tile-stock::before { width: 6px; height: 6px; }
.tile-add { right: 6px; bottom: 6px; width: 22px; height: 22px; font-size: 14px; box-shadow: none; }
.tile-badge { top: 5px; left: 5px; padding: 1px 6px; font-size: 8.5px; }
.tile-qty { top: 5px; right: 5px; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; }

/* Customer bill: folded bar at the bottom, opens on click */
.brk { flex: none; min-height: 0; margin: 4px 2px 8px 0; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(15,27,46,.06), 0 3px 10px -6px rgba(15,27,46,.14); }
.brk-head { cursor: pointer; user-select: none; height: 34px; padding: 0 12px; border-bottom: 0; gap: 10px; }
.brk-head:hover { background: var(--panel); }
.brk-head b { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.brk-sum { margin-left: auto; font: 600 11px var(--fm); color: var(--tx2); white-space: nowrap; }
.brk-sum b { display: inline; font-size: 12.5px; color: var(--o2); }
.brk-chev { font-size: 18px; color: var(--navy2); transition: transform .2s var(--ease); }
.brk-scroll, .brk-foot { display: none; }
.brk.open { height: 40vh; min-height: 190px; max-height: 360px; }
.brk.open .brk-head { border-bottom: 2px solid var(--navy2); }
.brk.open .brk-chev { transform: rotate(180deg); }
.brk.open .brk-scroll { display: block; }
.brk.open .brk-foot { display: flex; }

/* Current sale panel: lighter, same scale */
.cart-head h3 { font-size: 15px; } .cart-head h3 i { font-size: 17px; }
.line { grid-template-columns: 36px 1fr auto auto; padding: 7px 12px; }
.line-i { width: 36px; height: 36px; }
.line-n, .line-t { font-size: 12px; }
.sum-total { padding: 8px 12px; margin-top: 6px; }
.sum-total span { font-size: 14px; } .sum-total b { font-size: 20px; }
.cart-actions button { height: 36px; }
.pay { height: 46px; margin: 0 14px 12px; }
@media (min-width: 901px) {
  .main { padding: 2px 12px 8px; gap: 12px; }
  .catalog { padding: 6px 0 0; }
  .cart { width: 340px; }
  .cart-head { padding: 10px 14px 8px; }
}
