/*
 * Travel Footprint theme overrides on top of MDB/Bootstrap (see
 * shared/css/mdb.min.css). Values follow the "EXO Travel" Stitch design:
 * navy primary, lime-green secondary, light-blue accent, Inter typeface,
 * left sidebar navigation. Kept as targeted overrides so we never need to
 * recompile the MDB SCSS.
 */

@import url(fonts/inter/400.css);
@import url(fonts/inter/500.css);
@import url(fonts/inter/600.css);
@import url(fonts/inter/700.css);

:root {
  --tf-primary: #1448a3;
  --tf-primary-rgb: 20, 72, 163;
  --tf-primary-hover: #0f3a85;
  --tf-primary-active: #0b2d68;
  --tf-secondary: #84c920;
  --tf-secondary-rgb: 132, 201, 32;
  --tf-info: #58bbf9;
  --tf-danger: #ba1a1a;
  --tf-body-bg: #f9f9ff;
  --tf-body-color: #161c27;
  --tf-muted: #434652;
  --tf-border-color: #dde2f0;
  --tf-surface-container: #eef1fb;
  --tf-surface-container-high: #dde2f3;
  --tf-card-radius: 0.75rem;
  --tf-card-shadow: 0 4px 6px -1px rgba(20, 72, 163, 0.05), 0 2px 4px -2px rgba(20, 72, 163, 0.08);
  --tf-sidebar-width: 16rem;
  --tf-trip-builder-max-width: 1100px;
  --tf-step-accommodation: var(--tf-primary);
  --tf-step-transport: var(--tf-info);
  --tf-step-activity: var(--tf-secondary);
  --tf-step-food: #b5872f;
}

/* ---------------------------------------------------------------------- *
 * Typography and base surface
 * ---------------------------------------------------------------------- */

body {
  font-family: "Inter", var(--mdb-font-sans-serif);
  background-color: var(--tf-body-bg);
  color: var(--tf-body-color);
  overflow-x: clip;
}

.btn,
.nav-link {
  text-transform: unset !important;
}

.card-header,
.tf-sidebar-section-label,
h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", var(--mdb-font-sans-serif);
}

/* ---------------------------------------------------------------------- *
 * Primary / secondary color recolor (MDB hardcodes these per-component,
 * so variable overrides alone are not enough for every state)
 * ---------------------------------------------------------------------- */

a {
  color: var(--tf-primary);
}
a:hover {
  color: var(--tf-primary-hover);
}

.text-primary {
  --mdb-text-opacity: 1;
  color: rgba(var(--tf-primary-rgb), var(--mdb-text-opacity)) !important;
}
.bg-primary {
  --mdb-bg-opacity: 1;
  background-color: rgba(var(--tf-primary-rgb), var(--mdb-bg-opacity)) !important;
}

