/* Responsive wrappers for admin tables that would otherwise clip on mobile. */

.admin-table-wrap {
  overflow-x: auto;
  width: 100%;
  /* Subtle right-edge shadow hints that wide tables scroll horizontally on
     narrow viewports. Pure CSS (no JS); rendered beneath the table so it
     never covers or blocks clickable content. */
  box-shadow: inset -10px 0 10px -10px var(--wa-color-neutral-border-quiet);
}

.admin-table-wrap table {
  min-width: max-content;
}

/* HMS-271 — VIP verification queue. Same scroll-inside-the-wrap contract as
   .admin-table-wrap: the admin shell's 1fr column expands past the viewport
   between the 1167px breakpoint and ~1205px without it, scrolling the whole
   document. No `min-width: max-content` on the table — auto layout still
   fills the wrap when it fits. */
.vip-verifications__table-wrap {
  overflow-x: auto;
  width: 100%;
  box-shadow: inset -10px 0 10px -10px var(--wa-color-neutral-border-quiet);
}

/* Booking overrides results: same scroll-inside-the-wrap contract as
   .vip-verifications__table-wrap — auto layout fills the wrap when the table
   fits (desktop keeps its wrapped cells) and scrolls only when it cannot. */
.admin-overrides__table-wrap {
  overflow-x: auto;
  width: 100%;
  box-shadow: inset -10px 0 10px -10px var(--wa-color-neutral-border-quiet);
}

.admin-events__table th,
.admin-events__table td {
  white-space: nowrap;
  vertical-align: top;
}

/* UI review (HMS-385): the Actions cell holds up to 12 links for writers. The
   generic .admin-table-wrap rule gives the table min-width:max-content, which
   forced that cell onto one ~1030px line and clipped links mid-word at 1440.
   Let this table shrink to the wrap width so the links wrap as units instead;
   the nowrap Event/Starts/Ends cells keep its min-content wide enough that it
   still scrolls (rather than crushing) on very narrow screens. */
/* Specificity: must outrank `.admin-table-wrap table { min-width: max-content }`
   above (0,1,1) — plain `.admin-events__table` (0,1,0) loses. */
.admin-table-wrap .admin-events__table {
  min-width: 0;
}

.admin-events__table td:last-child {
  white-space: normal;
}

.admin-events__table td:last-child a {
  display: inline-block;
  white-space: nowrap;
  margin-block-end: 0.25rem;
}

/* HMS-257 — event settings form. Same field rhythm as the overflow-rule /
   OTA-partner / bulk-adjustment forms below; without it the field divs stack
   with 0px between them and the number inputs run the full content width. */
.admin-events__field {
  margin-block-end: 1rem;
  max-width: 32rem;
}

.admin-events__field label {
  display: block;
  margin-block-end: 0.25rem;
  font-weight: 600;
  color: var(--wa-color-text-normal);
}

.admin-events__errors {
  margin-block-end: 1rem;
  padding: 0.75rem 1rem;
  color: var(--wa-color-danger-on-quiet);
  background: var(--wa-color-danger-fill-quiet);
  border: 1px solid var(--wa-color-danger-border-normal);
  border-radius: var(--wa-border-radius-m);
}

.admin-events__errors ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.admin-table__empty {
  padding: var(--wa-space-m);
  text-align: center;
  color: var(--wa-color-text-quiet);
}

/* HMS-247 — overflow rules + OTA partners admin. Native Web Awesome table
   styles already cover row separators and cell padding; these rules add the
   card treatment + flex header the other admin index pages get, so the new
   screens don't sit visibly below the convention. The form pages get basic
   field rhythm for the same reason. */

.admin-overflow-rules__header,
.admin-ota-partners__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1.5rem;
}

.admin-overflow-rules__title,
.admin-ota-partners__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--wa-color-text-normal);
}

.admin-overflow-rules__intro {
  margin: 0 0 1.5rem;
  max-width: 60ch;
  color: var(--wa-color-text-quiet);
}

.admin-overflow-rules__table,
.admin-ota-partners__table {
  width: 100%;
  border-collapse: collapse;
  background: var(--wa-color-surface-default);
  border: 1px solid var(--wa-color-surface-border);
  border-radius: 0.5rem;
}

