.role-directory {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #dfe7eb;
  border-radius: 10px;
  background: #f7fafb;
}

.role-directory-head,
.role-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.role-directory-head { margin-bottom: 10px; }
.role-directory-head strong { font-size: 11px; color: #17344e; }
.role-directory-head span { font-size: 8px; color: #7f909d; }
.role-directory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.role-card { min-width: 0; padding: 10px; border: 1px solid #dfe7eb; border-radius: 8px; background: #fff; }
.role-card.inactive { opacity: .62; background: #f1f3f4; }
.role-card > div > strong { overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.role-card > small { display: block; margin-top: 5px; color: #788a97; font-size: 8px; }
.role-type { flex: 0 0 auto; border-radius: 10px; padding: 3px 6px; font-size: 7px; font-weight: 700; }
.role-type.system { color: #0d7782; background: #e6f5f5; }
.role-type.custom { color: #715b18; background: #fff5d8; }
.role-card details { margin-top: 8px; }
.role-card summary { cursor: pointer; color: #147d87; font-size: 8px; font-weight: 700; }
.role-card ul { max-height: 150px; overflow: auto; margin: 7px 0 0; padding-left: 16px; color: #627684; font-size: 8px; line-height: 1.55; }
.role-inline-message { max-width: 560px; margin-top: 7px; border-radius: 7px; padding: 8px 10px; font-size: 9px; line-height: 1.45; }
.role-inline-message.error { color: #a83939; background: #fff0f0; border: 1px solid #efcaca; }
.role-inline-message.success { color: #28745d; background: #ebf8f2; border: 1px solid #c6eadc; }
.role-name input.field-invalid { border-color: #c94848; box-shadow: 0 0 0 3px rgba(201,72,72,.12); }

@media (max-width: 1024px) { .role-directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .role-directory-grid { grid-template-columns: 1fr; } }
