I came across a website where i found this attractive design for chapter titles and sections.
https://webusers.imj-prg.fr/~leonardo.zapponi/leo_divers/Agreg/Matrices_normales.pdf
Here's my attempt at reproducing it
\documentclass[12pt,a4paper]{report}
\usepackage{tikz}
\tikzstyle{a} = [text width=\textwidth-1cm,rectangle,draw=orange,rounded corners=2mm,line width=1pt,fill=orange!5,minimum width=\textwidth,align=left,inner sep=5mm]
\tikzstyle{b} = [rectangle,draw,rounded corners=2mm,line width=.5pt,fill=orange!25,minimum height=0mm,align=left,inner sep=2mm,font=\bfseries]
\def\titlebox#1#2{%
\begin{tikzpicture}
\node[a](a){#2};
\node[b,right=3mm](b) at (a.north west){#1};
\node[b,left=3mm](b) at (a.south east){2015-2016};
\end{tikzpicture}
}
\def\lembox#1#2{%
\begin{tikzpicture}
\node[a](a){#2};
\node[b,right=3mm](b) at (a.north west){#1};
\end{tikzpicture}
}
\parindent=0mm
\begin{document}
\titlebox{title}{
text
}
\lembox{title}{text}
\end{document}
which produce:
How can I improve my code to produce the same images


