This is the way I understand it.
Dogma is only that which has been reveled to us by God in divine revelation.
Doctrine is ANYTHING that is taught by the Church on faith and morals
there are three levels of doctrine and dogma
level 1 Dogma things that are clearly reveled in divine revelation that has been declared as such by the Church. You would be a heretic if you don’t believe in this
Level 2 Infallible Doctrine, these things are things not necessarily reveled explicitly in divine revelation, ex. immaculate conception, but the Church in one of 3 has declared something on faith and morals as truth.
Way 1 The Pope speaks Ex-Cathedra
Way 2 A ecumenical council is called and they declare something as doctrine
Way 3 the body of Bishops as a whole all teach something in unity
Level 3 Doctrine not held to infallibility, this is anything said by bishops, the pope (when he doesn’t speak ex cathedra) and others in authority in the Church that isn’t considered infallible.
Much of CSD is considered Level three of Doctrine, there are many things in here that Catholics are not morally bond to follow, but he should out of religious submission of mind and will follow these non- infallible doctrines.
one more note the Church herself calls is Social Doctrine of the Church. So when I say CSD or SD of the C I speak in lines of how the Church speaks

.