/* ============================================================
   Role builder — permission matrix (collapsible groups + rows).
   ============================================================ */

.role-selected-summary {
  font-size: 12px;
  color: var(--text-tertiary);
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
}

.role-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.role-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-primary);
}
.role-group-chev { display: inline-flex; color: var(--text-tertiary); transition: transform 140ms ease; }
.role-group-chev.is-closed { transform: rotate(-90deg); }
.role-group-name { font-size: 13px; font-weight: 600; }
.role-group-count {
  font-size: 11px; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  background: var(--bg-hover); border-radius: 999px; padding: 1px 8px;
}

.role-group-all {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-secondary); cursor: pointer;
}

.role-perm-list { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
@media (max-width: 900px) { .role-perm-list { grid-template-columns: 1fr; } }

.role-perm-label {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background 100ms ease;
}
.role-perm-label:hover { background: var(--bg-hover); }
.role-perm-label input[type="checkbox"] { margin-top: 2px; }

.role-perm-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.role-perm-title { font-size: 13px; color: var(--text-primary); display: inline-flex; align-items: center; gap: 8px; }
.role-perm-key { font-size: 11px; color: var(--text-tertiary); }
.role-perm-desc { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }

.role-perm-danger {
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--danger); background: var(--danger-soft);
  border-radius: 999px; padding: 1px 6px;
}
