/* ============================================================
   QUOTE PAGES  (index.html / quote-view.html)
   All qm-* styles, leg cards, preferences, decline dialog.
   Extracted from styles.css so each page loads only what it needs.
============================================================ */

/* ── Page layout ──────────────────────────────────────────── */
#quoteModalWrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 20px;
  padding: 24px 20px;
  min-height: calc(100vh - 134px);
  animation: qm-wrapper-in .35s ease-out;
}

@keyframes qm-wrapper-in {
  from { opacity: 0; transform: translateY(48px); }
  to   { opacity: 1; transform: translateY(0); }
}

#quoteModal {
  background: #fff;
  border-radius: 10px;
  flex: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 12px rgba(0,48,87,.10);
  border: 1px solid var(--border-hair);
}

.index-map-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.index-map-panel .map-container {
  flex: 1;
  height: auto;
  margin-top: 0;
  border-radius: 10px;
}

/* Sticky left itinerary panel */
.qm-sticky-panel {
  position: sticky;
  top: 0;
  overflow-y: auto;
  max-height: 100vh;
}
.qm-prev-submitted-panel {
  padding: 12px 16px;
  border-top: 1px solid #e2eaf1;
}

/* ── Title ────────────────────────────────────────────────── */
.qm-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 14px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-blue);
}
.qm-title i { font-size: 1.5rem; }

/* ── Outer card ───────────────────────────────────────────── */
.qm-card {
  margin: 0 16px;
  border: 1px solid #b8d5e8;
  border-radius: 8px;
  overflow: hidden;
}

/* ── Trip bar ─────────────────────────────────────────────── */
.qm-trip-bar {
  display: flex;
  align-items: center;
  background: var(--brand-blue);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  padding: 8px 16px;
}
.qm-trip-bar--leg {
  justify-content: space-between;
}
.qm-trip-bar--leg span:first-child,
.qm-trip-bar--leg span:last-child {
  flex: 1;
}
.qm-trip-bar--leg span:last-child {
  text-align: right;
}
.qm-trip-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Preferences ──────────────────────────────────────────── */
.preference-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background-color: #e8f2fb;
  border: 1px solid #2a6496;
  color: #1a4f7a;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.client-preferences {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 16px;
}

.client-preferences-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.client-preferences-divider {
  height: 1px;
  background: #dee2e6;
  margin: 6px 0;
}

.client-preferences-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.client-preferences--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.preference-chip-stat {
  background-color: #eaf5ee;
  border-color: #2a7a4a;
  color: #1a5a34;
}

/* ── Leg card ─────────────────────────────────────────────── */
.qm-leg-card {
  background: #e8f3f8;
  border-bottom: 1px solid #b8d5e8;
  padding: 0;
  margin: 10px;
  border-radius: 8px;
  overflow: hidden;
}

.qm-leg-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  font-size: .85rem;
  font-weight: 700;
  color: #003057;
  background: #b5d4ea;
  padding: 7px 12px;
}
.qm-leg-header span:nth-child(2) { text-align: center; }
.qm-leg-header span:nth-child(3) { text-align: right; }

.qm-leg-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.qm-icao {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand-blue);
}
.qm-apt-name {
  font-size: .72rem;
  color: var(--brand-blue);
  margin-top: 2px;
}
.qm-apt-city {
  font-size: .78rem;
  color: #444;
  margin-top: 2px;
}

.qm-leg-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 120px;
}
.qm-flight-line {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 4px;
}
.qm-dash {
  flex: 1;
  border-top: 2px dashed #65aed3;
}
.qm-leg-icon {
  color: var(--brand-blue-light);
  font-size: 1rem;
  flex-shrink: 0;
}
.qm-pax {
  font-size: .82rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 3px;
}
.qm-pax i { color: var(--brand-blue); }

/* ── Quote info (legacy static form section) ──────────────── */
.qm-quote-info {
  margin: 0 12px 12px;
  border: 1px solid #b8d5e8;
  border-radius: 8px;
  overflow: hidden;
}
.qm-quote-info-header {
  background: #dde8f0;
  padding: 8px 14px;
  font-size: .88rem;
  font-weight: 600;
  color: #003057;
}
.qm-quote-info-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Form grid ────────────────────────────────────────────── */
.qm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qm-form-row-tall {
  grid-template-columns: 1fr;
  grid-template-rows: unset;
}
.qm-form-row-tall .qm-textarea {
  height: 90px;
}
.qm-form-row-tall .qm-upload-area {
  height: 110px;
}

