.user-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 28px 80px rgba(27, 22, 48, 0.3);
}

.user-dialog::backdrop {
  background: rgba(30, 26, 45, 0.48);
  backdrop-filter: blur(2px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-title {
  margin: 0;
  font-size: 21px;
}

.dialog-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #6f6a7e;
  background: #f5f3f8;
  cursor: pointer;
}

.dialog-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 22px 24px;
  overflow-y: auto;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #4e495c;
  font-size: 12px;
  font-weight: 700;
}

.form-field[hidden] {
  display: none;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.form-input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid #ddd9e6;
  border-radius: 10px;
  outline: 0;
  color: #302d3b;
  background: #fff;
  font: inherit;
  font-weight: 400;
}

.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(75, 61, 152, 0.1);
}

.role-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.role-option {
  position: relative;
}

.role-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-option span {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #ddd9e6;
  border-radius: 10px;
  color: #5f5a6d;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.role-option input:checked + span {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px rgba(75, 61, 152, 0.08);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
}
