/*
 * Module checkve — BẢN DUY NHẤT (themes/default).
 * Module luôn enqueue file này dù site đang dùng theme nào (xem modules/checkve/theme.php).
 */

/* Trên mobile / viewport hẹp: đảm bảo form luôn nhận click (tránh kế thừa pointer-events từ theme hoặc lớp che). */
.checkve-page {
  position: relative;
  z-index: 2;
}
@media screen and (max-width: 991px) {
  .checkve-page {
    z-index: 100;
  }
  /* Khi list chọn tuyến đang mở: nổi cả khối module lên (tránh menu/footer theme đè) */
  .checkve-page.checkve-page-dropdown-open {
    z-index: 100080 !important;
    position: relative;
  }
}
.checkve-page .panel,
.checkve-page .panel-body,
.checkve-page input,
.checkve-page select,
.checkve-page button,
.checkve-page textarea,
.checkve-page label {
  pointer-events: auto;
  touch-action: manipulation;
}

/*
 * Hàng form “Điều kiện tìm kiếm”: BS3 .row dùng ::before/::after clearfix.
 * Khi viewport gập cột (3→2→1), nếu ép flex hoặc một số theme kết hợp float,
 * pseudo-element có thể thành lớp vô hình chặn click lên select.
 * Dùng flex + tắt clearfix pseudo trên đúng hàng này.
 */
.checkve-page .checkve-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}
@media screen and (min-width: 992px) {
  .checkve-page .checkve-search-row {
    align-items: flex-end;
  }
}
.checkve-page .checkve-search-row::before,
.checkve-page .checkve-search-row::after {
  content: none !important;
  display: none !important;
}
.checkve-page .checkve-search-row > .checkve-search-col {
  float: none !important;
  position: relative;
  z-index: 2;
  min-height: 0;
  /* Flex: tránh input[type=date] (min-width nội tại WebKit) đẩy cột rộng hơn tuyến/chuyến — hay gặp trên iPad */
  min-width: 0;
}
.checkve-page .checkve-search-row > .checkve-search-col[style*="display:none"],
.checkve-page .checkve-search-row > .checkve-search-col[style*="display: none"] {
  display: none !important;
}
.checkve-page .checkve-search-row .form-control,
.checkve-page .checkve-search-row select,
.checkve-page .checkve-search-row input[type="date"] {
  position: relative;
  z-index: 3;
}

/* Ô ngày: shell flex = cùng chiều rộng cột với facade; font 16px mobile giảm zoom iOS */
.checkve-page .checkve-date-field-group {
  margin-bottom: 15px;
  max-width: 100%;
  min-width: 0;
}
.checkve-page .checkve-date-field-group > .control-label {
  cursor: pointer;
}
.checkve-page .checkve-date-input-shell {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  position: relative;
  display: block;
}
.checkve-page .checkve-date-input-shell .checkve-date-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.checkve-page .checkve-date-input {
  min-height: 34px;
  font-size: 16px;
  line-height: 1.35;
  cursor: pointer;
}
.checkve-page .checkve-date-sheet-btn {
  display: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  font-size: 16px;
  line-height: 1.35;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  color: #333;
  cursor: pointer;
  user-select: none;
  /* Match .form-control (select facade uses form-control) */
  padding: 6px 12px;
}
.checkve-page .checkve-date-sheet-btn .checkve-date-sheet-btn-lbl {
  flex: 1;
  min-width: 0;
}
.checkve-page .checkve-date-sheet-btn .checkve-date-sheet-caret {
  flex-shrink: 0;
  opacity: 0.55;
  font-size: 12px;
}
/* WebKit (Safari/iPad): phần hiển thị ngày trong ô date đôi khi vượt chiều rộng cột */
.checkve-page .checkve-date-input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  max-width: 100%;
}
.checkve-page .checkve-date-input[type="date"]::-webkit-datetime-edit {
  padding: 0;
  max-width: 100%;
}
/* PC: cùng chiều cao với select .form-control BS3; khối label cao hơn để bấm quanh ô + căn đáy */
@media screen and (min-width: 768px) {
  .checkve-page .checkve-search-row select.form-control,
  .checkve-page .checkve-search-row input.checkve-date-input[type="date"] {
    height: 34px;
    min-height: 34px;
    padding: 6px 12px;
    line-height: 1.42857143;
    font-size: 14px;
  }
  .checkve-page .checkve-date-field-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 62px;
  }
  /* Desktop/tablet: chỉ ô date native; ẩn nút lịch mobile */
  .checkve-page .checkve-date-input-shell .checkve-date-sheet-btn {
    display: none !important;
  }
  .checkve-page .checkve-date-input-shell .checkve-date-input[type="date"] {
    position: relative !important;
    width: 100% !important;
    height: 34px !important;
    min-height: 34px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    clip: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    border: 1px solid #ccc;
    left: auto !important;
    top: auto !important;
  }
}

/*
 * Mobile: thay menu select hệ thống (thường full màn) bằng panel cùng chiều rộng cột.
 * Desktop (≥768px): chỉ hiện <select> gốc.
 */
