I have searched for a whole day now and really could not find anything about it.
I want to change the style of the TOC in my document. Specifically, I want to have a background color to the section numbers in it, much like this:

I want this only on the top level sections, so the sub- and subsubsection still appear in their normal font and all.
Now I've tried around with tocloft and feel like \thesec is somehow what I want. I can't figure out how to add a colourbox around it though, or how to use it in general. I have used Latex for years now but never really used any scripts or so.
This is what I have so far:
\documentclass[10pt,a4paper,twoside,titlepage]{article}
\usepackage{tocloft}
\usepackage[T1]{fontenc}
\usepackage{color}
\definecolor{redl}{RGB}{255,52,52}
\definecolor{redd}{RGB}{149,28,23}
\makeatletter
\let\stdl@section\l@section
\renewcommand*{\l@section}[2]{%
\stdl@section{\textsc{\textcolor{redd}{#1}}}{\textcolor{redd}{#2}}}
%\let\thesecc\thesec
%\renewcommand*{\thesec}{\textcolor{redl}{\thesecc}}
\makeatother
\begin{document}
\tableofcontents
\section{Foo Test}
\subsection{bar}
\subsection{bar}
\end{document}
sets the top level section entries in redd (dark red, defined by me) and in small capitals. The two commented lines are a first try of using \thesec, that failed.
I would appreciate if someone had an idea. Please let me know if you need a MWE for this.
Best, Hannes
Edit1: Added the MWE
Edit2: Replaced \thesection by \thesec: Noticed that the actual section titles in the document were changed as well. I want the colourboxes for the TOC and for the headings to be defined seperately, as the sizes are obviously different. Thus my question about the TOC entries, as that seems more difficult.

tocbasicis part of the KOMA-Script bundle. You need at least version 3.20 from May 2016. Current version on CTAN etc. is 3.23 – esdd Jun 12 '17 at 12:06