How do perimenopause and menopause affect sleep quality?