@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

:root {
    --primary-color: #1a535c;
    --secondary-color: #f7b538;
    --light-color: #ffffff;
    --dark-color: #333333;
    --bg-light: #f4f6f9;
    --error-color: #721c24;
    --error-bg: #f8d7da;
    --success-color: #155724;
    --success-bg: #d4edda;
}

body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    background: var(--bg-light);
    margin: 0;
}

.auth-wrapper {
    width: 100%;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.auth-logo {
    max-width: 180px;
    margin-bottom: 25px;
}

.auth-box, .terms-box, .form-box {
    background-color: var(--light-color);
    margin: 0 auto;
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.08);
    border-top: 5px solid var(--primary-color);
    text-align: center;
}
.auth-box, .terms-box { max-width: 480px; }
.form-box { max-width: 900px; }

.auth-box h2, .terms-box h2, .form-box h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 700;
}

.auth-box > p, .terms-box > p, .form-box > p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.input-group, .form-group {
    margin-bottom: 20px;
    text-align: right;
}

.input-group label, .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}
.required { color: #e74c3c; font-weight: bold; margin-right: 2px; }

.input-group input[type="text"], .input-group input[type="email"], .input-group input[type="password"],
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="tel"],
.form-group input[type="number"], .form-group input[type="date"], .form-group select, .form-group textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fdfdfe;
}
.form-group input[type="file"] { padding: 8px; background-color: #f8f9fa; }
.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 16px 12px;
}

.input-group input:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(247, 181, 56, 0.25);
}

.btn-main {
    width: 100%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-decoration: none;
}
.form-box .btn-main { width: auto; padding-left: 40px; padding-right: 40px; }

.btn-main:hover {
    background-color: #2c7a7b;
    transform: translateY(-2px);
}
.btn-main:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: translateY(0);
}

