Hi! I hope that I have found a community that can help me

I would like to have pagenumbers right-aligned and not so close to the bottom of the page, and the headerline also right-aligned and formated in spaced laters(LIKE THIS).
Whats wrong with the following code/what do I have to do? Thank you very much!
\documentclass[12pt,a4paper,headsepline]{scrreprt}
\usepackage{amsmath}
\usepackage{geometry}
\geometry{a4paper,left=40mm,right=20mm, top=20mm, bottom=20mm}
\usepackage{amssymb}
%\usepackage[nenglish]{babel}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{array}
\usepackage{graphicx}
\usepackage{caption}
%\usepackage{subfigure}
\usepackage{setspace}
\onehalfspacing
\usepackage{fancyhdr}
\pagestyle{fancy}
\headheight 14pt
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
% Kopf- und Fußzeile in eingestellter Schriftart
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\end{document}