/* medad-project-management/public/css/medad-pm-public.css */

/* إعادة ضبط أساسية لبعض عناصر HTML داخل المكون الخاص بنا */
.medad-pm-front-dashboard-wrapper * {
    box-sizing: border-box !important;
    /* margin: 0 !important; */ /* تم إزالة هذا للحفاظ على مرونة الهوامش */
    /* padding: 0 !important; */ /* تم إزالة هذا للحفاظ على مرونة البادينج */
}

.medad-pm-front-dashboard-wrapper {
    background-color: #f9f9f9 !important;
    border: 1px solid #ddd !important;
    padding: 25px !important; /* تقليل البادينج قليلاً */
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    font-family: 'Arial', sans-serif !important; /* استخدام !important لتجاوز أنماط القالب */
    color: #333 !important;
    direction: rtl !important;
    text-align: right !important;
    max-width: 100% !important;
    /* overflow-x: auto !important; */ /* سنستخدم JavaScript للتحكم في التمرير الأفقي بدلاً من هذا */
    line-height: 1.6 !important;
    position: relative !important; /* لتمكين التمرير على الجدول بشكل أفضل */
}

.medad-pm-front-dashboard-wrapper h2 {
    color: #0073aa !important;
    font-size: 26px !important; /* تقليل حجم الخط قليلاً */
    margin-bottom: 20px !important;
    border-bottom: 2px solid #eee !important;
    padding-bottom: 10px !important;
    text-align: right !important;
}

/* تبويبات التنقل */
.medad-pm-front-tabs {
    margin-bottom: 15px !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 0 !important; /* إزالة البادينج السفلي */
    display: flex !important;
    flex-wrap: wrap !important; /* للسماح بالالتفاف على الشاشات الصغيرة */
    justify-content: flex-start !important;
}

.medad-pm-front-tabs a {
    display: block !important;
    padding: 10px 15px !important;
    text-decoration: none !important;
    color: #555 !important;
    font-weight: bold !important;
    border: 1px solid #ddd !important; /* جعل الحدود مرئية */
    border-bottom: none !important;
    border-radius: 5px 5px 0 0 !important;
    margin-left: 5px !important;
    margin-bottom: 5px !important; /* مسافة للأسفل عند الالتفاف */
    background-color: #f0f0f0 !important;
    transition: all 0.2s ease-in-out !important;
}

.medad-pm-front-tabs a:hover {
    background-color: #e5e5e5 !important;
    color: #333 !important;
}

.medad-pm-front-tabs a.active-tab {
    background-color: #fff !important;
    border-color: #ddd !important;
    border-bottom-color: #fff !important;
    color: #0073aa !important;
}

.medad-pm-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; /* تقليل الحد الأدنى للعرض */
    gap: 15px !important; /* تقليل المسافة بين البطاقات */
    margin-bottom: 25px !important;
}