.btn-primary,
.btn-check:checked + .btn-primary,
.btn-primary.active,
.btn-primary:active,
.btn-primary.disabled,
.btn-primary:disabled,
.show > .btn-primary.dropdown-toggle {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus {
  background-color: var(--tf-primary-hover);
  border-color: var(--tf-primary-hover);
  box-shadow: 0 0 0 0.25rem rgba(var(--tf-primary-rgb), 0.5);
}
.btn-primary:active,
.btn-primary.active {
  background-color: var(--tf-primary-active);
  border-color: var(--tf-primary-active);
}

.btn-outline-primary {
  color: var(--tf-primary);
  border-color: var(--tf-primary);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active,
.btn-outline-primary:active {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--tf-primary);
}

.nav-link.active,
.page-item.active .page-link {
  color: var(--tf-primary);
  border-color: var(--tf-primary);
}
.page-item.active .page-link {
  background-color: var(--tf-primary);
  color: #fff;
}

.form-outline .form-control:focus ~ .form-label {
  color: var(--tf-primary);
}
.form-check-input:checked {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
}

.text-success,
.bg-success {
  color: var(--tf-secondary) !important;
}
.bg-success {
  background-color: var(--tf-secondary) !important;
  color: #fff !important;
}

.text-info {
  color: var(--tf-info) !important;
}
.bg-info {
  background-color: var(--tf-info) !important;
  color: #161c27 !important;
}

.btn-info,
.btn-check:checked + .btn-info,
.btn-info.active,
.btn-info:active,
.btn-info.disabled,
.btn-info:disabled,
.show > .btn-info.dropdown-toggle {
  background-color: var(--tf-info);
  border-color: var(--tf-info);
  color: #0b2d4a;
}
.btn-info:hover,
.btn-info:focus,
.btn-info.focus {
  background-color: #3fa8e8;
  border-color: #3fa8e8;
  color: #0b2d4a;
  box-shadow: 0 0 0 0.25rem rgba(88, 187, 249, 0.5);
}

.btn-outline-info {
  color: #0b2d4a;
  border-color: var(--tf-info);
}
.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info.active,
.btn-outline-info:active {
  background-color: var(--tf-info);
  border-color: var(--tf-info);
  color: #0b2d4a;
}

.btn-outline-success {
  color: #4c7d0f;
  border-color: var(--tf-secondary);
}
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success.active,
.btn-outline-success:active {
  background-color: var(--tf-secondary);
  border-color: var(--tf-secondary);
  color: #fff;
}

.bg-warning {
  background-color: #e8b23d !important;
  color: #161c27 !important;
}
.bg-secondary {
  background-color: #5b6472 !important;
  color: #fff !important;
}

/* MDB's default .btn-secondary is a bright purple that clashes with the
   navy/green palette; use a neutral slate instead (Bootstrap's usual
   secondary-action role, not the Stitch "secondary" success green). */
.btn-secondary,
.btn-check:checked + .btn-secondary,
.btn-secondary.active,
.btn-secondary:active,
.btn-secondary.disabled,
.btn-secondary:disabled,
.show > .btn-secondary.dropdown-toggle {
  background-color: #5b6472;
  border-color: #5b6472;
}
.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary.focus {
  background-color: #464d59;
  border-color: #464d59;
  box-shadow: 0 0 0 0.25rem rgba(91, 100, 114, 0.5);
}

/* ---------------------------------------------------------------------- *
 * Cards, tables, alerts
 * ---------------------------------------------------------------------- */

.card {
  background-color: #fff;
  border: 1px solid var(--tf-border-color);
  border-radius: var(--tf-card-radius);
  box-shadow: var(--tf-card-shadow);
  min-width: 0;
  max-width: 100%;
}
.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--tf-border-color);
  font-weight: 600;
}
.card-body {
  min-width: 0;
  max-width: 100%;
}

.table thead th {
  background-color: var(--tf-surface-container);
  color: var(--tf-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  border-bottom-color: var(--tf-border-color);
}
.table td,
.table th {
  border-color: var(--tf-border-color);
}

/* ---------------------------------------------------------------------- *
 * Sidebar navigation shell
 * ---------------------------------------------------------------------- */

.tf-mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1020;
  background-color: #fff;
  border-bottom: 1px solid var(--tf-border-color);
  padding: 0.75rem 1rem;
}
.tf-mobile-header #page-logo {
  height: 36px;
}
.tf-mobile-toggle {
  border: 0;
  background: none;
  color: var(--tf-primary);
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
}

.tf-sidebar {
  width: var(--tf-sidebar-width);
  background-color: var(--tf-primary);
  border-right: 0;
  padding: 1.5rem 1rem;
}
.tf-sidebar .offcanvas-header {
  color: #fff;
}
.tf-sidebar .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}
.tf-sidebar-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tf-sidebar-brand {
  display: block;
  background-color: #fff;
  border-radius: var(--tf-card-radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 2rem;
  text-align: center;
}
.tf-sidebar-brand #page-logo {
  height: 36px;
}

