/* POS: register, payment dialog, drawer and reports. Tokens and base components come from app.css and ui.css. */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-4, 16px); align-items: start; }
.pos-find { display: flex; gap: 8px; margin-bottom: 12px; }
.pos-find input { flex: 1; min-width: 0; }
.pos-find .btn { flex: none; }
.pos-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pos-chips:empty { display: none; }
.pos-chips button { padding: 7px 12px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); color: var(--text); font: 500 var(--fs-md) var(--body); cursor: pointer; }
.pos-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.pos-tile { display: flex; flex-direction: column; text-align: left; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; font: inherit; color: var(--text); transition: border-color .12s, transform .06s; }
.pos-tile:hover { border-color: var(--ink); }
.pos-tile:active { transform: scale(.98); }
.pos-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pos-tile .pic { height: 74px; display: grid; place-items: center; background: hsl(var(--h, 30) 45% 92%) center / cover no-repeat; color: hsl(var(--h, 30) 40% 34%); font: 700 22px var(--head); text-transform: uppercase; letter-spacing: .02em; }
.pos-tile .nm { padding: 9px 10px 2px; font-weight: 600; font-size: var(--fs-md); line-height: 1.25; display: block; min-height: 2.5em; }
.pos-tile .nm small { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.pos-tile .pr { padding: 2px 10px 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 600; margin-top: auto; }
.pos-tile .pr em { font-style: normal; font-weight: 500; font-size: var(--fs-xs); color: #9a5300; }
.pos-tile .pr em.bad { color: #b3261b; }
.pos-tile.out .pic, .pos-tile.out .nm { opacity: .55; }

.pos-cart { position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.pos-cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pos-cust { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: var(--ground); border-radius: var(--r-sm); margin-bottom: 8px; }
.pos-cust span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pos-cust svg, .pos-addcust svg { width: 16px; height: 16px; flex: none; }
.pos-addcust { margin: 0 0 8px -10px; }
.pos-lines { overflow-y: auto; flex: 1; min-height: 80px; border-top: 1px solid var(--line-2); }
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.pos-line .nm b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.pos-line .nm small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.pos-line .qty { display: flex; align-items: center; gap: 2px; }
.pos-line .qty button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font-size: 18px; line-height: 1; cursor: pointer; color: var(--text); }
.pos-line .qty button:hover { border-color: var(--ink); }
.pos-line .qty b { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.pos-line .amt { background: none; border: 0; font: 600 var(--fs-md) var(--body); font-variant-numeric: tabular-nums; color: var(--text); min-width: 64px; text-align: right; padding: 6px 0; cursor: pointer; }
.pos-line .amt:disabled { cursor: default; color: var(--text); opacity: 1; }
.pos-tot { padding-top: 10px; }
.pos-tot > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 0; color: var(--ink-3, var(--muted)); font-variant-numeric: tabular-nums; }
.pos-tot > div b { font-weight: 500; color: var(--text); }
.pos-tot .big { font-size: var(--fs-xl, 20px); color: var(--text); padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); }
.pos-tot .big b { font-weight: 700; }
.pos-tot .linkbtn { font-size: var(--fs-sm); margin-left: 6px; }
.pos-tot.inset { background: var(--ground); border-radius: var(--r-sm); padding: 10px 14px; margin-top: 12px; }
.pos-charge { width: 100%; min-height: 56px; margin-top: 12px; font-size: var(--fs-lg, 17px); flex-direction: column; gap: 0; line-height: 1.2; }
.pos-charge small { font-weight: 500; opacity: .75; font-size: var(--fs-xs); }
.pos-drawer-tag { align-self: center; }

.pos-bar { display: none; }

/* Payment dialog */
.pos-pay .d { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.pos-tips { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pos-tips > span { font-weight: 600; }
.pos-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #f1f1ee; border-radius: var(--r); }
.pos-seg button { border: 0; background: none; padding: 8px 14px; border-radius: var(--r-sm); font: 600 14px var(--body); color: var(--muted); cursor: pointer; white-space: nowrap; }
.pos-seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.pos-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pos-m { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; align-items: center; text-align: left; padding: 16px; min-height: 84px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font: inherit; color: var(--text); }
.pos-m svg { width: 26px; height: 26px; grid-row: span 2; }
.pos-m b { font-size: var(--fs-lg, 17px); align-self: end; }
.pos-m small { color: var(--muted); align-self: start; }
.pos-m:hover:not(:disabled) { border-color: var(--ink); }
.pos-m:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pos-m:disabled { opacity: .55; cursor: not-allowed; background: var(--ground); }
.pos-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.pos-quick .btn { min-height: 52px; padding: 0 18px; font-size: var(--fs-lg, 17px); font-variant-numeric: tabular-nums; }
.pos-change { font-weight: 700; font-size: var(--fs-lg, 17px); min-height: 1.5em; margin: 4px 0 0; }
.pos-wait, .pos-done, .pos-qr { text-align: center; padding: 18px 0; }
.pos-spin { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--ink); animation: pos-spin 0.9s linear infinite; }
@keyframes pos-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pos-spin { animation-duration: 3s; } }
.pos-qr > div { width: 220px; max-width: 70%; margin: 0 auto 12px; }
.pos-qr svg { width: 100%; height: auto; display: block; }
.pos-qr p { max-width: 420px; margin: 6px auto; color: var(--muted); }
.pos-check { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #e3f6ea; color: #136c3a; display: grid; place-items: center; }
.pos-check svg { width: 32px; height: 32px; }
.pos-changebig { font-size: var(--fs-xl, 20px); margin: 0 0 4px; }
.pos-changebig b { font-size: 34px; font-weight: 800; display: block; font-variant-numeric: tabular-nums; }
.pos-rcpt { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.pos-rcpt .f { flex: 1; margin-bottom: 0; }
.pos-cres { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; margin-bottom: 8px; }
.pos-cpick { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); cursor: pointer; font: inherit; color: var(--text); }
.pos-cpick:hover { border-color: var(--ink); }
.pos-cpick small { display: block; color: var(--muted); }
.pos-rq { width: 84px; text-align: right; }

/* Drawer and reports */
.pos-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.pos-inline .f { margin-bottom: 0; width: 200px; }
.pos-rep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pos-rep .panel + .panel { margin-top: 0; }
.pos-hours { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 8px; }
.pos-hours > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.pos-hours span { display: block; width: 100%; max-width: 34px; background: var(--ink); border-radius: 3px 3px 0 0; }
.pos-hours small { font-size: 11px; color: var(--muted); }
#skiosk .list li select { width: auto; max-width: 220px; margin-left: auto; }
#scards .list li .tag { margin-left: auto; }

@media (max-width: 980px) {
  .pos { grid-template-columns: 1fr; }
  .pos-cart { position: static; max-height: none; }
  .pos-lines { max-height: none; overflow: visible; }
  .pos-rep { grid-template-columns: 1fr; }
  .pos-bar:not([hidden]) { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; bottom: 12px; z-index: 5; width: 100%; min-height: 52px; padding: 0 18px; border: 0; border-radius: var(--r); background: var(--ink); color: #fff; font: 600 var(--fs-md) var(--body); cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); order: 2; }
  .pos-bar span { opacity: .8; font-weight: 500; }
  .pos-cart { order: 3; scroll-margin-top: 12px; }
}
@media (max-width: 560px) {
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-methods { grid-template-columns: 1fr; }
  .pos-find { flex-wrap: wrap; }
  .pos-find .btn { width: 100%; }
  .pos-tips { flex-direction: column; align-items: flex-start; }
  .pos-rcpt { flex-wrap: wrap; }
  .pos-hours small { font-size: 9px; }
  #skiosk .list li, #scards .list li { flex-wrap: wrap; }
  #skiosk .list li select { margin-left: 0; max-width: none; width: 100%; }
}
