* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.search-box {
    flex: 1;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #219a52;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #34495e;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: #f8f9fa;
}

input[type="text"], input[type="date"], select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

input[type="text"]:focus, input[type="date"]:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.status-active {
    color: #27ae60;
    font-weight: bold;
}

.status-inactive {
    color: #e74c3c;
    font-weight: bold;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    font-weight: bold;
}

.notification.success {
    background-color: #27ae60;
}

.notification.error {
    background-color: #e74c3c;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    display: none;
}

.loading .fa-spinner {
    font-size: 2rem;
    margin-bottom: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
    display: none;
}

.empty-state i {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 10px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #7f8c8d;
}

/* تحسينات للاستجابة */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .table-container {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
}
/* تنسيق الرأس والقائمة الجانبية */
header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#userInfo {
    display: flex;
    align-items: center;
    gap: 15px;
}

aside {
    background: #34495e;
    color: white;
    width: 250px;
    height: calc(100vh - 80px);
    position: fixed;
    top: 80px;
    right: 0;
    overflow-y: auto;
}

aside ul {
    list-style: none;
    padding: 0;
}

aside li {
    border-bottom: 1px solid #2c3e50;
}

aside a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background 0.3s;
}

aside a:hover, aside a.active {
    background: #3498db;
    color: white;
}

aside a i {
    width: 20px;
    margin-left: 10px;
}

main {
    margin-right: 250px;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

/* تحسين مربع البحث */
.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.search-box input {
    padding-right: 10px;
    padding-left: 35px;
}

/* تحسين الأزرار */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* تحسين الجدول */
th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 1024px) {
    aside {
        width: 200px;
    }
    
    main {
        margin-right: 200px;
    }
}

@media (max-width: 768px) {
    aside {
        width: 100%;
        height: auto;
        position: static;
    }
    
    main {
        margin-right: 0;
    }
    
    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    #userInfo {
        flex-direction: column;
        gap: 10px;
    }
}
/* تنسيق إضافي للجدولين */
.container + .container {
    margin-top: 30px;
}

/* تحسين مظهر حقول الأرقام */
input[type="number"] {
    text-align: center;
}

/* تحسين مظهر select */
select {
    cursor: pointer;
    background: white;
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .container + .container {
        margin-top: 20px;
    }
    
    table {
        font-size: 12px;
    }
}
/* تنسيق إضافي للجدول الثالث */
.container + .container + .container {
    margin-top: 30px;
}

/* تحسين مظهر حقول النصوص */
input[type="text"] {
    text-align: right;
}

/* تنسيق خاص لأنواع المواد */
select {
    min-width: 120px;
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .container + .container + .container {
        margin-top: 20px;
    }
    
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 6px;
    }
}
/* تنسيق إضافي للجدول الرابع */
.container + .container + .container + .container {
    margin-top: 30px;
}

/* تحسين مظهر حقول السعة */
input[type="number"] {
    text-align: center;
    min-width: 80px;
}

/* تنسيق خاص للشعب */
select {
    min-width: 150px;
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .container + .container + .container + .container {
        margin-top: 20px;
    }
    
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 5px;
    }
    
    input[type="number"] {
        min-width: 60px;
    }
}
/* تنسيق إضافي للجدول الخامس */
.container + .container + .container + .container + .container {
    margin-top: 30px;
}

/* تحسين مظهر حقول العلامات */
input[type="number"] {
    text-align: center;
    min-width: 100px;
}

/* تنسيق خاص لتوزيع العلامات */
select {
    min-width: 180px;
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .container + .container + .container + .container + .container {
        margin-top: 20px;
    }
    
    table {
        font-size: 10px;
    }
    
    th, td {
        padding: 4px;
    }
    
    input[type="number"] {
        min-width: 70px;
    }
    
    select {
        min-width: 120px;
    }
}
/* تنسيقات CSS المعدلة في subjects.css */

/* تنسيقات أساسية للوحة التحكم */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 0; /* إزالة البادينج من البودي لنتمكن من التحكم بالشريط الجانبي */
    display: flex; /* استخدام فليكس لجعل الـ header والـ aside والـ main تعمل معاً */
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #34495e;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000; /* للتأكد من ظهوره فوق العناصر الأخرى */
}

header h1 {
    font-size: 24px;
    margin: 0;
    padding: 0;
    border-bottom: none;
}

/* تنسيق شريط التنقل الجانبي (Aside) - لتطبيق فكرة الانزلاق عند التحويم */
aside {
    position: fixed;
    top: 0;
    right: -220px; /* إخفاء الشريط جزئياً لليمين */
    width: 250px;
    height: 100%;
    background-color: #2c3e50; /* لون خلفية أغمق */
    color: white;
    padding-top: 80px; /* مساحة لرأس الصفحة */
    transition: right 0.3s ease-in-out; /* حركة سلسة */
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    z-index: 900;
}

/* إظهار الشريط الجانبي عند التحويم على حافة الصفحة (تتطلب استخدام JS لأفضل تطبيق) */
/* سنستخدم هنا التحويم المباشر، ويمكن استخدام JS لتطبيق التأثير على حافة الشاشة */
aside:hover {
    right: 0; /* إظهار الشريط بالكامل */
}

/* إضافة عنوان لشريط التنقل الجانبي */
.sidebar-title {
    color: #ecf0f1;
    text-align: center;
    padding: 15px 0;
    font-size: 1.2em;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 15px;
    width: 100%;
}

aside nav ul {
    list-style: none;
    padding: 0;
}

aside nav ul li a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #ecf0f1;
    transition: background-color 0.3s, color 0.3s;
    border-right: 5px solid transparent;
}

aside nav ul li a:hover,
aside nav ul li a.active {
    background-color: #3498db;
    color: white;
    border-right: 5px solid #e74c3c;
}

/* تنسيق محتوى الصفحة الرئيسي */
main {
    flex-grow: 1;
    padding: 20px;
    margin-right: 30px; /* مسافة للجهة التي يخرج منها الشريط الجانبي */
    transition: margin-right 0.3s ease-in-out;
    padding-top: 90px; /* مسافة لرأس الصفحة وشريط التنقل العلوي */
}

/* عند فتح الشريط الجانبي، قم بـ دفع المحتوى (اختياري، يفضل JS) */
/*
aside:hover + main {
    margin-right: 270px; 
}
*/

/* تنسيق شريط التنقل العلوي الجديد #sectionNav */
#sectionNav {
    position: fixed;
    top: 60px; /* أسفل الـ header */
    right: 0;
    left: 0;
    background-color: #ecf0f1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 950;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-bottom: 2px solid #bdc3c7;
}

#sectionNav a {
    text-decoration: none;
    color: #2c3e50;
    padding: 5px 15px;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 5px;
}

#sectionNav a:hover {
    background-color: #3498db;
    color: white;
}

#sectionNav a.active {
    background-color: #e74c3c;
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* تنسيق الحاوية لتفادي التداخل مع الشريط العلوي */
.container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    scroll-margin-top: 100px; /* هام لتصحيح التمرير عند النقر على الروابط العلوية */
}

/* ... بقية التنسيقات في subjects.css ... */
/* يجب عليك دمج هذه التغييرات في ملف subjects.css الحالي */