وَأَوَّلُ وَقْتِ الْوِتْرِ بَعْدَ الْعِشَاءِ، وَآخِرُ وَقْتِهَا مَا لَمْ يَطْلُعِ الْفَجْرُ
Translation: The time of Witr begins after Isha and lasts until dawn appears.
Witr is performed after Isha in the required order. Its final boundary is dawn, not merely midnight.