/* HMS-357 — standalone rooming list (Figma 435:812). */

.hotel-rooming-list__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--wa-space-m, 1rem); margin-bottom: var(--wa-space-m, 1rem);
  flex-wrap: wrap;
}
.hotel-rooming-list__title {
  margin: 0; font-size: var(--wa-font-size-2xl, 1.5rem);
  font-weight: var(--wa-font-weight-bold, 700);
  color: var(--wa-color-text-normal);
}
.hotel-rooming-list__event {
  margin: var(--wa-space-2xs, 4px) 0 0;
  color: var(--wa-color-text-quiet); font-size: var(--wa-font-size-s, 0.9375rem);
}
.hotel-rooming-list__actions {
  display: flex; align-items: center; gap: var(--wa-space-s, 0.75rem);
  flex-wrap: wrap;
}
.hotel-rooming-list__confirm {
  appearance: none; border: 0; cursor: pointer;
  background: var(--wa-color-brand-fill-loud);
  color: var(--wa-color-brand-on-loud);
  padding: var(--wa-space-xs, 0.5rem) var(--wa-space-m, 1rem);
  border-radius: var(--wa-border-radius-m); font: inherit;
}

/* Blue info banner: Last confirmed · N guests · Peak night. */
.hotel-rooming-list__banner {
  display: flex; align-items: center; gap: var(--wa-space-s, 0.75rem);
  margin-bottom: var(--wa-space-m, 1rem);
  padding: var(--wa-space-s, 0.75rem) var(--wa-space-m, 1rem);
  background: var(--wa-color-brand-fill-quiet, var(--wa-color-surface-default));
  border: 1px solid var(--wa-color-neutral-border-quiet);
  border-radius: var(--wa-border-radius-m);
  color: var(--wa-color-text-normal);
  font-size: var(--wa-font-size-s, 0.9375rem);
}
.hotel-rooming-list__banner i { color: var(--wa-color-text-link); }

.hotel-rooming-list__filters {
  display: flex; flex-wrap: wrap; gap: var(--wa-space-s, 0.75rem);
  align-items: flex-end; margin-bottom: var(--wa-space-m, 1rem);
  padding: var(--wa-space-s, 0.75rem) var(--wa-space-m, 1rem);
  background: var(--wa-color-surface-raised, var(--wa-color-surface-default));
  border: 1px solid var(--wa-color-neutral-border-quiet);
  border-radius: var(--wa-border-radius-m);
}
.hotel-rooming-list__filters wa-select,
.hotel-rooming-list__filters wa-input {
  width: auto; min-width: 10rem; margin-block-start: 0;
}
.hotel-rooming-list__filters wa-button { margin-block-start: 0; }

.hotel-rooming-list__table { width: 100%; border-collapse: collapse; }
.hotel-rooming-list__table th, .hotel-rooming-list__table td {
  padding: var(--wa-space-xs, 0.5rem) var(--wa-space-s, 0.75rem);
  text-align: left; border-bottom: 1px solid var(--wa-color-neutral-border-quiet);
  font-size: var(--wa-font-size-s, 0.9375rem);
  white-space: nowrap;
}

/* HMS-1647 Nov 30 — on a desktop the whole operational table fits the
   viewport: no Status or Special Requests column hiding off the right edge.
   Fixed layout shares the width by contract; text wraps inside its column.
   Narrower screens keep the portal's established horizontal-scroll table. */
