:root {
    --primary-color: #1a365d; /* أزرق مؤسسي داكن */
    --bg-color: #f4f7fb;
    --card-bg: #ffffff;
    --text-dark: #2d3748;
    --text-light: #718096;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
    margin: 0;
}

/* نظام الشاشات (Login / App) */
.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }
#login-screen { align-items: center; justify-content: center; background-color: var(--primary-color); }

/* صندوق تسجيل الدخول */
.login-box { background: var(--card-bg); padding: 40px; border-radius: var(--border-radius); box-shadow: 0 10px 25px rgba(0,0,0,0.2); text-align: center; width: 90%; max-width: 400px; }
.logo-icon-large { background: var(--primary-color); color: white; font-size: 32px; font-weight: 800; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; border-radius: 15px; letter-spacing: 2px; margin: 0 auto 20px auto; }
.login-box h2 { margin-bottom: 10px; color: var(--primary-color); }
.login-box p { color: var(--text-light); font-size: 14px; margin-bottom: 20px; }
.login-box input { width: 100%; padding: 12px; margin: 10px 0 20px 0; border: 1px solid #ddd; border-radius: 6px; font-size: 16px; }
.login-box input:focus { border-color: var(--primary-color); outline: none; }
.login-box button { width: 100%; padding: 12px; background: var(--primary-color); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: bold; transition: var(--transition); }
.login-box button:hover { background: #122643; }
.error-msg { color: #e53e3e; margin-top: 10px; font-size: 14px; min-height: 20px; font-weight: bold; }

/* الشريط العلوي */
.main-header {
    background-color: var(--card-bg);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-bottom: 3px solid var(--primary-color);
}

.logo-area { display: flex; align-items: center; gap: 15px; }
.logo-icon { background: var(--primary-color); color: white; font-size: 24px; font-weight: 800; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 10px; letter-spacing: 2px; }
.logo-area h1 { font-size: 20px; color: var(--primary-color); margin-bottom: 2px; }
.logo-area p { font-size: 13px; color: var(--text-light); }

.user-profile { display: flex; align-items: center; gap: 12px; font-weight: bold; }
.avatar { width: 45px; height: 45px; background-color: #e2e8f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 20px; }
.logout-btn { background: #fee2e2; color: #e53e3e; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px; transition: var(--transition); display: flex; align-items: center; justify-content: center;}
.logout-btn:hover { background: #fca5a5; color: #991b1b; }

/* منطقة المحتوى */
.dashboard-container { max-width: 1000px; margin: 40px auto; padding: 0 20px; flex-grow: 1; }
.welcome-banner { text-align: center; margin-bottom: 40px; }
.welcome-banner h2 { font-size: 28px; color: var(--primary-color); margin-bottom: 10px; }
.welcome-banner p { color: var(--text-light); }

/* شبكة الأزرار - Grid Layout */
.modules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; }

/* تصميم بطاقة الزر */
.module-card {
    background-color: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: right;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.module-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: var(--primary-color); }
.icon-wrapper { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: white; margin-bottom: 20px; }

/* ألوان الأيقونات المتنوعة */
.bg-blue { background: linear-gradient(135deg, #3182ce, #2b6cb0); }
.bg-green { background: linear-gradient(135deg, #48bb78, #38a169); }
.bg-purple { background: linear-gradient(135deg, #9f7aea, #805ad5); }
.bg-orange { background: linear-gradient(135deg, #ed8936, #dd6b20); }
.bg-teal { background: linear-gradient(135deg, #38b2ac, #319795); }
.bg-gray { background: linear-gradient(135deg, #a0aec0, #718096); }
.bg-red { background: linear-gradient(135deg, #f56565, #c53030); }

.module-card h3 { font-size: 20px; color: var(--text-dark); margin-bottom: 8px; }
.module-card p { font-size: 14px; color: var(--text-light); line-height: 1.5; }

/* تجاوب الشاشات للجوال */
@media (max-width: 768px) {
    .modules-grid { grid-template-columns: 1fr; }
    .main-header { flex-direction: column; gap: 15px; text-align: center; }
}