.bookings-page {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

.bookings-page__sidebar {
  grid-column: 1;
}

.bookings-page__content {
  grid-column: 2;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
  position: relative;
}

.page-header {
  margin-bottom: 24px;
}

.page-header__title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
}

.page-header__subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

.bookings-filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: visible;
  position: relative;
}

.bookings-filters:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border-color: color-mix(in srgb, var(--border) 80%, var(--accent));
}

.bookings-filters__top {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.bookings-filters__search {
  flex: 1;
  min-width: 0;
}

.bookings-filters__search-input {
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bookings-filters__search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 59, 130, 246), 0.1);
}

.bookings-filters__controls {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
}

.bookings-filters__controls > * {
  min-width: 0;
}

.bookings-filters__controls .select-menu {
  flex: 0 1 auto;
  min-width: 140px;
  max-width: 100%;
  display: flex;
}

.bookings-filters__controls .select-menu__select {
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bookings-filters__controls .select-menu__select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 59, 130, 246), 0.1);
}

.bookings-filters__controls .input,
.bookings-filters__controls .input-sm,
.bookings-filters__controls input[type="text"],
.bookings-filters__controls input[type="date"],
.bookings-filters__controls .datepicker-wrapper {
  min-width: 140px;
  flex: 0 1 auto;
  max-width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bookings-filters__controls .input:focus,
.bookings-filters__controls .input-sm:focus,
.bookings-filters__controls input[type="text"]:focus,
.bookings-filters__controls input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 59, 130, 246), 0.1);
}

.bookings-filters__select {
  min-width: 140px;
  flex: 0 1 auto;
  max-width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bookings-filters__select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 59, 130, 246), 0.1);
  outline: none;
}

.bookings-filters__select--compact {
  min-width: 140px;
}

.bookings-filters__search-btn,
.bookings-filters__controls .btn {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: stretch;
}

