/* Tour Voucher — Legacy geography layout (scoped under .tour-voucher-page) */

.tour-voucher-page .tour-booking-workspace {
  margin-bottom: 0;
}

.tour-voucher-page .tour-voucher-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--legacy-teal-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.tour-voucher-page .tour-voucher-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(180deg, var(--legacy-teal-dark) 0%, #084848 100%);
  color: #fff;
  font-weight: 600;
}

.tour-voucher-page .tour-voucher-topbar-title {
  text-transform: uppercase;
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
}

.tour-voucher-page .tour-voucher-topbar-co {
  font-size: var(--fs-meta);
  font-weight: 500;
  opacity: 0.95;
  text-align: right;
}

/* Top toolbar: SALES + Legacy navigation + user context + Exit */
.tour-voucher-page .tour-voucher-toolbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 5px 10px;
  border-bottom: 1px solid var(--legacy-teal-border);
  background: linear-gradient(180deg, #fff 0%, var(--legacy-teal-soft) 100%);
}

.tour-voucher-page .tour-voucher-toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

.tour-voucher-page .tour-voucher-toolbar-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.tour-voucher-page .tour-voucher-toolbar-link.is-active {
  background: var(--legacy-teal);
  border-color: var(--legacy-teal-dark);
  color: #fff;
}

.tour-voucher-page .tour-voucher-toolbar-link.is-active:hover {
  background: var(--legacy-teal-dark);
  color: #fff;
}

.tour-voucher-page .tour-voucher-agent-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--legacy-teal-border);
  background: #fff;
}

.tour-voucher-page .tour-voucher-agent-field {
  flex: 0 1 360px;
  min-width: 220px;
  max-width: 480px;
  margin: 0;
}

.tour-voucher-page .tour-voucher-agent-field .lbl {
  display: block;
  font-size: var(--fs-meta);
  font-weight: 600;
  color: var(--legacy-teal-text);
  margin-bottom: 2px;
}

.tour-voucher-page .tour-voucher-agent-field .combo,
.tour-voucher-page .tour-voucher-agent-field .control {
  width: 100%;
}

.tour-voucher-page .tour-voucher-dirty-note {
  margin-left: auto;
  padding-bottom: 4px;
  font-size: var(--fs-meta);
  font-weight: 600;
  color: #b45309;
  white-space: nowrap;
}

.tour-voucher-page .tour-voucher-toolbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--legacy-teal-text);
  font-size: var(--fs-meta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.25;
}

.tour-voucher-page .tour-voucher-toolbar-link:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--legacy-teal-border);
  text-decoration: none;
}

.tour-voucher-page .tour-voucher-toolbar-link.is-proto-only {
  opacity: 0.88;
}

.tour-voucher-page .tour-voucher-toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  padding-bottom: 2px;
}

.tour-voucher-page .tour-voucher-user-ctx {
  font-size: var(--fs-meta);
  font-weight: 600;
  color: var(--legacy-teal-text);
  white-space: nowrap;
}

/* Legacy context alias (mobile rules may reference) */
.tour-voucher-page .tour-voucher-context {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  padding: 5px 10px;
  border-bottom: 1px solid var(--legacy-teal-border);
  background: linear-gradient(180deg, #fff 0%, var(--legacy-teal-soft) 100%);
}

.tour-voucher-page .tour-voucher-ctx-field {
  margin: 0;
  min-width: 0;
}

.tour-voucher-page .tour-voucher-ctx-field .lbl {
  display: block;
  font-size: var(--fs-meta);
  font-weight: 600;
  color: var(--legacy-teal-text);
  margin-bottom: 2px;
}

.tour-voucher-page .tour-voucher-ctx-sales {
  flex: 1 1 280px;
  max-width: 480px;
}

.tour-voucher-page .tour-excursion-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
}

.tour-voucher-page .tour-excursion-picker:hover {
  border-color: var(--legacy-teal);
  background: var(--legacy-teal-soft);
}

