/* =========================================================
   Baghal Market — point of sale (POS) & invoice printing
   ========================================================= */

.pos-body {
  background:
    radial-gradient(900px 420px at 88% -10%, #efe6ff 0%, rgba(239, 230, 255, 0) 70%),
    radial-gradient(700px 360px at 4% 2%, #fff0dd 0%, rgba(255, 240, 221, 0) 72%),
    #f7f5fc;
  min-height: 100vh;
}

/* ---------- top bar ---------- */
.pos-top {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 26px;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.pos-brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.pos-brand-text strong { display: block; font-size: 19px; font-weight: 900; line-height: 1.35; letter-spacing: -.3px; }
.pos-brand-text small { display: block; font-size: 9px; color: var(--muted); font-weight: 600; }
.pos-top-meta { display: flex; align-items: center; gap: 8px; margin-inline-start: 6px; }
.pos-status {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-bg); color: #0d6d47; border-radius: 999px;
  padding: 4px 11px; font-size: 10px; font-weight: 800; white-space: nowrap;
}
.pos-status i { width: 7px; height: 7px; border-radius: 50%; background: #18a56c; box-shadow: 0 0 0 3px rgba(24, 165, 108, .15); }
.pos-status.is-closed { background: var(--warn-bg); color: #8a5d0e; }
.pos-status.is-closed i { background: #d19427; box-shadow: 0 0 0 3px rgba(209, 148, 39, .16); }
.pos-status.is-paused { background: #f1edf8; color: #5d5273; }
.pos-status.is-paused i { background: #8b819d; box-shadow: 0 0 0 3px rgba(139, 129, 157, .16); }
.pos-clock { font-size: 10.5px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.pos-top-actions { display: flex; align-items: center; gap: 7px; margin-inline-start: auto; }
.pos-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); box-shadow: var(--shadow-sm); transition: .18s;
}
.pos-icon-btn:hover { border-color: #d8ccf1; color: var(--brand); transform: translateY(-1px); }
.pos-icon-btn .ic { width: 18px; height: 18px; }
.pos-icon-btn.has-new { background: var(--accent-soft); border-color: #ffd7c6; color: var(--accent-2); }
.pos-bell-badge {
  position: absolute; top: -4px; left: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center; background: var(--accent-2); color: #fff;
  border-radius: 999px; font-size: 9px; font-weight: 900; font-style: normal;
  box-shadow: 0 0 0 2px #fff;
}
.pos-link {
  display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff;
  font-size: 10.5px; font-weight: 700; color: var(--ink-2); box-shadow: var(--shadow-sm);
  transition: .18s;
}
.pos-link:hover { border-color: #d8ccf1; color: var(--brand); }
.pos-link .ic { width: 16px; height: 16px; color: var(--brand); }

/* ---------- layout ---------- */
.pos-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 392px;
  gap: 18px; align-items: start;
  width: 100%; max-width: 1480px; margin-inline: auto;
  padding: 20px 26px 0;
}
.pos-catalog { min-width: 0; }
.pos-catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pos-catalog-head h1 { font-size: 25px; font-weight: 900; letter-spacing: -.6px; line-height: 1.35; }
.pos-catalog-head p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.pos-tools { display: flex; align-items: center; gap: 9px; }
.pos-search {
  display: flex; align-items: center; gap: 8px; width: 290px; height: 44px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s;
}
.pos-search:focus-within { border-color: #b9a2f3; box-shadow: 0 0 0 4px rgba(122, 87, 238, .12); }
.pos-search > span .ic { width: 17px; height: 17px; color: var(--muted); }
.pos-search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 11.5px; font-weight: 600; }
.pos-search input::placeholder { color: var(--muted-2); }
.pos-search button { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.pos-search button:hover { background: var(--surface-2); color: var(--ink); }
.pos-search button .ic { width: 13px; height: 13px; }
.pos-count { font-size: 10px; font-weight: 800; color: var(--brand); background: var(--brand-3); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }

/* categories */
.pos-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 9px; scrollbar-width: thin; }
.pos-cat {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 700; color: var(--text); transition: .16s; white-space: nowrap;
}
.pos-cat span { font-size: 13px; line-height: 1; }
.pos-cat small { font-size: 8.5px; color: var(--muted-2); }
.pos-cat:hover { border-color: #cdbcf2; color: var(--brand); }
.pos-cat.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(91, 50, 214, .22); }
.pos-cat.is-active small { color: #ded3ff; }

/* product grid */
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }
.pos-product {
  position: relative; display: flex; flex-direction: column; gap: 6px; text-align: right;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px;
  box-shadow: var(--shadow-sm); transition: transform .16s var(--ease), box-shadow .16s, border-color .16s;
  min-width: 0; min-height: 158px;
}
.pos-product:hover { transform: translateY(-2px); border-color: #d8c9f6; box-shadow: var(--shadow-md); }
.pos-product:active { transform: scale(.985); }
.pos-product.is-out { opacity: .55; filter: grayscale(.4); cursor: not-allowed; }
.pos-product.is-in-cart { border-color: #b79bf5; background: #fcfaff; box-shadow: 0 0 0 2px rgba(123, 88, 238, .12); }
.pos-prod-art {
  position: relative; display: grid; place-items: center; height: 62px; border-radius: 12px;
  font-size: 30px; line-height: 1; overflow: hidden;
}
.pos-prod-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.pos-prod-name { font-size: 11px; font-weight: 800; line-height: 1.6; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-prod-unit { font-size: 8.5px; color: var(--muted); line-height: 1.5; margin-top: -2px; }
.pos-prod-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: auto; }
.pos-prod-price { display: flex; flex-direction: column; line-height: 1.4; }
.pos-prod-price b { font-size: 11.5px; font-weight: 900; color: var(--ink); }
.pos-prod-price small { font-size: 8px; color: var(--muted); font-weight: 600; }
.pos-add {
  width: 27px; height: 27px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-3); color: var(--brand); transition: .16s;
}
.pos-add:hover { background: var(--brand); color: #fff; }
.pos-add .ic { width: 15px; height: 15px; }
.pos-product.is-in-cart .pos-add { background: linear-gradient(135deg, #ff9a44, #ff5c39); color: #fff; }
.pos-qty-badge {
  position: absolute; top: 6px; left: 6px; min-width: 21px; height: 21px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 8px; background: var(--brand); color: #fff;
  font-size: 9.5px; font-weight: 900; box-shadow: 0 4px 10px rgba(91, 50, 214, .28);
}
.pos-stock { position: absolute; top: 7px; right: 7px; font-size: 7.5px; font-weight: 800; color: var(--muted); background: rgba(255, 255, 255, .82); border-radius: 999px; padding: 2px 5px; }
.pos-stock.low { color: #b06a05; background: #fff4dd; }
.pos-empty { text-align: center; padding: 60px 20px; background: #fff; border: 1px dashed var(--line); border-radius: 22px; }
.pos-empty-emoji { font-size: 40px; display: block; margin-bottom: 8px; }
.pos-empty h3 { font-size: 15px; font-weight: 900; }
.pos-empty p { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- cart panel ---------- */
.pos-cart {
  position: sticky; top: 76px; display: flex; flex-direction: column;
  max-height: calc(100vh - 92px);
  background: #fff; border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 18px 46px rgba(45, 27, 93, .09); overflow: hidden;
}
.pos-cart-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 16px 13px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fbf8ff, #fff);
}
.pos-cart-head h2 { font-size: 16px; font-weight: 900; letter-spacing: -.3px; }
.pos-cart-head h2 small { font-size: 9.5px; font-weight: 700; color: var(--muted); margin-inline-start: 6px; }
.pos-trash { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); border: 1px solid transparent; }
.pos-trash:hover:not(:disabled) { background: var(--red-bg); color: var(--red); border-color: #f6d3d9; }
.pos-trash:disabled { opacity: .35; cursor: not-allowed; }
.pos-trash .ic { width: 17px; height: 17px; }
.pos-cart-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 4px; scrollbar-width: thin; }

.pos-cart-list { display: grid; gap: 7px; }
.pos-cart-empty { text-align: center; padding: 26px 16px 24px; border: 1px dashed var(--line); border-radius: 16px; background: var(--surface-2); margin-bottom: 4px; }
.pos-cart-empty span { font-size: 30px; display: block; margin-bottom: 6px; opacity: .8; }
.pos-cart-empty b { display: block; font-size: 12px; font-weight: 900; }
.pos-cart-empty small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 2px; line-height: 1.8; }
.pos-line {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 7px 8px; border: 1px solid var(--line-2); border-radius: 13px; background: #fff;
}
.pos-line-art { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; overflow: hidden; }
.pos-line-art img { width: 100%; height: 100%; object-fit: cover; }
.pos-line-main { min-width: 0; }
.pos-line-main b { display: block; font-size: 10.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-line-main small { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.pos-line-main small b { display: inline; font-size: 8.5px; color: var(--ink-2); font-weight: 800; }
.pos-line-side { display: flex; align-items: center; gap: 5px; }
.pos-stepper { display: inline-flex; align-items: center; gap: 1px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; }
.pos-stepper button { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--brand); background: #fff; border: 1px solid var(--line-2); }
.pos-stepper button:hover { background: var(--brand-3); }
.pos-stepper button .ic { width: 11px; height: 11px; }
.pos-stepper span { min-width: 19px; text-align: center; font-size: 10px; font-weight: 900; }
.pos-remove { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted-2); }
.pos-remove:hover { background: var(--red-bg); color: var(--red); }
.pos-remove .ic { width: 12px; height: 12px; }

.pos-fields { display: grid; gap: 8px; padding: 12px 0 0; }
.pos-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-cart .field { gap: 4px; font-size: 10px; }
.pos-cart .field input, .pos-cart .field select { min-height: 38px; padding: 7px 10px; font-size: 11px; border-radius: 10px; }
.pos-block { margin-top: 13px; }
.pos-block-title { display: block; font-size: 10px; font-weight: 800; color: var(--ink-2); margin-bottom: 6px; }
.pos-segment { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; }
.pos-segment.three { grid-template-columns: repeat(3, 1fr); }
.pos-segment button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 4px 6px; border-radius: 9px; font-size: 9.5px; font-weight: 800; color: var(--muted); transition: .16s; }
.pos-segment button .ic { width: 14px; height: 14px; }
.pos-segment button:hover { color: var(--ink); }
.pos-segment button.is-active { background: #fff; color: var(--brand); box-shadow: 0 3px 9px rgba(45, 27, 93, .1); }
.pos-money { display: grid; gap: 7px; }
.pos-line-input { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 11px; padding: 4px 9px; background: #fff; }
.pos-line-input span { font-size: 9.5px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.pos-line-input input { width: 116px; border: 0; outline: 0; text-align: left; background: none; font-size: 11px; font-weight: 800; padding: 6px 0; }
.pos-chips { display: flex; gap: 4px; }
.pos-chips button { flex: 1; min-height: 29px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 9px; font-weight: 800; color: var(--muted); transition: .16s; }
.pos-chips button:hover { border-color: #cdbcf2; color: var(--brand); }
.pos-chips button.is-active { background: var(--brand-3); border-color: #d9c9ff; color: var(--brand); }
.pos-error { margin-top: 9px; font-size: 9.5px; font-weight: 700; color: #a52d3c; background: var(--red-bg); border: 1px solid #f6d3d9; border-radius: 10px; padding: 7px 9px; display: flex; gap: 5px; }
.pos-error .ic { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }

.pos-cart-foot { border-top: 1px dashed var(--line); padding: 11px 14px 13px; background: #fff; }
.pos-totals { display: grid; gap: 4px; font-size: 10px; }
.pos-totals > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
.pos-totals dt { font-weight: 600; }
.pos-totals dd { margin: 0; font-weight: 800; color: var(--ink-2); }
.pos-totals .neg { color: var(--red); }
.pos-grand { margin-top: 5px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pos-grand dt { font-size: 11px; font-weight: 900; color: var(--ink); }
.pos-grand dd { font-size: 17px; font-weight: 900; color: var(--ink); letter-spacing: -.4px; }
.pos-pay-actions { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 9px; }
.pos-submit { min-height: 45px; justify-content: center; font-size: 12px; border-radius: 13px; }
.pos-submit-quiet { min-height: 36px; justify-content: center; font-size: 10px; border-radius: 10px; box-shadow: none; }
.pos-submit-quiet:hover { box-shadow: var(--shadow-sm); }
.pos-hint { text-align: center; font-size: 8.5px; color: var(--muted-2); margin-top: 7px; }
kbd { font-family: inherit; font-size: 8px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 4px; color: var(--ink-2); }

/* ---------- recent sales ---------- */
.pos-recent { max-width: 1480px; margin: 18px auto 40px; padding: 0 26px; }
.pos-recent-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pos-recent-head h2 { font-size: 16px; font-weight: 900; letter-spacing: -.3px; }
.pos-recent-count { font-size: 9.5px; color: var(--muted); font-weight: 700; }
.pos-recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 8px; }
.pos-sale {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm);
  text-align: right; min-width: 0;
}
.pos-sale-orb { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; background: var(--brand-3); color: var(--brand); }
.pos-sale-orb .ic { width: 17px; height: 17px; }
.pos-sale-main { flex: 1; min-width: 0; }
.pos-sale-main b { display: block; font-size: 10.5px; font-weight: 850; }
.pos-sale-main small { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-sale-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.pos-sale-actions button { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); border: 1px solid var(--line-2); }
.pos-sale-actions button:hover { background: var(--brand-3); }
.pos-sale-actions .ic { width: 14px; height: 14px; }
.pos-recent-empty { grid-column: 1 / -1; padding: 18px; text-align: center; font-size: 10.5px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 14px; }

/* ---------- drawer ---------- */
.pos-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(28, 14, 58, .35); backdrop-filter: blur(3px); animation: fadeIn .2s; }
.pos-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; width: min(392px, 100vw);
  display: flex; flex-direction: column; background: #fff;
  border-right: 1px solid var(--line); box-shadow: 30px 0 70px rgba(35, 18, 78, .2);
  animation: slideIn .28s var(--ease);
}
@keyframes slideIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pos-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 17px 16px 12px; border-bottom: 1px solid var(--line-2); }
.pos-drawer-head h2 { font-size: 17px; font-weight: 900; letter-spacing: -.3px; }
.pos-drawer-note { font-size: 9.5px; color: var(--muted); padding: 9px 16px 0; line-height: 1.8; }
.pos-drawer-list { flex: 1; overflow-y: auto; padding: 12px 14px 20px; display: grid; gap: 8px; align-content: start; }
.pos-pending { border: 1px solid #ffd9ca; background: #fff8f4; border-radius: 14px; padding: 10px; }
.pos-pending-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pos-pending-head b { font-size: 11px; font-weight: 900; }
.pos-pending-head small { font-size: 8.5px; color: var(--muted); }
.pos-pending-meta { font-size: 9.5px; color: var(--ink-2); line-height: 1.8; margin-top: 4px; }
.pos-pending-meta span { color: var(--muted); }
.pos-pending-items { font-size: 8.5px; color: var(--muted); margin-top: 3px; line-height: 1.8; }
.pos-pending-actions { display: flex; gap: 5px; margin-top: 8px; }
.pos-pending-actions .btn { flex: 1; justify-content: center; min-height: 33px; padding: 5px 8px; font-size: 9.5px; border-radius: 9px; }
.pos-pending-empty { text-align: center; padding: 34px 12px; color: var(--muted); font-size: 10.5px; }
.pos-pending-empty .ic { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--brand); display: block; }

/* ---------- alerts ---------- */
.pos-alerts {
  position: fixed; left: 18px; bottom: 18px; z-index: 120;
  display: flex; flex-direction: column; gap: 9px; width: min(350px, calc(100vw - 24px));
  pointer-events: none;
}
.pos-alert {
  pointer-events: auto; position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 9px;
  padding: 12px 12px 11px; background: #fff; border: 1px solid #ffd9ca; border-right: 4px solid var(--accent-2);
  border-radius: 15px; box-shadow: 0 18px 42px rgba(50, 22, 90, .2);
  animation: alertIn .32s var(--ease);
}
@keyframes alertIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.pos-alert-orb { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.pos-alert-orb .ic { width: 20px; height: 20px; }
.pos-alert-main b { display: block; font-size: 11.5px; font-weight: 900; }
.pos-alert-main small { display: block; font-size: 9px; color: var(--muted); margin-top: 1px; line-height: 1.7; }
.pos-alert-actions { grid-column: 1 / -1; display: flex; gap: 5px; }
.pos-alert-actions .btn { min-height: 32px; padding: 5px 9px; font-size: 9.5px; flex: 1; justify-content: center; }
.pos-alert-close { position: absolute; top: 5px; left: 5px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); }
.pos-alert-close:hover { background: var(--surface-2); color: var(--ink); }
.pos-alert-close .ic { width: 12px; height: 12px; }

/* ---------- modals ---------- */
.pos-modal {
  position: fixed; inset: 0; z-index: 140; display: grid; place-items: center;
  padding: 20px; background: rgba(24, 12, 52, .46); backdrop-filter: blur(5px);
  overflow-y: auto; animation: fadeIn .18s;
}
.pos-modal-card {
  width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; border-radius: 24px; box-shadow: 0 34px 90px rgba(24, 10, 60, .32);
  padding: 18px; animation: modalIn .26s var(--ease);
}
.pos-modal-sm { width: min(400px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.pos-success-head, .pos-modal-head { display: flex; align-items: flex-start; gap: 10px; }
.pos-success-head > div, .pos-modal-head > div { flex: 1; min-width: 0; }
.pos-success-head h2, .pos-modal-head h2 { font-size: 18px; font-weight: 900; letter-spacing: -.3px; }
.pos-success-head p, .pos-modal-head p { font-size: 9.5px; color: var(--muted); margin-top: 2px; line-height: 1.7; }
.pos-success-orb { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center; background: var(--green-bg); color: var(--green); }
.pos-success-orb .ic { width: 24px; height: 24px; }
.pos-receipt-preview {
  margin-top: 13px; padding: 12px; border-radius: 16px; background: #faf8ff;
  border: 1px dashed #ded3f3; max-height: 46vh; overflow: auto;
}
.pos-receipt-preview .receipt { margin: 0 auto; padding: 10px; background: #fff; border-radius: 6px; box-shadow: 0 4px 18px rgba(35, 18, 78, .07); }
.pos-modal-foot { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.pos-modal-foot .btn { flex: 1; justify-content: center; min-height: 42px; font-size: 11px; }
.pos-modal-foot .btn.ghost { flex: 0 1 auto; }
.pos-settings { display: grid; gap: 9px; margin-top: 12px; }
.pos-settings .field { font-size: 10px; }
.pos-settings .check-row { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .pos-shell { grid-template-columns: minmax(0, 1fr) 356px; padding-inline: 20px; }
  .pos-recent { padding-inline: 20px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(137px, 1fr)); }
}
@media (max-width: 1000px) {
  .pos-top { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .pos-top-meta { margin-inline-start: auto; order: 2; }
  .pos-top-actions { order: 3; width: 100%; justify-content: flex-end; }
  .pos-shell { grid-template-columns: 1fr; padding: 16px 16px 0; }
  .pos-recent { padding-inline: 16px; }
  .pos-cart { position: static; max-height: none; }
  .pos-cart-scroll { display: grid; grid-template-columns: 1.25fr .75fr; gap: 0 16px; overflow: visible; }
  .pos-cart-list { grid-column: 1; }
  .pos-fields { grid-column: 1; }
  .pos-block { grid-column: 2; margin-top: 10px; }
  .pos-money { grid-column: 2; }
  .pos-error { grid-column: 1 / -1; }
  .pos-cart-foot { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: end; }
  .pos-hint { display: none; }
  .pos-pay-actions { margin-top: 0; }
  .pos-grand dd { font-size: 19px; }
}
@media (max-width: 760px) {
  .pos-brand-text small { display: none; }
  .pos-catalog-head h1 { font-size: 21px; }
  .pos-catalog-head p { display: none; }
  .pos-tools { width: 100%; }
  .pos-search { width: auto; flex: 1; height: 42px; }
  .pos-count { align-self: center; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-product { min-height: 146px; }
  .pos-cart-scroll { display: block; }
  .pos-cart-foot { display: block; }
  .pos-pay-actions { grid-template-columns: 1fr; }
  .pos-recent-list { grid-template-columns: 1fr; }
  .pos-clock { display: none; }
  .pos-status { font-size: 9px; padding: 3px 8px; }
  .pos-drawer { width: min(360px, 96vw); }
}
@media (max-width: 520px) {
  .pos-top { padding: 9px 12px; }
  .pos-brand-text strong { font-size: 17px; }
  .pos-link span:last-child { display: none; }
  .pos-link { width: 38px; padding: 0; justify-content: center; }
  .pos-shell { padding: 12px 12px 0; }
  .pos-recent { padding-inline: 12px; }
  .pos-grid { gap: 7px; }
  .pos-product { padding: 8px; min-height: 140px; border-radius: 14px; }
  .pos-prod-art { height: 54px; font-size: 26px; }
  .pos-prod-price b { font-size: 10.5px; }
  .pos-modal { padding: 10px; }
  .pos-modal-card { padding: 14px; border-radius: 20px; }
  .pos-alerts { left: 10px; right: 10px; width: auto; bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .pos-alert, .pos-modal, .pos-drawer { animation: none; }
}

/* ---------- saved customers & loyalty ---------- */
.pos-cust-results {
  margin-top: 7px; border: 1px solid var(--line); border-radius: 13px; background: #fff;
  box-shadow: var(--shadow-sm); overflow: hidden; max-height: 232px; overflow-y: auto;
}
.pos-cust-hint { display: block; padding: 7px 11px 5px; font-size: 8.5px; font-weight: 800; color: var(--muted-2); background: var(--surface-2); }
.pos-cust-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: right;
  padding: 8px 10px; background: #fff; border: 0; border-top: 1px solid var(--line-2); cursor: pointer;
}
.pos-cust-item:first-of-type { border-top: 0; }
.pos-cust-item:hover { background: var(--surface-2); }
.pos-cust-av {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  font-size: 12px; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--brand), #8a63ef);
}
.pos-cust-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pos-cust-info b { font-size: 11px; font-weight: 800; color: var(--ink); }
.pos-cust-info small { font-size: 9px; color: var(--muted); direction: ltr; text-align: right; }
.pos-cust-tag { flex: 0 0 auto; font-size: 8px; font-weight: 800; padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.pos-cust-member {
  margin-top: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid #e2d9fb; background: #f6f2ff; border-radius: 13px;
}
.pos-member-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.pos-member-badge svg { width: 12px; height: 12px; }
.pos-member-pts { font-size: 9.5px; font-weight: 700; color: var(--ink-2); }
.pos-member-deal { display: inline-flex; align-items: center; gap: 4px; flex-basis: 100%; font-size: 9px; font-weight: 700; color: #1c8a52; }
.pos-member-deal svg { width: 12px; height: 12px; }
.pos-member-deal b { font-weight: 900; }
.pos-member-clear { margin-inline-start: auto; font-size: 9px; font-weight: 800; color: var(--muted); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.pos-member-clear:hover { color: var(--danger, #d33); }
.pos-loyalty-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px;
  border: 1px dashed #cbb8f5; border-radius: 11px; background: #faf7ff; cursor: pointer;
}
.pos-loyalty-row input { width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; }
.pos-loyalty-row span { font-size: 9.5px; font-weight: 700; color: var(--ink-2); }
.pos-loyalty-row b { color: var(--brand); }
.pos-loyalty-row small { font-size: 8.5px; color: var(--muted); }
.pos-cat-sep { width: 1px; align-self: stretch; margin: 4px 3px; background: var(--line); flex: 0 0 auto; }
.pos-cat.is-sub { font-size: 9px; padding: 6px 10px; border-style: dashed; }
.pos-cat.is-sub small { display: none; }

/* =========================================================
   Vibrancy, live counts & online-order alarm (Nov 2026)
   ========================================================= */

/* richer shop backdrop */
.pos-body {
  background:
    radial-gradient(1100px 520px at 94% -8%, #ffe4cf 0%, rgba(255, 228, 207, 0) 66%),
    radial-gradient(880px 460px at 0% 0%, #ebe1ff 0%, rgba(235, 225, 255, 0) 70%),
    radial-gradient(760px 520px at 60% 120%, #e3f7ee 0%, rgba(227, 247, 238, 0) 70%),
    linear-gradient(180deg, #faf8ff 0%, #f3f0fb 100%);
}

/* top bar: lively gradient line + gradient wordmark */
.pos-top {
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #ff8b35 0%, #ff5b37 28%, #7b58ee 66%, #5b32d6 100%) 1;
}
.pos-brand-text strong {
  background: linear-gradient(90deg, #5b32d6 0%, #8a63ef 55%, #ff6a3d 115%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.pos-icon-btn.has-new { animation: bellPulse 1.4s ease-in-out infinite; }
@keyframes bellPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 91, 55, .34); }
  50% { box-shadow: 0 0 0 8px rgba(255, 91, 55, 0); }
}

/* section headings with a hint of colour */
.pos-catalog-head h1 {
  background: linear-gradient(90deg, #5b32d6 0%, #8a63ef 55%, #ff6a3d 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* category chips: each department wears its own colour */
.pos-cat { transition: transform .16s var(--ease), background .16s, border-color .16s, color .16s, box-shadow .16s; }
.pos-cat:hover { transform: translateY(-1px); }
.pos-cat.is-all { border-inline-start: 3px solid var(--chip, #5b32d6); }
.pos-cat:not(.is-all) { border-inline-start: 3px solid var(--chip, #7c3aed); }
.pos-cat.is-sub { border-inline-start-style: dotted; }
.pos-cat.is-active {
  border-color: transparent; color: #fff;
  background: var(--chip);
  background: linear-gradient(135deg, var(--chip), color-mix(in srgb, var(--chip) 72%, #1b1033 28%));
  box-shadow: 0 10px 22px rgba(60, 30, 120, .18);
}
.pos-cat.is-active small { color: rgba(255, 255, 255, .85); }

/* product cards feel richer; the added quantity is big and obvious */
.pos-product { background: linear-gradient(180deg, #ffffff 0%, #fdfbff 100%); }
.pos-product:hover { border-color: #c9b4f6; }
.pos-product.is-in-cart { background: linear-gradient(180deg, #ffffff 0%, #f6f0ff 100%); border-color: #9f7cf0; }
.pos-prod-art { z-index: 0; }
.pos-stock { z-index: 4; }
.pos-qty-badge {
  z-index: 6;
  top: 8px; left: 8px; min-width: 27px; height: 27px; padding: 0 7px;
  border-radius: 10px; font-size: 12.5px; letter-spacing: -.2px;
  background: linear-gradient(135deg, #34d17a, #12a05a);
  box-shadow: 0 6px 15px rgba(18, 160, 90, .42), 0 0 0 3px rgba(255, 255, 255, .82);
  transform: none;
}
@keyframes qtyPop { from { transform: scale(.55); } to { transform: scale(1); } }

/* cart panel warmth */
.pos-cart { border-color: #e7ddf7; box-shadow: 0 18px 46px rgba(76, 45, 148, .10); }
.pos-cart-head { background: linear-gradient(135deg, #eefaf3 0%, #f3edff 52%, #fff5ec 100%); }
.pos-cart-head h2 small { color: #5b32d6; background: #efe7ff; border-radius: 999px; padding: 3px 9px; }
.pos-block-title { padding-inline-start: 8px; border-inline-start: 3px solid #b79bf5; line-height: 1.2; }
.pos-segment button.is-active { background: linear-gradient(135deg, #ffffff, #f7f1ff); color: #5b32d6; }

/* item counters in the footer */
.pos-cart-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pos-stat {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 800; color: #5b32d6;
  background: #f1ebff; border: 1px solid #e2d6ff; border-radius: 999px; padding: 4px 10px;
}
.pos-stat b { font-size: 12px; font-weight: 900; }
.pos-stat.is-orange { color: #c2410c; background: #fff1e8; border-color: #ffd9c7; }
.pos-stat.is-green { color: #0d6d47; background: #e9fbf2; border-color: #c4f0dc; margin-inline-start: auto; }

/* total pill — money in fresh green */
.pos-grand {
  margin-top: 8px; padding: 9px 11px; border: 1px solid #cdebdb; border-radius: 14px;
  background: linear-gradient(135deg, #eafaf1 0%, #f3fff9 100%);
}
.pos-grand dt { color: #14503a; }
.pos-grand dd { color: #0d7a4e; }

/* louder primary action */
.pos-submit { background: linear-gradient(135deg, #ff9a44 0%, #ff5b37 100%) !important; border-color: transparent !important; box-shadow: 0 10px 24px rgba(255, 91, 55, .34) !important; }
.pos-submit:hover { filter: brightness(1.03); }

/* ---------- live online-order banner ---------- */
.pos-neworder {
  position: sticky; top: 66px; z-index: 58;
  display: flex; align-items: center; gap: 10px;
  margin: 10px 26px 0; padding: 10px 13px;
  color: #fff; border-radius: 16px;
  background: linear-gradient(120deg, #ff8b35 0%, #ff5b37 58%, #e0412a 100%);
  box-shadow: 0 16px 36px rgba(255, 91, 55, .34);
  animation: bannerIn .32s var(--ease), bannerGlow 2.2s ease-in-out infinite;
}
@keyframes bannerIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes bannerGlow {
  0%, 100% { box-shadow: 0 16px 36px rgba(255, 91, 55, .30); }
  50% { box-shadow: 0 16px 44px rgba(255, 91, 55, .55); }
}
.pos-neworder-orb {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; background: rgba(255, 255, 255, .18);
  animation: bellShake 1.1s ease-in-out infinite;
}
.pos-neworder-orb .ic { width: 20px; height: 20px; }
@keyframes bellShake {
  0%, 70%, 100% { transform: rotate(0); }
  75% { transform: rotate(-14deg); }
  82% { transform: rotate(12deg); }
  89% { transform: rotate(-7deg); }
}
.pos-neworder-main { flex: 1; min-width: 0; line-height: 1.5; }
.pos-neworder-main b { display: block; font-size: 12.5px; font-weight: 900; }
.pos-neworder-main small { display: block; font-size: 9.5px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-neworder-btn { flex: 0 0 auto; min-height: 34px; padding: 6px 14px; border-radius: 10px; background: #fff !important; color: #d63c1f !important; border: 0 !important; box-shadow: none !important; }
.pos-neworder-x { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .18); }
.pos-neworder-x:hover { background: rgba(255, 255, 255, .3); }
.pos-neworder-x .ic { width: 14px; height: 14px; }

@media (max-width: 1000px) {
  .pos-neworder { top: 112px; margin-inline: 16px; }
}
@media (max-width: 520px) {
  .pos-neworder { top: 104px; margin-inline: 12px; border-radius: 14px; }
  .pos-neworder-main small { font-size: 8.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .pos-neworder, .pos-neworder-orb, .pos-icon-btn.has-new, .pos-qty-badge { animation: none !important; }
}

/* =========================================================
   POS: fixed checkout, compact head, square product art
   (Nov 2026 — cashier never loses the form)
   ========================================================= */

/* compact cart header */
.pos-cart-head { padding: 7px 14px; }
.pos-cart-head .eyebrow { font-size: 8px; letter-spacing: .02em; }
.pos-cart-head h2 { font-size: 14px; }
.pos-cart-head h2 small { font-size: 8.5px; padding: 2px 7px; }

/* cart = compact head / scrolling item list / fixed checkout / fixed foot */
.pos-cart { height: calc(100vh - 92px); max-height: calc(100vh - 92px); }
.pos-cart-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 12px; }

.pos-cart-checkout {
  flex: 0 0 auto; padding: 7px 12px 6px;
  border-top: 1px dashed var(--line); background: #fff;
}

/* tighter, aligned form controls */
.pos-cart-checkout .pos-fields { padding: 0; gap: 6px; }
.pos-cart-checkout .pos-field-grid { gap: 6px; }
.pos-cart .field { font-size: 9px; gap: 3px; }
.pos-cart .field input, .pos-cart .field select { min-height: 32px; padding: 5px 9px; font-size: 10.5px; border-radius: 9px; }
.pos-cart-checkout .pos-block { margin-top: 7px; }
.pos-cart-checkout .pos-block-title { margin-bottom: 4px; font-size: 9px; }
.pos-cart-checkout .pos-segment { padding: 3px; border-radius: 10px; }
.pos-cart-checkout .pos-segment button { min-height: 28px; font-size: 9px; }
.pos-cart-checkout .pos-money { gap: 5px; }
.pos-cart-checkout .pos-line-input { padding: 3px 9px; border-radius: 9px; }
.pos-cart-checkout .pos-line-input input { padding: 4px 0; font-size: 10.5px; }
.pos-cart-checkout .pos-chips button { min-height: 26px; }
.pos-cart-checkout .pos-loyalty-row { margin-top: 6px; padding: 6px 9px; }
.pos-cart-checkout .pos-error { margin-top: 6px; }

/* compact totals + actions */
.pos-cart-foot { padding: 8px 12px 10px; }
.pos-cart-stats { margin-bottom: 6px; }
.pos-totals { gap: 2px; font-size: 9.5px; }
.pos-grand { margin-top: 5px; padding: 7px 10px; }
.pos-grand dt { font-size: 10px; }
.pos-grand dd { font-size: 16px; }
.pos-pay-actions { margin-top: 7px; gap: 5px; }

/* square product image, fully visible (emoji was 64px in a 62px box) */
.pos-prod-art { height: auto; aspect-ratio: 1 / 1; border-radius: 14px; }
.pos-prod-art > span { font-size: 56px; }
.pos-prod-art img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pos-line-art > span { font-size: 18px; }
.pos-line-art img { object-fit: contain; }

@media (min-width: 1001px) {
  .pos-pay-actions { grid-template-columns: 1.45fr 1fr; }
  .pos-submit, .pos-submit-quiet { min-height: 42px; }
}

/* very short screens: let the page scroll while the list keeps its own scroll */
@media (max-height: 720px) and (min-width: 1001px) {
  .pos-cart { position: static; height: auto; max-height: none; }
  .pos-cart-scroll { max-height: 40vh; }
}

/* tablet / mobile: full-width cart, list scrolls in place */
@media (max-width: 1000px) {
  .pos-cart { position: static; height: auto; max-height: none; }
  .pos-cart-scroll { display: block; max-height: 46vh; overflow-y: auto; }
  .pos-cart-checkout { display: block; }
  .pos-cart-checkout .pos-fields, .pos-cart-checkout .pos-block,
  .pos-cart-checkout .pos-money, .pos-cart-checkout .pos-error { grid-column: auto; margin-top: 7px; }
  .pos-cart-foot { display: block; }
}
@media (max-width: 760px) {
  .pos-cart-scroll { max-height: 48vh; }
  .pos-prod-art > span { font-size: 50px; }
  .pos-pay-actions { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .pos-prod-art { height: auto; aspect-ratio: 1 / 1; }
  .pos-prod-art > span { font-size: 40px; }
}

/* compact option row: sale type + payment side by side */
.pos-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 7px; }
.pos-options .pos-block { margin-top: 0; }
.pos-options .pos-segment.three button { font-size: 8.5px; gap: 3px; padding: 3px 2px; }
.pos-options .pos-segment.three button .ic { width: 12px; height: 12px; }

/* discount input + quick chips on one line */
.pos-discount-row { display: flex; align-items: center; gap: 6px; }
.pos-discount-row .pos-line-input { flex: 1 1 auto; min-width: 0; }
.pos-discount-row .pos-line-input input { width: 64px; }
.pos-discount-row .pos-chips { flex: 0 0 auto; }
.pos-discount-row .pos-chips button { flex: 0 0 auto; padding: 0 7px; }

@media (max-width: 520px) {
  .pos-options { grid-template-columns: 1fr; }
  .pos-discount-row { flex-wrap: wrap; }
  .pos-discount-row .pos-chips { flex: 1 1 100%; }
  .pos-discount-row .pos-chips button { flex: 1; }
}

/* one-line cart header (more room for items) */
.pos-cart-head > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* product photos: square, uncropped, clear */
.pos-prod-art.has-image { background: #fff; }
.pos-prod-art img { object-fit: contain; padding: 6px; mix-blend-mode: normal; }

@media (min-width: 1001px) { .pos-hint { display: none; } }
