/* /admin.menumex.online/style.css (النسخة الاحترافية للموبايل) */

/* 1. إعدادات المتغيرات والـ RTL (كما هي) */
:root {
    --primary-color: #007bff;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --bg-color: #f0f2f5;
    --text-color: #333;
    --border-color: #dee2e6;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
}

html { direction: rtl; }

body {
    font-family: 'Tahoma', Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
}

* { box-sizing: border-box; }

/* 2. تصميم شاشة تسجيل الدخول (كما هي) */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.login-box { background: #fff; padding: 2.5rem; border-radius: 10px; box-shadow: var(--shadow); width: 100%; max-width: 450px; text-align: center; }
.login-box h2 { margin-top: 0; margin-bottom: 2rem; color: var(--dark-color); }

/* 3. تصميم المكونات (Forms, Buttons) (كما هي) */
.form-group { margin-bottom: 1.5rem; text-align: right; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-control { width: 100%; padding: 0.75rem 1rem; font-size: 1rem; border: 1px solid var(--border-color); border-radius: 5px; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0,123,255,0.1); }
.btn { display: inline-block; width: 100%; padding: 0.75rem 1rem; font-size: 1.1rem; font-weight: 600; color: #fff; background-color: var(--primary-color); border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.2s; }
.btn:hover { background-color: #0056b3; }
.message { margin-top: 1rem; font-size: 0.9rem; padding: 10px; border-radius: 5px; }
.message.error { color: #721c24; background: #f8d7da; }
.message.success { color: #155724; background: #d4edda; }

/* 4. تصميم الداشبورد (اللوحة الرئيسية) (كما هي) */
#sidebar {
    width: 250px;
    background: var(--dark-color);
    color: var(--light-color);
    position: fixed;
    top: 0;
    right: 0; 
    height: 100%;
    padding-top: 20px;
    transition: transform 0.3s ease-in-out;
    z-index: 1001; /* فوق كل شيء ما عدا الغطاء */
}

#sidebar .logo { text-align: center; font-size: 1.5rem; padding-bottom: 20px; border-bottom: 1px solid #4a4a4a; }
#sidebar-nav { list-style: none; padding: 0; margin: 20px 0; }
#sidebar-nav li { padding: 15px 25px; cursor: pointer; font-size: 1.1rem; }
#sidebar-nav li:hover, #sidebar-nav li.active { background: var(--primary-color); }

#content { margin-right: 250px; margin-left: 0; padding: 30px; transition: margin-right 0.3s ease; }
.module { display: none; }
.module.active { display: block; }
.card { background: #fff; padding: 25px; border-radius: 10px; box-shadow: var(--shadow); }
.card-header { border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.card-header h2 { margin: 0; }

/* 5. تصميم الجداول (كما هي) */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { border: 1px solid var(--border-color); padding: 12px 15px; text-align: right; }
th { background: var(--light-color); font-weight: 600; }
button { background: #28a745; color: white; padding: 5px 10px; border: none; cursor: pointer; border-radius: 4px; }
button.reject { background: #dc3545; }

/* 6. [جديد] تصميم زر القائمة (الهامبرغر) والغطاء */
.menu-toggle {
    display: none; /* مخفي على الكمبيوتر */
    position: fixed;
    top: 15px;
    right: 20px; /* في اليمين (RTL) */
    background: var(--dark-color);
    color: white;
    border: none;
    font-size: 24px;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1002; /* فوق كل شيء */
}

#overlay {
    display: none; /* مخفي افتراضياً */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* غطاء داكن */
    z-index: 1000; /* خلف القائمة */
}

.close-btn {
    display: none; /* مخفي على الكمبيوتر */
    position: absolute;
    top: 10px;
    left: 20px; /* في اليسار (RTL) */
    font-size: 30px;
    color: white;
    text-decoration: none;
}

/* 7. [تعديل] تصميم متجاوب (Responsive) للموبايل */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* إظهار زر الهامبرغر */
    }

    #sidebar {
        /* إخفاء القائمة الجانبية (خارج الشاشة) */
        transform: translateX(250px); 
    }

    #sidebar.open {
        /* إظهار القائمة عند الضغط (تنزلق للداخل) */
        transform: translateX(0);
    }

    .close-btn {
        display: block; /* إظهار زر الإغلاق داخل القائمة */
    }

    #content {
        /* جعل المحتوى يأخذ الشاشة كاملة */
        margin-right: 0;
        padding: 20px;
        padding-top: 80px; /* ترك مسافة للزر */
    }

    #overlay.active {
        display: block; /* إظهار الغطاء الداكن */
    }

    .login-box { padding: 1.5rem; }
}