.checkve-page .checkve-select-facade {
  position: relative;
  width: 100%;
  max-width: 100%;
}
.checkve-page .checkve-select-facade-btn {
  display: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  font-size: 16px;
  line-height: 1.35;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  color: #333;
  cursor: pointer;
  user-select: none;
}
.checkve-page .checkve-select-facade-btn .checkve-select-facade-lbl {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checkve-page .checkve-select-facade-btn .checkve-select-facade-caret {
  flex-shrink: 0;
  opacity: 0.55;
  font-size: 12px;
}
.checkve-page .checkve-select-facade-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
.checkve-page .checkve-select-facade-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 200;
  max-height: min(55vh, 320px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
  box-sizing: border-box;
}
.checkve-page .checkve-select-facade-panel.checkve-open {
  display: block;
}
.checkve-page .checkve-select-facade-opt {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
  color: #222;
}
.checkve-page .checkve-select-facade-opt:hover,
.checkve-page .checkve-select-facade-opt:focus {
  background: #f5f5f5;
  outline: none;
}
.checkve-page .checkve-select-facade-opt.is-selected {
  background: #e9ecef;
  font-weight: 600;
  color: #222;
}
.checkve-page .checkve-select-facade-opt.is-disabled,
.checkve-page .checkve-select-facade-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media screen and (max-width: 767px) {
  /* Trên mobile: ép mỗi cột chiếm đủ hàng để tránh lệch bề rộng giữa các row */
  .checkve-page .checkve-search-row > .checkve-search-col {
    flex: 0 0 100%;
    max-width: 100%;
  }
  /* Mobile: tránh .checkve-date-field-group bị hẹp hơn .form-group thường */
  .checkve-page .checkve-date-field-group {
    max-width: none;
    width: auto;
  }
  .checkve-page .checkve-search-row select.form-control {
    font-size: 16px;
  }

  /*
   * Điều kiện tìm kiếm: nhãn + ô (select facade / date / …) cùng một hàng — cùng tỷ lệ cột cho mọi .form-group.
   */
  .checkve-page .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px 8px;
    margin-bottom: 8px;
  }
  .checkve-page .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > .control-label {
    flex: 0 0 32%;
    max-width: 40%;
    min-width: 0;
    margin: 0;
    padding: 0;
    text-align: left;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    color: #333;
  }
  .checkve-page .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > .checkve-select-facade,
  .checkve-page .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > select.form-control,
  .checkve-page .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > div.form-control,
  .checkve-page .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > .checkve-date-input-shell {
    flex: 1 1 0%;
    min-width: 0;
    width: auto !important;
    max-width: none;
  }
  /* Mobile: input date gốc ẩn; nút sheet full width trong shell — bằng ô Chuyến/Lượt */
  .checkve-page .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) .checkve-date-input-shell .checkve-date-input[type="date"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    left: 0;
    top: 0;
  }
  .checkve-page .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) .checkve-date-input-shell .checkve-date-sheet-btn {
    display: flex !important;
    min-height: 36px;
    align-items: flex-start;
    padding: 5px 12px;
    height: auto;
  }
  /* BS3 form-horizontal / theme: tắt float để flex một hàng hoạt động */
  .checkve-page #checkveSearchForm.form-horizontal .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > .control-label {
    float: none !important;
  }
  .checkve-page #checkveSearchForm.form-horizontal .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > .checkve-select-facade,
  .checkve-page #checkveSearchForm.form-horizontal .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > select.form-control,
  .checkve-page #checkveSearchForm.form-horizontal .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > div.form-control,
  .checkve-page #checkveSearchForm.form-horizontal .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > .checkve-date-input-shell {
    float: none !important;
  }

  /* Panel lịch mobile: absolute trong shell; cả cột được nâng z-index để hàng Ngày về không đè lịch Ngày đi */
  .checkve-page .checkve-date-input-shell.checkve-date-shell-panel-open {
    z-index: 100068;
  }
  .checkve-page .checkve-search-col.checkve-date-col-panel-open {
    position: relative;
    z-index: 100070 !important;
  }
  /* Căn phải theo ô ngày (ô nằm bên phải nhãn); không tràn ngang; lưới co trong panel */
  .checkve-page .checkve-date-sheet-panel {
    display: none;
    position: absolute;
    right: 0;
    left: auto;
    top: calc(100% + 4px);
    width: min(360px, calc(100vw - 24px));
    margin: 0;
    z-index: 2;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    padding: 8px;
    box-sizing: border-box;
    max-height: min(58vh, 380px);
    overflow-x: hidden;
    overflow-y: auto;
  }
  .checkve-page .checkve-date-sheet-panel.checkve-open {
    display: block;
  }
  .checkve-page .checkve-date-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }
  .checkve-page .checkve-date-sheet-head button {
    border: 1px solid #ddd;
    background: #f8f8f8;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    min-width: 36px;
    min-height: 32px;
  }
  .checkve-page .checkve-date-sheet-title {
    font-weight: 700;
    font-size: 15px;
    flex: 1;
    text-align: center;
  }
  .checkve-page .checkve-date-sheet-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #666;
    text-align: center;
  }
  .checkve-page .checkve-date-sheet-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }
  .checkve-page .checkve-date-sheet-ph {
    min-height: 0;
    aspect-ratio: 1;
    max-height: 40px;
    pointer-events: none;
  }
  .checkve-page .checkve-date-sheet-day {
    box-sizing: border-box;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 4px;
    padding: 6px 2px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    max-height: 40px;
    line-height: 1.15;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .checkve-page .checkve-date-sheet-day:disabled,
  .checkve-page .checkve-date-sheet-day.is-out,
  .checkve-page .checkve-date-sheet-day.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f5f5f5;
  }
  .checkve-page .checkve-date-sheet-day.is-other-month {
    opacity: 0.55;
    color: #666;
  }
  .checkve-page .checkve-date-sheet-day.is-today {
    border-color: #ff5437;
    font-weight: 700;
  }

  /* Nút + danh sách: chiều cao gọn hơn (vẫn đủ vùng chạm) */
  .checkve-page .checkve-select-facade-btn {
    min-height: 36px;
    height: auto;
    align-items: flex-start;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .checkve-page .checkve-select-facade-btn .checkve-select-facade-lbl {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
  }
  /* Đồng bộ label nút ngày với label facade */
  .checkve-page .checkve-date-sheet-btn .checkve-date-sheet-btn-lbl {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
  }
  .checkve-page .checkve-select-facade-opt {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-height: 36px;
    line-height: 1.35;
  }
  .checkve-page .checkve-select-facade > select.form-control {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    left: 0;
    top: 0;
  }
  .checkve-page .checkve-select-facade-btn {
    display: flex !important;
  }

  /*
   * Panel xổ xuống: tránh bị cột flex phía sau / nội dung bên dưới đè lên;
   * tránh bị .panel-body overflow cắt mất.
   */
  .checkve-page .panel,
  .checkve-page .panel-body,
  .checkve-page .checkve-search-row,
  .checkve-page .checkve-search-col,
  .checkve-page .checkve-search-row .form-group {
    overflow: visible !important;
  }
  .checkve-page .checkve-ajax-root,
  .checkve-page #checkve-root {
    overflow: visible !important;
  }
  .checkve-page .checkve-select-facade-panel.checkve-open {
    z-index: 100050;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  }
  /* Cột đang mở list nổi lên trên mọi cột khác trong form (:has + class JS) */
  .checkve-page .checkve-search-col:has(.checkve-select-facade-panel.checkve-open),
  .checkve-page .checkve-search-col.checkve-col-dropdown-open {
    position: relative;
    z-index: 100060 !important;
  }
  .checkve-page .checkve-select-facade:has(.checkve-select-facade-panel.checkve-open) {
    z-index: 1;
  }

  /* SPD mobile: cột ghế căn trái (màn hẹp) */
  .checkve-page .checkve-spd-trip-card .checkve-spd-list-seats {
    text-align: left !important;
  }

  /*
   * Thẻ chuyến PQE: giữ 2 cột (trái = thông tin chuyến, phải = ghế trống/VIP/Eco).
   * Trước đây .checkve-trip-main { min-width: 200px } + flex-wrap khiến mobile xếp chồng 2 khối.
   */
  .checkve-page .checkve-pqe-trip-card .checkve-dflex-between {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 6px 8px;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-trip-main {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-trip-main .checkve-trip-title {
    font-size: 15px;
    line-height: 1.25;
  }
  /* Cột trái: meta gọn hơn; cột ghế đủ chỗ — tránh một bên quá cao */
  .checkve-page .checkve-pqe-trip-card .checkve-trip-main > .checkve-result-meta {
    font-size: 13px;
    line-height: 1.34;
    margin-bottom: 3px;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-trip-main > .checkve-result-meta:last-child {
    margin-bottom: 0;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-avail-block {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 50%;
    align-items: flex-end;
    text-align: right;
    gap: 4px;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-avail-line {
    font-size: 12px;
    line-height: 1.1;
    margin: 0;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-avail-badge-row {
    margin-bottom: 1px;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-seat-badge {
    font-size: 11px;
    padding: 3px 6px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.22;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-pqe-seatmap-wrap {
    justify-content: flex-end;
    margin-top: 0px;
  }
  .checkve-page .checkve-pqe-trip-card .checkve-pqe-seatmap-btn.btn {
    font-size: 12px;
    padding: 2px 6px;
    white-space: normal;
    max-width: 100%;
    text-align: center;
  }
  .checkve-page .checkve-pqe-inline-calc-table {
    font-size: 12px;
  }
  .checkve-page .checkve-pqe-inline-calc-table .checkve-inline-calc-qty-col {
    width: 36px;
  }
  .checkve-page .checkve-pqe-inline-calc-table .checkve-inline-calc-qty-col .checkve-inline-fare-qty {
    width: 50px;
    box-sizing: border-box;
    min-width: 50px;
    padding: 1px 4px;
    font-size: 12px;
    height: 22px;
    min-height: 22px;
  }
  .checkve-page .checkve-pqe-inline-calc-total {
    margin-top: 4px;
    font-size: 12px;
  }
  .panel-body {
    padding: 10px;
    padding-top: 10px;
    padding-right: 10px;
    padding-bottom: 5px;
    padding-left: 10px;
  }
  .checkve-page .checkve-pqe-fare-cd-bar {
    display: flex;
    justify-content: flex-start;
  }
  .checkve-page .checkve-pqe-fare-rt-bar--under-out-title {
    display: flex;
    justify-content: flex-end;
  }
}

@media screen and (min-width: 768px) {
  .checkve-page .checkve-select-facade-panel {
    display: none !important;
  }
}

/* Khớp lưới 24 cột, Bootstrap 3, không dùng utility BS5 */
.checkve-page .checkve-dflex-between {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.checkve-page .checkve-dflex-center {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.checkve-page .checkve-mb { margin-bottom: 12px; }
.checkve-page .checkve-mt { margin-top: 12px; }
.checkve-page .checkve-trip-title { font-weight: 700; margin-bottom: 4px; }
.checkve-page .checkve-section-title { font-size: 18px; font-weight: 700; margin: 12px 0; color: #333; }
.checkve-page .checkve-trip-main { flex: 1; min-width: 200px; }

/* PQE: ghế trống/VIP/Eco giữ layout cũ (.checkve-avail-block); bảng giá tối giản như checkpqe + ảnh mẫu */
.checkve-page .checkve-pqe-seatmap-wrap {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  width: 100%;
}
.checkve-page .checkve-pqe-seatmap-btn.btn {
  padding: 1px 8px;
  font-size: 12px;
  line-height: 1.25;
  border-radius: 3px;
}
/* .price-table — checkpqe (hàng 💰 Bảng giá vé: gọn chiều cao, ít margin dọc) */
.checkve-page .checkve-pqe-price-table {
  margin-top: 4px;
  padding-top: 4px;
  margin-bottom: 0;
  border-top: 1px dashed #dee2e6;
  font-weight: 600;
}
.checkve-page .checkve-pqe-price-toolbar {
  margin: 0;
  padding: 0;
  line-height: 1.2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}
.checkve-page .checkve-pqe-price-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #666;
  text-align: left;
  max-width: 100%;
  line-height: 1.2;
  vertical-align: middle;
}
.checkve-page .checkve-pqe-price-toggle-pill.small {
  font-size: 12px;
  line-height: 1.2;
}
.checkve-page .checkve-pqe-price-toggle-pill:hover,
.checkve-page .checkve-pqe-price-toggle-pill:focus {
  color: #333;
  outline: none;
}
.checkve-page .checkve-pqe-price-toggle-title {
  display: inline-block;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: inherit;
}
.checkve-page .checkve-pqe-price-toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1.5px solid #198754;
  box-sizing: border-box;
  flex-shrink: 0;
}
.checkve-page .checkve-pqe-price-toggle-pill[aria-expanded="true"] .checkve-pqe-price-toggle-dot {
  background-color: #198754;
}
/* PQE pill giờ chuyến: giống dòng Ngày/Tuyến (#222, nhãn đậm, giá trị thường); hover hơi mờ */
.checkve-page .checkve-pqe-trip-card .checkve-trip-compact-toggle.checkve-pqe-price-toggle-pill {
  color: #222;
  gap: 0;
}
.checkve-page .checkve-pqe-trip-card .checkve-trip-compact-toggle.checkve-pqe-price-toggle-pill .checkve-pqe-price-toggle-title {
  font-weight: 400;
  font-size: 13px;
  line-height: 1.34;
  color: inherit;
}
.checkve-page .checkve-trip-compact-toggle .checkve-pqe-price-toggle-dot {
  display: none;
}
.checkve-page .checkve-pqe-trip-card .checkve-trip-compact-toggle.checkve-pqe-price-toggle-pill .checkve-pqe-price-toggle-title strong {
  font-weight: 600;
}
.checkve-page .checkve-pqe-trip-card .checkve-trip-compact-toggle.checkve-pqe-price-toggle-pill:hover,
.checkve-page .checkve-pqe-trip-card .checkve-trip-compact-toggle.checkve-pqe-price-toggle-pill:focus {
  color: #5a5a5a;
  outline: none;
}
.checkve-page .checkve-pqe-trip-card .checkve-trip-compact-toggle.checkve-pqe-price-toggle-pill:hover .checkve-pqe-price-toggle-dot,
.checkve-page .checkve-pqe-trip-card .checkve-trip-compact-toggle.checkve-pqe-price-toggle-pill:focus .checkve-pqe-price-toggle-dot {
  opacity: 0.88;
}
.checkve-page .checkve-pqe-price-collapse-panel {
  margin-top: 6px;
}
.checkve-page .checkve-pqe-price-missing {
  font-weight: 400;
  margin: 4px 0 0;
  line-height: 1.35;
  font-size: 12px;
}
.checkve-page .checkve-pqe-fare-table-responsive {
  margin-top: 0;
}
/* Bảng 2 cột: nền trắng, kẻ ngang nhạt — giống mẫu Vũng Tàu–Côn Đảo */
.checkve-page .checkve-pqe-fare-table-simple {
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
  background: #fff;
  border: 0;
  font-size: 14px;
}
.checkve-page .checkve-pqe-inline-calc-table {
  /* Nhích 1 nấc để dễ nhìn + giảm rối wrap khi giá/thành tiền đổi */
  font-size: 13px;
  table-layout: auto;
}
.checkve-page .checkve-pqe-inline-calc-table > tbody > tr > td {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  line-height: 1.15;
}
.checkve-page .checkve-pqe-inline-calc-table .checkve-inline-fare-qty {
  /* Nhắm tới chiều cao tối thiểu cho dòng VIP/Phổ thông/Trẻ em/Khuyết tật */
  height: 22px;
  min-height: 22px;
  padding: 1px 4px !important;
  box-sizing: border-box;
}
.checkve-page .checkve-pqe-inline-calc-table > thead > tr > th:first-child,
.checkve-page .checkve-pqe-inline-calc-table > tbody > tr > td:first-child {
  /* Ưu tiên cột "Loại vé": cố định theo nội dung dài nhất */
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.checkve-page .checkve-pqe-fare-table-simple > thead > tr > th {
  border: 0;
  border-bottom: 1px solid #dee2e6;
  padding: 10px 8px 8px 0;
  font-weight: 700;
  color: #333;
  vertical-align: bottom;
}
.checkve-page .checkve-pqe-fare-table-simple > thead > tr > th.text-right {
  padding-right: 0;
  padding-left: 8px;
}
.checkve-page .checkve-pqe-inline-calc-table .checkve-inline-calc-qty-col {
  width: 96px;
}
.checkve-page .checkve-pqe-inline-calc-table .checkve-inline-calc-qty-col .checkve-inline-fare-qty {
  width: 38px;
  margin-left: 0;
  box-sizing: border-box;
  min-width: 35px;
}
.checkve-page .checkve-pqe-fare-table-simple > tbody > tr > td {
  border: 0;
  border-bottom: 1px solid #e8e8e8;
  padding: 10px 8px 10px 0;
  color: #333;
  vertical-align: middle;
}
.checkve-page .checkve-pqe-fare-table-simple > tbody > tr > td.text-right {
  padding-right: 0;
  padding-left: 8px;
  font-weight: 400;
}
.checkve-page .checkve-pqe-fare-table-simple > tbody > tr:last-child > td {
  border-bottom: 1px solid #dee2e6;
}
.checkve-page .checkve-pqe-inline-calc-total {
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: #333;
  line-height: 1.1;
}
.checkve-page .checkve-pqe-inline-calc-total-num {
  color: #ff5437;
  font-weight: 700;
}
.checkve-page .checkve-pqe-fare-note {
  margin-top: 10px;
  font-weight: 400;
  color: #555;
  font-size: 13px;
}
.checkve-page .checkve-pqe-price-row-vip > td {
  background-color: #f9f2be !important;
}

/* Cột phải thẻ chuyến: badge → Ghế trống → VIP → Eco (xếp dọc, căn phải) */
.checkve-page .checkve-avail-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
}
.checkve-page .checkve-avail-badge-row {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2px;
}
.checkve-page .checkve-avail-line {
  width: 100%;
  font-size: 12px;
  color: #555;
  line-height: 1.35;
}
.checkve-page .checkve-avail-line.text-muted { color: #777; }
.checkve-page .checkve-seat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
}
.checkve-page .checkve-seat-badge-toggle {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}
.checkve-page .checkve-seat-badge-toggle:focus { outline: none; }
.checkve-page .checkve-seat-badge-toggle .checkve-seat-badge { cursor: pointer; }
.checkve-page .checkve-spd-remain-toggle {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}
.checkve-page .checkve-spd-remain-toggle:focus { outline: none; }
.checkve-page .checkve-seat-badge--ok {
  color: #fff;
  background: #4caf50;
}
.checkve-page .checkve-seat-badge--full {
  color: #c62828;
  background: #ffc107b8;
}
.checkve-page .checkve-seat-badge--na {
  color: #666;
  background: #e0e0e0;
  font-weight: 600;
}

.checkve-seatmap-loading { color:#ff5437; font-weight:700; }

/* ========== SPD kết quả (bố cục giống nuc-server checksd.php) ========== */
.checkve-page .checkve-spd-results-row {
  margin-bottom: 20px;
}
.checkve-page .checkve-spd-trip-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  margin-bottom: 0;
}
.checkve-page .checkve-spd-card-header {
  background: rgba(34, 126, 244, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.checkve-page .checkve-spd-card-header-main {
  font-weight: 600;
  font-size: 15px;
}
.checkve-page .checkve-spd-card-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.checkve-page .checkve-pqe-fare-cd-bar {
  margin-top: 6px;
  margin-bottom: 4px;
}
.checkve-page .checkve-pqe-out-section-head .checkve-section-title {
  font-size: 15px;
  margin-bottom: 0;
}
.checkve-page .checkve-pqe-out-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
}
.checkve-page .checkve-pqe-out-head-row .checkve-section-title {
  flex: 1 1 auto;
  min-width: 0;
}
.checkve-page .checkve-pqe-fare-rt-bar--under-out-title {
  margin-top: 6px;
  margin-bottom: 2px;
}
.checkve-page .checkve-pqe-fare-cd-bar {
  display: flex;
  justify-content: flex-start;
}
.checkve-page .checkve-pqe-fare-rt-bar--under-out-title {
  display: flex;
  justify-content: flex-end;
}
.checkve-page .checkve-pqe-fare-cd-bar .btn,
.checkve-page .checkve-pqe-fare-rt-bar--under-out-title .btn {
  padding-top: 2px;
  padding-bottom: 2px;
  line-height: 1.2;
}
.checkve-page .checkve-pqe-fare-rt-bar--under-out-title .btn-primary {
  background: #ff5437;
  border-color: #e04a30;
  color: #fff;
}
.checkve-page .checkve-pqe-fare-rt-bar--under-out-title .btn-primary:hover,
.checkve-page .checkve-pqe-fare-rt-bar--under-out-title .btn-primary:focus {
  background: #e04a30;
  border-color: #c73f28;
  color: #fff;
}
.checkve-page .checkve-spd-card-header-meta {
  font-size: 12px;
}
.checkve-page .checkve-spd-card-body {
  padding: 12px 14px;
}
.checkve-page .checkve-spd-leg-title {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 14px;
}
.checkve-page .checkve-spd-leg-title--back {
  margin-top: 18px;
}
.checkve-page .checkve-spd-empty-leg {
  margin-bottom: 10px;
}
.checkve-page .checkve-spd-list-group {
  margin-bottom: 0;
}
.checkve-page .checkve-spd-list-group .list-group-item {
  border-radius: 0;
}
.checkve-page .checkve-spd-list-group .list-group-item:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.checkve-page .checkve-spd-list-col.checkve-spd-list-pick {
  flex: 0 0 auto;
  min-width: 64px;
  padding-right: 0;
  padding-left: 10px;
  align-self: center;
}
/* SPD một chuyến: 3 cột co giãn (giờ+tàu | Chọn+sơ đồ | ghế trống+tổng) */
.checkve-page .checkve-spd-list-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 10px;
  width: 100%;
  align-items: start;
}
.checkve-page .checkve-spd-grid-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.checkve-page .checkve-spd-grid-col--mid .checkve-spd-grid-cell--seatmap .checkve-seatmap-btn {
  margin: 0;
}
.checkve-page .checkve-spd-grid-cell--time .checkve-trip-compact-toggle {
  vertical-align: baseline;
}
.checkve-page .checkve-spd-list-grid--compact {
  gap: 4px 8px;
}
.checkve-page .checkve-spd-list-grid--compact .checkve-spd-grid-col--mid {
  justify-content: center;
}
.checkve-page .checkve-spd-list-grid--compact .checkve-spd-grid-col--right {
  justify-content: center;
}
.checkve-page .checkve-spd-grid-col--left {
  align-items: flex-start;
}
.checkve-page .checkve-spd-grid-col--left .checkve-spd-boat {
  margin-top: 0;
}
.checkve-page .checkve-spd-grid-col--mid {
  align-items: flex-start;
}
.checkve-page .checkve-spd-grid-col--right {
  align-items: flex-end;
}
.checkve-page .checkve-spd-trip-pick-label {
  font-weight: 600;
  font-size: 12px;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}
.checkve-page .checkve-spd-trip-pick-label input {
  margin: 0 4px 0 0;
  vertical-align: middle;
}
/* PQE: radio chọn chuyến nằm sau tên tàu (.checkve-pqe-trip-title-line), không còn hàng “Chọn chuyến này” */
.checkve-page .checkve-pqe-trip-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.checkve-page .checkve-pqe-trip-title-line .checkve-pqe-ship-title-toggle {
  flex: 0 1 auto;
  min-width: 0;
}
/* Tên tàu (PQE): giữ đậm như tiêu đề, không dùng style “Giờ khởi hành” (400) */
.checkve-page .checkve-pqe-trip-card .checkve-pqe-trip-title-line .checkve-pqe-ship-title-toggle .checkve-pqe-price-toggle-title {
  font-weight: 700;
  font-size: 1em;
  line-height: 1.25;
}
.checkve-page .checkve-pqe-trip-card .checkve-pqe-trip-title-line .checkve-pqe-ship-title-toggle:hover .checkve-pqe-price-toggle-title,
.checkve-page .checkve-pqe-trip-card .checkve-pqe-trip-title-line .checkve-pqe-ship-title-toggle:focus .checkve-pqe-price-toggle-title {
  font-weight: 700;
}
.checkve-page .checkve-pqe-trip-pick-label--after-title {
  font-weight: 600;
  font-size: 13px;
  margin: 0;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.checkve-page .checkve-pqe-trip-pick-label--after-title input {
  margin: 0;
  vertical-align: middle;
}
.checkve-page .checkve-pqe-trip-pick {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e5e5e5;
}
.checkve-page .checkve-pqe-trip-pick-label {
  font-weight: 600;
  font-size: 13px;
  margin: 0;
  cursor: pointer;
}
.checkve-page .checkve-pqe-trip-pick-label input {
  margin: 0 6px 0 0;
  vertical-align: middle;
}
.checkve-page .checkve-pqe-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.checkve-page .checkve-pqe-compact-summary {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}
.checkve-page .checkve-pqe-compact-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.checkve-page .checkve-pqe-trip-card.checkve-trip-compact .checkve-pqe-compact-summary {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}
.checkve-page .checkve-pqe-trip-card.checkve-trip-compact .checkve-pqe-list-expanded {
  display: none !important;
}
.checkve-page .checkve-pqe-compact-time {
  font-size: 12px;
  min-width: 0;
}
.checkve-page .checkve-pqe-compact-status {
  flex-shrink: 0;
  text-align: right;
}
.checkve-page .checkve-spd-list-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.checkve-page .checkve-spd-list-col.checkve-spd-list-main {
  min-width: 130px;
  flex: 1 1 auto;
}
.checkve-page .checkve-spd-list-col.checkve-spd-list-seats {
  min-width: 0;
  flex: 1 1 auto;
}
.checkve-page .checkve-spd-list-col.checkve-spd-list-actions {
  flex: 0 0 auto;
}
.checkve-page .checkve-spd-time {
  font-weight: 600;
  font-size: 15px;
}
.checkve-page .checkve-spd-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.checkve-page .checkve-spd-time-row .checkve-trip-compact-toggle .checkve-pqe-price-toggle-title,
.checkve-page .checkve-spd-grid-cell--time .checkve-trip-compact-toggle .checkve-pqe-price-toggle-title,
.checkve-page .checkve-spd-compact-left .checkve-trip-compact-toggle .checkve-pqe-price-toggle-title {
  font-size: 15px;
}
.checkve-page .checkve-spd-compact-summary {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}
.checkve-page .checkve-spd-compact-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.checkve-page .checkve-spd-list-item.checkve-trip-compact .checkve-spd-compact-summary {
  display: flex;
  width: 100%;
  min-width: 0;
}
.checkve-page .checkve-spd-list-item.checkve-trip-compact .checkve-spd-list-expanded {
  display: none !important;
}
.checkve-page .checkve-spd-compact-time {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
.checkve-page .checkve-spd-compact-status {
  text-align: right;
  font-size: 12px;
  min-width: 0;
}
.checkve-page .checkve-spd-boat {
  font-size: 12px;
  margin-top: 2px;
}
/* SPD/PQE kết quả: dòng mô tả chuyến (ngày, giờ, tàu, tổng ghế…) — chữ đen dễ đọc */
.checkve-page .checkve-result-meta {
  color: #222 !important;
}
.checkve-page .checkve-pqe-trip-card .checkve-avail-block,
.checkve-page .checkve-pqe-trip-card .checkve-avail-line {
  color: #222;
}
.checkve-page .checkve-spd-list-seats .checkve-spd-seat-remain {
  font-weight: 600;
}
.checkve-page .checkve-spd-list-seats .checkve-spd-seat-remain--zero {
  color: #5d4037;
  background: #ffc107b8;
  font-size: 12px;
  padding: 3px 5px;
  border-radius: 3px;
  display: inline-block;
}
.checkve-page .checkve-spd-list-seats .checkve-spd-seat-remain--ok {
  color: #fff;
  background: #4caf50;
  font-size: 12px;
  padding: 3px 5px;
  border-radius: 3px;
  display: inline-block;
}
.checkve-page .checkve-spd-grid-total {
  font-size: 12px;
}
.checkve-page .checkve-spd-list-seats .checkve-spd-seat-remain--na {
  color: inherit;
}
.checkve-page .checkve-spd-fare-table {
  margin-bottom: 0;
}
.checkve-page .checkve-spd-fare-note {
  margin-top: 8px;
}
.checkve-page .checkve-spd-results-row .btn-primary.checkve-seatmap-btn,
.checkve-page .checkve-spd-results-row .btn.btn-primary.checkve-seatmap-btn {
  background: #227ef4;
  border-color: #227ef4;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ========== PQE sơ đồ ghế (khớp nuc-server seatmap.php — trong modal) ========== */
#checkveSeatmapModalBody .checkve-pqe-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 0px;
  max-width: 100%;
}
#checkveSeatmapModalBody .checkve-pqe-header {
  margin-bottom: 4px;
  margin-left: 5px;
}
#checkveSeatmapModalBody .checkve-pqe-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
@media screen and (min-width: 769px) {
  #checkveSeatmapModalBody .checkve-pqe-title-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
  }
  #checkveSeatmapModalBody .checkve-pqe-title {
    justify-self: center;
    text-align: center;
  }
}
#checkveSeatmapModalBody .checkve-pqe-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
#checkveSeatmapModalBody .checkve-pqe-title {
  margin: 0;
  color: #ff5437;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}
.modal-body{
  padding: 0px;
}
#checkveSeatmapModalBody .checkve-pqe-btn {
  border: 0;
  background: #ff5437;
  color: #fff;
  padding: 5px 6px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}
#checkveSeatmapModalBody .checkve-pqe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
#checkveSeatmapModalBody .checkve-pqe-btn-emoji {
  display: inline-block;
}
@keyframes checkve-pqe-spin-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
#checkveSeatmapModalBody .checkve-pqe-btn.is-loading .checkve-pqe-btn-emoji {
  animation: checkve-pqe-spin-ccw 0.9s linear infinite;
}
#checkveSeatmapModalBody .checkve-pqe-meta {
  color: #666;
  font-size: 12px;
  margin-top: 0px;
  line-height: 1.4;
}
#checkveSeatmapModalBody .checkve-pqe-meta-hint {
  margin-top: 4px;
}
#checkveSeatmapModalBody .checkve-pqe-hint-ok {
  color: #2e7d32;
  font-size: 12px;
}
#checkveSeatmapModalBody .checkve-pqe-legend {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin: 9px 0 0;
  align-items: center;
}
#checkveSeatmapModalBody .checkve-pqe-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 6px;
  border-radius: 999px;
  font-size: 12px;
  background: #f2f2f2;
  color: #333;
}
#checkveSeatmapModalBody .checkve-pqe-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #ccc;
  display: inline-block;
  flex-shrink: 0;
}
#checkveSeatmapModalBody .checkve-pqe-dot.empty {
  background: #f8f9fa;
  border: 1px solid #ced4da;
}
#checkveSeatmapModalBody .checkve-pqe-dot.booked {
  background: #198754;
  border: 0;
}
#checkveSeatmapModalBody .checkve-pqe-dot.vip {
  background: #fff3cd;
  border: 1px solid #ffca2c;
}
#checkveSeatmapModalBody .checkve-pqe-loading-text {
  font-size: 13px;
  color: #ff5437;
  font-weight: 600;
}

