/* Tour Job Orders */
.tjo-card.is-focused {
  outline: 2px solid #1565c0;
  outline-offset: -2px;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, .18);
  position: relative;
  z-index: 1;
}
.legacy-colbar-trjo {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #f0c040;
}
.legacy-scroll {
  flex: 1;
  overflow: auto;
  background: var(--surface);
}
.legacy-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #e8e4d8;
  border-top: 1px solid #c5c0b0;
}
.legacy-footer-left { display: flex; align-items: center; gap: 6px; }
.legacy-sel-lbl { font-size: 10px; font-weight: 700; color: #555; }
.legacy-sel-val {
  padding: 4px 8px;
  border: 1px solid #aaa;
  background: #fff;
  font-size: 11px;
}
.legacy-footer-right { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.legacy-footer-right-wide { margin-left: auto; }
.legacy-pager { display: flex; align-items: center; gap: 6px; width: 100%; }
.legacy-focus {
  padding: 6px 10px;
  background: #e3f2fd;
  border-bottom: 1px solid #90caf9;
  font-size: 12px;
}

.btn-legacy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
}
.btn-legacy-create { background: var(--lg-create); color: #fff; }
.btn-legacy-cancel { background: var(--lg-cancel); color: #fff; }
.btn-legacy-details {
  background: #fff;
  border-color: var(--lg-cancel);
  color: #222;
  box-shadow: 0 0 0 2px rgba(198, 40, 40, .25);
}
.btn-legacy-details.is-on { background: #ffebee; }
.btn-legacy-export { background: #ffe082; color: #222; border-color: #e0b840; }
.btn-legacy-find { background: #fff; border-color: #999; color: #222; }

.legacy-toggle {
  padding: 4px 8px;
  border: 1px solid #999;
  border-radius: 999px;
  background: #f0f0f0;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.legacy-toggle.is-on {
  background: #c8e6c9;
  border-color: #2e7d32;
  color: #1b5e20;
}

/* Tour Bookings */
.tb-date-group { margin: 0; }
.tb-date-hd {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  min-height: 26px;
  background: var(--lg-orange-bar);
  color: #1a1a1a;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.01em;
  border-bottom: 1px solid #c87800;
  border-top: 1px solid #e09000;
}
.tb-program {
  border-bottom: 1px solid #bdbdbd;
}
.tb-program.is-cancelled { opacity: .55; }
.tb-program-hd {
  display: grid;
  grid-template-columns: var(--tb-summary-grid);
  gap: 2px 6px;
  align-items: center;
  padding: 3px 8px;
  background: linear-gradient(180deg, #eceff1 0%, #dde3e8 100%);
  border-top: 1px solid #cfd8dc;
  border-bottom: 1px solid #b0bec5;
  font-size: 12px;
  font-weight: 600;
}
.tb-program.has-jo .tb-program-hd {
  background: linear-gradient(180deg, #e8eef3 0%, #d5dde6 100%);
}
.tb-product-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
}
.tb-expand-btn {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #bbb;
  border-radius: 2px;
  background: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}
.tb-expand-btn.is-open {
  background: #e8f5e9;
  border-color: #2e7d32;
}
.tb-room-compact {
  flex: 1 1 100%;
  font-size: 10px;
  font-weight: 500;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-rail { align-self: stretch; border-radius: 1px; min-height: 20px; }
.tb-rail-ok { background: #2e7d32; }
.tb-rail-jo { background: #90a4ae; }
.tb-rail-cancel { background: #9e9e9e; }
.tb-product {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
  color: #212121;
}
.tb-mm, .tb-pa, .tb-pc, .tb-pi, .tb-pt {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.tb-pt { color: #1565c0; }
.tb-col-show,
.tb-col-create,
.tb-col-cancel,
.tb-col-jobid {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 0;
}
.tb-col-show .btn-legacy,
.tb-col-create .btn-legacy,
.tb-col-cancel .btn-legacy {
  width: 100%;
  justify-content: center;
  padding-left: 4px;
  padding-right: 4px;
  min-height: 26px;
  font-size: 10px;
}
.tb-col-reserved {
  display: block;
  width: 100%;
  min-height: 26px;
}
.tb-col-jobid.tb-jobid.is-empty {
  background: transparent;
  border-style: dashed;
  min-height: 26px;
}
.legacy-colbar-tb-detail {
  display: grid;
  grid-template-columns: var(--tb-detail-grid, 6.75rem minmax(7rem, 1.2fr) 3rem minmax(6rem, 1fr) 3.25rem minmax(4.25rem, .75fr) minmax(4.25rem, .7fr) 2.75rem 4.75rem minmax(5.5rem, 6.25rem));
  gap: 2px 6px;
  padding: 2px 8px 2px 14px;
  background: #e8f0e4;
  font-size: 9px;
  font-weight: 700;
  align-items: center;
  white-space: nowrap;
}
.tb-detail-row {
  display: grid;
  grid-template-columns: var(--tb-detail-grid, 6.75rem minmax(7rem, 1.2fr) 3rem minmax(6rem, 1fr) 3.25rem minmax(4.25rem, .75fr) minmax(4.25rem, .7fr) 2.75rem 4.75rem minmax(5.5rem, 6.25rem));
  gap: 2px 6px;
  align-items: center;
  padding: 2px 8px 2px 14px;
  background: var(--lg-cream);
  border-top: 1px solid #eadfca;
  font-size: 11px;
  line-height: 1.25;
  min-height: 0;
}
.tb-bk { color: #2e7d32; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-guest,
.tb-hotel,
.tb-agent,
.tb-subagent {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.tb-pax, .tb-time, .tb-lang { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-st-wrap { min-width: 0; }
.tb-st-chip.chip {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.chip-ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.chip-warn { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.chip-danger { background: #ffebee; color: #b71c1c; border: 1px solid #ef9a9a; }
.chip-muted { background: #f0f0f0; color: #555; border: 1px solid #ccc; }
.tb-guest-cell { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tb-carry-hint {
  font-size: 9px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-remark-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 3px;
  border-radius: 50%;
  background: #c62828;
  vertical-align: middle;
}
.tb-detail-row.is-cancelled { opacity: 0.55; }
.tb-detail-block { border-top: 1px solid #e0e0e0; }
.tb-jo {
  justify-self: stretch;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 2px;
  background: #fff;
  border: 1px solid #cfd8dc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-jo.has-jo {
  background: #ffebee;
  border-color: #ef9a9a;
  color: #b71c1c;
}
.tb-jo.is-empty {
  color: #9e9e9e;
  font-weight: 600;
  background: transparent;
  border-style: dashed;
}
.tb-dot { width: 8px; height: 8px; background: #c62828; border-radius: 1px; }

@media (min-width: 901px) {
  .tour-bookings-page .legacy-colbar-tb-summary,
  .tour-bookings-page .tb-program-hd { padding-top: 2px; padding-bottom: 2px; }
  .tour-bookings-page .tb-detail-row { padding-top: 1px; padding-bottom: 1px; }
  .tour-bookings-page .btn-legacy { min-height: 26px; padding: 2px 6px; font-size: 10px; }
}

/* Tour Job Orders */
.tjo-list { display: flex; flex-direction: column; gap: 0; }
@media (min-width: 901px) {
  .tour-job-orders-page .tjo-seg { padding: 2px 6px; }
  .tour-job-orders-page .tjo-seg-icons .btn {
    min-height: 20px;
    padding: 0 3px;
  }
  .tour-job-orders-page .tjo-line {
    padding-top: 1px;
    padding-bottom: 1px;
  }
  .tour-job-orders-page .legacy-chrome-hd { padding: 4px 10px; font-size: 13px; }
  .tour-job-orders-page .legacy-chrome-bar { padding: 3px 8px; }
}
/* TJO-G7 � Job Order print preview (screen) */
.tjo-print-preview-workbench {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(72vh, 820px);
  overflow: auto;
}
.tjo-print-proto-note { margin: 0; font-size: 11px; }
.tjo-print-batch-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 8px 10px;
  background: #f5f7fa;
  border: 1px solid #cfd8dc;
  border-radius: 2px;
  font-size: 12px;
}
.tjo-print-scope-note { margin: 4px 0 0; width: 100%; font-size: 11px; }
.tjo-print-root .tour-jo-print-page {
  background: #fff;
  border: 1px solid #b0bec5;
  border-radius: 2px;
  padding: 12px 14px 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.06);
}
.tjo-print-root .tjo-print-jo-hd {
  border-bottom: 2px solid #263238;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.tjo-print-root .tjo-print-brand {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.tjo-print-root .tjo-print-co { font-weight: 700; font-size: 14px; }
.tjo-print-root .tjo-print-doc {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 11px;
  color: #37474f;
}
.tjo-print-root .tjo-print-jo-meta,
.tjo-print-root .tjo-print-jo-assign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 12px;
}
.tjo-print-root .lbl {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  color: #546e7a;
  margin-right: 4px;
}
.tjo-print-root .tjo-print-cont-mark { display: none; }
.tjo-print-root .tjo-print-bk-hd {
  display: grid;
  grid-template-columns: 0.7fr 1.6fr 0.7fr 0.7fr 0.6fr 1.5fr 1fr 0.9fr 1.1fr 0.8fr;
  gap: 2px 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: #455a64;
  border-bottom: 1px solid #90a4ae;
  padding: 4px 0;
  margin: 6px 0 4px;
}
.tjo-print-root .tjo-print-booking {
  border-bottom: 1px solid #eceff1;
  padding: 4px 0 6px;
  margin-bottom: 4px;
}
.tjo-print-root .tjo-print-bk-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}
.tjo-print-root .tjo-print-bk-table td {
  vertical-align: top;
  padding: 2px 4px 2px 0;
  word-break: break-word;
}
.tjo-print-root .tjo-print-bk-rmk,
.tjo-print-root .tjo-print-jo-rmk {
  margin-top: 4px;
  font-size: 11px;
}
.tjo-print-root .tjo-print-pre { white-space: pre-wrap; word-break: break-word; }
.tjo-print-root .tjo-print-jo-rmk {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #263238;
}
@media (max-width: 900px), (html.force-mobile) {
  .tjo-print-root .tjo-print-bk-hd { display: none; }
  .tjo-print-root .tjo-print-jo-meta,
  .tjo-print-root .tjo-print-jo-assign { grid-template-columns: 1fr; }
  .tjo-print-preview-workbench { max-height: min(78vh, 900px); }
}