.tf-sidebar-section-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.tf-sidebar-nav {
  list-style: none;
  margin: 0 0 2rem 0;
  padding: 0;
}
.tf-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.tf-sidebar-link i {
  width: 1.1rem;
  text-align: center;
}
.tf-sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.tf-sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.tf-sidebar-link-soon {
  cursor: default;
  opacity: 0.45;
  pointer-events: none;
}
.tf-sidebar-soon-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

.tf-sidebar-footer {
  margin-top: auto;
}
.tf-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--tf-card-radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
}
.tf-user-card i {
  font-size: 1.75rem;
  color: rgba(255, 255, 255, 0.8);
}
.tf-user-card-info {
  overflow: hidden;
}
.tf-user-card-name {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-user-card-email {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-sidebar-external-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.5rem;
}
.tf-sidebar-external-links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  text-decoration: none;
}
.tf-sidebar-external-links a:hover {
  color: #fff;
}

@media (min-width: 992px) {
  .tf-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    visibility: visible;
    transform: none;
  }
}

/* ---------------------------------------------------------------------- *
 * Main content offset
 * ---------------------------------------------------------------------- */

.tf-main-content {
  box-sizing: border-box;
  width: 100%;
  padding: 1.5rem 1rem 3rem;
  min-width: 0;
}
.tf-main-with-sidebar {
  padding-top: 4.5rem;
}
@media (min-width: 992px) {
  .tf-main-content {
    padding: 2.5rem 2rem;
  }
  .tf-main-with-sidebar {
    margin-left: var(--tf-sidebar-width);
    width: calc(100vw - var(--tf-sidebar-width));
    padding-top: 2.5rem;
  }
}

/* ---------------------------------------------------------------------- *
 * Misc app-specific helpers (unchanged behaviour, restyled color)
 * ---------------------------------------------------------------------- */

#page-logo {
  height: 50px;
}

.blank-button {
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
}

.blue-button {
  color: var(--tf-primary);
}

div.icon-margin {
  margin-left: 4rem;
}

span.icon {
  margin-left: -4rem;
}

/* ---------------------------------------------------------------------- *
 * Trip builder — header, day overview, step chips, wizard panels
 * ---------------------------------------------------------------------- */

.tf-trip-builder {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--tf-trip-builder-max-width);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}

.tf-trip-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tf-day-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background-color: var(--tf-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Itinerary timeline layout */
.tf-itinerary-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  max-width: 100%;
}

.tf-day-section {
  display: flex;
  gap: 1rem;
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.tf-day-section:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 3.5rem;
  bottom: -1.25rem;
  width: 2px;
  background-color: var(--tf-border-color);
  z-index: 0;
}

.tf-day-marker {
  flex: 0 0 3rem;
  position: relative;
  z-index: 1;
}

.tf-day-marker-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background-color: var(--tf-primary);
  color: #fff;
  border: 3px solid var(--tf-body-bg);
  box-shadow: var(--tf-card-shadow);
  line-height: 1.1;
}

.tf-day-marker-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.tf-day-marker-number {
  font-size: 1rem;
  font-weight: 700;
}

.tf-day-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.15rem;
}

.tf-overview-collapsed-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--tf-muted);
}

.tf-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tf-step-item {
  display: grid;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--tf-border-color);
  border-radius: 0.5rem;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(20, 72, 163, 0.06);
  transition: box-shadow 0.15s ease-in-out;
  min-width: 0;
  max-width: 100%;
}

.tf-step-item--draggable {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "rail body";
  align-items: center;
}