.medad-pm-stat-card {
    background-color: #ffffff !important;
    padding: 18px !important; /* تقليل البادينج */
    border-radius: 7px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    text-align: center !important;
    transition: transform 0.2s ease-in-out !important;
    min-height: 100px !important; /* ضمان ارتفاع موحد */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

.medad-pm-stat-card:hover {
    transform: translateY(-5px) !important;
}

.medad-pm-stat-card h3 {
    margin-top: 0 !important;
    font-size: 16px !important; /* تقليل حجم الخط */
    color: #555 !important;
    line-height: 1.3 !important;
}

.medad-pm-stat-card p {
    font-size: 30px !important; /* تقليل حجم الخط */
    font-weight: bold !important;
    margin: 8px 0 0 !important;
    color: #0073aa !important;
}

.medad-pm-stat-card.total p { color: #0056b3 !important; }
.medad-pm-stat-card.in-progress p { color: #28a745 !important; }
.medad-pm-stat-card.completed p { color: #ffc107 !important; }
.medad-pm-stat-card.planned p { color: #dc3545 !important; }

.medad-pm-recent-projects {
    background-color: #ffffff !important;
    padding: 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 25px !important;
}

.medad-pm-recent-projects h3 {
    color: #0073aa !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
    font-size: 20px !important;
}

.medad-pm-recent-projects ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.medad-pm-recent-projects ul li {
    padding: 8px 0 !important;
    border-bottom: 1px dashed #eee !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.medad-pm-recent-projects ul li:last-child {
    border-bottom: none !important;
}

.medad-pm-recent-projects ul li strong {
    color: #333 !important;
    flex-basis: 60% !important;
}

.medad-pm-recent-projects ul li span.status {
    font-weight: bold !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    font-size: 0.8em !important;
    display: inline-block !important;
    margin-right: 0 !important;
    flex-basis: auto !important;
}

.medad-pm-recent-projects ul li .status.planned { background-color: #f8d7da !important; color: #dc3545 !important; }
.medad-pm-recent-projects ul li .status.in-progress { background-color: #d4edda !important; color: #28a745 !important; }
.medad-pm-recent-projects ul li .status.completed { background-color: #fff3cd !important; color: #856404 !important; }
.medad-pm-recent-projects ul li .status.on_hold { background-color: #ffeeba !important; color: #664d03 !important; }


.medad-pm-front-dashboard-wrapper .button {
    display: inline-block !important;
    background-color: #0073aa !important;
    color: #fff !important;
    padding: 9px 18px !important;
    border-radius: 5px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    transition: background-color 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 15px !important;
    margin-top: 15px !important;
}

.medad-pm-front-dashboard-wrapper .button:hover {
    background-color: #005f8b !important;
    color: #fff !important;
}

.medad-pm-projects-list-front {
    margin-top: 25px !important;
}

.medad-pm-projects-table-container {
    overflow-x: auto !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

.medad-pm-front-dashboard-wrapper .wp-list-table {
    width: 100% !important;
    min-width: 600px !important;
    border-collapse: collapse !important;
    margin-top: 15px !important;
    background-color: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    border-radius: 8px !important;
}

.medad-pm-front-dashboard-wrapper .wp-list-table th,
.medad-pm-front-dashboard-wrapper .wp-list-table td {
    padding: 10px 12px !important;
    border: 1px solid #eee !important;
    text-align: right !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

.medad-pm-front-dashboard-wrapper .wp-list-table th {
    background-color: #f5f5f5 !important;
    font-weight: bold !important;
    color: #555 !important;
    text-transform: uppercase !important;
}

.medad-pm-front-dashboard-wrapper .wp-list-table tbody tr:nth-child(even) {
    background-color: #fcfcfc !important;
}

.medad-pm-front-dashboard-wrapper .wp-list-table tbody tr:hover {
    background-color: #f0f0f0 !important;
}

.medad-pm-front-dashboard-wrapper .wp-list-table .column-actions a.button {
    padding: 4px 8px !important;
    font-size: 11px !important;
    margin-left: 4px !important;
}

.medad-pm-front-dashboard-wrapper .wp-list-table .column-actions a.button-danger {
    background-color: #dc3545 !important;
}

.medad-pm-front-dashboard-wrapper .wp-list-table .column-actions a.button-danger:hover {
    background-color: #c82333 !important;
}

.medad-pm-front-dashboard-wrapper .tablenav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 20px !important;
    margin-bottom: 10px !important;
}

.medad-pm-front-dashboard-wrapper .tablenav .actions {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.medad-pm-front-dashboard-wrapper .tablenav .search-box {
    margin-right: 10px !important;
    margin-bottom: 10px !important;
}

.medad-pm-front-dashboard-wrapper .tablenav .search-box input[type="search"] {
    padding: 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    width: auto !important;
}

.medad-pm-front-dashboard-wrapper .tablenav .search-box input[type="submit"] {
    padding: 8px 12px !important;
    background-color: #0073aa !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
}

.medad-pm-front-dashboard-wrapper .tablenav .tablenav-pages {
    font-size: 14px !important;
    color: #555 !important;
    margin-bottom: 10px !important;
}

.medad-pm-front-dashboard-wrapper .tablenav .tablenav-pages .pagination-links a,
.medad-pm-front-dashboard-wrapper .tablenav .tablenav-pages .pagination-links span {
    text-decoration: none !important;
    padding: 5px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    margin-left: 5px !important;
}

.medad-pm-front-dashboard-wrapper .tablenav .tablenav-pages .pagination-links .current {
    background-color: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}

.medad-pm-front-dashboard-wrapper .form-table {
    width: 100% !important;
    margin-top: 20px !important;
}
.medad-pm-front-dashboard-wrapper .form-table th,
.medad-pm-front-dashboard-wrapper .form-table td {
    padding: 10px 0 !important;
    vertical-align: top !important;
    border: none !important;
}

.medad-pm-front-dashboard-wrapper .form-table th {
    width: 150px !important;
    font-weight: bold !important;
    text-align: right !important;
}

.medad-pm-front-dashboard-wrapper .regular-text,
.medad-pm-front-dashboard-wrapper .large-text,
.medad-pm-front-dashboard-wrapper input[type="date"],
.medad-pm-front-dashboard-wrapper input[type="number"],
.medad-pm-front-dashboard-wrapper select {
    width: 100% !important;
    max-width: 350px !important;
    padding: 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
}

.medad-pm-front-dashboard-wrapper textarea {
    min-height: 70px !important;
    width: 100% !important;
    max-width: 350px !important;
    padding: 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
}

.medad-pm-front-dashboard-wrapper .submit .button {
    margin-top: 15px !important;
}

@media (max-width: 768px) {
    .medad-pm-front-dashboard-wrapper {
        padding: 15px !important;
    }

    .medad-pm-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
        gap: 8px !important;
    }

    .medad-pm-stat-card {
        padding: 8px !important;
    }

    .medad-pm-stat-card h3 {
        font-size: 13px !important;
    }

    .medad-pm-stat-card p {
        font-size: 20px !important;
    }

    .medad-pm-recent-projects h3 {
        font-size: 16px !important;
    }

    .medad-pm-recent-projects ul li {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .medad-pm-recent-projects ul li span.status {
        margin-top: 5px !important;
    }

    .medad-pm-front-dashboard-wrapper .tablenav {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .medad-pm-front-dashboard-wrapper .tablenav .actions {
        flex-direction: column !important;
        width: 100% !important;
        align-items: flex-start !important;
    }

    .medad-pm-front-dashboard-wrapper .tablenav .search-box {
        margin-right: 0 !important;
        width: 100% !important;
        margin-bottom: 10px !important;
    }

    .medad-pm-front-dashboard-wrapper .tablenav .search-box input[type="search"] {
        width: 100% !important;
    }
    .medad-pm-front-dashboard-wrapper .tablenav .search-box input[type="submit"] {
        width: 100% !important;
        margin-top: 5px !important;
    }

    .medad-pm-front-dashboard-wrapper .tablenav .tablenav-pages {
        width: 100% !important;
        text-align: center !important;
        margin-top: 10px !important;
    }

    .medad-pm-front-dashboard-wrapper .wp-list-table {
        min-width: unset !important;
    }
    .medad-pm-front-dashboard-wrapper .wp-list-table th,
    .medad-pm-front-dashboard-wrapper .wp-list-table td {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
    .medad-pm-front-dashboard-wrapper .wp-list-table .column-actions a.button {
        padding: 3px 6px !important;
        font-size: 10px !important;
    }
}