Generalized theory of shells