Are you getting a good night’s sleep?
Maybe it has nothing to do with how much caffeine you’re ingesting after 2pm. Maybe it has nothing to do with eating sweets after dinner. Maybe you don’t have to worry about too much exercise after 6p giving your body too much adreneline.
Maybe it’s something much more basic than all that.