Senate approves two-year budget deal in 3 a.m. vote