@media (min-width: 90rem) {
  .hotel-rooming-list__table-wrap {
    overflow-x: hidden;
    box-shadow: none;
  }
  .hotel-rooming-list__table-wrap .hotel-rooming-list__table {
    min-width: 0;
    table-layout: fixed;
  }
  .hotel-rooming-list__table-wrap .hotel-rooming-list__table th,
  .hotel-rooming-list__table-wrap .hotel-rooming-list__table td {
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .hotel-rooming-list__col-num { width: 3%; }
  .hotel-rooming-list__col-details { width: 13%; }
  .hotel-rooming-list__col-email { width: 11%; }
  .hotel-rooming-list__col-phone { width: 11%; }
  .hotel-rooming-list__col-company { width: 8%; }
  .hotel-rooming-list__col-room-type { width: 9%; }
  .hotel-rooming-list__col-room-number { width: 5%; }
  .hotel-rooming-list__col-check-in,
  .hotel-rooming-list__col-check-out { width: 8%; }
  .hotel-rooming-list__col-requests { width: 13%; }
  .hotel-rooming-list__col-status { width: 11%; }
  .hotel-rooming-list__table-wrap td.hotel-rooming-list__details,
  .hotel-rooming-list__table-wrap td.hotel-rooming-list__requests {
    min-width: 0;
    max-width: none;
  }
}
.hotel-rooming-list__table th {
  color: var(--wa-color-text-quiet);
  font-weight: var(--wa-font-weight-semibold, 600);
}
.hotel-rooming-list__table td.hotel-rooming-list__num,
.hotel-rooming-list__table th.hotel-rooming-list__num {
  color: var(--wa-color-text-quiet); width: 2.5rem;
}
.hotel-rooming-list__sort {
  color: inherit; text-decoration: none;
  display: inline-flex; align-items: center; gap: var(--wa-space-2xs, 4px);
}
/* Sort affordance mirrors the dashboard's recent-bookings header: the icon
   carries the state — quiet when neutral, brand-loud for the active
   direction. */
.hotel-rooming-list__chev { font-size: 0.75em; }
.hotel-rooming-list__sort .fa-sort { color: var(--wa-color-text-quiet); }
.hotel-rooming-list__sort .fa-sort-up,
.hotel-rooming-list__sort .fa-sort-down { color: var(--wa-color-brand-fill-loud); }
/* HMS-1699 — the Booking details cell stacks every party and ref on its
   own labeled line, so it wraps like the requests cell instead of the
   table's default nowrap. Each line is a block; the label reads quiet so
   the values carry the eye. */
.hotel-rooming-list__table td.hotel-rooming-list__details {
  white-space: normal;
  min-width: 11rem;
  max-width: 22rem;
}
.hotel-rooming-list__detail { display: block; }
.hotel-rooming-list__detail-key { color: var(--wa-color-text-quiet); }
.hotel-rooming-list__guest-link {
  color: var(--wa-color-text-link);
  text-decoration: none;
}
.hotel-rooming-list__guest-link:hover { text-decoration: underline; }
.hotel-rooming-list__ref { font-size: inherit; white-space: nowrap; }

/* HMS-1647 — Special Requests is the one free-text column: it wraps like
   the guest cell instead of the table's default nowrap, with a floor so a
   long note cannot squeeze the factual columns to nothing. */
.hotel-rooming-list__table td.hotel-rooming-list__requests {
  white-space: normal;
  min-width: 12.3rem;
  max-width: 12.3rem;
  overflow-wrap: anywhere;
}
.hotel-rooming-list__requests-more summary {
  cursor: pointer;
  color: var(--wa-color-text-link);
  font-size: 0.8125rem;
}
.hotel-rooming-list__requests-more summary:hover { text-decoration: underline; }

/* HMS-1647 — a completed stay stays on the list (the hotel still needs the
   record) but reads muted so it cannot pass for an active arrival. */
.hotel-rooming-list__table tr.hotel-rooming-list__row--completed td {
  color: var(--wa-color-text-quiet);
}

.hotel-rooming-list__empty {
  padding: var(--wa-space-l, 1.5rem); text-align: center;
  color: var(--wa-color-text-quiet);
}

/* HMS-1686 — the upload show's status column: chip and applied date. */
.hotel-rooming-list__status {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: var(--wa-space-2xs, 4px); text-align: right;
}
.hotel-rooming-list__status-detail {
  color: var(--wa-color-text-quiet);
  font-size: var(--wa-font-size-s, 0.9375rem);
}

/* HMS-1686 — the uploads index CTA is the page's primary action; the margin
   keeps it off the table's top edge (it used to sit flush on it). */
.hotel-rooming-list__upload-cta {
  margin-block-end: var(--wa-space-m, 1rem);
}

/* HMS-1894 — the uploads table fits a desktop portal width by pinning the
   File column inside the ticket's 300–360px range and middle-truncating the
   name inside it. The shared hotel-table rule sets min-width:max-content,
   which is exactly what made a long file name push the counters off-screen;
   the stronger selector restores a finite table floor. table-layout:fixed
   keeps File at its allocation in every browser. The five counter columns are
   deliberately widthless so they split the leftover table width equally —
   QA's re-test caught Mismatched absorbing all of it. File uses the low end
   of its ticketed range so the widest counter label still fits inside its
   equal share at a 1440px viewport, while Uploaded stays wide enough to keep
   its timestamp on one line. */
.hotel-table-wrap .hotel-rooming-list__uploads-table {
  min-width: 71.25rem;
  table-layout: fixed;
}
.hotel-rooming-list__uploads-uploaded-col { width: 13.25rem; }
.hotel-rooming-list__uploads-file-col { width: 18.75rem; }
.hotel-rooming-list__uploads-status-col { width: 11rem; }
.hotel-rooming-list__uploads-view-col { width: 3rem; }
.hotel-rooming-list__uploads-file-cell { white-space: nowrap; }
.hotel-rooming-list__uploads-file {
  display: flex; align-items: baseline;
  width: 100%; max-width: 100%; overflow: hidden;
  white-space: nowrap;
  border-radius: var(--wa-border-radius-s);
}
.hotel-rooming-list__uploads-file:focus-visible {
  outline: var(--wa-focus-ring);
  outline-offset: var(--wa-focus-ring-offset, 2px);
}
.hotel-rooming-list__uploads-file-start {
  flex: 0 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.hotel-rooming-list__uploads-file-end {
  flex: none; white-space: nowrap;
}

/* HMS-1686 QA re-test — quiet line under a section h2 explaining what a
   table column counts (the rejected rows' "Row in file"). The h2's own
   bottom margin supplies the gap above; this only needs air below. */
.hotel-rooming-list__table-hint {
  margin: 0 0 var(--wa-space-s, 0.75rem);
  color: var(--wa-color-text-quiet);
  font-size: var(--wa-font-size-s, 0.9375rem);
}

/* HMS-1201 — upload form keeps its gap; HMS-1302 — picker box and submit
   sit side by side in one row, per the ticket's design attachment. */
.hotel-rooming-list__upload-form {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--wa-space-m, 1rem);
  margin-block: var(--wa-space-m, 1rem);
}

/* HMS-1302/1303 — bordered picker box: Choose File button, filename text,
   and an X that clears the pick. HMS-1874 turns the box itself into the
   drag-and-drop target. */
.hotel-rooming-list__file-box {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--wa-space-xs, 0.5rem) var(--wa-space-s, 0.75rem);
  flex: 0 1 30rem; min-width: 18rem; min-height: 5.5rem;
  padding: var(--wa-space-s, 0.75rem) var(--wa-space-m, 1rem);
  background: var(--wa-color-surface-raised, var(--wa-color-surface-default));
  border: 2px dashed var(--wa-color-neutral-border-quiet);
  border-radius: var(--wa-border-radius-m);
  cursor: pointer;
}
.hotel-rooming-list__file-box[data-file-feedback-dropzone-active] {
  border-color: var(--wa-color-brand-50);
  background: var(--wa-color-brand-95);
}
.hotel-rooming-list__drop-copy {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: var(--wa-space-2xs, 4px);
  color: var(--wa-color-text-normal); text-align: center;
}
.hotel-rooming-list__drop-copy[hidden] { display: none; }
.hotel-rooming-list__drop-copy > i {
  color: var(--wa-color-brand-60);
  font-size: var(--wa-font-size-2xl, 1.5rem);
}
.hotel-rooming-list__browse {
  position: relative; cursor: pointer;
  color: var(--wa-color-text-link);
  text-decoration: underline;
}
.hotel-rooming-list__browse:focus-within {
  outline: 2px solid var(--wa-color-text-link); outline-offset: 2px;
}
.hotel-rooming-list__file-hint {
  color: var(--wa-color-text-quiet);
  font-size: var(--wa-font-size-s, 0.9375rem);
}
/* Visually hidden input: the label click still opens the picker. */
.hotel-rooming-list__file {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.hotel-rooming-list__file-name {
  display: flex; align-items: baseline;
  color: var(--wa-color-text-quiet); font-size: var(--wa-font-size-s, 0.9375rem);
  /* HMS-1672 — a zero flex basis keeps the span's hypothetical main size at
     0, so line-breaking never parks the × on its own line under a long name;
     it grows into the leftover space, ellipsizes, and pins × to the right. */
  flex: 1 1 0;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hotel-rooming-list__file-name[hidden] { display: none; }
.hotel-rooming-list__file-name[data-file-feedback-target~="picked"] {
  color: var(--wa-color-text-normal);
}
.hotel-rooming-list__file-name .file-feedback__name-start {
  flex: 0 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.hotel-rooming-list__file-name .file-feedback__name-end,
.hotel-rooming-list__file-name .file-feedback__name-size {
  flex: none; white-space: nowrap;
}
.hotel-rooming-list__file-name .file-feedback__name-size { white-space: pre; }
.hotel-rooming-list__file-remove {
  appearance: none; border: 0; background: none; cursor: pointer; flex: none;
  color: var(--wa-color-text-quiet); font-size: var(--wa-font-size-s, 0.9375rem);
  padding: var(--wa-space-2xs, 4px);
}
.hotel-rooming-list__file-remove:hover { color: var(--wa-color-text-normal); }
/* native.css styles every button display:inline-flex, which beats the UA
   [hidden] rule — the clear button needs an explicit guard. */
.hotel-rooming-list__file-remove[hidden] { display: none; }
.hotel-rooming-list__file-error {
  flex-basis: 100%; margin: 0;
  color: var(--wa-color-danger-fill-loud, #b91c1c);
  font-size: var(--wa-font-size-s, 0.9375rem);
}

/* HMS-1669 — the upload page's template downloads sit between the form and
   the requirements list, boxed like the filters panel. */
.hotel-rooming-list__downloads {
  margin-block: var(--wa-space-m, 1rem);
  padding: var(--wa-space-s, 0.75rem) var(--wa-space-m, 1rem);
  background: var(--wa-color-surface-raised, var(--wa-color-surface-default));
  border: 1px solid var(--wa-color-neutral-border-quiet);
  border-radius: var(--wa-border-radius-m);
}
.hotel-rooming-list__downloads-title {
  margin: 0 0 var(--wa-space-2xs, 4px);
  font-size: var(--wa-font-size-m, 1rem);
  font-weight: var(--wa-font-weight-semibold, 600);
  color: var(--wa-color-text-normal);
}
.hotel-rooming-list__downloads-hint {
  margin: 0 0 var(--wa-space-s, 0.75rem);
  color: var(--wa-color-text-quiet);
  font-size: var(--wa-font-size-s, 0.9375rem);
}
.hotel-rooming-list__downloads-actions {
  display: flex; gap: var(--wa-space-s, 0.75rem); flex-wrap: wrap;
}

/* HMS-1302 — divider + dedicated requirements list replace the old banner. */
.hotel-rooming-list__divider {
  border: 0; border-top: 1px solid var(--wa-color-neutral-border-quiet);
  margin: var(--wa-space-l, 1.5rem) 0;
}
.hotel-rooming-list__requirements h2 {
  margin: 0 0 var(--wa-space-s, 0.75rem);
  font-size: var(--wa-font-size-l, 1.125rem);
  font-weight: var(--wa-font-weight-semibold, 600);
  color: var(--wa-color-text-normal);
}
.hotel-rooming-list__requirements ul {
  margin: 0; padding-left: var(--wa-space-l, 1.5rem);
  color: var(--wa-color-text-normal);
  font-size: var(--wa-font-size-s, 0.9375rem);
}
.hotel-rooming-list__requirements li { margin-bottom: var(--wa-space-xs, 0.5rem); }
.hotel-rooming-list__requirements li:last-child { margin-bottom: 0; }

/* HMS-1311 — the back control is an outlined wa-button; air above it
   separates it from the CSV requirements list. */
.hotel-rooming-list__back { margin-block-start: var(--wa-space-l, 1.5rem); }

/* HMS-1680 QA re-test — the upload counters each carry a one-line hint:
   number+label on the dt line, the explanation quiet underneath. */
.hotel-rooming-list__counters {
  display: flex; flex-wrap: wrap;
  gap: var(--wa-space-xs, 0.5rem) var(--wa-space-xl, 2rem);
  margin: 0 0 var(--wa-space-2xs, 4px);
}
.hotel-rooming-list__counter { display: flex; flex-direction: column; gap: 2px; }
.hotel-rooming-list__counter dt {
  font-weight: var(--wa-font-weight-semibold, 600);
  color: var(--wa-color-text-normal);
}
.hotel-rooming-list__counter dd {
  margin: 0; max-width: 15rem;
  color: var(--wa-color-text-quiet);
  font-size: var(--wa-font-size-s, 0.9375rem);
}

/* HMS-1723 — a held confirmation number on a mismatched row prints its
   review state as a quiet second line inside the differences table's
   Field cell. */
.hotel-rooming-list__held-note {
  display: block;
  color: var(--wa-color-text-quiet);
  font-size: var(--wa-font-size-s, 0.9375rem);
}

/* HMS-1748 — Differences from Housing grouped by booking: each booking is a
   <tbody> headed by its reference, separated from the next by a gap. */
.hotel-rooming-list__diffs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--wa-space-xs) var(--wa-space-m);
}

.hotel-rooming-list__diffs-tally {
  color: var(--wa-color-text-quiet);
  font-size: var(--wa-font-size-s, 0.9375rem);
}

.hotel-rooming-list__diff-table {
  border-collapse: separate;
  border-spacing: 0;
}

.hotel-rooming-list__diff-group + .hotel-rooming-list__diff-group .hotel-rooming-list__diff-group-head th {
  border-top: var(--wa-space-m) solid var(--wa-color-surface-default, #fff);
}

.hotel-rooming-list__diff-group-head th {
  background: var(--wa-color-neutral-fill-quiet);
  text-align: left;
  font-weight: var(--wa-font-weight-normal, 400);
}

.hotel-rooming-list__diff-ref {
  font-family: var(--wa-font-family-code, monospace);
  font-weight: var(--wa-font-weight-semibold, 600);
  margin-right: var(--wa-space-s);
}

.hotel-rooming-list__diff-guest {
  color: var(--wa-color-text-quiet);
}

.hotel-rooming-list__diff-count {
  float: right;
  padding: 0 var(--wa-space-xs);
  border-radius: 999px;
  background: var(--wa-color-surface-default, #fff);
  font-size: var(--wa-font-size-xs, 0.75rem);
  font-weight: var(--wa-font-weight-semibold, 600);
}

@media (max-width: 640px) {
  .hotel-rooming-list__diff-table thead {
    display: none;
  }

  /* Stacked rows fit the viewport, so drop the wrap's scroll hint and its
     max-content table width. */
  .hotel-rooming-list__diff-wrap {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hotel-rooming-list__diff-wrap .hotel-rooming-list__diff-table {
    min-width: 0;
  }

  .hotel-rooming-list__diff-table,
  .hotel-rooming-list__diff-table tbody,
  .hotel-rooming-list__diff-table tr,
  .hotel-rooming-list__diff-table th {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
  }

  .hotel-rooming-list__diff-table tr:not(.hotel-rooming-list__diff-group-head) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .hotel-rooming-list__diff-table td {
    display: block;
    box-sizing: border-box;
    min-width: 0;
    overflow-wrap: anywhere;
    border: 0;
  }

  .hotel-rooming-list__diff-table td[data-label="Field"] {
    grid-column: 1 / -1;
    padding-bottom: 0;
  }

  .hotel-rooming-list__diff-table td[data-label="Field"]::before {
    content: none;
  }

  .hotel-rooming-list__diff-table tr:not(.hotel-rooming-list__diff-group-head) + tr {
    border-top: 1px solid var(--wa-color-neutral-border-quiet);
  }

  .hotel-rooming-list__diff-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--wa-color-text-quiet);
    font-size: var(--wa-font-size-xs, 0.75rem);
  }
}

/* HMS-1680 — bookings missing from the uploaded file collapse behind a
   native <details>; the summary reads like the section h2 it replaces. */
.hotel-rooming-list__missing-summary {
  font-size: var(--wa-font-size-l, 1.125rem);
  font-weight: var(--wa-font-weight-semibold, 600);
  color: var(--wa-color-text-normal);
  cursor: pointer;
}

@media (max-width: 40rem) {
  .hotel-rooming-list__filters { flex-direction: column; align-items: stretch; }
  .hotel-rooming-list__filters wa-select,
  .hotel-rooming-list__filters wa-input { width: 100%; }
  .hotel-rooming-list__actions { width: 100%; }
  /* Wrapped under the title on a phone, the status column reads left-to-right
     like everything else on the page instead of hugging the right edge. */
  .hotel-rooming-list__status { align-items: flex-start; text-align: left; }
}
