Some weeks ago I learnt a rule about those 2 things.
Such belongs to nouns.
This is such a great idea.
He is such an idiot.
She is such a careful driver.
So belongs to adjectives and adverbs.
He drives so incredibly uncarefully.
You look so hot.
This idea is so stupid.
I'm not sure if this already answers your question...
P.S. I cannot 100% guarantee that they belong to adverbs, too
- For Teachers