I feel for you right now, and it probably doesn't help a lot to say that this, too, shall pass.

I think part of what stopped the crazy-making for me (not all of it, as I still have days of huge frustration) are these:

Stop trying to control or change things over which you have no control. You cannot and will never make your daughter WANT something. You just can't make another person desire to do or not to do something. All you can do is what is within your power - draw firm boundaries, apply consequences predictably, and do your best to take your own emotion out of the dynamic. You can't make the school change their policies (but you can sure as heck try to apply pressure), so you have to learn to cope within them. If it isn't where you can cope, then maybe it's not worth having her there.

Accept that what applies to 99.9% of the kids and what works on them may not ever work on your child. That doesn't mean anything at all is wrong with her, and if she thinks her mother thinks there is something broken about her, she will be angry and hurt and act out because she will believe the one person she needs to be in her corner isn't. That doesn't mean you make excuses or let slide bad behavior. What it means is that you do everything within your power to empathize with her struggles and how she thinks and what makes her tick. The biggest struggle of parenting my children has come from the fact that what motivated me as a kid is nothing like what motivates them. I had to finally accept that two of the three were never going to care about grades. And so I learned to talk to them about what DID matter to them - honoring the blessings they'd been given, being a person of integrity, and showing kindness to others. And when I had their ear on those things that they did see the value in, then I was able to reason a little better with them about how their behavior or choices wasn't doing one of those things.

Take care of yourself. When you need to, walk away and remove yourself from the argument until you're in control again. Stop beating yourself up and telling yourself you're not a good mother because you can't get your daughter to do what you need her to do. It's a journey and a learning process for both of you, and if you fracture her respect of you or your respect for yourself, that is far more difficult to repair than dealing with an annoyed teacher who doesn't like not having her attention 100% of the time.

Accept that your daughter will likely always march to her own tune to a certain extent. Assess her strengths and her areas of challenge and start finding places where she can excel and where the areas of weaknesses will not prevent success. And then once you have some successes, build on those by easing her into more challenging circumstances that force her to deal for short periods with her struggles.

There are no rules that work 100% of the time on 100% of the kids.

This was the advice my pediatrician gave me about my kids, and I am so grateful to him for his insight into my own struggles at parenting. Pick your battles - the things that you will not back down from because they are inherent to your values (such as no hitting, no stealing, etc.) and then as much as you can, don't choose to battle over the rest of it. Let some of the small things go and don't own them all. If your child is hitting another kid or openly defying the teacher in class, that's worth a battle of wills with your child. But maybe everything else that's minor isn't. For those of us with kids with high maintenances personalities, chewing them out and making them aware they've failed us yet again is not a message they need to hear incessantly.

Hang in there - some days are worse than others.