/* Bảng khách (Today / History) + chip voucher trong bảng.
   Thứ tự nạp: templates/_styles.html */

/* TABLE */
.tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;width:100%;max-width:100%}
.tbl-card{background:var(--card);border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.07);overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:14px}
.guest-list th:not(:last-child), .guest-list td:not(:last-child){border-right:1px solid #e2e8e0}
.guest-list th.col-num, .guest-list td.col-num{
  width:1%;
  max-width:34px;
  min-width:26px;
  padding-left:3px;
  padding-right:3px;
  text-align:center;
  vertical-align:middle;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.guest-list th.col-num{font-size:10px;line-height:1.2;letter-spacing:.02em;padding-top:8px;padding-bottom:8px}
.guest-list td.col-num{color:#9ca3af;font-size:10px}
.guest-list th.col-guest, .guest-list td.col-guest{width:1%;min-width:120px;max-width:176px}
.guest-list td.col-guest{word-break:break-word}
.guest-list th.col-benefits, .guest-list td.col-benefits{min-width:445px;max-width:603px;width:33.6%}
.guest-list td.col-benefits .pill-row{max-width:none}
.guest-list td.col-benefits .ben-udfc{
  margin-bottom:4px;
  display:flex;
  align-items:baseline;
  gap:5px;
  min-width:0;
  max-width:100%;
  cursor:default;
}
.guest-list td.col-benefits .ben-udfc-lbl{
  flex-shrink:0;
  font-size:10px;
  font-weight:700;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.guest-list td.col-benefits .ben-udfc-txt{
  flex:1;
  min-width:0;
  font-size:11px;
  line-height:1.2;
  color:#374151;
  word-break:break-word;
  overflow:hidden;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.guest-list th.col-abf, .guest-list td.col-abf{
  width:1%;
  max-width:40px;
  min-width:34px;
  padding-left:4px;
  padding-right:4px;
  text-align:center;
  vertical-align:middle;
  white-space:nowrap;
}
.guest-list th.col-abf{font-size:10px;line-height:1.2;letter-spacing:.02em;padding-top:8px;padding-bottom:8px}
.udfc-tag{display:inline-block;font-size:10px;font-weight:700;padding:1px 5px;border-radius:4px;vertical-align:baseline;line-height:1.4;white-space:nowrap}
.udfc-tag-comp{background:#fce7f3;color:#9d174d;border:1px solid #fbcfe8}
.udfc-tag-voucher{background:#ede9fe;color:#5b21b6;border:1px solid #ddd6fe}
.guest-list th.col-room, .guest-list td.col-room{width:1%;max-width:68px;min-width:48px;padding-left:5px;padding-right:5px;text-align:center;vertical-align:middle}
.guest-list th.col-room{font-size:11px;letter-spacing:.02em;padding:8px 4px}
.guest-list td.col-room .rm-badge{max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
.guest-list th.col-class, .guest-list td.col-class{width:1%;max-width:66px;min-width:52px;padding-left:4px;padding-right:4px;text-align:center;white-space:nowrap}
.guest-list th.col-class{font-size:11px;letter-spacing:.02em;padding:8px 4px}
.guest-list th.col-adult, .guest-list td.col-adult{width:1%;max-width:61px;min-width:49px;padding-left:4px;padding-right:4px;text-align:center;white-space:nowrap}
.guest-list th.col-adult{font-size:11px;letter-spacing:.02em;padding:8px 4px}
.guest-list th.col-children, .guest-list td.col-children{width:1%;max-width:61px;min-width:49px;padding-left:4px;padding-right:4px;text-align:center;white-space:nowrap}
.guest-list th.col-children{font-size:11px;letter-spacing:.02em;padding:8px 4px}
.guest-list th.col-infant, .guest-list td.col-infant{width:1%;max-width:56px;min-width:44px;padding-left:4px;padding-right:4px;text-align:center;white-space:nowrap}
.guest-list th.col-infant{font-size:11px;letter-spacing:.02em;padding:8px 4px}
.guest-list th.col-stay-dates, .guest-list td.col-stay-dates{width:1%;min-width:100px;max-width:124px;padding-left:6px;padding-right:6px;vertical-align:middle}
.guest-list th.col-stay-dates{
  font-size:10px;
  line-height:1.25;
  padding:8px 5px;
  letter-spacing:.02em;
  white-space:normal;
  text-align:left;
  text-transform:uppercase;
}
.guest-list td.col-stay-dates{color:#6b7280}
.guest-list .stay-dates-stack{display:flex;flex-direction:column;gap:4px;line-height:1.35}
.guest-list .stay-dates-stack .sd-row{font-size:13px;font-variant-numeric:tabular-nums}
.guest-list .stay-dates-stack .sd-arr{color:#374151;font-weight:600}
.guest-list .stay-dates-stack .sd-dep{color:#4b5563;font-size:13px;font-weight:500}
.guest-list .stay-dates-stack .sd-ci{font-size:12px;font-weight:600;color:#15803d;white-space:nowrap}
thead{background:#f8faf9;border-bottom:2px solid #d1fae5}
th{padding:8px 9px;text-align:left;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.4px;color:#374151;white-space:nowrap}
td{padding:7px 9px;border-bottom:1px solid #f3f4f6;vertical-align:middle}
tr:last-child td{border-bottom:none}
tr:hover td{background:#fafffe}
tr.ci-row td{background:#f0fdf4}
tr.ci-row:hover td{background:#dcfce7}
.rm-badge{display:inline-block;font-weight:700;font-size:13px;padding:2px 8px;border-radius:5px}
.rm-fr{background:#dbeafe;color:#1e40af}.rm-fv{background:#ede9fe;color:#5b21b6}
.rc-badge{font-size:11px;font-weight:700;padding:2px 6px;border-radius:10px;display:inline-block}
.rc-fr{background:#dbeafe;color:#1e40af}.rc-fv{background:#ede9fe;color:#6d28d9}
.nb{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:4px;font-size:12px;font-weight:700}
.nb-a{background:#dbeafe;color:#1d4ed8}.nb-c{background:#fef3c7;color:#92400e}
.pill{display:inline-flex;align-items:center;gap:2px;font-size:11px;font-weight:600;padding:1px 5px;border-radius:8px;white-space:nowrap}
.p-abf{background:#dcfce7;color:#166534}.p-spa{background:#fdf4ff;color:#6b21a8}
.p-pick{background:#eff6ff;color:#1e40af}.p-tea{background:#fffbeb;color:#92400e}
.p-fb{background:#f0fdf4;color:#065f46}.p-msg{background:#f5f3ff;color:#4c1d95}
.pill-row{display:flex;flex-wrap:wrap;gap:2px;max-width:180px}
.nm{font-weight:600;font-size:14px;color:#111827}.nm-sub{font-size:12px;color:#374151}
/* Không có first name (vd "Mr De Vincentis Salvatore" nằm hết ở last name) → hiển thị như tên chính */
.nm:empty{display:none}
.nm:empty + .nm-sub{font-size:14px;font-weight:600;color:#111827}
/* Adult/Children/Infant — xem paxCellHtml() trong app.js */
.guest-list td.pax-cell{font-size:12px;font-weight:600;color:#1d4ed8}
.guest-list td.pax-cell.is-zero{color:#9ca3af;font-weight:500}
.guest-list th.col-identity, .guest-list td.col-identity{display:none}
.cell-identity{display:flex;flex-direction:column;gap:1px;font-size:11px;line-height:1.35;color:#374151}
.cell-identity .id-line{display:flex;align-items:baseline;gap:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cell-identity .id-lbl{flex-shrink:0;font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#9ca3af;min-width:32px}
.id-dash{color:#d1d5db}
.guest-list th.col-bnote, .guest-list td.col-bnote{min-width:180px;max-width:280px;width:1%;vertical-align:top;padding:6px 8px}
.cell-bnote{font-size:11px;line-height:1.35;color:#4b5563;max-height:54px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;padding:3px 6px;background:rgba(99,102,241,.06);border-left:2px solid #818cf8;border-radius:3px;cursor:help}
.sd{display:inline-flex;align-items:center;gap:3px;font-size:12px;font-weight:600;padding:2px 7px;border-radius:10px}
.sd-w{background:#f1f5f9;color:#475569}.sd-i{background:#dcfce7;color:#166534}
.ci-btn{padding:7px 12px;min-height:32px;border-radius:7px;font-size:12px;font-weight:600;border:none;cursor:pointer;transition:all .15s}
/* Cột nút (View details / Check in now) luôn dính mép phải khi bảng phải cuộn ngang
   (laptop < 1460px, tablet) — thứ tự cột không đổi, chỉ không bị khuất nữa */
.guest-list .col-act{position:sticky;right:0;z-index:1;width:1%;white-space:nowrap;background:var(--card);box-shadow:-6px 0 8px -6px rgba(15,23,42,.18)}
.guest-list thead .col-act{background:#f8faf9}
.guest-list tr:hover td.col-act{background:#fafffe}
.guest-list tr.ci-row td.col-act{background:#f0fdf4}
.guest-list tr.ci-row:hover td.col-act{background:#dcfce7}
.ci-w{background:var(--g);color:#fff}.ci-d{background:#dcfce7;color:#166534}.ci-view{background:#e0e7ff;color:#3730a3}
.svc-used{display:inline-flex;align-items:center;gap:3px;font-size:9px;font-weight:600;padding:2px 6px;border-radius:8px}
.svc-spa{background:#fdf4ff;color:#6b21a8;border:1px solid #e9d5ff}
.svc-tea{background:#fffbeb;color:#92400e;border:1px solid #fde68a}
.svc-msg{background:#f5f3ff;color:#4c1d95;border:1px solid #ddd6fe}
.svc-fb{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}
.svc-other{background:#f9fafb;color:#374151;border:1px solid #e5e7eb}
.svc-row{display:flex;flex-wrap:wrap;gap:2px}

@media(max-width:1024px){.guest-list{width:max-content}}

/* ── VOUCHER (dữ liệu từ voucher_parser backend) ───────────────────── */
.vchip-row{display:flex;flex-wrap:wrap;gap:3px;margin-top:3px}
.vchip{display:inline-flex;align-items:center;gap:3px;font-size:10px;font-weight:600;
       padding:1px 6px;border-radius:9px;white-space:nowrap;line-height:1.6;border:1px solid}
.vchip.v-fbsf {background:#fff1f2;color:#9f1239;border-color:#fecdd3}
.vchip.v-spagc{background:#f5f3ff;color:#5b21b6;border-color:#ddd6fe}
.vchip.v-bevc {background:#ecfeff;color:#155e75;border-color:#a5f3fc}
.vchip.v-atc  {background:#f0fdf4;color:#166534;border-color:#bbf7d0}
