* { box-sizing: border-box; }
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #f0f9ff 0%, #f5f3ff 50%, #fff7ed 100%);
  color: #111827;
}
.container { max-width: 1560px; margin: 20px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.hidden { display: none !important; }
.form-grid { display: grid; gap: 10px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
label { display: grid; gap: 4px; font-size: 14px; }
input, select, button { padding: 10px; border-radius: 8px; border: 1px solid #d1d5db; }
button { background: #2563eb; color: #fff; border: none; cursor: pointer; }
button:hover { background: #1d4ed8; }
.btn-secondary { background: #334155; }
.btn-secondary:hover { background: #1e293b; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.actions-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-cancelled { opacity: 0.55; }
.row-cancelled td { text-decoration: line-through; }
.status-cancelled { color: #b91c1c; font-weight: 600; text-decoration: none; }
.activity-day-move-select { max-width: 160px; }
.error { color: #b91c1c; min-height: 18px; }
.muted { color: #6b7280; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.simple-list { list-style: disc; padding-left: 20px; margin: 0; }

.desktop-layout {
  display: block;
}

.desktop-main-area {
  min-width: 0;
}

.vacation-sidebar-card {
  margin-bottom: 0;
}

.vacation-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.vacation-sidebar-header h3 {
  margin: 0;
}

.vacation-sidebar-header button {
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

.vacations-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.vacation-sidebar-item {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.vacation-sidebar-item.selected {
  border-color: #3b82f6;
  box-shadow: inset 0 0 0 1px #3b82f6;
}

.vacation-sidebar-select {
  width: 100%;
  text-align: left;
  background: #eff6ff;
  color: #0f172a;
}

.vacation-sidebar-select:hover {
  background: #dbeafe;
}

.vacation-sidebar-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.vacation-sidebar-actions button {
  font-size: 12px;
  padding: 6px 8px;
}

.vacation-sidebar-hover {
  position: absolute;
  left: calc(100% + 8px);
  top: 8px;
  min-width: 220px;
  max-width: 280px;
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 20;
}

.vacation-sidebar-item:hover .vacation-sidebar-hover {
  opacity: 1;
  transform: translateY(0);
}

.compact-row {
  padding-top: 10px;
  padding-bottom: 10px;
}

.compact-row h3 {
  margin: 0;
}

.compact-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.compact-row-head .muted {
  margin: 0;
}

.compact-row-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.summary-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.summary-inline-grid div {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 4px;
}

.summary-inline-grid strong {
  font-size: 14px;
}

.summary-inline-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planning-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.planning-board.collapsed .planning-board-body {
  display: none;
}

.planning-board.collapsed {
  margin-bottom: 8px;
}

.settings-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title-row h3 {
  margin: 0;
}

.settings-side-panel {
  position: static;
  width: 100%;
  max-height: none;
  overflow: visible;
}

.vacations-search-row {
  margin-bottom: 10px;
}

#vacations-search {
  width: min(420px, 100%);
}

.settings-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-list-item .actions-row button {
  padding: 6px 10px;
  font-size: 12px;
}

.planner-major-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.planner-major-card {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 10px;
  background: #f8fbff;
}

.planner-major-card h5 {
  margin: 0 0 8px;
  font-size: 14px;
}

.planner-card-flight { border-color: #bae6fd; background: linear-gradient(180deg, #f0f9ff, #fff); }
.planner-card-hotel  { border-color: #c4b5fd; background: linear-gradient(180deg, #f5f3ff, #fff); }
.planner-card-transport { border-color: #bbf7d0; background: linear-gradient(180deg, #ecfdf5, #fff); }
.planner-card-general { border-color: #fed7aa; background: linear-gradient(180deg, #fff7ed, #fff); }

/* Trip overview */
.planner-overview {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.planner-overview-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.planner-overview-meta {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 10px;
}
.planner-ov-kpis.kpis div {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: #fff;
}
.planner-ov-kpis.kpis strong { color: #fff; }
.planner-ov-kpis.kpis span { color: rgba(255,255,255,0.7); }

/* Budget dashboard */
.budget-dashboard {
  margin-bottom: 14px;
}
.budget-bar-container {
  margin-top: 8px;
}
.budget-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.budget-bar-track {
  height: 14px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}
.budget-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.budget-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
.budget-bar-fill.over { background: linear-gradient(90deg, #ef4444, #b91c1c); }

/* Finance grid */
.planner-finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.planner-finance-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}
.planner-finance-card h5 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

/* Daily itinerary */
.daily-itinerary-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.itinerary-day {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.itinerary-day-today {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.itinerary-day-today .itinerary-day-header {
  background: linear-gradient(90deg, #dbeafe, #eff6ff);
}
.itinerary-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #f8fafc, #eff6ff);
  border-bottom: 1px solid #e2e8f0;
  position: relative;
}
.itinerary-day-number {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.itinerary-day-date {
  font-weight: 600;
  font-size: 14px;
}
.itinerary-day-weekday {
  font-size: 12px;
  color: #6b7280;
}
.itinerary-day-hotel {
  margin-left: auto;
  font-size: 12px;
  background: #f5f3ff;
  color: #6d28d9;
  padding: 3px 10px;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
}
.itinerary-day-body {
  padding: 10px 14px;
  display: grid;
  gap: 6px;
}
.itinerary-event {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
}
.itinerary-event-icon {
  flex-shrink: 0;
  font-size: 16px;
}
.itinerary-event-text {
  flex: 1;
}
.itinerary-event-time {
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
}
.itinerary-note {
  width: 100%;
  min-height: 50px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  margin-top: 6px;
}
.itinerary-note-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.itinerary-note-row .itinerary-note {
  flex: 1;
}
.itinerary-save-btn {
  padding: 8px 14px;
  font-size: 12px;
  white-space: nowrap;
  align-self: flex-end;
  flex-shrink: 0;
}

.trip-calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.trip-day-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.trip-day-card h5 {
  margin: 0 0 8px;
}

.trip-day-events {
  margin: 0 0 8px;
  padding-left: 18px;
}

.trip-day-note {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px;
  font-family: Arial, sans-serif;
}

.attraction-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.trip-map-box {
  height: 360px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  overflow: hidden;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  display: inline-block;
  margin: 10px 0;
}

.section-planning { background: linear-gradient(90deg, #0ea5e9, #3b82f6); }
.section-settings { background: linear-gradient(90deg, #8b5cf6, #6366f1); }
.section-expenses { background: linear-gradient(90deg, #f97316, #ef4444); }

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-upcoming { border: 1px solid #dbeafe; background: linear-gradient(180deg, #ffffff, #eff6ff); }
.card-planning { border-left: 5px solid #3b82f6; }
.card-settings { border-left: 5px solid #8b5cf6; }
.card-expenses { border-left: 5px solid #f97316; }

.upcoming-soft {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
}

.upcoming-soft h3 {
  margin-bottom: 8px;
}

.upcoming-soft .kpis {
  margin-bottom: 0;
}

#vacation-workspace { display: grid; gap: 14px; }
#selected-vacation-text { font-weight: 600; }

.workspace-shell {
  display: block;
}

.workspace-content {
  min-width: 0;
}

.workspace-sidebar {
  display: grid;
  gap: 10px;
}

.workspace-nav-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.workspace-nav-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.desktop-top-grid {
  display: block;
}

.desktop-side-col {
  display: grid;
  gap: 12px;
}

.table-scroll {
  max-height: 340px;
  overflow: auto;
}

.compact-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-tab {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  background: #e2e8f0;
  color: #0f172a;
}

.workspace-nav-group .workspace-tab:last-child {
  margin-bottom: 0;
}

.workspace-tab:hover {
  background: #cbd5e1;
}

.workspace-tab.active {
  background: #2563eb;
  color: #fff;
}

.hidden-desktop-pane {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 5000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #fff;
  width: min(720px, 100%);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #e5e7eb; font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.kpis div { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.kpis strong { font-size: 18px; }
.colorful-kpis div:nth-child(4n+1) { background: #eff6ff; border-color: #bfdbfe; }
.colorful-kpis div:nth-child(4n+2) { background: #f5f3ff; border-color: #ddd6fe; }
.colorful-kpis div:nth-child(4n+3) { background: #fff7ed; border-color: #fed7aa; }
.colorful-kpis div:nth-child(4n+4) { background: #ecfdf5; border-color: #bbf7d0; }

.mobile-only { display: none; }
.mobile-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fff; }
.mobile-card h5 { margin: 0 0 6px 0; }
.mobile-row { display: flex; justify-content: space-between; font-size: 14px; margin-top: 4px; }

@media (max-width: 768px) {
  .form-grid.two-col, .form-grid.three-col { grid-template-columns: 1fr; }
  .desktop-only { display: none; }
  .mobile-only { display: block; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .section-title { font-size: 12px; }
  .planner-major-grid, .trip-calendar-grid { grid-template-columns: 1fr; }
  .planner-finance-grid { grid-template-columns: 1fr; }
  .itinerary-day-header { flex-wrap: wrap; }
  .itinerary-day-hotel { margin-left: 0; margin-top: 4px; }
  .route-note-layout { grid-template-columns: 1fr; }
  .route-inline-map { height: 180px; }
  .route-inline-legs { min-height: auto; }

  /* ── Hide desktop-only layout on mobile ── */
  .topbar { display: none !important; }
  .desktop-layout { display: none !important; }
  .desktop-top-grid { display: none !important; }
  .section-title.section-planning { display: none !important; }
  .section-title.section-settings { display: none !important; }
  #expenses-section-title { display: none !important; }
  .workspace-sidebar { display: none !important; }
  .planning-board-header { display: none; }
  .planning-board .planning-board-body { display: block !important; }

  .settings-side-wrap {
    position: static;
    margin-bottom: 10px;
  }

  .settings-side-panel {
    position: static;
    width: auto;
    max-height: none;
  }

  /* ── Mobile app container ── */
  .container { margin: 0; padding: 0 8px; }
  #app-section { padding-bottom: 72px; }

  /* ── Mobile bottom nav (flex override for mobile-only) ── */
  #mobile-bottom-nav.mobile-only { display: flex; }

  /* ── Hide ALL workspace panes by default on mobile ── */
  .hidden-desktop-pane { display: none; }
  .workspace-pane { display: none !important; }

  /* ── Show panes based on active mobile tab ── */
  body[data-mobile-tab="home"] #mobile-home { display: block !important; }

  /* Vacation management list only belongs on the Home tab; keep it out of the way elsewhere */
  #vacations-mobile { display: none !important; }
  body[data-mobile-tab="home"] #vacations-mobile { display: block !important; }

  /* Vacation switcher only belongs on the Home tab; keep it out of the way elsewhere */
  #mobile-vacation-select { display: none !important; }
  body[data-mobile-tab="home"] #mobile-vacation-select { display: block !important; }

  body[data-mobile-tab="plan"] #planner-pane { display: block !important; }
  body[data-mobile-tab="plan"] #mobile-home { display: none !important; }

  body[data-mobile-tab="bookings"] #mobile-bookings-switcher { display: flex !important; }
  body[data-mobile-tab="bookings"][data-booking-type="all"] #flights-pane,
  body[data-mobile-tab="bookings"][data-booking-type="all"] #hotels-pane,
  body[data-mobile-tab="bookings"][data-booking-type="all"] #transport-pane,
  body[data-mobile-tab="bookings"][data-booking-type="all"] #general-pane { display: block !important; }

  body[data-mobile-tab="bookings"][data-booking-type="flight"] #flights-pane { display: block !important; }
  body[data-mobile-tab="bookings"][data-booking-type="hotel"] #hotels-pane { display: block !important; }
  body[data-mobile-tab="bookings"][data-booking-type="transport"] #transport-pane { display: block !important; }
  body[data-mobile-tab="bookings"][data-booking-type="general"] #general-pane { display: block !important; }
  body[data-mobile-tab="bookings"] #mobile-home { display: none !important; }

  body[data-mobile-tab="expenses"] #expenses-pane { display: block !important; }
  body[data-mobile-tab="expenses"] #mobile-home { display: none !important; }
  body[data-mobile-tab="cash"] #cash-pane { display: block !important; }
  body[data-mobile-tab="cash"] #mobile-home { display: none !important; }
  body[data-mobile-tab="report"] #report-pane { display: block !important; }
  body[data-mobile-tab="report"] #mobile-home { display: none !important; }

  /* ── Planner: read-only on mobile ── */
  body[data-mobile-tab="plan"] #planned-expense-form { display: none !important; }
  body[data-mobile-tab="plan"] #attraction-form { display: none !important; }
  body[data-mobile-tab="plan"] #food-add-to-planned { display: none !important; }
  body[data-mobile-tab="plan"] .food-prices-row input { pointer-events: none; opacity: 0.7; }
  body[data-mobile-tab="plan"] .food-toggle-all { display: none !important; }
  body[data-mobile-tab="plan"] .food-cb { pointer-events: none; }
  body[data-mobile-tab="plan"] .add-note-row { display: none !important; }
  body[data-mobile-tab="plan"] .day-note-actions { display: none !important; }
  body[data-mobile-tab="plan"] .map-filters { display: none !important; }

  /* ── Trip Planner: Summary / Daily / General sub-tabs ── */
  .planner-mobile-subtabs {
    display: flex;
    gap: 6px;
    margin: 8px 0 14px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    padding: 6px 0;
  }
  .planner-subtab-btn {
    flex: 1;
    padding: 8px 6px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .planner-subtab-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
  }
  .planner-subtab-group { display: none; }
  .planner-subtab-group.active-subtab { display: block; }

  /* ── Daily itinerary: swipeable day cards ── */
  .planner-subtab-group[data-subtab="daily"] {
    max-width: 100%;
    overflow-x: hidden;
  }
  .daily-itinerary-grid {
    display: flex;
    grid-template-columns: unset;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    margin: 0 -8px;
    padding: 2px 8px 10px;
    contain: layout;
  }
  .daily-itinerary-grid .itinerary-day {
    flex: 0 0 100%;
    min-width: 0;
    max-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    contain: layout;
  }
  .daily-itinerary-grid .itinerary-day * {
    min-width: 0;
    word-break: break-word;
  }
  .daily-itinerary-grid .itinerary-day .route-inline-map,
  .daily-itinerary-grid .itinerary-day img {
    max-width: 100%;
  }

  /* ── Bookings: read-only on mobile (hide forms) ── */
  body[data-mobile-tab="bookings"] #flight-form,
  body[data-mobile-tab="bookings"] #hotel-form,
  body[data-mobile-tab="bookings"] #transport-form,
  body[data-mobile-tab="bookings"] #general-form { display: none !important; }

  /* ── Report: simplified on mobile ── */
  body[data-mobile-tab="report"] #report-pane table { display: none; }
  body[data-mobile-tab="report"] #report-pane .desktop-only { display: none !important; }
}

@media (min-width: 1024px) {
  .desktop-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 14px;
    align-items: start;
  }

  .vacation-sidebar {
    position: sticky;
    top: 10px;
    align-self: start;
    z-index: 3;
  }

  .desktop-main-area {
    min-width: 0;
  }

  .workspace-shell {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
  }

  .workspace-sidebar {
    position: sticky;
    top: 8px;
    align-self: start;
  }

  .desktop-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 14px;
    align-items: start;
  }

  .section-title.section-planning,
  .section-title.section-expenses {
    display: none;
  }

  .desktop-side-col {
    position: sticky;
    top: 10px;
    max-height: calc(100vh - 18px);
    overflow: auto;
  }

  .upcoming-soft .kpis div:nth-child(n+5) {
    display: none;
  }
}

/* ── Day Notes ── */
.day-notes-section { margin-top: 8px; }

.day-note-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fafbfc;
}

.day-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.day-note-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.note-type-text { background: #e0f2fe; color: #0369a1; }
.note-type-route { background: #dcfce7; color: #15803d; }
.note-type-timetable { background: #fef3c7; color: #b45309; }
.note-type-attraction { background: #ffe4e6; color: #be123c; }

.day-note-title {
  font-weight: 600;
  font-size: 13px;
}

.day-note-actions {
  margin-left: auto;
  display: flex;
  gap: 3px;
}

.day-note-actions .btn-sm {
  padding: 1px 6px;
  font-size: 11px;
  min-width: 0;
  line-height: 1.4;
}

.day-note-body {
  font-size: 13px;
  color: #334155;
}

.note-text-content { white-space: pre-wrap; }

.route-steps {
  margin: 4px 0 0 18px;
  padding: 0;
  font-size: 13px;
}

.route-steps li { margin-bottom: 2px; }

.timetable-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.timetable-mini td {
  padding: 3px 8px;
  border-bottom: 1px solid #e5e7eb;
}

.timetable-mini .tt-time {
  font-weight: 600;
  white-space: nowrap;
  width: 70px;
  color: #2563eb;
}

.add-note-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.add-note-row select {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.add-note-row .btn-sm {
  font-size: 12px;
  padding: 4px 10px;
}

/* ── Day Note Items ── */

.day-note-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.day-note-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.day-note-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.note-type-text { background: #e0f2fe; color: #0369a1; }
.note-type-route { background: #dcfce7; color: #15803d; }
.note-type-timetable { background: #fef3c7; color: #b45309; }

.day-note-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

.day-note-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.day-note-actions button {
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #0f172a;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
}

.day-note-actions button:hover {
  background: #e2e8f0;
}

.day-note-actions .btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.day-note-actions .btn-secondary {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.day-note-body {
  font-size: 13px;
  line-height: 1.5;
}

/* ── Route Note Display ── */

.route-note-display {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-note-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: start;
  margin: 8px 0;
  min-width: 0;
}

.route-inline-map {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  overflow: hidden;
  min-width: 0;
}

.route-inline-legs {
  min-height: 220px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  overflow: auto;
  min-width: 0;
}

.route-mode-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  width: fit-content;
}

.route-mode-foot {
  background: #dcfce7;
  color: #166534;
}

.route-mode-car {
  background: #dbeafe;
  color: #1e40af;
}

.route-waypoint-list {
  list-style: none;
  padding: 0;
  margin: 4px 0;
  font-size: 13px;
}

.route-waypoint-list li {
  padding: 2px 0 2px 4px;
  border-left: 2px solid #d1d5db;
  margin-left: 8px;
  padding-left: 10px;
}

.route-waypoint-list li:first-child {
  border-left-color: #16a34a;
}

.route-waypoint-list li:last-child {
  border-left-color: #dc2626;
}

.view-route-map-btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  width: fit-content;
}

.view-route-map-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.route-leg-summary {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.route-leg-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.route-leg-list {
  display: grid;
  gap: 6px;
}

.route-leg-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 13px;
}

.route-leg-label {
  font-weight: 600;
}

.route-leg-meta {
  color: #475569;
  white-space: nowrap;
}

.route-leg-summary-empty {
  font-size: 13px;
}

.route-inline-legs .route-leg-summary,
.route-inline-legs .route-leg-summary-empty {
  margin-top: 0;
}

/* ── Route Editor Modal ── */

.route-editor-section h5 {
  font-size: 14px;
  color: #374151;
}

.route-wp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.route-wp-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.route-wp-address {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}

.route-wp-status {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.route-wp-geocode,
.route-wp-remove {
  border: none;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
}

.route-wp-geocode:hover { background: #e5e7eb; }
.route-wp-remove:hover { background: #fee2e2; color: #dc2626; }

/* ── Route Viewer ── */

.route-viewer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.route-viewer-waypoints {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.route-viewer-wp {
  font-size: 13px;
  padding: 4px 8px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

/* ── Food Cost Planner ── */

.food-planner-section {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px;
}

.food-prices-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.food-prices-row label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
}

.food-prices-row input {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}

.food-grid-container {
  overflow-x: auto;
  margin: 10px 0;
}

.food-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.food-grid-table th,
.food-grid-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.food-grid-table th {
  background: #fef3c7;
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
}

.food-grid-table th:first-child,
.food-grid-table td:first-child {
  text-align: left;
  white-space: nowrap;
}

.food-grid-table td:last-child {
  font-weight: 600;
  color: #b45309;
}

.food-toggle-all {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
  margin-top: 2px;
  cursor: pointer;
}

.food-toggle-all input {
  margin-right: 3px;
}

.food-totals-row {
  background: #fef3c7;
  font-weight: 600;
}

.food-totals-row td {
  border-top: 2px solid #f59e0b;
  color: #92400e;
}

.food-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* ── Mobile Header ── */
.mobile-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 6px;
}

.mobile-header-title {
  font-weight: 700;
  font-size: 17px;
  color: #1e3a5f;
}

.mobile-header-bar button {
  padding: 6px 12px;
  font-size: 12px;
}

#mobile-vacation-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #2563eb;
  font-size: 14px;
  font-weight: 600;
  color: #1e3a5f;
  background: #eff6ff;
  margin-bottom: 8px;
  appearance: auto;
}

/* ── Mobile Bottom Navigation ── */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  z-index: 2000;
  padding: 2px 0 env(safe-area-inset-bottom, 4px);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 2px 4px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-icon {
  font-size: 22px;
  line-height: 1;
}

.mobile-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mobile-nav-btn.active {
  color: #2563eb;
  background: none;
}

.mobile-nav-btn.active .mobile-nav-label {
  color: #2563eb;
}

#mobile-bookings-switcher {
  display: none;
  gap: 6px;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 30;
  background: #f8fafc;
  padding: 6px 0;
  margin-bottom: 8px;
}

.mobile-booking-type-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-booking-type-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.mobile-open-confirmation-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.mobile-file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 13px;
}

.mobile-inline-file-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: underline;
}

/* ── Mobile workspace card tweaks ── */
@media (max-width: 768px) {
  #vacation-workspace { gap: 8px; }
  .card { padding: 10px; margin-bottom: 8px; }
  .card h3 { font-size: 16px; margin-top: 0; }
  .kpis strong { font-size: 15px; }
  .kpis div { padding: 8px; }
  .planner-overview { padding: 12px; }
  .planner-overview-title { font-size: 17px; }
}

/* ── Mobile Home Screen ── */
.mobile-home-empty {
  text-align: center;
  padding: 60px 20px;
}

.mobile-home-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.mobile-home-empty h3 {
  margin: 0 0 6px;
  color: #1e3a5f;
}

.mobile-home-card {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  margin: 8px 0;
}

.mobile-home-hero {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  padding: 20px 16px 16px;
  text-align: center;
}

.mobile-home-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}

.mobile-home-location {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 10px;
}

.mobile-home-status {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 99px;
  background: rgba(255,255,255,0.2);
}

.mobile-home-status.status-today {
  background: #fbbf24;
  color: #78350f;
}

.mobile-home-status.status-ongoing {
  background: #34d399;
  color: #064e3b;
}

.mobile-home-status.status-upcoming {
  background: rgba(255,255,255,0.22);
}

.mobile-home-details {
  padding: 14px 16px;
  display: grid;
  gap: 12px;
}

.mobile-home-detail {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-home-detail-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.mobile-home-detail-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
}

.mobile-home-detail strong {
  font-size: 15px;
}

.mobile-home-select-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.mobile-home-select-btn:hover {
  background: #1d4ed8;
}

/* ── PDF export: offline phone-readable travel reference ── */
#pdf-export-root {
  display: none;
}

.pdf-doc { font-family: Arial, Helvetica, sans-serif; color: #111827; font-size: 16px; line-height: 1.5; }
.pdf-doc .pdf-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2563eb;
  margin: 0 0 4px;
}
.pdf-doc h1 { font-size: 26px; margin: 0 0 6px; }
.pdf-doc h2 {
  font-size: 19px;
  margin: 26px 0 10px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #fff;
}
.pdf-doc h3 { font-size: 15px; margin: 14px 0 6px; font-weight: 700; color: #1e293b; }
.pdf-doc p { margin: 2px 0; }
.pdf-doc .pdf-meta { color: #4b5563; font-size: 13px; margin-bottom: 4px; }

/* Section accent colors, reusing the app's existing palette */
.pdf-doc .pdf-sec-reference { background: linear-gradient(90deg, #0ea5e9, #3b82f6); }
.pdf-doc .pdf-sec-flight    { background: linear-gradient(90deg, #38bdf8, #0ea5e9); }
.pdf-doc .pdf-sec-hotel     { background: linear-gradient(90deg, #a78bfa, #8b5cf6); }
.pdf-doc .pdf-sec-transport { background: linear-gradient(90deg, #34d399, #16a34a); }
.pdf-doc .pdf-sec-activity  { background: linear-gradient(90deg, #fb923c, #f97316); }
.pdf-doc .pdf-sec-record    { background: linear-gradient(90deg, #64748b, #334155); }

.pdf-doc .pdf-record-divider {
  margin: 34px 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, #475569, #1e293b);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pdf-doc .pdf-record-divider small { display: block; font-weight: 400; opacity: 0.8; font-size: 12px; margin-top: 2px; }

/* Booking cards — replace dense multi-column tables with stacked, scannable detail */
.pdf-doc .pdf-booking-card {
  border: 1px solid #e2e8f0;
  border-left: 5px solid #94a3b8;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
  break-inside: avoid;
}
.pdf-doc .pdf-booking-card.type-flight    { border-left-color: #0ea5e9; background: linear-gradient(180deg, #f0f9ff, #fff 40%); }
.pdf-doc .pdf-booking-card.type-hotel     { border-left-color: #8b5cf6; background: linear-gradient(180deg, #f5f3ff, #fff 40%); }
.pdf-doc .pdf-booking-card.type-transport { border-left-color: #16a34a; background: linear-gradient(180deg, #ecfdf5, #fff 40%); }
.pdf-doc .pdf-booking-card.type-activity  { border-left-color: #f97316; background: linear-gradient(180deg, #fff7ed, #fff 40%); }

.pdf-doc .pdf-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pdf-doc .pdf-card-title { font-size: 17px; font-weight: 700; }
.pdf-doc .pdf-card-amount { font-size: 14px; font-weight: 700; color: #1e293b; white-space: nowrap; }

.pdf-doc .pdf-status-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.pdf-doc .pdf-status-paid { background: #dcfce7; color: #166534; }
.pdf-doc .pdf-status-booked { background: #dbeafe; color: #1e40af; }
.pdf-doc .pdf-status-planned { background: #fef3c7; color: #92400e; }

.pdf-doc .pdf-field-row { display: flex; gap: 8px; font-size: 15px; padding: 3px 0; }
.pdf-doc .pdf-field-label { flex: 0 0 118px; color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; padding-top: 2px; }
.pdf-doc .pdf-field-value { flex: 1; word-break: break-word; }

.pdf-doc .pdf-confirmation {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 16px;
  background: #fff;
  border: 1px dashed #64748b;
  border-radius: 6px;
  padding: 1px 8px;
  display: inline-block;
}

.pdf-doc .pdf-attachment-img { margin-top: 8px; }
.pdf-doc .pdf-attachment-img img { max-width: 100%; border-radius: 8px; border: 1px solid #e2e8f0; display: block; }
.pdf-doc .pdf-attachment-caption { font-size: 11px; color: #64748b; margin-top: 3px; }
.pdf-doc .pdf-attachment-note { margin-top: 8px; font-size: 13px; color: #64748b; font-style: italic; }

/* KPI cards — mirror the live app's .colorful-kpis treatment */
.pdf-doc .pdf-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.pdf-doc .pdf-kpi { flex: 1 1 45%; min-width: 130px; border-radius: 10px; padding: 10px 12px; font-size: 12px; }
.pdf-doc .pdf-kpi span { display: block; color: #64748b; text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em; }
.pdf-doc .pdf-kpi strong { font-size: 20px; }
.pdf-doc .pdf-kpis .pdf-kpi:nth-child(4n+1) { background: #eff6ff; }
.pdf-doc .pdf-kpis .pdf-kpi:nth-child(4n+2) { background: #f5f3ff; }
.pdf-doc .pdf-kpis .pdf-kpi:nth-child(4n+3) { background: #fff7ed; }
.pdf-doc .pdf-kpis .pdf-kpi:nth-child(4n+4) { background: #ecfdf5; }

/* Tables that stay genuinely tabular (Quick Reference, Expenses, Cash, Attractions, Financial Planning, Report) */
.pdf-doc table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 13.5px; }
.pdf-doc th, .pdf-doc td {
  border: 1px solid #e2e8f0;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}
.pdf-doc th { background: #f1f5f9; font-size: 11px; text-transform: uppercase; letter-spacing: 0.02em; color: #475569; }
.pdf-doc tbody tr:nth-child(even) { background: #f8fafc; }

/* Daily itinerary */
.pdf-doc .pdf-day { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; break-inside: avoid; }
.pdf-doc .pdf-day-title { font-weight: 700; font-size: 15px; margin-bottom: 5px; padding-bottom: 5px; border-bottom: 1px solid #e2e8f0; }
.pdf-doc .pdf-day-event { font-size: 14px; margin: 4px 0; }
.pdf-doc .pdf-day-note { margin: 6px 0 0; padding: 6px 8px; background: #f8fafc; border-radius: 6px; break-inside: avoid; }
.pdf-doc .pdf-day-note-header { font-size: 12px; color: #475569; margin-bottom: 2px; }
.pdf-doc .pdf-day-note-body { font-size: 13.5px; color: #1e293b; }
.pdf-doc .pdf-day-note-body .note-text-content { white-space: pre-wrap; }

.pdf-doc .pdf-empty { color: #6b7280; font-size: 13px; font-style: italic; }

@media print {
  @page {
    size: 92mm 190mm;
    margin: 10mm 8mm;
  }
  body * {
    visibility: hidden;
  }
  #pdf-export-root, #pdf-export-root * {
    visibility: visible;
  }
  #pdf-export-root {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }
}
