Доброй ночи -genitive case.
Доброе утро -nominative/accusative case.

Why?

Thanks in advance.