Apart from the too small aperture people have mentioned, note that a shutter speed of 1/40th will not freeze motion (as opposed to shake). You're not thinking about the exposure as a whole.
I'd also consider the exposure settings. You can over-expose and this can leading to detail clipping and over-saturation of some elements. It looks like a relatively high contract scene, and sometimes for shots like these it's necessary to use a HDR technique (which can have it's own problems, but if it was easy everyone would be doing it :-) ).
On the subject of aperture, note that any lens can have a varying sharpness across the frame - this is almost impossible to avoid. You need to be aware that you probably can't have everything in most shots.
Finally consider using some sharpening techniques in post processing. You'd be surprised how much detail can be enhanced with a bit of practice at this.