.tf-step-body {
  grid-area: body;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.tf-step-body .tf-step-card-title {
  flex: 0 1 auto;
  min-width: 0;
}

.tf-step-body .tf-step-card-meta {
  flex: 0 0 auto;
}

.tf-step-body .tf-step-card-badges {
  flex: 1 1 auto;
  min-width: 0;
}

.tf-step-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.tf-step-item:hover {
  box-shadow: 0 4px 10px -2px rgba(20, 72, 163, 0.1);
}
.tf-step-item--accommodation {
  border-top: 2px solid var(--tf-step-accommodation);
}
.tf-step-item--transport {
  border-top: 2px solid var(--tf-step-transport);
}
.tf-step-item--activity {
  border-top: 2px solid var(--tf-step-activity);
}
.tf-step-item--food {
  border-top: 2px solid var(--tf-step-food);
}

.tf-step-card-rail {
  grid-area: rail;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.15rem;
}

.tf-step-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid var(--tf-body-bg);
  box-shadow: 0 1px 2px rgba(20, 72, 163, 0.1);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.tf-step-icon-circle--accommodation {
  background-color: var(--tf-surface-container);
  color: var(--tf-primary);
}
.tf-step-icon-circle--transport {
  background-color: rgba(88, 187, 249, 0.2);
  color: #0b5a8a;
}
.tf-step-icon-circle--activity {
  background-color: rgba(132, 201, 32, 0.2);
  color: #446e00;
}
.tf-step-icon-circle--food {
  background-color: var(--tf-surface-container-high);
  color: var(--tf-muted);
}

.tf-step-card-meta {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  color: var(--tf-muted);
}

.tf-step-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--tf-primary);
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tf-step-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 auto;
}

.tf-step-card-badges .badge {
  font-size: 0.68rem;
  font-weight: 600;
}

.tf-step-item-label {
  flex: 1 1 auto;
  min-width: 0;
}

.tf-step-action-form {
  margin: 0;
  display: flex;
  align-items: center;
}

.tf-step-action-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--tf-border-color);
  border-radius: 0.35rem;
  background-color: #fff;
  color: var(--tf-body-color);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.tf-step-action-btn i {
  font-size: 0.8rem;
  width: 0.9rem;
  text-align: center;
  flex-shrink: 0;
}

.tf-step-action-btn span {
  font-size: 0.68rem;
  font-weight: 600;
}

.tf-step-action-btn--edit {
  color: var(--tf-primary);
  border-color: rgba(var(--tf-primary-rgb), 0.35);
}
.tf-step-action-btn--edit:hover {
  background-color: rgba(var(--tf-primary-rgb), 0.06);
  color: var(--tf-primary-hover);
}

.tf-step-action-btn--info {
  color: var(--tf-muted);
  border-color: var(--tf-border-color);
}
.tf-step-action-btn--info:hover {
  background-color: var(--tf-surface-container);
  color: var(--tf-body-color);
}

.tf-step-action-btn--delete {
  color: var(--tf-danger);
  border-color: rgba(186, 26, 26, 0.35);
}
.tf-step-action-btn--delete:hover {
  background-color: rgba(186, 26, 26, 0.06);
  color: var(--tf-danger);
}

.tf-add-step-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  width: 100%;
}

.tf-add-step-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  border: 2px dashed rgba(var(--tf-primary-rgb), 0.25);
  border-radius: 0.5rem;
  background-color: var(--tf-surface-container);
  color: rgba(var(--tf-primary-rgb), 0.72);
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.tf-add-step-btn:hover,
.tf-add-step-btn:focus {
  background-color: var(--tf-surface-container-high);
  text-decoration: none;
}

.tf-add-step-btn--accommodation {
  border-color: rgba(var(--tf-primary-rgb), 0.28);
  color: rgba(var(--tf-primary-rgb), 0.72);
}
.tf-add-step-btn--accommodation:hover,
.tf-add-step-btn--accommodation:focus {
  border-color: rgba(var(--tf-primary-rgb), 0.45);
  color: var(--tf-primary);
}

.tf-add-step-btn--transport,
.tf-add-step-btn--flight {
  border-color: rgba(88, 187, 249, 0.35);
  color: rgba(11, 90, 138, 0.72);
}
.tf-add-step-btn--transport:hover,
.tf-add-step-btn--transport:focus,
.tf-add-step-btn--flight:hover,
.tf-add-step-btn--flight:focus {
  border-color: rgba(88, 187, 249, 0.55);
  color: #0b5a8a;
}

