.user-create-card { margin-top: 22px; }
.permission-badge { display: inline-flex; min-height: 27px; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid #dce3ec; border-radius: 999px; background: #f7f9fc; color: #536176; font-size: 10px; font-weight: 850; white-space: nowrap; }
.permission-badge.admin { border-color: #efc8df; background: #fff3fa; color: #a20d5b; }
.permission-badge.coordinator { border-color: #cbddea; background: #f1f7fb; color: #345b76; }
.user-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; margin-top: 20px; }
.user-field { display: grid; align-content: start; gap: 7px; }
.user-field label { color: #3e3441; font-size: 11px; font-weight: 800; }
.user-field input, .user-field select { width: 100%; min-height: 43px; margin: 0; border-color: #d9dfe7; background: #fff; font-size: 12px; }
.user-field input:focus, .user-field select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgb(162 13 91 / 9%); outline: 0; }
.user-field small { color: #7d8796; font-size: 9px; line-height: 1.45; }
.user-role-field { grid-column: 1 / 2; }
.user-submit { align-self: end; justify-self: end; min-width: 185px; min-height: 43px; }
.form-errors { margin-top: 16px; padding: 12px 14px; border: 1px solid #fecdd3; border-radius: 9px; background: #fff5f6; color: #a61b36; font-size: 11px; }
.form-errors strong { display: block; margin-bottom: 5px; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-errors.compact { margin: 0 0 13px; }
.users-section { margin-top: 26px; }
.users-heading { margin-bottom: 13px; }
.users-grid { display: grid; gap: 12px; }
.user-card { padding: 0; overflow: hidden; }
.user-card-display { display: grid; grid-template-columns: 42px minmax(180px, 1fr) auto auto auto; align-items: center; gap: 13px; padding: 15px 17px; }
.user-avatar { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #efd9e7; border-radius: 11px; background: #fcecf6; color: #a20d5b; font-size: 13px; font-weight: 900; }
.user-identity { min-width: 0; }
.user-identity strong, .user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity strong { color: #2b2130; font-size: 13px; }
.user-identity small { margin-top: 4px; color: #7e8999; font-size: 10px; }
.current-user-label { padding: 4px 7px; border-radius: 5px; background: #f0edf0; color: #786f7a; font-size: 9px; font-weight: 800; }
.user-edit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; padding: 17px; border-top: 1px solid #ece7eb; background: #fcfbfc; }
.user-edit-form[hidden] { display: none; }
.user-edit-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 8px; }
.user-edit-actions .mini-save, .user-edit-actions .mini-cancel { min-height: 36px; padding: 8px 13px; }

html[data-theme="dark"] .permission-badge { border-color: #444a53; background: #292c31; color: #c4cbd3; }
html[data-theme="dark"] .permission-badge.admin { border-color: #6c3655; background: #382331; color: #ee9bcb; }
html[data-theme="dark"] .permission-badge.coordinator { border-color: #3e5668; background: #24313a; color: #a9c9df; }
html[data-theme="dark"] .user-field label, html[data-theme="dark"] .user-identity strong { color: #eee8ef; }
html[data-theme="dark"] .user-field input, html[data-theme="dark"] .user-field select { border-color: #444049; background: #242329; color: #f3eff5; }
html[data-theme="dark"] .user-avatar { border-color: #5b354c; background: #3a2432; color: #ee9bcb; }
html[data-theme="dark"] .current-user-label { background: #302e33; color: #bdb6bf; }
html[data-theme="dark"] .user-edit-form { border-color: #3a373d; background: #211f23; }
html[data-theme="dark"] .form-errors { border-color: #65333d; background: #352226; color: #f2a3b2; }

@media (max-width: 760px) {
  .user-form, .user-edit-form { grid-template-columns: 1fr; }
  .user-role-field, .user-edit-actions { grid-column: auto; }
  .user-submit { width: 100%; justify-self: stretch; }
  .user-card-display { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .user-card-display .permission-badge { grid-column: 2; justify-self: start; }
  .current-user-label { grid-column: 2; justify-self: start; }
  .user-card-display .row-tools { grid-column: 3; grid-row: 1 / span 3; }
}
