Last month (a few weeks before turning 50) I had a similar surprise at work. Fortunately I was wearing dark jeans and they didn't stain all the way through. I was able to get them clean by pre-treating them.

I had originally planned to wear white pants that day, but fortunately changed my mind at the last minute.

The thing is that for most of my life I've had some kind of warning. For years I would get cramps right before getting my period. In recent years I started to get hot flashes for a week or so before it started. But apparently I can't count on any advance notice anymore.