html {
  overflow-x: hidden;
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: url('assets/homepage_back.jpg') center center / cover no-repeat fixed;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
  min-height: 100vh;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.container {
  max-width: 900px;
  margin: 30px auto;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 25px;
  margin-bottom: 25px;
}

h1 {
  font-size: 28px;
  color: #00796b;
  margin-bottom: 20px;
  text-align: center;
}

input, select, textarea {
  width: 100%;
  padding: 7px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 15px;
  box-sizing: border-box;
  min-height: 40px;
}

button {
  background: #00796b;
  color: white;
  border: none;
  padding: 14px 22px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

button:hover {
  background: #004d40;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 15px 10px;
    width: calc(100% - 20px);
  }
  h1 {
    font-size: 24px;
  }
  input, select, textarea {
    font-size: 16px;
  }
  .card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
    margin: 10px 5px;
    width: calc(100% - 10px);
  }
  h1 {
    font-size: 20px;
  }
  input, select, textarea {
    font-size: 16px !important;
    padding: 10px;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  #cancel_policy {
    font-size: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .card {
    padding: 15px;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Custom adjustments */
header .nav { display: none; }

/* Mode indicator and Home button */
.home-button:hover {
  background-color: #45a049 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

/* Header Layout */
.header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 15px auto;
  padding: 0 20px;
  gap: 15px;
}

/* Username container (left) */
.username-container {
  flex: 0 0 auto;
}

.username-badge {
  color: #000;
  font-weight: 500;
  padding: 8px 12px;
  background: transparent;
  border-radius: 6px;
  border: 2px solid #000;
  display: inline-block;
}

/* Logo container (center) */
.logo-container {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-logo {
  max-height: 80px;
  width: auto;
}

/* Right controls (languages + logout) */
.right-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  gap: 8px;
}

.logout-link {
  text-decoration: none;
  color: #ff6b6b;
  font-weight: 500;
  padding: 8px 16px;
  background: white;
  border-radius: 6px;
  border: 2px solid #ff6b6b;
  display: inline-block;
  white-space: nowrap;
}

.logout-link:hover {
  background: #ff6b6b;
  color: white;
}

/* Mobile responsive for mode-home container */
@media (max-width: 480px) {
  .mode-home-container {
    padding: 0 10px !important;
    gap: 10px !important;
  }
  
  .mode-home-container > div {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
  
  .mode-home-container .home-button {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
  
  .mode-home-container .home-button span:first-child {
    font-size: 16px !important;
  }
  
  /* Mobile header layout: Username (left) - Logo (center) - Logout (right) */
  .header-wrapper {
    padding: 0 10px;
    gap: 8px;
  }
  
  .username-badge {
    font-size: 13px;
    padding: 6px 10px;
  }
  
  .main-logo {
    max-height: 60px;
  }
  
  /* Hide language switch on mobile */
  .lang-switch {
    display: none;
  }
  
  .logout-link {
    font-size: 13px;
    padding: 6px 10px;
  }
}

.logo img {
  display: block;
  margin: 0 auto;
  max-height: 70px;
}

.lang-flag {
  font-size: 22px;
  text-decoration: none;
  transition: transform 0.2s;
}

.lang-flag:hover {
  transform: scale(1.2);
}

/* Grid layout for form fields - pairs */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (min-width: 481px) and (max-width: 768px) {
  .grid {
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .grid {
    gap: 6px;
    max-width: 100% !important;
  }
  
  .grid > .field {
    margin-bottom: 8px;
    min-width: 0 !important;
    flex-shrink: 1 !important;
  }
  
  /* Combined fields stay side-by-side on mobile */
  .field > .field {
    flex: 0 0 calc(50% - 6px) !important;
    margin: 0 !important;
  }
  
  .grid > .field label {
    margin-bottom: 5px !important;
    font-size: 14px !important;
  }
  
  /* Reduce padding for side-by-side fields to prevent overflow */
  .grid > .field input,
  .grid > .field select {
    padding: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 14px !important;
    min-height: 38px !important;
    box-sizing: border-box !important;
  }
  
  /* Force flatpickr inputs to respect container width - iOS Safari fix */
  .grid > .field input.flatpickr-input {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* iOS-specific fix for Arrival/Departure fields */
  .arrival-date-field input,
  .departure-nights-wrapper input,
  .arrival-date-field input.flatpickr-input,
  .departure-nights-wrapper input.flatpickr-input,
  .paid-up-to-field input,
  .paid-up-to-field input.flatpickr-input,
  .arrival-time-field input,
  .arrival-time-field input.flatpickr-input,
  #arrival_date,
  #departure_date,
  #paid_up_to,
  #arrival_time {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    -webkit-border-radius: 8px !important;
    -moz-border-radius: 8px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-clip: padding-box !important;
  }
  
  .arrival-date-field,
  .departure-nights-wrapper,
  .departure-field,
  .paid-up-to-field,
  .arrival-time-field {
    overflow: visible !important;
  }
}

.grid > .field {
  flex: 0 0 calc(50% - 10px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Combined fields (Adults+Children, Children's Ages+Baby Cot) */
.field > .field {
  flex: 0 0 calc(50% - 6px) !important;
  margin: 0 !important;
}

.field label {
  font-weight: bold;
  margin-bottom: 5px;
  line-height: 1.2;
  display: block;
}

/* Room labels alignment fix - ensure Booking Type and Room Type labels start at same height */
.room-labels-row {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.room-labels-row label {
  font-weight: bold;
  margin: 0 0 5px 0 !important;
}

/* Ensure Booking Type field and Room container start at same vertical position */
.field:has(#booking_type),
.room-fields-container {
  align-items: flex-start !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Force both containers to have identical top positioning */
.field:has(#booking_type) label,
.room-labels-row label {
  margin: 0 0 5px 0 !important;
  padding: 0 !important;
  font-weight: bold !important;
  line-height: 1.2 !important;
  display: block !important;
}

/* Safari-specific fix for label alignment */
.field:has(#booking_type),
.room-fields-container {
  -webkit-box-align: start !important;
  display: -webkit-flex !important;
  display: flex !important;
}

.room-labels-row {
  display: -webkit-flex !important;
  display: flex !important;
  -webkit-box-align: start !important;
  align-items: flex-start !important;
}

/* Additional Safari fix - normalize vertical positioning */
.field:has(#booking_type) {
  vertical-align: top !important;
}

.room-fields-container {
  vertical-align: top !important;
}

/* Ensure both field containers have same box sizing for Safari */
.field:has(#booking_type),
.room-fields-container {
  -webkit-box-sizing: border-box !important;
  -moz-box-sizing: border-box !important;
  box-sizing: border-box !important;
}

@media (min-width: 481px) and (max-width: 768px) {
  .grid > .field {
    flex: 0 0 100%;
  }
  
  /* Keep combined fields side-by-side on tablet */
  .field > .field {
    flex: 0 0 calc(50% - 6px) !important;
  }
  
  /* Departure/Nights container becomes full width on tablet */
  .departure-nights-wrapper {
    flex: 0 0 100% !important;
  }
  
  /* Inside: Departure gets more space, Nights stays small */
  .departure-field {
    flex: 0 0 70% !important;
  }
  
  .nights-field {
    flex: 0 0 calc(30% - 10px) !important;
  }
  
  /* Vehicle Plate and Arrival Time side-by-side on tablet */
  .vehicle-plate-field,
  .arrival-time-field {
    flex: 0 0 calc(50% - 7.5px);
  }
}

/* Desktop: Departure/Nights wrapper takes half width */
.departure-nights-wrapper {
  flex: 0 0 calc(50% - 6px);
}

/* Hide standalone Nights field on desktop (shown only on mobile) */
.nights-standalone {
  display: none;
}

@media (max-width: 480px) {
  /* Buttons layout for mobile */
  .actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 3px !important;
    overflow-x: auto !important;
  }
  
  /* Row 1: Pre-Booking and Confirmation side-by-side (50%-50%) */
  .btn-new.mode-btn {
    flex: 1 1 calc(50% - 4px) !important;
    margin: 0 !important;
    order: 1 !important;
  }
  
  .btn-confirmation.mode-btn {
    flex: 1 1 calc(50% - 4px) !important;
    margin: 0 !important;
    order: 2 !important;
  }
  
  /* Hide Registration on mobile */
  .btn-registration.mode-btn {
    display: none !important;
  }
  
  /* Action buttons in one line - 5 buttons for pre-booking (search, print, clear, save, mail) */
  .actions button,
  .actions .search-btn {
    min-width: 48px !important;
    max-width: 65px !important;
    padding: 6px 2px !important;
    font-size: 14px !important;
    flex: 1 1 auto !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  .actions button span:first-child,
  .actions .search-btn span:first-child {
    font-size: 16px !important;
  }
  
  .actions button span:last-child,
  .actions .search-btn span:last-child {
    font-size: 7px !important;
    white-space: nowrap !important;
  }
  
  .search-btn {
    order: 1 !important;
  }
  
  .print-btn {
    order: 2 !important;
  }
  
  .clear-btn.action-btn {
    order: 3 !important;
  }
  
  .save-btn.action-btn {
    order: 4 !important;
  }
  
  .btn-send-mail.action-btn,
  .send-mail-btn.action-btn {
    order: 5 !important;
  }
  
  /* Row 3: Reports, Admin (if admin), Logout */
  .actions a[href*="report.php"] {
    flex: 0 0 calc(33.333% - 6px) !important;
    margin: 0 !important;
    order: 6 !important;
  }
  
  .actions a[href*="admin.php"] {
    flex: 0 0 calc(33.333% - 6px) !important;
    margin: 0 !important;
    order: 7 !important;
    margin-left: 0 !important;
  }
  
  .actions a[href*="logout.php"] {
    flex: 0 0 calc(33.333% - 6px) !important;
    margin: 0 !important;
    order: 8 !important;
    margin-left: 0 !important;
  }
  
  /* Arrival Date and Departure Date side-by-side (50%-50%) */
  /* iOS Safari fix: use percentage instead of calc() */
  .arrival-date-field {
    flex: 0 0 48% !important;
    max-width: 48% !important;
    width: 48% !important;
    margin-bottom: 8px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  
  .departure-nights-wrapper {
    flex: 0 0 48% !important;
    max-width: 48% !important;
    width: 48% !important;
    margin-bottom: 8px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Simplify departure wrapper structure on mobile */
  .departure-nights-wrapper {
    gap: 0 !important;
    flex-direction: column !important;
    padding: 0 !important;
  }
  
  .departure-nights-wrapper .departure-field {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  
  .departure-nights-wrapper .departure-field input {
    border-radius: 8px !important;
    -webkit-border-radius: 8px !important;
  }
  
  /* Hide Nights from Departure wrapper on mobile */
  .departure-nights-wrapper .nights-field {
    display: none !important;
  }
  
  /* Show standalone Nights field and place it side-by-side with Rate per Night (50%-50%) */
  .nights-standalone {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  .rate-per-night-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  /* Stack combined action buttons on mobile */
  .combined-action-buttons-wrapper {
    flex-direction: column !important;
  }
  
  .combined-action-buttons-wrapper button {
    width: 100% !important;
  }
  
  /* Phone and ID/Passport side-by-side (50%-50%) */
  .phone-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  .id-number-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  /* Reservation No and UID Cloud side-by-side (50%-50%) */
  .reservation-number-field,
  .cloudhotel-uid-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  .room-number-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  /* Adults and Children side-by-side (50%-50%) */
  .adults-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  .children-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  /* Children's Ages and Baby Cot side-by-side (50%-50%) */
  .children-ages-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  .baby-cot-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  /* Deposit and To be Paid up to side-by-side (50%-50%) */
  .deposit-amount-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  .paid-up-to-field {
    flex: 0 0 48% !important;
    max-width: 48% !important;
    width: 48% !important;
    margin-bottom: 8px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Vehicle Plate and Arrival Time side-by-side (50%-50%) */
  .vehicle-plate-field {
    flex: 0 0 48% !important;
    max-width: 48% !important;
    width: 48% !important;
    margin-bottom: 8px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  
  .arrival-time-field {
    flex: 0 0 48% !important;
    max-width: 48% !important;
    width: 48% !important;
    margin-bottom: 8px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Balance and Deposit Method side-by-side (50%-50%) */
  .balance-amount-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  .field[style*="order: 22"] {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
  
  .payed-on-field {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    margin-bottom: 8px !important;
  }
}

/* Special adjustments */
.reservation-status-field {
  flex-basis: calc(50% - 10px);
}

/* Reservation Number and UID Cloud side-by-side on desktop */
.reservation-number-field,
.cloudhotel-uid-field {
  flex: 0 0 calc(50% - 6px) !important;
  max-width: calc(50% - 6px) !important;
}

@media (min-width: 481px) and (max-width: 768px) {
  .reservation-status-field {
    flex-basis: 100%;
  }
  
  /* Reservation Number and UID Cloud side-by-side on tablet */
  .reservation-number-field,
  .cloudhotel-uid-field {
    flex: 0 0 calc(50% - 7.5px) !important;
    max-width: calc(50% - 7.5px) !important;
  }
}

.field:has(#cancel_policy),
.field:has(#notes) {
  flex-basis: 100%;
}

/* Hide unused fields */
.field:has(#currency),
.field:has(#departure_time) {
  display: none !important;
}

/* Field ordering rules - FINAL & ONLY */
.field:has(#booking_channel) { order: 1; }
.field:has(#reservation_status) { order: 2; }
.field:has(#guest_name) { order: 3; }
.field:has(#phone) { order: 4; }
.field:has(#id_number) { order: 5; }
.field:has(#email) { order: 6; }
.field:has(#booking_type) { order: 7; }
.field:has(#reservation_number) { order: 8; }
#room-fields-container { order: 9; }
.field:has(#room_number) { order: 10; }
.field:has(#adults) { order: 11; }
.field:has(#children) { order: 12; }
.field:has(#children_ages) { order: 13; }
.field:has(#baby_cot) { order: 14; }
.field:has(#arrival_date) { order: 15; }
.field:has(#departure_date) { order: 16; }
.field:has(#rate_per_night) { order: 17; }
.field:has(#total_amount) { order: 18; }
.field:has(#deposit_amount) { order: 19; }
.field:has(#paid_up_to) { order: 20; }
.field:has(#balance_amount) { order: 21; }
.field:has(#deposit_method) { order: 22; }
.field:has(#nights_calc) { order: 23; }
.field:has(#vehicle_plate) { order: 24; }
.field:has(#arrival_time) { order: 25; }
.field:has(#cancel_policy) { order: 26; }
.field:has(#notes) { order: 27; }

/* Set specific widths for Cancel Policy and Notes */
#cancel_policy {
  width: 97% !important;
}

#notes {
  width: 100% !important;
}

.actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-secondary, .btn-primary, .btn-new, .btn-confirmation, .btn-send-mail {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

@media (max-width: 480px) {
  .btn-secondary, .btn-primary, .btn-new, .btn-confirmation, .btn-send-mail {
    padding: 10px 20px;
    font-size: 14px;
  }
}

.btn-secondary {
  background: #ccc;
  color: #333;
}

.btn-primary {
  background: #00796b;
  color: white;
}

.btn-new {
  background: #2196F3;
  color: white;
}

.btn-confirmation {
  background: #FF9800;
  color: white;
}

.btn-send-mail {
  background: #9C27B0;
  color: white;
}

.btn-secondary:hover {
  background: #bbb;
}

/* Search Panel Styles */
#searchPanel {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

#searchPanel h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
}

#searchPanel .search-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

#searchPanel input[type="text"] {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

@media (max-width: 768px) {
  #searchPanel {
    padding: 12px;
  }
  
  #searchPanel input[type="text"] {
    font-size: 15px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  #searchPanel {
    padding: 10px;
  }
  
  #searchPanel h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  #searchPanel .search-container {
    flex-direction: column;
    gap: 8px;
  }
  
  #searchPanel input[type="text"] {
    width: 100%;
    font-size: 15px;
    padding: 12px;
  }
  
  #searchPanel button {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
  }
}

.btn-primary:hover {
  background: #004d40;
}

.btn-new:hover {
  background: #1976D2;
}

.btn-confirmation:hover {
  background: #F57C00;
}

.btn-send-mail:hover {
  background: #7B1FA2;
}

.btn-save-and-send:hover {
  background: linear-gradient(135deg, #004d40 0%, #00251a 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2) !important;
}

/* New styles for dynamic room fields */
.room-fields-container {
  flex-basis: calc(50% - 10px);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 40px;
}

@media (max-width: 768px) {
  .room-fields-container {
    flex-basis: 100%;
    margin-bottom: 25px;
  }
}

@media (max-width: 480px) {
  .room-fields-container {
    margin-bottom: 12px;
  }
}

.room-field-group {
  display: flex;
  gap: 5px;
  align-items: center;
  margin: 0;
  margin-bottom: 5px;
  flex-wrap: nowrap;
}

@media (max-width: 480px) {
  .room-field-group {
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
}

.room-field-group .field {
  flex: 1;
  margin: 0;
}

.room-field-group .field-rate {
  flex: 0 0 calc(50% - 50px);
}

@media (max-width: 480px) {
  .room-field-group .field,
  .room-field-group .field-rate {
    flex: 1 1 calc(50% - 25px);
  }
}

.room-field-group .field select,
.room-field-group .field input {
  margin-bottom: 0;
  height: 100%;
}

.add-room-btn {
  background: #00796b;
  color: white;
  border: none;
  padding: 7px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  width: 40px;
  text-align: center;
  height: 40px;
  min-height: 40px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .add-room-btn {
    height: 40px;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .add-room-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 7px;
    font-size: 16px;
  }
}

.add-room-btn:hover {
  background: #004d40;
}

.remove-room-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 7px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  width: 40px;
  text-align: center;
  height: 40px;
  min-height: 40px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .remove-room-btn {
    height: 40px;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .remove-room-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 7px;
    font-size: 16px;
  }
}

.remove-room-btn:hover {
  background: #d32f2f;
}

/* Error field style */
.error-field input,
.error-field select {
  border-color: #c62828 !important;
}

.success {
  background: #e8f5e9;
  border: 1px solid #4caf50;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  color: #2e7d32;
}


/* Print styles - Modern professional template */
@media print {
  @page {
    size: A4;
    margin: 14mm;
  }
  
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  body {
    background: white !important;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.35;
    color: #111827;
  }
  
  .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
  }
  
  .card {
    box-shadow: none;
    border: none;
    padding: 0;
  }
  
  /* Hide interactive elements */
  .actions,
  #searchPanel,
  #editingBanner,
  .lang-switch,
  .add-room-btn,
  .remove-room-btn,
  .success {
    display: none !important;
  }
  
  /* Print header - 2 column grid */
  .header-wrapper {
    display: grid !important;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    transform: none;
    height: auto;
  }
  
  .header-wrapper::after {
    content: "Τμήμα Κρατήσεων\A Σταθερό: +30 27230 28600\A Κινητό: +30 6936 508 136\A Email: reservations@paradiseresort.gr";
    white-space: pre;
    display: block;
    grid-column: 2;
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
    font-weight: normal;
    color: #111827;
  }
  
  .logo-container {
    display: block !important;
    height: auto;
  }
  
  h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.2px;
    color: #111827 !important;
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
  }
  
  h1::after {
    content: "Γλώσσα: Ελληνικά";
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: #6b7280;
    margin-top: 0.125rem;
  }
  
  .logo img, .main-logo {
    max-height: 40px;
  }
  
  /* Labels - muted color */
  label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 0.15rem;
    font-weight: normal;
  }
  
  label::after {
    content: "";
  }
  
  /* Inputs with rounded borders and light background */
  input, select, textarea {
    width: 100% !important;
    font-size: 13px !important;
    padding: 0.45rem 0.5rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    background: #fafafa !important;
    color: #111827 !important;
    font-weight: normal;
    display: block !important;
    min-height: auto !important;
  }
  
  textarea {
    min-height: 64px !important;
    resize: vertical;
  }
  
  /* Main grid - all fields in boxes */
  .grid {
    display: block !important;
    margin-bottom: 1rem;
  }
  
  /* All field containers get box styling */
  .field {
    display: block;
    margin-bottom: 0.75rem;
    page-break-inside: avoid;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    background: white;
  }
  
  /* Room fields container */
  .room-fields-container {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: white;
  }
  
  .room-field-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    border: none !important;
    background: none !important;
    padding: 0 !important;
  }
  
  .room-field-group select,
  .room-field-group input {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }
  
  /* Cancellation Policy - with left accent */
  .field:has(#cancel_policy) {
    border-left: 3px solid #9ca3af !important;
  }
  
  #cancel_policy {
    background: white !important;
    border: none !important;
    padding: 0.25rem 0 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
  }
  
  /* Signature area - two columns with lines */
  form::after {
    content: "____________________________                                                              ____________________________\A\A(Υπογραφή πελάτη κατά την άφιξη)                                                      (Υπογραφή υπαλλήλου)";
    white-space: pre;
    display: block;
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
  }
  
  .room-field-group:last-child {
    margin-bottom: 0;
  }
}

/* Multiple Results Selection Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.modal-content h3 {
  color: #00796b;
  margin-top: 0;
  margin-bottom: 10px;
}

.modal-content p {
  color: #666;
  margin-bottom: 20px;
}

.reservation-item {
  padding: 15px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.reservation-item:hover {
  background-color: #f5f5f5;
  border-color: #00796b;
}

.btn-secondary {
  background: #9e9e9e;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.btn-secondary:hover {
  background: #757575;
}

/* iOS Mobile Scroll Fix - Prevent rubber-band bounce */
/* EXCEPTION: Plan Board page needs normal scrolling */
@media (max-width: 768px) {
  body {
    background-attachment: scroll !important; /* Remove fixed on mobile */
  }
  
  html:not(.plan-board-page), 
  body:not(.plan-board-page) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
  }
  
  .container {
    height: 100%;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  
  /* Header +10% height increase */
  .header-wrapper {
    padding-top: 18px !important;
    padding-bottom: 18px !important;
  }
  
  .main-logo {
    max-height: 66px !important; /* +10% from 60px */
  }
}
