Have you had her formally assessed for learning disabilities (dyslexia, dysgraphia, etc.), visual processing and visual-motor coordination problems? "Sloppy" hand writing, poor comprehension, and written output that is considerably below the level of oral output in complexity, organization, and amount are all huge red flags for these kinds of issues, and really bright kids often manage to compensate by using their reasoning to help fill in the gaps for difficulties in these areas for years before anyone notices.