/* ── Aircraft combobox ────────────────────────────────────── */
.qm-aircraft-wrap {
  position: relative;
}
.qm-aircraft-wrap .input-group { flex-wrap: nowrap; }
.qm-aircraft-prefix-text {
  color: var(--text-accent);
  background: #e0f0f9;
  border-color: #a5c8de;
  font-size: .8rem;
  padding: 0 9px;
}
.qm-aircraft-wrap .qm-input {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-color: #a5c8de;
}
.qm-ctrl-chevron {
  color: var(--text-accent);
  background: #e0f0f9;
  border-color: #a5c8de;
  font-size: .78rem;
  padding: 0 9px;
  cursor: pointer;
  line-height: 1;
}
.qm-ctrl-chevron:hover { color: #003057; background: #c8e5f5; }

.qm-aircraft-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid #a5c8de;
  border-top: none;
  border-radius: 0 0 5px 5px;
  list-style: none;
  margin: 0; padding: 0;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.qm-aircraft-list.open { display: block; }
.qm-aircraft-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: .83rem;
  color: #003057;
  cursor: pointer;
}
.qm-aircraft-list li:hover { background: #e0f2fa; }
.qm-tail-chip {
  font-size: .7rem;
  color: var(--text-accent);
  background: #e0f0f9;
  border-radius: 10px;
  padding: 1px 8px;
  flex-shrink: 0;
}

/* ── Amount input ─────────────────────────────────────────── */
.qm-amount-prefix {
  background: #e0f0f9;
  border-color: #a5c8de;
  color: var(--text-accent);
  font-size: .83rem;
}
.qm-labeled-field .input-group .qm-input {
  border-color: #a5c8de;
  min-width: 0;
  padding: 6px 10px;
  font-size: .83rem;
}
.qm-labeled-field .input-group .qm-input:focus {
  z-index: 1;
}
.qm-amount-error {
  font-size: .7rem;
  color: #dc3545;
  margin-top: 3px;
}
.qm-input.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 2px rgba(220,53,69,.12) !important;
}
.qm-amount-group.is-invalid {
  border-radius: 5px;
  box-shadow: 0 0 0 2px rgba(220,53,69,.12);
}
.qm-amount-group.is-invalid .qm-amount-prefix,
.qm-amount-group.is-invalid .qm-input {
  border-color: #dc3545 !important;
}
@keyframes qm-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.qm-shake {
  animation: qm-shake 0.4s ease-in-out;
}
/* Modify-mode attention (blue, per-field — clears on user input) */
.qm-modify-attention .qm-input,
.qm-modify-attention .input-group-text {
  border-color: #0d6efd !important;
}
.qm-modify-attention {
  border-radius: 5px;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, .2);
}
.qm-modify-attention-text {
  font-size: .7rem;
  color: #0d6efd;
  margin-top: 3px;
}
.qm-summary-tail {
  font-size: .9rem;
  font-weight: 500;
  color: #003057;
}

/* ── Base input / textarea / upload ──────────────────────── */
.qm-input {
  border: 1px solid #a5c8de;
  border-radius: 5px;
  padding: 6px 10px;
  font-size: .83rem;
  color: #003057;
  outline: none;
  background: #fff;
}
.qm-input::placeholder { color: var(--text-muted); }
.qm-input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 2px rgba(0,123,193,.12); }

.qm-textarea {
  border: 1px solid #a5c8de;
  border-radius: 5px;
  padding: 7px 10px;
  font-size: .83rem;
  color: #003057;
  resize: none;
  width: 100%;
  font-family: inherit;
  outline: none;
}
.qm-textarea::placeholder { color: var(--text-muted); }
.qm-textarea:focus { border-color: var(--brand-blue); }

