Theory of metallic magnetism at finite temperatures in bulk materials and thin films