It looks like you could leave SMF at 23:59 on the 26th... Arrive in ORD at 5:53 AM, and depart on your original flight to VIE on the 27th at 16:20. Not great, and I am not sure how reliable that red eye from SMF is, but I might do this. Does ORD have a hotel in the terminal ?