/* Trang Bán hàng — chỉ phần riêng; lớp chung (.btn-action, .filterbar, .tile, .list, .icon-btn) ở components.css */
.pg-sales { padding: 0; max-width: 1100px; margin: 0 auto; }
.pg-sales .sl-view { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h, 56px)); background: var(--c-surface); }
.pg-sales .hidden { display: none !important; }
.pg-sales .sl-searchrow { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--c-border); }
.pg-sales .sl-none { grid-column: 1 / -1; padding: var(--sp-5); text-align: center; color: var(--c-text-muted); }
.pg-sales .tile { position: relative; }
.pg-sales .sl-qbadge { position: absolute; top: 4px; right: 4px; z-index: 2; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: #F44336; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }

.pg-sales .sl-bar { display: flex; align-items: center; gap: var(--sp-2); min-height: 56px; padding: 0 var(--sp-2); background: var(--c-primary); color: #fff; }
.pg-sales .sl-bar-title { flex: 1; font-size: var(--fs-lg); font-weight: 600; }
.pg-sales .sl-scroll { flex: 1; }
.pg-sales .sl-foot { position: sticky; bottom: 0; padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); background: var(--c-surface); }

.pg-sales .sl-line { cursor: pointer; }
.pg-sales .sl-line-side { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.pg-sales .sl-line-price { min-width: 80px; text-align: right; font-weight: 600; color: var(--c-text); }
.pg-sales .sl-qty { display: inline-flex; align-items: center; }
.pg-sales .sl-qty button, .sl-modal .sl-qty-modal button { min-width: var(--tap, 44px); min-height: var(--tap, 44px); border: 1px solid var(--c-border); border-radius: 2px; background: var(--c-surface); color: var(--c-text); font-size: var(--fs-lg); font-weight: 700; cursor: pointer; }
.pg-sales .sl-qty span, .sl-modal .sl-qty-modal span { min-width: 32px; text-align: center; font-weight: 700; color: var(--c-text); }
.pg-sales .sl-del { color: var(--c-err); border-radius: 0; }
.pg-sales .sl-form { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); }
.pg-sales .sl-two { display: flex; gap: var(--sp-2); }
.pg-sales .sl-two > * { flex: 1; min-width: 0; }
.pg-sales .sl-form .chips { flex-wrap: nowrap; }
.pg-sales .sl-form .chips .chip { flex: 1; padding: 0 var(--sp-2); }
.pg-sales .sl-totals { padding: var(--sp-3); border-top: 1px solid var(--c-border); }
.pg-sales .sl-totals > div { display: flex; justify-content: space-between; min-height: 28px; }
.pg-sales .sl-grand { font-size: var(--fs-xl); font-weight: 700; }

.pg-sales .sl-sec { padding: var(--sp-3); }
.pg-sales .sl-lbl, .sl-modal .sl-lbl { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-muted); margin-bottom: var(--sp-1); }
.pg-sales .sl-paytotal { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-4); border-bottom: 1px solid var(--c-border); }
.pg-sales .sl-paytotal b { font-size: var(--fs-xl); }
.pg-sales .sl-paychange b { color: var(--c-ok); }
.pg-sales .sl-check { display: flex; align-items: center; gap: var(--sp-2); min-height: 56px; padding: 0 var(--sp-3); cursor: pointer; border-top: 1px solid var(--c-border); }
.pg-sales .sl-check input { width: 22px; height: 22px; }

/* số đơn chờ trên thanh trên (nút do JS tạo) */
.sl-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #F44336; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* modal (gắn vào body) */
.sl-modal .sl-sec { margin-bottom: var(--sp-3); }
.sl-modal .chips { flex-wrap: wrap; }
.sl-modal .chip { min-height: var(--tap, 44px); }
.sl-modal .sl-rowbet { display: flex; align-items: center; justify-content: space-between; }
.sl-modal .sl-qty-modal { display: inline-flex; align-items: center; gap: var(--sp-2); }
.sl-modal .sl-live { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3); background: var(--c-surface-2); border-radius: 2px; font-weight: 700; font-size: var(--fs-lg); }
.sl-modal.list { margin: 0 calc(-1 * var(--sp-4, 16px)); }
.sl-modal .list-item.active .list-title, .sl-modal .list-item.active { font-weight: 700; color: var(--c-primary); }
.sl-modal .list-item { text-align: left; }
.sl-done { text-align: center; }
.sl-done .sl-big { font-size: var(--fs-xxl); font-weight: 800; margin: var(--sp-2) 0; }
.sl-done .sl-change { font-size: var(--fs-lg); font-weight: 600; }

@media (max-width: 600px) {
  .pg-sales .sl-line { flex-wrap: wrap; }
  .pg-sales .sl-line-side { width: 100%; justify-content: space-between; }
}


/* ===== Tablet / điện thoại ngang: các màn con không kéo giãn ===== */
@media (min-width: 600px) {
  .pg-sales .sl-view.sl-sub { max-width: 640px; margin: 0 auto; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); }
}
.pg-sales .sl-foot { padding-bottom: calc(var(--sp-4) + var(--safe-b)); }
.pg-sales .sl-bar { padding-top: 0; }
.pg-sales .sl-qty button:hover, .sl-modal .sl-qty-modal button:hover { background: var(--c-surface-2); }

/* ===== Màn rộng >= 900px: thực đơn trái + hóa đơn cố định phải ===== */
@media (min-width: 900px) {
  .page.pg-sales { padding: 0; height: 100%; max-width: none; margin: 0; }
  .pg-sales .sl-split { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 400px); height: 100%; min-height: 0; }
  .pg-sales .sl-left { min-width: 0; min-height: 0; overflow-y: auto; background: var(--c-surface); }
  .pg-sales .sl-left .sl-view { min-height: 0; }
  .pg-sales .sl-left .btn-action-row { padding: var(--sp-3); }
  .pg-sales .sl-left #sl-gopay { display: none; }
  .pg-sales .sl-left .btn-action { min-height: 56px; }
  .pg-sales .sl-left .tile-grid { gap: 8px; padding: var(--sp-3); }
  .pg-sales .sl-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--c-border); background: var(--c-surface); }
  .pg-sales .sl-right .sl-view { flex: 1; min-height: 0; }
  .pg-sales .sl-right .sl-bar [data-back] { display: none; }
  .pg-sales .sl-right .sl-bar { min-height: 48px; padding-left: var(--sp-4); }
  .pg-sales .sl-right .sl-scroll { overflow-y: auto; min-height: 0; }
  .pg-sales .sl-right .sl-foot { position: static; padding-bottom: var(--sp-3); margin-top: auto; }
  .pg-sales .sl-right .btn-action-row { padding: var(--sp-3); }
  .pg-sales .sl-right .sl-line-side { flex-wrap: nowrap; }
  .pg-sales .sl-right .sl-line { flex-wrap: wrap; }
  .pg-sales .sl-right .sl-line-side { width: 100%; justify-content: space-between; }
  .pg-sales .sl-view.sl-sub { max-width: 560px; }
}
@media (min-width: 900px) and (max-width: 1100px) {
  .pg-sales .sl-left .tile { font-size: 13px; }
}