.tour-voucher-page .tour-excursion-picker:focus {
  outline: 2px solid var(--legacy-teal);
  outline-offset: 1px;
}

.tour-voucher-page .tour-excursion-picker-val {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-voucher-page .tour-excursion-picker-ico {
  flex: 0 0 auto;
  opacity: 0.55;
  width: 0.95rem;
  height: 0.95rem;
}

.tour-voucher-page .tour-voucher-sp-field .combo {
  width: 100%;
}

.tour-voucher-page .tour-voucher-ctx-field .combo,
.tour-voucher-page .tour-voucher-ctx-field .control {
  width: 100%;
}

.tour-voucher-page .tour-voucher-ctx-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  padding-bottom: 2px;
}

.tour-voucher-page .tour-voucher-agent-audit {
  margin: 0 0 4px;
  padding: 4px 8px;
  font-size: var(--fs-meta);
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  color: #92400e;
}

.tour-voucher-page .tour-voucher-col-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tour-voucher-page .tour-voucher-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 20%);
  gap: 6px;
  align-items: start;
  min-width: 0;
}

.tour-voucher-page .tour-voucher-body {
  padding: 6px 0 8px;
  background: #eef3f3;
}

.tour-voucher-page .tour-voucher-frame {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: stretch;
  min-width: 0;
}

.tour-voucher-page .tour-voucher-frame-center {
  min-width: 0;
  padding: 0 8px;
}

.tour-voucher-page .tour-voucher-rail {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100%;
  pointer-events: none;
  user-select: none;
  background: #d7e2e2;
  color: transparent;
}

.tour-voucher-page .tour-voucher-rail-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 8px 2px;
  width: max-content;
  min-width: 11px;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tour-voucher-page .tour-voucher-rail.paid {
  background: #16a34a;
  color: #fff;
}

.tour-voucher-page .tour-voucher-rail.void,
.tour-voucher-page .tour-voucher-rail.canceled {
  background: #dc2626;
  color: #fff;
}

.tour-voucher-page .tour-voucher-rail.confirmed {
  background: #16a34a;
  color: #fff;
}

.tour-voucher-page .tour-voucher-rail.pending {
  background: #7c3aed;
  color: #fff;
}

.tour-voucher-page .tour-voucher-rail.is-empty .tour-voucher-rail-text {
  color: transparent;
}

