@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap');
* { box-sizing: border-box; font-family: 'Tajawal', sans-serif; margin: 0; padding: 0; }
body { direction: rtl; background-color: #f0f2f5; color: #333; }
.navbar { background: #1a237e; color: white; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.container { max-width: 1400px; margin: 30px auto; padding: 0 20px; }
.card { background: white; border-radius: 10px; padding: 20px; margin-bottom: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.card-title { border-bottom: 2px solid #f0f2f5; padding-bottom: 10px; margin-bottom: 20px; color: #1a237e; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #555; }
.form-control { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; }
.btn { padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; text-decoration: none; display: inline-block; color: white;}
.btn-primary { background: #1a237e; } 
.btn-success { background: #00c853; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px; text-align: right; border-bottom: 1px solid #eee; vertical-align: top; }
table th { background: #f8f9fa; }
.report-grid { display: flex; gap: 15px; align-items: flex-end; flex-wrap: wrap; }
.stats-cards { display: flex; gap: 15px; margin-top: 15px; }
.stat-box { flex: 1; padding: 15px; border-radius: 8px; text-align: center; color: white; font-weight: bold; }
/* تصميم المودل الجديد لعرض الملفات */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.modal-content { background: #fff; margin: 10% auto; padding: 20px; width: 400px; border-radius: 8px; }
.close { color: #aaa; float: left; font-size: 28px; cursor: pointer; }
.file-link { display: block; padding: 10px; background: #f1f3f5; margin-bottom: 10px; border-radius: 5px; text-decoration: none; color: #1a237e; font-weight: bold; }
.file-link:hover { background: #e2e6ea; }




/* =========================================
   تنسيقات تطبيق الموبايل (PWA Mobile UI)
   ========================================= */

/* منع تحديد النصوص وتأثير النقر الأزرق المزعج */
body {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* السماح بالكتابة وتحديد النصوص فقط داخل حقول الإدخال */
input, textarea, select {
    -webkit-user-select: auto;
    user-select: auto;
}

/* ترتيب العناصر عندما تكون الشاشة بحجم الموبايل (أقل من 768 بكسل) */
@media (max-width: 768px) {
    /* ترتيب شريط التنقل العلوي (Navbar) */
    .navbar {
        flex-direction: column !important;
        text-align: center;
        gap: 15px;
        padding: 15px !important;
    }
    
    .navbar div {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .navbar .btn {
        margin-left: 0 !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* ترتيب الكاردات والإحصائيات لتصبح عمودية */
    .report-grid, .stats-cards {
        flex-direction: column !important;
    }

    /* جعل الحقول والأزرار تملأ الشاشة بالكامل */
    .form-group, .stat-box {
        width: 100% !important;
        min-width: 100% !important;
        margin-bottom: 10px;
        box-sizing: border-box;
    }

    /* تقليل الهوامش الجانبية للكاردات في الموبايل */
    .card {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    /* جعل الجدول قابل للتمرير الجانبي بسلاسة في الموبايل */
    table {
        min-width: 600px; /* لضمان عدم تداخل النصوص */
    }
}