Non-equilibrium thermodynamics and dynamics of quantum systems