.tour-voucher-page .tour-panel {
  border: 1px solid var(--legacy-teal-border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.tour-voucher-page .tour-panel-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: linear-gradient(180deg, var(--legacy-teal) 0%, var(--legacy-teal-dark) 100%);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tour-voucher-page .tour-panel-hd-legacy {
  justify-content: space-between;
}

.tour-voucher-page .tour-voucher-status-badge {
  padding: 2px 10px;
  border-radius: 2px;
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.2);
}

.tour-voucher-page .tour-voucher-status-badge.confirmed { background: #15803d; }
.tour-voucher-page .tour-voucher-status-badge.canceled { background: #b91c1c; }
.tour-voucher-page .tour-voucher-status-badge.pending { background: #7c3aed; }
.tour-voucher-page .tour-voucher-status-badge.draft { background: #475569; }
.tour-voucher-page .tour-voucher-status-badge.unsaved { background: #64748b; }

.tour-voucher-page .tour-voucher-dual-status-mobile {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.tour-voucher-page .tour-voucher-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #94a3b8;
  color: #fff;
}

.tour-voucher-page .tour-voucher-status-chip.paid,
.tour-voucher-page .tour-voucher-status-chip.confirmed { background: #16a34a; }
.tour-voucher-page .tour-voucher-status-chip.void,
.tour-voucher-page .tour-voucher-status-chip.canceled { background: #dc2626; }
.tour-voucher-page .tour-voucher-status-chip.pending { background: #7c3aed; }
.tour-voucher-page .tour-voucher-status-chip.unsaved { background: #64748b; }
.tour-voucher-page .tour-voucher-status-chip.empty { background: #94a3b8; }

.tour-voucher-page .tour-panel-hd-sub {
  background: var(--legacy-teal-soft);
  color: var(--legacy-teal-text);
  border-bottom: 1px solid var(--legacy-teal-border);
}

.tour-voucher-page .tour-panel-hd-pricing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-right: 10px;
}

.tour-voucher-page .tour-voucher-pricing-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tour-voucher-page .tour-panel-bd {
  padding: 6px 8px;
}

.tour-voucher-page .tour-voucher-grid.form-grid {
  gap: 6px 8px;
}

.tour-voucher-page .tour-voucher-grid .span-7 { grid-column: span 7; }

.tour-voucher-page .tour-voucher-grid .field label {
  font-size: var(--fs-meta);
  margin-bottom: 2px;
}

.tour-voucher-page .tour-voucher-grid .control,
.tour-voucher-page .tour-voucher-grid textarea.control {
  min-height: 28px;
  padding: 4px 6px;
  font-size: var(--fs-label);
}

.tour-voucher-page .control-guest-name {
  min-height: 44px;
  font-weight: 600;
  text-transform: uppercase;
}

.tour-voucher-page .tour-excursion-name {
  font-weight: 600;
  text-transform: uppercase;
}

/* Guest Information — explicit row grid (VC7) */
.tour-voucher-page .tour-guest-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.tour-voucher-page .tour-guest-grid .field {
  min-width: 0;
  margin: 0;
}

.tour-voucher-page .tour-guest-grid .field label,
.tour-voucher-page .tour-guest-grid .field .guest-inhouse-lbl {
  display: block;
  font-size: var(--fs-meta);
  line-height: 1.25;
  margin-bottom: 2px;
}

.tour-voucher-page .tour-guest-grid .control,
.tour-voucher-page .tour-guest-grid textarea.control,
.tour-voucher-page .tour-guest-grid select.control {
  min-height: 28px;
  padding: 4px 6px;
  font-size: var(--fs-label);
  width: 100%;
}

.tour-voucher-page .tour-guest-grid .guest-name { grid-column: 1 / 8; align-self: stretch; }
.tour-voucher-page .tour-guest-grid .guest-inhouse { grid-column: 8 / 10; }
.tour-voucher-page .tour-guest-grid .guest-lang { grid-column: 10 / 13; }
.tour-voucher-page .tour-guest-grid .guest-hotel { grid-column: 1 / 7; }
.tour-voucher-page .tour-guest-grid .guest-room { grid-column: 7 / 9; }
.tour-voucher-page .tour-guest-grid .guest-area { grid-column: 9 / 11; }
.tour-voucher-page .tour-guest-grid .guest-pax-group { grid-column: 1 / 5; align-self: end; }
.tour-voucher-page .tour-guest-grid .guest-email { grid-column: 5 / 13; }
.tour-voucher-page .tour-guest-grid .guest-phone { grid-column: 1 / 5; max-width: 280px; }

.tour-voucher-page .tour-guest-grid .guest-hotel .combo {
  width: 100%;
  min-width: 0;
}

.tour-voucher-page .tour-guest-grid .guest-inhouse {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tour-voucher-page .tour-guest-grid .tour-voucher-inhouse-btn {
  width: 100%;
  min-height: 28px;
  font-size: var(--fs-meta);
  padding: 4px 6px;
  white-space: nowrap;
}

.tour-voucher-page .tour-guest-grid .control-guest-name {
  min-height: 44px;
  font-weight: 600;
  text-transform: uppercase;
  resize: vertical;
}

.tour-voucher-page .tour-guest-grid .guest-pax-group > label {
  margin-bottom: 2px;
}

.tour-voucher-page .tour-guest-grid .tour-guest-pax.compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
}

.tour-voucher-page .tour-guest-grid .tour-guest-pax.compact .pax-field label {
  font-size: 10px;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 1px;
}

.tour-voucher-page .tour-guest-grid .tour-guest-pax.compact .control {
  min-height: 28px;
  padding: 2px 4px;
}

.tour-voucher-page .tour-voucher-room-area-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  min-width: 0;
}

.tour-voucher-page .tour-voucher-room-area-row .field {
  min-width: 0;
}

.tour-voucher-page .tour-voucher-inhouse-wrap {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tour-voucher-page .tour-voucher-inhouse-btn {
  width: 100%;
  font-size: var(--fs-meta);
  padding: 4px 6px;
}

.tour-voucher-page .tour-guest-pax.compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0;
}

.tour-voucher-page .tour-guest-pax.compact .pax-field label {
  font-size: 10px;
  text-transform: uppercase;
}

.tour-voucher-page .tour-guest-pax.compact .control {
  min-height: 28px;
  padding: 2px 4px;
}

.tour-voucher-page .tour-panel-remarks .tour-remarks-grid {
  padding: 6px 8px 0;
}

.tour-voucher-page .tour-panel-remarks textarea {
  min-height: 56px;
  resize: vertical;
}

.tour-voucher-page .tour-voucher-meta-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 4px 8px 6px;
  font-size: var(--fs-meta);
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}

.tour-voucher-page .tour-panel-acc.compact .tour-panel-bd {
  padding-top: 4px;
}

.tour-voucher-page .field-readonly-hint {
  font-size: var(--fs-meta);
  margin: 0 0 4px;
  grid-column: 1 / -1;
}

/* Right pricing column — override tour-booking.css sticky offset inside page scope */
.tour-voucher-page .tour-voucher-pricing {
  position: relative;
  top: auto;
  display: flex;
  flex-direction: column;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  border: 1px solid var(--legacy-teal-border);
  border-radius: var(--radius-sm);
  background: #fff;
  min-width: 0;
  overflow: visible;
}

.tour-voucher-page .tour-voucher-pricing .tour-panel-bd {
  flex: 1;
  overflow: visible;
  max-height: none;
  padding: 6px 8px;
}

.tour-voucher-page .tour-voucher-layout.is-canceled .tour-voucher-pricing .control:not([readonly]) {
  opacity: 0.85;
}

.tour-voucher-page .tour-pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-meta);
  margin-bottom: 6px;
  table-layout: fixed;
}

.tour-voucher-page .tour-pricing-table th,
.tour-voucher-page .tour-pricing-table td {
  padding: 3px 4px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-voucher-page .tour-pricing-table th.num,
.tour-voucher-page .tour-pricing-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tour-voucher-page .tour-pricing-table thead th {
  background: var(--legacy-teal-soft);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
}

.tour-voucher-page .tour-pricing-sum th,
.tour-voucher-page .tour-pricing-sum td {
  font-weight: 700;
  background: #f7fafc;
}

.tour-voucher-page .tour-pax-qty {
  font-weight: 400;
  color: var(--text-muted);
}

.tour-voucher-page .tour-payment-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tour-voucher-page .tour-payment-fields .field label {
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.tour-voucher-page .tour-payment-fields .control {
  min-height: 26px;
  padding: 3px 5px;
  font-size: var(--fs-meta);
}

.tour-voucher-page .tour-voucher-total-amt {
  font-weight: 700;
}

.tour-voucher-page .tour-voucher-snapshot-note {
  margin: 0 0 4px;
  font-size: 10px;
  color: var(--text-secondary);
  padding: 2px 6px;
  background: #f8fafc;
  border-left: 2px solid var(--legacy-teal);
}

.tour-voucher-page .tour-voucher-snapshot-note.is-preview {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.tour-voucher-page .tour-voucher-alloc-row {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 4px;
  margin-bottom: 4px;
}

.tour-voucher-page .tour-voucher-alloc-hint {
  margin: 0 0 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.tour-voucher-page .tour-voucher-pay-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 6px;
  margin: 4px 0;
  padding: 4px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}

.tour-voucher-page .tour-voucher-pay-summary-grid .field label {
  font-size: 10px;
}

.tour-voucher-page .tour-voucher-pay-summary-grid .control.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: #f8fafc;
}

/* Bottom legacy action bar */
.tour-voucher-page .tour-voucher-actionbar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  align-items: stretch;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px solid var(--legacy-teal-border);
  background: linear-gradient(180deg, #fff 0%, #f0f4f4 100%);
}

.tour-voucher-page .tour-voucher-actionbar .btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: var(--fs-meta);
  width: 100%;
  justify-content: center;
}

.tour-voucher-page .tour-voucher-actionbar .btn.has-ico {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tour-voucher-page .tour-voucher-actionbar .btn-ico {
  width: 0.95rem;
  height: 0.95rem;
}

.tour-voucher-page .tour-product-gate-bd {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 20px 12px !important;
}

.tour-voucher-page .tour-booking-form.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Product picker modal */
#ui-modal .tour-product-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 360px;
}

#ui-modal.open:has(.tour-product-picker) #ui-modal-ft {
  display: none;
}

#ui-modal .tour-picker-panes {
  display: grid;
  grid-template-columns: minmax(160px, 0.38fr) minmax(0, 0.62fr);
  gap: 10px;
}

#ui-modal .tour-picker-pane {
  border: 1px solid var(--legacy-teal-border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

#ui-modal .tour-picker-pane-hd {
  padding: 8px 10px;
  background: linear-gradient(180deg, var(--legacy-teal) 0%, var(--legacy-teal-dark) 100%);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-label);
  text-transform: uppercase;
}

#ui-modal .tour-picker-list {
  max-height: min(48vh, 380px);
  overflow: auto;
}

#ui-modal .tour-picker-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 9px 10px;
  cursor: pointer;
  font: inherit;
}

#ui-modal .tour-picker-row-op.is-active-op {
  background: #e0f2fe;
  box-shadow: inset 4px 0 0 var(--primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .tour-voucher-page .tour-voucher-split {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tour-voucher-page .tour-panel-svc,
  .tour-voucher-page .tour-panel-guest,
  .tour-voucher-page .tour-panel-remarks,
  .tour-voucher-page .tour-panel-acc,
  .tour-voucher-page .tour-voucher-pricing,
  .tour-voucher-page .tour-voucher-col-main {
    grid-column: 1;
    grid-row: auto;
  }

  .tour-voucher-page .tour-voucher-toolbar-row {
    align-items: stretch;
  }

  .tour-voucher-page .tour-voucher-ctx-sales,
  .tour-voucher-page .tour-voucher-toolbar .tour-voucher-ctx-sales {
    flex: 1 1 100%;
    max-width: none;
  }

  .tour-voucher-page .tour-voucher-toolbar-nav {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .tour-voucher-page .tour-voucher-toolbar-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .tour-voucher-page .tour-voucher-agent-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .tour-voucher-page .tour-voucher-agent-field {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .tour-voucher-page .tour-voucher-dirty-note {
    margin-left: 0;
    padding-bottom: 0;
  }

  .tour-voucher-page .tour-guest-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tour-voucher-page .tour-guest-grid .guest-name,
  .tour-voucher-page .tour-guest-grid .guest-inhouse,
  .tour-voucher-page .tour-guest-grid .guest-lang,
  .tour-voucher-page .tour-guest-grid .guest-hotel,
  .tour-voucher-page .tour-guest-grid .guest-room,
  .tour-voucher-page .tour-guest-grid .guest-area,
  .tour-voucher-page .tour-guest-grid .guest-pax-group,
  .tour-voucher-page .tour-guest-grid .guest-email,
  .tour-voucher-page .tour-guest-grid .guest-phone {
    grid-column: 1 / -1;
    max-width: none;
  }

  .tour-voucher-page .tour-guest-grid .guest-inhouse .guest-inhouse-lbl {
    display: none;
  }

  .tour-voucher-page .tour-voucher-context {
    align-items: stretch;
  }

  .tour-voucher-page .tour-voucher-ctx-sales {
    flex: 1 1 100%;
    max-width: none;
  }

  .tour-voucher-page .tour-voucher-ctx-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .tour-voucher-page .tour-voucher-grid.form-grid {
    grid-template-columns: 1fr;
  }

  .tour-voucher-page .tour-voucher-grid [class*="span-"] {
    grid-column: 1 / -1;
  }

  .tour-voucher-page .tour-voucher-room-area-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    grid-column: 1 / -1;
  }

  .tour-voucher-page .tour-voucher-room-area-row .field {
    min-width: 0;
  }

  .tour-voucher-page .tour-guest-pax.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tour-voucher-page .tour-voucher-pricing {
    width: 100%;
    min-width: 0;
  }

  .tour-voucher-page .tour-voucher-pricing .tour-panel-bd {
    max-height: none;
    padding: 8px;
  }

  .tour-voucher-page .tour-voucher-frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .tour-voucher-page .tour-voucher-rail {
    display: none !important;
  }

  .tour-voucher-page .tour-voucher-dual-status-mobile {
    display: flex;
  }

  .tour-voucher-page .tour-voucher-stamp {
    display: none !important;
  }

  .tour-voucher-page .tour-voucher-pay-summary-grid {
    grid-template-columns: 1fr;
  }

  .tour-voucher-page .tour-voucher-alloc-row {
    grid-template-columns: 1fr 88px;
  }

  .tour-voucher-page .tour-remarks-grid {
    grid-template-columns: 1fr !important;
  }

  .tour-voucher-page .tour-remarks-grid .span-6 {
    grid-column: 1 / -1;
  }

  .tour-voucher-page .tour-voucher-actionbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: sticky;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  }

  .tour-voucher-page .tour-voucher-body {
    padding: 8px;
    overflow-x: hidden;
  }

  .tour-voucher-page .tour-voucher-layout {
    overflow-x: hidden;
  }
}

/* Prototype Mobile toggle (wide viewport) — mirror ≤768px voucher layout */
html.force-mobile .tour-voucher-page .tour-voucher-split {
  grid-template-columns: 1fr !important;
  gap: 8px;
}

html.force-mobile .tour-voucher-page .tour-panel-svc,
html.force-mobile .tour-voucher-page .tour-panel-guest,
html.force-mobile .tour-voucher-page .tour-panel-remarks,
html.force-mobile .tour-voucher-page .tour-panel-acc,
html.force-mobile .tour-voucher-page .tour-voucher-pricing,
html.force-mobile .tour-voucher-page .tour-voucher-col-main {
  grid-column: 1 !important;
  grid-row: auto !important;
}

html.force-mobile .tour-voucher-page .tour-voucher-toolbar-row {
  align-items: stretch;
}

html.force-mobile .tour-voucher-page .tour-voucher-ctx-sales,
html.force-mobile .tour-voucher-page .tour-voucher-toolbar .tour-voucher-ctx-sales {
  flex: 1 1 100%;
  max-width: none;
}

html.force-mobile .tour-voucher-page .tour-voucher-toolbar-nav {
  flex: 1 1 100%;
}

html.force-mobile .tour-voucher-page .tour-voucher-toolbar-right {
  width: 100%;
  margin-left: 0;
  justify-content: space-between;
}

html.force-mobile .tour-voucher-page .tour-voucher-agent-bar {
  flex-direction: column;
  align-items: stretch;
}

html.force-mobile .tour-voucher-page .tour-voucher-agent-field {
  flex: 1 1 100%;
  max-width: none;
  min-width: 0;
}

html.force-mobile .tour-voucher-page .tour-guest-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

html.force-mobile .tour-voucher-page .tour-guest-grid .guest-name,
html.force-mobile .tour-voucher-page .tour-guest-grid .guest-inhouse,
html.force-mobile .tour-voucher-page .tour-guest-grid .guest-lang,
html.force-mobile .tour-voucher-page .tour-guest-grid .guest-hotel,
html.force-mobile .tour-voucher-page .tour-guest-grid .guest-room,
html.force-mobile .tour-voucher-page .tour-guest-grid .guest-area,
html.force-mobile .tour-voucher-page .tour-guest-grid .guest-pax-group,
html.force-mobile .tour-voucher-page .tour-guest-grid .guest-email,
html.force-mobile .tour-voucher-page .tour-guest-grid .guest-phone {
  grid-column: 1 / -1 !important;
  max-width: none;
}

html.force-mobile .tour-voucher-page .tour-voucher-context {
  align-items: stretch;
}

html.force-mobile .tour-voucher-page .tour-voucher-ctx-sales {
  flex: 1 1 100%;
  max-width: none;
}

html.force-mobile .tour-voucher-page .tour-voucher-ctx-actions {
  width: 100%;
  margin-left: 0;
  justify-content: flex-end;
}

html.force-mobile .tour-voucher-page .tour-voucher-grid.form-grid {
  grid-template-columns: 1fr;
}

html.force-mobile .tour-voucher-page .tour-voucher-grid [class*="span-"] {
  grid-column: 1 / -1;
}

html.force-mobile .tour-voucher-page .tour-guest-pax.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html.force-mobile .tour-voucher-page .tour-voucher-pricing {
  width: 100%;
  min-width: 0;
}

html.force-mobile .tour-voucher-page .tour-voucher-pricing .tour-panel-bd {
  max-height: none;
  padding: 8px;
}

html.force-mobile .tour-voucher-page .tour-voucher-frame {
  grid-template-columns: minmax(0, 1fr);
}

html.force-mobile .tour-voucher-page .tour-voucher-rail {
  display: none !important;
}

html.force-mobile .tour-voucher-page .tour-voucher-dual-status-mobile {
  display: flex;
}

html.force-mobile .tour-voucher-page .tour-voucher-pay-summary-grid {
  grid-template-columns: 1fr;
}

html.force-mobile .tour-voucher-page .tour-voucher-alloc-row {
  grid-template-columns: 1fr 88px;
}

html.force-mobile .tour-voucher-page .tour-remarks-grid {
  grid-template-columns: 1fr !important;
}

html.force-mobile .tour-voucher-page .tour-voucher-actionbar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html.force-mobile .tour-voucher-page .tour-voucher-body,
html.force-mobile .tour-voucher-page .tour-voucher-layout {
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .tour-voucher-page .tour-voucher-split {
    grid-template-columns: minmax(0, 4fr) minmax(200px, 1fr);
  }

  .tour-voucher-page .tour-voucher-pricing .tour-panel-bd {
    padding-right: 8px;
  }
}

@media (min-width: 1200px) {
  .tour-voucher-page .tour-voucher-split {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 20%);
  }
}

/* Grouped Sales Person combobox (portaled menu) */
#ui-combo-portal .combo-group-hd,
.combo-group-hd {
  padding: 4px 8px 2px;
  font-size: var(--fs-meta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--legacy-teal-text);
  background: var(--legacy-teal-soft);
  border-top: 1px solid var(--legacy-teal-border);
  border-bottom: 1px solid var(--legacy-teal-border);
  pointer-events: none;
  user-select: none;
}

#ui-combo-portal .combo-group-hd:first-child,
.combo-group-hd:first-child {
  border-top: 0;
}

#ui-combo-portal .combo-option-grouped,
.combo-option-grouped {
  padding-left: 10px;
}

.tour-voucher-page .tour-voucher-sp-field .combo-menu,
.tour-voucher-page .tour-voucher-sp-field .combo-group-hd {
  min-width: 100%;
}

/* In-House Guest lookup modal */
#ui-modal.tour-inhouse-modal-shell.open {
  max-width: min(96vw, 1180px);
}

#ui-modal .tour-inhouse-modal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

#ui-modal .tour-inhouse-lead {
  margin: 0;
  font-size: var(--fs-meta);
}

