The principle for a prayer being 'Qadha' is that iits time range expires as soon as the time range of next prayer is due, with the exception of Fajr, the time of which lapses at sunrise. For example, if the time of Asr prayers start at 4.00 pm then the Zuhr prayers can be offered till this time. If Zuhr prayers are offered after 4.00 pm then it will be a Qadha prayer.
However the prayer is a time- related duty, it should be offered at its earliest time as per Sunnah.
According to Islamic rules, midnight is not at 12 o'clock, but the actual mid point between sunset and sunrise. For example, if at a certain place the sun sets at 6.00 pm and rises at 7.00 am then the time of midnight is 12.30 pm.
Tahajjud prayers can be offered at any time before Subh Saadiq. If at certain place the time for Subh Saadiq is 5.00 am, tahajjud can ce offered before this time, no matter it is 30 minutes or so.
Allaah knows the best.