.admin-overflow-rules__table th,
.admin-overflow-rules__table td,
.admin-ota-partners__table th,
.admin-ota-partners__table td {
  padding: 0.875rem 1rem;
  text-align: start;
  border-block-end: 1px solid var(--wa-color-surface-border);
}

.admin-overflow-rules__table thead th,
.admin-ota-partners__table thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--wa-color-text-quiet);
  background: var(--wa-color-neutral-fill-quiet);
}

.admin-overflow-rules__table tbody tr:last-child td,
.admin-ota-partners__table tbody tr:last-child td {
  border-block-end: none;
}

.admin-overflow-rules__actions {
  white-space: nowrap;
}

.admin-overflow-rules__actions a,
.admin-ota-partners__table td a {
  margin-inline-end: 0.5rem;
}

.admin-overflow-rules__actions form,
.admin-ota-partners__table td form {
  display: inline;
}

.admin-overflow-rules__empty {
  color: var(--wa-color-text-quiet);
}

/* The new/edit forms: plain stacked fields, but with rhythm. */
.overflow-rule-form__field,
.ota-partner-form__field {
  margin-block-end: 1rem;
  max-width: 32rem;
}

.overflow-rule-form__field label,
.ota-partner-form__field label {
  display: block;
  margin-block-end: 0.25rem;
  font-weight: 600;
  color: var(--wa-color-text-normal);
}

.overflow-rule-form__field input,
.overflow-rule-form__field select,
.ota-partner-form__field input,
.ota-partner-form__field select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--wa-color-text-normal);
  background: var(--wa-color-surface-default);
  border: 1px solid var(--wa-color-neutral-border-normal);
  border-radius: var(--wa-border-radius-m);
}

.overflow-rule-form__destination {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--wa-color-surface-border);
  border-radius: var(--wa-border-radius-m);
}

.overflow-rule-form__destination legend {
  padding: 0 0.5rem;
  font-weight: 600;
  color: var(--wa-color-text-normal);
}

.overflow-rule-form__hint,
.ota-partner-form__hint {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--wa-color-text-quiet);
}

/* Error box mirrors .ad-banner-form__errors — the established pattern. */
.overflow-rule-form__errors,
.ota-partner-form__errors {
  margin-block-end: 1rem;
  padding: 0.75rem 1rem;
  color: var(--wa-color-danger-on-quiet);
  background: var(--wa-color-danger-fill-quiet);
  border: 1px solid var(--wa-color-danger-border-normal);
  border-radius: var(--wa-border-radius-m);
}

.overflow-rule-form__errors ul,
.ota-partner-form__errors ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.overflow-rule-form__submit,
.ota-partner-form__submit {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--wa-border-radius-m);
  background: var(--wa-color-brand-fill-normal);
  color: var(--wa-color-brand-on-normal);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* HMS-252 — bulk inventory adjustment form. Same field rhythm as the
   overflow-rule / OTA-partner forms above: the view declares
   bulk-adjustment-form__* classes, and without these rules the hint, fields
   and submit button render with 0px gaps between them. */
.bulk-adjustment-form__field {
  margin-block-end: 1rem;
  max-width: 32rem;
}

.bulk-adjustment-form__field label {
  display: block;
  margin-block-end: 0.25rem;
  font-weight: 600;
  color: var(--wa-color-text-normal);
}

.bulk-adjustment-form__field input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--wa-color-text-normal);
  background: var(--wa-color-surface-default);
  border: 1px solid var(--wa-color-neutral-border-normal);
  border-radius: var(--wa-border-radius-m);
}

.bulk-adjustment-form__hint {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--wa-color-text-quiet);
}

.bulk-adjustment-form__submit {
  display: inline-block;
  margin-inline-end: 0.75rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--wa-border-radius-m);
  background: var(--wa-color-brand-fill-normal);
  color: var(--wa-color-brand-on-normal);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* HMS-254 — block optimization admin. Web Awesome's native table styles cover
   padding and row separators; these rules cover what the view declares on top:
   the rate-alert badge line, the room-type subtitle inside the Room block cell,
   the hotel subheadings, and side-by-side Approve/Deny forms (matching the
   ota-partners `td form { display: inline }` convention above). */
.admin-block-optimization__alerts {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  color: var(--wa-color-text-quiet);
}

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