.tf-add-step-btn--activity {
  border-color: rgba(var(--tf-secondary-rgb), 0.35);
  color: rgba(68, 110, 0, 0.72);
}
.tf-add-step-btn--activity:hover,
.tf-add-step-btn--activity:focus {
  border-color: rgba(var(--tf-secondary-rgb), 0.55);
  color: #446e00;
}

.tf-add-step-btn--food {
  border-color: rgba(181, 135, 47, 0.35);
  color: rgba(120, 90, 30, 0.78);
}
.tf-add-step-btn--food:hover,
.tf-add-step-btn--food:focus {
  border-color: rgba(181, 135, 47, 0.55);
  color: #785a1e;
}

#tripStepModal .modal-dialog {
  max-width: min(820px, calc(100vw - 1.5rem));
  margin: 0.75rem auto;
}

#tripStepModal .modal-body {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 7rem);
  padding: 0.75rem 1rem;
}

#tripStepModal .modal-body .tf-wizard-panel {
  border: 0;
  box-shadow: none;
  margin-top: 0 !important;
}

#tripStepModal .modal-body .tf-wizard-panel > .card-header {
  display: none;
}

#tripStepModal .modal-body .tf-wizard-panel > .card-body {
  padding: 0 !important;
}

#tripStepModal .modal-body .container {
  max-width: 100%;
  padding: 0;
}

#tripStepModal .tf-transport-form-row > [class*="col-"] {
  flex: 0 0 100%;
  max-width: 100%;
}

.tf-transport-map {
  height: min(24rem, 50vh);
  width: 100%;
}

#tripStepModal .tf-transport-map {
  height: min(18rem, 38vh);
  width: 100%;
}

#tripStepModal .table-responsive {
  margin-bottom: 0;
}

#tripStepModal .row.mb-3 {
  --bs-gutter-x: 0.75rem;
  margin-left: 0;
  margin-right: 0;
}

#tripStepModal .row.mb-3 > [class*="col-lg-3"],
#tripStepModal .row.mb-3 > [class*="col-4"],
#tripStepModal .row.mb-3 > [class*="col-5"] {
  font-weight: 500;
}

#tripStepModal .row.mb-3 > [class*="col-lg-8"],
#tripStepModal .row.mb-3 > [class*="col-8"]:not([class*="col-lg-1"]) {
  min-width: 0;
}

#tripStepModal .row.mb-3 .w-100,
#tripStepModal .row.mb-3 input[type="text"],
#tripStepModal .row.mb-3 input[type="number"],
#tripStepModal .row.mb-3 select {
  max-width: 100%;
}

#tripStepModal .tf-flight-step-name-preview {
  font-weight: 600;
  color: var(--tf-primary);
  word-break: break-word;
}

#tripStepModal .row.mb-3 fieldset {
  margin-bottom: 0;
}

#tripStepModal .row.mb-3 fieldset label {
  font-weight: 400;
  margin-right: 0.75rem;
}

#tripStepModal #hotel_map_filter .col-lg-9,
#tripStepModal #hotel_map_filter .col-lg-3 {
  flex: 0 0 100%;
  max-width: 100%;
}

#tripStepModal #leafletmap {
  height: min(16rem, 34vh) !important;
}

.tf-step-list-continued {
  margin-bottom: 0;
}

.tf-step-item--continued {
  opacity: 0.9;
  background-color: var(--tf-surface-container);
  border-style: dashed;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "rail body";
  padding: 0.35rem 0.6rem;
  align-items: center;
}

.tf-step-drag-handle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.25rem;
  color: var(--tf-muted);
  cursor: grab;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}
.tf-step-drag-handle:active {
  cursor: grabbing;
}
.tf-step-item--draggable:hover .tf-step-drag-handle {
  color: var(--tf-primary);
  background-color: rgba(var(--tf-primary-rgb), 0.08);
}