#checkveSeatmapModalBody .checkve-pqe-seatmap .tabs,
#checkveSeatmapModalBody .checkve-pqe-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #eee;
  margin-top: 14px;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .tab-btn,
#checkveSeatmapModalBody .checkve-pqe-tabs .tab-btn {
  background: transparent;
  border: 0;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  color: #666;
  border-bottom: 3px solid transparent;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .tab-btn.active,
#checkveSeatmapModalBody .checkve-pqe-tabs .tab-btn.active {
  color: #ff5437;
  border-bottom-color: #ff5437;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .tab,
#checkveSeatmapModalBody .checkve-pqe-tab {
  display: none;
  padding-top: 12px;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .tab.active,
#checkveSeatmapModalBody .checkve-pqe-tab.active {
  display: block;
}

#checkveSeatmapModalBody .checkve-pqe-seatmap {
  --pqe-cell-w: 30px;
  --pqe-cell-h: 28px;
  --pqe-gap: 2px;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .grid-wrap {
  overflow: auto;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 3px;
  background: #fafafa;
}
/* Cột đều nhau (giống lầu dưới Trưng Nhị / seatmap.php boat-11) */
#checkveSeatmapModalBody .checkve-pqe-seatmap .grid {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: var(--pqe-gap);
  width: max-content;
  max-width: 100%;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap col.checkve-pqe-col {
  width: var(--pqe-cell-w);
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .cell {
  padding: 0;
  text-align: center;
  vertical-align: middle;
  width: var(--pqe-cell-w);
  min-width: var(--pqe-cell-w);
  height: var(--pqe-cell-h);
  overflow: hidden;
  box-sizing: border-box;
}
/* Ô gộp colspan: không ép width 1 ô — browser chia theo số cột col đã định */
#checkveSeatmapModalBody .checkve-pqe-seatmap .cell[colspan] {
  width: auto;
  min-width: 0;
  max-width: none;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .seat {
  width: 100%;
  max-width: 100%;
  height: var(--pqe-cell-h);
  box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #ced4da;
    background: #f8f9fa;
  color: #222;
    cursor: default;
    user-select: none;
    font-size: var(--pqe-seat-font, 10px);
    font-weight: 600;
  padding: 0;
  line-height: 1;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .seat.booked {
  background: #198754;
  border-color: #146c43;
  color: #fff;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .seat.vip {
  background: #fff3cd;
  border-color: #ffca2c;
  color: #222;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .seatvip.booked {
  border-color: #ffca2c;
  color: #ffca2c;
  background: #198754;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .label {
  padding: 0 4px;
  height: var(--pqe-cell-h);
  max-width: 100%;
  border-radius: 8px;
  background: #e9ecef;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 400;
  white-space: nowrap;
    font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap .empty-cell {
  width: 100%;
  height: 100%;
  min-height: 8px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  #checkveSeatmapModalBody .checkve-pqe-seatmap {
    --pqe-cell-w: 20px;
    --pqe-cell-h: 20px;
    --pqe-gap: 1px;
  }
  #checkveSeatmapModalBody .checkve-pqe-seatmap col.checkve-pqe-col {
    width: var(--pqe-cell-w) !important;
  }
  #checkveSeatmapModalBody .checkve-pqe-seatmap .seat {
    border-radius: 3px;
    font-size: 8px;
  }
  #checkveSeatmapModalBody .checkve-pqe-seatmap .label {
    font-size: 9px;
    padding: 0 2px;
  }
  #checkveSeatmapModalBody .checkve-pqe-seatmap .grid-wrap {
    padding: 1px;
    overflow-x: auto;
  }
}