.admin-block-optimization__hotel {
  margin: 1.25rem 0 0.375rem;
  font-size: 1rem;
  color: var(--wa-color-text-normal);
}

.admin-block-optimization__sub {
  display: block;
  font-size: 0.8125rem;
  color: var(--wa-color-text-quiet);
}

.admin-block-optimization__table td form {
  display: inline;
}

.admin-block-optimization__table td form + form {
  margin-inline-start: 0.5rem;
}

.admin-block-optimization__empty,
.admin-block-optimization__note {
  margin: 0.5rem 0;
  color: var(--wa-color-text-quiet);
}

/* HMS-302 — AI comm drafts review screens. Field rhythm + action row matching
   the other admin tool pages; the <pre> body needs wrapping since drafted text
   is plain text with hard newlines. */

.admin-ai-comms__field {
  margin-block-end: 1rem;
}

.admin-ai-comms__field label {
  display: block;
  font-weight: 600;
  margin-block-end: 0.25rem;
}

.admin-ai-comms__field input[type="text"],
.admin-ai-comms__field textarea,
.admin-ai-comms__field select {
  width: 100%;
  max-width: 42rem;
}

.admin-ai-comms__hint {
  margin: 0.25rem 0;
  font-size: 0.8125rem;
  color: var(--wa-color-text-quiet);
}

.admin-ai-comms__status {
  color: var(--wa-color-text-quiet);
}

.admin-ai-comms__errors {
  max-width: 42rem;
  margin-block-end: 1rem;
  padding: 0.75rem 1rem;
  color: var(--wa-color-danger-on-quiet);
  background: var(--wa-color-danger-fill-quiet);
  border: 1px solid var(--wa-color-danger-border-normal);
  border-radius: var(--wa-border-radius-m);
}

/* HMS-412 — the Current stage line is a status readout, not prose: quiet
   text with a semibold stage name, matching .admin-ai-comms__status. */
.admin-ai-settings__status {
  margin-block-end: 1rem;
  color: var(--wa-color-text-quiet);
}

.admin-ai-settings__stage {
  color: var(--wa-color-text-normal);
}

/* UI review: the AI settings screens (event + hotel) reuse the same
   role="alert" danger callout as .admin-ai-comms__errors — auto-pause
   banner and form validation errors. Without this rule they rendered as
   plain body text. */
.admin-ai-settings__errors {
  max-width: 42rem;
  margin-block-end: 1rem;
  padding: 0.75rem 1rem;
  color: var(--wa-color-danger-on-quiet);
  background: var(--wa-color-danger-fill-quiet);
  border: 1px solid var(--wa-color-danger-border-normal);
  border-radius: var(--wa-border-radius-m);
}

.admin-ai-comms__actions {
  display: flex;
  gap: 0.75rem;
  margin-block: 1rem;
}

.admin-ai-comms__body {
  max-width: 42rem;
  white-space: pre-wrap;
  font-family: inherit;
}

/* HMS-303 — AI report summary page. Same field rhythm as the AI comms
   screens; the figures tables reuse the plain admin table look. */

.admin-ai-report__meta,
.admin-ai-report__summary {
  max-width: 42rem;
}

.admin-ai-report__meta {
  color: var(--wa-color-text-quiet);
}

.admin-ai-report__summary {
  margin-block: 1rem;
  padding: 1rem 1.25rem;
  background: var(--wa-color-neutral-fill-quiet);
  border: 1px solid var(--wa-color-border-quiet);
  border-radius: var(--wa-border-radius-m);
}

.admin-ai-report__errors {
  max-width: 42rem;
  margin-block-end: 1rem;
  padding: 0.75rem 1rem;
  color: var(--wa-color-danger-on-quiet);
  background: var(--wa-color-danger-fill-quiet);
  border: 1px solid var(--wa-color-danger-border-normal);
  border-radius: var(--wa-border-radius-m);
}

.admin-ai-report__figures {
  margin-block-end: 1.25rem;
}

.admin-ai-report__figures dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1.5rem;
  max-width: 42rem;
}

.admin-ai-report__figures dt {
  font-weight: 600;
}

.admin-ai-report__figures dd {
  margin: 0;
}

.admin-ai-report__action {
  margin: 0.5rem 0 1.25rem;
}
