/* HMS-61 — block request review (admin) and the hotel's request list. */

.admin-block-requests__title,
.hotel-block-requests__title {
  margin: 0 0 1rem;
  font-size: 1.375rem;
  color: var(--wa-color-text-normal);
}

.admin-block-requests__section-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  color: var(--wa-color-text-normal);
}

/* HMS-1746 — one compact card per pending request: hotel icon + heading,
   the requested changes on one horizontal line, then notes on the left and
   reason / Approve / Deny on the right. */
.block-request-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--wa-color-surface-default);
  border: 1px solid var(--wa-color-neutral-border-normal);
  border-radius: var(--wa-border-radius-m);
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
}

.block-request-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.block-request-card__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--wa-border-radius-m);
  background: var(--wa-color-neutral-fill-quiet);
  color: var(--wa-color-text-normal);
}

.block-request-card__heading {
  min-width: 0;
}

.block-request-card__hotel {
  margin: 0;
  font-size: 1rem;
  color: var(--wa-color-text-normal);
}

.block-request-card__meta {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--wa-color-text-quiet);
}

.block-request-card__changes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wa-color-text-normal);
}

.block-request-card__change {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  padding: 0 1rem;
  border-left: 1px solid var(--wa-color-neutral-border-normal);
}

.block-request-card__change:first-child {
  padding-left: 0;
  border-left: 0;
}

.block-request-card__change i {
  color: var(--wa-color-text-quiet);
}

.block-request-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.block-request-card__note {
  display: flex;
  flex: 1 1 18rem;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--wa-border-radius-m);
  background: var(--wa-color-neutral-fill-quiet);
  font-size: 0.875rem;
}

.block-request-card__note-label {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--wa-color-text-normal);
}

.block-request-card__note-text {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--wa-color-text-normal);
}

/* Reason, Approve, Deny on one row: the deny form's children join the
   flex row so Approve can sit between the reason field and Deny. */
.block-request-card__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.block-request-card__approve-form,
.block-request-card__deny-form {
  display: contents;
}

.block-request-card__deny-reason {
  order: 1;
  width: 12rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--wa-color-neutral-border-normal);
  border-radius: var(--wa-border-radius-m);
  font: inherit;
}

.block-request-card__approve {
  order: 2;
  padding: 0.5rem 1rem;
  border: 1px solid var(--wa-color-brand-fill-loud);
  border-radius: var(--wa-border-radius-m);
  background: var(--wa-color-brand-fill-loud);
  color: var(--wa-color-brand-on-loud);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.block-request-card__deny {
  order: 3;
  padding: 0.5rem 1rem;
  border: 1px solid var(--wa-color-danger-border-normal);
  border-radius: var(--wa-border-radius-m);
  background: var(--wa-color-danger-fill-quiet);
  color: var(--wa-color-danger-on-quiet);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 640px) {
  .block-request-card__changes {
    flex-direction: column;
  }

  .block-request-card__change {
    padding-left: 0;
    border-left: 0;
  }

  .block-request-card__actions {
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
  }

  .block-request-card__deny-reason {
    flex: 1 1 100%;
    width: auto;
    min-width: 0;
  }

  .block-request-card__approve,
  .block-request-card__deny {
    flex: 1 1 0;
  }
}

.admin-block-requests__empty,
.hotel-block-requests__empty {
  color: var(--wa-color-text-quiet);
}

.admin-block-requests__table,
.hotel-block-requests__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-block-requests__table th,
.admin-block-requests__table td,
.hotel-block-requests__table th,
.hotel-block-requests__table td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--wa-color-neutral-border-quiet);
}

/* HMS-1746 — History stacks into labelled rows on narrow screens so the
   page never scrolls sideways. */
@media (max-width: 640px) {
  .block-requests-history thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .block-requests-history,
  .block-requests-history tbody,
  .block-requests-history tr,
  .block-requests-history td {
    display: block;
    width: 100%;
  }

  .block-requests-history tr {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--wa-color-neutral-border-quiet);
  }

  .block-requests-history td {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .block-requests-history td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--wa-color-text-quiet);
  }
}