/*
 * Thăng Long (boat_id=11): lưới rộng + nhiều colspan/rowspan (CẦU THANG, VIP…).
 * seatmap.php dùng table-layout:fixed + ô cố định; đồng bộ + nhãn gộp cột không phá cột.
 */
#checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] {
  --pqe-cell-w: 28px;
  --pqe-cell-h: 26px;
  --pqe-gap: 2px;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] .grid {
  table-layout: fixed;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] .cell {
  overflow: hidden;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] .label {
  font-size: 9px;
  padding: 0 3px;
}
#checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] .checkve-pqe-label-span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 8px;
    font-weight: 600;
  max-width: 100%;
}
@media (max-width: 768px) {
  #checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] {
    --pqe-cell-w: 18px;
    --pqe-cell-h: 18px;
    --pqe-gap: 1px;
  }
  #checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] .label,
  #checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] .checkve-pqe-label-span {
    font-size: 6px;
    padding: 0 1px;
  }
  #checkveSeatmapModalBody .checkve-pqe-seatmap[data-boat-id="11"] .seat {
    font-size: 7px;
  }
}

:root { --sd-primary:#227ef4; --sd-booked:#227ef4; --sd-empty:#d4d4d4; --sd-vip:#f1f290; }

/* SPD trong modal — khớp seatmapsd.php (stair, legend, nút) */
#checkveSeatmapModalBody { min-height: 160px; }
#checkveSeatmapModal.checkve-seatmap-modal--pqe .modal-title {
  color: #ff5437;
  font-weight: 800;
}
#checkveSeatmapModal.checkve-seatmap-modal--pqe .modal-header .close {
  color: #ff5437;
  opacity: 1;
  text-shadow: none;
}
#checkveSeatmapModal.checkve-seatmap-modal--pqe .modal-header .close:hover,
#checkveSeatmapModal.checkve-seatmap-modal--pqe .modal-header .close:focus {
  opacity: 0.85;
}
#checkveSeatmapModal.checkve-seatmap-modal--spd .modal-title {
  color: #227ef4;
  font-weight: 800;
  font-size: 19px;
}
#checkveSeatmapModal.checkve-seatmap-modal--spd .modal-header .close {
  color: #227ef4;
  opacity: 1;
  text-shadow: none;
  font-size: 28px;
}
#checkveSeatmapModal.checkve-seatmap-modal--spd .modal-header .close:hover,
#checkveSeatmapModal.checkve-seatmap-modal--spd .modal-header .close:focus {
  opacity: 0.85;
}
#checkveSeatmapModalBody .sd-seatmap-wrap.checkve-sd-modal-inner {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 8px 6px 8px;
}
#checkveSeatmapModalBody .checkve-sd-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
@media screen and (min-width: 769px) {
  #checkveSeatmapModalBody .checkve-sd-title-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
  }
  #checkveSeatmapModalBody .sd-modal-main-title {
    justify-self: center;
    text-align: center;
  }
}
#checkveSeatmapModalBody .sd-modal-main-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--sd-primary);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
#checkveSeatmapModalBody .checkve-sd-hint {
  font-weight: 400;
  font-size: 13px;
  margin: 6px 0 2px;
  color: #2e7d32;
  line-height: 1.35;
  font-style: italic;
}
#checkveSeatmapModalBody .checkve-sd-meta {
  margin-bottom: 10px;
}
#checkveSeatmapModalBody .checkve-sd-legend-outer {
  margin-bottom: 12px !important;
}
#checkveSeatmapModalBody .checkve-sd-legend-row,
#checkveSeatmapModalBody .checkve-sd-counts-row {
  display: flex;
  align-items: center;
  gap: 0px;
  flex-wrap: wrap;
}
#checkveSeatmapModalBody .checkve-sd-counts-row {
  margin-top: 6px;
  justify-content: space-between;
}
#checkveSeatmapModalBody .checkve-sd-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 5px;
  border-radius: 999px;
  font-size: 12px;
  background: transparent;
  color: #333;
  white-space: nowrap;
}
#checkveSeatmapModalBody .checkve-sd-sep { margin: 0 6px; opacity: 0.65; }
#checkveSeatmapModalBody .checkve-sd-countpair {
  display: inline;
}
#checkveSeatmapModalBody .checkve-sd-tab-wrap .nav-tabs {
  border-color: #ddd;
}
#checkveSeatmapModalBody .checkve-sd-tab-content {
  padding: 10px;
  border: 1px solid #ddd;
  border-top: 0;
  background: #fff;
  border-radius: 0 0 4px 4px;
}
#checkveSeatmapModalBody .checkve-sd-table-responsive {
  overflow-x: auto;
}
#checkveSeatmapModalBody .checkve-sd-stair {
  table-layout: fixed;
  border-collapse: collapse;
  width: 100%;
}
#checkveSeatmapModalBody .checkve-sd-stair td,
#checkveSeatmapModalBody .checkve-sd-stair th {
  border: 0 !important;
}
#checkveSeatmapModalBody .checkve-sd-stair td {
  padding: 1px !important;
  text-align: center;
  vertical-align: middle;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 30px !important;
  background: #fff;
}
#checkveSeatmapModalBody .checkve-sd-stair td.lobby { background: #fff; }
#checkveSeatmapModalBody .checkve-sd-stair td.seat { background: #f3f6ff; }
#checkveSeatmapModalBody .checkve-sd-stair td.feature { background: #eef2f7; }

