/* 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);
}

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

/* 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);
}
