/* 1. الإعدادات العامة والمتغيرات */
:root {
    --primary-blue: #1e3a8a;    /* الأزرق الداكن الاحترافي */
    --accent-blue: #3b82f6;     /* أزرق فاتح للعناصر التفاعلية */
    --success-green: #10b981;   /* أخضر للنجاح والأرباح */
    --bg-light: #f1f5f9;        /* خلفية الصفحة رمادي مزرق فاتح جداً */
    --text-main: #1e293b;       /* لون النص الأساسي */
    --text-muted: #64748b;      /* لون النصوص الثانوية */
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

/* 2. الهيدر (Navigation) */
header {
    background-color: var(--white);
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8%;
    position: sticky;
    top: 0;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-blue);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    margin: 0 15px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent-blue);
}

/* 3. الأزرار */
.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-secondary:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* 4. البطاقات (Cards) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 40px 8%;
}

.card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-blue);
}

/* 5. شريط التقدم (Progress Bar) */
.progress-container {
    background: #e2e8f0;
    height: 10px;
    border-radius: 5px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
    border-radius: 5px;
}

/* 6. لوحة التحكم (Dashboard Layout) */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 260px;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 30px 20px;
}

.sidebar h3 { margin-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }

.sidebar a {
    display: block;
    color: #cbd5e1;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: var(--transition);
}

.sidebar a:hover, .sidebar a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.main-content {
    flex: 1;
    padding: 40px;
}

/* 7. الجداول (Tables) */
.table-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background-color: #f8fafc;
    padding: 15px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 2px solid #e2e8f0;
}

table td {
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
}

/* 8. صناديق الإحصائيات (Stats Boxes) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-right: 6px solid var(--primary-blue);
}

.stat-box span { color: var(--text-muted); font-size: 0.9rem; }
.stat-box h2 { font-size: 1.8rem; color: var(--primary-blue); margin-top: 5px; }

/* 9. النماذج (Forms) */
input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-top: 5px;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 10. الاستجابة للهواتف (Responsive) */
@media (max-width: 768px) {
    .dashboard-container { flex-direction: column; }
    .sidebar { width: 100%; padding: 15px; }
    header { padding: 0 5%; }
}