.qm-upload-area {
  border: 2px dashed #7abcd8;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  gap: 4px;
  background: #fff;
}
.qm-upload-icon  { font-size: 1.4rem; color: var(--brand-blue); }
.qm-upload-text  { font-size: .76rem; color: #444; margin: 0; }
.qm-upload-link  { color: var(--brand-blue); cursor: pointer; font-weight: 500; }
.qm-upload-formats { font-size: .65rem; color: var(--text-accent); margin: 0; }
.qm-upload-label   { font-size: .72rem; font-weight: 600; color: #003057; margin: 0 0 4px; letter-spacing: .3px; text-align: left; }
.qm-upload-wrap    { display: flex; flex-direction: column; width: 100%; }

.qm-upload-required { position: relative; }
.qm-upload-required-badge {
  position: absolute;
  top: -9px;
  right: 8px;
  background: #dc3545;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
}

/* ── Add-quote: empty state (large cards) ────────────────── */
.qm-addquote-section {
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qm-addquote-label {
  font-weight: 700;
  color: #007BC1;
}
.qm-addquote-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qm-addquote-cards .dropdown {
  display: flex;
  min-width: 0;
  width: 100%;
}
.qm-addquote-cards .dropdown .qm-addquote-card {
  width: 100%;
}
.qm-addquote-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #d8e6ef;
  border-radius: 8px;
  padding: 18px;
}

/* ── Clickable add-quote card: lift + animated border path ─── */
@property --qm-border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.qm-addquote-card-clickable {
  position: relative;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.qm-addquote-card-clickable:hover,
.qm-addquote-card-clickable:focus-visible,
.qm-addquote-card-clickable.show {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,48,87,.12);
  outline: none;
}
.qm-addquote-card-clickable::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 9px;
  padding: 1.5px;
  background: conic-gradient(from var(--qm-border-angle), transparent 0% 70%, var(--brand-blue) 88%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  animation: qm-border-path 2.2s linear infinite paused;
}
.qm-addquote-card-clickable:hover::before,
.qm-addquote-card-clickable:focus-visible::before,
.qm-addquote-card-clickable.show::before {
  opacity: 1;
  animation-play-state: running;
}
@keyframes qm-border-path {
  to { --qm-border-angle: 360deg; }
}
.qm-addquote-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #e8f2fb;
  color: var(--brand-blue);
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.qm-addquote-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #003057;
}
.qm-addquote-desc {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}
.qm-addquote-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--brand-blue);
  font-size: .9rem;
  font-weight: 600;
  padding: 0;
  margin-top: auto;
  cursor: pointer;
}
.qm-addquote-link:hover { color: var(--brand-blue-hover); }
.qm-addquote-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Leg picker inline (replaces Bootstrap dropdown) ──────── */
@keyframes qmLegTitleOut {
  from { clip-path: inset(0 0 0 0); }
  to   { clip-path: inset(0 100% 0 0); }
}
@keyframes qmLegTitleIn {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.qm-addquote-title--erasing  { animation: qmLegTitleOut 0.22s ease forwards; overflow: hidden; white-space: nowrap; }
.qm-addquote-title--revealing { animation: qmLegTitleIn 0.22s ease forwards; overflow: hidden; white-space: nowrap; }

.qm-addquote-card--leg-open {
  cursor: default;
  border-color: var(--brand-blue);
  box-shadow: 0 4px 12px rgba(0,48,87,.1);
}

.qm-addquote-title--picking {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-bottom: 10px;
}
.qm-leg-picker-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .85rem; padding: 0 2px; line-height: 1;
}
.qm-leg-picker-close:hover { color: #003057; }

.qm-leg-picker-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px; width: 100%;
}
.qm-leg-picker-list--compact { margin-top: -4px; }
.qm-leg-picker-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid #c8dcec;
  border-radius: 6px; cursor: pointer; background: #f5fafd;
  transition: background .15s, border-color .15s;
}
.qm-leg-picker-item:hover { background: #e0f0f9; border-color: #a5c8de; }
.qm-leg-picker-num   { font-weight: 600; font-size: .82rem; color: #003057; white-space: nowrap; transition: color .15s; }
.qm-leg-picker-route { font-size: .82rem; color: var(--text-accent); flex: 1; transition: color .15s; }
.qm-leg-picker-date  { font-size: .75rem; color: var(--text-muted); white-space: nowrap; transition: color .15s; }
.qm-leg-picker-arrow {
  font-size: .7rem; color: var(--text-accent); margin-left: auto;
  transition: transform .15s, color .15s;
}
.qm-leg-picker-item:hover .qm-leg-picker-num,
.qm-leg-picker-item:hover .qm-leg-picker-route,
.qm-leg-picker-item:hover .qm-leg-picker-date { color: #003057; }
.qm-leg-picker-item:hover .qm-leg-picker-arrow { color: #003057; transform: translateX(3px); }

/* ── Add-quote: compact state (after first quote added) ──── */
@keyframes qmEnter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes qmSectionIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.qm-multi-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: qmSectionIn 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.qm-multi-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qm-multi-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid #d8e6ef;
  border-radius: 8px;
  background: #fff;
  color: #003057;
  font-size: .9rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.qm-multi-btn:hover { background: #f3f9fd; border-color: var(--brand-blue); }
.qm-multi-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e8f2fb;
  color: var(--brand-blue);
  font-size: .9rem;
  flex-shrink: 0;
}
.qm-multi-btn-text { flex: 1; text-align: left; }
.qm-multi-btn-add {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--brand-blue);
}
.qm-multi-btn-add-bg {
  color: var(--brand-blue);
  transition: color 0.25s ease;
}
.qm-multi-btn-add-plus {
  position: absolute;
  font-size: 0.6em;
  color: #fff;
  transition: transform 0.25s ease, color 0.25s ease;
}
.qm-multi-btn--open .qm-multi-btn-add-bg {
  color: var(--border-hair);
}
.qm-multi-btn--open .qm-multi-btn-add-plus {
  transform: rotate(45deg);
  color: #333;
}
.qm-multi-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Footer ───────────────────────────────────────────────── */
.qm-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 14px 24px 20px;
  border-top: 1px solid #dde8f0;
  margin-top: 20px;
}
.qm-decline-btn {
  background: none;
  border: none;
  color: #dc3545;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.qm-decline-btn:hover { text-decoration: underline; }
.qm-decline-btn.qm-cancel-mode {
  color: #495057;
  background: #fff;
  border: 1.5px solid #6c757d;
  border-radius: 6px;
  padding: 6px 22px;
  text-decoration: none;
}
.qm-decline-btn.qm-cancel-mode:hover { color: #343a40; background: #f0f1f3; border-color: #495057; text-decoration: none; }
.qm-submit-btn {
  background: #137a38;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 32px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.qm-submit-btn:hover    { background: #0f7034; }
.qm-submit-btn:disabled { background: #c8d4cc; cursor: not-allowed; }

/* ── Injected quote form items ────────────────────────────── */
@keyframes qmSlideDown {
  from { grid-template-rows: 0fr; opacity: 0; }
  to   { grid-template-rows: 1fr; opacity: 1; }
}

#qmQuoteFormsList {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  border-radius: 0.4rem;
  background: rgba(214, 228, 240, 0);
  transition: background-color 0.3s ease, padding 0.3s ease;
  overflow: hidden;
}

#qmQuoteFormsList:has(.qm-quote-form-item) {
  background: rgb(214, 228, 240);
  padding: 8px;
  margin-bottom: 16px;
}

/* When the last item is swiping out, co-animate the bucket back to its empty state
   so the background/padding don't linger until React removes the DOM node. */
#qmQuoteFormsList:has(.qm-discard-swipe-last) {
  background: rgba(214, 228, 240, 0);
  padding: 0;
  transition: background-color 0.75s ease, padding 0.75s ease;
}

.qm-quote-form-item {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  animation: qmSlideDown 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.qm-quote-form-item--booked {
  display: block;
  grid-template-rows: unset;
  animation: qmEnter 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes qmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Discard animation — swipe left like email apps.
   JS sets --qm-collapse-from (measured height) before adding the class,
   then waits for animationend to call onRemove(id). */

/* Multi-quote bucket: swipe + height close in one continuous motion */
@keyframes qmDiscardSwipe {
  0%   { transform: translateX(0);     opacity: 1; height: var(--qm-collapse-from, auto); }
  45%  { transform: translateX(-80%);  opacity: 0; height: var(--qm-collapse-from, auto); }
  100% { transform: translateX(-100%); opacity: 0; height: 0px; }
}

/* Single quote (last in bucket): swipe first, pause, then height collapses */
@keyframes qmDiscardSwipeLast {
  0%   { transform: translateX(0);     opacity: 1; height: var(--qm-collapse-from, auto); }
  38%  { transform: translateX(-100%); opacity: 0; height: var(--qm-collapse-from, auto); }
  55%  { transform: translateX(-100%); opacity: 0; height: var(--qm-collapse-from, auto); }
  100% { transform: translateX(-100%); opacity: 0; height: 0px; }
}

.qm-quote-form-item.qm-discard-swipe {
  animation: qmDiscardSwipe 0.55s ease forwards;
  overflow: hidden;
  pointer-events: none;
}
.qm-quote-form-item.qm-discard-swipe-last {
  animation: qmDiscardSwipeLast 0.75s ease forwards;
  overflow: hidden;
  pointer-events: none;
}

.qm-quote-form-card {
  width: 100%;
  min-height: 0;
  border: 1px solid #b8d5e8;
  border-radius: 8px;
  overflow: hidden;
}
.qm-quote-form-card .qm-trip-bar { border-radius: 0; }

.qm-tqi-wrap {
  background: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: qmEnter 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.qm-tqi-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #003057;
}

/* Floating-label field wrapper */
.qm-labeled-field-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.qm-labeled-field-wrap .qm-labeled-field {
  margin-top: 0;
}
.qm-booked-hint {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
  padding-left: 1px;
}
.qm-booked-hint-label {
  font-size: .68rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.qm-booked-hint-value {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-slate);
}

.qm-float-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: #003057;
  margin-bottom: 4px;
}
.qm-labeled-field .qm-input,
.qm-labeled-field .qm-aircraft-wrap {
  width: 100%;
}
.qm-field-hint {
  font-size: .72rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Discard / Apply actions */
.qm-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}
.qm-discard-btn {
  background: #fff;
  border: 1.5px solid #6c757d;
  border-radius: 6px;
  padding: 6px 22px;
  font-size: .88rem;
  color: #495057;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s;
}
.qm-discard-btn:hover { color: #343a40; background: #f0f1f3; border-color: #495057; }
.qm-apply-btn {
  background: #fff;
  border: 1.5px solid var(--brand-blue);
  color: var(--brand-blue);
  border-radius: 6px;
  padding: 6px 22px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.qm-apply-btn:hover { background: #e0f2fa; }

/* Section divider labels */
.qm-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #003057;

}
.qm-section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.qm-quote-counter {
  color: #003057;
}

/* Read-only previously submitted quotes */
.qm-readonly-item { padding: 0 10px 10px; }
.qm-trip-bar-muted { background: var(--text-accent); }
.qm-summary-row-readonly {
  background: #d8eef7;
  border-top: 1px solid #a5cce0;
}
.qm-submitted-badge {
  margin-left: auto;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: .5px;
  text-transform: uppercase;
}
.qm-readonly-list {
  max-height: 282px;
  overflow-y: auto;
  border: 1px solid #b8d5e8;
  background: rgb(214, 228, 240);
  border-radius: 6px;
  padding: 8px 0 0 0;
}

/* Summary row (after Apply) */
.qm-summary-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 16px;
  background: #fff;
  animation: qmEnter 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.qm-summary-aircraft {
  font-size: .9rem;
  font-weight: 500;
  color: #003057;
  min-width: 90px;
}
.qm-summary-amount {
  font-size: .9rem;
  font-weight: 700;
  color: #003057;
}
.qm-summary-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.qm-edit-btn,
.qm-delete-btn {
  background: none;
  border: none;
  font-size: .84rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.qm-edit-btn:hover   { color: #003057; }
.qm-delete-btn:hover { color: #dc3545; }

/* ── Decline confirmation overlay ────────────────────────── */
.decline-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
}

#declineConfirmBox {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px 22px;
  width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dc-message {
  font-size: .97rem;
  font-weight: 600;
  color: #003057;
  margin: 0;
}

.dc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#dcKeepBtn {
  background: #fff;
  border: 1.5px solid #a5c8de;
  border-radius: 6px;
  padding: 7px 18px;
  font-size: .86rem;
  font-weight: 500;
  color: #003057;
  cursor: pointer;
}
#dcKeepBtn:hover { background: #e8f3fa; }

#dcConfirmBtn {
  background: #dc3545;
  border: none;
  border-radius: 6px;
  padding: 7px 18px;
  font-size: .86rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}
#dcConfirmBtn:hover { background: #c82333; }

/* ── Confirm Aircraft Availability dialog ────────────────── */
.confirm-avail-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
}

#confirmAvailBox {
  background: #fff;
  border-radius: 10px;
  width: 560px;
  max-width: 92vw;
  max-height: 96vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
}

.ca-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: var(--brand-navy);
  border-radius: 10px 10px 0 0;
  padding: 16px 24px;
}
.ca-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.ca-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}
.ca-close-btn:hover { color: #fff; }

.ca-body {
  padding: 14px 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ca-desc {
  font-size: .85rem;
  color: #444;
  margin: 0;
}
.ca-upload-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 500;
}

.ca-trip-card {
  border: 1px solid #b8d5e8;
  border-radius: 8px;
  overflow: hidden;
}
.ca-trip-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  background: var(--brand-blue);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  padding: 8px 16px;
}
.ca-trip-bar span:nth-child(2) { text-align: center; }
.ca-trip-bar span:nth-child(3) { text-align: right; }

.ca-input-readonly {
  background: #eef2f5;
  color: #495057;
  cursor: default;
}
.ca-input-readonly:focus {
  border-color: #a5c8de;
  box-shadow: none;
}

.ca-locked-field {
  position: relative;
  display: flex;
}
.ca-locked-field .qm-input {
  width: 100%;
  padding-right: 30px;
}

.ca-upload-row .qm-upload-area {
  width: 100%;
  height: 140px;
}
.ca-upload-row .qm-upload-text .ca-upload-final {
  font-weight: 600;
}
.ca-lock-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #8aa0ad;
  font-size: .78rem;
  pointer-events: none;
}

.ca-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}
.ca-decline-btn {
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 24px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.ca-decline-btn:hover { background: #c82333; }
.ca-confirm-btn {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 28px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.ca-confirm-btn:hover { background: var(--brand-blue-hover); }

/* ── Booked card states ───────────────────────────────────── */

/* Disabled aircraft search input */
.qm-aircraft-wrap--disabled .qm-input { background: #f0f4f7; color: var(--text-muted); cursor: default; }
.qm-aircraft-wrap--disabled .qm-aircraft-prefix-text { background: #f0f4f7; color: #8aa0ad; border-color: #a5c8de; }

/* Badge variants for accepted/declined summary cards */
.badge-accepted { background-color: #1a7f4e; color: #fff; font-size: .75rem; }

/* Entry animation for accepted / declined booked card states */
@keyframes qmStatusIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Accepted card: green accent */
.qm-quote-form-card--accepted { border-color: #1a7f4e; animation: qmEnter 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.qm-trip-bar--accepted        { background: #1a7f4e !important; }
.qm-summary-row--accepted     { background: #eaf7f1; }

/* Declined card: red accent */
.qm-quote-form-card--declined { border-color: var(--status-declined); animation: qmEnter 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.qm-trip-bar--declined        { background: var(--status-declined) !important; }
.qm-summary-row--declined     { background: #fdf0f1; }

/* Modifying card: blue accent border */
.qm-quote-form-card--modifying { border-color: var(--brand-blue); }

/* Disabled upload area */
.qm-upload-area--disabled { opacity: .45; pointer-events: none; }

/* Booked action buttons row */
.qm-booked-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}
.qm-booked-decline-btn {
  background: none;
  border: 1.5px solid var(--status-declined);
  color: var(--status-declined);
  border-radius: 6px;
  padding: 6px 18px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  margin-right: auto;
}
.qm-booked-decline-btn:hover { background: #fdf0f1; }
.qm-booked-modify-btn {
  background: none;
  border: 1.5px solid #6c757d;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 6px 18px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.qm-booked-modify-btn:hover  { background: #f0f4f7; color: #003057; border-color: #003057; }
.qm-booked-cancel-btn {
  background: #fff;
  border: 1.5px solid #6c757d;
  border-radius: 6px;
  padding: 6px 22px;
  font-size: .88rem;
  color: #495057;
  font-weight: 600;
  cursor: pointer;
  margin-right: auto;
  transition: background .15s;
}
.qm-booked-cancel-btn:hover { color: #343a40; background: #f0f1f3; border-color: #495057; }
.qm-booked-accept-btn {
  background: #1a7f4e;
  border: 1.5px solid #1a7f4e;
  color: #fff;
  border-radius: 6px;
  padding: 6px 22px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.qm-booked-accept-btn:hover                  { background: #156640; }
.qm-booked-accept-btn--disabled,
.qm-booked-accept-btn[disabled]              { opacity: .4; cursor: not-allowed; }
.qm-booked-apply-btn {
  background: #fff;
  border: 1.5px solid var(--brand-blue);
  color: var(--brand-blue);
  border-radius: 6px;
  padding: 6px 22px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.qm-booked-apply-btn:hover { background: #e0f2fa; }

/* Add quotes group in booked mode — label sits flush above buttons */
.qm-booked-add-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
}

/* Locked add-button section hint */
.qm-multi-section--locked .qm-multi-btn { opacity: .45; cursor: not-allowed; }
.qm-multi-hint--locked { color: var(--text-muted); font-style: italic; font-size: .82rem; }
.qm-booked-undo-btn {
  background: none;
  border: 1.5px solid #6c757d;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 12px;
  margin-left: 12px;
  flex-shrink: 0;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.qm-booked-undo-btn:hover { background: #f0f4f7; color: #003057; border-color: #003057; }

.qm-amount-prefix--locked { background: #f0f4f7; color: #8aa0ad; }
.qm-amount-group--locked .qm-input { color: #6c757d !important; background: #f0f4f7; }
.qm-amount-group--locked { position: relative; }
.qm-amount-lock-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #8aa0ad;
  font-size: .72rem;
  pointer-events: none;
}

/* ── Undo button: icon-only at smaller screen widths ─────────── */
@media (max-width: 1599px) {
  .qm-undo-label { display: none; }
  .qm-booked-undo-btn { padding: 4px 8px; }
  .qm-summary-row { gap: 12px; }
}

/* ── Responsive: map stacks below form under 1440px ──────────── */
@media (max-width: 1439px) {
  #quoteModalWrapper {
    flex-direction: column;
    gap: 16px;
  }
  .index-map-panel .map-container {
    height: 440px !important;
    flex: none !important;
  }
}

@media (max-width: 991px) {
  /* Itinerary panel: no longer needs sticky/scroll constraint when stacked */
  .qm-sticky-panel {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
  /* Turn the vertical col divider into a horizontal one when stacked */
  #quoteModal .border-end {
    border-right: none !important;
    border-bottom: 1px solid #dee2e6;
  }
}

/* RTCQ — pointer cursor on clickable "my quote" rows */
#competitorTable tr.my-row,
#competitorTable tr.my-row-secondary {
  cursor: pointer;
}

/* ── Submit overlay ─────────────────────────────────────────── */
.submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}
.submit-overlay-box {
  background: #fff;
  border-radius: 10px;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--brand-darkest, #1a1a2e);
}
.submit-overlay-box video {
  width: 300px;
  height: 300px;
  object-fit: contain;
  display: block;
}
.submit-overlay-box p {
  margin: 0;
}
.submit-overlay-snippet {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-accent);
  min-height: 1.4em;
  text-align: center;
}
.submit-overlay-msg {
  font-size: .85rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
}
@keyframes so-slide-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0);    }
}
@keyframes so-slide-out {
  from { opacity: 1; transform: translateX(0);     }
  to   { opacity: 0; transform: translateX(-28px); }
}
.submit-overlay-snippet.so-in  { animation: so-slide-in  350ms ease forwards; }
.submit-overlay-snippet.so-out { animation: so-slide-out 350ms ease forwards; }
