/**
 * s420: shared table search + paging (saf-dashboard-tables.js), the failed-save
 * toast actions and the named confirm title (saf-dashboard.js).
 *
 * Kept out of saf-dashboard-base.css on purpose. Bump SAF_DASH_VERSION on every
 * edit (LiteSpeed cache-busts by ?ver=). Hover states go through :where() so
 * they never raise a rule above the s310 row-action look.
 */

/* --- Rows. A class, never [hidden]: tab scripts toggle tr.hidden themselves.
   !important because phone card mode sets display on tr. */
body.saf-dash-active .saf-dash__body tr.saf-dash-tbl-row--filtered,
body.saf-dash-active .saf-dash__body tr.saf-dash-tbl-row--paged {
  display: none !important;
}

/* --- Search bar above the table. */
body.saf-dash-active .saf-dash__body .saf-dash-tbl__bar {
  margin: 0 0 0.75rem;
}
body.saf-dash-active .saf-dash__body .saf-dash-tbl__bar[hidden] {
  display: none;
}
body.saf-dash-active .saf-dash__body .saf-dash-tbl__label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--saf-dash-text);
}
/* The shell's toolbar rule grows every input to fill the row; a cap is enough. */
body.saf-dash-active .saf-dash__body .saf-dash-tbl__input {
  max-width: 24rem;
}
body.saf-dash-active .saf-dash__body .saf-dash-tbl__status {
  font-size: 0.8125rem;
  color: var(--saf-dash-text-muted, #5f574a);
}
.saf-dash-tbl__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Print the whole list: a page of 25 on paper reads as the whole list. */
@media print {
  body.saf-dash-active .saf-dash__body tr.saf-dash-tbl-row--paged {
    display: table-row !important;
  }
  body.saf-dash-active .saf-dash__body [data-saf-tbl-control] {
    display: none;
  }
}

/* --- A toast that stays: message, then its buttons. */
body.saf-dash-active .saf-dash__toast.saf-dash__toast--sticky {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
body.saf-dash-active .saf-dash__toast--sticky .saf-dash__toast-msg {
  flex: 1 1 10rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
body.saf-dash-active .saf-dash__toast--sticky .saf-dash__toast-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
/* Three classes: the kit's button:hover is (0,2,1) and paints background + color. */
body.saf-dash-active .saf-dash__toast--sticky .saf-dash__toast-retry {
  min-height: 36px;
  min-width: 44px;
  padding: 0.25rem 0.875rem;
  border: 1px solid #fff;
  border-radius: 6px;
  background: #fff;
  color: var(--saf-dash-burgundy);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
body.saf-dash-active .saf-dash__toast--sticky .saf-dash__toast-retry:where(:hover) {
  background: #f3ece0;
  color: var(--saf-dash-burgundy);
}
body.saf-dash-active .saf-dash__toast--sticky .saf-dash__toast-dismiss {
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
body.saf-dash-active .saf-dash__toast--sticky .saf-dash__toast-dismiss:where(:hover) {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}
body.saf-dash-active .saf-dash__toast--sticky :is(.saf-dash__toast-retry, .saf-dash__toast-dismiss):focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@media (max-width: 480px) {
  body.saf-dash-active .saf-dash__toasts {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  body.saf-dash-active .saf-dash__toast {
    max-width: none;
  }
}

/* --- Confirm: the question is the title, the detail sits under it. */
body.saf-dash-active .saf-dash__modal-msg.saf-dash__modal-msg--title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
body.saf-dash-active .saf-dash__modal-msg--title:has(+ .saf-dash__modal-detail) {
  margin-bottom: 0.5rem;
}
body.saf-dash-active .saf-dash__modal-detail {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--saf-dash-text);
}
