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 
 
 
 
 
 
 
 
 
 
 
4f27cbb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>نظام إدارة مدرسة النور</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');
        
        :root {
            --primary-color: #1a5632;
            --secondary-color: #f7c948;
            --accent-color: #2e7d32;
        }
        
        body {
            font-family: 'Tajawal', sans-serif;
            transition: all 0.3s ease;
        }
        
        [dir="rtl"] body {
            font-family: 'Tajawal', sans-serif;
        }
        
        [dir="ltr"] body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        .sidebar {
            transition: all 0.3s ease;
            background-color: var(--primary-color);
        }
        
        .sidebar.collapsed {
            width: 80px;
        }
        
        .sidebar.collapsed .menu-text {
            display: none;
        }
        
        .sidebar.collapsed .logo-text {
            display: none;
        }
        
        .content-area {
            transition: all 0.3s ease;
        }
        
        .content-area.expanded {
            margin-right: 80px;
        }
        
        [dir="rtl"] .rotate-180 {
            transform: rotate(180deg);
        }
        
        [dir="ltr"] .content-area.expanded {
            margin-right: 0;
            margin-left: 80px;
        }
        
        .dropdown-menu {
            display: none;
        }
        
        .dropdown-menu.show {
            display: block;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }
        
        .btn-primary:hover {
            background-color: #134826;
        }
        
        .btn-secondary {
            background-color: var(--secondary-color);
            color: #333;
        }
        
        .btn-secondary:hover {
            background-color: #e6b722;
        }
        
        .text-primary {
            color: var(--primary-color);
        }
        
        .bg-primary {
            background-color: var(--primary-color);
        }
        
        .border-primary {
            border-color: var(--primary-color);
        }
        
        /* PWA Styles */
        #installContainer {
            position: fixed;
            bottom: 1em;
            left: 50%;
            transform: translateX(-50%);
            z-index: 100;
            display: none;
        }
        
        #installButton {
            background-color: var(--primary-color);
            color: white;
            padding: 0.75em 1.5em;
            border-radius: 5px;
            font-weight: bold;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }
        
        /* Offline notification */
        #offlineNotification {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background-color: #ff9800;
            color: white;
            text-align: center;
            padding: 10px;
            z-index: 1000;
            display: none;
        }
        
        /* Mobile menu */
        #mobileMenuButton {
            display: none;
        }
        
        @media (max-width: 768px) {
            #mobileMenuButton {
                display: block;
            }
            
            .sidebar {
                position: fixed;
                z-index: 1000;
                transform: translateX(100%);
                transition: transform 0.3s ease;
            }
            
            .sidebar.open {
                transform: translateX(0);
            }
            
            .content-area {
                margin-right: 0 !important;
            }
            
            .content-area.expanded {
                margin-left: 0 !important;
            }
        }
        
        /* Data table styles */
        .data-table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .data-table th, .data-table td {
            padding: 12px 15px;
            text-align: right;
            border-bottom: 1px solid #e5e7eb;
        }
        
        .data-table th {
            background-color: #f9fafb;
            font-weight: 600;
            color: #374151;
        }
        
        .data-table tr:hover {
            background-color: #f3f4f6;
        }
        
        /* Form styles */
        .form-group {
            margin-bottom: 1.5rem;
        }
        
        .form-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: #374151;
        }
        
        .form-control {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            transition: border-color 0.15s ease-in-out;
        }
        
        .form-control:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(26, 86, 50, 0.1);
        }
        
        /* Progress bar */
        .progress-container {
            width: 100%;
            height: 8px;
            background-color: #e5e7eb;
            border-radius: 4px;
            overflow: hidden;
        }
        
        .progress-bar {
            height: 100%;
            background-color: var(--primary-color);
            transition: width 0.3s ease;
        }
        
        /* Quran memorization tracker */
        .juz-container {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
        }
        
        .juz-box {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .juz-box:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        
        .juz-box.completed {
            background-color: #d1fae5;
            border-color: #34d399;
        }
        
        .juz-box.in-progress {
            background-color: #fef3c7;
            border-color: #f59e0b;
        }
        
        .juz-box.not-started {
            background-color: #f3f4f6;
            border-color: #e5e7eb;
        }
        
        /* Attendance status */
        .attendance-present {
            color: #10b981;
        }
        
        .attendance-absent {
            color: #ef4444;
        }
        
        .attendance-late {
            color: #f59e0b;
        }
        
        /* Financial status */
        .payment-paid {
            color: #10b981;
        }
        
        .payment-pending {
            color: #f59e0b;
        }
        
        .payment-overdue {
            color: #ef4444;
        }
    </style>
</head>
<body class="bg-gray-50 text-gray-800">
    <!-- Offline Notification -->
    <div id="offlineNotification">
        أنت الآن غير متصل بالإنترنت. سيتم حفظ التغييرات عند اتصالك مرة أخرى.
    </div>
    
    <!-- Install PWA Prompt -->
    <div id="installContainer">
        <button id="installButton" class="btn-primary">
            <i class="fas fa-download mr-2"></i>
            <span id="installText">تثبيت التطبيق</span>
        </button>
    </div>
    
    <div class="flex h-screen overflow-hidden">
        <!-- Mobile Menu Button -->
        <button id="mobileMenuButton" class="md:hidden fixed top-4 left-4 z-50 bg-white p-2 rounded-full shadow-lg">
            <i class="fas fa-bars text-xl text-primary"></i>
        </button>
        
        <!-- Sidebar -->
        <div id="sidebar" class="sidebar bg-primary text-white w-64 flex flex-col fixed h-full">
            <!-- Logo -->
            <div class="p-4 flex items-center justify-between border-b border-green-700">
                <div class="flex items-center">
                    <i class="fas fa-mosque text-2xl text-yellow-300"></i>
                    <span class="logo-text mr-2 text-xl font-bold">مدرسة النور</span>
                </div>
                <button id="toggleSidebar" class="text-white focus:outline-none hidden md:block">
                    <i class="fas fa-chevron-right"></i>
                </button>
            </div>
            
            <!-- User Profile -->
            <div class="p-4 flex items-center border-b border-green-700">
                <img src="https://via.placeholder.com/50" alt="User" class="rounded-full w-10 h-10">
                <div class="mr-3 menu-text">
                    <div class="font-medium" id="userName">الأستاذ أحمد</div>
                    <div class="text-xs text-green-200" id="userRole">مدير المدرسة</div>
                </div>
            </div>
            
            <!-- Main Menu -->
            <nav class="flex-1 overflow-y-auto">
                <ul class="py-2">
                    <li>
                        <a href="#" class="flex items-center p-3 hover:bg-green-700" data-page="dashboard">
                            <i class="fas fa-home text-yellow-300"></i>
                            <span class="menu-text mr-3" data-i18n="menu.home">الرئيسية</span>
                        </a>
                    </li>
                    
                    <!-- Students Dropdown -->
                    <li>
                        <div class="dropdown">
                            <button onclick="toggleDropdown('students')" class="w-full flex items-center justify-between p-3 hover:bg-green-700">
                                <div class="flex items-center">
                                    <i class="fas fa-users text-yellow-300"></i>
                                    <span class="menu-text mr-3" data-i18n="menu.students">الطلاب</span>
                                </div>
                                <i class="fas fa-chevron-down text-xs"></i>
                            </button>
                            <ul id="students" class="dropdown-menu bg-green-900">
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="students-list" data-i18n="menu.studentsList">قائمة الطلاب</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="add-student" data-i18n="menu.addStudent">تسجيل طالب جديد</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="attendance" data-i18n="menu.attendance">تقارير الحضور</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="student-groups" data-i18n="menu.studentGroups">مجموعات الطلاب</a></li>
                            </ul>
                        </div>
                    </li>
                    
                    <!-- Teachers Dropdown -->
                    <li>
                        <div class="dropdown">
                            <button onclick="toggleDropdown('teachers')" class="w-full flex items-center justify-between p-3 hover:bg-green-700">
                                <div class="flex items-center">
                                    <i class="fas fa-chalkboard-teacher text-yellow-300"></i>
                                    <span class="menu-text mr-3" data-i18n="menu.teachers">المعلمين</span>
                                </div>
                                <i class="fas fa-chevron-down text-xs"></i>
                            </button>
                            <ul id="teachers" class="dropdown-menu bg-green-900">
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="teachers-list" data-i18n="menu.teachersList">قائمة المعلمين</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="add-teacher" data-i18n="menu.addTeacher">إضافة معلم جديد</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="schedule" data-i18n="menu.schedule">جدول الحصص</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="teacher-attendance" data-i18n="menu.teacherAttendance">حضور المعلمين</a></li>
                            </ul>
                        </div>
                    </li>
                    
                    <!-- Quran Dropdown -->
                    <li>
                        <div class="dropdown">
                            <button onclick="toggleDropdown('quran')" class="w-full flex items-center justify-between p-3 hover:bg-green-700">
                                <div class="flex items-center">
                                    <i class="fas fa-quran text-yellow-300"></i>
                                    <span class="menu-text mr-3" data-i18n="menu.quran">القرآن الكريم</span>
                                </div>
                                <i class="fas fa-chevron-down text-xs"></i>
                            </button>
                            <ul id="quran" class="dropdown-menu bg-green-900">
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="memorization" data-i18n="menu.memorization">سجل الحفظ</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="recitation" data-i18n="menu.recitation">اختبارات التلاوة</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="tracking" data-i18n="menu.tracking">متابعة الحفظ</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="quran-tests" data-i18n="menu.quranTests">اختبارات القرآن</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="quran-levels" data-i18n="menu.quranLevels">مستويات الحفظ</a></li>
                            </ul>
                        </div>
                    </li>
                    
                    <!-- Islamic Studies Dropdown -->
                    <li>
                        <div class="dropdown">
                            <button onclick="toggleDropdown('islamic')" class="w-full flex items-center justify-between p-3 hover:bg-green-700">
                                <div class="flex items-center">
                                    <i class="fas fa-mosque text-yellow-300"></i>
                                    <span class="menu-text mr-3" data-i18n="menu.islamic">التربية الإسلامية</span>
                                </div>
                                <i class="fas fa-chevron-down text-xs"></i>
                            </button>
                            <ul id="islamic" class="dropdown-menu bg-green-900">
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="lessons" data-i18n="menu.lessons">الدروس</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="exams" data-i18n="menu.exams">الاختبارات</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="activities" data-i18n="menu.activities">الأنشطة</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="islamic-curriculum" data-i18n="menu.islamicCurriculum">المنهج الدراسي</a></li>
                            </ul>
                        </div>
                    </li>
                    
                    <!-- Arabic Language Dropdown -->
                    <li>
                        <div class="dropdown">
                            <button onclick="toggleDropdown('arabic')" class="w-full flex items-center justify-between p-3 hover:bg-green-700">
                                <div class="flex items-center">
                                    <i class="fas fa-language text-yellow-300"></i>
                                    <span class="menu-text mr-3" data-i18n="menu.arabic">اللغة العربية</span>
                                </div>
                                <i class="fas fa-chevron-down text-xs"></i>
                            </button>
                            <ul id="arabic" class="dropdown-menu bg-green-900">
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="courses" data-i18n="menu.courses">المقررات</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="homework" data-i18n="menu.homework">الواجبات</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="assessments" data-i18n="menu.assessments">التقييمات</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="arabic-levels" data-i18n="menu.arabicLevels">مستويات اللغة</a></li>
                            </ul>
                        </div>
                    </li>
                    
                    <!-- Financial Dropdown -->
                    <li>
                        <div class="dropdown">
                            <button onclick="toggleDropdown('financial')" class="w-full flex items-center justify-between p-3 hover:bg-green-700">
                                <div class="flex items-center">
                                    <i class="fas fa-money-bill-wave text-yellow-300"></i>
                                    <span class="menu-text mr-3" data-i18n="menu.financial">الشؤون المالية</span>
                                </div>
                                <i class="fas fa-chevron-down text-xs"></i>
                            </button>
                            <ul id="financial" class="dropdown-menu bg-green-900">
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="tuition" data-i18n="menu.tuition">الرسوم الدراسية</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="payments" data-i18n="menu.payments">سجل المدفوعات</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="reports" data-i18n="menu.financialReports">التقارير المالية</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="expenses" data-i18n="menu.expenses">المصروفات</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="invoices" data-i18n="menu.invoices">الفواتير</a></li>
                            </ul>
                        </div>
                    </li>
                    
                    <!-- Reports Dropdown -->
                    <li>
                        <div class="dropdown">
                            <button onclick="toggleDropdown('reports')" class="w-full flex items-center justify-between p-3 hover:bg-green-700">
                                <div class="flex items-center">
                                    <i class="fas fa-chart-bar text-yellow-300"></i>
                                    <span class="menu-text mr-3" data-i18n="menu.reports">التقارير</span>
                                </div>
                                <i class="fas fa-chevron-down text-xs"></i>
                            </button>
                            <ul id="reports" class="dropdown-menu bg-green-900">
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="student-reports" data-i18n="menu.studentReports">تقارير الطلاب</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="teacher-reports" data-i18n="menu.teacherReports">تقارير المعلمين</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="quran-reports" data-i18n="menu.quranReports">تقارير القرآن</a></li>
                                <li><a href="#" class="block p-3 pr-8 hover:bg-green-700" data-page="attendance-reports" data-i18n="menu.attendanceReports">تقارير الحضور</a></li>
                            </ul>
                        </div>
                    </li>
                    
                    <!-- Settings -->
                    <li>
                        <a href="#" class="flex items-center p-3 hover:bg-green-700" data-page="settings">
                            <i class="fas fa-cog text-yellow-300"></i>
                            <span class="menu-text mr-3" data-i18n="menu.settings">الإعدادات</span>
                        </a>
                    </li>
                </ul>
            </nav>
            
            <!-- Language and Logout -->
            <div class="p-4 border-t border-green-700">
                <button onclick="toggleLanguage()" class="flex items-center text-white mb-3">
                    <i class="fas fa-globe text-yellow-300"></i>
                    <span class="menu-text mr-3" data-i18n="menu.changeLanguage">تغيير اللغة / Cambiar idioma</span>
                </button>
                <a href="#" class="flex items-center text-white" onclick="logout()">
                    <i class="fas fa-sign-out-alt text-yellow-300"></i>
                    <span class="menu-text mr-3" data-i18n="menu.logout">تسجيل الخروج</span>
                </a>
            </div>
        </div>
        
        <!-- Main Content -->
        <div id="contentArea" class="content-area flex-1 flex flex-col overflow-hidden mr-64">
            <!-- Top Navigation -->
            <header class="bg-white shadow-sm py-4 px-6 flex items-center justify-between">
                <div class="flex items-center">
                    <h1 class="text-xl font-bold text-primary" id="pageTitle" data-i18n="page.dashboard">لوحة التحكم</h1>
                </div>
                
                <div class="flex items-center space-x-4">
                    <div class="relative">
                        <button class="text-gray-600 hover:text-green-800 focus:outline-none" onclick="showNotifications()">
                            <i class="fas fa-bell text-xl"></i>
                            <span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span>
                        </button>
                    </div>
                    <div class="relative">
                        <button class="text-gray-600 hover:text-green-800 focus:outline-none" onclick="showMessages()">
                            <i class="fas fa-envelope text-xl"></i>
                            <span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span>
                        </button>
                    </div>
                    <div class="flex items-center">
                        <img src="https://via.placeholder.com/40" alt="User" class="rounded-full w-8 h-8">
                        <span class="mr-2 font-medium" id="topUserName">الأستاذ أحمد</span>
                    </div>
                </div>
            </header>
            
            <!-- Dynamic Content -->
            <main id="dynamicContent" class="flex-1 overflow-y-auto p-6 bg-gray-50">
                <!-- Dashboard Content will be loaded here dynamically -->
                <div id="dashboardContent">
                    <!-- Stats Cards -->
                    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
                        <div class="bg-white rounded-lg shadow p-6">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-gray-500" data-i18n="stats.students">عدد الطلاب</p>
                                    <h3 class="text-2xl font-bold text-green-800">127</h3>
                                </div>
                                <div class="bg-green-100 p-3 rounded-full">
                                    <i class="fas fa-users text-green-800 text-xl"></i>
                                </div>
                            </div>
                            <p class="text-green-600 text-sm mt-2"><i class="fas fa-arrow-up"></i> <span data-i18n="stats.studentsIncrease">12% عن الشهر الماضي</span></p>
                        </div>
                        
                        <div class="bg-white rounded-lg shadow p-6">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-gray-500" data-i18n="stats.teachers">عدد المعلمين</p>
                                    <h3 class="text-2xl font-bold text-blue-800">8</h3>
                                </div>
                                <div class="bg-blue-100 p-3 rounded-full">
                                    <i class="fas fa-chalkboard-teacher text-blue-800 text-xl"></i>
                                </div>
                            </div>
                            <p class="text-blue-600 text-sm mt-2"><i class="fas fa-arrow-up"></i> <span data-i18n="stats.newTeachers">2 معلم جديد</span></p>
                        </div>
                        
                        <div class="bg-white rounded-lg shadow p-6">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-gray-500" data-i18n="stats.memorization">حفظ القرآن</p>
                                    <h3 class="text-2xl font-bold text-yellow-800">24</h3>
                                </div>
                                <div class="bg-yellow-100 p-3 rounded-full">
                                    <i class="fas fa-quran text-yellow-800 text-xl"></i>
                                </div>
                            </div>
                            <p class="text-yellow-600 text-sm mt-2"><i class="fas fa-arrow-up"></i> <span data-i18n="stats.completedParts">3 طلاب أكملوا جزءاً</span></p>
                        </div>
                        
                        <div class="bg-white rounded-lg shadow p-6">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-gray-500" data-i18n="stats.revenue">الإيرادات الشهرية</p>
                                    <h3 class="text-2xl font-bold text-purple-800">€3,450</h3>
                                </div>
                                <div class="bg-purple-100 p-3 rounded-full">
                                    <i class="fas fa-euro-sign text-purple-800 text-xl"></i>
                                </div>
                            </div>
                            <p class="text-purple-600 text-sm mt-2"><i class="fas fa-arrow-up"></i> <span data-i18n="stats.revenueIncrease">€450 عن الشهر الماضي</span></p>
                        </div>
                    </div>
                    
                    <!-- Recent Activities and Calendar -->
                    <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
                        <div class="lg:col-span-2">
                            <div class="bg-white rounded-lg shadow overflow-hidden">
                                <div class="p-5 border-b border-gray-200">
                                    <h3 class="font-bold text-primary" data-i18n="activity.recent">أحدث الأنشطة</h3>
                                </div>
                                <div class="divide-y divide-gray-200">
                                    <div class="p-4 hover:bg-gray-50">
                                        <div class="flex items-start">
                                            <div class="bg-green-100 p-2 rounded-full mr-3">
                                                <i class="fas fa-user-graduate text-green-800"></i>
                                            </div>
                                            <div>
                                                <p class="font-medium" data-i18n="activity.newStudent">تسجيل طالب جديد</p>
                                                <p class="text-sm text-gray-500" data-i18n="activity.newStudentDesc">تم تسجيل الطالب محمد أحمد في الصف الثالث</p>
                                                <p class="text-xs text-gray-400 mt-1" data-i18n="activity.timeAgo2">منذ ساعتين</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="p-4 hover:bg-gray-50">
                                        <div class="flex items-start">
                                            <div class="bg-blue-100 p-2 rounded-full mr-3">
                                                <i class="fas fa-chalkboard-teacher text-blue-800"></i>
                                            </div>
                                            <div>
                                                <p class="font-medium" data-i18n="activity.newTeacher">إضافة معلم جديد</p>
                                                <p class="text-sm text-gray-500" data-i18n="activity.newTeacherDesc">تم تعيين الأستاذ خالد لتدريس القرآن الكريم</p>
                                                <p class="text-xs text-gray-400 mt-1" data-i18n="activity.timeAgo1">منذ يوم</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="p-4 hover:bg-gray-50">
                                        <div class="flex items-start">
                                            <div class="bg-yellow-100 p-2 rounded-full mr-3">
                                                <i class="fas fa-quran text-yellow-800"></i>
                                            </div>
                                            <div>
                                                <p class="font-medium" data-i18n="activity.memorization">إكمال حفظ جزء</p>
                                                <p class="text-sm text-gray-500" data-i18n="activity.memorizationDesc">الطالبة سارة محمد أكملت حفظ جزء عم</p>
                                                <p class="text-xs text-gray-400 mt-1" data-i18n="activity.timeAgo3">منذ 3 أيام</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="p-4 hover:bg-gray-50">
                                        <div class="flex items-start">
                                            <div class="bg-purple-100 p-2 rounded-full mr-3">
                                                <i class="fas fa-euro-sign text-purple-800"></i>
                                            </div>
                                            <div>
                                                <p class="font-medium" data-i18n="activity.payment">دفع رسوم دراسية</p>
                                                <p class="text-sm text-gray-500" data-i18n="activity.paymentDesc">تم استلام رسوم الطالب يوسف أحمد لشهر يونيو</p>
                                                <p class="text-xs text-gray-400 mt-1" data-i18n="activity.timeAgo4">منذ 4 أيام</p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="p-4 bg-gray-50 text-center">
                                    <a href="#" class="text-primary font-medium" data-i18n="activity.viewAll">عرض جميع الأنشطة</a>
                                </div>
                            </div>
                        </div>
                        
                        <div>
                            <div class="bg-white rounded-lg shadow overflow-hidden">
                                <div class="p-5 border-b border-gray-200">
                                    <div class="flex justify-between items-center">
                                        <h3 class="font-bold text-primary" data-i18n="calendar.title">التقويم</h3>
                                        <div class="flex space-x-2">
                                            <button class="p-1 rounded-full hover:bg-gray-100" onclick="nextMonth()">
                                                <i class="fas fa-chevron-right"></i>
                                            </button>
                                            <button class="p-1 rounded-full hover:bg-gray-100" onclick="prevMonth()">
                                                <i class="fas fa-chevron-left"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                                <div class="p-4">
                                    <div class="grid grid-cols-7 gap-1 mb-2">
                                        <div class="text-center font-medium text-gray-500 text-sm" data-i18n="calendar.sun">أح</div>
                                        <div class="text-center font-medium text-gray-500 text-sm" data-i18n="calendar.mon">إث</div>
                                        <div class="text-center font-medium text-gray-500 text-sm" data-i18n="calendar.tue">ث</div>
                                        <div class="text-center font-medium text-gray-500 text-sm" data-i18n="calendar.wed">أر</div>
                                        <div class="text-center font-medium text-gray-500 text-sm" data-i18n="calendar.thu">خ</div>
                                        <div class="text-center font-medium text-gray-500 text-sm" data-i18n="calendar.fri">ج</div>
                                        <div class="text-center font-medium text-gray-500 text-sm" data-i18n="calendar.sat">س</div>
                                    </div>
                                    <div id="calendarDays" class="grid grid-cols-7 gap-1">
                                        <!-- Calendar days will be generated by JavaScript -->
                                    </div>
                                    <div class="mt-4 border-t border-gray-200 pt-4">
                                        <div class="flex items-center mb-2">
                                            <div class="w-3 h-3 bg-green-500 rounded-full mr-2"></div>
                                            <span class="text-sm" data-i18n="calendar.event1">اختبار حفظ - الجزء الثلاثون</span>
                                        </div>
                                        <div class="flex items-center">
                                            <div class="w-3 h-3 bg-blue-500 rounded-full mr-2"></div>
                                            <span class="text-sm" data-i18n="calendar.event2">اجتماع أولياء الأمور</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Upcoming Events -->
                    <div class="mt-6">
                        <div class="bg-white rounded-lg shadow overflow-hidden">
                            <div class="p-5 border-b border-gray-200">
                                <h3 class="font-bold text-primary" data-i18n="events.upcoming">الأحداث القادمة</h3>
                            </div>
                            <div class="divide-y divide-gray-200">
                                <div class="p-4 hover:bg-gray-50">
                                    <div class="flex items-start">
                                        <div class="bg-green-100 p-3 rounded-lg mr-3 text-center">
                                            <div class="font-bold text-green-800">17</div>
                                            <div class="text-xs text-green-600" data-i18n="month.june">يونيو</div>
                                        </div>
                                        <div>
                                            <p class="font-medium" data-i18n="events.exam">اختبار حفظ الجزء الثلاثون</p>
                                            <p class="text-sm text-gray-500" data-i18n="events.examDesc">لطلاب المستوى الثالث - قاعة القرآن الكريم</p>
                                            <p class="text-xs text-gray-400 mt-1">10:00 ص - 12:00 م</p>
                                        </div>
                                    </div>
                                </div>
                                <div class="p-4 hover:bg-gray-50">
                                    <div class="flex items-start">
                                        <div class="bg-blue-100 p-3 rounded-lg mr-3 text-center">
                                            <div class="font-bold text-blue-800">24</div>
                                            <div class="text-xs text-blue-600" data-i18n="month.june">يونيو</div>
                                        </div>
                                        <div>
                                            <p class="font-medium" data-i18n="events.meeting">اجتماع أولياء الأمور</p>
                                            <p class="text-sm text-gray-500" data-i18n="events.meetingDesc">لمناقشة تطور الطلاب وخطط الفصل القادم</p>
                                            <p class="text-xs text-gray-400 mt-1">5:00 م - 7:00 م</p>
                                        </div>
                                    </div>
                                </div>
                                <div class="p-4 hover:bg-gray-50">
                                    <div class="flex items-start">
                                        <div class="bg-purple-100 p-3 rounded-lg mr-3 text-center">
                                            <div class="font-bold text-purple-800">30</div>
                                            <div class="text-xs text-purple-600" data-i18n="month.june">يونيو</div>
                                        </div>
                                        <div>
                                            <p class="font-medium" data-i18n="events.graduation">حفل تخريج الدفعة الخامسة</p>
                                            <p class="text-sm text-gray-500" data-i18n="events.graduationDesc">لطلاب الصف السادس الذين أكملوا حفظ 5 أجزاء</p>
                                            <p class="text-xs text-gray-400 mt-1">6:00 م - 8:00 م</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Other pages content will be loaded here dynamically -->
                <div id="otherPagesContent" style="display: none;"></div>
            </main>
        </div>
    </div>

    <!-- Login Modal -->
    <div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-md">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-primary" data-i18n="login.title">تسجيل الدخول</h3>
                <button onclick="closeModal('loginModal')" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <form id="loginForm">
                <div class="mb-4">
                    <label for="username" class="block text-gray-700 mb-2" data-i18n="login.username">اسم المستخدم</label>
                    <input type="text" id="username" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary">
                </div>
                <div class="mb-4">
                    <label for="password" class="block text-gray-700 mb-2" data-i18n="login.password">كلمة المرور</label>
                    <input type="password" id="password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary">
                </div>
                <div class="mb-4 flex items-center">
                    <input type="checkbox" id="remember" class="mr-2">
                    <label for="remember" class="text-gray-700" data-i18n="login.remember">تذكرني</label>
                </div>
                <button type="submit" class="w-full bg-primary text-white py-2 px-4 rounded-md hover:bg-green-700 transition duration-300" data-i18n="login.submit">تسجيل الدخول</button>
            </form>
        </div>
    </div>

    <!-- Notifications Modal -->
    <div id="notificationsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-md">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-primary" data-i18n="notifications.title">الإشعارات</h3>
                <button onclick="closeModal('notificationsModal')" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="divide-y divide-gray-200 max-h-96 overflow-y-auto">
                <div class="py-3">
                    <div class="flex items-start">
                        <div class="bg-green-100 p-2 rounded-full mr-3">
                            <i class="fas fa-user-graduate text-green-800"></i>
                        </div>
                        <div>
                            <p class="font-medium" data-i18n="notifications.newStudent">تسجيل طالب جديد</p>
                            <p class="text-sm text-gray-500" data-i18n="notifications.newStudentDesc">تم تسجيل الطالب محمد أحمد في الصف الثالث</p>
                            <p class="text-xs text-gray-400 mt-1" data-i18n="notifications.timeAgo2">منذ ساعتين</p>
                        </div>
                    </div>
                </div>
                <div class="py-3">
                    <div class="Flex items-start">
                        <div class="bg-blue-100 p-2 rounded-full mr-3">
                            <i class="fas fa-chalkboard-teacher text-blue-800"></i>
                        </div>
                        <div>
                            <p class="font-medium" data-i18n="notifications.newTeacher">إضافة معلم جديد</p>
                            <p class="text-sm text-gray-500" data-i18n="notifications.newTeacherDesc">تم تعيين الأستاذ خالد لتدريس القرآن الكريم</p>
                            <p class="text-xs text-gray-400 mt-1" data-i18n="notifications.timeAgo1">منذ يوم</p>
                        </div>
                    </div>
                </div>
                <div class="py-3">
                    <div class="flex items-start">
                        <div class="bg-yellow-100 p-2 rounded-full mr-3">
                            <i class="fas fa-quran text-yellow-800"></i>
                        </div>
                        <div>
                            <p class="font-medium" data-i18n="notifications.memorization">إكمال حفظ جزء</p>
                            <p class="text-sm text-gray-500" data-i18n="notifications.memorizationDesc">الطالبة سارة محمد أكملت حفظ جزء عم</p>
                            <p class="text-xs text-gray-400 mt-1" data-i18n="notifications.timeAgo3">منذ 3 أيام</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Messages Modal -->
    <div id="messagesModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-md">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-primary" data-i18n="messages.title">الرسائل</h3>
                <button onclick="closeModal('messagesModal')" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="divide-y divide-gray-200 max-h-96 overflow-y-auto">
                <div class="py-3 hover:bg-gray-50 cursor-pointer">
                    <div class="flex items-start">
                        <img src="https://via.placeholder.com/40" alt="Sender" class="rounded-full w-10 h-10 mr-3">
                        <div>
                            <div class="flex justify-between">
                                <p class="font-medium">أحمد محمد</p>
                                <p class="text-xs text-gray-400" data-i18n="messages.timeAgo1">منذ يوم</p>
                            </div>
                            <p class="text-sm text-gray-500 truncate" data-i18n="messages.message1">هل يمكنني الحصول على تقرير عن مستوى ابني في الحفظ؟</p>
                        </div>
                    </div>
                </div>
                <div class="py-3 hover:bg-gray-50 cursor-pointer">
                    <div class="flex items-start">
                        <img src="https://via.placeholder.com/40" alt="Sender" class="rounded-full w-10 h-10 mr-3">
                        <div>
                            <div class="flex justify-between">
                                <p class="font-medium">الأستاذ خالد</p>
                                <p class="text-xs text-gray-400" data-i18n="messages.timeAgo2">منذ 3 أيام</p>
                            </div>
                            <p class="text-sm text-gray-500 truncate" data-i18n="messages.message2">أحتاج إلى تأجيل حصة يوم الخميس بسبب ظرف طارئ</p>
                        </div>
                    </div>
                </div>
                <div class="py-3 hover:bg-gray-50 cursor-pointer">
                    <div class="flex items-start">
                        <img src="https://via.placeholder.com/40" alt="Sender" class="rounded-full w-10 h-10 mr-3">
                        <div>
                            <div class="flex justify-between">
                                <p class="font-medium">إدارة المدرسة</p>
                                <p class="text-xs text-gray-400" data-i18n="messages.timeAgo3">منذ أسبوع</p>
                            </div>
                            <p class="text-sm text-gray-500 truncate" data-i18n="messages.message3">تذكير: اجتماع المعلمين يوم السبت القادم</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Add Student Modal -->
    <div id="addStudentModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-2xl">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-primary" data-i18n="student.addTitle">تسجيل طالب جديد</h3>
                <button onclick="closeModal('addStudentModal')" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <form id="addStudentForm">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                    <div class="form-group">
                        <label for="studentName" class="form-label" data-i18n="student.name">الاسم الكامل</label>
                        <input type="text" id="studentName" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="studentBirthdate" class="form-label" data-i18n="student.birthdate">تاريخ الميلاد</label>
                        <input type="date" id="studentBirthdate" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="studentGender" class="form-label" data-i18n="student.gender">الجنس</label>
                        <select id="studentGender" class="form-control" required>
                            <option value="" selected disabled data-i18n="student.selectGender">اختر الجنس</option>
                            <option value="male" data-i18n="student.male">ذكر</option>
                            <option value="female" data-i18n="student.female">أنثى</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="studentLevel" class="form-label" data-i18n="student.level">المستوى</label>
                        <select id="studentLevel" class="form-control" required>
                            <option value="" selected disabled data-i18n="student.selectLevel">اختر المستوى</option>
                            <option value="1" data-i18n="student.level1">المستوى الأول</option>
                            <option value="2" data-i18n="student.level2">المستوى الثاني</option>
                            <option value="3" data-i18n="student.level3">المستوى الثالث</option>
                            <option value="4" data-i18n="student.level4">المستوى الرابع</option>
                            <option value="5" data-i18n="student.level5">المستوى الخامس</option>
                            <option value="6" data-i18n="student.level6">المستوى السادس</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="studentGroup" class="form-label" data-i18n="student.group">المجموعة</label>
                        <select id="studentGroup" class="form-control" required>
                            <option value="" selected disabled data-i18n="student.selectGroup">اختر المجموعة</option>
                            <option value="1" data-i18n="student.group1">المجموعة أ</option>
                            <option value="2" data-i18n="student.group2">المجموعة ب</option>
                            <option value="3" data-i18n="student.group3">المجموعة ج</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="studentPhone" class="form-label" data-i18n="student.phone">رقم الهاتف</label>
                        <input type="tel" id="studentPhone" class="form-control">
                    </div>
                    <div class="form-group">
                        <label for="studentAddress" class="form-label" data-i18n="student.address">العنوان</label>
                        <input type="text" id="studentAddress" class="form-control">
                    </div>
                    <div class="form-group">
                        <label for="studentParent" class="form-label" data-i18n="student.parent">ولي الأمر</label>
                        <input type="text" id="studentParent" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="studentParentPhone" class="form-label" data-i18n="student.parentPhone">هاتف ولي الأمر</label>
                        <input type="tel" id="studentParentPhone" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="studentJoinDate" class="form-label" data-i18n="student.joinDate">تاريخ الالتحاق</label>
                        <input type="date" id="studentJoinDate" class="form-control" required>
                    </div>
                </div>
                <div class="mt-6 flex justify-end space-x-3">
                    <button type="button" onclick="closeModal('addStudentModal')" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50" data-i18n="common.cancel">إلغاء</button>
                    <button type="submit" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-green-700" data-i18n="common.save">حفظ</button>
                </div>
            </form>
        </div>
    </div>

    <!-- Add Teacher Modal -->
    <div id="addTeacherModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-2xl">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-primary" data-i18n="teacher.addTitle">إضافة معلم جديد</h3>
                <button onclick="closeModal('addTeacherModal')" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <form id="addTeacherForm">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                    <div class="form-group">
                        <label for="teacherName" class="form-label" data-i18n="teacher.name">الاسم الكامل</label>
                        <input type="text" id="teacherName" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="teacherBirthdate" class="form-label" data-i18n="teacher.birthdate">تاريخ الميلاد</label>
                        <input type="date" id="teacherBirthdate" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="teacherGender" class="form-label" data-i18n="teacher.gender">الجنس</label>
                        <select id="teacherGender" class="form-control" required>
                            <option value="" selected disabled data-i18n="teacher.selectGender">اختر الجنس</option>
                            <option value="male" data-i18n="teacher.male">ذكر</option>
                            <option value="female" data-i18n="teacher.female">أنثى</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="teacherSpecialization" class="form-label" data-i18n="teacher.specialization">التخصص</label>
                        <select id="teacherSpecialization" class="form-control" required>
                            <option value="" selected disabled data-i18n="teacher.selectSpecialization">اختر التخصص</option>
                            <option value="quran" data-i18n="teacher.quran">القرآن الكريم</option>
                            <option value="islamic" data-i18n="teacher.islamic">التربية الإسلامية</option>
                            <option value="arabic" data-i18n="teacher.arabic">اللغة العربية</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="teacherQualification" class="form-label" data-i18n="teacher.qualification">المؤهل العلمي</label>
                        <input type="text" id="teacherQualification" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="teacherPhone" class="form-label" data-i18n="teacher.phone">رقم الهاتف</label>
                        <input type="tel" id="teacherPhone" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="teacherAddress" class="form-label" data-i18n="teacher.address">العنوان</label>
                        <input type="text" id="teacherAddress" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="teacherJoinDate" class="form-label" data-i18n="teacher.joinDate">تاريخ التعيين</label>
                        <input type="date" id="teacherJoinDate" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="teacherSalary" class="form-label" data-i18n="teacher.salary">الراتب</label>
                        <input type="number" id="teacherSalary" class="form-control" required>
                    </div>
                </div>
                <div class="mt-6 flex justify-end space-x-3">
                    <button type="button" onclick="closeModal('addTeacherModal')" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50" data-i18n="common.cancel">إلغاء</button>
                    <button type="submit" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-green-700" data-i18n="common.save">حفظ</button>
                </div>
            </form>
        </div>
    </div>

    <!-- Quran Memorization Modal -->
    <div id="quranMemorizationModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-2xl">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-primary" data-i18n="quran.memorizationTitle">تسجيل حفظ جديد</h3>
                <button onclick="closeModal('quranMemorizationModal')" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <form id="quranMemorizationForm">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                    <div class="form-group">
                        <label for="memorizationStudent" class="form-label" data-i18n="quran.student">الطالب</label>
                        <select id="memorizationStudent" class="form-control" required>
                            <option value="" selected disabled data-i18n="quran.selectStudent">اختر الطالب</option>
                            <!-- Students will be populated by JavaScript -->
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="memorizationJuz" class="form-label" data-i18n="quran.juz">الجزء</label>
                        <select id="memorizationJuz" class="form-control" required>
                            <option value="" selected disabled data-i18n="quran.selectJuz">اختر الجزء</option>
                            <option value="30" data-i18n="quran.juz30">الجزء الثلاثون (عم)</option>
                            <option value="29" data-i18n="quran.juz29">الجزء التاسع والعشرون</option>
                            <!-- More juz options will be added -->
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="memorizationFromSurah" class="form-label" data-i18n="quran.fromSurah">من السورة</label>
                        <select id="memorizationFromSurah" class="form-control" required>
                            <option value="" selected disabled data-i18n="quran.selectSurah">اختر السورة</option>
                            <!-- Surahs will be populated by JavaScript based on selected juz -->
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="memorizationFromAyah" class="form-label" data-i18n="quran.fromAyah">من الآية</label>
                        <input type="number" id="memorizationFromAyah" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="memorizationToSurah" class="form-label" data-i18n="quran.toSurah">إلى السورة</label>
                        <select id="memorizationToSurah" class="form-control" required>
                            <option value="" selected disabled data-i18n="quran.selectSurah">اختر السورة</option>
                            <!-- Surahs will be populated by JavaScript based on selected juz -->
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="memorizationToAyah" class="form-label" data-i18n="quran.toAyah">إلى الآية</label>
                        <input type="number" id="memorizationToAyah" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="memorizationDate" class="form-label" data-i18n="quran.memorizationDate">تاريخ الحفظ</label>
                        <input type="date" id="memorizationDate" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="memorizationTeacher" class="form-label" data-i18n="quran.teacher">المعلم</label>
                        <select id="memorizationTeacher" class="form-control" required>
                            <option value="" selected disabled data-i18n="quran.selectTeacher">اختر المعلم</option>
                            <!-- Teachers will be populated by JavaScript -->
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="memorizationStatus" class="form-label" data-i18n="quran.status">حالة الحفظ</label>
                        <select id="memorizationStatus" class="form-control" required>
                            <option value="completed" data-i18n="quran.completed">مكتمل</option>
                            <option value="in-progress" selected data-i18n="quran.inProgress">قيد الحفظ</option>
                            <option value="review" data-i18n="quran.review">قيد المراجعة</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="memorizationNotes" class="form-label" data-i18n="quran.notes">ملاحظات</label>
                        <textarea id="memorizationNotes" class="form-control" rows="2"></textarea>
                    </div>
                </div>
                <div class="mt-6 flex justify-end space-x-3">
                    <button type="button" onclick="closeModal('quranMemorizationModal')" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50" data-i18n="common.cancel">إلغاء</button>
                    <button type="submit" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-green-700" data-i18n="common.save">حفظ</button>
                </div>
            </form>
        </div>
    </div>

    <!-- Payment Modal -->
    <div id="paymentModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-2xl">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-primary" data-i18n="payment.title">تسجيل دفعة جديدة</h3>
                <button onclick="closeModal('paymentModal')" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <form id="paymentForm">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                    <div class="form-group">
                        <label for="paymentStudent" class="form-label" data-i18n="payment.student">الطالب</label>
                        <select id="paymentStudent" class="form-control" required>
                            <option value="" selected disabled data-i18n="payment.selectStudent">اختر الطالب</option>
                            <!-- Students will be populated by JavaScript -->
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="paymentType" class="form-label" data-i18n="payment.type">نوع الدفعة</label>
                        <select id="paymentType" class="form-control" required>
                            <option value="" selected disabled data-i18n="payment.selectType">اختر النوع</option>
                            <option value="tuition" data-i18n="payment.tuition">رسوم دراسية</option>
                            <option value="activity" data-i18n="payment.activity">رسوم نشاط</option>
                            <option value="book" data-i18n="payment.book">رسوم كتب</option>
                            <option value="other" data-i18n="payment.other">أخرى</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="paymentAmount" class="form-label" data-i18n="payment.amount">المبلغ (€)</label>
                        <input type="number" id="paymentAmount" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="paymentDate" class="form-label" data-i18n="payment.date">تاريخ الدفع</label>
                        <input type="date" id="paymentDate" class="form-control" required>
                    </div>
                    <div class="form-group">
                        <label for="paymentMethod" class="form-label" data-i18n="payment.method">طريقة الدفع</label>
                        <select id="paymentMethod" class="form-control" required>
                            <option value="" selected disabled data-i18n="payment.selectMethod">اختر الطريقة</option>
                            <option value="cash" data-i18n="payment.cash">نقداً</option>
                            <option value="bank" data-i18n="payment.bank">تحويل بنكي</option>
                            <option value="card" data-i18n="payment.card">بطاقة ائتمان</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="paymentPeriod" class="form-label" data-i18n="payment.period">الفترة</label>
                        <select id="paymentPeriod" class="form-control" required>
                            <option value="" selected disabled data-i18n="payment.selectPeriod">اختر الفترة</option>
                            <option value="monthly" data-i18n="payment.monthly">شهري</option>
                            <option value="quarterly" data-i18n="payment.quarterly">ربع سنوي</option>
                            <option value="semester" data-i18n="payment.semester">فصلي</option>
                            <option value="annual" data-i18n="payment.annual">سنوي</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="paymentReceipt" class="form-label" data-i18n="payment.receipt">رقم الإيصال</label>
                        <input type="text" id="paymentReceipt" class="form-control">
                    </div>
                    <div class="form-group">
                        <label for="paymentNotes" class="form-label" data-i18n="payment.notes">ملاحظات</label>
                        <textarea id="paymentNotes" class="form-control" rows="2"></textarea>
                    </div>
                </div>
                <div class="mt-6 flex justify-end space-x-3">
                    <button type="button" onclick="closeModal('paymentModal')" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50" data-i18n="common.cancel">إلغاء</button>
                    <button type="submit" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-green-700" data-i18n="common.save">حفظ</button>
                </div>
            </form>
        </div>
    </div>

    <!-- Settings Modal -->
    <div id="settingsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-4xl">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-bold text-primary" data-i18n="settings.title">إعدادات النظام</h3>
                <button onclick="closeModal('settingsModal')" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            
            <div class="mb-6">
                <ul class="flex border-b border-gray-200" id="settingsTabs">
                    <li class="mr-1">
                        <a href="#" class="bg-white inline-block py-2 px-4 font-semibold text-primary border-b-2 border-primary" data-tab="general" data-i18n="settings.general">عام</a>
                    </li>
                    <li class="mr-1">
                        <a href="#" class="bg-white inline-block py-2 px-4 text-gray-500 hover:text-primary" data-tab="school" data-i18n="settings.school">المدرسة</a>
                    </li>
                    <li class="mr-1">
                        <a href="#" class="bg-white inline-block py-2 px-4 text-gray-500 hover:text-primary" data-tab="academic" data-i18n="settings.academic">أكاديمي</a>
                    </li>
                    <li class="mr-1">
                        <a href="#" class="bg-white inline-block py-2 px-4 text-gray-500 hover:text-primary" data-tab="financial" data-i18n="settings.financial">مالي</a>
                    </li>
                    <li class="mr-1">
                        <a href="#" class="bg-white inline-block py-2 px-4 text-gray-500 hover:text-primary" data-tab="users" data-i18n="settings.users">المستخدمون</a>
                    </li>
                </ul>
            </div>
            
            <div id="settingsContent">
                <!-- General Settings -->
                <div id="generalSettings" class="settings-tab-content">
                    <form id="generalSettingsForm">
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                            <div class="form-group">
                                <label for="schoolName" class="form-label" data-i18n="settings.schoolName">اسم المدرسة</label>
                                <input type="text" id="schoolName" class="form-control" value="مدرسة النور" required>
                            </div>
                            <div class="form-group">
                                <label for="schoolLogo" class="form-label" data-i18n="settings.schoolLogo">شعار المدرسة</label>
                                <input type="file" id="schoolLogo" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="defaultLanguage" class="form-label" data-i18n="settings.defaultLanguage">اللغة الافتراضية</label>
                                <select id="defaultLanguage" class="form-control" required>
                                    <option value="ar" selected data-i18n="settings.arabic">العربية</option>
                                    <option value="es" data-i18n="settings.spanish">الإسبانية</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="timezone" class="form-label" data-i18n="settings.timezone">المنطقة الزمنية</label>
                                <select id="timezone" class="
</html>