.bookings-filters__count {
  font-size: 13px;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.bookings-filters__count span {
  color: var(--text);
  font-weight: 600;
}

.bookings-filters__selects-group {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.bookings-filters__selects-group .select-menu,
.bookings-filters__selects-group .bookings-filters__select {
  flex: 1 1 auto;
  min-width: 140px;
  max-width: none;
}

.bookings-filters__date-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.bookings-filters__date-group .datepicker-wrapper,
.bookings-filters__date-group input[type="text"],
.bookings-filters__date-group input[type="date"] {
  flex: 1 1 auto;
  min-width: 140px;
}

@media (max-width: 768px) {
  .bookings-filters__selects-group {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .bookings-filters__selects-group .select-menu,
  .bookings-filters__selects-group .bookings-filters__select {
    width: 100%;
    min-width: auto;
    max-width: 100%;
  }

  .bookings-filters__date-group {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .bookings-filters__date-group .datepicker-wrapper,
  .bookings-filters__date-group input[type="text"],
  .bookings-filters__date-group input[type="date"] {
    width: 100%;
    min-width: auto;
  }
}

.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bookings-list--compact {
  gap: 12px;
}

.bookings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

@media (min-width: 1200px) {
  .bookings-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .bookings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bookings-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.bookings-section-title:first-child {
  margin-top: 0;
}

.booking-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.booking-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--shadow-hover);
}

.booking-card--compact,
.booking-card--list,
.booking-card--grid {
  cursor: pointer;
}

.booking-card--compact {
  padding: 16px;
}

.booking-card--compact:hover,
.booking-card--list:hover,
.booking-card--grid:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.booking-card--grid {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-card--list {
  padding: 16px;
}

.booking-card__main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
}

.booking-card__info {
  min-width: 0;
}

.booking-card__header-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.booking-card__title-compact {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.booking-card__renter-compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.booking-card__renter-name-compact {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.booking-card__renter-email-compact {
  font-size: 12px;
  color: var(--muted);
}

.booking-card__renter-grid {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.booking-card__renter-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.booking-card__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.booking-card__avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-size: 18px;
  font-weight: 600;
}

.booking-card__renter-info-grid {
  flex: 1;
  min-width: 0;
}

.booking-card__renter-name-grid {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-card__renter-email-grid {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-card__renter-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
}

.booking-card__rating-stars {
  color: #ffc107;
  font-size: 12px;
  letter-spacing: 1px;
}

.booking-card__rating-value {
  font-weight: 600;
  color: var(--text);
}

.booking-card__reviews-count {
  color: var(--muted);
  font-size: 11px;
}

.booking-card__header-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.booking-card__apartment-info {
  flex: 1;
  min-width: 0;
}

.booking-card__title-grid {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-card__dates-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.booking-card__date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.booking-card__date-label-grid {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.booking-card__date-value-grid {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.booking-card__actions-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.booking-card__renter-section {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 12px;
}

.booking-card__renter-info {
  flex: 1;
  min-width: 0;
}

.booking-card__renter-name-list {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.booking-card__renter-email-list {
  font-size: 12px;
  color: var(--muted);
}

.booking-card__dates-compact {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.booking-card__date-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}

.booking-card__date-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.booking-card__date-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.booking-card__actions-compact {
  display: flex;
  gap: 8px;
  align-items: center;
}

.booking-card__action-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}

.booking-card__action-btn--confirm {
  background: var(--accent);
  color: white;
}

.booking-card__action-btn--confirm:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.booking-card__action-btn--cancel {
  background: var(--error, #dc3545);
  color: white;
}

.booking-card__action-btn--cancel:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.booking-card__action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.booking-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.booking-status--pending {
  background: color-mix(in srgb, #ff9800 20%, transparent);
  color: #ff9800;
  border: 1px solid color-mix(in srgb, #ff9800 40%, transparent);
}

.booking-status--confirmed {
  background: color-mix(in srgb, #4caf50 20%, transparent);
  color: #4caf50;
  border: 1px solid color-mix(in srgb, #4caf50 40%, transparent);
}

.booking-status--cancelled {
  background: color-mix(in srgb, #f44336 20%, transparent);
  color: #f44336;
  border: 1px solid color-mix(in srgb, #f44336 40%, transparent);
}

.booking-status--completed {
  background: color-mix(in srgb, #2196f3 20%, transparent);
  color: #2196f3;
  border: 1px solid color-mix(in srgb, #2196f3 40%, transparent);
}

.booking-status--in-progress {
  background: color-mix(in srgb, #9c27b0 20%, transparent);
  color: #9c27b0;
  border: 1px solid color-mix(in srgb, #9c27b0 40%, transparent);
}

.booking-details-modal {
  max-width: 100%;
}

.booking-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.booking-details__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.booking-details__title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.booking-details__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-details__section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.booking-details__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.booking-details__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  min-width: 120px;
}

.booking-details__value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  flex: 1;
}

.booking-details__value a {
  color: var(--accent);
  text-decoration: none;
}

.booking-details__value a:hover {
  text-decoration: underline;
}

.booking-details__link {
  display: inline-block;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.booking-details__link:hover {
  opacity: 0.9;
}

.booking-details__notes {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin: 0;
}

.booking-details__actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.booking-details__confirm-btn,
.booking-details__cancel-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.booking-details__confirm-btn {
  background: var(--accent);
  color: white;
}

.booking-details__confirm-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.booking-details__cancel-btn {
  background: var(--error, #dc3545);
  color: white;
}

.booking-details__cancel-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.booking-details__confirm-btn:disabled,
.booking-details__cancel-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.bookings-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.bookings-empty__icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.bookings-empty h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.bookings-empty p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 768px) {
  .bookings-page {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .bookings-page__sidebar {
    grid-column: 1;
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
    max-width: 100%;
  }

  .bookings-page__content {
    grid-column: 1;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-header__title {
    font-size: 24px;
  }

  .bookings-filters {
    padding: 16px;
    gap: 12px;
  }

  .bookings-filters__top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 12px;
  }

  .bookings-filters__search {
    width: 100%;
  }

  .bookings-filters__controls {
    flex-direction: column;
    gap: 10px;
  }

  .bookings-filters__select,
  .bookings-filters__controls .select-menu,
  .bookings-filters__controls .input,
  .bookings-filters__controls .input-sm,
  .bookings-filters__controls input[type="text"],
  .bookings-filters__controls input[type="date"],
  .bookings-filters__controls .datepicker-wrapper {
    width: 100%;
    min-width: auto;
  }

  .booking-card__main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .booking-card__dates-compact {
    justify-content: flex-start;
  }

  .booking-card__actions-compact {
    width: 100%;
    justify-content: stretch;
  }

  .booking-card__action-btn {
    flex: 1;
  }

  .booking-details__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .booking-details__value {
    text-align: left;
  }

  .booking-details__actions {
    flex-direction: column;
  }

  .booking-details__confirm-btn,
  .booking-details__cancel-btn {
    width: 100%;
  }

  .bookings-grid {
    grid-template-columns: 1fr;
  }

  .bookings-filters__count {
    font-size: 12px;
    padding-top: 10px;
  }
}