.auth-links { display: flex; justify-content: space-between; margin-top: 25px; font-size: 0.9rem; padding-top: 15px; border-top: 1px solid #eee; }
.auth-links a { color: var(--primary-color); text-decoration: none; font-weight: 500; transition: color 0.3s; }
.auth-links a:hover { color: var(--secondary-color); }

.error-msg, .success-msg { border-radius: 6px; padding: 15px; margin-bottom: 20px; text-align: center; font-weight: 500; }
.error-msg { background-color: var(--error-bg); color: var(--error-color); border: 1px solid #f5c6cb; }
.success-msg { background-color: var(--success-bg); color: var(--success-color); border: 1px solid #c3e6cb; }
.terms-content { height: 300px; overflow-y: auto; border: 1px solid #eee; padding: 20px; margin-bottom: 20px; border-radius: 8px; line-height: 1.8; text-align: right; background-color: #fdfdfd; }
.input-group-checkbox { display: flex; align-items: center; gap: 10px; margin: 25px 0; justify-content: center; padding: 15px; background: #f8f9fa; border-radius: 8px; }
.input-group-checkbox input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.input-group-checkbox label { margin: 0; cursor: pointer; font-weight: 500; }

/* --- Beneficiary Dashboard & Request Form --- */
.dashboard-wrapper, .form-wrapper { width: 100%; background-color: var(--bg-light); }
.dashboard-header { background: #fff; padding: 15px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-bottom: 3px solid var(--primary-color); }
.dashboard-header .container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 15px;}
.header-content { display: flex; align-items: center; gap: 15px; }
.header-logo { height: 50px; }
.dashboard-header h2 { margin: 0; color: #1a535c; font-size: 1.5rem; }
.logout-link { color: #e74c3c; text-decoration: none; font-weight: bold; display: flex; align-items: center; gap: 8px; }
.logout-link:hover { text-decoration: underline; }
.dashboard-content { padding: 40px 0; }
.dashboard-content .container { background-color: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.05); }
.dashboard-content h3 { color: #1a535c; border-bottom: 2px solid #f7b538; padding-bottom: 10px; margin-bottom: 20px; }
.page-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.table-wrapper { overflow-x: auto; border: 1px solid #eee; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 15px; text-align: right; border-bottom: 1px solid #eee; }
table th { background-color: #f8f9fa; font-weight: bold; }
.status-tag { padding: 4px 12px; border-radius: 20px; color: #fff; font-size: 0.9rem; font-weight: 500; }
.status-new { background-color: #f39c12; }
.status-in_progress, .status-in-progress { background-color: #3498db; }
.status-approved, .status-completed { background-color: #27ae60; }
.status-rejected, .status-late { background-color: #e74c3c; }

.form-box h3 { color: #1a535c; margin-top: 30px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.contact-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form .full-width { grid-column: 1 / -1; }
@media (max-width: 768px) {
    .contact-form .form-grid { grid-template-columns: 1fr; }
}

body { font-family: 'Tajawal', sans-serif; background-color: #f0f2f5; margin: 0; display: flex; align-items: center; justify-content: center; min-height: 100vh; direction: rtl; }
.auth-wrapper { width: 100%; padding: 20px; }
.auth-box { max-width: 450px; margin: 0 auto; background: white; padding: 40px; border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.1); }
.auth-logo { display: block; max-width: 150px; margin: 0 auto 20px; }
.auth-box h2 { text-align: center; color: #1a535c; margin-top: 0; margin-bottom: 10px; }
.auth-box p { text-align: center; color: #666; margin-bottom: 30px; line-height: 1.6; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-weight: 500; margin-bottom: 8px; color: #333; }
.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 12px 15px; border-radius: 6px; border: 1px solid #ccc; font-family: 'Tajawal', sans-serif; box-sizing: border-box; transition: border-color 0.3s; font-size: 1rem; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { border-color: #f7b538; outline: none; }
.btn-main { width: 100%; padding: 14px; background-color: #1a535c; color: white; border: none; border-radius: 6px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background-color 0.3s; }
.btn-main:hover { background-color: #2c7a7b; }
.btn-main:disabled { background-color: #95a5a6; cursor: not-allowed; }
.auth-links { text-align: center; margin-top: 25px; font-size: 14px; display: flex; justify-content: space-between; }
.auth-links a { color: #1a535c; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.error-msg, .success-msg { padding: 15px; margin-bottom: 20px; border-radius: 6px; text-align: center; }
.error-msg { background-color: #fdd; color: #c00; border: 1px solid #fbb; }
.success-msg { background-color: #eafaf1; color: #27ae60; border: 1px solid #c8e6c9; }
.terms-box { border: 1px solid #eee; padding: 20px; margin-bottom: 20px; border-radius: 8px; max-height: 400px; overflow-y: auto; background: #fafafa; }
.terms-box h1, .terms-box h2 { color: #1a535c; }
.registration-form fieldset { border: 1px solid #e0e0e0; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.registration-form legend { font-weight: bold; color: #1a535c; padding: 0 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.form-grid .full-width { grid-column: 1 / -1; }
span.required { color: #e74c3c; margin-right: 4px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .auth-box { padding: 20px; } }

.btn-edit {
    color: #007bff;
    margin-left: 10px;
}
.btn-edit:hover {
    color: #0056b3;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}
.pagination .page-link {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    background: #f1f1f1;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
}
.pagination .page-link.active {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

body, html { margin: 0; padding: 0; font-family: 'Tajawal', sans-serif; background-color: #f4f6f9; }
        .dashboard-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
        .dashboard-header { background-color: #fff; padding: 15px 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
        .container { width: 95%; max-width: 1200px; margin: 0 auto; }
        .header-content { display: flex; justify-content: space-between; align-items: center; }
        .header-logo { height: 50px; }
        .logout-link { color: #e74c3c; font-weight: bold; text-decoration: none; display: flex; align-items: center; gap: 8px; font-size: 1rem; }
        .logout-link:hover { color: #c0392b; }
        .dashboard-content { flex-grow: 1; padding: 30px 0; }
        .success-msg, .info-msg { padding: 15px; border-radius: 6px; margin-bottom: 25px; border: 1px solid transparent; }
        .success-msg { background-color: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
        .info-msg { background: #fff3cd; color: #856404; border-color: #ffeeba; }
        .page-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
        .btn-main { background-color: #1a535c; color: white; border: none; padding: 12px 25px; border-radius: 6px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-weight: bold; transition: background-color 0.3s; }
        .btn-main:hover { background-color: #2c7a7b; }
        .table-wrapper { overflow-x: auto; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
        table { width: 100%; border-collapse: collapse; }
        th, td { padding: 15px; border-bottom: 1px solid #f0f0f0; text-align: right; }
        th { background-color: #f8f9fa; font-weight: 700; color: #555; }
        .status-tag { padding: 5px 12px; border-radius: 20px; color: #fff; font-size: 0.9rem; font-weight: bold; white-space: nowrap; }
        .status-new { background-color: #ff9800; } /* برتقالي */
        .status-under-study, .status-reviewed { background-color: #2196f3; } /* أزرق */
        .status-approved { background-color: #4caf50; } /* أخضر */
        .status-rejected { background-color: #f44336; } /* أحمر */
        .status-delayed { background-color: #e74c3c; } /* أحمر للتأخير */
        
        /* [إضافة]: تنسيق احترافي لرسالة الترحيب */
        .welcome-message {
            display: flex;
            align-items: center;
            gap: 10px; /* مسافة بين الأيقونة والنص */
            font-size: 1.1rem; /* حجم خط أصغر من h2 */
            font-weight: 500; /* وزن متوسط */
            color: #333;
        }
        .welcome-message .fa-user-circle {
            color: #1a535c; /* لون يطابق لون الزر الرئيسي */
            font-size: 1.4rem; /* أيقونة أكبر قليلاً من النص */
        }
        /* نهاية الإضافة */
        
/*
 * أضف هذا الكود إلى ملف style.css لتوحيد الخط والمحاذاة في كل الموقع
*/
button,
input,
select,
textarea {
    font-family: inherit; /* تجعل العنصر يرث الخط من أبيه (body) */
}

/* إضافة هذا الكود لإصلاح محاذاة النص في الأزرار */
button,
.btn-main,
.btn-download,
.btn-print-action,
.btn-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 8px; /* مسافة جميلة بين الأيقونة والنص */
}



/*
 * ===============================================
 *  إضافات لتوحيد تصميم النماذج والأزرار
 * ===============================================
*/

/* 1. توحيد الخط لكل عناصر النماذج */
button,
input,
select,
textarea {
    font-family: inherit; /* يرث خط 'Tajawal' من الصفحة */
}

/* 2. تنسيق أساسي لكل الأزرار */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* مسافة بين الأيقونة والنص */
    padding: 8px 18px; /* حجم أصغر للحشو الداخلي */
    font-size: 15px;     /* حجم خط أصغر */
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

/* 3. تعديل زر .btn-main الموجود لديك ليستخدم التنسيق الجديد */
.btn-main {
    background-color: #1a535c; /* اللون الأخضر الغامق الصحيح */
    border-color: #1a535c;
    color: white;
}
.btn-main:hover {
    background-color: #2c7a7b;
    border-color: #2c7a7b;
}

/* 4. كلاس جديد لزر "العودة" الثانوي */
.btn-secondary {
    background-color: #6c757d; /* لون رمادي ثانوي */
    border-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

/* 5. حاوية لتنظيم الأزرار في النماذج */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}
.form-actions .btn {
    flex: 1; /* يجعل الأزرار تأخذ مساحة متساوية */
}

       .sidebar ul a.logout-btn {
            color: #fff !important; /* اللون الافتراضي أبيض */
            background-color: #1d464d !important; /* بدون خلفية افتراضية */
        }
        .sidebar ul a.logout-btn:hover {
            background-color: #e74c3c !important; /* خلفية حمراء عند التمرير */
            color: #fff !important;
        }
        /* تعديل بسيط لضمان محاذاة النص والأيقونة لليمين */
        .sidebar ul a {
            justify-content: flex-start;
        }
        
        
          /* [تعديل جذري]: تصميم احترافي جديد */
    .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
    .kpi-card { background: #fff; border-radius: 12px; padding: 25px; box-shadow: 0 8px 30px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 20px; transition: transform 0.3s, box-shadow 0.3s; }
    .kpi-card:hover { transform: translateY(-5px); box-shadow: 0 12px 35px rgba(0,0,0,0.1); }
    .kpi-card .icon { font-size: 2.2rem; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; }
    .kpi-card .info .value { font-size: 2rem; font-weight: 800; color: #34495e; }
    .kpi-card .info .title { font-size: 1rem; color: #7f8c8d; }
    .charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
    .chart-container { background-color: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.05); }
    .chart-container.full-width { grid-column: 1 / -1; }
    .chart-container h3 { text-align: right; margin-bottom: 25px; color: #34495e; font-size: 1.2rem; font-weight: 700; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; }
    @media (max-width: 992px) { .charts-grid { grid-template-columns: 1fr; } }

    /* [تعديل جذري]: تصميم جديد واحترافي */
    .charts-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
        gap: 25px;
        margin-top: 20px;
    }
    .chart-container {
        background: #ffffff; /* خلفية بيضاء نقية */
        padding: 25px;
        border-radius: 12px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08); /* ظل أكثر نعومة وعمق */
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .chart-container:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
    }
    .chart-container h3 {
        text-align: right;
        margin-bottom: 25px;
        color: #34495e; /* لون عنوان أغمق */
        font-size: 1.2rem;
        font-weight: 700;
        border-bottom: 2px solid #f0f0f0;
        padding-bottom: 10px;
    }
    /* نهاية التعديل */
    
    
    /* أضف هذا في نهاية ملف assets/css/style.css */

.btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.btn-success:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}