Structure, affect and identity as bases of organizational competition and cooperation