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

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

/* ── Filters bar: advanced filters button ── */
.filters-bar__filter-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.filters-bar__filter-button .material-symbols-outlined {
  font-size: 1.25rem;
}

/* `.badge` usa display:inline-flex e sovrascriverebbe l'attributo [hidden] */
#filters-count[hidden] {
  display: none;
}

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

  #invitations-table thead {
    display: none;
  }

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

  #invitations-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);
  }

  #invitations-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;
    overflow-wrap: anywhere;
  }

  #invitations-table tr td:last-child {
    border-bottom: none;
  }

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

  /* Action buttons keep their touch target and align to the row end. */
  #invitations-table td.datatable__actions .datatable__actions-cell {
    justify-content: flex-end;
  }

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

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