/* Role permission matrix (it-53) — the grid on the role editor page.
 *
 * One block per registry group (a .float-card). Inside, each subject is a row:
 * a fixed-width label column so labels line up, then its action checkboxes in
 * even columns so the checkboxes align across subjects. House tokens only.
 */

.perm-subject {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: start;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.perm-subject:first-child {
  border-top: 0;
  padding-top: 0.25rem; /* the card header already gives space above the first row */
}

/* Line-height matches a row's height so the label sits centered on the first
 * checkbox row (not floating above it). */
.perm-subject__label {
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  line-height: var(--perm-row-h, 2rem);
}

/* The action checkboxes: even columns so read/create/update/… line up down the
 * card. auto-fill keeps it responsive; each cell is a comfortable min width. The
 * row-gap gives wrapped rows (e.g. a 6th action) real breathing room. */
.perm-actions {
  --perm-row-h: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.4rem 0.75rem;
}

/* A fixed-height, vertically-centered cell so every checkbox shares the same
 * baseline rhythm regardless of md-checkbox's internal touch-target padding. */
.perm-actions .checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: var(--perm-row-h, 2rem);
  margin: 0;
}

/* "Select all" affordance in the card header (right side, via .card__header's
 * space-between). A quieter label than the group title. */
.perm-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--md-sys-typescale-body-medium-size);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  user-select: none;
}
