/* ODM Billing - the billing screen (item picker + bill details) */
.pos { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.pos-top { background: var(--brand); color: #fff; padding: 6px 10px; display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; flex: none; }
.pos-top1 { flex: 1 1 340px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.pos-search { flex: 1; min-width: 0; height: 40px; box-shadow: none; }
.pos-search .input { height: 38px; }
.pos-cart { position: relative; width: 44px; height: 40px; border: 0; border-radius: 10px; background: #fff; color: var(--brand-dark); display: grid; place-items: center; flex: none; }
.pos-cart b { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; border-radius: 10px; background: #2B3142; color: #fff; font-size: 11.5px; display: grid; place-items: center; padding: 0 5px; }
.pos-tools { display: flex; gap: 8px; align-items: center; overflow-x: auto; max-width: 100%; padding-bottom: 1px; scrollbar-width: none; }
.pos-tools::-webkit-scrollbar { display: none; }
.pos-tools .btn { flex: none; max-width: 220px; } .pos-tools .btn span { overflow: hidden; text-overflow: ellipsis; }
.pos-scan { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; cursor: pointer; flex: none; }
.pos-scan input { width: 17px; height: 17px; accent-color: #fff; }

.pos-mid { flex: 1; min-height: 0; display: grid; grid-template-columns: 208px minmax(0, 1fr); }
.pos-mid.nocats { grid-template-columns: minmax(0, 1fr); }
.pos-cats { overflow-y: auto; background: #fff; border-right: 1px solid var(--line); }
.pos-cat { display: block; width: 100%; text-align: left; padding: 11px 10px 11px 12px; border: 0; border-bottom: 1px solid #EEF0F3; border-left: 4px solid transparent; background: none; font-size: 14px; }
.pos-cat.has { background: var(--hold); }
.pos-cat.on { border-left-color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.pos-cat b { color: var(--ok-dark); }
.pos-items { overflow-y: auto; padding: 10px; min-width: 0; }
.pos-grid { display: grid; gap: 8px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); align-content: start; }
.pos-card { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 8px; position: relative; display: grid; gap: 6px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; min-width: 0; }
.pos-card:active { filter: brightness(.96); }
.pos-card.sel { background: var(--sel); }
.pos-card-top { display: flex; gap: 8px; align-items: center; min-width: 0; }
.pos-pic { width: 50px; height: 50px; flex: none; border-radius: 8px; overflow: hidden; background: #F1F3F6; }
.pos-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-pic .tile { font-size: 17px; height: 100%; }
.pos-name { font-size: 14px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; padding-right: 18px; }
.pos-code { color: var(--primary-dark); font-weight: 700; }
.pos-stock { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.pos-card-bot { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.pos-qty { min-width: 46px; height: 34px; border-radius: 999px; border: 1.5px solid var(--line2); background: #fff; font-weight: 700; font-size: 15px; padding: 0 10px; font-variant-numeric: tabular-nums; }
.pos-qty.on { border-color: var(--ok-dark); background: var(--ok-dark); color: #fff; }
.pos-price { height: 34px; border-radius: 8px; border: 1.5px dashed #9AA3B2; background: rgba(255,255,255,.7); padding: 0 10px; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; display: grid; place-items: center; z-index: 2; box-shadow: var(--shadow); }
.pos-list { display: grid; gap: 6px; }
.pos-lrow { background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 6px 8px 6px 12px; display: flex; gap: 8px; align-items: center; cursor: pointer; user-select: none; -webkit-user-select: none; }
.pos-lrow.sel { background: var(--sel); }
.pos-lname { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.pos-lname .pos-code { margin-right: 6px; }
.pos-step { display: flex; align-items: center; gap: 4px; flex: none; }
.pos-step > button:not(.pos-qty) { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; }
.pos-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pos-link { border: 0; background: none; color: var(--primary-dark); text-decoration: underline; font-size: 12.5px; padding: 0 4px; font-weight: 600; }

.pos-bottom { flex: none; background: #fff; border-top: 1px solid var(--line); padding: 8px 10px; display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; box-shadow: 0 -2px 8px rgba(16,24,40,.06); }
.pos-total { font-size: 15px; font-weight: 700; display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: baseline; justify-content: start; }
.pos-total b { font-size: 24px; font-variant-numeric: tabular-nums; }
.pos-total small { grid-column: 1 / -1; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.pos-pay { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pos-pay .seg-b { padding: 8px 16px; font-weight: 600; }
.pos-paid { width: 110px; }
.pos-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.pos-mic { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--primary); color: #fff; font-weight: 700; font-size: 14.5px; }
.modal-body .row .chip { white-space: normal; height: auto; min-height: 22px; padding-top: 3px; padding-bottom: 3px; text-align: left; line-height: 1.3; }   /* long "please check" notes wrap on a phone */
.pos-mic.on { background: #1FA35A; animation: pos-pulse 1.2s ease-in-out infinite; }
@keyframes pos-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,163,90,.45); } 50% { box-shadow: 0 0 0 10px rgba(31,163,90,0); } }
.pos-bignum { height: 52px; font-size: 24px; font-weight: 700; text-align: center; }
.pos-warn { background: var(--amber-soft); color: #8A5300; border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.pos-found { display: grid; gap: 4px; }
.pos-found button { display: flex; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line2); border-radius: 8px; padding: 9px 12px; text-align: left; }
.pos-found span { color: var(--muted); }

/* details view */
.pos-party { cursor: pointer; }
.pos-lines { display: grid; }
.pos-line { display: grid; grid-template-columns: 26px minmax(0, 1fr) 84px 96px 96px 110px 34px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pos-line-head { font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; padding-top: 0; }
.pos-sr { color: var(--muted); font-size: 13px; }
.pos-lnm { font-weight: 600; overflow-wrap: anywhere; }
.pos-cell { min-width: 0; } .pos-cell i { display: none; font-style: normal; font-size: 11px; color: var(--muted); }
.pos-cell .input, .pos-lnm-in { height: 36px; }
.pos-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-nolines { padding: 16px; }
.pos-addrow { margin-top: 10px; }
.pos-sums { display: grid; gap: 4px; margin: 12px 0; }
.pos-sums > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.pos-sums b { font-variant-numeric: tabular-nums; }
.pos-grand { border-top: 2px solid var(--ink); padding-top: 6px; margin-top: 4px; font-size: 19px !important; font-weight: 800; }
.pos-prev { margin: 10px 0; font-size: 14px; color: var(--ink2); }
.pos-foot-total { margin-right: auto; font-size: 15px; } .pos-foot-total b { font-size: 21px; }
.pos-details .pos-pay { margin-bottom: 8px; }

@media (max-width: 900px) {
  .pos-mid { grid-template-columns: 160px minmax(0, 1fr); }
  .pos-cat { font-size: 13px; padding: 10px 8px 10px 10px; }
}
@media (max-width: 640px) {
  .pos-mid, .pos-mid.nocats { display: flex; flex-direction: column; }
  .pos-cats { display: flex; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); flex: none; padding: 6px; gap: 6px; scrollbar-width: none; }
  .pos-cats::-webkit-scrollbar { display: none; }
  .pos-cat { width: auto; white-space: nowrap; border: 1px solid var(--line2); border-radius: 999px; padding: 7px 12px; flex: none; }
  .pos-cat.on { border-color: var(--primary); }
  .pos-items { flex: 1; min-height: 0; padding: 8px; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-pic { width: 40px; height: 40px; } .pos-name { font-size: 13px; }
  .pos-scan span { display: none; }
  .pos-total b { font-size: 21px; }
  .pos-actions { margin-left: 0; width: 100%; } .pos-actions .btn { flex: 1; padding: 0 8px; font-size: 12.5px; }
  .pos-pay .seg-b { padding: 7px 12px; }
  .pos-line { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 34px; grid-template-areas: "sr nm nm nm x" ". q r d ." ". a a a ."; gap: 4px 6px; }
  .pos-line-head { display: none; }
  .pos-line > :nth-child(1) { grid-area: sr; } .pos-line > :nth-child(2) { grid-area: nm; } .pos-line > :nth-child(3) { grid-area: q; } .pos-line > :nth-child(4) { grid-area: r; }
  .pos-line > :nth-child(5) { grid-area: d; } .pos-line > :nth-child(6) { grid-area: a; } .pos-line > :nth-child(7) { grid-area: x; }
  .pos-cell i { display: block; }
  .page-foot .btn { flex: 1; padding: 0 8px; font-size: 12.5px; } .pos-foot-total { width: 100%; }
}
