/* Chair trong Quick Sale — seatMap.quicksale.js.
   Nằm ngoài scope .sm vì được chèn vào #quickSaleModal.

   Thanh ghế ở đầu khu Client (cả khi chưa có client và khi đã có client):
       #35961                                   [🪑 No chair ▾]
   Chip thay chỗ nhãn Appointment / Walk-in. Khi Seat Map bật, .cart-sidebar có class .qs-seat-on:
   thanh này thay hàng tiêu đề cũ và khu Client được rút gọn (cửa hàng không dùng Seat Map không bị đổi). */

/* ---------- thanh: số ticket trái, chip phải ---------- */
.qs-seat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 6px;
}
.qs-seat-bar__ticket {
  min-width: 0;
}
/* Số ticket lấy lại style gốc của nhãn #id; chỉ bỏ margin thừa. */
.qs-seat-bar .qs-customer-label {
  margin: 0;
}

/* Hàng tiêu đề cũ (#id + Appointment) và số #id trong thẻ client được thay bằng thanh trên. */
.cart-sidebar.qs-seat-on .qs-customer-empty .qs-customer-heading,
.cart-sidebar.qs-seat-on .qs-client-identity .qs-customer-label {
  display: none;
}

/* ---------- chip ---------- */
.qs-chair-chip {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--sm-d-green-line, #baf3df);
  border-radius: 999px;
  background: var(--sm-d-green-soft, #ecfdf5);
  color: var(--sm-d-green-text, #209d82);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.qs-chair-chip:hover {
  border-color: #209d82;
}
.qs-chair-chip:focus-visible {
  outline: 2px solid #209d82;
  outline-offset: 1px;
}
.qs-chair-chip > i {
  font-size: 13px;
}
.qs-chair-chip .qs-chair-chip__caret {
  font-size: 9px;
  opacity: 0.7;
}
.qs-chair-chip__text {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.qs-chair-chip__text small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}

/* Chưa có ghế: cam (màu cam của hệ thống), viền đứt để gợi ý "bấm để chọn". */
.qs-chair-chip--empty {
  border: 1px dashed var(--bs-orange, #fd7e14);
  background: var(--sm-d-orange-soft, #fff4e8);
  color: var(--sm-d-orange-text, #c2570a);
}
.qs-chair-chip--empty:hover {
  border-style: solid;
  border-color: var(--bs-orange, #fd7e14);
  background: var(--sm-d-orange-soft, #ffeedd);
}
.qs-chair-chip--empty:focus-visible {
  outline-color: var(--bs-orange, #fd7e14);
}
/* Đã chọn ghế nhưng ticket chưa check-in: cam, viền liền, kèm chú thích "at check-in". */
.qs-chair-chip--pending {
  border: 1px solid var(--bs-orange, #fd7e14);
  background: var(--sm-d-orange-soft, #fff4e8);
  color: var(--sm-d-orange-text, #c2570a);
}
.qs-chair-chip--pending:hover {
  border-color: var(--bs-orange, #fd7e14);
  background: var(--sm-d-orange-soft, #ffeedd);
}
.qs-chair-chip--pending:focus-visible {
  outline-color: var(--bs-orange, #fd7e14);
}

/* ---------- popup chọn ghế (gắn vào <body>, nằm trên Quick Sale) ---------- */
.qs-pick-backdrop {
  position: fixed;
  inset: 0;
  /* #quickSaleModal là z-index 9999, PIN overlay 10050, SweetAlert 10100. */
  z-index: 10200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 24, 40, 0.45);
}
.qs-pick {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  max-height: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: var(--sm-d-surface, #fff);
  color: var(--sm-d-text, #101828);
  box-shadow: 0 20px 48px rgba(16, 24, 40, 0.28);
}
.qs-pick button {
  font-family: inherit;
}
.qs-pick__main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.qs-pick__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 8px;
}
.qs-pick__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.qs-pick__sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--sm-d-muted, #667085);
}
.qs-pick__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sm-d-muted, #667085);
  cursor: pointer;
}
.qs-pick__x:hover {
  background: var(--sm-d-surface2, #f2f4f7);
}
.qs-pick__search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 20px 4px;
  padding: 0 12px;
  height: 42px;
  border: 1px solid var(--sm-d-line, #d0d5dd);
  border-radius: 10px;
  color: var(--sm-d-muted, #667085);
}
.qs-pick__search:focus-within {
  border-color: var(--bs-primary, #3a9821);
  box-shadow: 0 0 0 3px rgba(58, 152, 33, 0.18);
}
.qs-pick__search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--sm-d-text, #101828);
}
.qs-pick__tabs {
  display: flex;
  gap: 4px;
  margin: 8px 20px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--sm-d-line, #eaecf0);
}
.qs-pick__tab {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--sm-d-muted, #475467);
  cursor: pointer;
}
.qs-pick__tab b {
  font-size: 14px;
  font-weight: 600;
}
.qs-pick__tab small {
  font-size: 12px;
  color: var(--sm-d-muted, #667085);
}
.qs-pick__tab.is-on {
  border-bottom-color: var(--bs-primary, #3a9821);
  color: var(--bs-primary, #3a9821);
}
.qs-pick__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex: 1 1 auto;
  min-height: 80px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 14px 20px 10px;
}
.qs-pick__chair {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 56px;
  border: 1px solid var(--sm-d-line, #d0d5dd);
  border-radius: 8px;
  background: var(--sm-d-surface, #fff);
  color: var(--sm-d-text, #101828);
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.qs-pick__chair {
  position: relative;
}
.qs-pick__chair-ico {
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 10px;
  color: var(--sm-d-faint, #98a2b3);
}
.qs-pick__chair.is-queue .qs-pick__chair-ico {
  color: var(--bs-primary, #3a9821);
}
.qs-pick__chair.is-booked .qs-pick__chair-ico {
  color: var(--sm-d-orange-text, #c2570a);
}
.qs-pick__chair.is-sel .qs-pick__chair-ico {
  color: var(--sm-d-on-brand, #fff);
}
.qs-pick__chair b {
  font-size: 14px;
  font-weight: 700;
}
.qs-pick__hidden {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 20px 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--sm-d-surface2, #f2f4f7);
  font-size: 12px;
  color: var(--sm-d-muted, #667085);
}
.qs-pick__chair small {
  font-size: 11px;
  color: var(--sm-d-muted, #667085);
}
.qs-pick__chair:hover {
  border-color: var(--bs-primary, #3a9821);
}
.qs-pick__chair.is-booked {
  border-color: var(--sm-d-orange-line, #f5b57a);
  background: var(--sm-d-orange-soft, #fff7ed);
}
.qs-pick__chair.is-queue {
  border-style: dashed;
  border-color: var(--bs-primary, #3a9821);
}
.qs-pick__chair.is-queue small {
  color: var(--bs-primary, #3a9821);
}
.qs-pick__chair.is-sel {
  border-color: var(--bs-primary, #3a9821);
  background: var(--bs-primary, #3a9821);
  color: var(--sm-d-on-brand, #fff);
}
.qs-pick__chair.is-sel small {
  color: var(--sm-d-on-brand, rgba(255, 255, 255, 0.85));
}
.qs-pick__empty {
  grid-column: 1 / -1;
  margin: 12px 0;
  text-align: center;
  font-size: 13px;
  color: var(--sm-d-muted, #667085);
}
.qs-pick__legend {
  display: flex;
  gap: 16px;
  padding: 2px 20px 12px;
  font-size: 12px;
  color: var(--sm-d-muted, #475467);
}
.qs-pick__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.qs-pick__dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--sm-d-line, #d0d5dd);
  border-radius: 3px;
  background: var(--sm-d-surface, #fff);
}
.qs-pick__dot.is-sel {
  border-color: var(--bs-primary, #3a9821);
  background: var(--bs-primary, #3a9821);
}
.qs-pick__dot.is-queue {
  border-style: dashed;
  border-color: var(--bs-primary, #3a9821);
}
.qs-pick__dot.is-booked {
  border-color: var(--sm-d-orange-line, #f5b57a);
  background: var(--sm-d-orange-soft, #fff7ed);
}
/* Thẻ <div> (không dùng <footer>): CSS toàn cục của POS ép footer max-height 32px làm các nút tràn ra ngoài. */
.qs-pick__foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--sm-d-line, #eaecf0);
  background: var(--sm-d-surface2, #f9fafb);
}
.qs-pick__none {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--sm-d-red-line, #fda29b);
  border-radius: 10px;
  background: var(--sm-d-surface, #fff);
  color: var(--sm-d-red-text, #b42318);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.qs-pick__none:hover {
  background: var(--sm-d-red-soft, #fef3f2);
}
.qs-pick__btn {
  min-width: 96px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--sm-d-line, #98a2b3);
  border-radius: 10px;
  background: var(--sm-d-surface, #fff);
  color: var(--sm-d-text, #344054);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.qs-pick__btn:hover {
  background: var(--sm-d-surface2, #f2f4f7);
}
.qs-pick__btn--primary {
  border-color: var(--bs-primary, #3a9821);
  background: var(--bs-primary, #3a9821);
  color: var(--sm-d-on-brand, #fff);
}
.qs-pick__btn--primary:hover {
  background: #2f7d1a;
}
/* Assign chưa chọn ghế khác: xám đậm, chữ vẫn đọc được (không mờ như trước). */
.qs-pick__btn:disabled,
.qs-pick__btn--primary:disabled {
  border-color: var(--sm-d-line, #d0d5dd);
  background: var(--sm-d-surface2, #e4e7ec);
  color: var(--sm-d-muted, #667085);
  cursor: not-allowed;
}

/* ---------- khu Client gọn hơn khi Seat Map bật ---------- */
/* Đường kẻ giữa khu Client và danh sách món/nhân viên (gốc 1px gần như trùng màu nền) — dày và đậm hơn để tách rõ. */
.cart-sidebar.qs-seat-on .client-header {
  border-bottom: 1px solid var(--sm-d-line, #ebf0ed);
  box-shadow: 0 2px 4px rgba(22, 38, 26, 0.06);
  /* Nền xám nhạt của hệ thống (cùng màu nền trang). */
  background: var(--bs-surface-2-bg);
}
/* Chưa có client: bớt padding, bỏ dòng phụ "Attach phone or reward points".
   Nền trong suốt để cùng màu với thanh .qs-seat-bar và .client-header, hai phần liền một khối. */
.cart-sidebar.qs-seat-on .qs-customer-empty {
  padding: 0 12px 10px;
  background: transparent;
}
.cart-sidebar.qs-seat-on .client-card-container {
  padding: 6px 10px;
}
/* Đang chọn / thêm client: form không có padding ngang, nên thanh ghế bỏ padding để #id thẳng hàng với tiêu đề
   và chip ghế thẳng mép phải với nút X; bớt khoảng trống phía trên để form không bị đẩy xuống. */
.cart-sidebar.qs-seat-on .client-header:has(.client-inline-picker, .client-inline-form) .qs-seat-bar {
  padding: 0 0 12px;
}
.cart-sidebar.qs-seat-on .client-header:has(.client-inline-picker, .client-inline-form) .client-inline-picker__head {
  margin-bottom: 12px;
}
.cart-sidebar.qs-seat-on .client-card-icon-wrapper {
  width: 30px;
  height: 30px;
}
.cart-sidebar.qs-seat-on .qs-customer-subtitle {
  display: none;
}

/* Có client: thẻ bớt padding, avatar nhỏ lại, hai ô thống kê thấp hơn (nhãn trên, giá trị dưới, không bị cắt). */
.cart-sidebar.qs-seat-on .qs-client-header-wrapper {
  padding: 0 8px 8px;
}
.cart-sidebar.qs-seat-on .qs-client-summary-card {
  padding: 8px 10px;
}
.cart-sidebar.qs-seat-on .qs-client-avatar-circle {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.cart-sidebar.qs-seat-on .qs-client-stats {
  gap: 6px;
  margin-top: 6px;
}
.cart-sidebar.qs-seat-on .qs-client-stat {
  min-height: 0;
  padding: 5px 8px;
}
.cart-sidebar.qs-seat-on .qs-client-stat-label {
  margin-bottom: 2px;
}
.cart-sidebar.qs-seat-on .qs-client-stat-label {
  font-size: 10px;
  line-height: 1.2;
}
.cart-sidebar.qs-seat-on .qs-client-stat-value {
  font-size: 13px;
  line-height: 1.25;
}
.cart-sidebar.qs-seat-on .qs-client-note {
  margin-top: 6px;
  padding-top: 3px;
  padding-bottom: 3px;
}