@keyframes checkve-sd-spin-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
#checkveSeatmapModalBody #btnReload.is-loading .btn-emoji-load {
  display: inline-block;
  animation: checkve-sd-spin-ccw 0.9s linear infinite;
}

.sd-btn{
  border:0; background: var(--sd-primary); color:#fff; padding: 4px 5px; border-radius: 6px;
  cursor:pointer; font-weight:500; font-size: 12px; text-decoration:none; display:inline-flex; align-items:center; gap:2px;
}
.sd-btn:disabled{ opacity:.6; cursor:not-allowed; }
.sd-btn.secondary{ background: #227ef4; color:#fff; border:1px solid rgb(255 255 255); }
#checkveSeatmapModalBody .sd-seat,
.sd-seat{ width:100%; height:28px !important; padding:0; font-size:9px !important; font-weight:500; line-height:28px !important; border-radius:5px;
  border:2px solid rgba(0,0,0,.18); background-color: var(--sd-empty) !important; color:#111 !important; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sd-seat.sd-vip{ background-color: var(--sd-vip) !important; color:#111 !important; }
/* Ghế đã bán: xanh #227ef4 — đặt sau .sd-vip để luôn thắng khi vừa VIP vừa đã bán */
#checkveSeatmapModalBody .sd-seat.sd-booked,
.sd-seat.sd-booked{
  background-color: var(--sd-booked) !important;
  color: #fff !important;
  border-color: rgba(0,0,0,.2);
  cursor: not-allowed;
  opacity: 1;
}
.sd-seat.sd-selected{ background-color: var(--sd-primary) !important; color:#fff !important; border-color: rgba(0,0,0,.15); }
.sd-feature{ width:100%; height:28px; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color: rgba(0,0,0,.55); letter-spacing:.2px; user-select:none; }
.sd-legend-wrap{ background: rgba(34,126,244,.06); border: 1px solid rgba(0,0,0,.06); border-radius: 12px; padding: 10px 8px; }
.sd-legend-box{ display:inline-block; width:16px; height:16px; border-radius:3px; border:1px solid rgba(0,0,0,.12); vertical-align:middle; }
.sd-legend-empty{ background: var(--sd-empty); }
.sd-legend-booked{ background: var(--sd-booked); }
.sd-legend-vip{ background: var(--sd-vip); }

/*
 * AJAX tìm chuyến — không dùng pointer-events:none trên cả .checkve-page:
 * trên một số trình duyệt / chế độ responsive, click có thể “xuyên” hoặc form không nhận sự kiện.
 * Dùng lớp ::before trong suốt để chặn tương tác chỉ khi đang tải.
 */
/*
 * Chỉ làm mờ / chặn tương tác trên #checkve-root khi đang AJAX tìm chuyến.
 * KHÔNG đặt opacity lên cả .checkve-page — nếu không modal sơ đồ ghế (Bootstrap fixed) cũng bị mờ và khó thao tác.
 */
.checkve-page.checkve-ajax-loading {
  position: relative;
}
.checkve-page.checkve-ajax-loading #checkve-root {
  opacity: 0.65;
  transition: opacity 0.15s ease;
  position: relative;
}
.checkve-page.checkve-ajax-loading #checkve-root::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  pointer-events: auto;
  cursor: wait;
  background: rgba(255, 255, 255, 0.01);
}
.checkve-page.checkve-ajax-loading #checkve-root::after {
  content: "Đang tìm chuyến…";
  position: absolute;
  left: 50%;
  top: 120px;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ddd;
  border-radius: 6px;
  font-weight: 600;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 51;
  pointer-events: none;
  white-space: nowrap;
}

