Texting is perfectly fine. I text with 3 male friends, and nothing has ever crossed a line. Going out for a meal is perfectly fine.
You know where the line is, OP: it's not touching each other in a romantic way, and not expressing any sort of affection or wish for intimacy together.
DCUM is extremely conservative and frowns on anything that might get you in the vicinity of the universe of the star system in which the planet adultery resides. You're not supposed to even look at a man. You should positively wear a burqa and live by Taliban rules.
But in the real world, what you're doing is perfectly fine.
Men and women can be friends with each other.
Wth this is terrible advice. Confiding in a coworker of the opposite sex about marital issues is beyond inappropriate and crossing the line. You need much better boundaries.