:root {
  --navy-1: #020b3a;
  --navy-2: #01052a;
  --ink: #070c4d;
  --ink-soft: #344083;
  --purple: #3f13ff;
  --purple-2: #5815ff;
  --purple-soft: #f1ebff;
  --line: #e8ebf4;
  --line-strong: #dfe4f0;
  --red: #ff2d2d;
  --green: #17c964;
  --mpesa-green: #18a852;
  --white: #ffffff;
  --shadow-soft: 0 10px 24px rgba(7, 11, 66, 0.05);
  --sidebar-w: clamp(86px, 6.3vw, 96px);
  --topbar-h: clamp(70px, 8.4vh, 84px);
  --sale-head-h: clamp(74px, 10vh, 104px);
  --header-row-h: clamp(42px, 4.8vh, 52px);
  --cart-row-h: clamp(52px, 8vh, 91px);
  --footer-h: clamp(82px, 12vh, 110px);
  --pad-x: clamp(12px, 1.25vw, 20px);
  --radius-card: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100svh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 62% 6%, rgba(112, 65, 255, 0.06), transparent 26%),
    radial-gradient(circle at 18% 96%, rgba(60, 0, 255, 0.03), transparent 22%),
    #fbfcff;
}
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button { border: 0; background: transparent; cursor: pointer; }
img { max-width: 100%; display: block; }

.pos-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
  position: relative;
  min-height: 100svh;
  padding: clamp(16px, 2vh, 28px) clamp(10px, 0.9vw, 15px) clamp(20px, 2vh, 26px);
  background:
    radial-gradient(circle at 48px 56px, rgba(89, 31, 255, 0.35), transparent 84px),
    linear-gradient(180deg, #050642 0%, #01052a 58%, #010421 100%);
  box-shadow: 18px 0 44px rgba(4, 11, 51, 0.12);
}

.side-logo {
  width: clamp(54px, 4.5vw, 68px);
  height: clamp(56px, 5vw, 70px);
  display: grid;
  place-items: center;
  margin: 0 auto;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, #2e00ff 0%, #771dff 100%);
  box-shadow: 0 18px 28px rgba(67, 14, 255, 0.36);
}
.side-logo svg,
.side-icon svg,
.logout svg,
.search-bar svg,
.cashier-menu svg,
.outline-btn svg,
.complete-btn svg,
.add-more svg,
.delete-btn svg,
.modal-icon-box svg,
.modal-close svg,
.mini-icon-circle svg,
.phone-input-icon svg,
.send-stk-btn svg,
.receipt-icon svg,
.footer-action-btn svg,
.confirm-lock svg,
.method-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-logo svg { width: clamp(30px, 2.4vw, 39px); height: clamp(30px, 2.4vw, 39px); stroke-width: 2.2; }

.side-nav {
  margin-top: clamp(32px, 7vh, 62px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(26px, 5vh, 46px);
}

.side-icon,
.logout {
  width: clamp(34px, 2.8vw, 40px);
  height: clamp(34px, 2.8vw, 40px);
  display: grid;
  place-items: center;
  color: #fff;
}
.side-icon svg,
.logout svg { width: clamp(28px, 2.3vw, 34px); height: clamp(28px, 2.3vw, 34px); stroke-width: 1.85; }
.logout {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 5vh, 56px);
  transform: translateX(-50%);
}

.workspace {
  min-width: 0;
  padding: clamp(14px, 1.5vw, 20px) var(--pad-x) clamp(12px, 1.2vw, 14px) clamp(16px, 1.25vw, 18px);
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--footer-h);
  gap: clamp(10px, 1.4vh, 14px);
  min-height: 100svh;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(185px, 215px) minmax(420px, 1fr) minmax(240px, 280px);
  align-items: center;
  column-gap: clamp(12px, 1.25vw, 18px);
}

