I have 0 children, so you can take the following with a grain of salt. But I have a couple of thoughts.
1) Have you tried talking to her about what's going on with her non-academically? I ask because middle school is a tough time for kids, and she may be struggling with personal issues ranging from general identity issues to serious inter-personal issues to even psychological issues. And she may not have anyone to talk to, or know how to talk about it. She may just be genrrally needing attention, even if it doesn't make sense at her age.
2) Your daughter may be just fine, but unmotivated. If that is the case, you could try incentivize her with money for grades. When I was in grade school, several kids in my school (a small private school) had parents who did just that. As a child, I thought it was bizarre, but those kids did make good grades, and apparently they only would if their parents paid them to. (As a side note, my little brother made good grades for free, but got paid to do household chores. I couldn't believe it because my sister and I were expected to do them for free.
)