#ui-modal .tour-inhouse-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#ui-modal .tour-inhouse-search-row .control {
  flex: 1 1 auto;
  min-width: 0;
}

#ui-modal .tour-inhouse-results {
  max-height: min(60vh, 520px);
  overflow: auto;
}

#ui-modal .tour-inhouse-table-wrap {
  overflow-x: auto;
}

#ui-modal .tour-inhouse-table {
  font-size: var(--fs-meta);
  min-width: 920px;
}

#ui-modal .tour-inhouse-table th,
#ui-modal .tour-inhouse-table td {
  vertical-align: top;
  padding: 6px 8px;
}

#ui-modal .tour-inhouse-row.is-highlighted,
#ui-modal .tour-inhouse-card.is-highlighted {
  background: var(--legacy-teal-soft);
  outline: 1px solid var(--legacy-teal-border);
}

#ui-modal .tour-inhouse-row {
  cursor: pointer;
}

#ui-modal .tour-inhouse-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ui-modal .tour-inhouse-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ui-modal .tour-inhouse-card-hd {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.tour-voucher-page .tour-voucher-inhouse-source {
  margin: 0 0 8px;
  font-size: var(--fs-meta);
  padding: 6px 8px;
  background: var(--legacy-teal-soft);
  border: 1px solid var(--legacy-teal-border);
  border-radius: var(--radius-sm);
}

