/* ============================================================
   RosterDive — Page: Roster Auth
   Page-specific styles not covered by DS components.
   DS components used: inline-header, filters-bar, datatable, badge,
   modal, alert, form-field, button, icon-button, toast
   Tokens: css/tokens.css

   Responsive (responsive.md §10 Option B): on mobile the 8-column
   Firebase Auth table becomes a stack of cards, one per row. Each cell
   shows its column header from the `data-label` attribute set by
   roster_auth_table.js (i18n keys), so no data is hidden and no
   horizontal scroll is required.
   ============================================================ */

/* Keep DS vertical rhythm between the warning alert and the confirmation
   field of the delete-auth modal. */
#delete-auth-modal .form-field {
  margin-top: var(--space-4);
}

@media (max-width: 599px) {
  /* Drop the DS 600px min-width: the table is no longer a grid. */
  #auth-table .datatable__table {
    min-width: 0;
  }

  #auth-table .datatable__table thead {
    display: none;
  }

  #auth-table .datatable__table,
  #auth-table .datatable__table tbody,
  #auth-table .datatable__table tr,
  #auth-table .datatable__table td {
    display: block;
    width: 100%;
  }

  #auth-table .datatable__table tr {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background: var(--color-surface);
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
  }

  #auth-table .datatable__table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    border: none;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) 0;
    text-align: right;
  }

  #auth-table .datatable__table tr td:last-child {
    border-bottom: none;
  }

  #auth-table .datatable__table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-weight: var(--weight-medium);
    color: var(--color-text-secondary);
    text-align: left;
  }

  /* Long UID must wrap inside the card instead of forcing a wider row. */
  #auth-table .datatable__table td.datatable__cell--uid {
    min-width: 0;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right;
  }

  /* State rows (loading/empty/error) are not cards: keep the message
     centered and full width, without a column header. */
  #auth-table .datatable__table td.datatable__loading,
  #auth-table .datatable__table td.datatable__empty,
  #auth-table .datatable__table td.datatable__error {
    display: block;
    text-align: center;
    border-bottom: none;
  }

  #auth-table .datatable__table td.datatable__loading::before,
  #auth-table .datatable__table td.datatable__empty::before,
  #auth-table .datatable__table td.datatable__error::before {
    content: none;
  }
}