.tf-step-item-ghost {
  opacity: 0.45;
}
.tf-step-item-chosen {
  box-shadow: 0 8px 20px -4px rgba(20, 72, 163, 0.15);
}
.tf-step-item-dragging {
  opacity: 0.9;
}

.tf-step-dnd-pending {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 575.98px) {
  .tf-day-section {
    gap: 0.65rem;
  }
  .tf-day-marker {
    flex-basis: 2.5rem;
  }
  .tf-day-marker-circle {
    width: 2.5rem;
    height: 2.5rem;
  }
  .tf-day-section:not(:last-child)::after {
    left: 1.25rem;
    top: 3rem;
  }
  .tf-main-content {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* ---------------------------------------------------------------------- *
 * Trip builder — step wizard panels and product pickers
 * ---------------------------------------------------------------------- */

.tf-wizard-panel {
  border-top: 4px solid var(--tf-primary);
}
.tf-wizard-panel--accommodation {
  border-top-color: var(--tf-step-accommodation);
}
.tf-wizard-panel--transport {
  border-top-color: var(--tf-step-transport);
}
.tf-wizard-panel--activity {
  border-top-color: var(--tf-step-activity);
}
.tf-wizard-panel--food {
  border-top-color: var(--tf-step-food);
}

.tf-product-picker-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--tf-border-color);
}
.tf-product-picker-row:last-child {
  border-bottom: 0;
}
.tf-product-picker-icon {
  flex: 0 0 2rem;
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
  color: var(--tf-muted);
}
.tf-product-picker-buttons {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tf-type-card-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.tf-type-card {
  flex: 1 1 12rem;
  display: block;
  background-color: #fff;
  border: 1px solid var(--tf-border-color);
  border-top: 4px solid var(--tf-primary);
  border-radius: var(--tf-card-radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--tf-body-color);
  transition: box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}
form.tf-type-card {
  margin: 0;
}
.tf-type-card:hover {
  box-shadow: var(--tf-card-shadow);
  transform: translateY(-2px);
  color: var(--tf-body-color);
}
.tf-type-card--accommodation {
  border-top-color: var(--tf-step-accommodation);
}
.tf-type-card--transport {
  border-top-color: var(--tf-step-transport);
}
.tf-type-card--activity {
  border-top-color: var(--tf-step-activity);
}
.tf-type-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--tf-primary);
}
.tf-type-card--transport .tf-type-card-icon {
  color: var(--tf-step-transport);
}
.tf-type-card--activity .tf-type-card-icon {
  color: var(--tf-step-activity);
}
.tf-type-card-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.tf-type-card-hint {
  color: var(--tf-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ---------------------------------------------------------------------- *
 * Frozen product report (Stitch-inspired layout)
 * ---------------------------------------------------------------------- */

.tf-report {
  min-width: 0;
}

.tf-report-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "summary"
    "breakdown"
    "daily"
    "steps";
}

.tf-report-panel {
  min-width: 0;
}

.tf-report-panel--summary { grid-area: summary; }
.tf-report-panel--breakdown { grid-area: breakdown; }
.tf-report-panel--daily { grid-area: daily; }
.tf-report-panel--steps { grid-area: steps; }

@media (min-width: 1500px) {
  .tf-report-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "steps summary"
      "steps breakdown"
      "steps daily";
    align-items: start;
    gap: 1.5rem;
  }

  .tf-report-panel--steps {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: 0.25rem;
  }
}

.tf-report-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--tf-border-color);
  border-radius: var(--tf-card-radius);
  box-shadow: var(--tf-card-shadow);
}

.tf-report-card .card-body {
  padding: 1.75rem;
}

.tf-report-card-title {
  color: var(--tf-primary);
  font-weight: 600;
  font-size: 1.25rem;
}

.tf-report-header .card-body {
  padding: 1.25rem 1.75rem;
}

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

.tf-report-breadcrumb a {
  color: var(--tf-muted);
  text-decoration: none;
}

.tf-report-breadcrumb a:hover {
  color: var(--tf-primary);
}

