Not trying to be rude or offensive in any way here, so if it come across that way I apologize. But, at 12 years old I would think your daughter would know better than to mess with any gun she found around the house, let alone in your bedroom. I would suggest keeping it in your bedside table or night stand and explaining to your family that you have it there and why. You say you have been teaching her the basics of firearm safety, seems to me that one of the top things about safety would be not messing around with my guns unless we are at a range and I'm supervising you. I just hate the thought of fumbling around in the night trying to get into a safe or get a gun lock opened when there's a bad guy in my house. My gun stays loaded and ready to pull the trigger at all times. The way I see it is this...if a bad guy comes in my house down stairs in the middle of the night, odds are I may not hear him enter right away, and I don't want to be killed while trying to get my gun unlocked, time is not your friend here...and any safe will slow down your reaction time, and no one has ever lost a fight because they were too prepared. Why not secure the gun when you're not going to be around to prevent accidents if she did decide to go against what you've taught her and mess with it? I'm assuming you're a military man by your screen name. I'm speaking from experience when I say I know there are times you're probably gone for extended periods. I would also ensure that your wife knows how to use a gun in case she needs to defend herself and your daughter while you're away. Again, I mean no offense here but still, I would suggest talking with your daughter, at 12 years old she should be smart enough to make the connection of what you're teaching her. If she has been taught to respect firearms and be safe with them then you should not have a problem explaining to her that it is important for you to be able to protect your family. Either way you go, be safe out there.
"They're on our right, they're on our left, they're in front of us, they're behind us; they can't get away from us this time."
Chesty Puller, USMC, Chosin Reservoir, Korean War
"You cannot exaggerate about the Marines. They are convinced to the point of arrogance, that they are the most ferocious fighters on earth - and the amusing thing about it is that they are."
- Father Kevin Keaney, 1st MarDiv Chaplain, Korean War