Welcome to SR! You will find much support here from people who understand what you are going through. Hang around a while and read the forums and especially the stickies at the top of this forum. There is a lot of good and valuable wisdom to be found there.
I'm sorry your daughter has made bad choices and that she has found herself in jail. Sometimes that is what it takes to make them open their eyes to the direction they are heading. It's also good that she will be going to an in-patient rehab facility. She will learn the skills necessary for her to make better choices once she is back out and living in the world.
I don't mean to rain on your parade, but, please, tread cautiously during this time. I know that she is saying the things you want to hear right now, but that is easy to do when one ends up in jail. She still has a long way to go before she is healthy. Since she is 21, she will be able to check herself out of treatment at any time, and many do after a few days or weeks. The fact is, she will only get as much out of treatment as she is willing to put in. I hope she takes it seriously and stays for the full time.
Once again, welcome to SR! We are here to support YOU.