Two stage amplifier, low gain at high frequencies
Your first stage has a comparatively high output impedance (approximately 470 Ohms) relative to your 1V AC source resistance, which is presumably quite small. This resistance is seen as an effective source resistance to your second stage. The 470 Ohm resistance acts together with the capacitance of Q8 between the base and the collector to form a low-pass filter at the input of Q8. Due to the Miller Effect, this capacitance is effectively amplified by the gain of your second stage....which is around 90 or so. That is, the capacitance looks like a capacitor about 90 times larger than the actual base-collector capacitance, connected between the Q8 base and ground (the Miller Effect).
According to the BC817-40 datasheet, this capacitance is about 10pF. The effective capacitance seen at the input of Q8 is therefore around 900pF, so your 3dB rolloff will occur around \$f_{3dB} =\frac{1}{2\pi RC} = \frac{1}{2\pi\cdot 470 \cdot 900 \cdot 10^{-12}} = 380 \text{kHz}\$. From your graph, this looks about right.
A good solution is to use a Cascode configuration on your second stage to keep the Q8 collector at a steady voltage, circumventing the Miller Effect.