.tf-report-breakdown-bar {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background-color: var(--tf-surface-container);
  box-shadow: inset 0 1px 3px rgba(20, 72, 163, 0.08);
}

.tf-report-breakdown-segment {
  height: 100%;
  min-width: 0;
  transition: width 0.3s ease;
}

.tf-report-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .tf-report-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tf-report-stat {
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: var(--tf-surface-container-low, #f1f3ff);
  border-bottom: 4px solid var(--tf-primary);
  min-width: 0;
}

.tf-report-stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tf-muted);
  margin-bottom: 0.25rem;
}

.tf-report-stat-pct {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tf-primary);
}

.tf-report-stat-kg {
  display: block;
  font-size: 0.65rem;
  color: var(--tf-muted);
  margin-top: 0.25rem;
}

.tf-report-summary-metric {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--tf-primary);
  margin-bottom: 0;
}

.tf-report-summary-metric span {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--tf-muted);
}

.tf-report-summary-meta {
  color: var(--tf-muted);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.tf-report-chart-wrap {
  position: relative;
  height: 16rem;
  width: 100%;
}

.tf-report-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--tf-border-color);
}

.tf-report-chart-controls .form-check {
  margin-bottom: 0;
}

.tf-report-insight {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--tf-border-color);
  color: var(--tf-muted);
  font-size: 0.875rem;
}

.tf-report-insight i {
  color: var(--tf-secondary);
  margin-top: 0.125rem;
}

.tf-report-category-heading {
  color: var(--tf-primary);
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  text-transform: capitalize;
}

.tf-report-category-heading:first-child {
  margin-top: 0;
}

.tf-report-step-card {
  border: 1px solid var(--tf-border-color);
  border-radius: 0.75rem;
  background-color: var(--tf-surface-container-low, #f1f3ff);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s ease;
}

.tf-report-step-card:hover {
  border-color: rgba(var(--tf-primary-rgb), 0.35);
}

.tf-report-step-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.tf-report-step-body {
  flex: 1;
  min-width: 0;
}

.tf-report-step-aside {
  float: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  flex-shrink: 0;
  max-width: 50%;
  text-align: right;
}

.tf-report-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background-color: var(--tf-surface-container);
  color: var(--tf-primary);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.tf-report-step-title {
  font-weight: 700;
  color: var(--tf-primary);
  margin-bottom: 0.125rem;
  line-height: 1.3;
}

.tf-report-step-meta {
  color: var(--tf-muted);
  font-size: 0.8125rem;
  margin-bottom: 0;
  line-height: 1.4;
}

.tf-report-step-ref {
  white-space: nowrap;
  font-size: 0.8125rem;
}

.tf-report-step-co2 {
  font-weight: 700;
  color: var(--tf-primary);
  font-size: 0.875rem;
  white-space: nowrap;
}

.tf-report-export-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tf-report-export-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Custom fields */
.tf-cf-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.tf-cf-markers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.tf-cf-markers-inline {
  min-height: 1.25rem;
}

.tf-cf-column-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--tf-surface-alt, #f8f9fa);
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.375rem;
}

.tf-cf-column-toggle-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tf-muted, #6c757d);
}

.tf-cf-inline-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
}

.tf-cf-drag-handle {
  cursor: grab;
  color: var(--tf-muted, #6c757d);
}

.tf-cf-drag-handle-cell {
  width: 2rem;
  vertical-align: middle;
}

.tf-cf-row-ghost {
  opacity: 0.5;
}

.tf-cf-row-chosen {
  background: rgba(0, 0, 0, 0.03);
}

.tf-cf-dnd-pending {
  opacity: 0.7;
  pointer-events: none;
}

.tf-cf-cell-inner {
  min-height: 1.5rem;
}

.tf-cf-edit-btn {
  flex-shrink: 0;
  line-height: 1;
}

.tf-cf-edit-btn .fa-pencil {
  font-size: 0.75rem;
}

.tf-cf-edit-col {
  width: 2rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  vertical-align: middle;
  white-space: nowrap;
}
