sober as a judge
Not at all intoxicated, quite clear-headed, as in Even after three drinks he was sober as a judge. Why judges should be equated with sobriety is not known, but the simile was first recorded in 1694.
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.