.brand { padding-left: clamp(2px, 0.4vw, 12px); }
.brand-title {
  font-size: clamp(27px, 2.1vw, 32px);
  line-height: 1.02;
  font-weight: 860;
  letter-spacing: -0.05em;
}
.brand-subtitle {
  margin-top: 7px;
  font-size: clamp(11px, 0.92vw, 13px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.search-bar {
  height: clamp(58px, 7.5vh, 70px);
  border: 2px solid var(--purple);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(60, 0, 255, 0.035);
  display: grid;
  grid-template-columns: clamp(54px, 4vw, 60px) 1fr clamp(78px, 6vw, 94px);
  align-items: center;
  overflow: hidden;
}
.scan-icon {
  margin-left: clamp(12px, 1vw, 18px);
  width: clamp(28px, 2.2vw, 34px);
  height: clamp(28px, 2.2vw, 34px);
  color: var(--purple);
  display: grid;
  place-items: center;
}
.scan-icon svg { width: 100%; height: 100%; stroke-width: 1.8; }
.search-bar input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 12px 0 10px;
  border-left: 1px solid #e6e8f1;
  background: transparent;
  color: #1d256a;
  font-size: clamp(14px, 1.3vw, 18px);
  font-weight: 740;
  letter-spacing: -0.018em;
}
.search-bar input::placeholder { color: #4a518d; opacity: 1; }
kbd {
  justify-self: center;
  min-width: clamp(64px, 5vw, 74px);
  height: clamp(26px, 3.2vh, 30px);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #29336e;
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: 800;
  background: #f2f3f8;
  border-radius: 7px;
}

.cashier {
  display: grid;
  grid-template-columns: clamp(52px, 3.8vw, 61px) 1fr 28px;
  align-items: center;
  column-gap: clamp(10px, 0.95vw, 15px);
  justify-self: end;
}
.avatar-wrap {
  position: relative;
  width: clamp(52px, 3.8vw, 61px);
  height: clamp(52px, 3.8vw, 61px);
}
.avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #eef0f8;
}
.status-dot {
  position: absolute;
  right: 0;
  bottom: 4px;
  width: clamp(11px, 1vw, 15px);
  height: clamp(11px, 1vw, 15px);
  border-radius: 50%;
  background: var(--green);
  border: 3px solid #fff;
}
.cashier-copy strong {
  display: block;
  font-size: clamp(14px, 1.12vw, 16px);
  font-weight: 860;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.cashier-copy span {
  display: block;
  margin-top: 6px;
  color: var(--purple);
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 820;
}
.cashier-menu {
  width: 28px;
  height: 28px;
  color: #061052;
  display: grid;
  place-items: center;
}
.cashier-menu svg { width: 24px; height: 24px; stroke-width: 2.35; }

.sale-card {
  min-height: 0;
  display: grid;
  grid-template-rows: var(--sale-head-h) minmax(0, 1fr) auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #edf0f8;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.sale-head {
  padding: clamp(18px, 2.4vh, 26px) clamp(18px, 1.3vw, 20px) 0 clamp(18px, 1.3vw, 21px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.sale-head h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: clamp(10px, 0.9vw, 15px);
  font-size: clamp(24px, 2vw, 28px);
  line-height: 1.08;
  font-weight: 860;
  letter-spacing: -0.045em;
}
.count-pill {
  width: clamp(24px, 1.8vw, 28px);
  height: clamp(24px, 1.8vw, 28px);
  display: inline-grid;
  place-items: center;
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: 900;
  color: var(--purple);
  background: #f0eaff;
  border-radius: 999px;
}
.sale-head p {
  margin: clamp(8px, 1.6vh, 13px) 0 0;
  color: #394384;
  font-size: clamp(14px, 1.12vw, 16px);
  font-weight: 720;
  letter-spacing: -0.015em;
}
.more-actions {
  width: clamp(164px, 13vw, 180px);
  height: clamp(48px, 6vh, 54px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1vw, 17px);
  color: #080d48;
  background: #fff;
  border: 1px solid #e5e8f3;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(5, 14, 58, 0.035);
  font-size: clamp(14px, 1vw, 15px);
  font-weight: 820;
}
.more-actions .dots {
  transform: translateY(-2px);
  font-size: clamp(20px, 1.5vw, 24px);
  line-height: 1;
  letter-spacing: 2px;
}

.sale-table {
  min-height: 0;
  margin: 0 clamp(18px, 1.3vw, 20px);
  border: 1px solid var(--line-strong);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  background: #fff;
}
.table-row {
  display: grid;
  grid-template-columns: minmax(260px, 2.9fr) minmax(200px, 2.1fr) minmax(150px, 1.5fr) minmax(180px, 1.8fr) minmax(140px, 1.4fr) 90px;
  align-items: center;
}
.table-header {
  min-height: var(--header-row-h);
  background: #fbfcff;
  border-bottom: 1px solid var(--line-strong);
  font-size: clamp(11px, 0.88vw, 13px);
  font-weight: 900;
  color: #080d4b;
}
.table-header > div,
.cart-row > div { padding-left: clamp(12px, 0.95vw, 14px); }
.cart-row {
  min-height: var(--cart-row-h);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.product-cell {
  display: grid;
  grid-template-columns: clamp(44px, 4vw, 54px) 1fr;
  align-items: center;
  column-gap: clamp(10px, 1vw, 14px);
}
.product-img {
  width: clamp(34px, 2.8vw, 44px);
  height: clamp(48px, 5.8vh, 66px);
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 4px 5px rgba(7, 9, 50, 0.08));
}
.product-name {
  display: block;
  color: var(--ink);
  font-size: clamp(13px, 1.32vw, 17px);
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -0.018em;
}
.product-size {
  display: block;
  margin-top: clamp(4px, 1.1vh, 10px);
  color: #313a80;
  font-size: clamp(12px, 1.05vw, 16px);
  font-weight: 650;
  line-height: 1;
}
.barcode,
.money {
  font-size: clamp(13px, 1.08vw, 16px);
  letter-spacing: -0.01em;
}
.barcode { color: #344083; font-weight: 720; }
.money { color: var(--purple); font-weight: 880; }
.qty-control {
  display: inline-grid;
  grid-template-columns: clamp(36px, 2.8vw, 42px) clamp(52px, 4.5vw, 64px) clamp(36px, 2.8vw, 42px);
  height: clamp(36px, 4.5vh, 42px);
  border: 1px solid #dfe4f2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.qty-control button,
.qty-control span {
  display: grid;
  place-items: center;
  height: 100%;
}
.qty-control button {
  color: var(--ink);
  background: #fff;
  font-size: clamp(18px, 1.4vw, 22px);
  font-weight: 800;
}
.qty-control button:first-child { border-right: 1px solid #e3e6f2; }
.qty-control button:last-child { border-left: 1px solid #e3e6f2; }
.qty-control span {
  color: var(--ink);
  font-size: clamp(15px, 1.1vw, 17px);
  font-weight: 880;
}
.delete-btn {
  width: clamp(40px, 3.2vw, 46px);
  height: clamp(40px, 3.2vw, 46px);
  display: grid;
  place-items: center;
  color: var(--red);
  background: #fff;
  border: 1px solid #ffacb0;
  border-radius: 10px;
}
.delete-btn svg { width: clamp(20px, 1.6vw, 24px); height: clamp(20px, 1.6vw, 24px); stroke-width: 2.2; }

.add-more {
  margin: clamp(6px, 1vh, 7px) clamp(18px, 1.3vw, 20px) clamp(12px, 1.5vh, 16px);
  min-height: clamp(50px, 7vh, 66px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1vw, 14px);
  color: var(--purple);
  background: #fff;
  border: 1px dashed #b18cff;
  border-radius: 8px;
  font-size: clamp(14px, 1.08vw, 16px);
  font-weight: 850;
  letter-spacing: -0.01em;
}
.add-more svg { width: clamp(24px, 1.9vw, 27px); height: clamp(24px, 1.9vw, 27px); stroke-width: 1.9; }

.checkout-bar {
  display: grid;
  grid-template-columns: minmax(360px, 510px) minmax(220px, 1fr) minmax(255px, 306px);
  align-items: center;
  gap: clamp(12px, 1vw, 20px);
  min-height: var(--footer-h);
  padding: 0 clamp(16px, 1.25vw, 20px) 0 clamp(16px, 1.15vw, 18px);
  background: #fff;
  border: 1px solid #edf0f8;
  border-radius: 13px;
  box-shadow: var(--shadow-soft);
}
.left-actions {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1vw, 19px);
}
.outline-btn {
  min-width: clamp(150px, 12.5vw, 176px);
  height: clamp(54px, 7vh, 65px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 0.8vw, 13px);
  border-radius: 10px;
  background: #fff;
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 860;
  letter-spacing: -0.018em;
}
.outline-btn svg { width: clamp(22px, 1.9vw, 27px); height: clamp(22px, 1.9vw, 27px); stroke-width: 2.1; }
.hold-btn { color: var(--purple); border: 1px solid #b99dff; }
.clear-btn { color: var(--red); border: 1px solid #ff9aa0; }

.payable {
  justify-self: end;
  display: inline-flex;
  align-items: baseline;
  gap: clamp(12px, 1vw, 20px);
  white-space: nowrap;
}
.payable span {
  color: #2b3579;
  font-size: clamp(15px, 1.08vw, 16px);
  font-weight: 780;
}
.payable strong {
  color: var(--purple);
  font-size: clamp(30px, 2.6vw, 48px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.055em;
}
.complete-btn {
  height: clamp(58px, 7.2vh, 66px);
  display: grid;
  grid-template-columns: 32px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 0 clamp(16px, 1.2vw, 22px) 0 clamp(20px, 1.6vw, 28px);
  color: #fff;
  background: linear-gradient(135deg, #3100e8 0%, #5d0fff 60%, #4b00e8 100%);
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(60, 0, 255, 0.25);
  font-size: clamp(15px, 1.18vw, 18px);
  font-weight: 860;
  letter-spacing: -0.02em;
}
.complete-btn .check-icon { width: clamp(24px, 1.9vw, 29px); height: clamp(24px, 1.9vw, 29px); display: grid; place-items: center; }
.complete-btn svg { width: 100%; height: 100%; stroke-width: 1.9; }
.complete-btn kbd {
  min-width: clamp(36px, 3vw, 41px);
  height: clamp(28px, 3.2vh, 32px);
  color: #cabbff;
  background: rgba(17, 0, 150, 0.28);
  border-radius: 7px;
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 900;
}

/* Payment modal */
.payment-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 15, 40, 0.35);
  backdrop-filter: blur(5px);
}
.payment-modal-backdrop[hidden] { display: none; }
.payment-modal {
  width: min(940px, calc(100vw - 40px));
  max-height: calc(100svh - 36px);
  background: rgba(255,255,255,0.98);
  border: 1px solid #ecedf5;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(9, 17, 60, 0.22);
  overflow: auto;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px 24px;
  border-bottom: 1px solid #e9ecf5;
}
.modal-header-left {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.modal-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #3d0fff 0%, #6a24ff 100%);
}
.modal-icon-box svg { width: 28px; height: 28px; stroke-width: 1.9; }
.modal-header h2 {
  margin: 2px 0 4px;
  font-size: 25px;
  font-weight: 860;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.modal-header p {
  margin: 0;
  color: #5a6599;
  font-size: 15px;
  font-weight: 540;
}
.modal-close {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #252c69;
  background: #f7f8fd;
  border: 1px solid #e4e8f2;
  border-radius: 12px;
}
.modal-close svg { width: 24px; height: 24px; stroke-width: 2.2; }

.modal-body {
  padding: 28px;
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr) 252px;
  gap: 18px;
  align-items: start;
}
.payment-summary-box,
.payment-methods-box,
.payment-info-box,
.receipt-btn,
.footer-action-btn {
  background: #fff;
  border: 1px solid #e7eaf3;
  border-radius: 14px;
}
.payment-summary-box {
  padding: 24px 22px 20px;
}
.box-label {
  font-size: 14px;
  font-weight: 850;
  color: #2d356f;
  margin-bottom: 12px;
}
.summary-amount {
  color: var(--purple);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.box-divider {
  height: 1px;
  margin: 22px 0 18px;
  background: #eaedf5;
}
.summary-items-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mini-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--purple);
  background: #f2edff;
}
.mini-icon-circle svg { width: 20px; height: 20px; stroke-width: 1.9; }
.summary-items-copy span {
  display: block;
  font-size: 14px;
  color: #6570a4;
  margin-bottom: 4px;
}
.summary-items-copy strong {
  font-size: 17px;
  color: var(--ink);
}

.payment-methods-box {
  padding: 0;
  border: 0;
  background: transparent;
}
.payment-methods-box h3,
.payment-info-box h3,
.receipt-options-section h3,
.section-title-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 850;
  color: var(--ink);
}
.payment-method-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.method-card {
  position: relative;
  min-height: 156px;
  padding: 18px 12px 18px;
  background: #fff;
  border: 1.5px solid #e3e6f2;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink);
}
.method-card.active {
  border-color: var(--purple);
  box-shadow: inset 0 0 0 1px rgba(63, 19, 255, 0.12);
}
.method-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 38px;
  height: 22px;
  padding: 0 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.method-tag.alt { background: #5a2dfd; }
.method-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f8f8fd;
}
.method-icon-phone { color: #16b454; }
.method-icon-phone svg,
.method-icon-cash svg,
.method-icon-split svg { width: 32px; height: 32px; stroke-width: 1.85; }
.method-icon-phone .phone-screen-fill {
  fill: #ebfff2;
  stroke: #8ddaa9;
  stroke-width: 1.3;
}
.method-icon-cash { color: #24b956; }
.method-icon-split { color: var(--purple); }
.method-icon-logo {
  width: 58px;
  background: #fbfcff;
}
.mpesa-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mpesa-mark,
.brand-mpesa-mark {
  position: relative;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  transform: rotate(12deg);
  background: linear-gradient(135deg, #50d47a 0%, #1bb257 100%);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.mpesa-mark::before,
.brand-mpesa-mark::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.92);
}
.mpesa-logo-text {
  font-size: 14px;
  font-weight: 900;
  color: #189c4e;
  letter-spacing: -0.02em;
}
.m-green { color: #1bb257; }
.method-title {
  text-align: center;
  line-height: 1.45;
  font-size: 14px;
  font-weight: 820;
  color: var(--ink);
}

.till-box,
.stk-box,
.status-box {
  padding: 22px;
}
.till-box {
  background: #fcfffd;
}
.till-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #26a654;
  font-size: 19px;
  font-weight: 900;
  margin-top: 2px;
  margin-bottom: 28px;
}
.brand-mpesa {
  color: #1ba44f;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.brand-mpesa-mark {
  width: 14px;
  height: 14px;
}
.till-label,
.account-label,
.field-label {
  color: #333c72;
  font-size: 14px;
  font-weight: 760;
  margin-bottom: 12px;
}
.till-digits {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.till-digits span {
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #effaf1;
  color: #1da84f;
  font-size: 20px;
  font-weight: 900;
}
.account-label { margin-bottom: 8px; color: #6974a7; }
.account-name {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
}

.stk-box {
  background: #fff;
}
.section-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.inline-tag {
  min-width: 30px;
  height: 20px;
  padding: 0 8px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.section-subcopy {
  margin: 0 0 16px;
  color: #556192;
  font-size: 14px;
}
.phone-input-wrap {
  position: relative;
  margin-bottom: 14px;
}
.phone-input-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 42px;
  border: 1px solid #dfe3f1;
  border-radius: 10px;
  outline: none;
  color: #6c76a8;
  font-size: 15px;
  font-weight: 650;
}
.phone-input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #2b336c;
}
.phone-input-icon.left { left: 14px; }
.phone-input-icon.right { right: 14px; }
.phone-input-icon svg { width: 20px; height: 20px; stroke-width: 1.9; }
.send-stk-btn {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(135deg, #3200ec 0%, #5c18ff 100%);
  box-shadow: 0 10px 24px rgba(60, 0, 255, 0.22);
  font-size: 14px;
  font-weight: 820;
}
.send-stk-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }
.how-it-works {
  margin-top: 14px;
  padding: 16px 16px 14px;
  border-radius: 12px;
  background: #f8f5ff;
}
.how-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--purple);
  margin-bottom: 8px;
}
.how-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.how-it-works ol {
  margin: 0;
  padding-left: 24px;
  color: #47528a;
  font-size: 13px;
  line-height: 1.6;
}

.status-box {
  text-align: center;
  background: #fbfaff;
}
.status-box h3 {
  text-align: left;
  margin-bottom: 18px;
}
.status-circle {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.status-circle svg {
  width: 160px;
  height: 160px;
}
.status-circle circle,
.status-circle rect,
.status-circle path {
  fill: none;
  stroke: #c7abff;
  stroke-width: 2.2;
}
.status-circle text {
  font-size: 12px;
  font-weight: 800;
  fill: #1ba451;
}
.status-title {
  margin-top: 6px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 860;
}
.status-box p {
  margin: 12px auto 0;
  max-width: 180px;
  color: #556092;
  font-size: 14px;
  line-height: 1.45;
}

.receipt-options-section {
  padding: 4px 28px 0;
}
.receipt-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.receipt-btn {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #3b4580;
  font-size: 14px;
  font-weight: 760;
}
.receipt-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--purple);
  background: #f4f0ff;
}
.receipt-icon svg { width: 18px; height: 18px; stroke-width: 1.85; }

.modal-footer-actions {
  padding: 26px 28px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer-left-actions {
  display: flex;
  gap: 14px;
}
.footer-action-btn {
  min-width: 140px;
  height: 56px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 820;
}
.footer-action-btn svg { width: 22px; height: 22px; stroke-width: 2.05; }
.cancel-modal-btn { color: #21295f; }
.hold-modal-btn { color: var(--purple); }
.confirm-payment-btn {
  min-width: 352px;
  height: 62px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  background: linear-gradient(180deg, #12b84c 0%, #0fa53f 100%);
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(17, 177, 72, 0.24);
}
.confirm-lock {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.confirm-lock svg { width: 24px; height: 24px; stroke-width: 2; }
.confirm-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.confirm-copy strong {
  font-size: 17px;
  line-height: 1.1;
}
.confirm-copy small {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 170px minmax(360px, 1fr) minmax(220px, 250px);
  }
  .checkout-bar {
    grid-template-columns: 1fr auto auto;
  }
  .payable strong {
    font-size: clamp(28px, 2.2vw, 40px);
  }
  .modal-body {
    grid-template-columns: 1fr;
  }
  .payment-method-grid,
  .receipt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-footer-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .footer-left-actions,
  .confirm-payment-btn {
    width: 100%;
  }
  .confirm-payment-btn {
    min-width: 0;
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-rows: auto auto auto;
    overflow-x: auto;
  }
  .topbar,
  .sale-card,
  .checkout-bar {
    min-width: 1020px;
  }
  .payment-modal {
    width: min(940px, calc(100vw - 24px));
  }
  .payment-method-grid,
  .receipt-grid {
    grid-template-columns: 1fr;
  }
  .footer-left-actions {
    flex-direction: column;
  }
}


/* ===== Modal refinements for pixel-tight 1366x768 fit ===== */
.payment-modal {
  width: min(940px, calc(100vw - 44px));
  max-height: none;
  overflow: hidden;
  border-radius: 20px;
}
.payment-modal-backdrop {
  padding: 18px;
  overflow: auto;
}
.modal-header {
  padding: 24px 28px 20px;
}
.modal-header h2 {
  font-size: 25px;
}
.modal-header p {
  font-size: 14px;
}
.modal-close {
  width: 48px;
  height: 48px;
}
.modal-body {
  padding: 20px 28px 10px;
  grid-template-columns: 255px 307px 252px;
  grid-template-areas:
    "summary methods methods"
    "till stk status";
  column-gap: 18px;
  row-gap: 18px;
}
.payment-summary-box { grid-area: summary; }
.payment-methods-box { grid-area: methods; }
.till-box { grid-area: till; }
.stk-box { grid-area: stk; }
.status-box { grid-area: status; }

.payment-summary-box,
.till-box,
.stk-box,
.status-box,
.receipt-btn,
.footer-action-btn {
  border-radius: 14px;
}
.payment-summary-box {
  min-height: 214px;
  padding: 28px 22px 20px;
}
.summary-amount {
  font-size: 36px;
  line-height: 1.05;
}
.box-divider {
  margin: 28px 0 18px;
}
.payment-method-grid {
  margin-top: 14px;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.method-card {
  min-height: 158px;
  padding: 18px 10px 16px;
  border-radius: 14px;
}
.method-icon {
  width: 48px;
  height: 48px;
}
.method-title {
  font-size: 14px;
  line-height: 1.4;
}
.method-tag {
  top: 5px;
  right: 5px;
}
.till-box,
.stk-box,
.status-box {
  min-height: 258px;
  padding: 22px;
}
.till-brand {
  margin-bottom: 26px;
}
.till-digits span {
  height: 46px;
}
.section-subcopy {
  margin-bottom: 14px;
}
.phone-input-wrap input,
.send-stk-btn {
  height: 44px;
}
.how-it-works {
  margin-top: 14px;
  padding: 14px 16px 12px;
}
.status-box {
  padding-top: 24px;
}
.status-circle svg {
  width: 150px;
  height: 150px;
}
.status-title {
  font-size: 16px;
}
.status-box p {
  font-size: 13px;
  max-width: 180px;
}
.receipt-options-section {
  padding: 12px 28px 0;
}
.receipt-grid {
  margin-top: 14px;
  gap: 18px;
}
.receipt-btn {
  min-height: 48px;
}
.modal-footer-actions {
  padding: 18px 28px 24px;
}
.footer-action-btn {
  height: 56px;
}
.confirm-payment-btn {
  min-width: 352px;
  height: 62px;
}

@media (max-height: 820px) {
  .payment-modal {
    width: min(920px, calc(100vw - 38px));
    border-radius: 18px;
  }
  .modal-header {
    padding: 20px 24px 16px;
  }
  .modal-icon-box {
    width: 54px;
    height: 54px;
  }
  .modal-header h2 {
    font-size: 24px;
  }
  .modal-body {
    padding: 16px 24px 8px;
    grid-template-columns: 238px 294px 238px;
    column-gap: 16px;
    row-gap: 16px;
  }
  .payment-summary-box {
    min-height: 188px;
    padding: 22px 20px 16px;
  }
  .summary-amount {
    font-size: 31px;
  }
  .box-divider {
    margin: 22px 0 14px;
  }
  .payment-method-grid {
    gap: 12px;
  }
  .method-card {
    min-height: 144px;
    padding: 14px 8px;
  }
  .method-icon {
    width: 42px;
    height: 42px;
  }
  .method-icon-phone svg,
  .method-icon-cash svg,
  .method-icon-split svg {
    width: 28px;
    height: 28px;
  }
  .method-title {
    font-size: 13px;
  }
  .till-box,
  .stk-box,
  .status-box {
    min-height: 232px;
    padding: 18px 18px 16px;
  }
  .till-brand {
    font-size: 17px;
    margin-bottom: 20px;
  }
  .till-label,
  .account-label,
  .field-label,
  .section-subcopy,
  .status-box p,
  .how-it-works ol,
  .receipt-btn,
  .summary-items-copy span {
    font-size: 13px;
  }
  .till-digits {
    gap: 7px;
    margin-bottom: 18px;
  }
  .till-digits span {
    height: 42px;
    font-size: 17px;
  }
  .account-name {
    font-size: 14px;
  }
  .section-title-row {
    margin-bottom: 6px;
  }
  .phone-input-wrap {
    margin-bottom: 12px;
  }
  .phone-input-wrap input,
  .send-stk-btn {
    height: 42px;
  }
  .send-stk-btn {
    font-size: 13px;
  }
  .how-it-works {
    margin-top: 12px;
    padding: 12px 14px 10px;
  }
  .status-box h3 {
    margin-bottom: 12px;
  }
  .status-circle {
    margin-bottom: 10px;
  }
  .status-circle svg {
    width: 132px;
    height: 132px;
  }
  .status-title {
    font-size: 15px;
    margin-top: 4px;
  }
  .receipt-options-section {
    padding: 8px 24px 0;
  }
  .receipt-options-section h3,
  .payment-methods-box h3,
  .payment-info-box h3,
  .section-title-row h3 {
    font-size: 15px;
  }
  .receipt-grid {
    margin-top: 12px;
    gap: 14px;
  }
  .receipt-btn {
    min-height: 46px;
    gap: 10px;
  }
  .receipt-icon {
    width: 28px;
    height: 28px;
  }
  .receipt-icon svg {
    width: 17px;
    height: 17px;
  }
  .modal-footer-actions {
    padding: 14px 24px 18px;
    gap: 14px;
  }
  .footer-action-btn {
    min-width: 132px;
    height: 52px;
    font-size: 15px;
  }
  .footer-action-btn svg {
    width: 20px;
    height: 20px;
  }
  .confirm-payment-btn {
    min-width: 320px;
    height: 58px;
    padding: 0 20px;
  }
  .confirm-copy strong {
    font-size: 16px;
  }
  .confirm-copy small {
    font-size: 11px;
  }
}

@media (max-width: 980px) {
  .payment-modal {
    max-height: calc(100svh - 20px);
    overflow: auto;
  }
  .modal-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "summary"
      "methods"
      "till"
      "stk"
      "status";
  }
}


@media (max-height: 730px) {
  .payment-modal {
    width: min(900px, calc(100vw - 32px));
  }
  .modal-header {
    padding: 16px 22px 12px;
  }
  .modal-icon-box {
    width: 50px;
    height: 50px;
  }
  .modal-header h2 {
    font-size: 22px;
  }
  .modal-header p {
    font-size: 13px;
  }
  .modal-close {
    width: 44px;
    height: 44px;
  }
  .modal-body {
    padding: 12px 22px 6px;
    grid-template-columns: 220px 280px 220px;
    column-gap: 14px;
    row-gap: 14px;
  }
  .payment-summary-box {
    min-height: 168px;
    padding: 18px 18px 14px;
  }
  .summary-amount {
    font-size: 28px;
  }
  .payment-method-grid {
    gap: 10px;
  }
  .method-card {
    min-height: 126px;
    padding: 12px 8px;
  }
  .method-tag {
    min-width: 34px;
    height: 20px;
    font-size: 10px;
  }
  .method-icon,
  .method-icon-logo {
    width: 38px;
    height: 38px;
  }
  .method-icon-phone svg,
  .method-icon-cash svg,
  .method-icon-split svg {
    width: 24px;
    height: 24px;
  }
  .mpesa-logo-text {
    font-size: 11px;
  }
  .mpesa-mark,
  .brand-mpesa-mark {
    width: 11px;
    height: 11px;
  }
  .method-title {
    font-size: 12px;
    line-height: 1.35;
  }
  .till-box,
  .stk-box,
  .status-box {
    min-height: 208px;
    padding: 16px;
  }
  .till-brand {
    font-size: 15px;
    margin-bottom: 16px;
  }
  .till-digits span {
    height: 36px;
    font-size: 16px;
  }
  .phone-input-wrap input,
  .send-stk-btn {
    height: 38px;
  }
  .status-circle svg {
    width: 112px;
    height: 112px;
  }
  .status-box p {
    font-size: 12px;
  }
  .receipt-options-section {
    padding: 4px 22px 0;
  }
  .receipt-grid {
    gap: 12px;
    margin-top: 10px;
  }
  .receipt-btn {
    min-height: 42px;
    font-size: 13px;
  }
  .modal-footer-actions {
    padding: 10px 22px 16px;
  }
  .footer-action-btn {
    min-width: 124px;
    height: 48px;
    font-size: 14px;
  }
  .confirm-payment-btn {
    min-width: 290px;
    height: 54px;
  }
  .confirm-copy strong {
    font-size: 15px;
  }
}


/* ===== Final modal fit correction ===== */
.payment-modal {
  width: min(942px, calc(100vw - 28px));
  max-height: calc(100svh - 18px);
  overflow: auto;
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,0.98);
}
.modal-body {
  grid-template-columns: minmax(228px, 1.02fr) minmax(310px, 1.26fr) minmax(228px, 1.02fr);
  align-items: start;
}
.payment-summary-box {
  min-height: 196px;
}
.payment-method-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.method-card {
  min-height: 150px;
}
.method-title {
  font-size: 13.5px;
  line-height: 1.35;
}
.till-box,
.stk-box,
.status-box {
  min-height: 244px;
}
.section-subcopy {
  line-height: 1.32;
}
.receipt-options-section {
  padding-top: 8px;
}
.receipt-grid {
  gap: 14px;
}
.receipt-btn {
  min-height: 46px;
}
.modal-footer-actions {
  padding-top: 14px;
}

@media (max-height: 760px) {
  .payment-modal {
    width: min(930px, calc(100vw - 22px));
    max-height: calc(100svh - 12px);
    border-radius: 18px;
  }
  .modal-header {
    padding: 16px 20px 14px;
  }
  .modal-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 11px;
  }
  .modal-icon-box svg {
    width: 26px;
    height: 26px;
  }
  .modal-header h2 {
    font-size: 23px;
    margin: 0 0 3px;
  }
  .modal-header p {
    font-size: 13px;
  }
  .modal-close {
    width: 44px;
    height: 44px;
    border-radius: 11px;
  }
  .modal-close svg {
    width: 22px;
    height: 22px;
  }
  .modal-body {
    padding: 14px 20px 8px;
    grid-template-columns: minmax(210px, 1.02fr) minmax(300px, 1.30fr) minmax(210px, 1.02fr);
    column-gap: 14px;
    row-gap: 14px;
  }
  .payment-summary-box {
    min-height: 166px;
    padding: 18px 18px 14px;
  }
  .box-label {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .summary-amount {
    font-size: 29px;
  }
  .box-divider {
    margin: 18px 0 12px;
  }
  .mini-icon-circle {
    width: 38px;
    height: 38px;
  }
  .summary-items-copy span {
    font-size: 13px;
  }
  .summary-items-copy strong {
    font-size: 16px;
  }
  .payment-methods-box h3,
  .payment-info-box h3,
  .receipt-options-section h3,
  .section-title-row h3 {
    font-size: 15px;
  }
  .payment-method-grid {
    margin-top: 10px;
    gap: 10px;
  }
  .method-card {
    min-height: 126px;
    padding: 12px 8px;
    border-radius: 13px;
  }
  .method-tag {
    top: 5px;
    right: 5px;
    min-width: 34px;
    height: 19px;
    padding: 0 8px;
    font-size: 10px;
    border-radius: 7px;
  }
  .method-icon,
  .method-icon-logo {
    width: 40px;
    height: 40px;
  }
  .method-icon-phone svg,
  .method-icon-cash svg,
  .method-icon-split svg {
    width: 24px;
    height: 24px;
  }
  .mpesa-logo-text {
    font-size: 11px;
  }
  .mpesa-mark,
  .brand-mpesa-mark {
    width: 11px;
    height: 11px;
  }
  .method-title {
    font-size: 12px;
    line-height: 1.32;
  }
  .till-box,
  .stk-box,
  .status-box {
    min-height: 208px;
    padding: 16px;
    border-radius: 13px;
  }
  .till-brand {
    font-size: 16px;
    margin-bottom: 16px;
  }
  .till-label,
  .account-label,
  .field-label,
  .section-subcopy,
  .status-box p,
  .how-it-works ol,
  .receipt-btn,
  .summary-items-copy span {
    font-size: 12px;
  }
  .till-digits {
    gap: 6px;
    margin-bottom: 14px;
  }
  .till-digits span {
    height: 34px;
    font-size: 15px;
    border-radius: 7px;
  }
  .account-name {
    font-size: 13px;
  }
  .section-title-row {
    gap: 8px;
    margin-bottom: 5px;
  }
  .inline-tag {
    min-width: 28px;
    height: 18px;
    font-size: 10px;
  }
  .section-subcopy {
    margin: 0 0 10px;
    line-height: 1.28;
  }
  .phone-input-wrap {
    margin-bottom: 10px;
  }
  .phone-input-wrap input,
  .send-stk-btn {
    height: 38px;
    border-radius: 9px;
  }
  .phone-input-wrap input {
    font-size: 13px;
  }
  .phone-input-icon {
    width: 18px;
    height: 18px;
  }
  .phone-input-icon svg {
    width: 18px;
    height: 18px;
  }
  .send-stk-btn {
    gap: 8px;
    font-size: 13px;
  }
  .send-stk-btn svg {
    width: 16px;
    height: 16px;
  }
  .how-it-works {
    margin-top: 10px;
    padding: 12px 12px 10px;
    border-radius: 11px;
  }
  .how-title-row {
    gap: 8px;
    margin-bottom: 6px;
  }
  .how-icon {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
  .how-it-works ol {
    padding-left: 18px;
    line-height: 1.45;
  }
  .status-box h3 {
    margin-bottom: 10px;
  }
  .status-circle {
    margin-bottom: 8px;
  }
  .status-circle svg {
    width: 108px;
    height: 108px;
  }
  .status-title {
    margin-top: 2px;
    font-size: 14px;
  }
  .status-box p {
    margin-top: 8px;
    max-width: 150px;
    line-height: 1.32;
  }
  .receipt-options-section {
    padding: 2px 20px 0;
  }
  .receipt-grid {
    margin-top: 10px;
    gap: 10px;
  }
  .receipt-btn {
    min-height: 40px;
    padding: 0 12px;
    gap: 8px;
    border-radius: 11px;
  }
  .receipt-icon {
    width: 24px;
    height: 24px;
  }
  .receipt-icon svg {
    width: 15px;
    height: 15px;
  }
  .modal-footer-actions {
    padding: 10px 20px 16px;
    gap: 10px;
  }
  .footer-left-actions {
    gap: 10px;
  }
  .footer-action-btn {
    min-width: 118px;
    height: 44px;
    padding: 0 16px;
    gap: 8px;
    border-radius: 11px;
    font-size: 14px;
  }
  .footer-action-btn svg {
    width: 18px;
    height: 18px;
  }
  .confirm-payment-btn {
    min-width: 274px;
    height: 50px;
    padding: 0 16px;
    gap: 10px;
    border-radius: 11px;
  }
  .confirm-lock {
    width: 28px;
    height: 28px;
  }
  .confirm-lock svg {
    width: 20px;
    height: 20px;
  }
  .confirm-copy strong {
    font-size: 14px;
  }
  .confirm-copy small {
    margin-top: 3px;
    font-size: 10px;
  }
}

@media (max-height: 700px) {
  .payment-modal {
    width: min(918px, calc(100vw - 18px));
  }
  .modal-body {
    grid-template-columns: minmax(200px, 1.03fr) minmax(286px, 1.36fr) minmax(200px, 1.03fr);
  }
}

/* ===== POS production polish: search, scanner readiness, menus, rows ===== */
.side-logo { text-decoration: none; }
.side-icon { text-decoration: none; border-radius: 12px; transition: background .18s ease, transform .18s ease; }
.side-icon:hover,
.side-icon:focus-visible,
.logout:hover,
.logout:focus-visible {
  background: rgba(255,255,255,0.10);
  outline: none;
}

.workspace {
  gap: clamp(8px, 1vh, 12px);
}

.topbar {
  grid-template-columns: minmax(156px, 205px) minmax(420px, 1fr) minmax(218px, 268px);
}

.search-wrap {
  position: relative;
  min-width: 0;
  z-index: 30;
}

.search-bar {
  width: 100%;
  height: clamp(54px, 7vh, 64px);
  grid-template-columns: clamp(48px, 3.8vw, 56px) minmax(0, 1fr) clamp(70px, 5.7vw, 88px);
  border-radius: 13px;
}

.search-bar input {
  padding-left: clamp(8px, .8vw, 12px);
  font-size: clamp(13px, 1.08vw, 16px);
  text-overflow: ellipsis;
}

.search-bar kbd {
  margin-right: 10px;
}

.search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  max-height: min(430px, calc(100svh - 150px));
  padding: 8px;
  overflow: auto;
  background: #fff;
  border: 1px solid #dfe4f2;
  border-radius: 14px;
  box-shadow: 0 22px 52px rgba(7, 13, 77, .16);
}

.search-suggestions[hidden] { display: none; }

.suggestion-item {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  text-align: left;
  border-radius: 11px;
  background: #fff;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #f5f1ff;
}

.suggestion-item img {
  width: 42px;
  height: 52px;
  object-fit: contain;
  object-position: center;
}

.suggestion-main,
.suggestion-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.suggestion-main strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 880;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-main small,
.suggestion-meta small {
  margin-top: 5px;
  color: #4f5a92;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

.suggestion-meta {
  align-items: flex-end;
  white-space: nowrap;
}

.suggestion-meta strong {
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
}

.suggestion-empty {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #3b4584;
}

.suggestion-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.cashier {
  position: relative;
  min-width: 0;
}

.cashier-dropdown,
.more-actions-menu {
  position: absolute;
  z-index: 90;
  min-width: 220px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e3e7f2;
  border-radius: 14px;
  box-shadow: 0 22px 48px rgba(7, 13, 77, .16);
}

.cashier-dropdown[hidden],
.more-actions-menu[hidden] { display: none; }

.cashier-dropdown {
  top: calc(100% + 10px);
  right: 0;
}

.cashier-dropdown-head {
  padding: 11px 12px 12px;
  margin-bottom: 6px;
  border-radius: 11px;
  background: #f7f8ff;
}

.cashier-dropdown-head strong,
.cashier-dropdown-head span {
  display: block;
}

.cashier-dropdown-head strong {
  font-size: 14px;
  font-weight: 900;
}

.cashier-dropdown-head span {
  margin-top: 4px;
  color: #59649a;
  font-size: 12px;
  font-weight: 730;
}

.cashier-dropdown button,
.more-actions-menu button {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: #11184f;
  font-size: 13px;
  font-weight: 820;
  text-align: left;
  border-radius: 10px;
}

.cashier-dropdown button:hover,
.more-actions-menu button:hover {
  background: #f2efff;
  color: var(--purple);
}

.cashier-dropdown .logout-menu-item {
  color: var(--red);
}

.sale-card {
  grid-template-rows: clamp(64px, 8.2vh, 82px) minmax(0, 1fr) auto;
}

.sale-head {
  padding-top: clamp(12px, 1.6vh, 18px);
  align-items: flex-start;
}

.sale-head h1 {
  font-size: clamp(21px, 1.72vw, 26px);
}

.sale-head p {
  margin-top: clamp(4px, .65vh, 7px);
  font-size: clamp(13px, 1vw, 15px);
}

.sale-actions-wrap {
  position: relative;
  flex: 0 0 auto;
}

.more-actions {
  width: clamp(152px, 12vw, 174px);
  height: clamp(42px, 5.5vh, 50px);
  gap: 10px;
}

.more-action-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--purple);
  border-radius: 8px;
  background: #f0eaff;
}

.more-action-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.more-actions-menu {
  top: calc(100% + 10px);
  right: 0;
}

.sale-table {
  overflow: auto;
}

.table-row {
  grid-template-columns: minmax(300px, 3.35fr) minmax(160px, 1.55fr) minmax(118px, 1.05fr) minmax(148px, 1.33fr) minmax(126px, 1.08fr) 76px;
}

.cart-row > div,
.table-header > div {
  padding-left: clamp(10px, .8vw, 13px);
  padding-right: clamp(6px, .55vw, 9px);
}

.cart-row {
  align-items: center;
}

.product-cell {
  grid-template-columns: clamp(46px, 3.7vw, 54px) minmax(0, 1fr);
  column-gap: clamp(9px, .75vw, 12px);
  min-width: 0;
}

.product-img {
  width: clamp(38px, 2.9vw, 44px);
  height: clamp(48px, 6.1vh, 64px);
}

.product-copy {
  min-width: 0;
}

.product-name {
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: clamp(13px, 1.15vw, 16px);
  line-height: 1.18;
}

.product-size {
  margin-top: clamp(3px, .6vh, 6px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(11px, .92vw, 14px);
}

.barcode {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  line-height: 1.1;
  overflow: hidden;
}

.barcode span,
.sku-line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-line {
  color: #6a74a3;
  font-size: clamp(10px, .78vw, 12px);
  font-weight: 760;
}

.qty-control {
  grid-template-columns: clamp(34px, 2.45vw, 39px) clamp(48px, 3.6vw, 58px) clamp(34px, 2.45vw, 39px);
  height: clamp(34px, 4.1vh, 40px);
}

.qty-control input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  text-align: center;
  color: var(--ink);
  background: #fff;
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 900;
  -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.qty-control input:focus {
  background: #f7f5ff;
}

.qty-control button:first-child { border-right: 1px solid #e3e6f2; }
.qty-control button:last-child { border-left: 1px solid #e3e6f2; }

.add-more {
  min-height: clamp(44px, 5.8vh, 56px);
  margin-top: clamp(5px, .8vh, 7px);
  margin-bottom: clamp(9px, 1.2vh, 13px);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 150px minmax(330px, 1fr) minmax(210px, 236px);
  }

  .table-row {
    grid-template-columns: minmax(280px, 3fr) minmax(148px, 1.45fr) minmax(112px, 1fr) minmax(142px, 1.3fr) minmax(122px, 1.05fr) 72px;
  }
}

@media (max-width: 980px) {
  .pos-shell {
    grid-template-columns: clamp(70px, 14vw, 86px) minmax(0, 1fr);
  }

  .workspace {
    overflow-x: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 14px 12px;
  }

  .topbar,
  .sale-card,
  .checkout-bar {
    min-width: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-left: 0;
  }

  .brand-title {
    font-size: 24px;
  }

  .brand-subtitle {
    margin-top: 0;
  }

  .cashier {
    width: 100%;
    justify-self: stretch;
    grid-template-columns: 46px 1fr 28px;
  }

  .avatar-wrap {
    width: 46px;
    height: 46px;
  }

  .sale-head {
    gap: 12px;
  }

  .sale-table {
    overflow-x: auto;
  }

  .sale-table .table-row {
    min-width: 900px;
  }

  .checkout-bar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .left-actions,
  .payable,
  .complete-btn {
    width: 100%;
  }

  .payable {
    justify-self: stretch;
    justify-content: space-between;
  }

  .complete-btn {
    grid-template-columns: 32px 1fr 44px;
  }
}

@media (max-width: 620px) {
  .pos-shell {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .sidebar {
    padding-left: 8px;
    padding-right: 8px;
  }

  .side-logo {
    width: 48px;
    height: 50px;
  }

  .side-nav {
    gap: 22px;
  }

  .search-bar {
    height: 52px;
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .search-bar kbd {
    display: none;
  }

  .suggestion-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .suggestion-meta {
    display: none;
  }

  .sale-head {
    flex-direction: column;
  }

  .sale-actions-wrap,
  .more-actions {
    width: 100%;
  }

  .more-actions-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

  .left-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .outline-btn {
    width: 100%;
  }

  .payable {
    align-items: center;
  }

  .payable strong {
    font-size: 30px;
  }
}

/* Keep the POS sidebar compact even with the same core modules shown as icons */
.side-nav {
  margin-top: clamp(22px, 3.8vh, 42px);
  gap: clamp(13px, 2.45vh, 25px);
}

/* ===== POS page hard fit + alignment correction v2 ===== */
:root {
  --sidebar-w: clamp(72px, 5.35vw, 84px);
  --topbar-h: clamp(58px, 7vh, 68px);
  --sale-head-h: clamp(54px, 7vh, 68px);
  --header-row-h: clamp(34px, 4.4vh, 40px);
  --cart-row-h: clamp(48px, 6.55vh, 58px);
  --footer-h: clamp(68px, 9.2vh, 78px);
  --pad-x: clamp(10px, 1vw, 16px);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

.pos-shell {
  height: 100svh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  min-height: 0;
  height: 100svh;
  padding: clamp(12px, 1.7vh, 18px) clamp(8px, .7vw, 11px) clamp(14px, 1.8vh, 18px);
}

.side-logo {
  width: clamp(50px, 4.1vw, 60px);
  height: clamp(54px, 4.5vw, 64px);
  border-radius: 12px;
  animation: cartMicroMove 5.2s ease-in-out infinite;
  transform-origin: center;
}

.side-logo svg {
  width: clamp(29px, 2.2vw, 35px);
  height: clamp(29px, 2.2vw, 35px);
  animation: cartIconPulse 2.8s ease-in-out infinite;
}

@keyframes cartMicroMove {
  0%, 72%, 100% { transform: translateY(0) rotate(0deg); }
  78% { transform: translateY(-1px) rotate(-4deg); }
  84% { transform: translateY(0) rotate(4deg); }
  90% { transform: translateY(-1px) rotate(-2deg); }
}

@keyframes cartIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

.side-nav {
  margin-top: clamp(16px, 3vh, 28px);
  gap: clamp(12px, 2.05vh, 18px);
}

.side-icon,
.logout {
  width: clamp(33px, 2.55vw, 38px);
  height: clamp(33px, 2.55vw, 38px);
}

.side-icon svg,
.logout svg {
  width: clamp(26px, 2vw, 31px);
  height: clamp(26px, 2vw, 31px);
}

.logout {
  bottom: clamp(12px, 2.2vh, 22px);
}

.workspace {
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  padding: clamp(8px, 1vh, 10px) var(--pad-x) clamp(7px, .9vh, 9px) clamp(14px, 1.1vw, 16px);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--footer-h);
  gap: clamp(6px, .85vh, 8px);
}

.topbar {
  min-height: 0;
  grid-template-columns: minmax(145px, 190px) minmax(420px, 1fr) minmax(210px, 260px);
  column-gap: clamp(10px, .95vw, 14px);
}

.brand-title {
  font-size: clamp(24px, 1.85vw, 29px);
}

.brand-subtitle {
  margin-top: 4px;
  font-size: clamp(10px, .8vw, 12px);
}

.search-bar {
  height: clamp(48px, 6.15vh, 56px);
  border-radius: 12px;
  grid-template-columns: clamp(44px, 3.3vw, 50px) minmax(0, 1fr) clamp(60px, 4.8vw, 72px);
}

.scan-icon {
  margin-left: clamp(10px, .8vw, 13px);
  width: clamp(25px, 1.95vw, 30px);
  height: clamp(25px, 1.95vw, 30px);
}

.search-bar input {
  font-size: clamp(12px, .98vw, 15px);
  font-weight: 780;
}

.search-bar kbd {
  min-width: 54px;
  height: 26px;
  margin-right: 8px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.search-suggestions {
  top: calc(100% + 6px);
  max-height: min(365px, calc(100svh - 116px));
}

.cashier {
  grid-template-columns: clamp(44px, 3.35vw, 50px) minmax(0, 1fr) 26px;
  column-gap: 9px;
}

.avatar-wrap {
  width: clamp(44px, 3.35vw, 50px);
  height: clamp(44px, 3.35vw, 50px);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-width: 2px;
  bottom: 3px;
}

.cashier-copy strong {
  font-size: clamp(13px, 1vw, 15px);
}

.cashier-copy span {
  margin-top: 3px;
  font-size: clamp(12px, .9vw, 14px);
}

.cashier-menu,
.cashier-menu svg {
  width: 24px;
  height: 24px;
}

.sale-card {
  min-height: 0;
  grid-template-rows: var(--sale-head-h) minmax(0, 1fr) auto;
  border-radius: 14px;
}

.sale-head {
  min-height: 0;
  padding: clamp(9px, 1.15vh, 12px) clamp(16px, 1.15vw, 18px) 0;
  align-items: center;
}

.sale-head h1 {
  gap: 8px;
  font-size: clamp(20px, 1.55vw, 24px);
  line-height: 1.05;
}

.count-pill {
  width: auto;
  min-width: 28px;
  max-width: 112px;
  height: 24px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(10px, .82vw, 12px);
  line-height: 24px;
}

.sale-head p {
  margin-top: 3px;
  font-size: clamp(12px, .92vw, 14px);
  line-height: 1.1;
}

.more-actions {
  width: clamp(148px, 11.2vw, 166px);
  height: clamp(38px, 4.8vh, 44px);
  border-radius: 12px;
  font-size: clamp(12px, .9vw, 14px);
  justify-content: center;
}

.more-action-icon {
  width: 25px;
  height: 25px;
}

.more-actions-menu {
  top: calc(100% + 7px);
  min-width: 238px;
}

.sale-table {
  position: relative;
  min-height: 0;
  margin: 0 clamp(16px, 1.15vw, 18px);
  display: grid;
  grid-template-rows: var(--header-row-h) minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
}

.sale-table::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 80%);
  transition: opacity .18s ease;
}

.sale-table.has-overflow::after {
  opacity: 1;
}

.sale-table.has-overflow::before {
  content: 'Scroll list';
  position: absolute;
  right: 12px;
  bottom: 6px;
  z-index: 2;
  padding: 4px 8px;
  color: #4b16ff;
  background: rgba(242, 238, 255, .96);
  border: 1px solid #d8c8ff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

#cartRows {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 19, 255, .45) #f1efff;
}

#cartRows::-webkit-scrollbar { width: 9px; }
#cartRows::-webkit-scrollbar-track { background: #f4f2ff; }
#cartRows::-webkit-scrollbar-thumb {
  background: rgba(63, 19, 255, .45);
  border-radius: 999px;
  border: 2px solid #f4f2ff;
}

.table-row {
  grid-template-columns: minmax(330px, 3.65fr) minmax(146px, 1.38fr) minmax(112px, 1.02fr) minmax(146px, 1.28fr) minmax(152px, 1.38fr) 66px;
}

.table-header {
  min-height: 0;
  height: var(--header-row-h);
  align-items: center;
  font-size: clamp(10px, .78vw, 12px);
}

.cart-row {
  min-height: var(--cart-row-h);
}

.cart-row > div,
.table-header > div {
  padding-left: clamp(8px, .62vw, 10px);
  padding-right: clamp(4px, .45vw, 7px);
}

.table-header > div:nth-child(6),
.cart-row > div:nth-child(6) {
  padding-left: 0;
  padding-right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-cell {
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 10px;
}

.product-img {
  width: 42px;
  height: 46px;
  justify-self: center;
  object-fit: contain;
}

.product-name {
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.14;
}

.product-size {
  margin-top: 3px;
  font-size: clamp(10px, .82vw, 12px);
}

.barcode,
.money {
  font-size: clamp(12px, .94vw, 14px);
}

.barcode {
  gap: 2px;
}

.sku-line {
  font-size: clamp(9px, .68vw, 11px);
}

.qty-control {
  grid-template-columns: 32px minmax(62px, 74px) 32px;
  height: clamp(32px, 4vh, 37px);
}

.qty-control button {
  font-size: clamp(15px, 1.15vw, 18px);
}

.qty-control input {
  min-width: 0;
  font-size: clamp(12px, .86vw, 14px);
  padding: 0 3px;
}

.delete-btn {
  width: clamp(36px, 2.7vw, 40px);
  height: clamp(36px, 2.7vw, 40px);
  border-radius: 10px;
}

.delete-btn svg {
  width: clamp(18px, 1.35vw, 21px);
  height: clamp(18px, 1.35vw, 21px);
}

.empty-sale-state {
  height: 100%;
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 22px;
  color: #273174;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(63, 19, 255, .06), transparent 38%),
    #fff;
}

.empty-sale-button {
  min-width: min(420px, 100%);
  padding: 18px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--purple);
  background: #fbfaff;
  border: 1px dashed #b18cff;
  border-radius: 14px;
  font-weight: 900;
}

.empty-sale-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-sale-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
}

.empty-sale-copy strong {
  font-size: 15px;
}

.empty-sale-copy span {
  color: #515c96;
  font-size: 12px;
  font-weight: 740;
}

.add-more {
  min-height: clamp(36px, 4.8vh, 42px);
  margin: clamp(4px, .55vh, 5px) clamp(16px, 1.15vw, 18px) clamp(8px, .95vh, 10px);
  border-radius: 10px;
  font-size: clamp(12px, .9vw, 14px);
}

.add-more svg {
  width: 22px;
  height: 22px;
}

.checkout-bar {
  min-height: 0;
  height: var(--footer-h);
  grid-template-columns: minmax(300px, 385px) minmax(240px, 1fr) minmax(250px, 306px);
  padding: 0 clamp(12px, 1vw, 16px);
  gap: clamp(8px, .8vw, 14px);
  border-radius: 13px;
}

.left-actions {
  gap: clamp(9px, .75vw, 13px);
}

.outline-btn {
  min-width: clamp(132px, 10.8vw, 170px);
  height: clamp(46px, 6vh, 54px);
  font-size: clamp(12px, .98vw, 15px);
  border-radius: 10px;
}

.outline-btn svg {
  width: clamp(20px, 1.55vw, 24px);
  height: clamp(20px, 1.55vw, 24px);
}

.payable {
  min-width: 0;
  gap: clamp(8px, .8vw, 14px);
}

.payable span {
  font-size: clamp(12px, .9vw, 14px);
}

.payable strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(26px, 2.25vw, 38px);
  letter-spacing: -0.045em;
}

.complete-btn {
  height: clamp(50px, 6.4vh, 58px);
  grid-template-columns: 28px minmax(0, 1fr) 40px;
  padding: 0 clamp(14px, 1vw, 18px);
  border-radius: 12px;
  font-size: clamp(13px, 1vw, 16px);
}

.complete-btn .check-icon {
  width: 25px;
  height: 25px;
}

.complete-btn kbd {
  min-width: 36px;
  height: 28px;
  font-size: 13px;
}

.pos-toast {
  position: fixed;
  right: clamp(14px, 1.4vw, 22px);
  bottom: clamp(14px, 1.6vh, 24px);
  z-index: 1500;
  max-width: min(380px, calc(100vw - 28px));
  padding: 12px 14px;
  color: #fff;
  background: #090f49;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  box-shadow: 0 18px 44px rgba(7, 12, 67, .22);
  font-size: 13px;
  font-weight: 780;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.pos-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* payment modal final fit: no modal scroll on normal laptop height */
.payment-modal-backdrop {
  padding: clamp(8px, 1.2vh, 12px);
  overflow: hidden;
}

.payment-modal {
  width: min(920px, calc(100vw - 20px));
  max-height: calc(100svh - 20px);
  overflow: hidden;
  border-radius: 18px;
}

.payment-modal .modal-header {
  position: static;
  padding: 14px 20px 12px;
}

.payment-modal .modal-icon-box {
  width: 46px;
  height: 46px;
}

.payment-modal .modal-icon-box svg {
  width: 24px;
  height: 24px;
}

.payment-modal .modal-header h2 {
  margin: 0 0 2px;
  font-size: 22px;
}

.payment-modal .modal-header p {
  font-size: 12px;
}

.payment-modal .modal-close {
  width: 42px;
  height: 42px;
}

.payment-modal .modal-body {
  padding: 12px 20px 6px;
  grid-template-columns: minmax(205px, 1.02fr) minmax(292px, 1.34fr) minmax(205px, 1.02fr);
  column-gap: 12px;
  row-gap: 12px;
}

.payment-modal .payment-summary-box {
  min-height: 154px;
  padding: 16px 16px 12px;
}

.payment-modal .box-label {
  margin-bottom: 8px;
  font-size: 12px;
}

.payment-modal .summary-amount {
  font-size: 27px;
}

.payment-modal .box-divider {
  margin: 16px 0 10px;
}

.payment-modal .mini-icon-circle {
  width: 34px;
  height: 34px;
}

.payment-modal .payment-method-grid {
  margin-top: 9px;
  gap: 8px;
}

.payment-modal .method-card {
  min-height: 116px;
  padding: 10px 7px;
  gap: 8px;
  border-radius: 12px;
}

.payment-modal .method-icon,
.payment-modal .method-icon-logo {
  width: 36px;
  height: 36px;
}

.payment-modal .method-icon-phone svg,
.payment-modal .method-icon-cash svg,
.payment-modal .method-icon-split svg {
  width: 23px;
  height: 23px;
}

.payment-modal .method-title {
  font-size: 11.5px;
  line-height: 1.28;
}

.payment-modal .method-tag {
  height: 18px;
  min-width: 32px;
  font-size: 9px;
}

.payment-modal .till-box,
.payment-modal .stk-box,
.payment-modal .status-box {
  min-height: 196px;
  padding: 14px;
}

.payment-modal .till-brand {
  margin-bottom: 12px;
  font-size: 15px;
}

.payment-modal .till-digits {
  gap: 5px;
  margin-bottom: 12px;
}

.payment-modal .till-digits span {
  height: 32px;
  font-size: 14px;
}

.payment-modal .till-label,
.payment-modal .account-label,
.payment-modal .field-label,
.payment-modal .section-subcopy,
.payment-modal .status-box p,
.payment-modal .how-it-works ol,
.payment-modal .receipt-btn,
.payment-modal .summary-items-copy span {
  font-size: 11.5px;
}

.payment-modal .account-name {
  font-size: 12.5px;
}

.payment-modal .phone-input-wrap {
  margin-bottom: 8px;
}

.payment-modal .phone-input-wrap input,
.payment-modal .send-stk-btn {
  height: 36px;
  border-radius: 9px;
  font-size: 12px;
}

.payment-modal .how-it-works {
  margin-top: 8px;
  padding: 9px 10px 8px;
}

.payment-modal .how-it-works ol {
  line-height: 1.34;
}

.payment-modal .status-box h3 {
  margin-bottom: 7px;
}

.payment-modal .status-circle svg {
  width: 96px;
  height: 96px;
}

.payment-modal .status-title {
  margin-top: 0;
  font-size: 13px;
}

.payment-modal .status-box p {
  margin-top: 5px;
  line-height: 1.24;
}

.payment-modal .receipt-options-section {
  padding: 2px 20px 0;
}

.payment-modal .receipt-grid {
  margin-top: 8px;
  gap: 8px;
}

.payment-modal .receipt-btn {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
}

.payment-modal .receipt-icon {
  width: 22px;
  height: 22px;
}

.payment-modal .receipt-icon svg {
  width: 14px;
  height: 14px;
}

.payment-modal .modal-footer-actions {
  padding: 8px 20px 12px;
  gap: 8px;
}

.payment-modal .footer-left-actions {
  gap: 8px;
}

.payment-modal .footer-action-btn {
  min-width: 112px;
  height: 42px;
  padding: 0 14px;
  gap: 7px;
  border-radius: 10px;
  font-size: 13px;
}

.payment-modal .confirm-payment-btn {
  min-width: 260px;
  height: 46px;
  padding: 0 14px;
  gap: 8px;
  border-radius: 10px;
}

.payment-modal .confirm-lock {
  width: 26px;
  height: 26px;
}

.payment-modal .confirm-lock svg {
  width: 19px;
  height: 19px;
}

.payment-modal .confirm-copy strong {
  font-size: 13px;
}

.payment-modal .confirm-copy small {
  margin-top: 2px;
  font-size: 9.5px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 135px minmax(320px, 1fr) minmax(194px, 225px);
  }
  .table-row {
    grid-template-columns: minmax(300px, 3.35fr) minmax(138px, 1.28fr) minmax(106px, .98fr) minmax(140px, 1.28fr) minmax(142px, 1.32fr) 62px;
  }
  .checkout-bar {
    grid-template-columns: minmax(265px, 335px) minmax(215px, 1fr) minmax(225px, 280px);
  }
}

@media (max-width: 980px) {
  html,
  body,
  .pos-shell,
  .workspace {
    overflow: hidden;
  }
  .pos-shell {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .workspace {
    padding: 8px 10px;
  }
  .topbar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    row-gap: 7px;
  }
  .sale-card {
    min-height: 0;
  }
  .sale-table {
    overflow-x: auto;
  }
  .sale-table .table-row {
    min-width: 860px;
  }
  #cartRows {
    overflow: auto;
  }
  .checkout-bar {
    height: auto;
    min-height: 0;
  }
  .payment-modal-backdrop {
    overflow: auto;
  }
  .payment-modal {
    max-height: calc(100svh - 16px);
    overflow: auto;
  }
}

/* ===== POS payment / hold / receipt production modal redesign v3 ===== */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(5, 10, 44, 0.42);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.app-modal-backdrop[hidden] { display: none !important; }

.pos-payment-modal {
  width: min(1120px, calc(100vw - 42px));
  height: min(720px, calc(100svh - 20px));
  max-height: calc(100svh - 20px);
  overflow: hidden !important;
  display: grid;
  grid-template-rows: 70px minmax(0, 1fr) 74px 70px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 78px rgba(2, 8, 38, .24);
}
.pos-payment-modal .v3-modal-header {
  min-height: 70px;
  padding: 14px 24px;
  border-bottom: 1px solid #e6e9f4;
}
.pos-payment-modal .modal-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}
.pos-payment-modal .modal-icon-box svg {
  width: 25px;
  height: 25px;
}
.pos-payment-modal .modal-header h2 {
  font-size: 24px;
  line-height: 1;
  margin: 0 0 5px;
}
.pos-payment-modal .modal-header p {
  font-size: 13px;
  margin: 0;
}
.pos-payment-modal .modal-close {
  width: 44px;
  height: 44px;
  border: 1px solid #e2e6f1;
  border-radius: 12px;
}

.payment-layout-v3 {
  min-height: 0;
  padding: 16px 24px 10px;
  display: grid;
  grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
  gap: 20px;
  overflow: hidden;
}
.receipt-summary-card {
  min-height: 0;
  position: relative;
  padding: 18px 18px 20px;
  border: 1px solid #e3e8f4;
  border-radius: 14px 14px 18px 18px;
  background: linear-gradient(180deg, #fff 0%, #fff 86%, #fbfcff 100%);
  box-shadow: 0 12px 28px rgba(5, 14, 58, .05);
}
.receipt-summary-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 14px;
  background: linear-gradient(135deg, transparent 8px, #fff 0) 0 0/16px 14px repeat-x,
              linear-gradient(225deg, transparent 8px, #fff 0) 0 0/16px 14px repeat-x;
  filter: drop-shadow(0 5px 5px rgba(10, 16, 70, .06));
}
.summary-store-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}
.summary-store-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a09ff 0%, #691aff 100%);
  box-shadow: 0 10px 22px rgba(63, 19, 255, .24);
}
.summary-store-icon svg,
.hold-search-bar svg,
.payment-field svg,
.receipt-action-row svg,
.found-check svg,
.done-complete-btn svg,
.not-payment-btn svg,
.find-payment-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.summary-store-icon svg { width: 22px; height: 22px; stroke-width: 2; }
.summary-store-row strong {
  display: block;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 900;
}
.summary-store-row small {
  display: block;
  margin-top: 5px;
  color: #586394;
  font-size: 11px;
  font-weight: 700;
}
.summary-divider {
  height: 1px;
  margin: 15px 0;
  background: #e4e8f4;
}
.summary-divider.dashed {
  background: none;
  border-top: 1px dashed #cbd2e5;
}
.receipt-breakdown {
  display: grid;
  gap: 11px;
  margin-top: 15px;
}
.receipt-breakdown > div,
.receipt-totals,
.receipt-total,
.receipt-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.receipt-breakdown span {
  color: #536091;
  font-size: 13px;
  font-weight: 700;
}
.receipt-breakdown strong {
  color: #101758;
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}
.receipt-breakdown .discount-line strong,
.green-text { color: #0aa54e; }
.summary-total-label {
  color: #45507f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
}
.receipt-summary-card .summary-amount {
  margin-top: 8px;
  color: var(--purple);
  font-size: clamp(26px, 2.55vw, 38px);
  font-weight: 950;
  line-height: .96;
  letter-spacing: -.06em;
}
.payment-main-v3 {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 120px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}
.v3-methods-box {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.v3-methods-box h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
}
.v3-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.pos-payment-modal .method-card {
  position: relative;
  min-height: 90px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  text-align: left;
  gap: 2px 12px;
  border-radius: 14px;
  border: 1px solid #dfe4f2;
  background: #fff;
  box-shadow: none;
}
.pos-payment-modal .method-card.active {
  border: 2px solid var(--purple);
  background: linear-gradient(180deg, #fff 0%, #fbf9ff 100%);
  box-shadow: 0 12px 28px rgba(63, 19, 255, .08);
}
.pos-payment-modal .method-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: none;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--purple);
  font-size: 13px;
  font-weight: 900;
}
.pos-payment-modal .method-card.active .method-check { display: grid; }
.pos-payment-modal .method-icon,
.pos-payment-modal .method-icon-logo {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f4f0ff;
}
.pos-payment-modal .method-title {
  display: block;
  color: #081056;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 900;
}
.pos-payment-modal .method-card small {
  display: block;
  margin-top: 5px;
  color: #6a74a0;
  font-size: 11px;
  font-weight: 750;
}
.pos-payment-modal .method-tag { display: none; }
.payment-panels-v3 {
  min-height: 0;
  overflow: hidden;
}
.payment-panel {
  height: 100%;
  min-height: 0;
}
.manual-flow-grid,
.cash-flow-grid,
.split-flow-grid {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 14px;
}
.manual-entry-card,
.cash-entry-card,
.split-entry-card,
.payment-found-card,
.cash-change-card,
.split-balance-card {
  min-height: 0;
  border: 1px solid #e1e6f3;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}
.manual-entry-card,
.cash-entry-card,
.split-entry-card {
  display: flex;
  flex-direction: column;
}
.manual-entry-card h3,
.cash-entry-card h3,
.split-entry-card h3,
.payment-found-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}
.manual-tag { background: #f1ecff; color: var(--purple); }
.cash-tag { background: #eafaf1; color: #0ea24c; }
.split-tag { background: #f3edff; color: var(--purple); }
.till-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #dfe4f1;
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0 12px;
}
.till-detail-grid > div {
  padding: 10px 12px;
}
.till-detail-grid > div + div { border-left: 1px solid #dfe4f1; }
.till-detail-grid span,
.payment-field span,
.split-balance-card span,
.cash-change-card .mini-caption,
.found-details span {
  display: block;
  color: #566092;
  font-size: 11px;
  font-weight: 800;
}
.till-detail-grid strong {
  display: block;
  margin-top: 5px;
  color: #091056;
  font-size: 14px;
  font-weight: 900;
}
.input-grid { display: grid; gap: 12px; }
.two-col-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payment-field {
  display: grid;
  gap: 6px;
}
.payment-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #dfe4f2;
  border-radius: 10px;
  outline: 0;
  color: #121a5a;
  background: #fff;
  font-size: 13px;
  font-weight: 760;
}
.payment-field input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(63, 19, 255, .11);
}
.large-field input { height: 54px; font-size: 20px; font-weight: 900; }
.find-payment-btn,
.done-complete-btn,
.not-payment-btn {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
}
.find-payment-btn {
  margin-top: 12px;
  color: #fff;
  background: linear-gradient(135deg, #3200ec 0%, #5c18ff 100%);
  box-shadow: 0 12px 24px rgba(63, 19, 255, .18);
}
.find-payment-btn svg,
.done-complete-btn svg,
.not-payment-btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.compact-help {
  margin-top: auto;
  padding: 12px;
}
.help-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: #536092;
  font-size: 10px;
  font-weight: 760;
}
.payment-found-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  background: linear-gradient(180deg, #f3fff7 0%, #ffffff 100%);
  border-color: #9fe2b8;
  box-shadow: 0 18px 36px rgba(17, 184, 76, .10);
  transition: opacity .18s ease, transform .18s ease;
}
.payment-found-card.is-hidden {
  opacity: .45;
  filter: grayscale(.2);
}
.payment-found-card.is-hidden .done-complete-btn { opacity: .65; }
.found-check {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 2px auto 9px;
  color: #fff;
  border-radius: 50%;
  background: #18bb58;
  box-shadow: 0 15px 30px rgba(17, 184, 76, .22);
}
.found-check svg { width: 36px; height: 36px; stroke-width: 2.6; }
.payment-found-card p {
  margin: 6px 0 12px;
  color: #546092;
  font-size: 12px;
  font-weight: 700;
}
.found-details {
  display: grid;
  gap: 0;
  border: 1px solid #dfe9ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  text-align: left;
}
.found-details > div {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid #edf1f7;
}
.found-details > div:last-child { border-bottom: 0; }
.found-details strong {
  color: #071058;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}
.not-payment-btn {
  margin-top: auto;
  color: #081056;
  background: #fff;
  border: 1px solid #cbbcf8;
}
.done-complete-btn {
  margin-top: 8px;
  color: #fff;
  background: linear-gradient(135deg, #3200ec 0%, #5c18ff 100%);
  box-shadow: 0 12px 24px rgba(63, 19, 255, .22);
}
.cash-change-card,
.split-balance-card {
  display: grid;
  align-content: center;
  gap: 14px;
  text-align: center;
  background: linear-gradient(180deg, #fbfaff 0%, #fff 100%);
}
.cash-change-card > strong {
  color: var(--purple);
  font-size: 36px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.05em;
}
.cash-change-card p,
.split-balance-card p {
  margin: 0;
  color: #586394;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.quick-cash-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-cash-row button {
  height: 42px;
  color: var(--purple);
  background: #f5f1ff;
  border: 1px solid #dacdff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
}
.split-balance-card > div {
  min-height: 60px;
  display: grid;
  align-content: center;
  padding: 10px 14px;
  border: 1px solid #e4e8f3;
  border-radius: 12px;
  background: #fff;
  text-align: left;
}
.split-balance-card strong {
  display: block;
  margin-top: 4px;
  color: #081056;
  font-size: 18px;
  font-weight: 950;
}
#splitBalanceAmount { color: #ff2d2d; }
#splitBalanceAmount.paid { color: #0ca54c; }
.v3-receipt-options {
  padding: 8px 24px 10px;
  border-top: 1px solid #eef1f8;
}
.v3-receipt-options h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
}
.pos-payment-modal .receipt-grid {
  margin: 0;
  gap: 14px;
}
.pos-payment-modal .receipt-btn {
  min-height: 42px;
  border-radius: 10px;
  font-size: 13px;
}
.v3-modal-footer {
  padding: 10px 24px 14px;
  border-top: 1px solid #eef1f8;
}
.pos-payment-modal .footer-action-btn {
  min-width: 126px;
  height: 46px;
  border-radius: 10px;
  font-size: 14px;
}
.pos-payment-modal .v3-complete-sale-btn {
  min-width: 292px;
  height: 50px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3200ec 0%, #5c18ff 100%);
  box-shadow: 0 12px 26px rgba(63, 19, 255, .24);
}
.pos-payment-modal .confirm-copy strong { font-size: 14px; }
.pos-payment-modal .confirm-copy small { font-size: 10px; }

/* On Hold Sales modal */
.hold-sales-modal,
.receipt-preview-modal {
  width: min(1120px, calc(100vw - 42px));
  height: min(720px, calc(100svh - 20px));
  max-height: calc(100svh - 20px);
  overflow: hidden;
  display: grid;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 78px rgba(2, 8, 38, .24);
}
.hold-sales-modal { grid-template-rows: 78px 56px 62px minmax(0, 1fr) 74px; }
.hold-modal-header,
.receipt-preview-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e6e9f4;
}
.hold-modal-header h2,
.receipt-preview-header h2 {
  margin: 0 0 5px;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}
.hold-modal-header p,
.receipt-preview-header p {
  margin: 0;
  color: #546092;
  font-size: 13px;
  font-weight: 650;
}
.hold-toolbar {
  padding: 10px 24px 0;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
}
.hold-search-bar {
  height: 44px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 64px;
  align-items: center;
  border: 2px solid var(--purple);
  border-radius: 10px;
  background: #fff;
}
.hold-search-bar svg {
  width: 20px;
  height: 20px;
  justify-self: center;
  color: var(--purple);
  stroke-width: 2;
}
.hold-search-bar input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: #182065;
  font-size: 13px;
  font-weight: 720;
}
.hold-search-bar kbd { min-width: 52px; height: 24px; font-size: 11px; }
.hold-filter {
  height: 44px;
  padding: 0 16px;
  border: 1px solid #dfe4f1;
  border-radius: 10px;
  color: #1c2466;
  background: #fff;
  font-size: 13px;
  font-weight: 820;
}
.hold-filter.active {
  color: var(--purple);
  border-color: #d9ceff;
  background: #f5f1ff;
}
.hold-summary-strip {
  margin: 10px 24px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #e1e6f3;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.hold-summary-strip > div {
  min-height: 52px;
  display: grid;
  align-content: center;
  padding: 8px 18px;
  border-right: 1px solid #e8ecf6;
}
.hold-summary-strip > div:last-child { border-right: 0; }
.hold-summary-strip span {
  color: #596496;
  font-size: 11px;
  font-weight: 760;
}
.hold-summary-strip strong {
  display: block;
  margin-top: 3px;
  color: #081056;
  font-size: 16px;
  font-weight: 950;
}
.hold-sales-list {
  min-height: 0;
  margin: 14px 24px 0;
  overflow: auto;
  padding-right: 4px;
}
.held-sale-row {
  margin-bottom: 10px;
  border: 1px solid #e1e6f3;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.held-sale-row.selected {
  border-color: var(--purple);
  box-shadow: 0 10px 26px rgba(63, 19, 255, .08);
}
.held-main-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(80px, .75fr) minmax(120px, .95fr) minmax(70px, .55fr) minmax(105px, .8fr) minmax(125px, .85fr) minmax(230px, 1.45fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}
.held-label,
.held-ref span,
.held-main-row small {
  display: block;
  color: #596496;
  font-size: 11px;
  font-weight: 730;
}
.held-ref strong {
  display: block;
  color: var(--purple);
  font-size: 16px;
  font-weight: 950;
}
.held-main-row strong {
  color: #081056;
  font-size: 13px;
  font-weight: 900;
}
.held-total strong {
  color: var(--purple);
  font-size: 15px;
}
.held-actions {
  display: grid;
  grid-template-columns: minmax(122px, 1fr) 38px 38px;
  gap: 8px;
}
.resume-held-btn,
.view-held-btn,
.delete-held-btn {
  height: 38px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
}
.resume-held-btn {
  color: #fff;
  background: linear-gradient(135deg, #3200ec 0%, #5c18ff 100%);
}
.view-held-btn { color: var(--purple); background: #f4f0ff; border: 1px solid #d9ceff; }
.delete-held-btn { color: #ff2d2d; background: #fff7f7; border: 1px solid #ffcbcb; }
.held-preview-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  margin: 0 14px 14px;
  padding: 14px;
  border: 1px solid #ded3ff;
  border-radius: 12px;
  background: #fbf9ff;
}
.held-preview-panel h4 {
  margin: 0 0 10px;
  color: #101758;
  font-size: 12px;
  font-weight: 950;
}
.held-items-preview > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
.held-preview-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.held-preview-item img {
  width: 28px;
  height: 34px;
  object-fit: contain;
}
.held-preview-item strong,
.held-preview-item small {
  display: block;
}
.held-preview-item strong { font-size: 12px; color: #081056; }
.held-preview-item small { font-size: 10px; color: #596496; }
.held-preview-item b { color: #081056; font-size: 11px; }
.held-preview-summary {
  padding-left: 18px;
  border-left: 1px solid #ded3ff;
}
.held-preview-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  color: #596496;
  font-size: 12px;
  font-weight: 700;
}
.held-preview-summary strong { color: #081056; }
.held-preview-total {
  margin-top: 7px;
  padding-top: 10px !important;
  border-top: 1px dashed #cdbdff;
}
.held-preview-total strong { color: var(--purple); font-size: 20px; }
.held-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed #cfc4ff;
  border-radius: 14px;
  color: #536092;
  background: #fbf9ff;
}
.held-empty-state strong { color: #081056; font-size: 18px; }
.hold-modal-footer,
.receipt-preview-footer {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #eef1f8;
}
.start-new-sale-btn,
.receipt-done-btn { min-width: 230px; height: 50px; background: linear-gradient(135deg, #3200ec 0%, #5c18ff 100%); }

/* Receipt preview modal */
.receipt-preview-modal { grid-template-rows: 78px minmax(0, 1fr) 74px; }
.receipt-preview-body {
  min-height: 0;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 380px;
  gap: 28px;
  overflow: hidden;
}
.receipt-paper-wrap {
  min-height: 0;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 0 0 12px;
}
.thermal-receipt {
  width: min(80mm, 100%);
  min-height: 520px;
  padding: 20px 18px 26px;
  color: #111;
  background: #fff;
  border: 1px solid #e3e5ee;
  box-shadow: 0 16px 34px rgba(5, 14, 58, .12);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.25;
  position: relative;
}
.thermal-receipt::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 14px;
  background: linear-gradient(135deg, transparent 8px, #fff 0) 0 0/16px 14px repeat-x,
              linear-gradient(225deg, transparent 8px, #fff 0) 0 0/16px 14px repeat-x;
}
.receipt-logo-text {
  text-align: center;
  font-family: Inter, Arial, sans-serif;
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -.04em;
}
.receipt-subtitle,
.receipt-tagline,
.receipt-footer-text,
.receipt-powered { text-align: center; }
.receipt-subtitle { margin-top: 3px; font-weight: 900; }
.receipt-tagline { margin-top: 8px; font-size: 10px; }
.receipt-dash { margin: 10px 0; border-top: 1px dashed #222; }
.receipt-meta {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 4px 8px;
  font-size: 10px;
}
.receipt-meta strong { text-align: right; }
.receipt-items {
  width: 100%;
  border-collapse: collapse;
}
.receipt-items th,
.receipt-items td {
  padding: 3px 0;
  font-size: 10px;
  text-align: right;
  vertical-align: top;
}
.receipt-items th:first-child,
.receipt-items td:first-child { text-align: left; }
.receipt-items small { font-size: 9px; }
.receipt-totals,
.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}
.receipt-total {
  font-family: Inter, Arial, sans-serif;
  font-size: 15px;
  font-weight: 950;
}
.receipt-footer-text { margin-top: 14px; font-size: 11px; }
.receipt-powered { margin-top: 10px; color: #586394; font-size: 10px; }
.receipt-action-panel {
  min-height: 0;
  border-left: 1px solid #e7ebf5;
  padding-left: 24px;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: hidden;
}
.receipt-action-panel h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 950;
}
.receipt-action-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid #e1e6f3;
  border-radius: 12px;
  background: #fff;
}
.receipt-action-row svg {
  width: 26px;
  height: 26px;
  color: var(--purple);
  stroke-width: 2;
}
.receipt-action-row strong,
.receipt-action-row small { display: block; }
.receipt-action-row strong { color: var(--purple); font-size: 14px; font-weight: 950; }
.receipt-action-row small { margin-top: 4px; color: #596496; font-size: 12px; font-weight: 650; }
.receipt-action-row b { color: #141b60; font-size: 26px; line-height: 1; }
.share-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 6px;
}
.share-chips button {
  height: 42px;
  border: 1px solid #dfe4f2;
  border-radius: 10px;
  color: #101758;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}
.share-chips button:first-child { color: #10a94f; }
.receipt-note {
  margin-top: 8px;
  padding: 14px;
  display: grid;
  gap: 5px;
  border-radius: 12px;
  color: #4b16ff;
  background: #f5f1ff;
  border: 1px solid #ded3ff;
}
.receipt-note strong { font-size: 13px; }
.receipt-note span { color: #596496; font-size: 12px; }

@media (max-width: 1180px) {
  .pos-payment-modal,
  .hold-sales-modal,
  .receipt-preview-modal {
    width: calc(100vw - 24px);
  }
  .payment-layout-v3 { grid-template-columns: 228px minmax(0, 1fr); gap: 14px; }
  .manual-flow-grid,
  .cash-flow-grid,
  .split-flow-grid { grid-template-columns: minmax(0, 1fr) 290px; }
  .held-main-row { grid-template-columns: minmax(170px, 1.5fr) 76px 108px 62px 94px 118px 212px; }
}

@media (max-width: 980px) {
  .app-modal-backdrop { overflow: auto; align-items: start; }
  .pos-payment-modal,
  .hold-sales-modal,
  .receipt-preview-modal {
    height: auto;
    min-height: calc(100svh - 20px);
    overflow: auto !important;
  }
  .pos-payment-modal { grid-template-rows: auto auto auto auto; }
  .payment-layout-v3,
  .receipt-preview-body {
    grid-template-columns: 1fr;
  }
  .payment-main-v3 { grid-template-rows: auto auto; }
  .manual-flow-grid,
  .cash-flow-grid,
  .split-flow-grid,
  .held-preview-panel {
    grid-template-columns: 1fr;
  }
  .hold-toolbar { grid-template-columns: 1fr 1fr; }
  .hold-search-bar { grid-column: 1 / -1; }
  .held-main-row { grid-template-columns: 1fr; }
  .held-actions { grid-template-columns: 1fr 42px 42px; }
  .receipt-action-panel { border-left: 0; padding-left: 0; }
}

@media print {
  body.print-receipt-mode * {
    visibility: hidden !important;
  }
  body.print-receipt-mode #receiptPaper,
  body.print-receipt-mode #receiptPaper * {
    visibility: visible !important;
  }
  body.print-receipt-mode #receiptPaper {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 80mm !important;
    min-height: auto !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 4mm !important;
    margin: 0 !important;
  }
  @page { size: 80mm auto; margin: 0; }
}

/* ===== V4 serious POS payment repair: isolate modal from older payment CSS ===== */
.pos-payment-modal {
  width: min(1120px, calc(100vw - 40px)) !important;
  height: min(704px, calc(100svh - 18px)) !important;
  max-height: calc(100svh - 18px) !important;
  display: grid !important;
  grid-template-rows: 72px minmax(0, 1fr) 72px 66px !important;
  overflow: hidden !important;
  border-radius: 20px !important;
}
.pos-payment-modal .payment-layout-v3 {
  grid-area: auto !important;
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 20px !important;
  min-height: 0 !important;
  padding: 16px 22px 10px !important;
  overflow: hidden !important;
}
.pos-payment-modal .payment-main-v3 {
  display: grid !important;
  grid-template-rows: 110px minmax(0, 1fr) !important;
  gap: 12px !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.pos-payment-modal .payment-methods-box,
.pos-payment-modal .v3-methods-box {
  grid-area: auto !important;
  align-self: start !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.pos-payment-modal .payment-method-grid,
.pos-payment-modal .v3-method-grid {
  grid-area: auto !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: 0 !important;
}
.pos-payment-modal .method-card {
  grid-area: auto !important;
  min-height: 78px !important;
  height: 78px !important;
  padding: 10px 14px !important;
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  align-content: center !important;
  justify-content: stretch !important;
  gap: 2px 12px !important;
  text-align: left !important;
  border-radius: 14px !important;
}
.pos-payment-modal .method-icon,
.pos-payment-modal .method-icon-logo {
  grid-row: 1 / span 2 !important;
  width: 42px !important;
  height: 42px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
}
.pos-payment-modal .method-title { font-size: 16px !important; line-height: 1.05 !important; }
.pos-payment-modal .method-card small { font-size: 11px !important; line-height: 1.15 !important; margin: 4px 0 0 !important; }
.pos-payment-modal .payment-panels-v3 {
  grid-area: auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}
.pos-payment-modal .payment-panel {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.pos-payment-modal .manual-flow-grid,
.pos-payment-modal .cash-flow-grid,
.pos-payment-modal .split-flow-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px) !important;
  gap: 12px !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.pos-payment-modal .manual-entry-card,
.pos-payment-modal .cash-entry-card,
.pos-payment-modal .split-entry-card,
.pos-payment-modal .payment-found-card,
.pos-payment-modal .cash-change-card,
.pos-payment-modal .split-balance-card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  padding: 14px !important;
  border-radius: 14px !important;
  border: 1px solid #e1e6f3 !important;
  background: #fff !important;
  color: inherit !important;
  overflow: hidden !important;
}
.pos-payment-modal .manual-entry-card { overflow: visible !important; }
.pos-payment-modal .section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pos-payment-modal .section-subcopy { margin: 5px 0 10px !important; line-height: 1.32 !important; }
.mpesa-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: #f5f1ff;
  border: 1px solid #e2d8ff;
}
.mpesa-mode-btn {
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 10px;
  text-align: left;
  color: #18205f;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.mpesa-mode-btn span { font-size: 12px; font-weight: 950; }
.mpesa-mode-btn small { color: #65709f; font-size: 10px; font-weight: 760; }
.mpesa-mode-btn.active {
  color: var(--purple);
  background: #fff;
  box-shadow: 0 8px 18px rgba(63, 19, 255, .10);
}
.mpesa-mode-panel[hidden] { display: none !important; }
.stk-ready-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #dfe6f3;
  border-radius: 12px;
  background: #fbfcff;
}
.stk-ready-card h4 { margin: 0 0 3px; color: #071058; font-size: 14px; font-weight: 950; }
.stk-ready-card p { margin: 0; color: #5d6795; font-size: 11px; font-weight: 700; line-height: 1.34; }
.stk-icon-badge {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  color: #0aa54e; background: #eafaf1;
}
.stk-icon-badge svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pos-payment-modal .till-detail-grid { margin: 0 0 10px !important; }
.pos-payment-modal .input-grid { gap: 10px !important; }
.pos-payment-modal .payment-field input { height: 40px !important; }
.pos-payment-modal .find-payment-btn { margin-top: 10px !important; height: 40px !important; flex-shrink: 0 !important; }
.pos-payment-modal .compact-help { margin-top: 10px !important; padding: 10px !important; }
.pos-payment-modal .help-steps { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 7px !important; }
.pos-payment-modal .payment-found-card {
  background: linear-gradient(180deg, #f2fff7 0%, #fff 100%) !important;
  border-color: #9fe2b8 !important;
  text-align: center !important;
}
.pos-payment-modal .payment-found-card.is-hidden {
  opacity: 1 !important;
  filter: none !important;
  background: linear-gradient(180deg, #fff 0%, #fbfcff 100%) !important;
  border-color: #dfe6f3 !important;
}
.pos-payment-modal .payment-found-card.is-hidden .found-check { background: #c8d0e6 !important; box-shadow: none !important; }
.pos-payment-modal .payment-found-card.is-hidden h3::after { content: 'Waiting for valid payment'; display:block; margin-top:4px; color:#66709e; font-size:11px; font-weight:700; }
.pos-payment-modal .found-check { width: 54px !important; height: 54px !important; margin-bottom: 8px !important; flex-shrink: 0; }
.pos-payment-modal .found-details > div { min-height: 31px !important; padding: 6px 9px !important; }
.pos-payment-modal .not-payment-btn,
.pos-payment-modal .done-complete-btn { height: 40px !important; flex-shrink: 0 !important; }
.pos-payment-modal .v3-receipt-options {
  padding: 8px 22px !important;
  min-height: 0 !important;
  border-top: 1px solid #eef1f8 !important;
}
.pos-payment-modal .receipt-grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 12px !important; margin: 0 !important; }
.pos-payment-modal .receipt-btn { min-height: 38px !important; }
.pos-payment-modal .v3-modal-footer { padding: 9px 22px 12px !important; min-height: 0 !important; }
.pos-payment-modal .v3-complete-sale-btn { min-width: 292px !important; height: 48px !important; }

/* Price check modal */
.price-check-modal {
  width: min(760px, calc(100vw - 34px));
  max-height: min(620px, calc(100svh - 28px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 28px 78px rgba(2, 8, 38, .24);
}
.price-check-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px 14px; border-bottom: 1px solid #e6e9f4;
}
.price-check-header h2 { margin: 0 0 3px; color: #071058; font-size: 24px; font-weight: 950; }
.price-check-header p { margin: 0; color: #526090; font-size: 13px; font-weight: 700; }
.price-check-search {
  margin: 16px 22px 12px; height: 54px; display: grid; grid-template-columns: 24px 1fr auto; align-items:center; gap: 12px;
  padding: 0 14px; border: 2px solid var(--purple); border-radius: 14px; background:#fff;
}
.price-check-search svg { width: 22px; height: 22px; fill: none; stroke: var(--purple); stroke-width: 2.2; }
.price-check-search input { border: 0; outline: 0; font-size: 15px; font-weight: 800; color: #0a1157; }
.price-check-search kbd { color: #4b16ff; background: #f3efff; border: 1px solid #e0d6ff; border-radius: 8px; padding: 5px 9px; font-weight: 900; }
.price-check-results { min-height:0; overflow:auto; padding: 0 22px 14px; display:grid; gap:10px; }
.price-result-row {
  display:grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; align-items:center; gap:14px;
  min-height:76px; padding: 10px 12px; border:1px solid #e2e7f2; border-radius: 14px; background:#fff;
}
.price-result-row img { width:44px; height:54px; object-fit:contain; }
.price-result-row strong { display:block; color:#081056; font-size:15px; font-weight:950; }
.price-result-row small { display:block; margin-top:4px; color:#5a6594; font-size:12px; font-weight:750; }
.price-result-amount { color: var(--purple); font-size: 20px; font-weight: 950; white-space: nowrap; }
.price-result-row button { height:40px; padding:0 16px; color:#fff; background:linear-gradient(135deg,#3200ec,#5c18ff); border:0; border-radius:10px; font-weight:900; }
.price-check-empty { padding:24px; text-align:center; color:#5c6796; border:1px dashed #cdd3e6; border-radius:14px; font-weight:800; }
.price-check-footer { display:flex; justify-content:space-between; gap:12px; padding: 12px 22px 16px; border-top:1px solid #eef1f8; }
.price-check-footer .price-check-focus-sale { min-width: 250px; height:46px; }

@media (max-width: 980px) {
  .pos-payment-modal { height: auto !important; min-height: calc(100svh - 20px) !important; overflow: auto !important; }
  .pos-payment-modal .payment-layout-v3,
  .pos-payment-modal .manual-flow-grid,
  .pos-payment-modal .cash-flow-grid,
  .pos-payment-modal .split-flow-grid { grid-template-columns: 1fr !important; }
  .pos-payment-modal .payment-main-v3 { grid-template-rows: auto auto !important; }
  .pos-payment-modal .payment-panel { height: auto !important; overflow: visible !important; }
  .price-result-row { grid-template-columns: 48px 1fr; }
  .price-result-amount, .price-result-row button { grid-column: 2; justify-self:start; }
}

/* ===== POS Sidebar Open/Hide Overlay v8 =====
   Keeps the loved POS collapsed rail, but lets the cart icon open the full menu with labels.
   The workspace stays fixed and is never pushed. */
:root {
  --pos-sidebar-closed: var(--sidebar-w);
  --pos-sidebar-open: 254px;
}

.pos-shell {
  grid-template-columns: var(--pos-sidebar-closed) minmax(0, 1fr) !important;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 230;
  width: var(--pos-sidebar-closed);
  overflow: hidden;
  transition: width .24s ease, box-shadow .24s ease;
}

body:not(.sidebar-collapsed) .sidebar {
  width: var(--pos-sidebar-open);
  box-shadow: 30px 0 70px rgba(3, 8, 47, .30);
}

.pos-logo-row {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.side-logo {
  flex: 0 0 auto;
  margin: 0 auto;
  cursor: pointer;
  text-decoration: none;
}

body:not(.sidebar-collapsed) .side-logo {
  margin: 0;
}

.pos-brand-copy {
  min-width: 0;
  color: #fff;
  line-height: 1;
}

.pos-brand-copy strong {
  display: block;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -.04em;
}

.pos-brand-copy small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  color: rgba(255,255,255,.9);
}

.pos-sidebar-toggle {
  position: absolute;
  right: 2px;
  top: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(228,232,245,.95);
  border-radius: 999px;
  color: #07114a;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 26px rgba(1, 7, 42, .24);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.pos-sidebar-toggle:hover {
  color: #fff;
  background: linear-gradient(135deg, #4318ff, #681dff);
}

.pos-sidebar-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

body.sidebar-collapsed .pos-brand-copy,
body.sidebar-collapsed .pos-sidebar-toggle,
body.sidebar-collapsed .side-text {
  display: none !important;
}

body:not(.sidebar-collapsed) .pos-brand-copy,
body:not(.sidebar-collapsed) .pos-sidebar-toggle,
body:not(.sidebar-collapsed) .side-text {
  display: inline-block !important;
}

body:not(.sidebar-collapsed) .side-nav {
  align-items: stretch;
  gap: 3px;
  margin-top: 10px;
}

body.sidebar-collapsed .side-nav {
  align-items: center;
}

body:not(.sidebar-collapsed) .side-icon,
body:not(.sidebar-collapsed) .logout {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 11px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  color: rgba(255,255,255,.9);
  text-decoration: none;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

body:not(.sidebar-collapsed) .side-icon:hover,
body:not(.sidebar-collapsed) .logout:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
}

body:not(.sidebar-collapsed) .side-icon svg,
body:not(.sidebar-collapsed) .logout svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

body:not(.sidebar-collapsed) .logout {
  left: 12px;
  right: 12px;
  bottom: clamp(12px, 2.2vh, 22px);
  width: auto;
  transform: none;
}

@media (max-height: 740px) {
  .pos-logo-row { min-height: 56px; }
  body:not(.sidebar-collapsed) .side-icon,
  body:not(.sidebar-collapsed) .logout { height: 38px; min-height: 38px; }
  body:not(.sidebar-collapsed) .side-nav { gap: 1px; margin-top: 6px; }
}

@media (max-width: 760px) {
  :root { --pos-sidebar-open: min(254px, calc(100vw - 10px)); }
}
