.create-user-dialog {
  width: 650px;
  max-width: 650px;
  display: flex;
  flex-direction: column;

  @media (max-width: 768px) {
    width: 100%;
    max-width: 100%;
  }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.25rem 1.5rem;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

  .header-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 10px;


    .header-icon {
      font-size: 1.5rem;
      color: var(--primary-contrast-color);
    }
  }

  .header-text {
    flex: 1;

    .panel-title {
      margin: 0 0 0.25rem 0;
      font-size: 1.25rem;
      font-weight: 600;
      color: var(--text-color);
    }

    .panel-description {
      margin: 0;
      font-size: 0.875rem;
      color: var(--text-secondary-color);
    }
  }

  @media (max-width: 480px) {
    padding: 1rem;

    .header-icon-wrapper {
      width: 40px;
      height: 40px;

      .header-icon {
        font-size: 1.25rem;
      }
    }

    .header-text {
      .panel-title {
        font-size: 1.125rem;
      }

      .panel-description {
        font-size: 0.8rem;
      }
    }
  }
}

.form-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-top: none;
  overflow-y: auto;
  max-height: 60vh;

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: var(--overlay-background);
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
    transition: background 0.2s ease;

    &:hover {
      background: var(--primary-color);
    }
  }

  @media (max-width: 480px) {
    padding: 1rem;
    gap: 1.25rem;
  }
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    padding-bottom: 0.5rem;

    i {
      color: var(--primary-color);
      font-size: 1.125rem;
    }
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  .field-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
  }

  .field-input {
    width: 100%;
  }

  .field-error {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #ef4444;
    font-size: 0.8125rem;
    margin-top: -0.25rem;

    i {
      font-size: 0.875rem;
    }
  }
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;

  @media (max-width: 640px) {
    grid-template-columns: 1fr;
  }
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.95rem;
  background: var(--ground-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;

  &:hover {
    border-color: var(--primary-color);
    transform: translateX(3px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);

    .permission-icon {
      color: var(--primary-color);
      transform: scale(1.08);
    }
  }

  &.admin-permission {
    background: rgba(255, 152, 0, 0.05);

    &:hover {
      border-color: #ff9800;

      .permission-icon {
        color: #ff9800;
      }
    }

    .permission-icon-wrapper.admin-icon {
      background: rgba(255, 152, 0, 0.1);

      .permission-icon {
        color: #ff9800;
      }
    }

    .admin-name {
      color: #ff9800;
      font-weight: 600;
    }
  }

  .permission-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    min-width: 0;

    .permission-icon-wrapper {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      background: var(--overlay-background);
      border-radius: 8px;
      flex-shrink: 0;

      .permission-icon {
        font-size: 1rem;
        color: var(--text-secondary-color);
        transition: all 0.3s ease;
      }
    }

    .permission-name {
      font-size: 0.9rem;
      color: var(--text-color);
      font-weight: 500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  @media (max-width: 480px) {
    padding: 0.75rem;
    gap: 0.625rem;

    .permission-label {
      gap: 0.625rem;

      .permission-icon-wrapper {
        width: 32px;
        height: 32px;

        .permission-icon {
          font-size: 0.9rem;
        }
      }

      .permission-name {
        font-size: 0.85rem;
      }
    }
  }
}

.dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);

  .footer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary-color);

    i {
      color: var(--primary-color);
    }
  }

  .footer-actions {
    display: flex;
    gap: 0.75rem;
  }

  @media (max-width: 640px) {
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;

    .footer-info {
      width: 100%;
      justify-content: center;
    }

    .footer-actions {
      width: 100%;
      justify-content: flex-end;
      gap: 0.5rem;
    }
  }
}
