/**
 * ملحق المشاريع — أنماط الواجهة الأمامية.
 * RTL آمن (خصائص منطقية) + متغيرات هوية القالب مع بدائل.
 */

.apx-form,
.apx-brief,
.apx-mine,
.apx-notice {
	direction: rtl;
	text-align: start;
}

/* بطاقة المطلوب */
.apx-brief {
	background: var(--acaprs-bg-soft, #f6f3ec);
	border: 1px solid var(--acaprs-secondary, #efd9a4);
	border-radius: 18px;
	padding: 22px 26px;
	margin-block-end: 26px;
}
.apx-kicker {
	display: inline-block;
	color: var(--acaprs-gold, #c9a24b);
	font-weight: 800;
	font-size: 0.85rem;
	margin-block-end: 6px;
}
.apx-kicker::before {
	content: "";
	display: block;
	width: 34px;
	height: 3px;
	background: var(--acaprs-gold, #c9a24b);
	border-radius: 2px;
	margin-block-end: 8px;
}
.apx-brief__title {
	margin: 0 0 10px;
	color: var(--acaprs-primary, #4b2c5f);
	font-size: 1.3rem;
}
.apx-brief__criteria {
	color: var(--acaprs-ink, #1f2a30);
	line-height: 1.9;
}

/* النموذج */
.apx-form {
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 8px 30px rgba(75, 44, 95, 0.08);
	padding: 28px;
	max-width: 760px;
}
.apx-field {
	margin-block-end: 20px;
}
.apx-field label {
	display: block;
	margin-block-end: 8px;
	color: var(--acaprs-primary, #4b2c5f);
}
.apx-required {
	color: #c0392b;
}
.apx-input {
	width: 100%;
	border: 1px solid #d9d4c7;
	border-radius: 12px;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 1rem;
	background: #fff;
}
.apx-input:focus {
	outline: 2px solid var(--acaprs-secondary, #efd9a4);
	border-color: var(--acaprs-primary, #4b2c5f);
}
textarea.apx-input {
	resize: vertical;
}
.apx-hint {
	display: block;
	font-size: 0.85rem;
	color: #7a7568;
	margin-block-start: 6px;
}
.apx-actions {
	margin-block-start: 26px;
}
.apx-btn {
	display: inline-block;
	background: var(--acaprs-primary, #4b2c5f);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 13px 38px;
	font-size: 1.05rem;
	font-weight: 800;
	font-family: inherit;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.apx-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(75, 44, 95, 0.28);
	color: #fff;
}
.apx-btn--sm {
	padding: 8px 22px;
	font-size: 0.9rem;
	margin-block-start: 10px;
}

/* متصفح المشاريع: صفّ واحد في كل سطر — النص يميناً والزر ملاصق لأقصى
   اليسار في كل الصفوف، بدل أن يقع الزر حيث ينتهي نص العنوان (سُلّم مائل).
   الصفّ مرن فيلتفّ على الشاشات الضيقة. */
.apx-project-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.apx-project-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.apx-project-item .apx-btn {
	flex-shrink: 0;
	margin: 0;
}

/* التنبيهات */
.apx-notice {
	border-radius: 14px;
	padding: 16px 20px;
	margin-block-end: 20px;
	line-height: 1.8;
}
.apx-notice--success {
	background: #eaf7ee;
	border: 1px solid #9ed3ae;
	color: #1e6b34;
}
.apx-notice--error {
	background: #fdecea;
	border: 1px solid #f1a9a0;
	color: #a93226;
}
.apx-notice--warning,
.apx-notice--info {
	background: #fdf6e7;
	border: 1px solid var(--acaprs-secondary, #efd9a4);
	color: #7a5c14;
}

/* بطاقات مشاريعي */
.apx-mine {
	display: grid;
	gap: 22px;
}
.apx-card {
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 8px 30px rgba(75, 44, 95, 0.08);
	padding: 24px 26px;
}
.apx-card__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	margin-block-end: 12px;
}
.apx-card__title {
	margin: 0 0 4px;
	color: var(--acaprs-primary, #4b2c5f);
	font-size: 1.15rem;
}
.apx-card__unit,
.apx-card__date {
	display: inline-block;
	font-size: 0.85rem;
	color: #7a7568;
	margin-inline-end: 10px;
}
.apx-card__body {
	line-height: 1.9;
	color: var(--acaprs-ink, #1f2a30);
}
.apx-badge {
	flex-shrink: 0;
	display: inline-block;
	border-radius: 999px;
	padding: 6px 16px;
	font-size: 0.82rem;
	font-weight: 800;
	white-space: nowrap;
}
.apx-badge--pending {
	background: #fdf6e7;
	color: #7a5c14;
	border: 1px solid var(--acaprs-secondary, #efd9a4);
}
.apx-badge--accepted {
	background: #eaf7ee;
	color: #1e6b34;
	border: 1px solid #9ed3ae;
}
.apx-badge--needs-work {
	background: #fff4e5;
	color: #b26a00;
	border: 1px solid #f5c87a;
}
.apx-badge--rejected {
	background: #fdecea;
	color: #a93226;
	border: 1px solid #f1a9a0;
}
.apx-files {
	list-style: none;
	margin: 12px 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.apx-files li a {
	display: inline-block;
	background: var(--acaprs-bg-soft, #f6f3ec);
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 0.82rem;
	color: var(--acaprs-primary, #4b2c5f);
	text-decoration: none;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	direction: ltr;
}
.apx-grade {
	margin-block-start: 16px;
	background: var(--acaprs-bg-soft, #f6f3ec);
	border-radius: 14px;
	padding: 16px 20px;
}
.apx-grade__row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.apx-grade__value {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--acaprs-primary, #4b2c5f);
}
.apx-grade__reviewer {
	font-size: 0.85rem;
	color: #7a7568;
}
.apx-criteria-table {
	width: 100%;
	border-collapse: collapse;
	margin-block-start: 12px;
	font-size: 0.9rem;
}
.apx-criteria-table th,
.apx-criteria-table td {
	border-block-end: 1px solid #e5e0d2;
	padding: 8px 6px;
	text-align: start;
}
.apx-feedback {
	margin-block-start: 12px;
}
.apx-feedback summary {
	cursor: pointer;
	font-weight: 800;
	color: var(--acaprs-primary, #4b2c5f);
}
.apx-audio {
	width: 100%;
	margin-block-start: 10px;
}

/* شارة الإدارة */
.apx-admin-badge {
	display: inline-block;
	background: #eef0ff;
	color: #3c3fa3;
	border-radius: 999px;
	padding: 2px 12px;
	font-size: 12px;
	font-weight: 700;
}

@media (max-width: 640px) {
	.apx-form,
	.apx-card {
		padding: 20px 16px;
	}
	.apx-card__head {
		flex-direction: column;
	}
	/* م5 (1.1.9): جدول المعايير يمرَّر داخلياً بدل ضغط الأعمدة */
	.apx-criteria-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ب1 (1.1.9): أزرار صغيرة بارتفاع لمس مريح */
.apx-btn--sm { min-height: 44px; display: inline-flex; align-items: center; }

.apx-brief__meta{display:flex;gap:1.2rem;flex-wrap:wrap;color:#5b5b66;font-size:.92rem;margin:.4rem 0 1rem}
.apx-brief__h{font-size:1.08rem;margin:1.3rem 0 .5rem;color:#4B2C5F;border-bottom:2px solid #EFD9A4;padding-bottom:.3rem}
.apx-brief__text{margin:0 0 .6rem;line-height:1.9}
.apx-brief__text ol,.apx-brief__text ul{margin:.4rem 0;padding-inline-start:1.4rem}
.apx-brief__text li{margin-bottom:.35rem}

/* صفحة «مشاريعي»: أقسام (مسلَّمة / بانتظار / لم تُسلَّم / تخرج / خبرة). */
.apx-section{font-size:1.25rem;margin:2.2rem 0 1rem;color:var(--acaprs-primary,#4b2c5f);border-bottom:2px solid var(--acaprs-secondary,#efd9a4);padding-bottom:.35rem}
.apx-section:first-child{margin-top:.2rem}
.apx-subsection{font-size:1.05rem;margin:1.4rem 0 .5rem;color:var(--acaprs-primary,#4b2c5f)}
.apx-section__note{margin:0 0 1rem;color:#5b5b66;line-height:1.9}
.apx-card__track{display:block;color:#5b5b66;font-size:.92rem;margin-top:2px}
.apx-card__peer-grades{display:block;margin-top:4px}
.apx-mini-list{margin:.5rem 0 1rem;padding-inline-start:1.4rem;line-height:2}
.apx-mini-item__hint{color:#8a8a93;font-size:.88rem}
.apx-capstone{background:var(--acaprs-bg-soft,#f6f3ec);border:1px solid var(--acaprs-secondary,#efd9a4);border-radius:14px;padding:16px 20px;margin:0 0 1rem;line-height:1.9}
.apx-capstone p{margin:0 0 .4rem}
.apx-capstone p:last-child{margin-bottom:0}
.apx-capstone .apx-mini-list{margin-bottom:.4rem}

/* ============================================================
   «مشاريعي» 1.2.0 — لغة تصميم بوابة الطالب (نفس هوية «لوحتي»):
   ترويسة بنفسجية بشارات ملخص، رؤوس أقسام بحد ذهبي وعدّاد، بطاقات
   بشارات حالة ملوّنة، حلقة درجة بارزة، بطاقات مصغرة، قائمة بوابة،
   وصفوف خبرة. كل القواعد داخل نطاق .apx-mine (غلاف صفحة مشاريعي)
   حتى لا تتسرب إلى بقية الإضافة (خصوصاً نموذج تسليم المشروع الذي
   يشارك هذا الملف) — باستثناء .apx-empty التي قد تُعرض منفردة
   عند الخروج المبكر من render()، وهي كلاسات لا يولّدها غير مشاريعي.
   الاتجاه RTL والمحاذاة لليمين مثبّتان صراحة.
   ============================================================ */
.apx-mine {
	text-align: right;
}

/* ترويسة الصفحة */
.apx-mine .apx-hero {
	background: linear-gradient(135deg, var(--acaprs-primary, #4b2c5f) 0%, #3a2349 100%);
	border-radius: 18px;
	color: #fff;
	padding: 26px 22px;
	box-shadow: 0 12px 34px rgba(75, 44, 95, 0.09);
	position: relative;
	overflow: hidden;
	direction: rtl;
	text-align: right;
}
.apx-mine .apx-hero::after {
	content: "";
	position: absolute;
	inset-inline-end: -60px;
	top: -60px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	background: rgba(239, 217, 164, 0.14);
}
.apx-mine .apx-hero__title {
	color: #fff;
	font-size: 1.65rem;
	font-weight: 800;
	line-height: 1.6;
	margin: 0;
	position: relative;
	z-index: 1;
}
.apx-mine .apx-hero__sub {
	color: #e9ddf2;
	margin: 4px 0 0;
	max-width: 640px;
	line-height: 1.9;
	position: relative;
	z-index: 1;
}
.apx-mine .apx-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
	position: relative;
	z-index: 1;
}
.apx-mine .apx-chip {
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(239, 217, 164, 0.45);
	color: #fff;
	border-radius: 999px;
	padding: 4px 15px;
	font-weight: 700;
	font-size: 0.9rem;
}
.apx-mine .apx-chip b {
	color: var(--acaprs-secondary, #efd9a4);
	font-weight: 900;
	unicode-bidi: isolate;
}
.apx-mine .apx-chip--ok {
	background: rgba(26, 122, 58, 0.35);
	border-color: rgba(140, 230, 170, 0.5);
}

/* رؤوس الأقسام */
.apx-mine .apx-sec-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	border-bottom: 2px solid var(--acaprs-secondary, #efd9a4);
	padding-bottom: 8px;
	margin: 10px 0 4px;
}
.apx-mine .apx-sec-head .apx-section {
	border-bottom: none;
	margin: 0;
	padding-bottom: 0;
	font-size: 1.28rem;
	font-weight: 800;
}
.apx-mine .apx-sec-count {
	background: var(--acaprs-bg-soft, #f6f3ec);
	border: 1px solid #e8e0d2;
	color: var(--acaprs-primary, #4b2c5f);
	border-radius: 999px;
	padding: 2px 13px;
	font-size: 0.9rem;
	font-weight: 800;
	unicode-bidi: isolate;
}
.apx-mine .apx-subsection {
	font-size: 1.05rem;
	font-weight: 800;
	margin: 20px 0 10px;
}

/* البطاقات والشارات */
.apx-mine .apx-card {
	border: 1px solid #e8e0d2;
	box-shadow: 0 12px 34px rgba(75, 44, 95, 0.09);
	position: relative;
	overflow: hidden;
}
.apx-mine .apx-card--gold::before {
	content: "";
	position: absolute;
	top: 0;
	inset-inline: 0;
	height: 5px;
	background: linear-gradient(to left, #c9a24b, var(--acaprs-secondary, #efd9a4));
}
.apx-mine .apx-card__track {
	color: #6f6580;
}
.apx-mine .apx-card__excerpt {
	line-height: 1.95;
	margin: 0 0 6px;
}
.apx-mine .apx-badge--gray {
	background: #f1ede3;
	color: #6f6580;
	border: 1px solid #e8e0d2;
}
.apx-mine .apx-badge--neutral {
	background: #efe7f5;
	color: var(--acaprs-primary, #4b2c5f);
	border: 1px solid #d9c8ec;
}
.apx-mine .apx-card__review {
	margin-top: 6px;
	color: #6f6580;
	font-size: 0.93rem;
	line-height: 1.9;
}
.apx-mine .apx-card__review .apx-card__result {
	font-weight: 800;
}
.apx-mine .apx-files li a {
	border: 1px solid #e8e0d2;
	unicode-bidi: isolate;
}

/* كتلة الدرجة البارزة: حلقة + تقييمات المراجعين + زر النتيجة */
.apx-mine .apx-grade-row {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 14px;
	background: var(--acaprs-bg-soft, #f6f3ec);
	border: 1px solid #e8e0d2;
	border-radius: 14px;
	padding: 14px 18px;
}
.apx-mine .apx-grade-ring {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.apx-mine .apx-grade-ring i {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-style: normal;
	line-height: 1.15;
	color: var(--acaprs-primary, #4b2c5f);
}
.apx-mine .apx-grade-ring i b {
	font-size: 1.35rem;
	font-weight: 900;
}
.apx-mine .apx-grade-ring i small {
	font-size: 0.62rem;
	color: #6f6580;
	font-weight: 700;
}
.apx-mine .apx-grade-info {
	flex: 1;
	min-width: 180px;
}
.apx-mine .apx-grade-label {
	display: block;
	font-weight: 800;
	color: var(--acaprs-primary, #4b2c5f);
}
.apx-mine .apx-grade-row .apx-card__peer-grades {
	color: #6f6580;
	font-size: 0.93rem;
}
.apx-mine .apx-grade-row .apx-btn {
	margin: 0;
}

/* كتلة الدرجة القديمة وملاحظات المراجع داخل مشاريعي */
.apx-mine .apx-grade {
	border: 1px solid #e8e0d2;
}
.apx-mine .apx-feedback {
	border-top: 1px dashed #e8e0d2;
	padding-top: 10px;
}

/* البطاقات المصغرة: لم تُسلَّم بعد */
.apx-mine .apx-mini-grid {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	line-height: 1.7;
}
.apx-mine .apx-mini-card {
	background: #fff;
	border: 1px solid #e8e0d2;
	border-radius: 14px;
	padding: 14px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	box-shadow: 0 6px 18px rgba(75, 44, 95, 0.05);
}
.apx-mine .apx-mini-card__title {
	font-weight: 800;
	color: var(--acaprs-ink, #241a2e);
	text-decoration: none;
}
.apx-mine a.apx-mini-card__title:hover {
	color: var(--acaprs-primary, #4b2c5f);
	text-decoration: underline;
}
.apx-mine .apx-mini-card__hint {
	color: #6f6580;
	font-size: 0.86rem;
	display: block;
}

/* مشروع التخرج: بطاقة وصفوف حالة وقائمة بوابة */
.apx-mine .apx-capstone--card {
	background: #fff;
	border: 1px solid #e8e0d2;
	border-radius: 18px;
	box-shadow: 0 12px 34px rgba(75, 44, 95, 0.09);
	padding: 20px 22px;
}
.apx-mine .apx-status-rows {
	display: grid;
	gap: 10px;
	margin: 0 0 0.6rem;
}
.apx-mine .apx-status-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px 12px;
	flex-wrap: wrap;
	background: var(--acaprs-bg-soft, #f6f3ec);
	border: 1px solid #e8e0d2;
	border-radius: 12px;
	padding: 11px 16px;
	margin: 0;
}
.apx-mine .apx-gate-open {
	background: #e9f7ee;
	border: 1px solid #9ed3ae;
	color: #1a7a3a;
	border-radius: 12px;
	padding: 11px 16px;
	font-weight: 700;
}
.apx-mine .apx-gate-list {
	list-style: none;
	margin: 12px 0 0.4rem;
	padding: 0;
	display: grid;
	gap: 10px;
	line-height: 1.8;
}
.apx-mine .apx-gate-item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	background: var(--acaprs-bg-soft, #f6f3ec);
	border: 1px solid #e8e0d2;
	border-radius: 12px;
	padding: 11px 16px;
}
.apx-mine .apx-gate-ic {
	font-size: 1.15rem;
	line-height: 1.5;
}
.apx-mine .apx-gate-txt {
	flex: 1;
}

/* صفوف الخبرة الخارجية داخل مشاريعي */
.apx-mine .apx-xp-rows {
	display: grid;
	gap: 10px;
	margin: 0;
}
.apx-mine .apx-xp-row {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--acaprs-bg-soft, #f6f3ec);
	border: 1px solid #e8e0d2;
	border-radius: 12px;
	padding: 11px 16px;
	flex-wrap: wrap;
	line-height: 1.8;
}
.apx-mine .apx-xp-type {
	font-weight: 800;
	min-width: 86px;
}
.apx-mine .apx-xp-status {
	color: #6f6580;
	flex: 1;
	font-size: 0.95rem;
}
.apx-mine .apx-xp-actions {
	margin: 0;
}

/* الحالة الفارغة المصممة (قد تُعرض منفردة خارج .apx-mine) */
.apx-empty {
	border: 1.5px dashed #d9cba6;
	background: #fffdf6;
	color: var(--acaprs-ink, #241a2e);
	border-radius: 18px;
	padding: 28px 22px;
	margin-block-end: 20px;
	text-align: center;
	direction: rtl;
	line-height: 1.9;
}
.apx-empty__ic {
	font-size: 2rem;
	line-height: 1.2;
}
.apx-empty__msg {
	color: #6f6580;
	max-width: 520px;
	margin: 6px auto 0;
}
.apx-empty .apx-btn {
	margin-top: 14px;
}

/* شاشات أوسع */
@media (min-width: 700px) {
	.apx-mine .apx-hero {
		padding: 30px 34px;
	}
	.apx-mine .apx-mini-grid {
		grid-template-columns: 1fr 1fr;
	}
}