.checkve-page .checkve-search-col-submit .checkve-search-submit-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 112px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.checkve-page .checkve-search-col-submit .checkve-search-submit-btn > span {
  white-space: nowrap;
}
.checkve-page .checkve-search-col-submit .checkve-search-submit-btn .checkve-search-submit-label {
  display: inline-block;
  width: 72px;
  text-align: left;
}
.checkve-page .checkve-search-col-submit .checkve-search-submit-btn .checkve-search-submit-icon {
  margin-right: 4px;
  display: inline-block;
  transform-origin: 55% 65%;
}
.checkve-page .checkve-search-col-submit .checkve-search-submit-btn.is-loading,
.checkve-page .checkve-search-col-submit .checkve-search-submit-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
  filter: brightness(0.98);
}
.checkve-page .checkve-search-col-submit .checkve-search-submit-btn.is-loading .checkve-search-submit-icon {
  animation: checkve-search-lens-wiggle 2s linear infinite;
}

@keyframes checkve-search-lens-wiggle {
  0% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-2px) rotate(-12deg); }
  50% { transform: translateX(2px) rotate(12deg); }
  75% { transform: translateX(-2px) rotate(-12deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

/* Modal tính giá nhóm (PQE / SPD) — Bootstrap 3 */
.checkve-fare-modal .checkve-fare-total-num {
  color: #ff5437;
  font-weight: 700;
}
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-discount-row > th,
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-remaining-row > th {
  vertical-align: bottom;
}

/* Hàng chiết khấu 🌹: cao gấp đôi, input/🌹 giữ size và bám đáy */
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-discount-row > th {
  padding-top: 14px;
  padding-bottom: 4px;
}
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-discount-row {
  height: 56px;
}

/* Đảo độ đậm đường kẻ: “Cộng” -> bình thường, “Tổng cộng” -> đậm */
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-sum-row > th {
  border-top: 1px solid #ddd !important;
}
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-grand-row > th {
  border-top: 2px solid #ccc !important;
}

/* Từ “Tổng cộng” trở xuống: bỏ kẻ dọc, chỉ giữ kẻ ngang */
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-grand-row > th,
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-discount-row > th,
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-remaining-row > th {
  border-left: 0 !important;
  border-right: 0 !important;
}
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-grand-row > th:first-child,
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-discount-row > th:first-child,
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-remaining-row > th:first-child {
  border-left: 0 !important;
}
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-grand-row > th:last-child,
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-discount-row > th:last-child,
.checkve-fare-modal .checkve-fare-calc-table > tfoot > tr.checkve-fare-remaining-row > th:last-child {
  border-right: 0 !important;
}

/* PQE khứ hồi (bảng 4 cột): cột “Lượt về” đừng sát mép phải */
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr > th:last-child,
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tbody > tr > td:last-child,
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tfoot > tr > th:last-child {
  padding-right: 5px !important; /* +3px so với mặc định 2px */
}
.checkve-fare-modal .modal-body > .small.margin-bottom {
  /* Lề cho dòng note trong modal: trái lùi 2px, phải lùi 3px (đồng bộ PQE + SPD) */
  padding-left: 2px;
  padding-right: 3px;
}
.checkve-fare-modal .checkve-fare-qty-col {
  width: 72px;
  min-width: 56px;
}
.checkve-fare-modal .checkve-fare-pay-input,
.checkve-fare-modal .checkve-fare-per-ticket {
  max-width: 110px;
  display: inline-block;
}
.checkve-fare-modal #fareCalcPortNotePqe,
.checkve-fare-modal #fareCalcPortNotePqeCd,
.checkve-fare-modal #fareRtSpdPortNote {
  font-style: italic;
}
.checkve-fare-modal .checkve-fare-qty-mini {
  width: 62px;
  max-width: 62px;
  min-width: 18px;
}
.checkve-fare-modal .checkve-fare-unit-price {
  margin-top: 1px;
  line-height: 1.1;
  font-size: 11px;
}
.checkve-fare-modal .checkve-fare-ticket-suffix {
  color: #222;
  font-weight: 400;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:first-child > th {
  vertical-align: middle;
  text-align: center;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:first-child > th {
  border-top: 2px solid #555 !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:first-child > th:first-child {
  border-left: 2px solid #555 !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:first-child > th:last-child {
  border-right: 2px solid #555 !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:nth-child(2) > th {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:first-child > th {
  border-bottom: 1px solid #ddd !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:nth-child(2) > th {
  border-bottom: 0 !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:nth-child(2) > th:first-child {
  border-left: 2px solid #555 !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > thead > tr:nth-child(2) > th:last-child {
  border-right: 2px solid #555 !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tbody > tr > td:first-child {
  white-space: nowrap;
}
/* Khung đậm từ header xuống hết dòng “Tổng cộng” */
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tbody > tr > td:first-child,
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tfoot > tr.checkve-fare-sum-row > th:first-child,
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tfoot > tr.checkve-fare-grand-row > th:first-child {
  border-left: 2px solid #555 !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tbody > tr > td:last-child,
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tfoot > tr.checkve-fare-sum-row > th:last-child,
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tfoot > tr.checkve-fare-grand-row > th:last-child {
  border-right: 2px solid #555 !important;
}
.checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tfoot > tr.checkve-fare-grand-row > th {
  border-bottom: 2px solid #555 !important;
}

/* 🌹 + input chung một ô (PQE Cd + SPD Rt) */
.checkve-fare-modal .checkve-fare-inline-rose {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
}
.checkve-fare-modal .checkve-fare-inline-rose--right {
  width: 100%;
  justify-content: flex-end;
}
.checkve-fare-modal .checkve-fare-rose {
  display: inline-block;
  line-height: 1;
  padding-bottom: 2px;
}
.checkve-fare-modal .checkve-fare-per-ticket--short {
  max-width: 86px;
}
.checkve-fare-modal .checkve-fare-rt-table .checkve-fare-price-col {
  width: 96px;
}
/* SPD khứ hồi: cột “Giá vé” đừng sát mép phải */
.checkve-fare-modal .checkve-fare-rt-table > thead > tr > th.checkve-fare-price-col,
.checkve-fare-modal .checkve-fare-rt-table > tbody > tr > td.checkve-fare-price-col,
.checkve-fare-modal .checkve-fare-rt-table > tfoot > tr > th.checkve-fare-price-col {
  padding-right: 5px !important; /* +3px so với mặc định 2px */
}
.checkve-fare-modal .checkve-fare-toggle-lbl {
  font-weight: 600;
  margin: 0;
  cursor: pointer;
}
.checkve-fare-modal .checkve-fare-rt-label {
  font-weight: normal;
  margin: 4px 0 0;
  cursor: pointer;
}
.checkve-fare-modal .checkve-fare-rt-row {
  margin-top: 4px;
}
.checkve-fare-modal .checkve-fare-footer-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.checkve-fare-modal .checkve-fare-age-note {
  font-size: 12px;
  line-height: 1.35;
  color: #333;
  font-style: italic;
}
/* Ô số vé: chỉ khi đã nhập thì chuyển đỏ đậm như số kết quả */
.checkve-fare-modal input.fare-qty:not(:placeholder-shown),
.checkve-fare-modal input.fare-qty-out:not(:placeholder-shown),
.checkve-fare-modal input.fare-qty-back:not(:placeholder-shown) {
  color: #ff5437;
  font-weight: 700;
}

/* Modal tính giá — mobile: bỏ bớt lề 2 bên, bảng vừa khung, hạn chế kéo ngang */
@media (max-width: 767px) {
  .checkve-fare-modal .modal-dialog {
    width: calc(100% - 8px);
    max-width: 100%;
    margin: 6px 4px;
    padding: 0;
  }
  .checkve-fare-modal .modal-content {
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
  .checkve-fare-modal .modal-header {
    padding: 8px 6px;
    border-bottom-width: 1px;
  }
  .checkve-fare-modal .modal-header .modal-title {
    font-size: 16px;
    line-height: 1.25;
    padding-right: 28px;
    word-break: break-word;
  }
  .checkve-fare-modal .modal-header .close {
    margin-top: -2px;
    padding: 4px 6px;
    font-size: 22px;
    line-height: 1;
    opacity: 0.75;
  }
  .checkve-fare-modal .modal-body {
    padding: 6px 4px 8px;
  }
  .checkve-fare-modal .modal-body > .small.margin-bottom {
    margin-bottom: 6px !important;
    padding-left: 2px;
    padding-right: 3px;
    font-size: 13px;
    line-height: 1.35;
  }
  .checkve-fare-modal .table-responsive {
    margin-bottom: 8px;
    border: 0;
    /* Không ép scroll ngang nếu bảng đã co theo % */
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
  }
  .checkve-fare-modal .checkve-fare-calc-table {
    table-layout: fixed;
    width: 100% !important;
    max-width: 100%;
    font-size: 12px;
    margin-bottom: 6px;
  }
  .checkve-fare-modal .checkve-fare-calc-table > thead > tr > th,
  .checkve-fare-modal .checkve-fare-calc-table > tbody > tr > td,
  .checkve-fare-modal .checkve-fare-calc-table > tfoot > tr > th {
    padding: 4px 2px !important;
    vertical-align: middle;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  /* Cột “Loại vé” co chữ, các cột số hẹp */
  /* PQE khứ hồi (bảng .checkve-fare-calc-table-cd): khóa tỉ lệ cột bằng colgroup để % ăn đúng.
     Bạn tự đổi % tại đây là ra đúng layout. */
  /* % cột Loại vé */
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd col.checkve-fare-cd-col-type { width: 30%; }
  /* % cột số vé */
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd col.checkve-fare-cd-col-qty { width: 12%; }
  /* % cột Giá tiền */
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd col.checkve-fare-cd-col-price { width: 21%; }
  .checkve-fare-modal .checkve-fare-qty-col {
    width: 17% !important;
    min-width: 0 !important;
    max-width: none;
  }
  /* PQE khứ hồi: cột qty của tfoot dùng theo colgroup, không ăn width 17% */
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd .checkve-fare-qty-col {
    width: auto !important;
  }
  .checkve-fare-modal .checkve-fare-rt-table .checkve-fare-qty-col {
    width: 16% !important;
    min-width: 0 !important;
  }
  .checkve-fare-modal .checkve-fare-rt-table .checkve-fare-price-col {
    width: 22% !important;
    min-width: 0 !important;
  }
  .checkve-fare-modal .checkve-fare-calc-table .form-control.input-sm,
  .checkve-fare-modal .checkve-fare-calc-table input.form-control {
    padding: 3px 2px !important;
    font-size: 12px !important;
    height: auto;
    min-height: 28px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  /* PQE khứ hồi: đảm bảo input trong 2 cột “số vé” co được theo % cột */
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tbody > tr > td:nth-child(2) input,
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tbody > tr > td:nth-child(4) input {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tbody > tr > td:nth-child(2),
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd > tbody > tr > td:nth-child(4) {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  .checkve-fare-modal .checkve-fare-pay-input,
  .checkve-fare-modal .checkve-fare-per-ticket {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 3px 4px !important;
    font-size: 12px !important;
  }
  .checkve-fare-modal .checkve-fare-qty-mini {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: right !important;
    box-sizing: border-box !important;
  }
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd input.fare-qty-out.checkve-fare-qty-mini,
  .checkve-fare-modal .checkve-fare-calc-table.checkve-fare-calc-table-cd input.fare-qty-back.checkve-fare-qty-mini {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: right !important;
    box-sizing: border-box !important;
  }
  .checkve-fare-modal .text-right.margin-top {
    padding-left: 2px;
    padding-right: 2px;
  }
  .checkve-fare-modal .checkve-fare-footer-actions {
    align-items: flex-start;
    gap: 6px;
  }
  .checkve-fare-modal .checkve-fare-age-note {
    font-size: 11px;
  }
  .checkve-fare-modal .alert {
    padding: 6px 8px;
    margin-bottom: 8px;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .checkve-fare-modal .modal-dialog {
    width: calc(100% - 4px);
    margin: 4px 2px;
  }
  .checkve-fare-modal .modal-body {
    padding: 4px 2px 6px;
  }
  .checkve-fare-modal .checkve-fare-calc-table {
    font-size: 11px;
  }
  .checkve-fare-modal .checkve-fare-calc-table .form-control.input-sm,
  .checkve-fare-modal .checkve-fare-calc-table input.form-control {
    font-size: 11px !important;
    min-height: 27px;
  }
  .checkve-fare-modal .checkve-fare-pay-input,
  .checkve-fare-modal .checkve-fare-per-ticket {
    font-size: 11px !important;
  }
  .checkve-fare-modal .checkve-fare-calc-table > thead > tr > th,
  .checkve-fare-modal .checkve-fare-calc-table > tbody > tr > td,
  .checkve-fare-modal .checkve-fare-calc-table > tfoot > tr > th {
    padding: 3px 1px !important;
  }
}

/*
 * Khối « Tuỳ chọn tìm kiếm » (.checkve-search-options-panel): tối ưu chiều dọc — không ảnh hưởng kết quả/modal.
 */
.checkve-page .checkve-search-options-panel .panel-heading {
  padding: 6px 12px;
}
.checkve-page .checkve-search-options-panel .panel-body {
  padding: 6px 12px;
}
.checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-row > .checkve-search-col > .form-group {
  margin-bottom: 8px;
}
.checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-date-field-group {
  margin-bottom: 8px;
}
.checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit .form-group.margin-top {
  margin-top: 8px !important;
  margin-bottom: 6px;
}
.checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit .checkve-search-submit-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* Slot nút tính giá nhóm trước đây đã bỏ (nút chuyển xuống cuối kết quả) */

@media screen and (min-width: 768px) {
  .checkve-page .checkve-search-options-panel .panel-heading {
    padding: 6px 15px;
  }
  .checkve-page .checkve-search-options-panel .panel-body {
    padding: 8px 15px;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-row > .checkve-search-col > .form-group {
    margin-bottom: 6px;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-date-field-group {
    margin-bottom: 6px;
    min-height: 48px;
  }
  .checkve-page .checkve-search-options-panel .checkve-search-row select.form-control,
  .checkve-page .checkve-search-options-panel .checkve-search-row input.checkve-date-input[type="date"] {
    height: 30px;
    min-height: 30px;
    padding: 3px 10px;
    line-height: 1.35;
    font-size: 13px;
  }
  .checkve-page .checkve-search-options-panel .checkve-date-input-shell .checkve-date-input[type="date"] {
    height: 30px !important;
    min-height: 30px !important;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit .form-group.margin-top {
    margin-top: 6px !important;
    margin-bottom: 4px;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit .checkve-search-submit-actions {
    gap: 6px;
  }
}

@media screen and (max-width: 767px) {
  .checkve-page .checkve-search-options-panel .panel-heading {
    padding: 5px 10px;
  }
  .checkve-page .checkve-search-options-panel .panel-body {
    padding: 5px 10px;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group {
    margin-bottom: 3px;
    gap: 3px 6px;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) > .form-group > .control-label {
    font-size: 14px;
    line-height: 1.2;
  }
  .checkve-page .checkve-search-options-panel .checkve-select-facade-btn {
    min-height: 32px;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .checkve-page .checkve-search-options-panel .checkve-select-facade-opt {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.3;
  }
  .checkve-page .checkve-search-options-panel .checkve-search-row > .checkve-search-col:not(.checkve-search-col-submit) .checkve-date-input-shell .checkve-date-sheet-btn {
    min-height: 32px;
    align-items: flex-start;
    padding: 3px 12px;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-date-field-group {
    margin-bottom: 0;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit .form-group.margin-top {
    margin-top: 5px !important;
    margin-bottom: 2px;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit .checkve-search-submit-actions {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center !important;
    width: 100%;
    text-align: center;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit .checkve-search-submit-actions > button[type="submit"] {
    flex: 0 0 auto;
    min-width: auto;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit > .form-group > button[type="submit"] {
    padding: 5px 12px;
    font-size: 14px;
    width: auto;
  }
  .checkve-page .checkve-search-options-panel #checkveSearchForm .checkve-search-col-submit .checkve-search-submit-btn {
    flex-wrap: nowrap;
  }
}

/* PQE: nút tính giá vé nhóm ở cuối kết quả → căn trái + padding trên/dưới +2px */
.checkve-page .checkve-pqe-results-bottom-bar .checkve-pqe-fare-rt-bar--under-out-title {
  justify-content: flex-start;
}
.checkve-page .checkve-pqe-results-bottom-bar .checkve-pqe-fare-rt-bar--under-out-title .btn {
  padding-top: 4px;
  padding-bottom: 4px;
}