/* Transfer-side EXCURSION reverse list (In-House link feature) */
.transfer-excursion-panel .transfer-excursion-lead {
  margin: 0 0 10px;
  font-size: var(--fs-meta);
}

.transfer-excursion-table {
  font-size: var(--fs-meta);
}

.transfer-excursion-row {
  cursor: pointer;
}

.transfer-excursion-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transfer-excursion-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.transfer-excursion-card:hover,
.transfer-excursion-row:hover {
  background: var(--legacy-teal-soft);
}

/* Transfer Excursions → Tour Voucher workbench (keeps Transfer page intact) */
.tv-workbench-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}
.tv-workbench-layer.open {
  display: flex;
}
.tv-workbench-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 45, 0.45);
  z-index: 0;
}
.tv-workbench-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(95vw, 1400px);
  height: min(94vh, 960px);
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.tv-workbench-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: #f7f9fb;
}
.tv-workbench-hd h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tv-workbench-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: var(--fs-meta);
  color: var(--text-secondary);
  line-height: 1.35;
}
.tv-workbench-meta .k {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 2px;
}
.tv-workbench-hd-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tv-workbench-newtab {
  font-size: var(--fs-meta);
  white-space: nowrap;
  color: var(--primary);
  text-decoration: none;
}
.tv-workbench-newtab:hover {
  text-decoration: underline;
}
.tv-workbench-bd {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: var(--page-bg, #eef2f6);
}
.tv-workbench-bd .tour-voucher-page {
  margin: 0;
}
.tv-workbench-ft {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  flex-shrink: 0;
}
/* Workbench: hide full-module Exit / nav shell chrome that would leave Transfer */
.tour-voucher-page.is-tv-workbench .tour-voucher-toolbar-nav,
.tour-voucher-page.is-tv-workbench .tour-voucher-toolbar-right .btn-danger-outline {
  display: none !important;
}
.tour-voucher-page.is-tv-workbench .tour-voucher-topbar-title::after {
  content: " · Workbench";
  font-weight: 500;
  opacity: 0.85;
}
@media (max-width: 768px) {
  .tv-workbench-panel {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .tv-workbench-layer {
    padding: 0;
  }
}
