You are correct it is forbidden to eat before Maariv in the fear one will forget to pray or start sleeping. In the words of R Eliezer Melamed (here)
It is forbidden to start eating, even a light meal, half an hour
before tzeit hakochavim, for perhaps one will continue his meal until
he becomes tired and falls asleep. It is also forbidden to drink
alcoholic beverages.
However, drinks in general and coffee in particular, are not forbidden. Even a small meal is permitted, as it doesn't typically lead to become tired/sleep or forget to pray. R Melamed continues
However, fruits and vegetables may be eaten. Even the consumption of
bread or grains in an amount less than a kabeitzah is permissible.
PS. It is also permitted to drink coffee before morning prayers, see e.g., here for details