Since surgery I've been to the ER for loss of consciousness twice (and a grand mal seizure from my chronic seizure disorder once). In one case the loss of consciousness was caused by dehydration from diarrhea at 4 am, even though I drink water all the time when awake, it wasn't enough that night. I was on my way to the bathroom when my husband heard the thud of me hitting the wall and floor. he said there wasn't seizure activity, and the ambulance people said I turned around quickly when they started the saline drip. After a seizure, I am in a mental fog for a few hours and that didn't happen. The other time it was was electrolyte depletion, they said my glucose and sodium were too low to stay conscious and my blood pressure had dropped very low, 80/40 I think. I didn't have diarrhea that time but I was in the heat in august in NY outside without air conditioning for a few hours and hadn't eaten or had anything but a water bottle. I was on a NYC bus going home from a day showing family the sights and they said I didn't have seizure activity, just slumped to the floor. [ The grand mal happened at 2 am and that was low blood sugar and a change of seizure medicine the week before. That was the typical seizure and I didn't leave the bed, but woke my husband up from the movement (he is a saint). I was hospitalized for that one.]
The lesson is that we malabsorb water too and need to drink every hour or so, and more than we think we need. I am conscious of electrolytes when I am hot or have diarrhea. I am not a salt eater, but I have some when i think I need it (no problem getting sugar!)
The other thing to think about with lightheadedness and feeling crappy is hypoglycemia, to always have a few carbs with protein, to eat something small every 2 hours, and keep snacks (like cheese or nuts) with me at all times. I take a half a peanut butter and jelly sandwich to bed, in case I wake up with the body heat that means hypoglycemia. I have a water bottle at the bedside. I don't have diabetes any more, but I have had hypoglycemia since surgery. They did a 24-hour glucose monitor and found low dips at 2 am and 11 am. I concentrate on eating at those times. You might want to do glucose monitoring.
I hope you find a solution that works for you!