/* ============================================================
   نظام التصميم الموحّد — Graduation Project Tracker
   طبقة واحدة فوق Tabler تُطبَّق على كل لوحات التحكم وصفحات الدخول.
   نفس التوكنز المستخدمة في الموقع العام (premium.css).
   ============================================================ */

/* ==================== 1) Design Tokens ==================== */
:root {
    /* --- الهوية: رمادي معماري (نفس premium.css) ---
       كانت نيلية/بنفسجية ولم تُحدَّث مع تبديل هوية الموقع، فبقيت صفحة
       الدخول واللوحات الثلاث على اللون القديم. --ds-violet و --ds-cyan
       لا تُحذفان لأن أقساماً كثيرة تستهلكهما؛ تُعاد توجيههما إلى درجتَي
       الأزرق نفسه فتنتقل تلك الأقسام معنا بدل أن تتنافر. */
    --ds-brand-50: #eff6ff;
    --ds-brand-100: #dbeafe;
    --ds-brand-200: #bfdbfe;
    --ds-brand-300: #93c5fd;
    --ds-brand-400: #60a5fa;
    --ds-brand-500: #3b82f6;
    --ds-brand-600: #2563eb;
    --ds-brand-700: #1d4ed8;
    --ds-brand-900: #1e3a8a;
    --ds-brand-950: #172554;
    --ds-violet: #1e40af;
    --ds-cyan: #60a5fa;
    /* التدرّجان صارا لوناً مصمتاً — التمييز من الطباعة والفراغ لا من التدرّج */
    --ds-gradient: var(--ds-brand-600);
    --ds-gradient-135: var(--ds-brand-600);

    /* --- الحالات (Semantic) --- */
    --ds-success: #10b981;
    --ds-success-bg: #ecfdf5;
    --ds-warning: #f59e0b;
    --ds-warning-bg: #fffbeb;
    --ds-danger: #e11d48;
    --ds-danger-bg: #fff1f2;
    --ds-info: #0ea5e9;
    --ds-info-bg: #f0f9ff;

    /* --- الأسطح والنصوص: رماديات باردة محايدة لا مزرقّة --- */
    --ds-bg: #fbfbfc;
    --ds-surface: #ffffff;
    --ds-surface-sunk: #f4f4f5;
    --ds-border: #e4e4e7;
    --ds-border-strong: #d4d4d8;
    --ds-ink: #09090b;
    --ds-ink-soft: #3f3f46;
    --ds-ink-mute: #5c5c66;

    /* --- لون الفعل والحالة: الحبر للنصوص فقط، والأزرق للنشط والمنجَز والتقدّم
       (كالموقع وصفحة الدخول) — لا أزرار ولا مؤشّرات سوداء في اللوحات --- */
    --ds-accent: var(--ds-brand-600);
    --ds-accent-strong: var(--ds-brand-700);
    --ds-accent-soft: var(--ds-brand-50);

    /* --- الزوايا (Radius scale) --- */
    --ds-radius-sm: 8px;
    --ds-radius-md: 12px;
    --ds-radius-lg: 16px;
    --ds-radius-xl: 20px;
    --ds-radius-pill: 999px;

    /* --- الظلال (Elevation) --- */
    /* ظلال محايدة ومنخفضة — الارتفاع من الحدّ لا من الضبابية الملوّنة */
    --ds-shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.04);
    --ds-shadow-md: 0 1px 2px rgba(9, 9, 11, 0.04), 0 6px 16px -10px rgba(9, 9, 11, 0.10);
    --ds-shadow-lg: 0 1px 2px rgba(9, 9, 11, 0.05), 0 12px 32px -14px rgba(9, 9, 11, 0.14);
    --ds-shadow-glow: 0 0 0 3px var(--ds-brand-50);

    /* --- التباعد (8px scale) --- */
    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
    --ds-space-6: 24px;
    --ds-space-8: 32px;
    --ds-space-12: 48px;

    /* --- الحركة --- */
    --ds-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ds-dur-fast: 0.15s;
    --ds-dur: 0.3s;
    --ds-dur-slow: 0.5s;

    /* --- الخطوط: Almarai للعناوين، IBM Plex Sans Arabic للنصوص الكثيفة --- */
    --ds-font-display: 'Almarai', 'IBM Plex Sans Arabic', -apple-system, 'Segoe UI', Tahoma, sans-serif;

    /* --- ربط توكنز Tabler بالنظام --- */
    --tblr-font-sans-serif: 'IBM Plex Sans Arabic', 'Cairo', -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --tblr-primary: var(--ds-brand-600);
    --tblr-primary-rgb: 37, 99, 235;
    --tblr-primary-fg: #ffffff;
    --tblr-link-color: var(--ds-brand-600);
    --tblr-link-hover-color: var(--ds-brand-700);
    --tblr-body-bg: var(--ds-bg);
    --tblr-body-color: var(--ds-ink);
    --tblr-border-color: var(--ds-border);
    --tblr-border-radius: var(--ds-radius-md);
    --tblr-card-border-radius: var(--ds-radius-lg);
}

body {
    background: var(--ds-bg);
    color: var(--ds-ink);
    -webkit-font-smoothing: antialiased;
}

/* كانت بقعتين ملوّنتين مكتوبتين مباشرة خارج التوكنز — حُذفتا.
   العمق يأتي من الحدود والفراغ لا من تدرّجات الخلفية. */
.page-wrapper { background: var(--ds-bg); }

/* ==================== 2) Typography ====================
   العربية خط متصل: أي letter-spacing موجباً كان أو سالباً يفكّ وصل
   الحروف أو يسحقها. التباعد صفر في كل النصوص العربية. */
h1, h2, h3, h4, h5, h6,
.page-title, .card-title, .h1, .h2, .h3, .h4 {
    font-family: var(--ds-font-display);
    letter-spacing: 0;
}
.page-title {
    font-weight: 800;
    color: var(--ds-ink);
}
.page-pretitle {
    color: var(--ds-brand-600);
    font-weight: 700;
    letter-spacing: 0;
}
.card-title { font-weight: 700; color: var(--ds-ink); }
.text-secondary { color: var(--ds-ink-mute) !important; }

.page-subtitle {
    margin-top: 5px;
    font-size: 13.5px;
    color: var(--ds-ink-mute);
}

/* ==================== 2) Layout width ====================
   container-xl يحصر المحتوى عند ~١٣٢٠ بكسل، فتضيع على شاشة ١٩٠٠ نحو
   ٣٠٠ بكسل فارغة من كل جانب. لوحة إدارة تعرض جداول: العرض مساحة عمل
   لا هامش قراءة. نفتحه مع حدّ أقصى معقول يمنع تمدّد الجداول بلا نهاية. */
.page-body > .container-xl,
.page-header .container-xl,
header.navbar > .container-xl,
.footer .container-xl {
    max-width: 1680px;
    padding-inline: 28px;
}

@media (max-width: 991.98px) {
    .page-body > .container-xl,
    .page-header .container-xl,
    header.navbar > .container-xl,
    .footer .container-xl { padding-inline: 16px; }
}

/* ==================== 2A) Dashboard blocks ====================
   الصفحة كانت رفّ أدوات بلا ترتيب. صارت أربعة فصول بترتيب الإلحاح:
   ما يحتاج إجراءً ← حالة الفصل ← التوزيع ← آخر النشاط.
   لكل فصل عنوانه، فتعرف العين أين تبدأ وما علاقة كل قسم بجاره. */
.dash-block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-family: var(--ds-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-ink);
    letter-spacing: 0;
}
.dash-block-title i { color: var(--ds-ink-mute); font-size: 17px; }

.dash-clear {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    color: var(--ds-ink-mute);
    font-size: 13.5px;
}
.dash-clear i { color: #047857; font-size: 17px; }

/* ---- لوح القيادة الداكن ----
   قسما «يحتاج إجراءً» و«حالة الفصل» كانا صندوقين أبيضين منفصلين بنفس
   الوزن، فلا بؤرة في الصفحة ولا علاقة مرئية بينهما رغم أن الإجراء
   ناتج عن الحالة. لوح واحد داكن وسط الفاتح يحلّ الأمرين. */
.cmd-panel {
    --cmd-line: #dbe4f0;
    --cmd-mute: var(--ds-ink-mute);

    /* البؤرة من الطبقات لا من الإظلام: أرضية زرقاء باردة خفيفة جداً،
       وبطاقات بيضاء فوقها. الصفحة تبقى فاتحة بالكامل. */
    background: #f4f7fb;
    border: 1px solid var(--cmd-line);
    border-radius: var(--ds-radius-lg);
    color: var(--ds-ink);
    overflow: hidden;
}

.cmd-context {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    border-bottom: 1px solid var(--cmd-line);
    font-size: 12.5px;
    color: var(--cmd-mute);
}
.cmd-context i { font-size: 16px; }

.cmd-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
}

/* الأرقام الحيوية */
.cmd-vitals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 22px;
    gap: 18px;
}
.vital { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vital-n {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--ds-font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}
.vital-l { font-size: 13px; color: var(--ds-ink-soft); }
.vital-s { font-size: 11.5px; color: var(--ds-ink-mute); }

/* عمود الإجراءات: بطاقات بيضاء فوق الأرضية المُلوّنة — الطبقة هي ما
   يميّزه، لا لون داكن. */
.cmd-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-inline-start: 1px solid var(--cmd-line);
}
.cmd-action {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--cmd-line);
    border-radius: 10px;
    background: var(--ds-surface);
    color: var(--ds-ink-soft);
    text-decoration: none;
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease;
}
.cmd-action:hover {
    border-color: var(--ds-brand-300);
    box-shadow: var(--ds-shadow-sm);
    color: var(--ds-ink);
}
.cmd-action > i:first-child { font-size: 17px; color: var(--ds-brand-600); flex: none; }
.cmd-action-n {
    font-family: var(--ds-font-display);
    font-size: 19px;
    font-weight: 800;
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
    flex: none;
}
.cmd-action-l {
    font-size: 12.5px;
    line-height: 1.5;
    min-width: 0;
}
.cmd-action-go {
    margin-inline-start: auto;
    font-size: 15px;
    color: #b4b4bb;
    flex: none;
    transition: color var(--ds-dur-fast) ease;
}
.cmd-action:hover .cmd-action-go { color: var(--ds-ink); }

.cmd-clear {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 16px 14px;
    border: 1px solid var(--cmd-line);
    border-radius: 10px;
    background: var(--ds-surface);
    font-size: 13px;
    color: var(--ds-ink-mute);
}
.cmd-clear i { color: #047857; font-size: 17px; }

/* شريط الحالات */
.cmd-status {
    padding: 16px 22px 20px;
    border-top: 1px solid var(--cmd-line);
}
.cmd-status-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 11px;
    font-size: 12.5px;
    color: var(--cmd-mute);
}
.cmd-status-head b {
    font-family: var(--ds-font-display);
    color: var(--ds-ink);
    font-size: 13.5px;
}

/* أطوال متجاورة تُقارَن بالعين أسهل من زوايا قطاعات، ويُبنى بـ CSS
   فيسقط اعتماد ApexCharts من CDN خارجي. */
.stack-bar {
    display: flex;
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #e3eaf4;
}
.stack-seg { display: block; height: 100%; transition: opacity var(--ds-dur-fast) ease; }
.stack-bar:hover .stack-seg { opacity: .45; }
.stack-bar .stack-seg:hover { opacity: 1; }

.stack-key {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 13px 0 0;
    padding: 0;
    list-style: none;
}
.stack-key li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--cmd-mute);
}
.stack-key b {
    font-family: var(--ds-font-display);
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}
.key-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

@media (max-width: 1100px) {
    .cmd-main { grid-template-columns: 1fr; }
    .cmd-actions {
        border-inline-start: 0;
        border-top: 1px solid var(--cmd-line);
        flex-direction: row;
        flex-wrap: wrap;
    }
    .cmd-action { flex: 1 1 220px; }
    .cmd-action + .cmd-action {
        border-top: 0;
        border-inline-start: 1px solid var(--cmd-line);
    }
}
@media (max-width: 620px) {
    .cmd-vitals { grid-template-columns: 1fr; gap: 14px; }
    .cmd-action + .cmd-action { border-inline-start: 0; border-top: 1px solid var(--cmd-line); }
}

/* ---- ٣) و ٤) ألواح التوزيع والنشاط ---- */
/* align-items: start حتى يحتضن كل لوح محتواه. المطّ الافتراضي كان
   يساوي الارتفاعين فيترك فراغاً ميتاً داخل اللوح الأقصر — والفراغ
   داخل صندوق يبدو مبتوراً، بينما اختلاف الارتفاع طبيعي. */
.dist-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}

/* سطر المجموع: يملأ ذيل اللوح بمعلومة بدل أن يُترك فارغاً */
.dist-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 18px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface-sunk);
    font-size: 12.5px;
    color: var(--ds-ink-mute);
}
.dist-foot b {
    font-family: var(--ds-font-display);
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}
.dist-panel {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.dist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--ds-border);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ds-ink);
}
.dist-head a {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ds-ink-mute);
    text-decoration: none;
    transition: color var(--ds-dur-fast) ease;
}
.dist-head a:hover { color: var(--ds-brand-600); }

/* الصفّ نفسه يمتلئ بالنسبة بدل شريط محشور في عمود ضيّق: يستعمل العرض
   كاملاً، ويُقرأ في لمحة، ويختفي الفراغ الميت بين الاسم والشريط. */
.dist-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    font-size: 13px;
    overflow: hidden;
}
.dist-row + .dist-row { border-top: 1px solid var(--ds-border); }

.dist-fill {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    background: var(--ds-brand-50);
    z-index: 0;
    transition: width var(--ds-dur-slow) var(--ds-ease);
}
.dist-row:hover .dist-fill { background: var(--ds-brand-100); }

.dist-name,
.dist-n { position: relative; z-index: 1; }

.dist-name {
    color: var(--ds-ink);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dist-n {
    font-family: var(--ds-font-display);
    font-weight: 700;
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
    flex: none;
}

/* صفّ بقيمة صفر: يبقى ظاهراً ليُعرف أنه موجود، لكنه يخفت */
.dist-row.is-zero .dist-name,
.dist-row.is-zero .dist-n { color: var(--ds-ink-mute); font-weight: 400; }

.dist-empty { margin: 0; padding: 22px 18px; color: var(--ds-ink-mute); font-size: 13px; }

/* ---- الرسم الزمني (Chart.js مستضافة محلياً) ----
   الارتفاع يُضبط هنا لا في خاصية height، لأن Chart.js ترسم على canvas
   يتمدّد بالحاوية حين maintainAspectRatio: false. */
.trendchart {
    position: relative;
    height: 240px;
}
.trendchart canvas { display: block; }

.dist-head-note { font-size: 12px; font-weight: 500; color: var(--ds-ink-mute); }

/* صفوف النشاط */
.feed-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
.feed-row + .feed-row { border-top: 1px solid var(--ds-border); }
.feed-row:hover { background: var(--ds-surface-sunk); }
.feed-body { min-width: 0; flex: 1; }
.feed-title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ds-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feed-meta { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ds-ink-mute); }
.feed-new {
    flex: none;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-700);
    font-size: 11px;
    font-weight: 700;
}

/* سهم ثابت في ذيل كل صفّ: يملأ العمود الذي كان فارغاً في لوح الرسائل،
   ويُعلن أن الصفّ قابل للنقر — وهو ما لم يكن ظاهراً. */
.feed-go {
    flex: none;
    font-size: 15px;
    color: #c9c9cf;
    transition: color var(--ds-dur-fast) ease, transform var(--ds-dur) var(--ds-ease);
}
.feed-row:hover .feed-go { color: var(--ds-ink); transform: translateX(-3px); }
[dir="ltr"] .feed-row:hover .feed-go { transform: translateX(3px); }

@media (max-width: 991.98px) {
    .dist-grid { grid-template-columns: 1fr; }
    .state-figures { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .dist-row { grid-template-columns: minmax(0, 1fr) 60px 40px; gap: 10px; }
}

/* ==================== 2a) Attention bar ====================
   كانت بطاقتين بحجم كامل لسطرين من المعلومات. صارت شريطاً واحداً:
   الرقم أولاً ثم ما يعنيه، لأن الأدمن يبحث عن العدد لا عن الشرح. */
.attention-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--ds-border);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    overflow: hidden;
}
.attention-item {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--ds-surface);
    color: var(--ds-ink-soft);
    font-size: 13.5px;
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
.attention-item:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
.attention-item > i:first-child { color: var(--ds-brand-600); font-size: 17px; }
.attention-item b {
    font-family: var(--ds-font-display);
    font-size: 17px;
    font-weight: 800;
    color: var(--ds-ink);
}
.attention-go { margin-inline-start: auto; color: #b4b4bb; font-size: 15px; }
.attention-item:hover .attention-go { color: var(--ds-ink); }

/* ==================== 2b) Stat strip ====================
   بدل أربع بطاقات كل منها ~١٤٠ بكسل ارتفاعاً بأيقونة وشارة وسطر فرعي،
   شريط واحد بخلايا تتقاسم حدودها وارتفاعه ~٩٠. كثافة أعلى ومسح أسرع. */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--ds-border);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    overflow: hidden;
}
.stat-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px 18px;
    background: var(--ds-surface);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
.stat-cell:hover { background: var(--ds-surface-sunk); }
.stat-label { font-size: 12.5px; color: var(--ds-ink-mute); }
.stat-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--ds-font-display);
    font-size: 27px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 11.5px; color: var(--ds-ink-mute); }
/* شارة الحالة داخل خانة رقمية تبقى بحجم شارة — لا تتضخّم إلى ٢٧ بكسل */
.stat-value .status-badge {
    align-self: flex-start;
    margin-top: 3px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

/* مؤشّر الاتجاه: نصّ صغير لا شارة ملوّنة تنافس الرقم */
.trend {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-family: var(--ds-font-body, inherit);
    font-size: 11.5px;
    font-weight: 600;
}
.trend i { font-size: 13px; }
.trend--up { color: #047857; }
.trend--down { color: #be123c; }

@media (max-width: 991.98px) {
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
/* عمودان حتى ٣٤٠: عمود واحد على ٣٧٥ يمدّ أربعة أرقام إلى ٣٦٠ بكسل تمريراً */
@media (max-width: 520px) {
    .stat-cell { padding: 13px 14px; }
    .stat-value { font-size: 23px; }
}
@media (max-width: 340px) {
    .stat-strip { grid-template-columns: 1fr; }
}

/* ==================== 2c) KPI icon ====================
   كانت أربع أيقونات بأربعة ألوان بلا معنى دلالي. صارت حبرية محايدة،
   واللون للبطاقة التي تحتاج تدخّلاً وحدها. */
.kpi-icon {
    flex: none;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink);
    border: 1px solid var(--ds-border);
}
.kpi-icon i { font-size: 22px; }
.kpi-icon--accent {
    background: var(--ds-brand-50);
    color: var(--ds-brand-600);
    border-color: var(--ds-brand-100);
}

/* ==================== 2c) Table action buttons ====================
   كان التعديل أخضر والحذف أحمر في كل صف — والتعديل ليس «نجاحاً»،
   ولونان مشبعان في مئات الصفوف ضجيج. صارا شبحين، والحذف وحده
   يحمّر عند قصده. */
.btn-action {
    width: 30px; height: 30px;
    padding: 0;
    display: inline-grid; place-items: center;
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    background: transparent;
    color: var(--ds-ink-mute);
    transition: color var(--ds-dur-fast) ease,
                border-color var(--ds-dur-fast) ease,
                background-color var(--ds-dur-fast) ease;
}
.table .btn-action + .btn-action { margin-inline-start: 6px; }
.btn-action:hover {
    color: var(--ds-ink);
    border-color: var(--ds-border-strong);
    background: var(--ds-surface-sunk);
}
.btn-action.btn-action--danger:hover {
    color: var(--ds-danger);
    border-color: #fecdd3;
    background: var(--ds-danger-bg);
}
.btn-action i { font-size: 15px; }

/* جرّبنا إخفاءها حتى المرور على الصفّ — والنتيجة أن العمود يبدو
   معطوباً لا هادئاً: لا عنوان ولا محتوى. الأزرار الشبحية (حدّ شعرة
   ولون محايد) تكفي وحدها لخفض الضجيج، والفعل يبقى مرئياً ومكتشفاً.
   يبقى التوكيد عند المرور وحده. */
.table tbody .btn-group .btn-action { opacity: .75; }
.table tbody tr:hover .btn-group .btn-action,
.table tbody tr:focus-within .btn-group .btn-action { opacity: 1; }

/* زرّ فعل معطَّل: يبقى مرئياً ليقول إن الفعل موجود لكنه ممنوع الآن،
   ولا يبدو قابلاً للنقر */
.btn-action.is-disabled {
    opacity: .4;
    cursor: not-allowed;
    background: var(--ds-surface-sunk);
}
.btn-action.is-disabled:hover {
    color: var(--ds-ink-mute);
    border-color: var(--ds-border);
    background: var(--ds-surface-sunk);
}

/* ==================== الصورة الشخصية ====================
   الصورة اختيارية، والأحرف الأولى هي الأساس. فالقاعدة هنا لا تغيّر
   شكل الأفاتار بل تملؤه بصورة حين توجد — بنفس المقاس والاستدارة
   في كل موضع، بلا قاعدة لكل شكل. */
.has-photo {
    padding: 0;
    overflow: hidden;
    background: var(--ds-surface-sunk);
    /* اللون والخط لا معنى لهما حين تملأ الصورة الحيّز */
    color: transparent;
    font-size: 0;
}
.has-photo > img {
    width: 100%;
    height: 100%;
    /* \u200Ecover\u200E لا \u200Econtain\u200E: الصورة تملأ المربّع ولا تُشوَّه ولا تترك
       أشرطة بيضاء — والقصّ تمّ عند الرفع فلا يُقصّ هنا إلا نادراً */
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

/* بطاقة الصورة الشخصية.
   كان الأفاتار والأزرار والنصّ الإرشادي في صفّ واحد داخل عمود ~٣٤٠
   بكسل، فتعصر الثلاثة ويُقطع النصّ. الصورة تتصدّر مركزيةً الآن،
   وهي نفسها منطقة النقر والإفلات — فلا زرّ «اختيار» منفصل أصلاً. */
.avatar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.avatar-card > form { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }

.avatar-drop {
    position: relative;
    display: block;
    border-radius: 22px;
    cursor: pointer;
    transition: transform var(--ds-dur-fast) ease;
}
.avatar-drop:hover { transform: translateY(-1px); }
.avatar-drop:focus-within { outline: 2px solid var(--ds-brand-600); outline-offset: 4px; border-radius: 22px; }
.avatar-card .profile-avatar { width: 108px; height: 108px; font-size: 34px; border-radius: 22px; }

/* طبقة الكاميرا تقول إن الصورة قابلة للتغيير — بلا زرّ يزاحمها */
.avatar-drop-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: inherit;
    background: rgba(9, 9, 11, .55);
    color: #fff;
    font-size: 26px;
    opacity: 0;
    transition: opacity var(--ds-dur-fast) ease;
}
.avatar-drop:hover .avatar-drop-overlay,
.avatar-drop:focus-within .avatar-drop-overlay,
.avatar-drop.is-over .avatar-drop-overlay { opacity: 1; }
.avatar-drop.is-over .avatar-drop-overlay { background: rgba(37, 99, 235, .70); }

.avatar-card-hint {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.8;
    text-align: center;
    color: var(--ds-ink-soft);
}
.avatar-card-hint span { font-size: 11px; color: var(--ds-ink-mute); }

@media (prefers-reduced-motion: reduce) {
    .avatar-drop:hover { transform: none; }
}
/* حقل الملف الأصلي مخفيّ والزرّ \u200E<label>\u200E يقوم مقامه — الحقل الخام
   لا يقبل تنسيقاً في أي متصفّح */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* الزرّ \u200E<label>\u200E يحتاج مؤشّر اليد: ليس زرّاً في نظر المتصفّح */
label.btn { cursor: pointer; margin: 0; }

/* ==================== الملف الشخصي ====================
   كانت بطاقة يسار شبه فارغة (بريد وجنس) ونموذج لا يتيح إلا رقم
   الجوال — بينما يستطيع المسؤول تعديل اسم أي مسؤول آخر. */
/* كان شريطاً أسود بارتفاع ٦٤ بكسل يتصدّر الصفحة — كتلة داكنة تسحب
   العين إليها وهي لا تحمل معلومة، وتناقض لوحة فاتحة بالكامل.
   التمييز الآن بحافة لونية رفيعة: تكفي لتقول «هذا تعريف لا نموذج»
   بلا أن تطغى. */
.profile-hero {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-sm);
    overflow: hidden;
}
.profile-hero-band {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--ds-brand-600);
}
.profile-hero-body {
    display: contents;
}
.profile-avatar {
    flex: none;
    width: 76px; height: 76px;
    display: grid; place-items: center;
    border-radius: 20px;
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    color: var(--ds-ink-soft);
    font-family: var(--ds-font-display);
    font-size: 25px;
    font-weight: 800;
}
.profile-identity { flex: 1 1 240px; min-width: 0; }
.profile-name {
    display: inline;
    margin: 0;
    font-family: var(--ds-font-display);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--ds-ink);
}
/* التعريف في سطر واحد مفصول بنقاط بدل بطاقة ثانية تكرّر ما في
   النموذج تحت */
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 7px 0 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ds-ink-mute);
}
.profile-meta b { font-weight: 600; color: var(--ds-ink-soft); }
.profile-meta-sep { color: var(--ds-border-strong); }


/* شارة الدور: كانت bg-purple-lt — بنفسجي بقي من قبل ترحيل الألوان */
.role-badge {
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    color: var(--ds-ink-soft);
    font-size: 11px;
    font-weight: 600;
    margin-inline-start: 8px;
    vertical-align: middle;
}

/* عمودان مقصودان لا \u200Eauto-fit\u200E: الصورة والأمان أقصر من المعلومات،
   وتركها للتوزيع التلقائي يُنتج ثلاثة أعمدة متفاوتة الارتفاع.
   والمعلومات — وهي الأطول — تأخذ العمود الأوسع. */
.profile-grid {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 18px;
    align-items: start;
}
.profile-col { display: flex; flex-direction: column; gap: 18px; }

@media (max-width: 991.98px) {
    .profile-grid { grid-template-columns: 1fr; }
}
.profile-section {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.profile-section-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--ds-border);
}
.profile-section-head > i { font-size: 20px; color: var(--ds-ink-mute); margin-top: 1px; }
.profile-section-head h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ds-ink);
}
.profile-section-head p { margin: 2px 0 0; font-size: 12px; color: var(--ds-ink-mute); }
.profile-form { padding: 18px; }

/* الحقل المقفل يظهر مقفلاً لا مخفيّاً: من لا يجد اسمه في الصفحة
   يظنّ أن الصفحة ناقصة، لا أن الاسم ليس له */
.field-locked {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px dashed var(--ds-border-strong);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-surface-sunk);
    font-size: 13.5px;
    color: var(--ds-ink-soft);
}
.field-locked span { flex: 1; min-width: 0; }
.field-locked i { flex: none; font-size: 15px; color: var(--ds-ink-mute); }
.profile-locked-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0 0 16px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--ds-ink-mute);
}
.profile-locked-note i { flex: none; font-size: 15px; margin-top: 2px; }

/* مقياس قوة كلمة السر: تغذية راجعة أثناء الكتابة بدل رسالة خطأ
   بعد الإرسال */
.pw-meter { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.pw-meter-bar {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: var(--ds-border);
    overflow: hidden;
}
.pw-meter-bar > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--ds-ink-mute);
    transition: width var(--ds-dur) var(--ds-ease), background-color var(--ds-dur-fast) ease;
}
.pw-meter-bar > span.is-weak   { background: #be123c; }
.pw-meter-bar > span.is-fair   { background: #b45309; }
.pw-meter-bar > span.is-good   { background: #2563eb; }
.pw-meter-bar > span.is-strong { background: #047857; }
.pw-meter-label { flex: none; font-size: 11.5px; color: var(--ds-ink-mute); }

@media (prefers-reduced-motion: reduce) {
    .pw-meter-bar > span { transition: none; }
}

@media (max-width: 575.98px) {
    .profile-hero { padding: 18px; gap: 14px; }
    .profile-avatar { width: 62px; height: 62px; font-size: 21px; }
}

/* ==================== الفصول الدراسية ====================
   الفصل النشط كان شارة صغيرة في صفّ جدول، وهو أهم معلومة في الصفحة:
   كل تقديم وكل إحصاء وكل لوحة تُقرأ منه وحده. صار لوحاً يتصدّرها. */
.term-now {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 20px 22px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-sm);
}
.term-now-head { flex: 1 1 260px; min-width: 0; }
.term-now-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: #047857;
}
/* نبضة صغيرة: «يعمل الآن» تُقال بالحركة أسرع مما تُقرأ */
.term-pulse {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #047857;
    box-shadow: 0 0 0 0 rgba(4, 120, 87, .5);
    animation: term-pulse 2.4s ease-out infinite;
}
@keyframes term-pulse {
    70%  { box-shadow: 0 0 0 7px rgba(4, 120, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .term-pulse { animation: none; }
}
.term-now-name {
    margin: 6px 0 4px;
    font-family: var(--ds-font-display);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--ds-ink);
}
.term-now-note { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--ds-ink-mute); }

.term-now-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    gap: 1px;
    flex: 1 1 380px;
    background: var(--ds-border);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    overflow: hidden;
}
.term-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 6px;
    background: var(--ds-surface);
    text-decoration: none;
    text-align: center;
    transition: background-color var(--ds-dur-fast) ease;
}
.term-stat:hover { background: var(--ds-surface-sunk); }
.term-stat-n {
    font-family: var(--ds-font-display);
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.term-stat-l { font-size: 10.5px; line-height: 1.4; color: var(--ds-ink-mute); }
.term-now-actions { flex: none; }

/* الأرشيف */
.term-list { display: flex; flex-direction: column; }
.term-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    transition: background-color var(--ds-dur-fast) ease;
}
.term-row + .term-row { border-top: 1px solid var(--ds-border); }
.term-row:hover { background: var(--ds-surface-sunk); }
.term-main { flex: 1; min-width: 0; }
.term-name {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ds-ink);
}
.term-count { font-size: 12px; color: var(--ds-ink-mute); text-decoration: none; }
.term-count:not(.is-empty):hover { color: var(--ds-brand-600); }
/* الفعل الأساسي يُفصل عن الثانويين بفاصل شعرة، فيُقرأ فعلاً مستقلاً
   لا ثالثَ أيقونتين */
.term-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.term-actions .btn-group { padding-inline-start: 14px; border-inline-start: 1px solid var(--ds-border); }

/* زرّ التفعيل.
   كان ‎btn btn-outline-primary btn-sm‎ — حبّة دوائرية صغيرة بجانب
   أيقونتين مربّعتَي الزوايا بارتفاع مختلف، فيبدو الصفّ مجمَّعاً لا
   مصمَّماً.

   وهو أخطر فعل في الصفحة: ينقل التقديم واللوحات والإحصائيات إلى فصل
   آخر. هادئ في السكون لأن الصفّ أرشيف يُتصفَّح، وممتلئ عند قصده
   لأنه ليس كأيقونة تعديل. */
.term-activate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    background: transparent;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ds-ink-soft);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--ds-dur-fast) ease,
                border-color var(--ds-dur-fast) ease,
                color var(--ds-dur-fast) ease;
}
.term-activate i { font-size: 15px; }
.term-activate:hover {
    background: var(--ds-brand-600);
    border-color: var(--ds-brand-600);
    color: #fff;
}
/* الفعل خطير، فموضع التركيز يجب أن يُرى قبل الضغط بلوحة المفاتيح */
.term-activate:focus-visible {
    outline: 2px solid var(--ds-brand-600);
    outline-offset: 2px;
}

/* نافذة التفعيل: الانتقال معروضاً لا موصوفاً */
.term-switch {
    display: flex;
    align-items: stretch;
    gap: 1px;
    margin-bottom: 18px;
    background: var(--ds-border);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    overflow: hidden;
}
.term-switch-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: var(--ds-surface);
    min-width: 0;
}
.term-switch-side.is-next { background: var(--ds-brand-50); }
.term-switch-label { font-size: 11px; color: var(--ds-ink-mute); }
.term-switch-side b {
    font-family: var(--ds-font-display);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--ds-ink);
}
.term-switch-arrow {
    align-self: center;
    padding: 0 10px;
    font-size: 19px;
    color: var(--ds-ink-mute);
    background: var(--ds-surface);
    display: grid;
    place-items: center;
}

@media (max-width: 575.98px) {
    .term-now-stats { grid-template-columns: repeat(3, 1fr); }
    .term-row { flex-wrap: wrap; }
    .term-main { flex: 1 1 100%; }
}

/* ==================== أنواع المشاريع ====================
   كانت جدول DataTables خادمياً — بترقيم وبحث وفرز عبر ajax — لنوعين
   اثنين. والحدّان كانا عمودين منفصلين («٢ عضو» و«٣ عضو») وهما مفهوم
   واحد: مدى حجم الفريق. */
.type-list { display: flex; flex-direction: column; }
.type-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 18px;
    transition: background-color var(--ds-dur-fast) ease;
}
.type-row + .type-row { border-top: 1px solid var(--ds-border); }
.type-row:hover { background: var(--ds-surface-sunk); }
.type-main { flex: 1; min-width: 0; }
.type-name {
    margin: 0 0 4px;
    font-family: var(--ds-font-display);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ds-ink);
}
.type-range {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12.5px;
    color: var(--ds-ink-mute);
}
.type-range i { font-size: 15px; }
.type-range b {
    font-family: var(--ds-font-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}

/* عدد المشاريع المستعمِلة: هو ما يُبنى عليه قرار التعديل والحذف،
   ولم يكن معروضاً إطلاقاً */
.type-usage { flex: none; text-align: center; }
.type-usage-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
}
.type-usage-n {
    font-family: var(--ds-font-display);
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.type-usage-link:hover .type-usage-n { color: var(--ds-brand-600); }
.type-usage-l { font-size: 11px; color: var(--ds-ink-mute); }
.type-usage-none { font-size: 12px; color: var(--ds-ink-mute); }

/* شريط تلميح: يشرح أثر الإعداد على المستخدم النهائي، لا معناه
   المعجمي — الحقلان في النافذة وحدهما لا يقولان أنهما يقبلان فريقاً
   أو يرفضونه عند التسجيل */
.hint-bar {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 16px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ds-ink-mute);
}
.hint-bar > i { flex: none; font-size: 17px; margin-top: 2px; color: var(--ds-ink-soft); }

@media (max-width: 575.98px) {
    .type-row { flex-wrap: wrap; }
    .type-main { flex: 1 1 100%; }
}

/* ==================== شريحة النطاق ====================
   حين تصل القائمة من بطاقة تخصص، لم يكن شيء يقول إنها مُصفّاة سوى
   قائمة منسدلة مختارة في زاوية الشريط — والعدّادات كانت تقول العدد
   الكلّي فتناقض الجدول. الشريحة تقول النطاق وتعطي مخرجاً منه. */
.scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px 8px 6px 6px;
    border: 1px solid var(--ds-brand-100);
    border-radius: 999px;
    background: var(--ds-brand-50);
    font-size: 12.5px;
    color: var(--ds-ink-soft);
}
.scope-chip > i:first-child { font-size: 15px; color: var(--ds-brand-600); margin-inline-start: 4px; }
.scope-chip b { font-weight: 700; color: var(--ds-ink); }
.scope-chip-clear {
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    color: var(--ds-ink-mute);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.scope-chip-clear:hover { background: rgba(37, 99, 235, .12); color: var(--ds-brand-600); }
.scope-chip-clear i { font-size: 14px; }

/* ==================== التخصصات ====================
   كانت جدول DataTables خادمياً لأربعة صفوف — آلة أكبر من حاجتها —
   يعرض عموداً واحداً. البطاقة تعرض ثقل التخصص في النظام كاملاً:
   طلابه ومشرفوه وأنواع مشاريعه، وكل رقم مدخل إلى قائمته المُصفّاة. */
/* \u200Eauto-fill\u200E كان يصنع أعمدة وهمية فارغة إلى جانب البطاقات الثلاث على
   شاشة عريضة، فتنزوي البطاقات في طرف ويبقى نصف الصفحة بياضاً.
   \u200Eauto-fit\u200E يطوي الأعمدة الفارغة فتتمدّد البطاقات على العرض كلّه. */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}
.spec-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease;
}
.spec-card:hover { border-color: var(--ds-border-strong); box-shadow: var(--ds-shadow-sm); }
/* التخصص الناقص يحمل خطاً علوياً كهرماني — يُميَّز في الشبكة قبل
   أن تُقرأ كلمة واحدة */
.spec-card.is-incomplete { border-color: #fcd9a4; }
.spec-card.is-incomplete::before {
    content: "";
    display: block;
    height: 2px;
    background: #b45309;
}

.spec-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ds-border);
}
.spec-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--ds-font-display);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ds-ink);
}
.spec-head .btn-group { flex: none; }

/* ثلاث خلايا تتقاسم حدودها — لا بطاقات داخل بطاقة */
.spec-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--ds-border);
}
.spec-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 14px 8px;
    background: var(--ds-surface);
    text-decoration: none;
    text-align: center;
    transition: background-color var(--ds-dur-fast) ease;
}
.spec-stat:hover { background: var(--ds-surface-sunk); }
.spec-n {
    font-family: var(--ds-font-display);
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.spec-l { font-size: 11.5px; color: var(--ds-ink-mute); }
/* الصفر هنا ليس رقماً صغيراً بل عطلاً: يوقف طلاب التخصص */
.spec-stat.is-zero .spec-n { color: #b45309; }

/* أنواع المشاريع بأسمائها — هي ما يملأ البطاقة ويجعل عرضها مُستحقّاً
   بدل أن تكون عنواناً وثلاثة أرقام في مساحة واسعة */
.spec-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 13px 16px;
    margin-top: auto;
    border-top: 1px solid var(--ds-border);
}
.spec-type {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 9px;
    border: 1px solid var(--ds-border);
    border-radius: 7px;
    background: var(--ds-surface-sunk);
    font-size: 12px;
    color: var(--ds-ink-soft);
    text-decoration: none;
    transition: border-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.spec-type:hover { border-color: var(--ds-border-strong); color: var(--ds-ink); }
/* حجم الفريق المسموح: شرط يصطدم به الطلاب عند التسجيل، ولم يكن
   ظاهراً إلا داخل صفحة الأنواع */
.spec-type-size {
    font-family: var(--ds-font-display);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink-mute);
}

/* التخصص الموقوف: أرشيف حيّ لا عطل — يُميَّز بالهدوء لا بالتحذير */
.spec-card.is-archived { background: var(--ds-surface-sunk); }
.spec-card.is-archived .spec-name,
.spec-card.is-archived .spec-n { color: var(--ds-ink-mute); }
.spec-card.is-archived .spec-stat { background: var(--ds-surface-sunk); }
.spec-card.is-archived .spec-stat:hover { background: var(--ds-surface); }
.spec-archived {
    display: inline-block;
    margin-inline-start: 7px;
    padding: 0 7px;
    border: 1px solid var(--ds-border-strong);
    border-radius: 5px;
    font-family: var(--ds-font-body, inherit);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.8;
    color: var(--ds-ink-mute);
    vertical-align: middle;
}
.spec-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    padding: 11px 16px;
    border-top: 1px solid var(--ds-border);
    font-size: 12px;
    line-height: 1.6;
    color: var(--ds-ink-mute);
}
.spec-note i { flex: none; font-size: 15px; margin-top: 1px; }

/* نافذة الإيقاف: ما يتوقّف بعلامة، وما يبقى بعلامة أخرى — الأدمن
   يرى الميزان لا جملة تطمين */
.archive-effects { list-style: none; margin: 0; padding: 0; }
.archive-effects li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ds-ink-soft);
}
.archive-effects li + li { border-top: 1px solid var(--ds-border); }
.archive-effects i { flex: none; font-size: 18px; margin-top: 1px; }
.archive-effects .is-stop i { color: #b45309; }
.archive-effects .is-keep i { color: #047857; }

/* وسم الموقوف في توزيع لوحة التحكم */
.dist-archived {
    margin-inline-start: 6px;
    padding: 0 5px;
    border-radius: 4px;
    background: var(--ds-surface-sunk);
    font-size: 10px;
    font-weight: 600;
    color: var(--ds-ink-mute);
}

.spec-warn {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    padding: 11px 16px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-warning-bg);
    font-size: 12px;
    line-height: 1.6;
    color: #8a4308;
}
.spec-warn i { flex: none; font-size: 15px; margin-top: 1px; }
/* التحذير يحمل مخرجه: كان يصف العطل ويترك الأدمن يبحث عن صفحة إصلاحه */
.spec-warn-fix { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; }
.spec-warn-fix a {
    font-weight: 700;
    color: #8a4308;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}
.spec-warn-fix a:hover { color: #6b3406; }

/* ==================== 2c2) Filter bar ====================
   أزرار الحالة تحمل عدّاداتها، فيعرف الأدمن حجم كل مجموعة قبل النقر
   بدل أن يجرّب ويرى. */
.filter-bar {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--ds-border);
}
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ds-ink-mute);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.filter-tab:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
.filter-tab.is-active {
    background: var(--ds-accent);
    color: #fff;
    font-weight: 600;
}
.filter-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.filter-count {
    font-family: var(--ds-font-display);
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-soft);
}
.filter-tab.is-active .filter-count { background: rgba(255, 255, 255, .16); color: #fff; }

/* البحث والمُرشِّح في صفّ واحد: البحث يتمدّد لأنه الأداة الأساسية،
   والتخصص بعرض ثابت لأنه قائمة قصيرة */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 14px 16px;
}
.filter-field { flex: 1 1 180px; min-width: 0; }
/* البحث ضعف القائمة عرضاً: هو الأداة الأساسية والقوائم مُرشِّحات */
.filter-field--search { flex: 2 1 260px; }

/* داخل \u200E.filter-row\u200E الحشو على الصفّ نفسه، وإلا ازدوج. والحقل يضيق
   لأن البحث بجانبه هو من يستحقّ التمدّد. */
.filter-field .form-label { font-size: 12.5px; font-weight: 600; color: var(--ds-ink-soft); margin-bottom: 6px; }
/* الأزرار تُدفع إلى طرف الصفّ فلا تلتصق بآخر قائمة */
.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    margin-inline-start: auto;
}

/* على الشاشات الضيّقة حقل واحد في السطر: التزاحم على ١٨٠ بكسل
   يقطع أسماء التخصصات والفصول */
@media (max-width: 781.98px) {
    .filter-field, .filter-field--search { flex: 1 1 100%; }
    .filter-actions { width: 100%; margin-inline-start: 0; }
    .filter-actions .btn { flex: 1; }
}

/* ==================== 2c3) Table cells ==================== */
.row-actions { display: flex; align-items: center; gap: 6px; }

/* خليّة الهوية: الاسم والبريد كانا عمودين بوزن واحد — والاسم هو ما
   تبحث عنه العين وهي تمسح، والبريد بيانات تُستخرج عند الحاجة.
   دمجهما يحرّر عموداً كاملاً، والأحرف الأولى تعطي العين مرساة تنزل
   عليها عبر مئات الصفوف. */
.cell-identity { display: flex; align-items: center; gap: 11px; }
.cell-avatar {
    flex: none;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-display);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ds-ink-soft);
}
.cell-identity-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
/* \u200Edisplay: block\u200E مقصود: لو لم يصل تصفيف الحاوية لأي سبب، يبقى
   السطران منفصلين بدل أن يلتصقا في جملة واحدة */
.cell-name {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ds-ink);
}
.cell-sub {
    display: block;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--ds-ink-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* مُعرِّفات رقمية: بلا tabular-nums لا تصطفّ الخانات عمودياً عبر
   الصفوف فيصعب مقارنتها بالعين */
.cell-num { font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* تاريخ هادئ: معلومة سياق لا رقم يُقارَن */
.cell-when { font-size: 12.5px; color: var(--ds-ink-mute); white-space: nowrap; }

/* «أنت» في جدول المسؤولين: كان حسابك مستثنى من القائمة تماماً، فلا
   تعرف ببريد أيّها أنت داخل. يظهر الآن موسوماً، وبلا زرّ حذف. */
.cell-you {
    display: inline-block;
    margin-inline-start: 7px;
    padding: 0 6px;
    border: 1px solid var(--ds-border-strong);
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.7;
    color: var(--ds-ink-mute);
    vertical-align: middle;
}

/* نظير خليّة الهوية في جدول المجموعات: العنوان فوق نوع المشروع،
   والخليّة كلها رابط فمساحة النقر سطران لا سطر */
.cell-identity-link {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    text-decoration: none;
}
.cell-identity-link .cell-name { transition: color var(--ds-dur-fast) ease; }
.cell-identity-link:hover .cell-name { color: var(--ds-brand-600); }

/* نوع المشروع: كان نصّاً صغيراً يلي العنوان مباشرةً فيُقرأ امتداداً
   له — «… نسخة 2برمجة ذكاء صناعي». الشارة تفصله بحدّ وخلفية، فالفرق
   قائم بالشكل لا بحجم الخطّ وحده مهما ضاق العمود. */
.cell-tag {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    max-width: 100%;
    margin-top: 4px;
    padding: 1px 8px;
    border: 1px solid var(--ds-border);
    border-radius: 6px;
    background: var(--ds-surface-sunk);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--ds-ink-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* عمود المشروع هو أعرض أعمدة الجدول: العناوين طويلة، وتركها تلتفّ
   إلى ثلاثة أسطر يُفقد الصفوف إيقاعها */
.table td .cell-identity-link { max-width: 340px; }
.table td .cell-identity-link .cell-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* حجم الفريق مقابل حدّ نوعه — لم يكن معروضاً في صفحة المجموعات */
.team-size {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    font-family: var(--ds-font-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.team-size small { font-weight: 400; color: var(--ds-ink-mute); }
.team-size.is-over { color: var(--ds-danger); }
.team-size.is-over small { color: var(--ds-danger); }

/* عمود المشروع في جدول الطلاب — كان ✓ خضراء أو ✗ حمراء تقول
   «نعم/لا» ولا تقول أين الطالب */
.team-link {
    color: var(--ds-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--ds-border-strong);
    padding-bottom: 1px;
    transition: border-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.team-link:hover { color: var(--ds-brand-600); border-bottom-color: var(--ds-brand-600); }

.no-team {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--ds-ink-mute);
}
.no-team::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #d4d4d8;
}

/* ==================== عبء الإشراف ====================
   كانت شارة زرقاء تقول «٢ مجموعة» ولا تقول من أصل كم — والسقف
   \u200Emax_group\u200E مُخزَّن في القاعدة ولا يُعرض في أي شاشة. فالأدمن يوزّع
   المشاريع بلا أن يرى الحدّ الذي يوزّع ضمنه.
   الرقم يقول «كم»، والشريط يقول «كم بقي» في لمحة واحدة. */
.load-cell {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    min-width: 62px;
    text-decoration: none;
}
.load-figure {
    display: flex;
    align-items: baseline;
    gap: 1px;
    font-family: var(--ds-font-display);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.load-figure small { font-size: 11.5px; font-weight: 500; color: var(--ds-ink-mute); }
.load-bar {
    display: block;
    height: 3px;
    border-radius: 999px;
    background: var(--ds-border);
    overflow: hidden;
}
.load-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--ds-ink-mute);
    transition: background-color var(--ds-dur-fast) ease;
}
/* اللون للحالة التي تحتاج تدخّلاً وحدها — والمتاح يبقى محايداً،
   وإلا صار نصف الجدول ملوّناً فلا يبرز شيء */
.load-cell.is-full .load-figure { color: #b45309; }
.load-cell.is-full .load-bar > span { background: #b45309; }
.load-cell.is-over .load-figure,
.load-cell.is-over .load-figure small { color: var(--ds-danger); }
.load-cell.is-over .load-bar > span { background: var(--ds-danger); }
.load-cell:hover .load-figure { text-decoration: underline; text-underline-offset: 3px; }

/* كانت bg-purple-lt — بنفسجي خارج اللوحة */
.grade-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid var(--ds-border);
    border-radius: 999px;
    background: var(--ds-surface-sunk);
    font-family: var(--ds-font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}
.grade-pill small { font-weight: 500; font-size: 11.5px; color: var(--ds-ink-mute); }

/* ==================== 2c4) Trash page ====================
   يعرض ما سيضيع قبل الحذف النهائي — «هل أنت متأكد؟» المجرّدة لا تعطي
   الأدمن ما يقرر به. */
.loss-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    font-size: 12.5px;
    color: var(--ds-ink-mute);
}
.loss-grade {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
    font-weight: 600;
}
.row-actions form { display: inline-flex; margin: 0; }

/* ==================== 2c45) Person rows ====================
   بديل الجداول ذات الرؤوس الأربعة لصفّين — الرؤوس كانت أثقل من
   البيانات. تُستعمل في تفاصيل المشروع وتعديل المجموعة معاً. */
.ctx-card {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.ctx-card + .ctx-card { margin-top: 16px; }
.ctx-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--ds-border);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ds-ink);
}
.ctx-head > i { color: var(--ds-ink-mute); font-size: 17px; }
.ctx-badge {
    margin-inline-start: auto;
    font-family: var(--ds-font-display);
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.ctx-badge small { font-weight: 400; color: var(--ds-ink-mute); }
.ctx-badge.is-over { color: var(--ds-danger); }

.ctx-person {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 18px;
}
.ctx-person + .ctx-person { border-top: 1px solid var(--ds-border); }
.ctx-person:hover { background: var(--ds-surface-sunk); }
/* القائد يُميَّز بحافة لا بخلفية: الفريق كلّه على لون واحد والفرق
   إشارة لا تلوين */
.ctx-person.is-leader { border-inline-start: 2px solid var(--ds-brand-600); }

/* أفعال العضو: كان اللوح للقراءة فقط، فصفحة التعديل تعرض «الفريق ٥
   والحدّ ٣» ولا تملك ما تُصلح به */
.ctx-person-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-inline-start: auto;
    flex: none;
    opacity: .6;
    transition: opacity var(--ds-dur-fast) ease;
}
.ctx-person:hover .ctx-person-actions,
.ctx-person:focus-within .ctx-person-actions { opacity: 1; }
.ctx-person-actions form { display: inline-flex; margin: 0; }
.ctx-person-actions .btn-action {
    width: 28px; height: 28px;
    padding: 0;
    display: inline-grid; place-items: center;
    border: 1px solid var(--ds-border);
    border-radius: 7px;
    background: transparent;
    color: var(--ds-ink-mute);
    transition: color var(--ds-dur-fast) ease, border-color var(--ds-dur-fast) ease,
                background-color var(--ds-dur-fast) ease;
}
.ctx-person-actions .btn-action i { font-size: 14px; }
.ctx-person-actions .btn-action:hover {
    color: var(--ds-ink);
    border-color: var(--ds-border-strong);
    background: var(--ds-surface);
}
.ctx-person-actions .btn-action.btn-action--danger:hover {
    color: var(--ds-danger);
    border-color: #fecdd3;
    background: var(--ds-danger-bg);
}
.ctx-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-display);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ds-ink-soft);
    flex: none;
}
.ctx-avatar.is-supervisor { background: var(--ds-accent); color: #fff; border-color: var(--ds-accent); }
.ctx-person-body { min-width: 0; }
.ctx-person-name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ds-ink);
}
.ctx-tag {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-700);
    font-size: 10.5px;
    font-weight: 700;
}
.ctx-person-meta { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ds-ink-mute); }

.ctx-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--ds-border);
}
/* التسمية بعرض ثابت فتصطفّ القيم عمودياً، وفاصل شعرة بين الصفوف:
   كانا بحشو ٩ بكسل بلا فاصل فيلتصق البريد بالجوال. */
.ctx-facts dt {
    width: 72px;
    padding: 12px 18px 12px 0;
    margin-inline-start: 18px;
    font-size: 12px;
    color: var(--ds-ink-mute);
    white-space: nowrap;
}
.ctx-facts dd {
    padding: 12px 18px 12px 0;
    margin: 0;
    font-size: 12.5px;
    color: var(--ds-ink);
    /* بريد طويل يلتفّ داخل بطاقة ٣٤٠ بكسل بدل أن يزاحم تسميته */
    overflow-wrap: anywhere;
}
.ctx-facts dt:not(:first-of-type),
.ctx-facts dd:not(:first-of-type) { border-top: 1px solid var(--ds-border); }
/* البريد والجوال روابط لا نصوص تُنسخ يدوياً */
.ctx-facts dd a { color: inherit; text-decoration: none; }
.ctx-facts dd a:hover { color: var(--ds-brand-600); text-decoration: underline; }

/* عبء الإشراف داخل بطاقة المشرف: هو ما يُبنى عليه قرار النقل،
   فيتصدّر البريد والجوال ويُفصل عنهما */
.ctx-load {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--ds-border);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
.ctx-load:hover { background: var(--ds-surface-sunk); }
.ctx-load-label { flex: 1; min-width: 0; font-size: 12px; color: var(--ds-ink-mute); }
.ctx-load .load-cell { flex: none; min-width: 54px; }
.ctx-load-go { flex: none; font-size: 15px; color: var(--ds-border-strong); }
.ctx-load:hover .ctx-load-go { color: var(--ds-ink); }

/* تخطيط صفحة التعديل: سياق جانبي ونموذج في المتن */
.edit-grid {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}
.limit-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid var(--ds-border);
    border-radius: 10px;
    background: var(--ds-surface-sunk);
    font-size: 13px;
    line-height: 1.75;
    color: var(--ds-ink-soft);
}
.limit-note > i { font-size: 18px; color: var(--ds-ink-mute); flex: none; margin-top: 1px; }
.limit-note.is-warn { background: var(--ds-warning-bg); border-color: #fde68a; }
.limit-note.is-warn > i { color: #b45309; }
.form-footer { display: flex; align-items: center; gap: 10px; margin-top: 22px; }

@media (max-width: 991.98px) {
    .edit-grid { grid-template-columns: 1fr; }
}

/* ==================== 2c5) Project detail ====================
   كانت أربع بطاقات مؤشرات بارتفاع كبير لأربعة أرقام أحدها فارغ،
   وثلاثة صناديق تقول «لا يوجد» بلا تفسير رغم أن السبب واضح من الحالة. */
.proj-panel {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}

/* مسار المشروع: يقول ما مضى وما بقي، لا الحالة وحدها */
.proj-rail { padding: 22px 24px 18px; border-bottom: 1px solid var(--ds-border); }
.rail-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
}
.rail-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
/* الخط الواصل يُرسم من العقدة إلى جارتها */
.rail-step::before {
    content: "";
    position: absolute;
    top: 11px;
    inset-inline-start: 50%;
    inline-size: 100%;
    height: 2px;
    background: var(--ds-border);
}
.rail-step:last-child::before { display: none; }
.rail-step.is-done::before { background: var(--ds-accent); }

.rail-node {
    position: relative;
    z-index: 1;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ds-surface);
    border: 2px solid var(--ds-border);
    color: transparent;
    font-size: 13px;
}
.rail-step.is-done .rail-node {
    background: var(--ds-accent);
    border-color: var(--ds-accent);
    color: #fff;
}
.rail-step.is-current .rail-node {
    border-color: var(--ds-brand-600);
    box-shadow: 0 0 0 4px var(--ds-brand-50);
}
.rail-step.is-current .rail-node::after {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ds-brand-600);
}
.rail-label { font-size: 12.5px; color: var(--ds-ink-mute); }
.rail-step.is-done .rail-label { color: var(--ds-ink-soft); }
.rail-step.is-current .rail-label { color: var(--ds-ink); font-weight: 600; }
.rail-meta { font-size: 11px; color: var(--ds-ink-mute); }

.proj-rejected {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: 13.5px;
    color: var(--ds-ink-soft);
}
.proj-rejected i { font-size: 20px; color: var(--ds-danger); flex: none; }
.proj-rejected b { display: block; color: var(--ds-ink); margin-bottom: 2px; }

.proj-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--ds-border);
}
.fact-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 20px;
    background: var(--ds-surface);
}
.fact-label { font-size: 12px; color: var(--ds-ink-mute); }
.fact-value {
    font-family: var(--ds-font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}
.fact-value.is-late { color: var(--ds-danger); }

/* ---- التقييم ---- */
.grade-panel {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.grade-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 20px 28px;
    background: var(--ds-accent);
    color: #fff;
    flex: none;
}
.grade-num {
    font-family: var(--ds-font-display);
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.grade-of { font-size: 11.5px; color: rgba(255, 255, 255, .6); }
.grade-body { padding: 18px 22px; min-width: 0; }
.grade-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ds-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-ink);
}
.grade-label {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-ink-soft);
}
.grade-note { margin: 8px 0 0; font-size: 13.5px; line-height: 1.8; color: var(--ds-ink-soft); }
.grade-date { margin-top: 6px; font-size: 11.5px; color: var(--ds-ink-mute); }

/* ==================== اعتماد الدرجة ====================
   كانت الدرجة تُعدَّل بلا حدّ إلى الأبد. الاعتماد يقفلها، والشارة
   تقول إنها نتيجة معلنة لا مسوّدة. */
.grade-locked {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--ds-success-bg);
    border: 1px solid #a7d8c4;
    font-size: 12px;
    font-weight: 700;
    color: #047857;
}
.grade-locked i { font-size: 14px; }
.grade-unlock-btn { align-self: center; margin-inline-end: 18px; flex: none; }

/* شريط الاعتماد في صفحة المشرف: الحفظ والاعتماد فعلان مختلفان —
   الدرجة تُراجَع وتُعدَّل مرّات ثم تُعتمد مرّة واحدة */
.grade-lock-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
}
.grade-lock-bar b { display: block; font-size: 13.5px; color: var(--ds-ink); }
.grade-lock-bar span { display: block; margin-top: 3px; font-size: 12px; line-height: 1.7; color: var(--ds-ink-mute); }

/* اللوح الساكن بعد الاعتماد: النموذج يختفي كلياً. إبقاؤه معطَّلاً
   يوحي بأن التعديل ممكن بحيلة، والقفل قرار لا عائق. */
.grade-final {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    border: 1px solid #a7d8c4;
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.grade-final-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 18px 26px;
    background: #047857;
    color: #fff;
    flex: none;
}
.grade-final-score .grade-of { color: rgba(255, 255, 255, .7); }
.grade-final-body { flex: 1 1 240px; min-width: 0; padding: 16px 20px; }
.grade-final-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-family: var(--ds-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-ink);
}
.grade-final-head > i { font-size: 19px; color: #047857; }
.grade-final-note { margin: 8px 0 0; font-size: 12px; line-height: 1.75; color: var(--ds-ink-mute); }

/* نافذة التأكيد: الرقم يتصدّر — هو ما يُعتمد، لا النصّ حوله */
.grade-confirm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
}
.grade-confirm-n {
    font-family: var(--ds-font-display);
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.grade-confirm-l { font-size: 12.5px; color: var(--ds-ink-mute); }

@media (max-width: 575.98px) {
    .grade-final { flex-direction: column; }
    .grade-final-score { flex-direction: row; gap: 8px; align-items: baseline; padding: 14px 18px; }
    .grade-unlock-btn { margin: 0 18px 18px; }
}

/* ==================== سجلّ التدقيق ====================
   سطر لكل حدث، بنفس المكوّن في صفحة السجلّ وفي شريط «تاريخ هذا
   المشروع» — وإلا انحرف الشكلان مع أول تعديل. */
.audit-list { display: flex; flex-direction: column; }
.audit-row {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 18px;
    transition: background-color var(--ds-dur-fast) ease;
}
.audit-row + .audit-row { border-top: 1px solid var(--ds-border); }
.audit-row:hover { background: var(--ds-surface-sunk); }

.audit-icon {
    flex: none;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    color: var(--ds-ink-mute);
}
.audit-icon i { font-size: 17px; }
/* اللون للحدث الذي يحتاج انتباهاً وحده — وإلا صار السجلّ كلّه ملوّناً
   فلا يبرز شيء */
.audit-row.is-good .audit-icon { background: var(--ds-success-bg); border-color: #a7d8c4; color: #047857; }
.audit-row.is-warn .audit-icon { background: var(--ds-warning-bg); border-color: #fcd9a4; color: #b45309; }
.audit-row.is-danger .audit-icon { background: var(--ds-danger-bg); border-color: #fecdd3; color: var(--ds-danger); }

.audit-body { flex: 1; min-width: 0; }
.audit-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    font-size: 13.5px;
    color: var(--ds-ink);
}
.audit-head b { font-weight: 700; }
.audit-subject { color: var(--ds-ink-mute); overflow-wrap: anywhere; }

.audit-change {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin: 6px 0 0;
    font-family: var(--ds-font-display);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.audit-change i { font-size: 13px; color: var(--ds-ink-mute); align-self: center; }
.audit-from { color: var(--ds-ink-mute); text-decoration: line-through; }
.audit-to { font-weight: 700; color: var(--ds-ink); }
.audit-change small { font-size: 11px; font-weight: 400; color: var(--ds-ink-mute); }

/* السبب هو ما يُقرأ عند التنازع — يُعرض كاملاً لا مقتطعاً */
.audit-reason {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 8px 0 0;
    padding: 9px 12px;
    border-inline-start: 2px solid var(--ds-border-strong);
    background: var(--ds-surface-sunk);
    border-radius: 0 6px 6px 0;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--ds-ink-soft);
}
.audit-reason i { flex: none; font-size: 14px; color: var(--ds-ink-mute); margin-top: 2px; }

.audit-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 7px 0 0;
    font-size: 11.5px;
    color: var(--ds-ink-mute);
}
.audit-role {
    padding: 0 6px;
    border-radius: 4px;
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    font-size: 10.5px;
    font-weight: 600;
}
.audit-sep { color: var(--ds-border-strong); }

/* ---- بيانات المشروع ---- */
.proj-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    margin: 0;
}
.proj-dl dt {
    padding: 11px 18px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ds-ink-mute);
    white-space: nowrap;
}
.proj-dl dd {
    padding: 11px 18px 11px 0;
    margin: 0;
    font-size: 13.5px;
    color: var(--ds-ink);
}
.proj-dl dt:not(:first-of-type),
.proj-dl dt:not(:first-of-type) + dd { border-top: 1px solid var(--ds-border); }

.proj-desc { padding: 14px 18px; border-top: 1px solid var(--ds-border); }
.proj-desc-label { display: block; font-size: 12.5px; color: var(--ds-ink-mute); margin-bottom: 5px; }
.proj-desc p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--ds-ink-soft); }

/* ---- لوح «لم يبدأ العمل» ---- */
.stage-note {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 20px 22px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface-sunk);
}
.stage-note > i { font-size: 22px; color: var(--ds-ink-mute); flex: none; }
.stage-note b { display: block; font-family: var(--ds-font-display); font-size: 14.5px; color: var(--ds-ink); }
.stage-note p { margin: 4px 0 0; font-size: 13px; line-height: 1.8; color: var(--ds-ink-mute); }

/* ---- المراحل ---- */
.ms-progress {
    display: block; /* يُستعمل على span أحياناً — بلا هذا يُهمَل الارتفاع فيختفي الشريط */
    height: 5px;
    margin: 14px 18px 4px;
    border-radius: 999px;
    background: var(--ds-surface-sunk);
    overflow: hidden;
}
.ms-progress span { display: block; height: 100%; background: var(--ds-accent); border-radius: 999px; }

.ms-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 18px;
}
.ms-row + .ms-row { border-top: 1px solid var(--ds-border); }
.ms-check {
    width: 20px; height: 20px;
    border-radius: 6px;
    display: grid; place-items: center;
    border: 1px solid var(--ds-border-strong);
    color: transparent;
    font-size: 12px;
    flex: none;
    margin-top: 1px;
}
.ms-row.is-done .ms-check { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }
.ms-body { min-width: 0; }
.ms-title { display: block; font-size: 13.5px; color: var(--ds-ink); }
.ms-row.is-done .ms-title { color: var(--ds-ink-mute); text-decoration: line-through; }
.ms-due { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ds-ink-mute); }

/* ==================== لوحة الطالب ====================
   كانت ٤٦ بطاقة في ملفّ بـ٦٦٩ سطراً، بنغمات Bootstrap قديمة فيها
   البنفسجي، وكلّها عمود واحد بالوزن نفسه.
   الأصناف هنا هي الجديد وحده — البقية مُعاد استعمالها من لوحة
   الأدمن: \u200E.dist-panel\u200E و\u200E.stat-strip\u200E و\u200E.rail-steps\u200E و\u200E.ctx-card\u200E
   و\u200E.ms-row\u200E و\u200E.cmt-row\u200E و\u200E.file-row\u200E و\u200E.grade-panel\u200E. */

/* المتن ما يُعمل عليه، والجانب ما يُرجَع إليه */
.work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 16px;
    align-items: start;
}
.work-main { min-width: 0; }
.work-side { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 991.98px) {
    .work-grid { grid-template-columns: 1fr; }
}

/* ---- «ماذا عليّ الآن» ----
   الصفحة كانت تجيب «ما حالة مشروعي؟» وتدفن السؤال الذي يفتحها
   الطالب من أجله */
.todo-panel {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.todo-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ds-border);
    font-family: var(--ds-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-ink);
}
.todo-title > i { font-size: 18px; color: var(--ds-brand-600); }

.todo-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 18px;
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
.todo-row + .todo-row { border-top: 1px solid var(--ds-border); }
.todo-row:hover { background: var(--ds-surface-sunk); }
.todo-row > i:first-child { flex: none; font-size: 18px; color: var(--ds-ink-mute); }
.todo-n {
    font-family: var(--ds-font-display);
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.todo-label { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ds-ink-soft); }
.todo-go { flex: none; font-size: 15px; color: var(--ds-border-strong); }
.todo-row:hover .todo-go { color: var(--ds-ink); }
/* اللون لما يحتاج تدخّلاً وحده — وإلا صار اللوح كلّه إنذاراً */
.todo-row.is-danger > i:first-child,
.todo-row.is-danger .todo-n { color: var(--ds-danger); }
.todo-row.is-warn > i:first-child,
.todo-row.is-warn .todo-n { color: #b45309; }
.todo-row.is-brand > i:first-child,
.todo-row.is-brand .todo-n { color: var(--ds-brand-600); }

.todo-clear {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 16px 18px;
    font-size: 13px;
    color: var(--ds-ink-mute);
}
.todo-clear > i { font-size: 18px; color: #047857; }

/* ==================== مجموعات المشرف ====================
   كان جدولاً بستة أعمدة لثلاث إلى ستّ مجموعات — يُهدر العرض ويضغط
   شريط التقدّم في عمود ضيّق. */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.group-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease;
}
.group-card:hover { border-color: var(--ds-border-strong); box-shadow: var(--ds-shadow-sm); }
/* المتأخّرة تُميَّز في الشبكة قبل أن تُقرأ كلمة — كبطاقة التخصص الناقص */
.group-card.is-late { border-color: #fecdd3; }
.group-card.is-late::before { content: ""; display: block; height: 2px; background: var(--ds-danger); }

.group-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px 18px;
}
.group-card-title { flex: 1; min-width: 0; text-decoration: none; }
.group-card-title span {
    display: block;
    font-family: var(--ds-font-display);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--ds-ink);
    transition: color var(--ds-dur-fast) ease;
}
.group-card-title:hover span { color: var(--ds-brand-600); }
.group-card-title small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ds-ink-mute); }

.group-card-progress { display: flex; align-items: center; gap: 10px; padding: 0 18px 14px; }
.group-card-progress .ms-progress { flex: 1; margin: 0; }
.group-card-pct {
    flex: none;
    font-family: var(--ds-font-display);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink-soft);
}
.group-card-nostage { font-size: 12px; color: var(--ds-ink-mute); }

.group-card-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 0 18px 15px;
    margin-top: auto;
}
.group-fact {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--ds-ink-mute);
}
.group-fact i { font-size: 14px; }
/* اللون لما يحتاج تدخّلاً وحده */
.group-fact.is-warn { color: #b45309; font-weight: 600; }
.group-fact.is-late { color: var(--ds-danger); font-weight: 600; }

.group-card-go {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface-sunk);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ds-ink-soft);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.group-card-go:hover { background: var(--ds-brand-600); color: #fff; }
.group-card-go i { font-size: 15px; }

/* خليّة الشريط تصير رابطاً حين تقود إلى مكان */
a.stat-cell { text-decoration: none; }

/* أزرار التصفية: \u200E<button>\u200E لا \u200E<a>\u200E في لوحة المشرف (تصفية في المتصفّح) */
button.filter-tab { border: 0; background: transparent; font-family: inherit; cursor: pointer; }

/* ---- المسار في لوحة الطالب: لوح قائم بذاته لا رأس بطاقة ---- */
.rail-card {
    padding: 22px 24px 18px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
}

/* ---- بطاقة المشروع في العمود الجانبي ---- */
.proj-title-cell { padding: 14px 18px; border-bottom: 1px solid var(--ds-border); }
.proj-title-cell h3 {
    margin: 0 0 3px;
    font-family: var(--ds-font-display);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--ds-ink);
}
.proj-title-cell span { font-size: 12px; color: var(--ds-ink-mute); }
.proj-desc {
    margin: 0;
    padding: 13px 18px;
    border-top: 1px solid var(--ds-border);
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--ds-ink-mute);
}
.ctx-head-link {
    margin-inline-start: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--ds-brand-600);
    text-decoration: none;
}
.ctx-head-link:hover { text-decoration: underline; }

.notif-brief { padding: 12px 18px; }
.notif-brief + .notif-brief { border-top: 1px solid var(--ds-border); }
.notif-brief b { display: block; font-size: 12.5px; color: var(--ds-ink); }
.notif-brief p { margin: 3px 0; font-size: 12px; line-height: 1.7; color: var(--ds-ink-mute); }
.notif-brief time { font-size: 11px; color: var(--ds-ink-mute); }
.notif-brief .notif-project { font-weight: 400; color: var(--ds-ink-mute); }
/* الجديد منذ آخر زيارة: حدّ جانبي لا لون خلفية يطغى على القائمة */
.notif-brief.is-new { box-shadow: inset -3px 0 0 var(--ds-brand-600); background: var(--ds-surface-sunk); }
[dir="ltr"] .notif-brief.is-new { box-shadow: inset 3px 0 0 var(--ds-brand-600); }

/* ---- المرحلة المتأخّرة ---- */
.ms-row.is-overdue .ms-check { background: var(--ds-danger-bg); border-color: #fecdd3; color: var(--ds-danger); }
.ms-flag {
    flex: none;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--ds-danger-bg);
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-danger);
}

/* ---- الرفع والنقاش ---- */
.file-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.file-actions form { display: inline-flex; margin: 0; }

.cmt-del { margin-inline-start: auto; }
.cmt-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface-sunk);
}
.cmt-form textarea { flex: 1; min-width: 180px; resize: vertical; }
.cmt-form .btn { flex: none; align-self: flex-end; }
.cmt-form .text-danger { flex: 1 1 100%; }

/* ---- حالة: لا مشروع ---- */
.reject-panel,
.start-panel {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.reject-panel { border-color: #fecdd3; }
.reject-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
    background: var(--ds-danger-bg);
}
.reject-head > i { font-size: 26px; color: var(--ds-danger); flex: none; }
.reject-head h2 {
    margin: 0;
    font-family: var(--ds-font-display);
    font-size: 16px;
    font-weight: 800;
    color: var(--ds-danger);
}
.reject-head p { margin: 3px 0 0; font-size: 13.5px; color: var(--ds-ink-soft); }

/* السبب هو ما يُبنى عليه الطلب التالي، فيُعرض كاملاً */
.reject-reason {
    margin: 0;
    padding: 16px 20px;
    border-inline-start: 3px solid var(--ds-border-strong);
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--ds-ink-soft);
}
.reject-reason-label {
    display: block;
    margin-bottom: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ds-ink-mute);
}
.reject-next {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 13px 20px;
    border-top: 1px solid var(--ds-border);
    font-size: 12.5px;
    color: var(--ds-ink-mute);
}

.start-panel { display: flex; align-items: flex-start; gap: 16px; padding: 22px 24px; }
.start-panel > i { flex: none; font-size: 34px; color: var(--ds-brand-600); }
.start-panel h2 {
    margin: 0 0 5px;
    font-family: var(--ds-font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--ds-ink);
}
.start-panel p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--ds-ink-mute); max-width: 62ch; }

.stat-value.is-late { color: var(--ds-danger); }

/* ---- الملفات ---- */
.file-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 18px;
}
.file-row + .file-row,
.file-item + .file-item { border-top: 1px solid var(--ds-border); }

/* ---- ملاحظات على الملفات ----
   «صفحة ٣ ينقصها المرجع — @آية»: على ملفها، تنبّه عضواً، وتُغلق حين تُعالَج.
   كانت تُكتب في النقاش باسم الملف نصّاً، أو تنتقل إلى واتساب. */
.file-item.has-open { box-shadow: inset -3px 0 0 var(--ds-warning); }
[dir="ltr"] .file-item.has-open { box-shadow: inset 3px 0 0 var(--ds-warning); }
.file-flag {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-warning-bg);
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
}
.file-flag i { font-size: 13px; }
.file-flag.is-mine { background: #b45309; color: #fff; }

.file-notes-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--ds-border);
    border-radius: 9px;
    background: var(--ds-surface);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--ds-ink-soft);
    cursor: pointer;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.file-notes-btn i { font-size: 16px; }
.file-notes-btn:hover { border-color: var(--ds-border-strong); background: var(--ds-surface-sunk); color: var(--ds-ink); }
.file-notes-btn.has-open { border-color: #fcd34d; background: var(--ds-warning-bg); color: #b45309; }
.file-notes-btn[aria-expanded="true"] { border-color: var(--ds-brand-300); background: var(--ds-brand-50); color: var(--ds-brand-700); }

.file-notes {
    margin: 0 18px 14px;
    padding: 12px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
    animation: ms-open .2s var(--ds-ease);
}
.file-note { display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px; }
.file-note + .file-note { border-top: 1px dashed var(--ds-border); }
.file-note-avatar.ctx-avatar { width: 30px; height: 30px; border-radius: 50%; font-size: 11px; }
.file-note-body { flex: 1; min-width: 0; }
.file-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.file-note-head b { color: var(--ds-ink); }
.file-note-head time { margin-inline-start: auto; font-size: 11px; color: var(--ds-ink-mute); }
.file-note-mention {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 0 7px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-brand-50);
    font-size: 11px;
    font-weight: 700;
    color: var(--ds-brand-700);
}
.file-note-mention i { font-size: 12px; }
.file-note-mention.is-me { background: var(--ds-brand-600); color: #fff; }
.file-note-text { margin: 4px 0 0; font-size: 13px; line-height: 1.75; color: var(--ds-ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.file-note-done { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: #047857; }
.file-note.is-resolved .file-note-text { color: var(--ds-ink-mute); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.file-note.is-resolved .file-note-avatar { opacity: .6; }
.file-note-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.file-note-actions form { margin: 0; }
.file-note-resolve {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #a7f3d0;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-success-bg);
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    color: #047857;
    cursor: pointer;
}
.file-note-resolve:hover { background: #d1fae5; }
.file-note-resolve.is-reopen { border-color: var(--ds-border); background: var(--ds-surface); color: var(--ds-ink-soft); }

.file-note-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--ds-border); }
.file-notes > .file-note-form:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.file-note-form textarea { resize: vertical; font-size: 13px; }
.file-note-form-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.file-note-to { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--ds-brand-600); }
.file-note-to .form-select { min-width: 190px; }
.file-notes-empty { margin: 0; font-size: 12.5px; color: var(--ds-ink-mute); }

@media (max-width: 575.98px) {
    /* الاسم سطرٌ كامل، والشارة والأزرار تحته — كان الاسم يُعصر في عمود ضيّق */
    .file-row { flex-wrap: wrap; row-gap: 8px; }
    .file-row .file-body { flex: 1 1 calc(100% - 64px); }
    .file-flag { order: 3; }
    .file-row .file-actions { order: 4; margin-inline-start: auto; }
    .file-notes { margin-inline: 12px; }
    .file-note { flex-wrap: wrap; }
    .file-note-actions { width: 100%; justify-content: flex-end; }
    .file-note-form-row .btn, .file-note-to, .file-note-to .form-select { flex: 1; min-width: 0; }
}
.file-icon { font-size: 19px; color: var(--ds-ink-mute); flex: none; }
.file-body { min-width: 0; flex: 1; }
.file-name {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ds-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-meta { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ds-ink-mute); }

/* ---- النقاش ---- */
.cmt-row { display: flex; gap: 12px; padding: 14px 18px; }
.cmt-row + .cmt-row { border-top: 1px solid var(--ds-border); }
.cmt-body { min-width: 0; flex: 1; }
.cmt-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cmt-head b { font-size: 13.5px; color: var(--ds-ink); }
.cmt-role {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    font-size: 11px;
    color: var(--ds-ink-mute);
}
.cmt-time { font-size: 11.5px; color: var(--ds-ink-mute); }
.cmt-text {
    margin: 5px 0 0;
    font-size: 13.5px;
    line-height: 1.85;
    color: var(--ds-ink-soft);
    white-space: pre-line;
}

@media (max-width: 720px) {
    .proj-facts { grid-template-columns: repeat(2, 1fr); }
    .rail-steps { grid-template-columns: repeat(2, 1fr); gap: 20px 8px; }
    .rail-step::before { display: none; }
    .grade-panel { flex-direction: column; }
    .grade-score { flex-direction: row; gap: 8px; align-items: baseline; }
}

/* ==================== 2c6) Inbox ====================
   كان أكورديون: لقراءة رسالة تُعاد الصفحة كاملةً، وواحدة فقط تُفتح،
   والقائمة تبقى طويلة مهما قرأت.

   لوحان الآن — قائمة وقارئ — وهو ما تفعله كل برامج البريد لأنه
   الصحيح لهذه المهمة: تمسح القائمة، وتقرأ بلا أن تفقد مكانك فيها. */
.inbox-split {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    align-items: start;
}
.inbox-list-pane,
.inbox-reader {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}

/* ---- أدوات القائمة ---- */
.inbox-tools { padding: 12px; border-bottom: 1px solid var(--ds-border); }
.inbox-tabs { display: flex; gap: 2px; margin-bottom: 10px; }
.inbox-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ds-ink-mute);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.inbox-tab:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
.inbox-tab.is-active { background: var(--ds-accent); color: #fff; font-weight: 600; }
.inbox-tab-n {
    font-family: var(--ds-font-display);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-soft);
}
.inbox-tab.is-active .inbox-tab-n { background: rgba(255, 255, 255, .16); color: #fff; }
/* عدّاد غير المقروءة حين يكون فيه ما ينتظر */
.inbox-tab-n.is-live { background: var(--ds-brand-600); color: #fff; }
.inbox-tab.is-active .inbox-tab-n.is-live { background: #fff; color: var(--ds-ink); }

/* البحث كان كتلة كاملة العرض بزرّ منفصل — حقل واحد يُرسل بـ Enter */
.inbox-search { position: relative; }
.inbox-search > i {
    position: absolute;
    inset-inline-start: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--ds-ink-mute);
    pointer-events: none;
}
.inbox-search .form-control {
    height: 36px;
    padding-inline-start: 34px;
    padding-inline-end: 32px;
    font-size: 13px;
}
.inbox-search .form-control::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.inbox-search-clear {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    color: var(--ds-ink-mute);
    text-decoration: none;
}
.inbox-search-clear:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
.inbox-search-clear i { font-size: 13px; }

/* ---- الصفوف ----
   سطران لا ثلاثة: الاسم والوقت في سطر، والموضوع والمعاينة في الثاني
   مقتطعين. الارتفاع ~٦٤ بدل ~٩٠، فيُرى ضعف العدد. */
.inbox-list {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 270px);
    overflow-y: auto;
}
.inbox-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    text-decoration: none;
    border-inline-start: 2px solid transparent;
    transition: background-color var(--ds-dur-fast) ease;
}
.inbox-item + .inbox-item { border-top: 1px solid var(--ds-border); }
.inbox-item:hover { background: var(--ds-surface-sunk); }
/* المفتوحة: حدّ لوني على حافة البداية لا خلفية صارخة */
.inbox-item.is-active {
    background: var(--ds-brand-50);
    border-inline-start-color: var(--ds-brand-600);
}

.inbox-item-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: transparent;
    flex: none;
    margin-top: 13px;
}
.inbox-item.is-unread .inbox-item-dot { background: var(--ds-brand-600); }

.inbox-item .msg-avatar { width: 32px; height: 32px; font-size: 11.5px; }
.inbox-item.is-unread .msg-avatar { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }

.inbox-item-body { flex: 1; min-width: 0; }
.inbox-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.inbox-item-top b { font-size: 13px; font-weight: 500; color: var(--ds-ink); }
.inbox-item.is-unread .inbox-item-top b { font-weight: 700; }
.inbox-item-top time { flex: none; font-size: 10.5px; color: var(--ds-ink-mute); }

.inbox-item-subject {
    display: block;
    margin-top: 1px;
    font-size: 12.5px;
    color: var(--ds-ink-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inbox-item.is-unread .inbox-item-subject { color: var(--ds-ink); font-weight: 600; }
.inbox-item-preview {
    display: block;
    font-size: 11.5px;
    color: var(--ds-ink-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-pages { padding: 10px; border-top: 1px solid var(--ds-border); display: flex; justify-content: center; }
.inbox-pages .pagination { margin: 0; }

/* ---- القارئ ---- */
.inbox-reader { padding: 22px 26px; min-height: 320px; }
/* العودة للهاتف وحده: على الواسع القائمة ظاهرة بجانبه */
.inbox-back {
    display: none;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 12.5px;
    color: var(--ds-ink-mute);
    text-decoration: none;
}
.inbox-back:hover { color: var(--ds-brand-600); }

.reader-head { border-bottom: 1px solid var(--ds-border); padding-bottom: 16px; margin-bottom: 18px; }
.reader-subject {
    margin: 0 0 14px;
    font-family: var(--ds-font-display);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--ds-ink);
}
.reader-from { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.reader-from-body { flex: 1 1 180px; min-width: 0; }
.reader-from-body b { display: block; font-size: 13.5px; color: var(--ds-ink); }
.reader-mail { font-size: 12px; color: var(--ds-ink-mute); text-decoration: none; word-break: break-all; }
.reader-mail:hover { color: var(--ds-brand-600); text-decoration: underline; }
.reader-time { flex: none; font-size: 11.5px; color: var(--ds-ink-mute); }

/* عرض قراءة محدود: سطر يتجاوز ~٧٠ حرفاً تتعب العين في العودة إلى
   أوّله */
.reader-text {
    max-width: 70ch;
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.95;
    color: var(--ds-ink-soft);
}

.reader-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--ds-border);
}
.reader-foot-end { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.reader-foot-end form { display: inline-flex; margin: 0; }

/* لوح فارغ يقول ما يُفعل، لا مساحة بيضاء صامتة */
.reader-blank {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 280px;
    text-align: center;
}
.reader-blank > i { font-size: 38px; color: var(--ds-border-strong); margin-bottom: 4px; }
.reader-blank p { margin: 0; font-size: 14px; font-weight: 600; color: var(--ds-ink-soft); }
.reader-blank span { font-size: 12px; color: var(--ds-ink-mute); }

@media (max-width: 991.98px) {
    /* عمود واحد: القائمة، وفتح رسالة يُظهر القارئ وحده */
    .inbox-split { grid-template-columns: 1fr; }
    .inbox-list { max-height: none; }
    .inbox-split.has-open .inbox-list-pane { display: none; }
    .inbox-split:not(.has-open) .inbox-reader { display: none; }
    .inbox-back { display: inline-flex; }
}

@media (max-width: 575.98px) {
    .inbox-reader { padding: 18px; }
    .reader-subject { font-size: 17px; }
}

.msg-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-display);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ds-ink-soft);
    flex: none;
}

/* ==================== 2d) DataTables chrome ====================
   أدوات الجدول كانت بتنسيق Bootstrap الخام فتبدو دخيلة على النظام */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    height: 38px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    padding: 0 12px;
    background: var(--ds-surface);
    color: var(--ds-ink);
    font-size: 14px;
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--ds-brand-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
    outline: none;
}
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info { color: var(--ds-ink-mute); font-size: 13.5px; }

/* الترقيم: كان أزراراً متناثرة كلٌّ بحدّه وفجوة بينها — ثمانية عناصر
   منفصلة تقرأها العين واحداً واحداً. صارت مجموعة واحدة متّصلة بحدّ
   خارجي واحد وفواصل شعرة بين أزرارها، فتُقرأ كأداة واحدة.
   الحدود منطقية (\u200Einline-start\u200E) فتنقلب مع RTL بلا قاعدة ثانية. */
.dataTables_wrapper .pagination {
    display: inline-flex;
    margin: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-surface);
    overflow: hidden;
}
.dataTables_wrapper .pagination .page-item { margin: 0; }
.dataTables_wrapper .pagination .page-link {
    min-width: 34px;
    height: 32px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0 11px;
    border: 0;
    border-inline-start: 1px solid var(--ds-border);
    border-radius: 0;
    background: transparent;
    color: var(--ds-ink-soft);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    box-shadow: none;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
/* أوّل زرّ لا فاصل قبله — وإلا ازدوج مع حدّ المجموعة */
.dataTables_wrapper .pagination .page-item:first-child .page-link { border-inline-start: 0; }
.dataTables_wrapper .pagination .page-link:hover {
    background: var(--ds-surface-sunk);
    color: var(--ds-ink);
}
.dataTables_wrapper .pagination .page-link:focus-visible {
    outline: 2px solid var(--ds-brand-600);
    outline-offset: -2px;
}
.dataTables_wrapper .pagination .active .page-link,
.dataTables_wrapper .pagination .active .page-link:hover {
    background: var(--ds-accent);
    color: #fff;
    font-weight: 600;
}
.dataTables_wrapper .pagination .disabled .page-link {
    color: var(--ds-ink-mute);
    opacity: .5;
    pointer-events: none;
}
/* «…» ليست زرّاً: تُقرأ كفاصل لا كخيار */
.dataTables_wrapper .pagination .disabled .page-link:hover { background: transparent; }

/* ==================== 3) Buttons ==================== */
.btn {
    border-radius: var(--ds-radius-md);
    font-weight: 600;
    transition: transform var(--ds-dur) var(--ds-ease),
        box-shadow var(--ds-dur) var(--ds-ease),
        background-color var(--ds-dur-fast) ease,
        border-color var(--ds-dur-fast) ease,
        opacity var(--ds-dur-fast) ease;
}

/* الزر الأساسي: تدرج الهوية + توهج */
.btn-primary,
.btn-login {
    background: var(--ds-brand-600);
    border: 0;
    color: #fff;
    box-shadow: none;
}
.btn-primary:hover, .btn-primary:focus,
.btn-login:hover, .btn-login:focus {
    background: var(--ds-brand-700);
    color: #fff;
    box-shadow: var(--ds-shadow-sm);
}
.btn-primary:active, .btn-login:active {
    transform: translateY(0);
    background: var(--ds-gradient);
}
.btn-primary:disabled, .btn-login:disabled {
    background: var(--ds-gradient);
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.btn-outline-primary {
    --tblr-btn-color: var(--ds-brand-600);
    --tblr-btn-border-color: var(--ds-brand-200);
    --tblr-btn-hover-bg: var(--ds-brand-50);
    --tblr-btn-hover-color: var(--ds-brand-700);
    --tblr-btn-hover-border-color: var(--ds-brand-400);
    --tblr-btn-active-bg: var(--ds-brand-100);
    --tblr-btn-active-color: var(--ds-brand-700);
    --tblr-btn-active-border-color: var(--ds-brand-400);
}

.btn-ghost-secondary:hover { border-radius: var(--ds-radius-md); }

.btn-danger {
    --tblr-btn-bg: var(--ds-danger);
    --tblr-btn-border-color: var(--ds-danger);
    --tblr-btn-hover-bg: #be123c;
    --tblr-btn-hover-border-color: #be123c;
}
.btn-outline-danger {
    --tblr-btn-color: var(--ds-danger);
    --tblr-btn-border-color: #fecdd3;
    --tblr-btn-hover-bg: var(--ds-danger-bg);
    --tblr-btn-hover-color: #be123c;
    --tblr-btn-hover-border-color: var(--ds-danger);
}
.btn-success {
    --tblr-btn-bg: var(--ds-success);
    --tblr-btn-border-color: var(--ds-success);
    --tblr-btn-hover-bg: #059669;
    --tblr-btn-hover-border-color: #059669;
}

/* ==================== 4) Cards ==================== */
.card {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-sm);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--ds-border);
}
.card-footer {
    background: transparent;
    border-top: 1px solid var(--ds-border);
}

/* البطاقات التفاعلية: رفع موحّد */
.card-link, .card.card-link, .card-link-pop {
    transition: transform var(--ds-dur) var(--ds-ease), box-shadow var(--ds-dur) var(--ds-ease);
}
.card-link:hover, .card-link-pop:hover {
    transform: translateY(-4px);
    box-shadow: var(--ds-shadow-lg);
    color: inherit;
}

/* بطاقة المؤشّر KPI */
.card .h1 { font-weight: 800; letter-spacing: 0; font-family: var(--ds-font-display); }
.avatar.avatar-lg { width: 3rem; height: 3rem; border-radius: var(--ds-radius-md); }

/* ==================== 5) Forms ==================== */
.form-control, .form-select {
    border-radius: var(--ds-radius-md);
    border-color: var(--ds-border);
    color: var(--ds-ink);
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--ds-brand-400);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.form-control.is-invalid { border-color: var(--ds-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12); }
.form-label { font-weight: 600; color: var(--ds-ink-soft); }
.invalid-feedback { color: var(--ds-danger); }

.form-check-input:checked {
    background-color: var(--ds-brand-600);
    border-color: var(--ds-brand-600);
}

/* ==================== 6) Tables & DataTables ====================
   جدولا DataTables والجداول العادية كانا يبدوان مختلفين: رأس أزرق
   \u200E--ds-brand-50\u200E وترقيم بتدرّج، وأدوات محشورة داخل حشو البطاقة.
   التنسيق هنا واحد للاثنين. */
/* الرأس والجسم بنفس المحاذاة والحشو — بدونهما تبدو البيانات مزاحة
   عن عناوين أعمدتها، خصوصاً في RTL */
.table thead th,
.table tbody td { text-align: start; }

/* المكتبة تكتب \u200Etext-align: left\u200E على كل رأس بانتقاء (0,1,3) أقوى من
   \u200E.table thead th\u200E (0,1,2) — فبقيت العناوين يساراً والبيانات يميناً،
   والقاعدة أعلاه لم تُطبَّق قط على جداول DataTables.
   \u200Edashboard.css\u200E يُحمّل بعد CSS المكتبة، فالانتقاء المساوي يكفي
   بلا \u200E!important\u200E. */
table.dataTable thead th, table.dataTable thead td,
table.dataTable tfoot th, table.dataTable tfoot td { text-align: start; }

/* \u200Epadding-right: 26px\u200E تفتح به المكتبة مكاناً لسهم الفرز — وفي RTL
   جهة البداية هي اليمين، فالحشو يدفع العنوان بعيداً عن حافة عموده،
   والسهم يجلس فوق موضع بداية النصّ. نُعيده صفراً ونفتح المكان في
   جهة النهاية. */
table.dataTable thead > tr > th.sorting,
table.dataTable thead > tr > th.sorting_asc,
table.dataTable thead > tr > th.sorting_desc {
    /* \u200E.75rem\u200E هو حشو خلايا الجسم في Tabler — فيقع العنوان فوق بياناته */
    padding-inline-start: .75rem;
    padding-inline-end: 22px;
}
/* القاعدة أعلاه انتقاؤها أقوى من حافة \u200E.card-table\u200E، فتُعاد هنا لعمودَي
   الطرفين وإلا خرج عنوان «الطالب» عن محاذاة الأفاتار تحته */
table.dataTable.card-table thead > tr > th:first-child { padding-inline-start: 1.25rem; }
table.dataTable.card-table thead > tr > th:last-child { padding-inline-end: 1.25rem; }
table.dataTable thead > tr > th.sorting::before,
table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::before,
table.dataTable thead > tr > th.sorting_desc::after {
    right: auto;
    inset-inline-end: 6px;
}

.table thead th {
    background: var(--ds-surface);
    color: var(--ds-ink-mute);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0;
    padding-block: 12px;
    border-bottom: 1px solid var(--ds-border);
    white-space: nowrap;
}
/* DataTables يكتب عرضاً ثابتاً على الرؤوس حين يُفعَّل autoWidth —
   عُطِّل في السكربت، وهذا يُبطل أي بقايا منه */
table.dataTable { width: 100% !important; }
table.dataTable thead th { width: auto !important; }
.table tbody td {
    font-size: 13.5px;
    color: var(--ds-ink-soft);
    border-bottom: 1px solid var(--ds-border);
    /* كان ١٢ فالصفّ ~٥٥ بكسل لمحتوى نصّي — فضفاض. الآن ~٤٨،
       فيظهر صفّان إضافيان في الشاشة بلا ازدحام. */
    padding-block: 10px;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--ds-dur-fast) ease; }
.table tbody tr:hover { background: var(--ds-surface-sunk); }

/* أسهم الفرز: كانت رمادية داكنة على كل عمود فتزاحم العناوين */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after {
    opacity: .22;
    font-size: 11px;
}
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_desc::after { opacity: .9; color: var(--ds-ink); }
table.dataTable thead th:hover::before,
table.dataTable thead th:hover::after { opacity: .5; }

/* أدوات الجدول: خيار \u200Edom\u200E الجديد أزال أغلفة \u200E.row\u200E التي كانت القواعد
   القديمة تستهدفها، فصار التذييل عنصرين متراصّين رأسياً — المعلومة
   في سطر والترقيم في سطر تحته، بلا حدّ فاصل ولا حشو. الحاويتان
   \u200E.dt-top\u200E و\u200E.dt-bottom\u200E من صنعنا، فننسّقهما نحن. */
.card .dataTables_wrapper { padding: 0; }

.dt-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 11px 16px;
    border-top: 1px solid var(--ds-border);
}
.dataTables_wrapper .dataTables_info {
    margin: 0;
    padding: 0;
    font-size: 12.5px;
    color: var(--ds-ink-mute);
    font-variant-numeric: tabular-nums;
}

.dataTables_wrapper .dataTables_filter { text-align: start; }
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--ds-ink-mute);
}
.dataTables_wrapper .dataTables_filter input { min-width: 240px; }

/* حقل البحث بعد نقله إلى شريط التصفية: كان صندوقاً عارياً بلا أيقونة
   ولا نصّ إرشادي فلا يُقرأ كحقل بحث أصلاً. الأيقونة داخله في جهة
   البداية، والحشو يُفتح لها فلا يمرّ النصّ تحتها. */
.filter-search-box { position: relative; }
.filter-search-box > .form-control { padding-inline-start: 38px; }
.filter-search-icon {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 17px;
    line-height: 1;
    color: var(--ds-ink-mute);
    pointer-events: none;
    z-index: 2;
}
.dt-top.is-inline,
.dt-top.is-inline .dataTables_filter,
.dt-top.is-inline .dataTables_filter label { display: block; margin: 0; width: 100%; }
.dt-top.is-inline .dataTables_filter input {
    width: 100%;
    min-width: 0;
    height: 38px;
    margin: 0;
    padding-inline-start: 38px;
    padding-inline-end: 12px;
    font-size: 13.5px;
}
/* المتصفّحات تضيف زرّ مسح خاصاً بها على \u200Etype=search\u200E بمظهر دخيل */
.dt-top.is-inline .dataTables_filter input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* مؤشّر التحميل: كان صندوقاً يتوسّط الجدول فيحجب الصفوف ويقفز مع كل
   بحث أو ترتيب. صار خيطاً متحركاً أعلى الجدول — يُعلم بالانشغال بلا
   أن يحجب أو يزيح شيئاً. */
.dataTables_wrapper { position: relative; }
.dataTables_wrapper .dataTables_processing {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    top: 0;
    width: 100%;
    height: 2px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--ds-surface-sunk);
    box-shadow: none;
    /* النصّ يبقى لقارئات الشاشة ويختفي عن العين */
    font-size: 0;
    color: transparent;
    overflow: hidden;
    z-index: 5;
}
.dataTables_wrapper .dataTables_processing::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inline-size: 35%;
    background: var(--ds-brand-600);
    animation: dt-load 1s ease-in-out infinite;
}
@keyframes dt-load {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(400%); }
}

@media (prefers-reduced-motion: reduce) {
    .dataTables_wrapper .dataTables_processing::after {
        animation: none;
        inline-size: 100%;
        opacity: .35;
    }
}

/* الترقيم يُنسَّق في القسم 2d: تكامل Bootstrap 5 يرسمه
   \u200E.pagination .page-link\u200E لا \u200E.paginate_button\u200E */

/* ==================== 7) Badges & Alerts ==================== */
.badge { border-radius: var(--ds-radius-pill); font-weight: 600; }
.status-badge { display: inline-flex; align-items: center; gap: 4px; }

.alert { border-radius: var(--ds-radius-md); border: 0; box-shadow: var(--ds-shadow-sm); }
.alert-success { background: var(--ds-success-bg); color: #047857; }
.alert-danger { background: var(--ds-danger-bg); color: #be123c; }
.alert-warning { background: var(--ds-warning-bg); color: #b45309; }
.alert-info { background: var(--ds-info-bg); color: #0369a1; }

/* ==================== 8) Sidebar (Navbar vertical) ==================== */
.navbar-vertical.navbar-expand-lg {
    /* كان كتلة سوداء تقطع الشاشة نصفين. الفصل الآن بخط شعرة لا بتباين
       حادّ — العين تنتقل بين السايدبار والمحتوى بلا قفزة. */
    background: #fafafa !important;
    border-inline-end: 1px solid var(--ds-border);
}

/* العلامة */
.sidebar-brand { padding-block: 14px; }
/* على الجوال كانت العلامة فوق شريط التنقّل قبل أي محتوى — ومسار
   التنقّل في الهيدر يبدأ بأيقونة الرئيسية فيغني عنها */
@media (max-width: 991.98px) {
    .sidebar-brand { display: none; }
    /* \u200E.navbar\u200E يفرض ٥٦ بكسل ولو كان فارغاً — القائمة المفتوحة تأخذ ارتفاعها */
    aside.sidebar { min-height: 0; padding-block: 0; }
}
.sidebar-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    color: var(--ds-ink);
    flex-shrink: 0;
}
.sidebar-brand-text { line-height: 1.25; text-align: start; color: var(--ds-ink); }
.sidebar-brand-text b,
.sidebar-brand-text strong {
    font-family: var(--ds-font-display);
    font-weight: 800;
    font-size: 15px;
}
.sidebar-brand-text small {
    font-size: 11px;
    font-weight: 400;
    color: var(--ds-ink-mute);
}

/* مساحة العمل: الفصل النشط تحت العلامة */
.sidebar-context {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 10px 10px;
    padding: 9px 11px;
    border: 1px solid var(--ds-border);
    border-radius: 10px;
    background: var(--ds-surface);
    color: var(--ds-ink);
    font-size: 13px;
    min-width: 0;
}
.sidebar-context > i { color: var(--ds-ink-mute); font-size: 17px; flex: none; }

/* عنصر flex لا ينكمش تحت حجم محتواه ما لم يُعطَ min-width صفراً —
   وبدونها كان اسم الفصل يطفح خارج الإطار. */
.sidebar-context-text { min-width: 0; flex: 1; }

.sidebar-context small {
    display: block;
    font-size: 10.5px;
    color: var(--ds-ink-mute);
    line-height: 1.3;
}
/* يلتفّ على سطرين بدل قصّه بنقاط تبتلع السنة — والاسم كاملاً في title */
.sidebar-context b {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* ---- العلامة: مضمّنة ومتحرّكة ----
   علامة الموقع نفسها (عقد على مسار) — كانت اللوحة بقبعة في صورة ثابتة
   تخالف الموقع وصفحة الدخول. عند التحميل يُرسم المسار وتضيء العقد
   تباعاً، وعند المرور تمتلئ الأخيرة — التخرّج — ويعبر بريق. */
.brand-link { display: flex; align-items: center; gap: 11px; }
.brand-mark {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(9, 9, 11, .12), 0 6px 14px -6px rgba(37, 99, 235, .45);
    transition: transform var(--ds-dur) var(--ds-ease), box-shadow var(--ds-dur) var(--ds-ease);
}
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-link:hover .brand-mark {
    transform: translateY(-1px) rotate(-3deg);
    box-shadow: 0 1px 2px rgba(9, 9, 11, .12), 0 10px 20px -8px rgba(37, 99, 235, .6);
}

.bm-rail { stroke-dasharray: 1; animation: bm-draw .7s .1s var(--ds-ease) both; }
.bm-node { transform-box: fill-box; transform-origin: center; animation: bm-pop .45s var(--ds-ease) both; }
.bm-n1 { animation-delay: .05s; }
.bm-n2 { animation-delay: .3s; }
.bm-n3 {
    animation-delay: .55s;
    transition: fill var(--ds-dur) var(--ds-ease), stroke var(--ds-dur) var(--ds-ease);
}
.brand-link:hover .bm-n3 { fill: #fff; stroke: #fff; }

@keyframes bm-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* بريق يعبر البلاطة */
.brand-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .28) 48%, transparent 62%);
    transform: translateX(-120%);
    pointer-events: none;
}
.brand-link:hover .brand-shine { animation: bm-shine .9s var(--ds-ease); }

@keyframes bm-shine { to { transform: translateX(120%); } }

.brand-link .sidebar-brand-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.sidebar-brand-text b { display: inline-flex; align-items: flex-end; gap: 3px; font-size: 17px; line-height: 1.2; }
/* نقطة العلامة بلون الهوية — تنبض مرّة عند التحميل */
.brand-dot {
    width: 6px;
    height: 6px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: var(--ds-brand-600);
    animation: bm-pop .5s .8s var(--ds-ease) both;
}
@keyframes bm-pop {
    from { transform: scale(0); }
    60% { transform: scale(1.5); }
    to { transform: scale(1); }
}

/* ---- الفصل الحالي: الفصل عنواناً والسنة شارة ---- */
.sem-card { gap: 10px; padding: 9px 10px; transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease; }
.sem-card:hover { border-color: var(--ds-border-strong); box-shadow: var(--ds-shadow-sm); }
.sem-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-600);
    font-size: 17px;
}
.sem-card small { display: flex; align-items: center; gap: 5px; }
/* يلتفّ ولا يُقصّ — الاسم كاملاً أهمّ من سطر واحد */
.sem-card b {
    display: block;
    margin-top: 2px;
    font-family: var(--ds-font-display);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
/* «مباشر»: الفصل النشط يعمل الآن */
.sem-live {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ds-success);
}
.sem-live::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--ds-success);
    animation: sem-pulse 2s ease-out infinite;
}
@keyframes sem-pulse {
    from { transform: scale(1); opacity: .6; }
    to { transform: scale(2.8); opacity: 0; }
}
.sem-year {
    flex: none;
    margin-inline-start: auto;
    padding: 1px 7px;
    line-height: 1.5;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    border: 1px solid var(--ds-border);
    font-family: var(--ds-font-display);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink-soft);
}

@media (prefers-reduced-motion: reduce) {
    .bm-rail, .bm-node, .brand-dot, .sem-live::after,
    .brand-link:hover .brand-shine { animation: none; }
}

/* تسمية القسم — التباعد الموجب يفكّ وصل الحروف العربية، فصُفّر */
.sidebar-label {
    margin: 18px 22px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #9a9aa2;
    list-style: none;
}
li.sidebar-label { margin-inline: 22px; }

/* الروابط: أصغر وأهدأ — كثافة أعلى بلا ازدحام */
.navbar-vertical .nav-link {
    position: relative;
    border-radius: 9px;
    margin: 1px 10px;
    padding-block: 8px;
    font-size: 13.5px;
    color: var(--ds-ink-soft);
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.navbar-vertical .nav-link .nav-link-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: transparent;
    color: #9a9aa2;
    transition: color var(--ds-dur-fast) ease;
}
.navbar-vertical .nav-link:hover {
    background: #f0f0f1;
    color: var(--ds-ink);
}
.navbar-vertical .nav-link:hover .nav-link-icon { color: var(--ds-ink); }

/* النشط: أرضية هادئة وشريط حبري على الحافة — لا حبّة زرقاء ممتلئة */
.navbar-vertical .nav-item.active .nav-link,
.navbar-vertical .nav-link.active {
    background: #ededee;
    color: var(--ds-ink);
    font-weight: 600;
    box-shadow: none;
}
.navbar-vertical .nav-item.active .nav-link::before {
    content: "";
    position: absolute;
    inset-inline-start: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 56%;
    border-radius: 3px;
    background: var(--ds-accent);
}
.navbar-vertical .nav-item.active .nav-link .nav-link-icon {
    background: transparent;
    color: var(--ds-ink);
}

/* عدّاد داخل رابط */
.sidebar-count {
    margin-inline-start: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--ds-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

/* بطاقة مشروع الطالب — كانت مبنية على شفافية بيضاء تفترض خلفية داكنة */
.sidebar-project {
    display: block;
    margin: 8px 10px;
    padding: 12px;
    border-radius: 10px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    color: var(--ds-ink-soft);
    font-size: 12.5px;
    text-decoration: none;
    transition: border-color var(--ds-dur-fast) ease;
}
.sidebar-project:hover {
    border-color: var(--ds-border-strong);
    color: var(--ds-ink);
}
.sidebar-project i { color: var(--ds-ink-mute); }
.sidebar-project-track {
    height: 5px;
    border-radius: 999px;
    background: #ededee;
    overflow: hidden;
}
/* كان تدرّجاً ثلاثي الألوان — صار حبراً مصمتاً */
.sidebar-project-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ds-accent);
    transition: width var(--ds-dur-slow) var(--ds-ease);
}
.sidebar-project-meta { font-size: 11px; color: var(--ds-ink-mute); }

/* تذييل: تسجيل الخروج */
.sidebar-foot {
    padding: 10px 10px 14px;
    border-top: 1px solid var(--ds-border);
    margin-top: 8px;
}
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--ds-ink-mute);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.sidebar-logout:hover {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

/* شريط تمرير أنيق داخل القائمة */
.navbar-vertical .navbar-collapse::-webkit-scrollbar { width: 6px; }
.navbar-vertical .navbar-collapse::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 999px;
}
.navbar-vertical .navbar-collapse::-webkit-scrollbar-track { background: transparent; }

/* ==================== 9) Header ==================== */
.page-wrapper .navbar,
header.navbar {
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--ds-border);
}

.badge-notify {
    position: absolute;
    top: 0.25rem;
    inset-inline-start: 1.5rem;
    background: var(--ds-danger) !important;
    color: #fff !important;
}

/* ==================== 10) Dropdowns & Modals ==================== */
.dropdown-menu {
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow-lg);
    animation: ds-pop var(--ds-dur) var(--ds-ease);
}
.dropdown-item { border-radius: var(--ds-radius-sm); transition: background-color var(--ds-dur-fast) ease; }
.dropdown-item:hover { background: var(--ds-brand-50); color: var(--ds-brand-700); }
.dropdown-item.text-danger:hover { background: var(--ds-danger-bg); color: var(--ds-danger); }

.modal-content {
    border: 0;
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--ds-border); }
.modal-footer { border-top: 1px solid var(--ds-border); }
.modal.fade .modal-dialog {
    transition: transform var(--ds-dur) var(--ds-ease), opacity var(--ds-dur) var(--ds-ease);
    transform: translateY(16px) scale(0.98);
}
.modal.show .modal-dialog { transform: translateY(0) scale(1); }

@keyframes ds-pop {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== 11) Page transition ==================== */
.page-body { animation: ds-page-in var(--ds-dur-slow) var(--ds-ease); }
@keyframes ds-page-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 12) Focus states (WCAG) ==================== */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
a:focus-visible {
    outline: 2px solid var(--ds-brand-600);
    outline-offset: 2px;
    box-shadow: none;
}

/* ==================== 13) Utilities & bits ==================== */
.min-w-0 { min-width: 0 !important; }
/* رابط «نسيت كلمة السر» تحت زرّ الدخول: من نسي كلمته لا يبحث عن
   رابط في صفحة أخرى */
.auth-forgot { margin: 14px 0 0; text-align: center; }
.auth-forgot a {
    font-size: 12.5px;
    color: var(--ds-ink-mute);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--ds-dur-fast) ease, border-color var(--ds-dur-fast) ease;
}
.auth-forgot a:hover { color: var(--ds-brand-600); border-bottom-color: currentColor; }

/* ==================== التنبيهات المنبثقة ====================
   أسفل الجهة الأخرى من السايدبار — كانت أعلاه فتحجب التنقّل.
   بطاقة بأيقونة في دائرة ملوّنة، وعنوان قصير ونصّ، وشريط وقت أسفلها:
   انتهاؤه هو ما يغلقها، ويتوقّف عند المرور أو التركيز (dialog.js). */
.toast-stack {
    position: fixed;
    inset-block-end: 22px;
    inset-inline-end: 22px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: min(390px, calc(100vw - 32px));
    pointer-events: none;
}
.app-toast {
    --tone: var(--ds-brand-600);
    --tone-soft: var(--ds-brand-50);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px 16px 14px;
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 18px 40px -14px rgba(15, 23, 42, .28);
    overflow: hidden;
    pointer-events: auto;
    animation: toast-in .5s cubic-bezier(.21, 1.02, .73, 1) both;
}
/* هالة خفيفة بلون النغمة عند حافة البداية */
.app-toast::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 90px;
    background: linear-gradient(to right, var(--tone-soft), transparent);
    pointer-events: none;
}
[dir="rtl"] .app-toast::before { background: linear-gradient(to left, var(--tone-soft), transparent); }
.app-toast-icon {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tone);
    color: #fff;
    box-shadow: 0 0 0 5px var(--tone-soft), 0 6px 14px -4px var(--tone);
    animation: toast-pop .55s cubic-bezier(.34, 1.56, .64, 1) .12s both;
}
.app-toast-icon i { font-size: 19px; }
.app-toast-body {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 1px;
    color: inherit;
    text-decoration: none;
}
.app-toast-title { font-size: 14px; font-weight: 700; color: var(--ds-ink); line-height: 1.45; }
.app-toast-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
    color: var(--ds-ink-soft);
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
a.app-toast-body:hover .app-toast-title { color: var(--tone); }
.app-toast-close {
    position: relative;
    flex: none;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ds-ink-mute);
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.app-toast-close:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
.app-toast-close i { font-size: 15px; }
/* شريط الوقت: يتقلّص نحو البداية، ويتوقّف بالمرور أو التركيز */
.app-toast-timer {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    height: 3px;
    background: var(--tone);
    opacity: .55;
    transform-origin: left;
    animation: toast-timer var(--toast-delay, 5000ms) linear forwards;
}
[dir="rtl"] .app-toast-timer { transform-origin: right; }
.app-toast:hover .app-toast-timer,
.app-toast:focus-within .app-toast-timer { animation-play-state: paused; }

.app-toast.is-success { --tone: #059669; --tone-soft: #ecfdf5; }
.app-toast.is-danger  { --tone: #dc2626; --tone-soft: #fef2f2; }
.app-toast.is-warning { --tone: #d97706; --tone-soft: #fffbeb; }
.app-toast.is-info    { --tone: #0284c7; --tone-soft: #f0f9ff; }
.app-toast.is-notify  { --tone: var(--ds-brand-600); --tone-soft: var(--ds-brand-50); }
.app-toast.is-notify .app-toast-icon i { animation: toast-ring 1s ease .5s 2; transform-origin: 50% 10%; }

/* الخروج: تنزلق جانباً ويُطوى ارتفاعها فتتحرّك الباقية بنعومة */
.app-toast { --toast-out: 28px; }
[dir="rtl"] .app-toast { --toast-out: -28px; }
.app-toast.is-leaving {
    animation: toast-out .4s cubic-bezier(.4, 0, .2, 1) forwards;
    pointer-events: none;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(18px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
    40%  { opacity: 0; transform: translateX(var(--toast-out)) scale(.98); }
    100% { opacity: 0; transform: translateX(var(--toast-out)); height: 0; padding-block: 0; margin-block-start: -10px; border-width: 0; }
}
@keyframes toast-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes toast-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); }
    60% { transform: rotate(8deg); } 80% { transform: rotate(-5deg); }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast, .app-toast-icon, .app-toast.is-notify .app-toast-icon i { animation: none; }
    .app-toast.is-leaving { animation: none; opacity: 0; }
}

@media (max-width: 575.98px) {
    .toast-stack { inset-inline: 12px; width: auto; inset-block-end: 12px; }
}

.toast-container { z-index: 1090; }

/* ==================== نافذة التأكيد ====================
   بدل confirm() المتصفّح: <dialog> في الطبقة العليا (فوق الأدراج والنوافذ)
   بأيقونة ولون حسب الخطورة. السلوك في dialog.js. */
.app-dialog {
    width: min(420px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
    color: var(--ds-ink);
    overflow: visible;
}
.app-dialog[open] { animation: dlg-in .38s cubic-bezier(.21, 1.02, .73, 1); }
.app-dialog::backdrop {
    background: rgba(15, 23, 42, .38);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: dlg-fade .25s ease;
}
.app-dialog-card {
    --tone: #dc2626;
    --tone-soft: #fef2f2;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 30px 26px 22px;
    border-radius: 22px;
    background: var(--ds-surface);
    text-align: center;
    box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .05);
    overflow: hidden;
}
/* إشعاع ناعم بلون الخطورة خلف الأيقونة */
.app-dialog-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 130px;
    background: radial-gradient(60% 100% at 50% 0, var(--tone-soft), transparent 75%);
    pointer-events: none;
}
.app-dialog[data-tone="warning"] .app-dialog-card { --tone: #d97706; --tone-soft: #fffbeb; }
.app-dialog[data-tone="primary"] .app-dialog-card { --tone: var(--ds-brand-600); --tone-soft: var(--ds-brand-50); }
.app-dialog-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: #fff;
    color: var(--tone);
    box-shadow: 0 0 0 8px var(--tone-soft), 0 10px 24px -8px var(--tone);
}
.app-dialog[open] .app-dialog-icon { animation: toast-pop .5s cubic-bezier(.34, 1.56, .64, 1) .08s both; }
.app-dialog[open][data-tone="danger"] .app-dialog-icon i { animation: dlg-shake .5s ease .45s; }
.app-dialog-icon i { font-size: 28px; }
.app-dialog-title {
    position: relative;
    margin: 0;
    font-family: var(--ds-font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--ds-ink);
}
.app-dialog-text {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    line-height: 1.75;
    color: var(--ds-ink-soft);
    overflow-wrap: anywhere;
}
/* الفقرة الثانية (ما يترتّب على القرار) في لوح ملوّن خفيف */
.app-dialog-text small {
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--tone-soft);
    color: var(--ds-ink);
    font-size: 12.5px;
    line-height: 1.7;
}
.app-dialog-actions {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
}
.app-dialog-actions .btn { min-height: 42px; border-radius: 12px; font-weight: 700; }
.app-dialog-ok.btn-warning { color: #fff; }
/* الإلغاء: زرّ هادئ أبيض — تلوين Bootstrap عند التركيز يجعله أثقل من «حذف» */
.app-dialog-cancel.btn,
.app-dialog-cancel.btn:focus,
.app-dialog-cancel.btn:active { background: #fff; border: 1px solid var(--ds-border-strong); color: var(--ds-ink); }
.app-dialog-cancel.btn:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
.app-dialog-actions .btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ds-brand-200); }

@keyframes dlg-in {
    from { opacity: 0; transform: translateY(14px) scale(.95); }
    to   { opacity: 1; transform: none; }
}
@keyframes dlg-fade { from { opacity: 0; } }
@keyframes dlg-shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-6deg); }
}
@media (prefers-reduced-motion: reduce) {
    .app-dialog[open], .app-dialog::backdrop, .app-dialog[open] .app-dialog-icon, .app-dialog[open] .app-dialog-icon i { animation: none; }
}
@media (max-width: 575.98px) {
    .app-dialog-actions { grid-template-columns: 1fr; }
}

/* هيكل تحميل (Skeleton) */
.chart-wrap { position: relative; min-height: 320px; }
.chart-skeleton { position: absolute; inset: 0; border-radius: var(--ds-radius-md); }
.skeleton {
    background: linear-gradient(90deg, #eef0f6 25%, #f6f7fb 37%, #eef0f6 63%);
    background-size: 400% 100%;
    animation: ds-skeleton 1.4s ease infinite;
}
@keyframes ds-skeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* زر إظهار/إخفاء كلمة السر */
.password-wrapper { position: relative; }
.password-wrapper .toggle-password {
    position: absolute;
    inset-inline-end: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--ds-ink-mute);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.password-wrapper .form-control { padding-inline-end: 2.25rem; }

/* الحالة الفارغة (Empty state) */
.empty .empty-icon {
    color: var(--ds-brand-300);
}
/* مشهد الحالة الفارغة: شخصية في هالة، وأيقونة الحالة شارة تطفو بجانبها */
.empty-scene {
    position: relative;
    display: grid;
    place-items: end center;
    width: 168px;
    height: 118px;
    margin: 0 auto;
}
.empty-scene::before {
    content: "";
    position: absolute;
    inset: 4px 14px 0;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--ds-brand-50), transparent);
}
.empty-scene::after {
    content: "";
    position: absolute;
    bottom: 2px;
    width: 110px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--ds-border-strong), transparent);
}
.empty-cast {
    position: relative;
    z-index: 1;
    overflow: visible;
    margin-bottom: 2px;
    animation: empty-rise .6s cubic-bezier(.34, 1.4, .64, 1) both;
    transform-origin: 50% 100%;
}
.empty-badge {
    position: absolute;
    z-index: 2;
    top: 6px;
    inset-inline-end: 10px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ds-surface);
    color: var(--ds-brand-600);
    box-shadow: 0 0 0 1px var(--ds-border), 0 10px 22px -10px rgba(37, 99, 235, .45);
    animation: empty-rise .6s cubic-bezier(.34, 1.4, .64, 1) .15s both, empty-float 3s ease-in-out .8s infinite alternate;
}
.empty-badge i { font-size: 20px; }
@keyframes empty-rise { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes empty-float { to { translate: 0 -5px; } }
@media (prefers-reduced-motion: reduce) {
    .empty-cast, .empty-badge { animation: none; }
}

/* ==================== 14) Auth pages (login) ====================
   فاتحة، والبطاقة تجلس على مسار المنصة: الخط يدخل من اليمين ويمرّ خلفها
   ويخرج يساراً بعقده الباقية — الداخل واقف عند نقطة على طريق التخرّج.
   لا تدرّجات لونية: العمق من ضوء أبيض خافت خلف البطاقة، إضاءةً لا لوناً. */
.auth-body {
    --auth-bg: #f7f7f9;
    --auth-surface: #ffffff;
    --auth-line: #e4e4e7;
    --auth-line-lit: #09090b;
    --auth-text: #09090b;
    --auth-mute: #5c5c66;
    --auth-blue: #2563eb;

    margin: 0;
    min-height: 100vh;
    /* ضوء أبيض خافت خلف البطاقة — إضاءة لا لون، فلا تعود التدرّجات */
    background:
        radial-gradient(ellipse 60% 45% at 50% 42%, #ffffff 0%, rgba(255,255,255,0) 70%),
        var(--auth-bg);
    color: var(--auth-text);
    display: grid;
    place-items: center;
    padding: 48px 24px;
    position: relative;
    overflow-x: hidden;
}

/* ---- المسار: منحنى يلتفّ حول البطاقة بمحطّاته الأربع ----
   ما مضى أزرق متصل، وما بقي متقطّع رمادي، ونقطة ضوء تسري عليه.
   كل شيء فاتح: شبكة نقاط خافتة وهالتان زرقاوان بالكاد تُريان. */
.auth-path {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.auth-path::before,
.auth-path::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
}
.auth-path::before {
    width: 46vw; height: 46vw; top: -18vw; inset-inline-start: -12vw;
    background: radial-gradient(closest-side, rgba(37, 99, 235, .10), transparent);
}
.auth-path::after {
    width: 40vw; height: 40vw; bottom: -18vw; inset-inline-end: -10vw;
    background: radial-gradient(closest-side, rgba(96, 165, 250, .10), transparent);
}
.auth-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(9, 9, 11, .09) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 75%);
    opacity: 0;
    animation: auth-fade .8s ease .1s forwards;
}
@keyframes auth-fade { to { opacity: 1; } }

.auth-route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
[dir="ltr"] .auth-route { transform: scaleX(-1); }
.auth-route path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.route-todo { stroke: #cbd5e1; stroke-width: 1.6; stroke-dasharray: .5 .9; opacity: 0; animation: auth-fade .6s ease 1.2s forwards; }
/* الجزء الذي مضى: يُرسم من الحافة حتى خلف البطاقة */
.route-done {
    stroke-width: 2.4;
    stroke-dasharray: 52 100;
    stroke-dashoffset: 52;
    animation: route-draw 1.4s var(--ds-ease) .2s forwards;
}
@keyframes route-draw { to { stroke-dashoffset: 0; } }
.route-spark { fill: #2563eb; filter: drop-shadow(0 0 6px rgba(37, 99, 235, .8)); opacity: 0; animation: auth-fade .4s ease 1.6s forwards; }

/* المحطّات: مرساة بلا أبعاد عند نقطة المنحنى */
.station { position: absolute; width: 0; height: 0; }
.station-dot {
    position: absolute; left: 0; top: 0;
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    font-style: normal; font-size: 11.5px; font-weight: 800;
    font-family: var(--ds-font-display);
    transform: translate(-50%, -50%) scale(0);
    animation: station-pop .45s var(--ds-ease) forwards;
}
.station.is-done .station-dot { background: #2563eb; color: #fff; box-shadow: 0 0 0 5px rgba(37, 99, 235, .14); }
.station.is-next .station-dot { background: #fff; color: #2563eb; box-shadow: inset 0 0 0 2px #2563eb, 0 0 0 5px rgba(37, 99, 235, .10); }
.station.is-todo .station-dot { background: #fff; color: #94a3b8; box-shadow: inset 0 0 0 1.5px #cbd5e1; }
@keyframes station-pop { to { transform: translate(-50%, -50%) scale(1); } }

.station-card {
    position: absolute; left: 0;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 7px 13px; border-radius: 12px;
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid #e4e4e7;
    box-shadow: 0 12px 26px -18px rgba(15, 23, 42, .35);
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 6px);
    animation: station-in .5s var(--ds-ease) forwards;
}
.station.is-below .station-card { top: 24px; }
.station.is-above .station-card { bottom: 24px; }
.station-card b { font-family: var(--ds-font-display); font-size: 12.5px; font-weight: 700; color: var(--auth-text); }
.station-card small { font-size: 11px; font-weight: 600; color: #94a3b8; }
.station.is-done .station-card small { color: #047857; }
.station.is-next .station-card { border-color: #bfdbfe; }
.station.is-next .station-card small { color: #2563eb; }
@keyframes station-in { to { opacity: 1; transform: translate(-50%, 0); } }

/* تتابع الظهور على طول المسار */
.station.s1 .station-dot { animation-delay: .5s; }  .station.s1 .station-card { animation-delay: .6s; }
.station.s2 .station-dot { animation-delay: .8s; }  .station.s2 .station-card { animation-delay: .9s; }
.station.s3 .station-dot { animation-delay: 1.3s; } .station.s3 .station-card { animation-delay: 1.4s; }
.station.s4 .station-dot { animation-delay: 1.5s; } .station.s4 .station-card { animation-delay: 1.6s; }

/* ---- شخصيات المسار: الفريق يمشي حتى المشرف، واللجنة تنتظر ----
   المواضع من public/js/auth-cast.js (على المنحنى نفسه). الشخصيات من
   partials/cast.blade.php — هي نفسها في الصفحة الرئيسية. */
.cast-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.auth-cast { position: absolute; inset: 0; }
.cast-team { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.cast-actor, .cast-walker {
    position: absolute; top: 0; left: 0;
    overflow: visible;
    opacity: 0;
    transition: opacity .5s ease;
}
.cast-actor.is-supervisor { width: 49px; height: 84px; }
.cast-actor.is-committee { width: 69px; height: 58px; }
.cast-walker { width: 49px; height: 84px; opacity: 1; }
.auth-cast.is-ready .cast-team { opacity: 1; transition-delay: .8s; }
.auth-cast.is-ready .cast-actor.is-supervisor { opacity: 1; transition-delay: .9s; }
.auth-cast.is-ready .cast-actor.is-committee { opacity: 1; transition-delay: 1.6s; }
/* الوجوه: الفريق يتّجه في سيره، والمشرف واللجنة يستقبلانه */
[dir="rtl"] .cast-walker > use,
[dir="ltr"] .cast-actor > use { transform: scaleX(-1); }

.auth-path .hj-leg, .auth-path .hj-arm { transform-box: fill-box; transform-origin: 50% 8%; }
.auth-path.is-walking .hj-leg.is-a { animation: cast-step .42s ease-in-out infinite alternate; }
.auth-path.is-walking .hj-leg.is-b { animation: cast-step .42s ease-in-out infinite alternate-reverse; }
.auth-path.is-walking .hj-arm { animation: cast-step .42s ease-in-out infinite alternate-reverse; }
.auth-path.is-walking .cast-walker { animation: cast-bob .42s ease-in-out infinite alternate; }
.auth-path.is-walking .cast-walker:nth-child(2) { animation-delay: -.14s; }
.auth-path.is-walking .cast-walker:nth-child(3) { animation-delay: -.28s; }
.auth-path .hj-wave { transform-box: fill-box; transform-origin: 50% 0; animation: cast-wave 2.4s ease-in-out infinite; }
/* وصل الفريق: قفزة فرح صغيرة */
.auth-cast.is-arrived .cast-walker { animation: cast-hop .5s ease-out 2; }
.auth-cast.is-arrived .cast-walker:nth-child(2) { animation-delay: .1s; }
.auth-cast.is-arrived .cast-walker:nth-child(3) { animation-delay: .2s; }
@keyframes cast-step { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
@keyframes cast-bob { to { translate: 0 -3px; } }
@keyframes cast-hop { 50% { translate: 0 -7px; } }
@keyframes cast-wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-28deg); } 80% { transform: rotate(-8deg); } 90% { transform: rotate(-26deg); } }

/* حين تقترب المحطّات من البطاقة تزاحمها الشخصيات */
@media (max-width: 1100px), (max-height: 620px) {
    .auth-cast { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cast-actor, .cast-team { transition: none; }
    .auth-path .hj-wave, .auth-cast.is-arrived .cast-walker { animation: none; }
}

.auth-col {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 384px;
}

/* ---- البطاقة: سطح داكن بحافة علوية مضيئة ---- */
.login-card {
    position: relative;
    background: var(--auth-surface);
    border: 1px solid var(--auth-line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(9, 9, 11, .04), 0 18px 48px -24px rgba(9, 9, 11, .22);
    padding: 34px 32px;
    opacity: 0;
    animation: auth-rise .6s var(--ds-ease) .3s forwards;
}
/* على الفاتح لا معنى لخيط الضوء — الارتفاع يأتي من الحدّ والظل */

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.auth-mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 1px solid var(--auth-line);
    border-radius: 11px;
    background: #fafafa;
    color: var(--auth-text);
}
.auth-brand-name {
    font-family: var(--ds-font-display);
    font-weight: 800;
    font-size: 18px;
    color: var(--auth-text);
}

.login-card h2 {
    font-family: var(--ds-font-display);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 8px;
    color: var(--auth-text);
}
.login-lead {
    color: var(--auth-mute);
    font-size: 13.5px;
    line-height: 1.85;
    margin: 0 0 28px;
}

.auth-field { opacity: 0; animation: auth-rise .45s var(--ds-ease) forwards; }
.auth-field:nth-of-type(1) { animation-delay: .42s; }
.auth-field:nth-of-type(2) { animation-delay: .48s; }
.auth-actions { opacity: 0; animation: auth-rise .45s var(--ds-ease) .54s forwards; }

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-body .form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--auth-mute);
    margin-bottom: 8px;
}
.auth-field:focus-within .form-label { color: var(--auth-text); }

.auth-body .form-control {
    height: 46px;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14.5px;
    color: var(--auth-text);
    background: #fcfcfd;
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.auth-body .form-control::placeholder { color: #a1a1aa; }
.auth-body .form-control:hover { border-color: #c9c9cf; }
.auth-body .form-control:focus {
    border-color: var(--auth-blue);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
    outline: none;
}
.auth-body .form-control.is-invalid { border-color: var(--ds-danger); box-shadow: none; }

/* الزر أبيض على داكن — أعلى تباين ممكن للفعل الوحيد في الصفحة */
.btn-login {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    font-family: var(--ds-font-display);
    font-weight: 700;
    font-size: 15px;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 12px 24px -14px rgba(37, 99, 235, .8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color var(--ds-dur-fast) ease, transform var(--ds-dur-fast) ease;
}
.btn-login:hover, .btn-login:focus { background: #1d4ed8; color: #fff; }
.btn-login:active { transform: scale(.985); }
.btn-login:disabled { opacity: .6; background: #2563eb; color: #fff; }

.auth-note {
    margin: 26px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--auth-line);
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--auth-mute);
    text-align: center;
    opacity: 0;
    animation: auth-rise .45s var(--ds-ease) .6s forwards;
}
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-mute);
    text-decoration: none;
    transition: gap var(--ds-dur) var(--ds-ease), color var(--ds-dur-fast) ease;
}
.auth-back:hover { gap: 11px; color: var(--auth-text); }

.auth-foot {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: #a1a1aa;
    opacity: 0;
    animation: auth-rise .45s var(--ds-ease) .66s forwards;
}

.auth-body .alert {
    border-radius: 10px;
    border: 1px solid #fecdd3;
    background: var(--ds-danger-bg);
    color: #9f1239;
    font-size: 13.5px;
    padding: 12px 14px;
    margin-bottom: 20px;
    animation: auth-rise .35s var(--ds-ease);
}
.auth-body .invalid-feedback { color: #9f1239; font-size: 12.5px; }

.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-inline-end: 44px; }
.toggle-password {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 0; background: transparent;
    border-radius: 8px;
    color: #a1a1aa;
    cursor: pointer;
    transition: color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.toggle-password:hover { color: var(--auth-text); background: #f4f4f5; }

/* على الشاشات الضيقة يزاحم المسار البطاقة — تبقى العقد وتختفي الأسماء */
/* حين تضيق الشاشة تقترب المحطّات من البطاقة: تبقى الدوائر وتختفي البطاقات،
   ثم على الجوال يبقى المنحنى وحده خافتاً على الأطراف */
@media (max-width: 1180px) {
    .station.s2 .station-card, .station.s3 .station-card { display: none; }
}
@media (max-width: 860px) {
    .station-card { display: none; }
}
@media (max-width: 575.98px) {
    .auth-body { padding: 36px 18px; }
    .login-card { padding: 28px 22px; }
    .station { display: none; }
    .auth-route { opacity: .6; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-grid, .route-todo, .route-done, .station-dot, .station-card,
    .login-card, .auth-field, .auth-actions,
    .auth-note, .auth-foot, .auth-body .alert {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
    .route-done { stroke-dashoffset: 0; }
    .station-dot { transform: translate(-50%, -50%); }
    .station-card { transform: translate(-50%, 0); }
    .route-spark { display: none; }
}

/* ==================== 15) Topbar (الشريط العلوي) ====================
   ثلاث مناطق: مسار التنقّل يقول أين أنت، بحث في الوسط، وإجراءات في
   الذيل. الارتفاع ثابت ٥٦ وحدّ شعرة سفلي — بلا ظل ولا حبّات ملوّنة. */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 56px;
    border-bottom: 1px solid var(--ds-border);
    padding-block: 0;
}
.topbar > .container-xl {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 56px;
}

/* ---- مسار التنقّل ----
   كان يعرض الرئيسية والصفحة الحالية فقط ويُسقط ما بينهما، فلم يكن
   بدّ من أزرار عودة في ستّ صفحات. صار مساراً كاملاً بأسلاف قابلة
   للنقر، وحُذفت الأزرار. */
.crumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--ds-ink-mute);
    min-width: 0;
    flex: 1;
}
.crumb-home,
.crumb-link {
    color: var(--ds-ink-mute);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--ds-dur-fast) ease;
}
.crumb-home:hover,
.crumb-link:hover { color: var(--ds-ink); }
.crumb-home i { font-size: 16px; }

.crumb-sep { color: #c9c9cf; font-size: 14px; line-height: 1; flex: none; }

/* الحلقة الأخيرة تنكمش وحدها حين يطول العنوان */
.crumb-current {
    color: var(--ds-ink);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* على الشاشات الضيقة: آخر سلف فقط كسهم رجوع، فلا يزدحم الشريط */
@media (max-width: 991.98px) {
    .crumb-home,
    .crumb-link:not(:nth-last-of-type(1)),
    .crumb-sep:not(:last-of-type) { display: none; }
    .crumb-link { display: inline-flex; align-items: center; }
    .crumb-link::before {
        content: "\ea19"; /* ti-arrow-right */
        font-family: "tabler-icons";
        margin-inline-end: 5px;
        font-size: 15px;
    }
    .crumb-current { display: none; }
}

/* ---- البحث في الوسط ---- */
.cmdk-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 320px;
    max-width: 100%;
    margin-inline: auto;
    padding: 7px 13px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-mute);
    font-size: 13px;
    cursor: pointer;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.cmdk-trigger:hover {
    border-color: var(--ds-border-strong);
    background: var(--ds-surface);
}
.cmdk-trigger-label { flex: 1; text-align: start; }

/* رمادية محايدة — كانت زرقاء تنافس ألوان الأفعال */
.cmdk-kbd {
    font-size: 11px;
    font-weight: 700;
    color: #9a9aa2;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 5px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* ---- أزرار الذيل ---- */
.topbar-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ds-ink-soft);
    padding: 0;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.topbar-icon-btn:hover {
    border-color: var(--ds-border);
    background: var(--ds-surface-sunk);
    color: var(--ds-ink);
}
.topbar-icon-btn i { font-size: 20px; }

.topbar-badge {
    position: absolute;
    top: 4px;
    inset-inline-start: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--ds-danger);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--ds-surface);
}

/* ---- مُشغّل قائمة المستخدم: أفاتار وحده ----
   الاسم والدور انتقلا إلى داخل القائمة (وهما فيها أصلاً)، فتحرّر
   نحو ١٦٠ بكسل من الشريط لمسار التنقّل. */
.user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    padding: 3px 5px 3px 3px;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.user-trigger:hover { border-color: var(--ds-border); background: var(--ds-surface-sunk); }
.user-trigger .ti-chevron-down { font-size: 15px; color: #9a9aa2; }

/* حبر مصمت بأحرف بيضاء — نفس لغة علامة الموقع، لا خلفية متدرّجة */
.avatar-gradient {
    background: var(--ds-accent) !important;
    color: #fff !important;
    font-weight: 700;
    font-family: var(--ds-font-display);
    letter-spacing: 0;
}

/* ---- الموبايل: الهيدر كان يختفي كلياً تحت ٩٩٢ فيضيع البحث
       والإشعارات وقائمة المستخدم معاً ---- */
.topbar-burger { display: none; }

@media (max-width: 991.98px) {
    .topbar-burger { display: grid; }
    .cmdk-trigger {
        width: 36px;
        margin-inline-start: auto;
        margin-inline-end: 0;
        justify-content: center;
        padding: 7px;
    }
    .cmdk-trigger-label,
    .cmdk-kbd { display: none; }
    .crumb-section,
    .crumb-sep { display: none; }
}

/* قائمة الإشعارات */
.notif-menu {
    width: 360px;
    max-width: 92vw;
    padding: 0;
    overflow: hidden;
}
.notif-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-brand-50);
}
.notif-item {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ds-border);
    color: var(--ds-ink);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
.notif-item:hover { background: var(--ds-brand-50); }
.notif-item.unread { background: rgba(37, 99, 235, 0.05); }
.notif-item .notif-dot {
    position: absolute;
    top: 18px;
    inset-inline-start: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
}
.notif-item.unread .notif-dot { background: var(--ds-brand-500); }
.notif-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-text { font-size: 12.5px; color: var(--ds-ink-mute); }
.notif-time { font-size: 11px; color: var(--ds-ink-mute); opacity: 0.8; }
.notif-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--ds-ink-mute);
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.notif-empty i { font-size: 26px; opacity: 0.5; }
.notif-menu-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px;
    font-weight: 700;
    font-size: 13px;
    color: var(--ds-brand-600);
    text-decoration: none;
    background: rgba(238, 244, 255, 0.5);
    transition: background-color var(--ds-dur-fast) ease;
}
.notif-menu-foot:hover { background: var(--ds-brand-50); color: var(--ds-brand-700); }

/* قائمة المستخدم */
.user-trigger { border-radius: var(--ds-radius-md); }
/* ---- الشريط: الجرس وشريحة المستخدم ----
   كانا أيقونتين بلا وزن: جرس بلا حدود، وأفاتار مربّع بسهم رمادي. */
.topbar-bell { width: 40px; height: 40px; border-radius: 12px; border-color: var(--ds-border); background: var(--ds-surface); }
.topbar-bell.has-unread i { animation: bell-ring 1.1s .6s var(--ds-ease) both; transform-origin: 50% 4px; }
.topbar-bell .topbar-badge { top: -4px; inset-inline-start: -4px; }
.topbar-bell.has-unread .topbar-badge::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 2px solid var(--ds-danger);
    animation: badge-ping 2.4s ease-out infinite;
}
@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-5deg); }
    75% { transform: rotate(2deg); }
}
@keyframes badge-ping {
    0% { transform: scale(1); opacity: .7; }
    70%, 100% { transform: scale(1.7); opacity: 0; }
}

.topbar-sep { width: 1px; height: 24px; margin-inline: 8px; background: var(--ds-border); }

.user-trigger {
    gap: 9px;
    height: 40px;
    padding: 3px;
    padding-inline-end: 10px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.user-trigger:hover { border-color: var(--ds-border-strong); background: var(--ds-surface); box-shadow: var(--ds-shadow-sm); }
.user-trigger[aria-expanded="true"] { border-color: var(--ds-brand-300); box-shadow: var(--ds-shadow-glow); }
.user-trigger .ti-chevron-down { transition: transform var(--ds-dur) var(--ds-ease); }
.user-trigger[aria-expanded="true"] .ti-chevron-down { transform: rotate(180deg); color: var(--ds-brand-600); }

.user-trigger-avatar { position: relative; flex: none; display: inline-grid; }
.user-trigger-avatar .avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 12px; }
.user-trigger-avatar.is-lg .avatar { width: 46px; height: 46px; font-size: 16px; }
.user-online {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ds-success);
    border: 2px solid var(--ds-surface);
}
.user-trigger-avatar.is-lg .user-online { width: 12px; height: 12px; }

.user-trigger-text { display: none; flex-direction: column; align-items: flex-start; line-height: 1.25; text-align: start; }
.user-trigger-text b { font-size: 12.5px; font-weight: 700; color: var(--ds-ink); white-space: nowrap; }
.user-trigger-text small { font-size: 11px; color: var(--ds-ink-mute); white-space: nowrap; }
@media (min-width: 1200px) {
    .user-trigger-text { display: flex; }
}

/* القوائم تنفتح بحركة لا بقفزة */
.topbar .dropdown-menu.show { animation: menu-in .18s var(--ds-ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

.user-menu { width: 290px; max-width: 92vw; padding: 0; overflow: hidden; border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-lg); }
.user-menu-head {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--ds-border);
    background: linear-gradient(180deg, var(--ds-surface-sunk), var(--ds-surface));
}
.user-menu-head .role-badge { margin-inline-start: 0; }
.user-menu-list { padding: 6px; }
.user-menu-list.is-foot { border-top: 1px solid var(--ds-border); }
.user-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ds-ink-soft);
}
.user-menu .dropdown-item:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
.user-menu-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-soft);
    font-size: 16px;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.user-menu .dropdown-item:hover .user-menu-icon { background: var(--ds-brand-50); color: var(--ds-brand-600); }
.user-menu-count {
    margin-inline-start: auto;
    min-width: 20px;
    padding: 0 6px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.user-menu-ext { margin-inline-start: auto; font-size: 14px; color: var(--ds-ink-mute); }
.user-menu .dropdown-item.is-danger { color: var(--ds-danger); }
.user-menu .dropdown-item.is-danger .user-menu-icon { background: var(--ds-danger-bg); color: var(--ds-danger); }
.user-menu .dropdown-item.is-danger:hover { background: var(--ds-danger-bg); }

@media (max-width: 575.98px) {
    .topbar-sep { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .topbar-bell.has-unread i, .topbar-bell.has-unread .topbar-badge::after, .topbar .dropdown-menu.show { animation: none; }
}

/* ==================== 16) Command Palette ==================== */
.cmdk-dialog { max-width: 560px; }
.cmdk-content {
    border-radius: var(--ds-radius-xl);
    overflow: hidden;
}
.cmdk-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ds-border);
}
.cmdk-search > i { color: var(--ds-brand-500); font-size: 18px; }
.cmdk-input {
    flex: 1;
    border: 0;
    outline: none !important;
    background: transparent;
    font-size: 15px;
    color: var(--ds-ink);
    font-family: inherit;
}
.cmdk-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
}
.cmdk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--ds-radius-md);
    color: var(--ds-ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.cmdk-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--ds-brand-50);
    color: var(--ds-brand-600);
    flex-shrink: 0;
    transition: all var(--ds-dur-fast) ease;
}
.cmdk-item-go { margin-inline-start: auto; opacity: 0; color: var(--ds-brand-500); transition: opacity var(--ds-dur-fast) ease; }
.cmdk-item.active, .cmdk-item:hover {
    background: var(--ds-brand-50);
    color: var(--ds-brand-700);
}
.cmdk-item.active .cmdk-item-icon {
    background: var(--ds-gradient-135);
    color: #fff;
}
.cmdk-item.active .cmdk-item-go { opacity: 1; }
.cmdk-no-results {
    padding: 28px;
    text-align: center;
    color: var(--ds-ink-mute);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.cmdk-no-results i { font-size: 24px; opacity: 0.5; }
.cmdk-foot {
    display: flex;
    gap: 16px;
    padding: 10px 18px;
    border-top: 1px solid var(--ds-border);
    background: rgba(238, 244, 255, 0.4);
    font-size: 12px;
    color: var(--ds-ink-mute);
}
.cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* وميض القسم عند الانتقال إليه من البحث */
.section-flash {
    animation: ds-flash 1.5s var(--ds-ease);
}
@keyframes ds-flash {
    0%, 60% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3), var(--ds-shadow-md); }
    100% { box-shadow: var(--ds-shadow-md); }
}

/* ==================== 17) الخط الزمني للمراحل ==================== */
.ds-timeline {
    position: relative;
    padding-inline-start: 8px;
}
.ds-timeline-item {
    position: relative;
    display: flex;
    gap: 14px;
    padding-inline-start: 8px;
    padding-bottom: 20px;
}
.ds-timeline-item:last-child { padding-bottom: 0; }
/* الخط الواصل */
.ds-timeline-item::before {
    content: "";
    position: absolute;
    top: 30px;
    bottom: -2px;
    inset-inline-start: 22px;
    width: 2px;
    background: var(--ds-border);
}
.ds-timeline-item:last-child::before { display: none; }
.ds-timeline-item.done::before { background: rgba(16, 185, 129, 0.35); }

.ds-timeline-dot {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 14px;
    background: var(--ds-brand-50);
    color: var(--ds-ink-mute);
    border: 2px solid var(--ds-border);
}
.ds-timeline-item.done .ds-timeline-dot {
    background: var(--ds-success-bg);
    color: var(--ds-success);
    border-color: rgba(16, 185, 129, 0.4);
}
.ds-timeline-item.overdue .ds-timeline-dot {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
    border-color: rgba(225, 29, 72, 0.35);
}
.ds-timeline-body { min-width: 0; padding-top: 3px; }

/* ==================== 18) منطقة السحب والإفلات ==================== */
/* ==================== 19) منتقي أعضاء الفريق ==================== */
/* شبكة لا عمود واحد: الصفّ كان يشغل ~١٥٠ بكسل في بطاقة عرضها ١٢٠٠،
   فتسعة أعشار كل سطر فراغ، ويُرى خمسة طلاب حيث يسع خمسة عشر. */
.picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 6px;
    align-content: start;
    /* المساحة انتقلت إلى الشرائح فوقها، وهي أنفع من صفّين إضافيين في
       قائمة تُبحَث لا تُمسَح */
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    padding: 6px;
    background: rgba(255, 255, 255, 0.6);
}
/* رسالة «لا نتائج» تمتدّ على الشبكة كلها لا على خليّة */
.picker-list > .empty { grid-column: 1 / -1; }

/* عدد المتاحين: من يرى «١٤٧» يعرف أن المسح بالعين ليس الطريق فيبحث */
.picker-count {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--ds-ink-mute);
}

/* شرائح المختارين: كنت تختار ثم تمرّر فتفقد أثر ما اخترت */
.picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
/* تُقرأ كاختيار قائم يمكن سحبه لا كزرّ فعل: حدّ خفيف ولون هادئ،
   والحرارة في زرّ الإزالة وحده عند قصده */
.picker-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 10px;
    border: 1px solid var(--ds-brand-100);
    border-radius: 999px;
    background: var(--ds-brand-50);
    font-size: 12px;
    color: var(--ds-ink-soft);
}
.picker-chip button {
    display: grid;
    place-items: center;
    width: 18px; height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ds-ink-mute);
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.picker-chip button:hover { background: var(--ds-danger-bg); color: var(--ds-danger); }
.picker-chip button i { font-size: 12px; }
/* الصفّ صار \u200E<button>\u200E لا \u200E<label>\u200E بمربّع اختيار: النتائج تأتي من
   الخادم، والاختيار يُحفظ في حقول مخفيّة مستقلّة — فلا مربّع يُربط به */
.picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--ds-radius-md);
    background: transparent;
    text-align: start;
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease;
}
.picker-item:hover { background: var(--ds-brand-50); }
.picker-item:focus-visible { outline: 2px solid var(--ds-brand-600); outline-offset: -2px; }
.picker-item.disabled { opacity: 0.45; cursor: not-allowed; }

.picker-avatar {
    width: 30px; height: 30px;
    flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    overflow: hidden;
    background: var(--ds-brand-50);
    border: 1px solid var(--ds-brand-100);
    font-family: var(--ds-font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--ds-brand-600);
}
.picker-avatar img { width: 100%; height: 100%; object-fit: cover; }

.picker-item-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}
.picker-item-meta > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.picker-item-check {
    margin-inline-start: auto;
    color: #047857;
    font-size: 18px;
    opacity: 0;
    transition: opacity var(--ds-dur-fast) ease;
}
.picker-item.is-picked {
    background: var(--ds-brand-50);
    box-shadow: inset 0 0 0 1px var(--ds-brand-200);
}
.picker-item.is-picked .picker-item-check { opacity: 1; }

/* صفّ البحث: الحقل يتمدّد وزرّ التصفّح بعرضه */
.picker-bar { display: flex; gap: 8px; align-items: stretch; }
.picker-bar .input-icon { flex: 1; min-width: 0; }
.picker-bar .btn { flex: none; white-space: nowrap; }

/* «عرض المزيد» بدل تمرير لا نهائي: التمرير يُخفي حجم ما بقي،
   والزرّ يقوله بالرقم.
   يمتدّ على الشبكة كلها فيُقرأ فاصلاً بين ما عُرض وما سيُعرض، لا
   بطاقةً سادسة في صفّ. */
.picker-more {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    margin-top: 6px;
    padding: 10px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ds-ink-soft);
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) ease,
                border-color var(--ds-dur-fast) ease,
                color var(--ds-dur-fast) ease;
}
.picker-more:hover {
    background: var(--ds-brand-50);
    border-color: var(--ds-brand-100);
    color: var(--ds-brand-600);
}
.picker-more:focus-visible { outline: 2px solid var(--ds-brand-600); outline-offset: 2px; }
.picker-more i { font-size: 15px; }
.picker-more:disabled { opacity: .55; cursor: default; background: var(--ds-surface-sunk); }
/* العدد المتبقّي أهدأ من الدعوة نفسها */
.picker-more small { font-weight: 400; color: var(--ds-ink-mute); }

@media (max-width: 575.98px) {
    .picker-bar { flex-direction: column; }
}

/* رسالة داخل القائمة: «اكتب للبحث» أو «لا نتائج» أو «جارٍ البحث» */
.picker-hint {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 28px 16px;
    font-size: 12.5px;
    color: var(--ds-ink-mute);
    text-align: center;
}
.picker-hint i { font-size: 16px; }
.picker-hint .ti-loader-2,
.picker-more .ti-loader-2 { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 19b) النقاش ====================
   كان قسماً في ذيل الصفحة يطول بالرسائل. صار تبويباً بصندوق ثابت
   الارتفاع: التمرير داخل المجرى وحده، والنموذج مثبّت أسفله، والصفحة
   لا تنزل مهما كثرت الرسائل. */
.chat-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    height: calc(100dvh - 230px);
    min-height: 440px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.chat-shell.is-single { grid-template-columns: minmax(0, 1fr); }

/* ---- القائمة ---- */
.chat-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-inline-end: 1px solid var(--ds-border);
    background: var(--ds-surface);
}
.chat-side-head { flex: none; padding: 14px 14px 10px; border-bottom: 1px solid var(--ds-border); }
.chat-side-title { display: flex; align-items: center; gap: 7px; }
.chat-side-title b { font-family: var(--ds-font-display); font-size: 15px; font-weight: 800; color: var(--ds-ink); }
.chat-side-title > span:not(.chat-side-unread) {
    padding: 0 7px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-ink-mute);
}
.chat-side-unread { margin-inline-start: auto; font-size: 11.5px; font-weight: 600; color: var(--ds-danger); }
.chat-search { position: relative; margin-top: 10px; }
.chat-search i {
    position: absolute;
    inset-inline-start: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--ds-ink-mute);
    pointer-events: none;
}
.chat-search input {
    width: 100%;
    height: 36px;
    padding-inline: 34px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--ds-surface-sunk);
    font: inherit;
    font-size: 13px;
    color: var(--ds-ink);
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.chat-search input:focus { outline: 0; border-color: var(--ds-brand-300); background: var(--ds-surface); box-shadow: var(--ds-shadow-glow); }

.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.chat-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border-radius: 12px;
    color: var(--ds-ink-soft);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
.chat-item + .chat-item { margin-top: 2px; }
.chat-item:hover { background: var(--ds-surface-sunk); color: var(--ds-ink-soft); }
.chat-item.is-active { background: var(--ds-brand-50); }
.chat-item.is-active::before {
    content: "";
    position: absolute;
    inset-inline-start: -6px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: var(--ds-brand-600);
}
.chat-item-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.chat-item-top,
.chat-item-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-item-top b {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ds-ink);
}
.chat-item-top time { flex: none; font-size: 11px; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.chat-item-snippet {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--ds-ink-mute);
}
.chat-item-snippet em { font-style: normal; font-weight: 600; color: var(--ds-ink-soft); }
.chat-item-flag { color: #b45309; font-weight: 600; }
/* غير المقروء: عنوان أثقل ووقت بلون الهوية — والشارة تكفي عدداً */
.chat-item.is-unread .chat-item-top b { font-weight: 800; }
.chat-item.is-unread .chat-item-snippet { color: var(--ds-ink); }
.chat-item.is-unread .chat-item-top time { color: var(--ds-brand-600); font-weight: 700; }
.chat-item .sidebar-count { margin-inline-start: 0; flex: none; background: var(--ds-brand-600); }
.chat-list-none { margin: 0; padding: 24px 12px; text-align: center; font-size: 12.5px; color: var(--ds-ink-mute); }

/* حرف المشروع: لون ثابت من رقمه، هادئ التشبّع */
.chat-mono {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: hsl(var(--h) 70% 95%);
    color: hsl(var(--h) 55% 32%);
    font-family: var(--ds-font-display);
    font-size: 16px;
    font-weight: 800;
}
.chat-mono.is-lg { width: 42px; height: 42px; }

/* ---- المحادثة ---- */
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ds-bg); }
.chat-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface);
    flex: none;
}
.chat-head-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chat-head-body b {
    font-family: var(--ds-font-display);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ds-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-head-body span {
    font-size: 12px;
    color: var(--ds-ink-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-head-team { flex: none; }
.chat-back { display: none; flex: none; }
.chat-head .btn, .chat-head .status-badge { flex: none; }

/* المجرى: خلفية نقطية خافتة تفصل مساحة الحديث عن إطارها */
.chat-stream {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 18px 18px;
    background-image: radial-gradient(rgba(9, 9, 11, .045) 1px, transparent 1px);
    background-size: 18px 18px;
}

.chat-day { display: flex; justify-content: center; margin: 14px 0 10px; }
.chat-day span {
    padding: 3px 11px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-ink-mute);
}
.chat-new {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ds-brand-600);
}
.chat-new::before,
.chat-new::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .35; }

/* الفقاعة */
.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.msg.is-cont { margin-top: 3px; }
.msg.is-mine { flex-direction: row-reverse; }
.msg-avatar.ctx-avatar, .msg-avatar-gap { flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: 11px; }
.msg-body { display: flex; flex-direction: column; max-width: min(72%, 560px); min-width: 0; }
.msg.is-mine .msg-body { align-items: flex-end; }
.msg-author { display: flex; align-items: center; gap: 6px; margin: 0 4px 3px; }
.msg-author b { font-size: 12px; font-weight: 700; color: var(--ds-ink-soft); }
.msg-role {
    padding: 0 6px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-brand-50);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ds-brand-700);
}
.msg-bubble {
    position: relative;
    padding: 8px 12px 6px;
    border: 1px solid var(--ds-border);
    border-radius: 16px;
    border-end-start-radius: 5px;
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-sm);
    animation: msg-in .25s var(--ds-ease) both;
}
/* رسائلي: تدرّج بلون الهوية بظلّ خفيف — كانت سوداء مصمتة ثقيلة على العين */
.msg.is-mine .msg-bubble {
    border-color: transparent;
    border-radius: 18px;
    border-end-end-radius: 6px;
    background: linear-gradient(135deg, var(--ds-brand-500) 0%, var(--ds-brand-600) 55%, var(--ds-brand-700) 100%);
    box-shadow: 0 1px 2px rgba(29, 78, 216, .25), 0 8px 18px -10px rgba(37, 99, 235, .6);
    color: #fff;
}
/* رسائل الآخرين: بيضاء بحدّ ناعم، والمشرف بلمسة من لون الهوية ليُعرف بلمحة */
.msg:not(.is-mine) .msg-bubble { border-radius: 18px; border-end-start-radius: 6px; }
.msg.is-supervisor:not(.is-mine) .msg-bubble { border-color: var(--ds-brand-100); background: linear-gradient(180deg, #fff, var(--ds-brand-50)); }
.msg.is-cont .msg-bubble { border-end-start-radius: 16px; }
.msg.is-mine.is-cont .msg-bubble { border-end-end-radius: 16px; }
.msg .cmt-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.75;
    white-space: pre-line;
    overflow-wrap: anywhere;
    color: var(--ds-ink);
}
.msg.is-mine .cmt-text { color: #fff; }
.msg-time {
    display: block;
    margin-top: 1px;
    font-size: 10.5px;
    text-align: end;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink-mute);
}
.msg.is-mine .msg-time { color: rgba(255, 255, 255, .72); }
.msg.is-cont:not(.is-mine) .msg-bubble { border-end-start-radius: 18px; }
.msg.is-mine.is-cont .msg-bubble { border-end-end-radius: 18px; }

/* ==================== نقاش الفريق ====================
   قناة خاصة بالأعضاء بجانب «مع المشرف»، و@ لتنبيه زميل بعينه. */
.chat-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    padding: 5px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface-sunk);
}
.chat-tab {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 12px;
    color: var(--ds-ink-soft);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.chat-tab:hover { background: rgba(255, 255, 255, .6); color: var(--ds-ink); }
.chat-tab.is-active { background: var(--ds-surface); box-shadow: var(--ds-shadow-md); color: var(--ds-ink); }
/* النصّ بصنفه: الأفاتار نفسه span، فكان محدِّدٌ عامّ يمدّه ليملأ التبويب */
.chat-tab-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-tab-avatar.ctx-avatar { flex: none; }
.chat-tab b { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 700; }
.chat-tab small { font-size: 11.5px; color: var(--ds-ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tab-avatar.ctx-avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; }
.chat-tab-stack .cell-avatar { width: 26px; height: 26px; }
.chat-tab-lock { font-size: 13px; color: var(--ds-ink-mute); }
.chat-tab .sidebar-count { flex: none; margin: 0; background: var(--ds-brand-600); }

.chat-team-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ds-accent);
    color: #fff;
    font-size: 19px;
}
.chat-private {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface-sunk);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ds-ink-mute);
}
.chat-private i { font-size: 14px; }

/* @الاسم داخل الفقاعة */
.mention {
    padding: 0 5px;
    border-radius: 6px;
    background: var(--ds-brand-50);
    font-weight: 700;
    color: var(--ds-brand-700);
}
.msg.is-mine .mention { background: rgba(255, 255, 255, .22); color: #fff; }
/* رسالة تذكرني */
.msg.is-mentioned .msg-bubble { border-color: var(--ds-brand-300); box-shadow: 0 0 0 3px var(--ds-brand-50), var(--ds-shadow-sm); }

/* قائمة @ فوق صندوق الكتابة */
.chat-compose { position: relative; }
.mention-menu {
    position: absolute;
    bottom: calc(100% - 4px);
    inset-inline-start: 14px;
    z-index: 5;
    width: 260px;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-lg);
    animation: menu-in .15s var(--ds-ease);
}
.mention-menu-head { padding: 4px 8px 6px; font-size: 11px; font-weight: 700; color: var(--ds-ink-mute); }
.mention-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-ink);
    text-align: start;
    cursor: pointer;
}
.mention-option .ctx-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 10.5px; }
.mention-option:hover, .mention-option.is-active { background: var(--ds-brand-50); color: var(--ds-brand-700); }

@media (max-width: 575.98px) {
    .chat-tab { padding: 8px; gap: 7px; }
    .chat-tab small { display: none; }
    .chat-tab-stack { display: none; }
    .mention-menu { inset-inline: 12px; width: auto; }
}

/* الحذف يظهر عند المرور — لا سلّة بجانب كل رسالة */
.msg-del { flex: none; align-self: center; opacity: 0; transition: opacity var(--ds-dur-fast) ease; }
.msg:hover .msg-del, .msg-del:focus-within { opacity: 1; }
@media (hover: none) { .msg-del { opacity: .6; } }

@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* لا رسائل / لا محادثة مختارة */
.chat-empty { margin: auto; padding: 40px 20px; }
.chat-pane > .chat-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.chat-start, .chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.chat-start { height: 100%; }
.chat-welcome { flex: 1; padding: 40px 24px; background-image: radial-gradient(rgba(9, 9, 11, .045) 1px, transparent 1px); background-size: 18px 18px; }
.chat-start-icon, .chat-welcome-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow-md);
    color: var(--ds-brand-600);
    font-size: 26px;
}
.chat-welcome-icon { width: 64px; height: 64px; border-radius: 18px; font-size: 30px; }
.chat-start h3, .chat-welcome h2 {
    margin: 0 0 6px;
    font-family: var(--ds-font-display);
    font-size: 16px;
    font-weight: 800;
    color: var(--ds-ink);
}
.chat-start p, .chat-welcome p { max-width: 360px; margin: 0 0 16px; font-size: 13px; line-height: 1.7; color: var(--ds-ink-mute); }

/* ---- الكتابة ---- */
.chat-compose.cmt-form {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px 10px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface);
}
.compose-box {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 5px 5px 5px 5px;
    padding-inline-start: 14px;
    border: 1px solid var(--ds-border);
    border-radius: 22px;
    background: var(--ds-surface-sunk);
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.compose-box:focus-within { border-color: var(--ds-brand-300); background: var(--ds-surface); box-shadow: var(--ds-shadow-glow); }
.compose-box textarea {
    flex: 1;
    min-width: 0;
    max-height: 160px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    resize: none;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ds-ink);
}
.compose-box textarea:focus { outline: 0; }
.compose-box textarea.is-invalid { color: var(--ds-danger); }
.compose-send {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--ds-border-strong);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) ease, transform var(--ds-dur-fast) ease;
}
/* أيقونة الإرسال تشير إلى جهة الكتابة في RTL */
.compose-send i { transform: scaleX(-1); }
.compose-send.is-ready { background: var(--ds-brand-600); }
.compose-send.is-ready:hover { background: var(--ds-brand-700); transform: scale(1.05); }
.compose-send .spinner-border { margin: 0 !important; }
.chat-hint { padding-inline: 14px; font-size: 11px; color: var(--ds-ink-mute); }
.chat-hint kbd {
    padding: 0 5px;
    border: 1px solid var(--ds-border);
    border-radius: 4px;
    background: var(--ds-surface-sunk);
    box-shadow: none;
    font-size: 10px;
    color: var(--ds-ink-soft);
}

@media (max-width: 781.98px) {
    .chat-shell { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 190px); }
    /* القائمة وحدها، أو المحادثة وحدها إن اختيرت */
    .chat-shell:not(.is-single) .chat-pane { display: none; }
    .chat-shell.has-open .chat-side { display: none; }
    .chat-shell.has-open .chat-pane { display: flex; }
    .chat-side { border-inline-end: 0; }
    .chat-back { display: inline-grid; }
    /* \u200E.chat-head\u200E في المحدِّد: \u200E.avatar-stack\u200E معرَّف بعد هذا القسم فيغلبه */
    .chat-hint, .chat-head .chat-head-team { display: none; }
    .chat-head-btn span { display: none; }
    .chat-head-btn i { margin: 0 !important; }
    .msg-body { max-width: 82%; }
    .chat-stream { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .msg-bubble { animation: none; }
}

/* ==================== 19c) مراحل قابلة للتعديل (المشرف) ====================
   \u200E.ms-row\u200E نفسه الذي يراه الطالب والأدمن، والدائرة زرّ تبديل. */
button.ms-check {
    padding: 0;
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) ease, border-color var(--ds-dur-fast) ease;
}
button.ms-check:hover { border-color: var(--ds-accent); }
.ms-row form { display: inline-flex; margin: 0; }
.ms-actions { display: flex; align-items: center; gap: 6px; flex: none; margin-inline-start: auto; }
.ms-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface-sunk);
}
.ms-add input[name="title"] { flex: 1 1 200px; }
.ms-add input[type="date"] { flex: 0 1 170px; }
.ms-add .btn { flex: none; }

/* ==================== 19d) صفحة إدارة المشروع (المشرف) ==================== */
.grade-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 16px 18px;
}
.grade-form .form-label { font-size: 12.5px; margin-bottom: 5px; }
.grade-form .form-label small { color: var(--ds-ink-mute); font-weight: 400; }
.grade-form-score { flex: 0 1 150px; }
.grade-form-note { flex: 1 1 260px; }
.grade-form .btn { flex: none; }
.grade-form .text-danger { flex: 1 1 100%; }

/* الموعد النهائي داخل بطاقة البيانات: يُعدَّل حيث يُقرأ */
.ctx-form { padding: 14px 18px; border-top: 1px solid var(--ds-border); }
.ctx-form .form-label { font-size: 12.5px; margin-bottom: 6px; color: var(--ds-ink-mute); }
.ctx-form-row { display: flex; gap: 8px; }
.ctx-form-row .form-control { flex: 1; min-width: 0; }
.ctx-form-row .btn { flex: none; }

/* ==================== 19e) المشاريع المنجزة + الأرشيف ==================== */
.explore-desc {
    margin: 0;
    padding: 0 18px 14px;
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--ds-ink-soft);
}

/* «مشاريع منجزة مشابهة» تحت عنوان المقترح: تنبيه هادئ لا خطأ */
.similar-hint { background: var(--ds-surface-sunk); }
.similar-hint ul { margin: 4px 0 0; padding-inline-start: 18px; }
.similar-hint li + li { margin-top: 2px; }
.similar-hint a { color: var(--ds-ink); font-weight: 600; }

.start-panel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-brand-600);
    text-decoration: none;
}
.start-panel-link:hover { text-decoration: underline; }

.archive-row { color: inherit; text-decoration: none; transition: background-color var(--ds-dur-fast) ease; }
.archive-row:hover { background: var(--ds-surface-sunk); color: inherit; }
.archive-row .grade-pill { flex: none; }
.archive-nograde { flex: none; font-size: 12px; color: var(--ds-ink-mute); }
.archive-go { flex: none; font-size: 16px; color: var(--ds-ink-mute); }
.archive-row:hover .archive-go { color: var(--ds-ink); }

/* ==================== 19f) طلبات الإشراف ====================
   كانت سطراً مطويّاً في أكورديون تحت جدولَي إشعارات. صارت بطاقة
   مفتوحة: ما يُقرَّر به (الفكرة والفريق) وزرّا القرار ظاهرين دائماً. */
.req-list { display: grid; gap: 14px; }
.req-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.req-section-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: var(--ds-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-ink);
}
.req-section-head .sidebar-count { margin-inline-start: 0; }

.req-card {
    border: 1px solid var(--ds-border);
    border-inline-start: 3px solid var(--ds-warning);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.req-head { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px 10px; }
.req-title { flex: 1; min-width: 0; }
.req-title b {
    display: block;
    font-family: var(--ds-font-display);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ds-ink);
}
.req-title span { display: block; margin-top: 2px; font-size: 12px; color: var(--ds-ink-mute); }
.req-waiting {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-soft);
    font-size: 11.5px;
    font-weight: 600;
}
/* انتظار طال: التنبيه للطلب الذي يستحقّه لا لكل طلب */
.req-waiting.is-long { background: var(--ds-warning-bg); color: #b45309; }
.req-desc {
    margin: 0;
    padding: 0 18px 12px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--ds-ink-soft);
    white-space: pre-line;
}

.req-team {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 0;
    padding: 0 18px 14px;
    list-style: none;
}
.req-team li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ds-ink); }
.req-team .ctx-avatar { width: 28px; height: 28px; font-size: 11px; }
.req-team small { display: block; font-size: 11px; color: var(--ds-ink-mute); }

.req-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface-sunk);
}
.req-actions form { margin: 0; }
.req-full {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 0;
    font-size: 12.5px;
    color: var(--ds-ink-mute);
}

/* الرفض يُفتح ليُكتب سببه — والملخّص زرّ لا مثلّث details */
.req-reject { flex: 1 1 260px; }
.req-reject > summary { list-style: none; display: inline-flex; align-items: center; }
.req-reject > summary::-webkit-details-marker { display: none; }
.req-reject[open] > summary { margin-bottom: 10px; }
.req-reject-form { display: grid; gap: 8px; }
.req-reject-form .form-label { margin: 0; font-size: 12.5px; }
.req-reject-form .form-label small { color: var(--ds-ink-mute); font-weight: 400; }
.req-reject-form .btn { justify-self: start; }

/* ==================== 19g) بطاقات المشروع ====================
   كان العمود الجانبي ١٢٧٠ بكسل والمتن ٧٤٠: بطاقات تعيد ما قيل أعلى
   الصفحة، وصفوف فريق بأرقام جامعية، وحالات فارغة أكبر مما تنوب عنه. */

/* شريط بثلاث خانات — والثالثة سطر كامل على الجوال لا خانة يتيمة */
.stat-strip.is-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) {
    .stat-strip.is-3 { grid-template-columns: repeat(2, 1fr); }
    .stat-strip.is-3 > :last-child { grid-column: 1 / -1; }
}
/* قيمة نصّية (عنوان مرحلة) لا رقم: لا تُعرض بحجم ٢٧ */
.stat-value.is-text {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* العدد بجانب العنوان لا في الطرف الآخر من البطاقة */
.ctx-count {
    font-family: var(--ds-font-display);
    font-weight: 500;
    font-size: 12.5px;
    color: var(--ds-ink-mute);
    font-variant-numeric: tabular-nums;
}
.ctx-tag.is-neutral { background: var(--ds-surface-sunk); color: var(--ds-ink-soft); }
.ctx-card.is-team .ctx-person { padding: 9px 18px; }
.ctx-card.is-team .ctx-avatar { width: 30px; height: 30px; font-size: 11.5px; }

/* الوصف يُطوى بعد أربعة أسطر */
.clamp { border-top: 1px solid var(--ds-border); }
.clamp .proj-desc { border-top: 0; }
.clamp:not(.is-open) .clamp-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.clamp-toggle {
    display: block;
    margin: -6px 18px 12px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ds-brand-600);
    cursor: pointer;
}
.clamp-toggle[hidden] { display: none; }

/* حالة فارغة داخل قسم: سطر بأيقونة صغيرة، لا لوح بارتفاع ٢٠٠ بكسل */
.empty.is-inline {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
    padding: 16px 18px;
    text-align: start;
}
.empty.is-inline .empty-icon { grid-row: span 2; margin: 0; }
.empty.is-inline .empty-icon i { font-size: 22px !important; }
.empty.is-inline .empty-title { margin: 0 !important; font-size: 13.5px; font-weight: 600; }
.empty.is-inline .empty-subtitle { margin: 2px 0 0; font-size: 12.5px; }
.empty.is-inline .empty-action { grid-column: 1 / -1; margin-top: 12px !important; }

/* ==================== 19h) تقرير الاستيراد ==================== */
.import-report { border-inline-start: 3px solid var(--ds-warning); }
.import-report-hint { margin: 0; padding: 12px 18px 4px; font-size: 12.5px; line-height: 1.8; color: var(--ds-ink-mute); }
.import-report-list {
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 6px 18px 14px;
    list-style: none;
    font-size: 13px;
}
.import-report-list li { padding: 5px 0; }
.import-report-list li + li { border-top: 1px solid var(--ds-border); }
.import-report-list b { display: inline-block; min-width: 64px; margin-inline-end: 8px; color: var(--ds-ink); }

/* ==================== 19i) صفحات الخطأ ==================== */
.error-code {
    margin: 0 0 4px;
    font-family: var(--ds-font-display);
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    color: var(--ds-border-strong);
    font-variant-numeric: tabular-nums;
}

.withdraw-note { margin: 0 0 10px; font-size: 12.5px; line-height: 1.8; color: var(--ds-ink-mute); }

/* ==================== 19j) بطاقات المشروع: رؤوس وملفات ====================
   رؤوس المتن بأيقونة كرؤوس الجانب — كانا نظامين في صفحة واحدة. وبطاقة
   الملفات: فارغةً هي منطقة الإفلات نفسها، وفيها ملفات شارة لكل نوع. */
.dist-head-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.dist-head-title > i { font-size: 17px; color: var(--ds-ink-mute); }

/* ---- منطقة الإفلات ---- */
.file-upload { padding: 16px 18px; border-bottom: 1px solid var(--ds-border); }
.file-list:empty { display: none; }
.files-card .file-upload:last-child { border-bottom: 0; }

.file-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 168px;
    padding: 22px 18px;
    border: 1.5px dashed var(--ds-border-strong);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface-sunk);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.file-drop:hover { border-color: var(--ds-brand-400); background: var(--ds-brand-50); }
.file-drop:focus-within { border-color: var(--ds-brand-500); box-shadow: 0 0 0 3px var(--ds-brand-100); }
/* مخفي بصرياً لكن قابل للتركيز — رسائل التحقّق للمتصفّح تحتاجه */
.file-drop-input { position: absolute; inset-inline-start: 50%; bottom: 10px; width: 1px; height: 1px; opacity: 0; }

.file-drop-idle { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.file-drop-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    color: var(--ds-brand-600);
    font-size: 22px;
    transition: transform var(--ds-dur) var(--ds-ease);
}
.file-drop:hover .file-drop-icon { transform: translateY(-2px); }
.file-drop-idle > b { font-size: 14px; font-weight: 600; color: var(--ds-ink); }
.file-drop-idle > b u { color: var(--ds-brand-600); text-underline-offset: 3px; }
.file-drop-idle > small { font-size: 12px; color: var(--ds-ink-mute); }

.file-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.file-chip {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.7;
}

/* الملف المختار: بطاقة صغيرة داخل المنطقة */
.file-drop.has-file { min-height: 0; padding: 14px 16px; border-style: solid; background: var(--ds-surface); }
.file-drop-picked { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; }
.file-drop-picked-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-drop-picked-body b { font-size: 13.5px; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop-picked-body small { font-size: 11.5px; color: var(--ds-ink-mute); }
.file-drop-change { flex: none; font-size: 12.5px; font-weight: 600; color: var(--ds-brand-600); }

.file-upload-row { display: flex; gap: 8px; margin-top: 12px; }
.file-upload-row .form-control { flex: 1; min-width: 0; }
.file-upload-row .btn { flex: none; }

/* البطاقة كلّها تستقبل السحب */
.files-card { transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease; }
.files-card.is-drag-over { border-color: var(--ds-brand-500); box-shadow: 0 0 0 3px var(--ds-brand-100); }
.files-card.is-drag-over .file-drop { border-color: var(--ds-brand-500); background: var(--ds-brand-50); }

/* ---- شارة النوع: لون لكل عائلة، نصّ داكن على خلفية فاتحة ---- */
.file-type {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-family: var(--ds-font-display);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .02em;
}
:is(.file-type, .file-chip).is-pdf { background: #fff1f2; color: #be123c; }
:is(.file-type, .file-chip).is-doc { background: #eff6ff; color: #1d4ed8; }
:is(.file-type, .file-chip).is-ppt { background: #fff7ed; color: #c2410c; }
:is(.file-type, .file-chip).is-xls { background: #ecfdf5; color: #047857; }
:is(.file-type, .file-chip).is-img { background: #ecfeff; color: #0e7490; }
:is(.file-type, .file-chip):is(.is-zip, .is-other) { background: var(--ds-surface-sunk); color: var(--ds-ink-soft); }

/* ---- صفوف الملفات ---- */
.files-card .file-row { gap: 12px; padding: 12px 18px; transition: background-color var(--ds-dur-fast) ease; }
.files-card .file-row:hover { background: var(--ds-surface-sunk); }
.files-card .file-name { font-size: 13.5px; font-weight: 600; }
.files-card .file-meta { margin-top: 3px; }

/* أفعال نادرة (الحذف، الاتصال) عند المرور على الحاسوب، ودائماً على اللمس —
   كانت عموداً ثابتاً من الأيقونات في كل صفّ ينافس الأسماء */
@media (hover: hover) {
    .files-card .file-row .is-reveal,
    .ctx-card.is-team .ctx-person-actions { opacity: 0; transition: opacity var(--ds-dur-fast) ease; }
    .files-card .file-row:hover .is-reveal,
    .files-card .file-row:focus-within .is-reveal,
    .ctx-card.is-team .ctx-person:hover .ctx-person-actions,
    .ctx-card.is-team .ctx-person:focus-within .ctx-person-actions { opacity: 1; }
}

@media (max-width: 575.98px) {
    .file-drop { min-height: 150px; padding: 18px 14px; }
    .file-upload-row { flex-wrap: wrap; }
    .file-upload-row .btn { flex: 1 1 100%; }
}

/* ==================== 19k) خطة المراحل ====================
   مسار عمودي: كل مرحلة عقدة على خطّ وبطاقة بجانبها. العقدة تقول حال المرحلة
   عبر المجموعات (منجزة كلّها / فيها متأخّر)، والحبّات تقول حالها في كل مجموعة. */

/* ---- بطاقة الإضافة ---- */
.stage-compose {
    margin-bottom: 22px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.stage-intro {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 22px 22px 6px;
}
.stage-intro-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-600);
    font-size: 24px;
}
.stage-intro h2 { margin: 2px 0 6px; font-family: var(--ds-font-display); font-size: 17px; font-weight: 800; color: var(--ds-ink); }
.stage-intro p { margin: 0; max-width: 64ch; font-size: 13.5px; line-height: 1.9; color: var(--ds-ink-mute); }

.stage-form { padding: 18px 22px 20px; }
.stage-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 14px 16px;
}
.stage-field .form-label { font-size: 12.5px; font-weight: 600; color: var(--ds-ink-soft); margin-bottom: 6px; }
.stage-field .form-label small { font-weight: 400; color: var(--ds-ink-mute); }
.stage-field.is-wide { grid-column: 1 / -1; }
.stage-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; }

.stage-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stage-suggest-chip {
    padding: 3px 11px;
    border: 1px solid var(--ds-border);
    border-radius: 999px;
    background: var(--ds-surface);
    font-family: inherit;
    font-size: 12px;
    color: var(--ds-ink-soft);
    cursor: pointer;
    transition: border-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.stage-suggest-chip:hover { border-color: var(--ds-brand-300); color: var(--ds-brand-700); background: var(--ds-brand-50); }

/* منطقة إفلات مصغّرة للقالب */
.file-drop.is-compact { min-height: 0; padding: 14px 16px; }
.file-drop.is-compact .file-drop-idle { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
.file-drop.is-compact .file-drop-icon { width: 34px; height: 34px; font-size: 17px; }
.file-drop.is-compact.is-over { border-color: var(--ds-brand-500); background: var(--ds-brand-50); }

/* ---- المسار ---- */
.stage-line { position: relative; margin: 0; padding: 0; list-style: none; }
/* الخطّ يمرّ بمراكز العقد: عرض العقدة ٣٦ ⇒ مركزها ١٨ */
.stage-line::before {
    content: "";
    position: absolute;
    inset-inline-start: 17px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: var(--ds-border);
}
.stage-item { position: relative; display: flex; gap: 16px; padding-bottom: 16px; }
.stage-item:last-child { padding-bottom: 0; }

.stage-node {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    margin-top: 14px;
    border: 2px solid var(--ds-border-strong);
    border-radius: 50%;
    background: var(--ds-surface);
    font-family: var(--ds-font-display);
    font-size: 14px;
    font-weight: 800;
    color: var(--ds-ink-soft);
    box-shadow: 0 0 0 4px var(--ds-bg);
}
.stage-item.is-done .stage-node { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; font-size: 17px; }
.stage-item.is-late .stage-node { border-color: var(--ds-danger); color: var(--ds-danger); background: var(--ds-danger-bg); }

.stage-card {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease;
}
.stage-card:hover { border-color: var(--ds-border-strong); box-shadow: var(--ds-shadow-sm); }
.stage-card.is-editing { border-color: var(--ds-brand-300); box-shadow: 0 0 0 3px var(--ds-brand-50); }
.stage-item.is-late .stage-card { border-inline-start: 3px solid var(--ds-danger); }

.stage-view { padding: 16px 18px; }
.stage-head { display: flex; align-items: flex-start; gap: 12px; }
.stage-title { flex: 1; min-width: 0; }
.stage-title h3 {
    margin: 0 0 6px;
    font-family: var(--ds-font-display);
    font-size: 15.5px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--ds-ink);
}
.stage-due {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--ds-surface-sunk);
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-ink-soft);
}
.stage-due span { font-weight: 400; color: var(--ds-ink-mute); }
.stage-due.is-soon { background: var(--ds-warning-bg); color: #b45309; }
.stage-due.is-past { background: var(--ds-danger-bg); color: var(--ds-danger); }
.stage-due.is-past span, .stage-due.is-soon span { color: inherit; opacity: .8; }
.stage-due.is-none { font-weight: 400; color: var(--ds-ink-mute); }

.stage-tools { display: flex; gap: 6px; flex: none; }
.stage-tools form { margin: 0; }
@media (hover: hover) {
    .stage-tools { opacity: 0; transition: opacity var(--ds-dur-fast) ease; }
    .stage-card:hover .stage-tools, .stage-card:focus-within .stage-tools { opacity: 1; }
}

.stage-instructions {
    margin: 12px 0 0;
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--ds-ink-soft);
    white-space: pre-line;
}

/* رقاقة القالب — قابلة للنقر كلّها */
.stage-template {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 440px;
    margin-top: 14px;
    padding: 9px 12px;
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    background: var(--ds-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.stage-template:hover { border-color: var(--ds-brand-300); background: var(--ds-brand-50); color: inherit; }
.stage-template .file-type { width: 36px; height: 36px; font-size: 10px; }
.stage-template-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.stage-template-body b { font-size: 13px; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-template-body small { font-size: 11.5px; color: var(--ds-ink-mute); }
.stage-template > i { flex: none; font-size: 18px; color: var(--ds-brand-600); }

/* حال المرحلة في كل مجموعة */
.stage-groups { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--ds-border); }
.stage-groups-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; font-size: 12.5px; color: var(--ds-ink-mute); }
.stage-groups-head b { color: var(--ds-ink); font-family: var(--ds-font-display); }
.stage-bar { flex: 1; height: 5px; border-radius: 999px; background: var(--ds-surface-sunk); overflow: hidden; }
.stage-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ds-success); transition: width var(--ds-dur-slow) var(--ds-ease); }

.stage-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 10px 4px 12px;
    border: 1px solid var(--ds-border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--ds-ink-soft);
    text-decoration: none;
    transition: border-color var(--ds-dur-fast) ease, transform var(--ds-dur-fast) ease;
}
.stage-pill:hover { transform: translateY(-1px); border-color: var(--ds-border-strong); color: var(--ds-ink); }
.stage-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-pill i { flex: none; font-size: 13px; }
.stage-pill.is-done { background: var(--ds-success-bg); border-color: #a7f3d0; color: #047857; }
.stage-pill.is-late { background: var(--ds-danger-bg); border-color: #fecdd3; color: var(--ds-danger); }
.stage-pill.is-open { background: var(--ds-surface); }
.stage-pill.is-missing { background: var(--ds-surface-sunk); border-style: dashed; color: var(--ds-ink-mute); }
/* تسليم ينتظر المشرف — لون الهوية: عمل عليه هو، لا إنذار على الفريق */
.stage-pill.is-submitted { background: var(--ds-brand-50); border-color: var(--ds-brand-200); color: var(--ds-brand-700); }
.stage-pill.is-revision { background: var(--ds-warning-bg); border-color: #fde68a; color: #b45309; }
.stage-review-note { color: var(--ds-brand-700); font-weight: 600; }

.stage-edit-note {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ds-ink-mute);
}

@media (max-width: 575.98px) {
    .stage-form, .stage-intro { padding-inline: 16px; }
    .stage-form-grid { grid-template-columns: minmax(0, 1fr); }
    .stage-intro { flex-direction: column; gap: 10px; }
    .stage-line::before { inset-inline-start: 13px; }
    .stage-item { gap: 10px; }
    .stage-node { width: 28px; height: 28px; font-size: 12px; margin-top: 16px; }
    .stage-view { padding: 14px; }
    .stage-tools { opacity: 1; }
}

/* مرحلة من الخطة داخل صفّ المراحل */
.ms-plan-tag {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-700);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.8;
    text-decoration: none;
    vertical-align: middle;
}
.ms-instructions {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--ds-ink-soft);
    white-space: pre-line;
}
.ms-template {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    margin-top: 8px;
    padding: 6px 12px 6px 8px;
    border: 1px solid var(--ds-border);
    border-radius: 10px;
    background: var(--ds-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.ms-template:hover { border-color: var(--ds-brand-300); background: var(--ds-brand-50); color: inherit; }
.ms-template .file-type { width: 30px; height: 30px; font-size: 9.5px; border-radius: 8px; }
.ms-template > span:not(.file-type) { display: flex; flex-direction: column; min-width: 0; }
.ms-template b { font-size: 12.5px; color: var(--ds-ink); }
.ms-template small { font-size: 11px; color: var(--ds-ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.ms-template > i { font-size: 16px; color: var(--ds-brand-600); }

/* ==================== لوحة المشرف ====================
   كانت شريط أرقام أغلبه أصفار وبطاقة تمتدّ بعرض الصفحة لسطرين.
   صارت: مؤشرات تقود إلى فعل، ومجموعات في عمود، وبجانبها القادم وآخر النشاط. */
.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}
.dash-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.dash-side .ctx-card + .ctx-card { margin-top: 0; }
@media (max-width: 1199.98px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 991.98px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-side { position: static; }
}

.dash-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.dash-section-head h2 {
    margin: 0;
    font-family: var(--ds-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-ink);
}
.dash-section-meta { font-size: 12px; color: var(--ds-ink-mute); }

/* الشبكة داخل العمود: بطاقة وحيدة لا تمتدّ بعرض الصفحة */
.dash-main .group-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ---- المؤشرات ---- */
.stat-value small { font-size: 14px; font-weight: 600; color: var(--ds-ink-mute); }
.stat-value.is-muted { color: var(--ds-border-strong); }
.stat-value.is-brand { color: var(--ds-brand-600); }
.kpi-bar { display: block; margin: 4px 0 0; }
.kpi-cap { flex-direction: row; align-items: center; gap: 14px; }
.kpi-cap-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

/* حلقة تقدّم: \u200E--p\u200E من ١٠٠، و\u200EpathLength\u200E يجعل الإزاحة نسبة مباشرة */
.kpi-ring, .pct-ring { position: relative; flex: none; display: inline-grid; place-items: center; }
.kpi-ring { width: 52px; height: 52px; }
.pct-ring { width: 46px; height: 46px; }
.kpi-ring svg, .pct-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.kpi-ring circle, .pct-ring circle { fill: none; stroke-width: 4; }
.kpi-ring circle:first-child, .pct-ring circle:first-child { stroke: var(--ds-surface-sunk); }
.kpi-ring circle + circle, .pct-ring circle + circle {
    stroke: var(--ds-brand-600);
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--p));
    transition: stroke-dashoffset var(--ds-dur-slow) var(--ds-ease);
}
/* حلقة بلا تقدّم: لا نقطة زرقاء عند الصفر */
.pct-ring.is-empty circle + circle { stroke: transparent; }
.pct-ring b {
    position: relative;
    font-family: var(--ds-font-display);
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.pct-ring.is-empty b { color: var(--ds-ink-mute); }
.group-card.is-late .pct-ring circle + circle { stroke: var(--ds-danger); }

/* ---- بطاقة المجموعة ---- */
.group-card-team { display: flex; align-items: center; gap: 10px; padding: 0 18px 12px; }
.avatar-stack { display: inline-flex; flex: none; }
.avatar-stack .cell-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--ds-surface);
    font-size: 10.5px;
    box-shadow: 0 0 0 1px var(--ds-border);
}
.avatar-stack .cell-avatar + .cell-avatar { margin-inline-start: -8px; }
.avatar-stack .avatar-more { background: var(--ds-accent); color: #fff; box-shadow: none; }
.group-card-team-text { display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ds-ink-soft); }
.group-card-team-text small {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--ds-ink-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-card-stage {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 18px 12px;
    padding: 9px 12px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-surface-sunk);
    font-size: 12.5px;
}
.group-card-stage > i { flex: none; font-size: 15px; color: var(--ds-brand-600); }
.group-card-stage-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--ds-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-card-stage-title.is-muted { font-weight: 400; color: var(--ds-ink-mute); }
.group-card-stage-due { flex: none; font-size: 11.5px; color: var(--ds-ink-mute); }
.group-card-stage-due.is-link { color: var(--ds-brand-600); font-weight: 600; text-decoration: none; }
.group-card-stage-due.is-link:hover { text-decoration: underline; }
.group-card-stage.is-late { background: var(--ds-danger-bg); }
.group-card-stage.is-review { background: var(--ds-brand-50); }
.group-card-stage.is-revision { background: var(--ds-warning-bg); }
.group-card-stage.is-revision > i,
.group-card-stage.is-revision .group-card-stage-due { color: #b45309; font-weight: 600; }
.group-card-stage.is-late > i,
.group-card-stage.is-late .group-card-stage-due { color: var(--ds-danger); font-weight: 600; }

.group-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface-sunk);
}
.group-card-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ds-ink-soft);
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.group-card-actions a + a { border-inline-start: 1px solid var(--ds-border); }
.group-card-actions a:hover { background: var(--ds-surface); color: var(--ds-brand-600); }
.group-card-actions i { font-size: 15px; }
/* العدّاد بجانب الكلمة لا في طرف الخلية — \u200Esidebar-count\u200E يدفع نفسه للطرف */
.group-card-actions .sidebar-count { margin-inline-start: 2px; }

/* ---- اللوحان الجانبيان ---- */
.dash-panel { overflow: hidden; }
.dash-panel-hint {
    padding: 1px 8px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    font-size: 11px;
    font-weight: 500;
    color: var(--ds-ink-mute);
}
.dash-panel-empty { margin: 0; padding: 18px; font-size: 13px; color: var(--ds-ink-mute); }

.plan-invite { padding: 20px 18px; text-align: center; }
.plan-invite-icon {
    display: inline-grid;
    place-items: center;
    width: 44px; height: 44px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-600);
    font-size: 22px;
}
.plan-invite h3 { margin: 0 0 4px; font-family: var(--ds-font-display); font-size: 14px; font-weight: 700; color: var(--ds-ink); }
.plan-invite p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.7; color: var(--ds-ink-mute); }

.upcoming-list, .activity-feed { list-style: none; margin: 0; padding: 6px 0; }
.upcoming-item, .activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 18px;
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
.upcoming-item:hover, .activity-item:hover { background: var(--ds-surface-sunk); }

.upcoming-date {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 44px;
    padding: 5px 0;
    border: 1px solid var(--ds-border);
    border-radius: 10px;
    background: var(--ds-surface);
    line-height: 1.1;
}
.upcoming-date b { font-family: var(--ds-font-display); font-size: 17px; font-weight: 800; color: var(--ds-ink); }
.upcoming-date small { font-size: 10.5px; color: var(--ds-ink-mute); }
.upcoming-date.is-soon { border-color: #fcd34d; background: var(--ds-warning-bg); }
.upcoming-date.is-soon b { color: #b45309; }
.upcoming-body, .activity-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.upcoming-title { font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--ds-ink); }
.upcoming-meta, .activity-meta { font-size: 11.5px; color: var(--ds-ink-mute); }
.upcoming-bar { display: block; margin: 3px 0 0; height: 4px; }

.activity-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-soft);
    font-size: 14px;
}
.activity-text {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ds-ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.activity-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- البداية ---- */
.dash-start { padding: 22px 24px; }
.dash-start h3 { margin: 0 0 14px; font-family: var(--ds-font-display); font-size: 15px; font-weight: 700; color: var(--ds-ink); }
.dash-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.dash-steps li { display: flex; gap: 12px; align-items: flex-start; }
.dash-step-n {
    flex: none;
    display: grid;
    place-items: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--ds-accent);
    color: #fff;
    font-family: var(--ds-font-display);
    font-size: 13px;
    font-weight: 800;
}
.dash-steps a, .dash-steps li > div > span { font-size: 13.5px; font-weight: 700; color: var(--ds-ink); text-decoration: none; }
.dash-steps a:hover { color: var(--ds-brand-600); }
.dash-steps p { margin: 2px 0 0; font-size: 12.5px; color: var(--ds-ink-mute); }

@media (max-width: 520px) {
    .kpi-ring { width: 42px; height: 42px; }
    .kpi-cap { gap: 10px; }
    .dash-main .group-grid { grid-template-columns: 1fr; }
}

/* ==================== لوحة الطالب ====================
   كانت ترويسة تحيّة، وشريط أرقام قيمه «—»، ولوح مسار بعرض الصفحة،
   والعنوان والمشرف في العمود الجانبي. صارت بطاقة مشروع واحدة، ثم
   «المرحلة الحالية» بما على الفريق فيها. */
.stu-hero {
    position: relative;
    padding: 22px 24px 18px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-xl);
    background:
        radial-gradient(600px 220px at 0% 0%, var(--ds-brand-50), transparent 70%),
        var(--ds-surface);
    overflow: hidden;
    animation: hero-in .45s var(--ds-ease) both;
}
@keyframes hero-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stu-hero-top { display: flex; align-items: flex-start; gap: 20px; }
.stu-hero-main { flex: 1; min-width: 0; }
.stu-hero-hello { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ds-ink-mute); }
.stu-hero-hello > span { font-weight: 400; }
.stu-hero-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.stu-hero-title h1 {
    margin: 0;
    font-family: var(--ds-font-display);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--ds-ink);
    overflow-wrap: anywhere;
}
.stu-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }
.hero-meta-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ds-ink-soft); text-decoration: none; }
.hero-meta-item > i { font-size: 16px; color: var(--ds-ink-mute); }
.hero-meta-avatar.ctx-avatar { width: 26px; height: 26px; border-radius: 50%; font-size: 10.5px; }
a.hero-team:hover { color: var(--ds-brand-600); }

.stu-hero-progress { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 110px; }
.stu-hero-progress small { font-size: 11.5px; color: var(--ds-ink-mute); text-align: center; }
.pct-ring.is-xl { width: 84px; height: 84px; }
.pct-ring.is-xl circle { stroke-width: 3.2; }
.pct-ring.is-xl b { font-size: 18px; }
.pct-ring.is-xl circle + circle { animation: ring-fill 1s .2s var(--ds-ease) both; }
@keyframes ring-fill { from { stroke-dashoffset: 100; } }
.hero-progress-empty {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 2px dashed var(--ds-border-strong);
    color: var(--ds-ink-mute);
    font-size: 28px;
}

/* المسار المضغوط */
.hero-rail { list-style: none; display: flex; margin: 20px 0 0; padding: 0; }
.hero-rail li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.hero-rail li + li::before {
    content: "";
    position: absolute;
    top: 10px;
    inset-inline-end: 50%;
    width: 100%;
    height: 2px;
    background: var(--ds-border);
}
.hero-rail li.is-done + li::before,
.hero-rail li.is-done::before { background: var(--ds-accent); }
.hero-rail-node {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--ds-border-strong);
    background: var(--ds-surface);
    font-size: 12px;
    color: #fff;
}
.hero-rail li.is-done .hero-rail-node { border-color: var(--ds-accent); background: var(--ds-accent); }
.hero-rail li.is-current .hero-rail-node { border-color: var(--ds-brand-600); box-shadow: 0 0 0 4px var(--ds-brand-100); }
.hero-rail li.is-current .hero-rail-node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ds-brand-600); }
.hero-rail-label { font-size: 12px; color: var(--ds-ink-mute); }
.hero-rail li.is-current .hero-rail-label { font-weight: 700; color: var(--ds-ink); }

/* ---- «رحلة المشروع» على مسار البطاقة ----
   الشخصيات نفسها من الصفحة الرئيسية (partials/cast.blade.php، مضمَّنة مرة في
   القالب). كل عنصر في عمود خطوته: (i + ½) ÷ n من العرض، وقدماه على الخط. */
.hero-journey { position: relative; }
.hero-journey:has(.rail-cast) .hero-rail { margin-top: 0; padding-top: 52px; }
.rail-cast { position: absolute; inset: 0 0 auto; height: 54px; pointer-events: none; }
.rail-actor, .rail-team {
    position: absolute;
    bottom: 0;
    inset-inline-start: calc((var(--i) + .5) / var(--n) * 100%);
}
.rail-actor.is-supervisor { width: 28px; height: 48px; margin-inline-start: 18px; }
.rail-actor.is-committee  { width: 46px; height: 39px; margin-inline-start: 16px; }
.rail-actor.is-cap        { width: 28px; height: 20px; bottom: 16px; margin-inline-start: -14px; animation: rail-float 2.6s ease-in-out infinite alternate; }
.rail-actor, .rail-member { overflow: visible; }
/* الفريق متلاصق ومتمركز على خطوته؛ ينتقل بين الخطوات بالمشي */
.rail-team {
    display: flex;
    width: 66px;
    margin-inline-start: -33px;
    transition: inset-inline-start 2.2s cubic-bezier(.45, .05, .35, 1);
}
.rail-team.is-meeting { margin-inline-start: -64px; }
.rail-member { flex: none; width: 28px; height: 50px; }
.rail-member + .rail-member { margin-inline-start: -9px; }
/* الوجوه: الفريق نحو الخطوة التالية، والمشرف واللجنة نحو الفريق القادم */
[dir="rtl"] .rail-member > use,
[dir="ltr"] .rail-actor > use { transform: scaleX(-1); }
[dir="rtl"] .rail-member .rail-member-cap { transform: scaleX(-1); }

.rail-actor.is-supervisor .hj-wave,
.rail-cast .hj-wave { transform-box: fill-box; transform-origin: 50% 0; }
.cast-defs .hj-wave { transform-box: fill-box; transform-origin: 50% 0; animation: cast-wave 2.6s ease-in-out infinite; }
.cast-defs .hj-leg, .cast-defs .hj-arm { transform-box: fill-box; transform-origin: 50% 8%; }
.cast-defs.is-walking .hj-leg.is-a { animation: cast-step .4s ease-in-out infinite alternate; }
.cast-defs.is-walking .hj-leg.is-b { animation: cast-step .4s ease-in-out infinite alternate-reverse; }
.cast-defs.is-walking .hj-arm { animation: cast-step .4s ease-in-out infinite alternate-reverse; }
.rail-team.is-walking .rail-member { animation: cast-bob .4s ease-in-out infinite alternate; }
.rail-team.is-walking .rail-member:nth-child(2) { animation-delay: -.13s; }
.rail-team.is-walking .rail-member:nth-child(3) { animation-delay: -.26s; }

/* التخرّج: القبعات تُرمى مرة ثم تستقرّ على الرؤوس */
.rail-member-cap { transform-box: fill-box; transform-origin: center; animation: rail-toss 1.1s cubic-bezier(.2, .7, .3, 1) .5s both; }
.rail-member:nth-child(2) .rail-member-cap { animation-delay: .62s; }
.rail-member:nth-child(3) .rail-member-cap { animation-delay: .74s; }
@keyframes rail-toss { 0% { translate: 0 0; rotate: 0deg; } 45% { translate: 0 -30px; rotate: 200deg; } 100% { translate: 0 0; rotate: 360deg; } }
@keyframes rail-float { to { translate: 0 -4px; } }

@media (max-width: 575.98px) {
    .rail-actor.is-supervisor, .rail-actor.is-committee, .rail-actor.is-cap { display: none; }
    .rail-team, .rail-team.is-meeting { width: 54px; margin-inline-start: -27px; }
    .rail-member { width: 24px; height: 43px; }
    .hero-journey:has(.rail-cast) .hero-rail { padding-top: 46px; }
}
@media (prefers-reduced-motion: reduce) {
    .rail-team { transition: none; }
    .rail-actor.is-cap, .rail-member-cap, .cast-defs .hj-wave { animation: none; }
}

.stu-hero-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--ds-border);
}
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-ink-soft);
}
.hero-chip > i { font-size: 16px; }
.hero-chip small { font-weight: 400; color: var(--ds-ink-mute); }
.hero-chip.is-warn { background: var(--ds-warning-bg); color: #b45309; }
.hero-chip.is-late { background: var(--ds-danger-bg); color: var(--ds-danger); }
.hero-chip.is-done { background: var(--ds-success-bg); color: #047857; }
.stu-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- المرحلة الحالية ---- */
.spotlight {
    display: flex;
    gap: 16px;
    padding: 20px 22px;
    border: 1px solid var(--ds-border);
    border-inline-start: 4px solid var(--ds-brand-600);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-md);
    animation: hero-in .45s .08s var(--ds-ease) both;
}
.spotlight-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-600);
    font-size: 22px;
}
.spotlight-body { flex: 1; min-width: 0; }
.spotlight-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 0; color: var(--ds-brand-700); }
.spotlight h2 {
    margin: 2px 0 0;
    font-family: var(--ds-font-display);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.45;
    color: var(--ds-ink);
}
.spotlight-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12.5px; color: var(--ds-ink-mute); }
.spotlight-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.spotlight-meta i { font-size: 15px; }
.spotlight-meta .is-warn { color: #b45309; font-weight: 600; }
.spotlight-meta .is-late { color: var(--ds-danger); font-weight: 600; }
.spotlight-note, .spotlight p { margin: 10px 0 0; font-size: 13px; line-height: 1.8; color: var(--ds-ink-soft); }
.spotlight-feedback {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-warning-bg);
    font-size: 13px;
    line-height: 1.8;
    color: var(--ds-ink-soft);
}
.spotlight-feedback b { display: block; color: #92400e; }
.spotlight-feedback span { white-space: pre-line; overflow-wrap: anywhere; }
.spotlight-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.spotlight-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ds-ink-mute); text-decoration: none; }
.spotlight-link:hover { color: var(--ds-brand-600); }

.spotlight.is-revision { border-inline-start-color: var(--ds-warning); }
.spotlight.is-revision .spotlight-icon { background: var(--ds-warning-bg); color: #b45309; }
.spotlight.is-revision .spotlight-kicker { color: #b45309; }
.spotlight.is-late { border-inline-start-color: var(--ds-danger); }
.spotlight.is-late .spotlight-icon { background: var(--ds-danger-bg); color: var(--ds-danger); }
.spotlight.is-late .spotlight-kicker { color: var(--ds-danger); }
.spotlight.is-done { border-inline-start-color: var(--ds-success); }
.spotlight.is-done .spotlight-icon { background: var(--ds-success-bg); color: #047857; }
.spotlight.is-done .spotlight-kicker { color: #047857; }
.spotlight.is-empty { border-inline-start-color: var(--ds-border-strong); box-shadow: none; background: linear-gradient(90deg, var(--ds-surface), var(--ds-surface-sunk)); }
.spotlight.is-empty .spotlight-icon { background: var(--ds-surface-sunk); color: var(--ds-ink-soft); }
.spotlight.is-empty .spotlight-kicker { color: var(--ds-ink-mute); }

/* ألوان أيقونات النشاط */
.activity-icon.is-brand { background: var(--ds-brand-50); color: var(--ds-brand-600); }
.activity-icon.is-success { background: var(--ds-success-bg); color: #047857; }
.activity-icon.is-warn { background: var(--ds-warning-bg); color: #b45309; }

@media (max-width: 767.98px) {
    .stu-hero { padding: 18px 16px 16px; }
    .stu-hero-top { flex-direction: column-reverse; gap: 14px; }
    .stu-hero-progress { flex-direction: row; min-width: 0; gap: 12px; }
    .pct-ring.is-xl, .hero-progress-empty { width: 60px; height: 60px; }
    .pct-ring.is-xl b { font-size: 14px; }
    .hero-progress-empty { font-size: 22px; }
    .stu-hero-title h1 { font-size: 19px; }
    .hero-rail-label { font-size: 10.5px; }
    .stu-hero-actions, .stu-hero-actions .btn { width: 100%; }
    .spotlight { padding: 16px; gap: 12px; }
    .spotlight-icon { width: 38px; height: 38px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
    .stu-hero, .spotlight, .pct-ring.is-xl circle + circle { animation: none; }
}

/* ==================== أدوار الفريق ====================
   مَن مسؤول عن ماذا: وسوم ملوّنة تحت كل عضو، ومحرّر للقائد بمصفوفة
   تغطية تكشف الدور بلا مسؤول والعضو بلا دور. اللون من \u200E--h\u200E ثابت لكل دور. */
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--ds-radius-pill);
    background: hsl(var(--h) 80% 96%);
    border: 1px solid hsl(var(--h) 60% 88%);
    color: hsl(var(--h) 55% 32%);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}
.role-chip i { font-size: 13px; }
.role-chip.is-flat { border-color: transparent; }
.role-resp { display: block; margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--ds-ink-mute); }

.team-assign-btn {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-brand-700);
    cursor: pointer;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.team-assign-btn:hover { border-color: var(--ds-brand-300); background: var(--ds-brand-50); }
.team-assign-btn i { font-size: 15px; }
.ctx-head .ctx-count + .team-assign-btn { margin-inline-start: auto; }

.team-coverage {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface-sunk);
    font-size: 12px;
    color: var(--ds-ink-mute);
}
.team-coverage b { color: #b45309; }
.team-coverage-bar { flex: 0 0 70px; height: 5px; border-radius: 99px; background: var(--ds-border); overflow: hidden; }
.team-coverage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ds-success); }
.team-coverage.has-gap .team-coverage-bar span { background: var(--ds-warning); }

.team-invite {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    border: 0;
    border-bottom: 1px solid var(--ds-border);
    background: linear-gradient(90deg, var(--ds-brand-50), var(--ds-surface));
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.team-invite:hover { background: var(--ds-brand-50); }
.team-invite-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--ds-brand-600);
    color: #fff;
    font-size: 17px;
}
.team-invite > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.team-invite b { font-size: 13px; color: var(--ds-ink); }
.team-invite small { font-size: 11.5px; line-height: 1.6; color: var(--ds-ink-mute); }
.team-invite > .ti-chevron-left { color: var(--ds-brand-600); }

/* ---- صفحة الفريق والأدوار: الأدوار في المركز ----
   كانت بطاقة لكل عضو تحمل كل الأدوار المقترحة، ومصفوفة تكرّر البيانات
   نفسها. صارت: لوحة أدوار بأفاتارات حامليها، وشريط أعضاء بحمل كلٍّ. */
a.team-assign-btn { text-decoration: none; }

.roles-summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
}
.roles-cover { flex: 1 1 260px; display: flex; flex-direction: column; gap: 7px; }
.roles-cover-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ds-ink-mute); }
.roles-cover-label b { font-family: var(--ds-font-display); font-size: 13.5px; color: var(--ds-ink); }
.roles-cover-track { height: 8px; border-radius: 99px; background: var(--ds-surface-sunk); overflow: hidden; }
.roles-cover-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ds-brand-500), var(--ds-brand-600));
    transition: width var(--ds-dur-slow) var(--ds-ease);
}
.roles-balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ds-ink-soft);
}
.roles-balance i { font-size: 16px; }
.roles-balance.is-ok { background: var(--ds-success-bg); color: #047857; }
.roles-balance.is-warn { background: var(--ds-warning-bg); color: #b45309; }
.roles-suggest.is-done { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* ---- لوحة الأدوار ---- */
.role-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 24px; }
.role-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 150px;
    padding: 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background:
        linear-gradient(180deg, hsl(var(--h) 80% 97%), var(--ds-surface) 55%);
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease, transform var(--ds-dur-fast) ease;
    animation: role-card-in .35s var(--ds-ease) both;
}
.role-card:hover { border-color: hsl(var(--h) 55% 80%); box-shadow: var(--ds-shadow-md); }
.role-card.is-vacant { border-style: dashed; border-color: #fcd34d; background: var(--ds-surface); }
.role-card.is-mine { box-shadow: 0 0 0 2px var(--ds-brand-300); }
.role-card.is-new { animation: role-pop .35s var(--ds-ease); }
@keyframes role-card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes role-pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.role-board .role-card:nth-child(2) { animation-delay: .03s; }
.role-board .role-card:nth-child(3) { animation-delay: .06s; }
.role-board .role-card:nth-child(4) { animation-delay: .09s; }
.role-board .role-card:nth-child(n+5) { animation-delay: .12s; }

.role-card-head { display: flex; align-items: flex-start; gap: 10px; }
.role-card-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: hsl(var(--h) 75% 93%);
    color: hsl(var(--h) 55% 38%);
    font-size: 19px;
}
.role-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.role-card-title b { font-size: 13.5px; font-weight: 700; line-height: 1.4; color: var(--ds-ink); overflow-wrap: anywhere; }
.role-card-title small { font-size: 11.5px; color: var(--ds-ink-mute); }
.role-card.is-vacant .role-card-title small { color: #b45309; font-weight: 600; }
.role-card-kind {
    flex: none;
    padding: 1px 7px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ds-ink-mute);
}

.role-holders { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; flex: 1; align-content: flex-start; }
.role-holder {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    padding-inline: 3px 10px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-ink-soft);
    animation: holder-in .3s var(--ds-ease) both;
}
.role-holder .ctx-avatar { width: 24px; height: 24px; border-radius: 50%; font-size: 9.5px; }
.role-holder.is-me { border-color: var(--ds-brand-300); background: var(--ds-brand-50); color: var(--ds-brand-700); }
.role-holder.is-suggested { border-style: dashed; border-color: var(--ds-brand-400); animation: holder-in .3s var(--ds-ease) both, suggest-pulse 1.6s ease-in-out 2; }
@keyframes holder-in { from { opacity: 0; transform: translateY(-4px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes suggest-pulse { 50% { box-shadow: 0 0 0 4px var(--ds-brand-100); } }

.role-assign-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px dashed var(--ds-border-strong);
    border-radius: var(--ds-radius-pill);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-ink-soft);
    cursor: pointer;
    transition: border-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.role-assign-btn:hover { border-style: solid; border-color: hsl(var(--h) 55% 60%); background: hsl(var(--h) 80% 96%); color: hsl(var(--h) 55% 32%); }
.role-assign-btn i { font-size: 15px; }
.role-card.is-vacant .role-assign-btn { border-color: #f59e0b; color: #b45309; }

/* بطاقة «دور جديد»: حقل بزرّه المدمج، واقتراحات بنقرة — كانت حقلاً رفيعاً
   وزرّاً صغيراً معزولاً تحته */
.role-card.is-add {
    border: 1.5px dashed var(--ds-border-strong);
    background: var(--ds-surface);
    animation: none;
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease;
}
.role-card.is-add:hover,
.role-card.is-add:focus-within { border-color: var(--ds-brand-400); box-shadow: var(--ds-shadow-glow); }
.role-card.is-add .role-card-icon { background: var(--ds-accent); color: #fff; }

.role-add-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    padding-inline-start: 12px;
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    background: var(--ds-surface-sunk);
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.role-add-box:focus-within { border-color: var(--ds-brand-300); background: var(--ds-surface); }
.role-add-box > i { flex: none; font-size: 16px; color: var(--ds-ink-mute); }
.role-add-box input {
    flex: 1;
    min-width: 0;
    height: 34px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--ds-ink);
}
.role-add-box input:focus { outline: 0; }
.role-add-submit {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: var(--ds-brand-600);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) ease, transform var(--ds-dur-fast) ease, opacity var(--ds-dur-fast) ease;
}
.role-add-submit i { font-size: 15px; }
.role-add-submit:hover:not(:disabled) { background: var(--ds-brand-700); }
.role-add-submit:active:not(:disabled) { transform: scale(.96); }
.role-add-submit:disabled { background: var(--ds-border-strong); cursor: not-allowed; }

.role-add-ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.role-add-ideas small { font-size: 11px; color: var(--ds-ink-mute); }
.role-idea {
    padding: 3px 10px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ds-ink-soft);
    cursor: pointer;
    transition: border-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.role-idea::before { content: "+ "; color: var(--ds-brand-600); }
.role-idea:hover { border-color: var(--ds-brand-300); background: var(--ds-brand-50); color: var(--ds-brand-700); }

/* ---- الأعضاء: الحمل والمسؤولية ---- */
.roster { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); overflow: hidden; }
.roster-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 13px 18px;
    border-bottom: 1px solid var(--ds-border);
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-ink);
}
.roster-title > i { color: var(--ds-ink-mute); font-size: 17px; }
.roster-title span { font-size: 12px; font-weight: 400; color: var(--ds-ink-mute); }
.roster-row {
    display: grid;
    grid-template-columns: 40px minmax(140px, 1.1fr) 110px minmax(0, 1.4fr) minmax(0, 1.6fr);
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    transition: background-color var(--ds-dur-fast) ease;
}
.roster-row + .roster-row { border-top: 1px solid var(--ds-border); }
.roster-row:hover { background: var(--ds-surface-sunk); }
.roster-row.is-me { background: linear-gradient(90deg, var(--ds-surface), var(--ds-brand-50)); }
.roster-row.is-empty { box-shadow: inset -3px 0 0 var(--ds-warning); }
[dir="ltr"] .roster-row.is-empty { box-shadow: inset 3px 0 0 var(--ds-warning); }
.roster-avatar.ctx-avatar { width: 40px; height: 40px; border-radius: 50%; }
.roster-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; }
.roster-who b { color: var(--ds-ink); }
.roster-load { display: flex; flex-direction: column; gap: 4px; }
.load-dots { display: flex; gap: 4px; }
.load-dots i {
    width: 16px;
    height: 6px;
    border-radius: 99px;
    background: var(--ds-surface-sunk);
    box-shadow: inset 0 0 0 1px var(--ds-border);
    transition: background-color var(--ds-dur) var(--ds-ease);
}
.load-dots i.is-on { background: var(--ds-brand-600); box-shadow: none; }
.roster-row.is-empty .roster-load small { color: #b45309; font-weight: 700; }
.roster-load small { font-size: 11.5px; color: var(--ds-ink-mute); }
.roster-roles { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.roster-resp { display: flex; align-items: center; gap: 6px; min-width: 0; }
.roster-resp-view { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.6; color: var(--ds-ink-soft); cursor: text; }
.roster-resp-view.is-placeholder { color: var(--ds-ink-mute); font-style: italic; }
.roles-app.is-readonly .roster-resp-view { cursor: default; }
.roster-resp-input { flex: 1; }

/* ---- قائمة الإسناد ---- */
.assign-menu {
    position: absolute;
    z-index: 1060;
    width: 280px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-lg), 0 20px 40px -20px rgba(9, 9, 11, .25);
    overflow: hidden;
}
.assign-menu.is-open { animation: menu-in .18s var(--ds-ease); }
.assign-menu-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--ds-border); }
.assign-menu-head b { flex: 1; min-width: 0; font-size: 13px; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-menu-head .btn-close { font-size: 10px; }
.assign-menu-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.assign-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) ease;
}
.assign-option:hover:not(:disabled), .assign-option:focus-visible { background: var(--ds-surface-sunk); outline: 0; }
.assign-option .ctx-avatar { width: 32px; height: 32px; border-radius: 50%; }
.assign-option-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--ds-ink); }
.assign-option-name small { font-size: 11px; font-weight: 400; color: var(--ds-ink-mute); }
.assign-check {
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--ds-border-strong);
    border-radius: 7px;
    color: transparent;
    font-size: 13px;
    transition: background-color var(--ds-dur-fast) ease, border-color var(--ds-dur-fast) ease;
}
.assign-option.is-on .assign-check { border-color: var(--ds-brand-600); background: var(--ds-brand-600); color: #fff; }
.assign-option:disabled { opacity: .45; cursor: not-allowed; }

/* ---- شريط الحفظ: يظهر حين يوجد ما يُحفظ ---- */
.roles-savebar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 16px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    box-shadow: var(--ds-shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity var(--ds-dur) var(--ds-ease), transform var(--ds-dur) var(--ds-ease);
}
.roles-savebar.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.roles-savebar-text { flex: 1; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ds-brand-700); }
.roles-savebar-text i { font-size: 18px; animation: badge-ping-dot 1.6s ease-in-out infinite; }
@keyframes badge-ping-dot { 50% { opacity: .35; } }

@media (max-width: 991.98px) {
    .roster-row { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "av who load" "roles roles roles" "resp resp resp"; row-gap: 8px; }
    .roster-avatar { grid-area: av; }
    .roster-who { grid-area: who; }
    .roster-load { grid-area: load; align-items: flex-end; }
    .roster-roles { grid-area: roles; }
    .roster-resp { grid-area: resp; }
}
@media (max-width: 575.98px) {
    .role-board { grid-template-columns: 1fr 1fr; gap: 8px; }
    .role-card { min-height: 0; padding: 12px; }
    .role-card.is-add { grid-column: 1 / -1; }
    .roster-row { padding: 12px 14px; }
    /* الجوال: القائمة لوح من الأسفل */
    .assign-menu {
        position: fixed;
        inset: auto 0 0 0;
        width: auto;
        border-radius: 20px 20px 0 0;
    }
    .assign-menu.is-open { animation: sheet-in .25s var(--ds-ease); }
    .assign-menu-list { max-height: 60vh; }
    .roles-savebar { flex-wrap: wrap; }
    .roles-savebar-text { flex-basis: 100%; }
    .roles-savebar .btn { flex: 1; }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .role-card, .role-holder, .role-holder.is-suggested, .assign-menu.is-open, .roles-savebar-text i { animation: none; }
}

/* ==================== إشعارات الطالب ====================
   كانت سطوراً رمادية متشابهة: قبول المشروع وطلب التعديل وتغيير الإدارة
   بوزن واحد. صارت بطاقات بأيقونة فئتها، مجموعة باليوم، ومصفّاة بالمصدر. */
.notif-tabs { display: inline-flex; flex-wrap: wrap; }
.notif-feed { display: flex; flex-direction: column; gap: 20px; }
.notif-day-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ds-ink-mute);
}
.notif-day-title::after { content: ""; flex: 1; height: 1px; background: var(--ds-border); }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notif-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 14px 16px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    text-decoration: none;
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease, transform var(--ds-dur-fast) ease;
    animation: notif-in .35s var(--ds-ease) both;
}
.notif-card:hover { border-color: var(--ds-border-strong); box-shadow: var(--ds-shadow-md); transform: translateY(-1px); }
.notif-card.is-new { border-color: var(--ds-brand-200); background: linear-gradient(90deg, var(--ds-surface), var(--ds-brand-50)); }
.notif-card.is-new::before {
    content: "";
    position: absolute;
    inset-inline-start: -1px;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 3px;
    background: var(--ds-brand-600);
}
.notif-list li:nth-child(2) .notif-card { animation-delay: .04s; }
.notif-list li:nth-child(3) .notif-card { animation-delay: .08s; }
.notif-list li:nth-child(n+4) .notif-card { animation-delay: .12s; }
@keyframes notif-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.notif-card-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-soft);
    font-size: 19px;
}
.notif-card-icon.is-sm { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
.notif-card-icon.is-success { background: var(--ds-success-bg); color: #047857; }
.notif-card-icon.is-danger { background: var(--ds-danger-bg); color: var(--ds-danger); }
.notif-card-icon.is-warn { background: var(--ds-warning-bg); color: #b45309; }
.notif-card-icon.is-brand { background: var(--ds-brand-50); color: var(--ds-brand-600); }
/* الإدارة بالحبر: لون الهوية للمشرف، والإدارة جهة محايدة */
.notif-card-icon.is-admin { background: var(--ds-accent); color: #fff; }

.notif-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif-card-top { display: flex; align-items: center; gap: 8px; }
.notif-card-top b { font-size: 13.5px; font-weight: 700; color: var(--ds-ink); }
.notif-card-top time { margin-inline-start: auto; flex: none; font-size: 11.5px; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.notif-new {
    padding: 0 7px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-brand-600);
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
}
.notif-card-text { font-size: 13px; line-height: 1.7; color: var(--ds-ink-soft); overflow-wrap: anywhere; }
.notif-card-meta { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ds-ink-mute); }
.notif-card-meta i { font-size: 13px; }
.notif-card-go { flex: none; align-self: center; font-size: 16px; color: var(--ds-border-strong); transition: color var(--ds-dur-fast) ease, transform var(--ds-dur-fast) ease; }
.notif-card:hover .notif-card-go { color: var(--ds-brand-600); transform: translateX(-2px); }
.notif-none { margin: 0; padding: 30px; text-align: center; font-size: 13px; color: var(--ds-ink-mute); }

.notif-empty-page { display: flex; flex-direction: column; align-items: center; padding: 56px 24px; text-align: center; }
.notif-empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-600);
    font-size: 30px;
}
.notif-empty-page h2 { margin: 0 0 6px; font-family: var(--ds-font-display); font-size: 17px; font-weight: 800; color: var(--ds-ink); }
.notif-empty-page p { max-width: 420px; margin: 0 0 18px; font-size: 13px; line-height: 1.8; color: var(--ds-ink-mute); }

@media (max-width: 575.98px) {
    .notif-card { padding: 12px; gap: 10px; }
    .notif-card-icon { width: 34px; height: 34px; font-size: 17px; }
    .notif-card-go { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .notif-card { animation: none; }
}

/* ==================== تسليم المراحل ====================
   دورة: الفريق يسلّم ← المشرف يعتمد أو يطلب تعديلاً بملاحظة ← الفريق يعيد.
   الألوان: الأزرق عمل على المشرف (مراجعة)، والكهرماني عمل على الفريق (تعديل). */
.ms-row .ms-body { flex: 1; }
.ms-row.is-submitted .ms-check { background: var(--ds-brand-50); border-color: var(--ds-brand-200); color: var(--ds-brand-600); }
.ms-row.is-revision .ms-check { background: var(--ds-warning-bg); border-color: #fde68a; color: #b45309; }
.ms-flag.is-review { background: var(--ds-brand-50); color: var(--ds-brand-700); }
.ms-flag.is-revision { background: var(--ds-warning-bg); color: #b45309; }
.ms-head-review { color: var(--ds-brand-700); font-weight: 600; }

.ms-sub {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--ds-border);
    border-inline-start: 3px solid var(--ds-border-strong);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
}
.ms-sub.is-pending { border-inline-start-color: var(--ds-brand-500); background: linear-gradient(0deg, var(--ds-surface), var(--ds-surface)) padding-box; }
.ms-sub.is-revision { border-inline-start-color: var(--ds-warning); }
.ms-sub.is-approved { border-inline-start-color: var(--ds-success); }
.ms-sub-head { display: flex; align-items: center; gap: 8px; }
.ms-sub-avatar.ctx-avatar { width: 24px; height: 24px; border-radius: 50%; font-size: 10px; }
.ms-sub-who { flex: 1; min-width: 0; font-size: 12px; color: var(--ds-ink-mute); }
.ms-sub-who b { color: var(--ds-ink); font-weight: 700; }
.ms-round {
    flex: none;
    padding: 1px 8px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ds-ink-soft);
}
.ms-sub-note { margin: 8px 0 0; font-size: 13px; line-height: 1.8; color: var(--ds-ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.ms-sub-file { margin-top: 8px; }

.ms-feedback {
    display: flex;
    gap: 9px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-warning-bg);
    font-size: 13px;
    line-height: 1.75;
    color: var(--ds-ink-soft);
}
.ms-feedback > i { flex: none; margin-top: 3px; font-size: 16px; color: #b45309; }
.ms-feedback b { display: block; color: #92400e; }
/* أسطر المشرف كما كتبها — على نصّه وحده لا على فراغات القالب */
.ms-feedback-text { display: block; white-space: pre-line; overflow-wrap: anywhere; }
.ms-feedback small { display: block; margin-top: 2px; font-size: 11px; color: var(--ds-ink-mute); }
.ms-row .btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.ms-approved { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 12px; font-weight: 600; color: #047857; }

/* أزرار المراجعة ونماذج التسليم */
.ms-review { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ds-border); }
.ms-review .ms-revise { flex: 1 1 260px; }
.ms-revise > summary, .ms-submit > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; }
.ms-revise > summary::-webkit-details-marker, .ms-submit > summary::-webkit-details-marker { display: none; }
.ms-submit { margin-top: 10px; }
.ms-row .ms-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
    animation: ms-open .2s var(--ds-ease);
}
.ms-row .ms-form .form-label { margin: 0; font-size: 12.5px; font-weight: 600; }
.ms-row .ms-form .btn { align-self: flex-start; }
@keyframes ms-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.ms-file {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px dashed var(--ds-border-strong);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-surface);
    font-size: 12.5px;
    color: var(--ds-ink-soft);
    cursor: pointer;
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.ms-file:hover { border-color: var(--ds-brand-400); background: var(--ds-brand-50); }
.ms-file > i { font-size: 16px; color: var(--ds-brand-600); }
.ms-file span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.ms-history { margin-top: 10px; font-size: 12px; }
.ms-history > summary { cursor: pointer; color: var(--ds-ink-mute); font-weight: 600; }
.ms-history > summary:hover { color: var(--ds-ink); }
.ms-history ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ms-history li { display: flex; gap: 8px; align-items: baseline; color: var(--ds-ink-mute); line-height: 1.7; }
.ms-history em { display: block; font-style: normal; color: #92400e; }

.ms-sub-file { max-width: 100%; }
.ms-sub-file b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* الجوال: الشارة تتكرّر مع لون الدائرة وبطاقة التسليم، وتأخذ عرضها */
@media (max-width: 575.98px) {
    .ms-row.is-submitted .ms-flag,
    .ms-row.is-revision .ms-flag { display: none; }
    .ms-sub { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .ms-row .ms-form { animation: none; }
}

/* ==================== طلبات الإشراف ====================
   كانت عنواناً وحالة فارغة ولوح تحديثات بعرض الصفحة. صارت: السعة أولاً
   (ما يُقرَّر على أساسه)، والطلبات بتنبيه التشابه، وبجانبها ما قُرّر. */
.seat-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: stretch;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
}
.seat-main { display: flex; flex-direction: column; gap: 9px; padding: 16px 20px; }
.seat-label { font-size: 12.5px; color: var(--ds-ink-mute); }
.seat-pips { display: flex; flex-wrap: wrap; gap: 6px; }
.seat-pip {
    width: 30px;
    height: 10px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    box-shadow: inset 0 0 0 1px var(--ds-border);
    animation: seat-in .4s var(--ds-ease) both;
}
.seat-pip.is-taken { background: var(--ds-brand-600); box-shadow: none; }
.seat-pip.is-over { background: var(--ds-danger); box-shadow: none; }
.seat-pip:nth-child(2) { animation-delay: .06s; }
.seat-pip:nth-child(3) { animation-delay: .12s; }
.seat-pip:nth-child(4) { animation-delay: .18s; }
.seat-pip:nth-child(n+5) { animation-delay: .24s; }
@keyframes seat-in { from { transform: scaleX(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.seat-note { font-size: 13.5px; font-weight: 700; color: var(--ds-ink); }
.seat-note small { font-weight: 400; font-size: 12px; color: var(--ds-ink-mute); }
.seat-panel.is-full .seat-note { color: var(--ds-danger); }
.seat-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 150px;
    padding: 16px 22px;
    border-inline-start: 1px solid var(--ds-border);
}
.seat-stat b {
    font-family: var(--ds-font-display);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.seat-stat b.is-warn { color: #b45309; }
.seat-stat span { font-size: 12px; color: var(--ds-ink-mute); }
@media (max-width: 767.98px) {
    .seat-panel { grid-template-columns: 1fr 1fr; }
    .seat-main { grid-column: 1 / -1; border-bottom: 1px solid var(--ds-border); }
    .seat-stat { min-width: 0; padding: 13px 18px; }
    .seat-stat:first-of-type { border-inline-start: 0; }
}

/* تنبيه التشابه داخل بطاقة الطلب */
.req-similar {
    display: flex;
    gap: 9px;
    margin: 0 18px 12px;
    padding: 9px 12px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-info-bg);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ds-ink-soft);
}
.req-similar > i { flex: none; margin-top: 3px; font-size: 15px; color: var(--ds-info); }
.req-similar b { color: var(--ds-ink); }
.req-similar small { color: var(--ds-ink-mute); }

.req-empty { display: flex; flex-direction: column; align-items: center; padding: 44px 24px; text-align: center; }
.req-empty-icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: var(--ds-brand-50);
    color: var(--ds-brand-600);
    font-size: 28px;
}
.req-empty h2 { margin: 0 0 6px; font-family: var(--ds-font-display); font-size: 16px; font-weight: 800; color: var(--ds-ink); }
.req-empty p { max-width: 420px; margin: 0 0 16px; font-size: 13px; line-height: 1.8; color: var(--ds-ink-mute); }

/* ما قرّره */
.decision-list { list-style: none; margin: 0; padding: 6px 0; }
.decision-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 9px 18px;
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) ease;
}
a.decision-item:hover { background: var(--ds-surface-sunk); }
.decision-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 14px;
}
.decision-icon.is-accept { background: var(--ds-success-bg); color: #047857; }
.decision-icon.is-reject { background: var(--ds-danger-bg); color: var(--ds-danger); }
.decision-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.decision-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.decision-meta { font-size: 11.5px; color: var(--ds-ink-mute); }

.activity-icon.is-admin { background: var(--ds-warning-bg); color: #b45309; }
li.activity-item { list-style: none; }

@media (prefers-reduced-motion: reduce) {
    .seat-pip { animation: none; }
}

/* ==================== 20) Reduced motion ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .skeleton { animation: none; }
}

/* ==================== متابعة الفرق ====================
   أربعة مؤشّرات في شبكة بخطوط شعرية كلوح القيادة: الرقم كبير، والخلية
   رابط إلى قائمة الفرق نفسها. التحذير لما فيه عدد وحده — الصفر يهدأ. */
.health-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--ds-border);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    overflow: hidden;
}
.health-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 18px 16px;
    background: var(--ds-surface);
    color: inherit;
    text-decoration: none;
    transition: background-color var(--ds-dur-fast) var(--ds-ease);
}
.health-cell:hover { background: var(--ds-surface-sunk); color: inherit; }
.health-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.health-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-mute);
    font-size: 18px;
}
.health-n {
    font-family: var(--ds-font-display);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--ds-ink-mute);
    font-variant-numeric: tabular-nums;
}
.health-title { font-size: 13.5px; font-weight: 700; color: var(--ds-ink); }
.health-text { font-size: 12px; line-height: 1.7; color: var(--ds-ink-mute); }
.health-cell.is-alert .health-icon { background: var(--ds-warning-bg); color: #b45309; }
.health-cell.is-alert .health-n { color: var(--ds-ink); }
.health-cell.is-clear .health-title { color: var(--ds-ink-soft); }

/* شريط التصفية القادمة من «متابعة الفرق» فوق جدول المجموعات */
.issue-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #fde68a;
    border-radius: var(--ds-radius-lg);
    background: var(--ds-warning-bg);
    font-size: 13px;
    color: var(--ds-ink-soft);
}
.issue-banner > .ti { font-size: 20px; color: #b45309; flex: none; }
.issue-banner b { color: var(--ds-ink); margin-inline-end: 6px; }
.issue-banner-clear {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 600;
    color: #92400e;
}

/* جدول المشرفين: التسليمات بانتظار المراجعة */
.review-cell { display: inline-flex; flex-direction: column; line-height: 1.3; white-space: nowrap; }
.review-cell b { font-family: var(--ds-font-display); font-size: 15px; color: var(--ds-ink); }
.review-cell small { font-size: 11px; color: var(--ds-ink-mute); }
.review-cell.is-late b, .review-cell.is-late small { color: var(--ds-danger); }

@media (max-width: 991.98px) {
    .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .health-grid { grid-template-columns: 1fr; }
    .issue-banner { flex-wrap: wrap; }
    .issue-banner-clear { margin-inline-start: 32px; }
}

/* ==================== الاتجاه خلال الفصل ====================
   رسمان متجاوران لكلٍّ مقياسه (لا محوران على رسم واحد)، فوق كلٍّ رقمه
   الحالي وتغيّره بسهم وكلمة. محدِّد المدّة فوقهما يحكمهما معاً. */
.tc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tc-range {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
}
.tc-range button {
    border: 0;
    background: none;
    padding: 5px 14px;
    border-radius: var(--ds-radius-pill);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ds-ink-mute);
    cursor: pointer;
    transition: background-color var(--ds-dur-fast) var(--ds-ease), color var(--ds-dur-fast) var(--ds-ease);
}
.tc-range button:hover { color: var(--ds-ink); }
.tc-range button[aria-pressed="true"] { background: var(--ds-accent); color: var(--ds-surface); }
.tc-range button:focus-visible { outline: 2px solid var(--ds-brand-500); outline-offset: 2px; }
.tc-note { font-size: 12px; color: var(--ds-ink-mute); }

.tc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tc-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    padding: 18px 18px 10px;
    min-width: 0;
}
.tc-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title title" "now delta"; align-items: end; row-gap: 8px; margin-bottom: 10px; }
.tc-title { grid-area: title; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ds-ink-soft); }
.tc-title .ti { font-size: 17px; color: var(--ds-ink-mute); }
.tc-now { grid-area: now; display: inline-flex; align-items: baseline; gap: 6px; }
.tc-value {
    font-family: var(--ds-font-display);
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}
.tc-unit { font-size: 13px; color: var(--ds-ink-mute); }
.tc-delta {
    grid-area: delta;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--ds-radius-pill);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--ds-surface-sunk);
    color: var(--ds-ink-soft);
}
.tc-delta .ti { font-size: 14px; }
.tc-delta.is-good { background: var(--ds-success-bg); color: var(--ds-success); }
.tc-delta.is-bad { background: var(--ds-danger-bg); color: var(--ds-danger); }
.tc-plot { position: relative; height: 170px; }

.tc-table { margin-top: 6px; border-top: 1px solid var(--ds-border); padding-top: 6px; }
.tc-table summary { font-size: 12px; color: var(--ds-ink-mute); cursor: pointer; width: max-content; }
.tc-table summary:hover { color: var(--ds-ink); }
.tc-table table { width: 100%; margin-top: 8px; font-size: 12.5px; }
.tc-table th { font-weight: 600; color: var(--ds-ink-mute); padding: 4px 0; text-align: start; }
.tc-table td { padding: 4px 0; border-top: 1px solid var(--ds-border); color: var(--ds-ink-soft); font-variant-numeric: tabular-nums; }
.tc-table td:last-child, .tc-table th:last-child { text-align: end; }
.tc-table tbody { display: block; max-height: 200px; overflow-y: auto; }
.tc-table thead, .tc-table tbody tr { display: table; width: 100%; table-layout: fixed; }

@media (max-width: 767.98px) {
    .tc-grid { grid-template-columns: 1fr; }
    .tc-toolbar { flex-wrap: wrap; }
    .tc-value { font-size: 30px; }
}

/* ==================== صفحة المجموعة عند الإدارة ====================
   رأس مضغوط بشارات، شريط انتباه حين يلزم، ثم عمودان: العمل في تبويبات،
   والخلاصة في جانب ثابت. البطاقات بحدّ شعري ونصف قطر اللوحة نفسها. */
.pg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: -8px; }
.pg-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 12px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
    font-size: 12.5px; font-weight: 600; color: var(--ds-ink-soft);
    white-space: nowrap;
}
.pg-chip .ti { font-size: 15px; color: var(--ds-ink-mute); }
.pg-chip-sep { margin: 0 2px; color: var(--ds-ink-mute); }
.pg-chip.is-person { padding-inline-start: 4px; }
.pg-chip-avatar { width: 22px !important; height: 22px !important; font-size: 9.5px !important; border-radius: 50%; }

.pg-alerts {
    border: 1px solid #fde68a; border-radius: var(--ds-radius-lg);
    background: var(--ds-warning-bg);
    overflow: hidden;
}
.pg-alerts-title {
    display: flex; align-items: center; gap: 7px;
    margin: 0; padding: 10px 16px;
    border-bottom: 1px solid #fde68a;
    font-size: 12.5px; font-weight: 700; color: #92400e;
}
.pg-alerts-title .ti { font-size: 16px; }
.pg-alerts-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px; background: #fde68a;
}
.pg-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px;
    background: #fffdf5;
}
.pg-alert .ti { font-size: 19px; color: #b45309; flex: none; margin-top: 1px; }
.pg-alert b { display: block; font-size: 13px; color: var(--ds-ink); }
.pg-alert small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.6; color: var(--ds-ink-mute); }

.pg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.pg-main { min-width: 0; }
.pg-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

/* التبويبات */
.pg-tablist {
    display: flex; gap: 4px;
    margin-bottom: 14px; padding: 4px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow-x: auto; scrollbar-width: none;
}
.pg-tablist::-webkit-scrollbar { display: none; }
.pg-tablist [role="tab"] {
    display: inline-flex; align-items: center; gap: 7px;
    flex: none;
    border: 0; background: none;
    padding: 9px 14px; border-radius: var(--ds-radius-md);
    font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ds-ink-mute);
    cursor: pointer; white-space: nowrap;
    transition: background-color var(--ds-dur-fast) var(--ds-ease), color var(--ds-dur-fast) var(--ds-ease);
}
.pg-tablist [role="tab"] .ti { font-size: 17px; }
.pg-tablist [role="tab"]:hover { color: var(--ds-ink); background: var(--ds-surface-sunk); }
.pg-tablist [role="tab"][aria-selected="true"] { background: var(--ds-accent); color: var(--ds-surface); }
.pg-tablist [role="tab"]:focus-visible { outline: 2px solid var(--ds-brand-500); outline-offset: 2px; }
.pg-count {
    min-width: 22px; padding: 1px 7px; border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk); color: var(--ds-ink-soft);
    font-size: 11.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
[aria-selected="true"] .pg-count { background: rgba(255, 255, 255, .16); color: inherit; }
/* بلا JavaScript: اللوحات متتالية بمسافة؛ بعده: واحدة ظاهرة */
.pg-panel + .pg-panel { margin-top: 16px; }
.pg-tabs.is-enhanced .pg-panel + .pg-panel { margin-top: 0; }
.pg-panel[hidden] { display: none; }
.pg-panel > .dist-panel, .pg-panel > section { margin-bottom: 0 !important; }

/* البطاقات الجانبية */
.pg-card {
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    padding: 18px;
}
.pg-card-title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    margin: 0 0 12px;
    font-size: 14px; font-weight: 700; color: var(--ds-ink);
}
.pg-card-title span { font-size: 12px; font-weight: 500; color: var(--ds-ink-mute); }

.pg-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.pg-progress-title { display: block; font-size: 14px; font-weight: 700; color: var(--ds-ink); }
.pg-progress-sub { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ds-ink-mute); }
.pg-time {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 14px; padding: 9px 12px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
    font-size: 13px; font-weight: 600; color: var(--ds-ink-soft);
}
.pg-time .ti { font-size: 17px; }
.pg-time.is-success { background: var(--ds-success-bg); color: var(--ds-success); }
.pg-time.is-danger { background: var(--ds-danger-bg); color: var(--ds-danger); }
.pg-time.is-warn { background: var(--ds-warning-bg); color: #b45309; }

/* المسار عمودياً: عقدة وخطّ يصلها بالتالية */
.pg-steps { list-style: none; margin: 0; padding: 0; }
.pg-steps li {
    position: relative;
    display: grid; grid-template-columns: 22px 1fr auto; align-items: center; column-gap: 10px;
    padding: 7px 0;
    font-size: 13px; color: var(--ds-ink-mute);
}
.pg-steps li:not(:last-child)::after {
    content: ""; position: absolute;
    inset-inline-start: 10px; top: calc(50% + 11px); height: calc(100% - 22px);
    width: 2px; background: var(--ds-border);
}
.pg-steps li.is-done:not(:last-child)::after { background: var(--ds-accent); }
.pg-step-node {
    display: grid; place-items: center;
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--ds-border); background: var(--ds-surface);
    font-size: 12px; color: #fff;
}
.pg-steps li.is-done .pg-step-node { background: var(--ds-accent); border-color: var(--ds-accent); }
.pg-steps li.is-current .pg-step-node { border-color: var(--ds-brand-600); box-shadow: 0 0 0 4px var(--ds-brand-50); }
.pg-steps li.is-done, .pg-steps li.is-current { color: var(--ds-ink); }
.pg-steps li.is-current .pg-step-label { font-weight: 700; }
.pg-step-meta { font-size: 11.5px; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }

/* التقييم: الرقم بطل البطاقة */
.pg-grade { background: linear-gradient(180deg, var(--ds-surface-sunk), var(--ds-surface) 70%); }
.pg-grade-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pg-grade-num {
    font-family: var(--ds-font-display);
    font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.02em;
    color: var(--ds-ink); font-variant-numeric: tabular-nums;
}
.pg-grade-num small { font-size: 14px; font-weight: 600; color: var(--ds-ink-mute); letter-spacing: 0; }
.pg-grade-label {
    padding: 3px 10px; border-radius: var(--ds-radius-pill);
    background: var(--ds-accent); color: var(--ds-surface);
    font-size: 12px; font-weight: 700;
}
.pg-grade-note { margin: 12px 0 0; font-size: 13px; line-height: 1.8; color: var(--ds-ink-soft); }
.pg-grade-meta { margin-top: 10px; font-size: 12px; color: var(--ds-ink-mute); }
.pg-grade-unlock { margin-top: 12px; }

/* الفريق */
.pg-team { list-style: none; margin: 0; padding: 0; }
.pg-team li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.pg-team li + li { border-top: 1px solid var(--ds-border); }
.pg-member { display: flex; flex-direction: column; min-width: 0; }
.pg-member-name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ds-ink); }
.pg-member-meta { margin-top: 2px; font-size: 11.5px; color: var(--ds-ink-mute); }

/* التفاصيل */
.pg-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.pg-dl dt { font-weight: 500; color: var(--ds-ink-mute); }
.pg-dl dd { margin: 0; color: var(--ds-ink); text-align: end; }
.pg-dl dd small { display: block; font-size: 11.5px; color: var(--ds-ink-mute); }
.pg-desc { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ds-border); font-size: 13px; line-height: 1.85; color: var(--ds-ink-soft); }
.pg-desc p { margin: 6px 0 0; }
.pg-desc-label { display: block; font-size: 12px; font-weight: 600; color: var(--ds-ink-mute); }
details.pg-desc summary { list-style: none; cursor: pointer; }
details.pg-desc summary::-webkit-details-marker { display: none; }
.pg-desc-preview { display: block; margin-top: 6px; }
.pg-desc-more { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--ds-brand-600); }
details.pg-desc[open] .pg-desc-preview, details.pg-desc[open] .pg-desc-more { display: none; }

/* الجوال: الخلاصة (الإنجاز والتقييم) أولاً، ثم العمل، ثم الفريق والتفاصيل —
   لا أربع بطاقات قبل أن تصل المراحل */
@media (max-width: 991.98px) {
    .pg-layout { display: flex; flex-direction: column; gap: 16px; }
    .pg-side { display: contents; }
    .pg-side > .pg-card { order: 3; }
    .pg-side > .pg-card.is-summary { order: 1; }
    .pg-main { order: 2; width: 100%; }
}

/* ==================== درج التعديل ====================
   للطالب والمشرف والمسؤول. رأس بهوية السجلّ، وحقول في مجموعات، وتذييل
   ثابت يعدّ التغييرات. على الجوال ورقة من الأسفل بعرض كامل. */
.offcanvas.ed-drawer {
    --bs-offcanvas-width: 480px;
    width: 480px;
    max-width: 100vw;
    border: 0;
    background: var(--ds-surface);
    box-shadow: 0 0 0 1px var(--ds-border), 0 24px 60px -12px rgba(9, 9, 11, .28);
}
.ed-form { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.ed-head {
    flex: none;
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--ds-border);
    background:
        radial-gradient(120% 90% at 100% 0%, var(--ds-brand-50), transparent 65%),
        var(--ds-surface);
}
.ed-head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ed-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--ds-ink-mute); letter-spacing: .01em; }

.ed-identity { display: flex; align-items: center; gap: 14px; }
.ed-avatar {
    flex: none;
    position: relative;
    display: grid; place-items: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--ds-accent); color: var(--ds-surface);
    font-family: var(--ds-font-display); font-size: 19px; font-weight: 800;
    overflow: hidden;
    box-shadow: 0 0 0 3px var(--ds-surface), 0 0 0 4px var(--ds-border);
    transition: opacity var(--ds-dur) var(--ds-ease), filter var(--ds-dur) var(--ds-ease);
}
.ed-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ed-avatar.is-removing { opacity: .35; filter: grayscale(1); }
.ed-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ed-who b {
    font-family: var(--ds-font-display); font-size: 18px; font-weight: 800; color: var(--ds-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-who span { font-size: 12.5px; color: var(--ds-ink-mute); text-align: start; unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }
.ed-status {
    flex: none; max-width: 150px;
    padding: 4px 10px; border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk); color: var(--ds-ink-soft);
    font-size: 11.5px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-status[data-tone="in"] { background: var(--ds-success-bg); color: var(--ds-success); }
.ed-status[data-tone="full"] { background: var(--ds-warning-bg); color: #b45309; }
.ed-status[data-tone="none"] { background: var(--ds-surface-sunk); color: var(--ds-ink-mute); }

.ed-avatar-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; }
.ed-link {
    display: inline-flex; align-items: center; gap: 5px;
    border: 0; background: none; padding: 0;
    font: inherit; font-weight: 600; color: var(--ds-brand-600); cursor: pointer;
}
.ed-link:hover { text-decoration: underline; }
.ed-link.is-danger { color: var(--ds-danger); }
.ed-remove-note { display: inline-flex; align-items: center; gap: 5px; color: var(--ds-danger); font-weight: 600; }

.ed-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 22px 22px; }
.ed-group { border: 0; margin: 0; padding: 16px 0 4px; min-width: 0; }
.ed-group + .ed-group { border-top: 1px solid var(--ds-border); }
/* \u200Efloat\u200E يُخرج الـ legend من حدّ الـ fieldset فيصير عنواناً عادياً فوق حقوله */
.ed-group > legend + * { clear: both; }
.ed-group legend {
    float: inline-start; width: 100%; margin: 0 0 12px; padding: 0;
    font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--ds-ink-mute);
}
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ed-field { margin-bottom: 14px; min-width: 0; }
.ed-field.is-wide { grid-column: 1 / -1; }
.ed-field .form-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.ed-field .form-control, .ed-field .form-select { border-radius: var(--ds-radius-md); }
.ed-field .form-control[dir="ltr"] { text-align: left; }
.ed-hint { margin-top: 5px; font-size: 11.5px; color: var(--ds-ink-mute); }
/* الحقل الذي تغيّر: نقطة بجانب اسمه وحدّ بلون العلامة */
.ed-changed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ds-brand-600); opacity: 0; transform: scale(.4); transition: opacity var(--ds-dur-fast) var(--ds-ease), transform var(--ds-dur-fast) var(--ds-ease); }
.ed-field.is-changed .ed-changed-dot { opacity: 1; transform: none; }
.ed-field.is-changed .form-control:not(.is-invalid),
.ed-field.is-changed .form-select:not(.is-invalid) { border-color: var(--ds-brand-300); background-color: var(--ds-brand-50); }

/* الجنس: زرّان مجزّآن */
.ed-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface-sunk); }
.ed-segmented label { margin: 0; cursor: pointer; }
.ed-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.ed-segmented span {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 10px; border-radius: calc(var(--ds-radius-md) - 3px);
    font-size: 13px; font-weight: 600; color: var(--ds-ink-mute);
    transition: background-color var(--ds-dur-fast) var(--ds-ease), color var(--ds-dur-fast) var(--ds-ease);
}
.ed-segmented input:checked + span { background: var(--ds-surface); color: var(--ds-ink); box-shadow: 0 1px 2px rgba(9, 9, 11, .08), 0 0 0 1px var(--ds-border); }
.ed-segmented input:focus-visible + span { outline: 2px solid var(--ds-brand-500); outline-offset: 1px; }

/* العدّاد */
.ed-stepper { display: grid; grid-template-columns: 38px 1fr 38px; gap: 6px; }
.ed-stepper button {
    display: grid; place-items: center;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md);
    background: var(--ds-surface); color: var(--ds-ink-soft); cursor: pointer;
}
.ed-stepper button:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.ed-stepper input { text-align: center; font-weight: 700; -moz-appearance: textfield; }
.ed-stepper input::-webkit-outer-spin-button, .ed-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* كلمة السر */
.ed-password { margin-top: 2px; }
.ed-password-toggle {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 12px 14px;
    border: 1px dashed var(--ds-border-strong); border-radius: var(--ds-radius-md);
    background: var(--ds-surface); text-align: start; cursor: pointer;
    transition: border-color var(--ds-dur-fast) var(--ds-ease), background-color var(--ds-dur-fast) var(--ds-ease);
}
.ed-password-toggle:hover { border-color: var(--ds-accent); background: var(--ds-surface-sunk); }
.ed-password-toggle > .ti:first-child { font-size: 19px; color: var(--ds-ink-soft); }
.ed-password-toggle > .ti:last-child { margin-inline-start: auto; color: var(--ds-ink-mute); }
.ed-password-toggle b { display: block; font-size: 13px; color: var(--ds-ink); }
.ed-password-toggle small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--ds-ink-mute); }
.ed-password-body { padding: 12px 14px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface-sunk); }
.ed-password-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ed-password-head .form-label { margin: 0; font-size: 12.5px; font-weight: 600; }
.ed-password-head .ed-link { font-size: 12px; }
.ed-password-input { display: grid; grid-template-columns: 1fr 38px 38px; gap: 6px; }
.ed-password-input .form-control { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.ed-icon-btn {
    display: grid; place-items: center;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md);
    background: var(--ds-surface); color: var(--ds-ink-soft); cursor: pointer; font-size: 17px;
}
.ed-icon-btn:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.ed-strength { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: center; gap: 4px; margin-top: 8px; }
.ed-strength span { height: 4px; border-radius: 99px; background: var(--ds-border); transition: background-color var(--ds-dur-fast) var(--ds-ease); }
.ed-strength small { margin-inline-start: 8px; font-size: 11.5px; color: var(--ds-ink-mute); white-space: nowrap; }
.ed-strength[data-level="1"] span:nth-child(-n+1) { background: var(--ds-danger); }
.ed-strength[data-level="2"] span:nth-child(-n+2) { background: #f59e0b; }
.ed-strength[data-level="3"] span:nth-child(-n+3) { background: var(--ds-brand-500); }
.ed-strength[data-level="4"] span:nth-child(-n+4) { background: var(--ds-success); }

/* التذييل */
.ed-foot {
    flex: none;
    display: flex; align-items: center; gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface);
}
.ed-changes { margin-inline-end: auto; font-size: 12.5px; color: var(--ds-ink-mute); }
.ed-changes.is-dirty { color: var(--ds-brand-600); font-weight: 700; }
.ed-foot .btn-primary[disabled] { opacity: .45; }
.ed-spinner {
    display: none; width: 15px; height: 15px; margin-inline-end: 6px;
    border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%;
    animation: ed-spin .7s linear infinite;
}
.is-saving .ed-spinner { display: inline-block; }
.is-saving .ti-device-floppy { display: none; }
@keyframes ed-spin { to { transform: rotate(360deg); } }

/* الجوال: ورقة من الأسفل */
@media (max-width: 575.98px) {
    .offcanvas.ed-drawer {
        top: auto; right: 0; left: 0; bottom: 0;
        width: 100%; height: 92vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    .offcanvas.ed-drawer.showing, .offcanvas.ed-drawer.show:not(.hiding) { transform: none; }
    .offcanvas.ed-drawer.hiding { transform: translateY(100%); }
    .ed-head { border-radius: 20px 20px 0 0; }
    .ed-head::before { content: ""; display: block; width: 40px; height: 4px; margin: -8px auto 12px; border-radius: 99px; background: var(--ds-border-strong); }
    .ed-grid { grid-template-columns: 1fr; }
    .ed-status { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ed-spinner { animation-duration: 2s; }
}

/* ==================== ثبات الصفحة عند فتح نافذة أو درج ====================
   يُخفي Bootstrap شريط التمرير (16px) عند فتح نافذة أو درج، فيتّسع العرض
   وتقفز القائمة الجانبية الثابتة 16px ثم ترجع عند الإغلاق. ويعوّض بـ
   padding-right على body وحده لا على العناصر الثابتة. المساحة محجوزة
   للشريط دائماً فلا يتغيّر العرض — والتعويض صار زائداً فيُلغى. */
html { scrollbar-gutter: stable; }
/* صفحات الدخول لا شريط جانبي فيها: الهامش المحجوز كان يقطع الخلفية عند الحافة */
html:has(> body.auth-body) { scrollbar-gutter: auto; }
body[style*="padding-right"] { padding-right: 0 !important; }

/* ==================== سجلّ التدقيق — خطّ زمني ====================
   لكل فئة لونها في ‎--at-c‎ (العقدة والنقطة والشريط)، والنصّ بألوان الحبر
   دائماً: اللون يعرّف الفئة ولا يحمل المعنى وحده — الأيقونة والاسم يحملانه. */
[data-cat] { --at-c: var(--ds-ink-soft); --at-bg: var(--ds-surface-sunk); }
[data-cat="grade"] { --at-c: #b45309; --at-bg: #fffbeb; }
[data-cat="work"] { --at-c: var(--ds-brand-600); --at-bg: var(--ds-brand-50); }
[data-cat="project"] { --at-c: var(--ds-ink); --at-bg: var(--ds-surface-sunk); }
[data-cat="danger"] { --at-c: #be123c; --at-bg: #fff1f2; }
[data-cat="account"] { --at-c: #6d28d9; --at-bg: #f5f3ff; }

.at-readonly {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 12px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
    font-size: 12.5px; font-weight: 600; color: var(--ds-ink-mute);
}

/* الملخّص */
.at-summary {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px; background: var(--ds-border);
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    overflow: hidden;
}
.at-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--ds-surface); min-width: 0; }
.at-stat-n {
    font-family: var(--ds-font-display); font-size: 26px; font-weight: 800; line-height: 1.1;
    color: var(--ds-ink); font-variant-numeric: tabular-nums;
}
.at-stat[data-cat="grade"] .at-stat-n { color: #b45309; }
.at-stat-name { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-stat-l { font-size: 12.5px; color: var(--ds-ink-mute); }

/* التصفية */
.at-dot { background: var(--at-c) !important; }
.filter-tab.is-empty { opacity: .5; }
.filter-tab.is-empty:hover { opacity: 1; }
.at-filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
.at-periods {
    display: inline-flex; padding: 3px; gap: 2px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunk);
}
.at-periods label { margin: 0; cursor: pointer; }
.at-periods input { position: absolute; opacity: 0; pointer-events: none; }
.at-periods span {
    display: block; padding: 6px 13px; border-radius: var(--ds-radius-pill);
    font-size: 12.5px; font-weight: 600; color: var(--ds-ink-mute); white-space: nowrap;
    transition: background-color var(--ds-dur-fast) var(--ds-ease), color var(--ds-dur-fast) var(--ds-ease);
}
.at-periods span:hover { color: var(--ds-ink); }
.at-periods input:checked + span { background: var(--ds-accent); color: var(--ds-surface); }
.at-periods input:focus-visible + span { outline: 2px solid var(--ds-brand-500); outline-offset: 1px; }
.at-range { display: inline-flex; gap: 8px; }
.at-range[hidden] { display: none; }
.at-range label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--ds-ink-mute); }
.at-range .form-control { width: 150px; }
.at-select { width: auto; min-width: 150px; }
.at-apply { margin-inline-start: auto; }
.at-applied { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 16px 12px; }
.at-applied-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: var(--ds-radius-pill);
    background: var(--ds-accent); color: var(--ds-surface);
    font-size: 12px; font-weight: 600;
}
.at-applied-chip:hover { background: var(--ds-danger); color: #fff; }
.at-applied-clear { font-size: 12px; font-weight: 600; color: var(--ds-ink-mute); }

/* الأيام */
.at-day + .at-day { margin-top: 20px; }
.at-day-head {
    position: sticky; top: 64px; z-index: 2;
    display: flex; align-items: baseline; gap: 10px;
    margin: 0 0 8px; padding: 6px 2px;
    background: var(--ds-bg, var(--ds-surface-sunk));
    font-size: 14px; font-weight: 800; color: var(--ds-ink);
}
.at-day-head span { font-size: 12px; font-weight: 500; color: var(--ds-ink-mute); }
.at-list {
    position: relative;
    padding: 6px 18px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
}

/* الحدث: عقدة على الخطّ، ثم المتن */
.at-row { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 12px 0; }
.at-row:not(:last-child)::before {
    content: ""; position: absolute;
    inset-inline-start: 16px; top: 46px; bottom: -12px;
    width: 2px; background: var(--ds-border);
}
.at-node {
    position: relative; z-index: 1;
    display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--at-bg); color: var(--at-c);
    box-shadow: 0 0 0 4px var(--ds-surface), inset 0 0 0 1px color-mix(in srgb, var(--at-c) 22%, transparent);
    font-size: 17px;
}
.at-body { min-width: 0; padding-top: 5px; }
.at-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; font-size: 13.5px; line-height: 1.6; }
.at-head b { color: var(--ds-ink); }
.at-subject { color: var(--ds-ink-soft); }
a.at-subject { color: var(--ds-brand-600); text-decoration: underline; text-decoration-color: var(--ds-brand-200); text-underline-offset: 3px; }
a.at-subject:hover { text-decoration-color: currentColor; }

.at-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.at-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: var(--ds-radius-pill);
    border: 1px solid var(--ds-border); background: var(--ds-surface);
    font-size: 12px; color: var(--ds-ink-soft);
}
.at-chip-label { color: var(--ds-ink-mute); }
.at-chip .ti { font-size: 12px; color: var(--ds-ink-mute); }
.at-from { color: var(--ds-ink-mute); text-decoration: line-through; text-decoration-color: var(--ds-border-strong); }
.at-to { font-weight: 700; color: var(--ds-ink); }

.at-reason {
    margin: 8px 0 0; padding: 8px 12px;
    border-inline-start: 3px solid var(--at-c);
    border-radius: 0 var(--ds-radius-md) var(--ds-radius-md) 0;
    background: var(--at-bg);
    font-size: 13px; line-height: 1.8; color: var(--ds-ink-soft);
}
[dir="rtl"] .at-reason { border-radius: var(--ds-radius-md) 0 0 var(--ds-radius-md); }

.at-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--ds-ink-mute); }
.at-avatar { width: 20px !important; height: 20px !important; font-size: 9px !important; }
.at-actor { font-weight: 600; color: var(--ds-ink-soft); }
.at-role { padding: 1px 7px; border-radius: var(--ds-radius-pill); background: var(--ds-surface-sunk); font-size: 11px; }
.at-meta time { font-variant-numeric: tabular-nums; }

/* تبويب «سجلّ المشروع» في صفحة المجموعة: الخطّ نفسه داخل اللوحة */
.audit-list { padding: 4px 18px; }

@media (max-width: 991.98px) {
    .at-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .at-apply { margin-inline-start: 0; }
}
@media (max-width: 575.98px) {
    .at-periods { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
    .at-select, .at-range, .at-range .form-control { width: 100%; }
    .at-range { flex-direction: column; }
    .at-apply { width: 100%; }
    .at-list { padding: 4px 12px; }
    .at-stat-n { font-size: 22px; }
}


/* ==================== درج الإضافة ==================== */
.ed-avatar.is-new {
    background: var(--ds-surface);
    color: var(--ds-ink-mute);
    border: 2px dashed var(--ds-border-strong);
    box-shadow: none;
    font-size: 22px;
}
.ed-who b.is-placeholder { color: var(--ds-ink-mute); font-weight: 600; }
.ed-foot .btn-outline-primary { white-space: nowrap; }
.ed-warning {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 14px 0 0; padding: 10px 12px;
    border: 1px solid #fde68a; border-radius: var(--ds-radius-md);
    background: var(--ds-warning-bg);
    font-size: 12.5px; line-height: 1.7; color: #92400e;
}
.ed-warning .ti { font-size: 17px; flex: none; margin-top: 1px; }

/* ==================== نافذة الاستيراد ==================== */
.im-modal .modal-header { align-items: flex-start; }
.im-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--ds-ink-mute); }
.im-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.im-steps li {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
}
.im-steps li > div { flex: 1; min-width: 0; }
.im-steps b { display: block; font-size: 13.5px; color: var(--ds-ink); }
.im-steps span:not(.im-step-n) { display: block; font-size: 12px; color: var(--ds-ink-mute); line-height: 1.6; }
.im-step-n {
    flex: none; display: grid; place-items: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--ds-accent); color: var(--ds-surface);
    font-size: 12.5px; font-weight: 800;
}

.im-drop {
    position: relative;
    display: grid; place-items: center;
    min-height: 150px; margin: 0; padding: 18px;
    border: 2px dashed var(--ds-border-strong); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface-sunk);
    text-align: center; cursor: pointer;
    transition: border-color var(--ds-dur-fast) var(--ds-ease), background-color var(--ds-dur-fast) var(--ds-ease);
}
.im-drop:hover, .im-drop.is-over { border-color: var(--ds-brand-500); background: var(--ds-brand-50); }
.im-drop:focus-within { outline: 2px solid var(--ds-brand-500); outline-offset: 2px; }
.im-drop.has-file { border-style: solid; border-color: var(--ds-brand-300); background: var(--ds-surface); min-height: 0; }
.im-drop.is-invalid { border-color: var(--ds-danger); background: var(--ds-danger-bg); }
/* الـ input يغطّي المنطقة: النقر والإفلات عليه نفسه */
.im-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.im-drop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.im-drop-empty .ti { font-size: 34px; color: var(--ds-brand-600); margin-bottom: 4px; }
.im-drop-empty b { font-size: 14px; color: var(--ds-ink); }
.im-drop-empty span { font-size: 12.5px; color: var(--ds-ink-mute); }
.im-drop-file { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; }
.im-drop-file[hidden], .im-drop-empty[hidden] { display: none; }
.im-file-badge {
    flex: none; display: grid; place-items: center;
    width: 42px; height: 42px; border-radius: var(--ds-radius-md);
    background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 800;
}
.im-file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.im-file-meta b { font-size: 13.5px; color: var(--ds-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: end; }
.im-file-meta small { font-size: 12px; color: var(--ds-ink-mute); }
.im-drop-file .ed-link { position: relative; z-index: 2; }
.im-drop-error { margin-top: 6px; font-size: 12.5px; color: var(--ds-danger); }
.im-drop-error[hidden] { display: none; }

.im-guide { margin-top: 14px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface); }
.im-guide summary {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px; cursor: pointer; list-style: none;
    font-size: 13px; font-weight: 600; color: var(--ds-ink-soft);
}
.im-guide summary::-webkit-details-marker { display: none; }
.im-guide summary::after { content: "\ea5f"; font-family: "tabler-icons"; margin-inline-start: auto; transition: transform var(--ds-dur-fast) var(--ds-ease); }
.im-guide[open] summary::after { transform: rotate(180deg); }
.im-guide table { width: 100%; font-size: 12.5px; border-top: 1px solid var(--ds-border); }
.im-guide th { padding: 8px 14px; font-weight: 600; color: var(--ds-ink-mute); text-align: start; background: var(--ds-surface-sunk); }
.im-guide td { padding: 8px 14px; border-top: 1px solid var(--ds-border); color: var(--ds-ink-soft); vertical-align: top; }
.im-guide code { padding: 1px 6px; border-radius: 5px; background: var(--ds-surface-sunk); color: var(--ds-ink); font-size: 12px; }
.im-req, .im-opt { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: var(--ds-radius-pill); white-space: nowrap; }
.im-req { background: var(--ds-brand-50); color: var(--ds-brand-600); }
.im-opt { background: var(--ds-surface-sunk); color: var(--ds-ink-mute); }
.im-specs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 10px 14px; border-top: 1px solid var(--ds-border); font-size: 12px; color: var(--ds-ink-mute); }
.im-spec { padding: 2px 9px; border-radius: var(--ds-radius-pill); border: 1px solid var(--ds-border); color: var(--ds-ink-soft); }
[data-import-submit].is-saving .ed-spinner { display: inline-block; }
[data-import-submit].is-saving .ti-upload { display: none; }

@media (max-width: 575.98px) {
    .im-steps { grid-template-columns: 1fr; }
    .ed-foot { flex-wrap: wrap; }
    .ed-foot .ed-changes { flex-basis: 100%; }
}

/* الاستيراد على الجوال: كل عمود بطاقة — الاسم وشارته، ثم الشرح تحتهما */
@media (max-width: 575.98px) {
    .im-guide thead { display: none; }
    .im-guide tr { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; padding: 10px 14px; border-top: 1px solid var(--ds-border); }
    .im-guide td { padding: 0; border: 0; }
    .im-guide td:nth-child(3) { grid-column: 1 / -1; }
    .im-file-meta small { text-align: end; }
}

/* رأس نافذة الاستيراد بسطرين: Tabler يثبّت ارتفاع الرأس فيُقصّ العنوان */
.im-modal .modal-header { height: auto; min-height: 3.5rem; padding-top: 16px; padding-bottom: 14px; }

/* ==================== التخصصات — لوحة جاهزية ====================
   لكل تخصص لونه الثابت من ‎--h‎ (كأدوار الفريق)، ومقاييس بأشرطة تجيب أسئلة
   الفصل: كم بلا فريق، وكم مقعداً متاحاً، وكم مشروعاً يجري. */
.sp-summary {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px; background: var(--ds-border);
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    overflow: hidden;
}
.sp-sum { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--ds-surface); color: inherit; }
a.sp-sum:hover { background: var(--ds-surface-sunk); color: inherit; }
.sp-sum-n { font-family: var(--ds-font-display); font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.sp-sum-n small { font-size: 14px; font-weight: 600; color: var(--ds-ink-mute); }
.sp-sum-l { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ds-ink-mute); }
.sp-sum.is-ok .sp-sum-l { color: var(--ds-success); }
.sp-sum.is-warn .sp-sum-l, .sp-sum.is-warn .sp-sum-n { color: #b45309; }
.sp-sum.is-bad .sp-sum-n { color: var(--ds-danger); }

.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }

.sp-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    overflow: hidden;
    transition: border-color var(--ds-dur-fast) var(--ds-ease), box-shadow var(--ds-dur-fast) var(--ds-ease);
}
.sp-card:hover { border-color: var(--ds-border-strong); box-shadow: 0 10px 30px -18px rgba(9, 9, 11, .25); }
.sp-card.is-incomplete { border-color: #fde68a; }
.sp-card.is-archived { background: var(--ds-surface-sunk); }
.sp-card.is-archived .sp-mono { filter: grayscale(1); opacity: .6; }

.sp-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 16px 14px;
    background: linear-gradient(180deg, hsl(var(--h) 80% 97%), transparent);
}
.sp-mono {
    flex: none; display: grid; place-items: center;
    width: 42px; height: 42px; border-radius: 12px;
    background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 30%);
    border: 1px solid hsl(var(--h) 55% 85%);
    font-family: var(--ds-font-display); font-size: 19px; font-weight: 800;
}
.sp-title { flex: 1; min-width: 0; }
.sp-title h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ds-ink); line-height: 1.5; }
.sp-state { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--ds-success); }
.is-incomplete .sp-state { color: #b45309; }
.is-archived .sp-state { color: var(--ds-ink-mute); }
.sp-head .dropdown-menu { min-width: 200px; }
.sp-head .dropdown-item { font-size: 13px; }
.sp-head form { margin: 0; }

.sp-metrics {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px; background: var(--ds-border);
    border-top: 1px solid var(--ds-border); border-bottom: 1px solid var(--ds-border);
}
.sp-metric { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--ds-surface); color: inherit; min-width: 0; }
.sp-metric:hover { background: var(--ds-surface-sunk); color: inherit; }
.is-archived .sp-metric { background: var(--ds-surface-sunk); }
.sp-metric-top { display: flex; align-items: baseline; gap: 5px; }
.sp-metric-n { font-family: var(--ds-font-display); font-size: 22px; font-weight: 800; line-height: 1; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.sp-metric-l { font-size: 12px; color: var(--ds-ink-mute); }
.sp-metric-sub { font-size: 11.5px; color: var(--ds-ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-bar { display: block; height: 5px; border-radius: 99px; background: var(--ds-surface-sunk); overflow: hidden; }
.sp-bar span { display: block; height: 100%; border-radius: 99px; background: hsl(var(--h) 60% 45%); }
.sp-bar.is-seats span { background: var(--ds-accent); }
.sp-metric.is-bad .sp-metric-sub { color: var(--ds-danger); font-weight: 600; }
.sp-metric.is-bad .sp-bar span { background: var(--ds-danger); }

.sp-callout {
    display: flex; align-items: center; gap: 8px;
    margin: 12px 16px 0; padding: 9px 12px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
    font-size: 12.5px; font-weight: 600; color: var(--ds-ink-soft);
}
.sp-callout .ti:first-child { font-size: 17px; color: var(--ds-ink-mute); }
.sp-callout .ti:last-child { margin-inline-start: auto; color: var(--ds-ink-mute); }
.sp-callout:hover { background: var(--ds-brand-50); color: var(--ds-brand-600); }

.sp-types { padding: 12px 16px 14px; }
.sp-types-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; color: var(--ds-ink-mute); }
.sp-types-head a { font-size: 12px; letter-spacing: 0; }
.sp-type { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.sp-type + .sp-type { border-top: 1px dashed var(--ds-border); }
.sp-type-name { font-weight: 600; color: var(--ds-ink); min-width: 0; }
.sp-type-size { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.sp-type-count { min-width: 64px; padding: 1px 8px; border-radius: var(--ds-radius-pill); background: var(--ds-surface-sunk); font-size: 11.5px; font-weight: 600; color: var(--ds-ink-soft); text-align: center; }
.sp-type-empty {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 12px; border: 1px dashed #fcd34d; border-radius: var(--ds-radius-md);
    background: var(--ds-warning-bg); font-size: 12.5px; font-weight: 600; color: #92400e;
}

.sp-warn {
    display: flex; gap: 8px;
    margin: 0 16px 14px; padding: 10px 12px;
    border: 1px solid #fde68a; border-radius: var(--ds-radius-md);
    background: var(--ds-warning-bg);
    font-size: 12.5px; line-height: 1.7; color: #92400e;
}
.sp-warn .ti { font-size: 17px; flex: none; margin-top: 2px; }
.sp-warn-fix { display: flex; gap: 12px; margin-top: 2px; }
.sp-warn-fix a { font-weight: 700; color: #92400e; text-decoration: underline; }
.sp-note { margin: 0 16px 14px; font-size: 12.5px; color: var(--ds-ink-mute); }

.sp-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 220px; padding: 20px;
    border: 2px dashed var(--ds-border-strong); border-radius: var(--ds-radius-lg);
    background: transparent; color: var(--ds-ink-mute); cursor: pointer; text-align: center;
    transition: border-color var(--ds-dur-fast) var(--ds-ease), background-color var(--ds-dur-fast) var(--ds-ease), color var(--ds-dur-fast) var(--ds-ease);
}
.sp-add .ti { font-size: 28px; }
.sp-add b { font-size: 14px; color: var(--ds-ink); }
.sp-add span { font-size: 12px; max-width: 28ch; }
.sp-add:hover { border-color: var(--ds-brand-500); background: var(--ds-brand-50); color: var(--ds-brand-600); }

@media (max-width: 991.98px) {
    .sp-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .sp-grid { grid-template-columns: 1fr; }
    .sp-sum-n { font-size: 22px; }
}

/* ==================== الفصول الدراسية ====================
   الفصل الحالي بمؤشّراته وشريط حالاته، ثم كل الفصول على خطّ زمني واحد:
   لكل فصل حجمه مقارنةً بأكبرها، والجزء الداكن من الشريط ما اكتمل. */
.tm-now {
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background:
        radial-gradient(90% 120% at 100% 0%, var(--ds-success-bg), transparent 55%),
        var(--ds-surface);
    overflow: hidden;
}
.tm-now-head { position: relative; padding: 20px 22px 16px; }
.tm-now-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--ds-success); }
.tm-now-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 6px 0 4px; font-family: var(--ds-font-display); font-size: 26px; font-weight: 800; color: var(--ds-ink); }
.tm-now-name span { font-size: 18px; font-weight: 700; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.tm-now-note { margin: 0; font-size: 13px; color: var(--ds-ink-mute); }
.tm-now-edit { position: absolute; top: 18px; inset-inline-end: 18px; }

.tm-now-kpis {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px; background: var(--ds-border);
    border-top: 1px solid var(--ds-border); border-bottom: 1px solid var(--ds-border);
}
.tm-kpi { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; background: var(--ds-surface); color: inherit; }
a.tm-kpi:hover { background: var(--ds-surface-sunk); color: inherit; }
.tm-kpi-n { font-family: var(--ds-font-display); font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.tm-kpi-l { font-size: 12px; color: var(--ds-ink-mute); }
.tm-kpi.is-warn .tm-kpi-n { color: #b45309; }

.tm-dist { padding: 14px 22px 16px; }
.tm-bar { display: flex; gap: 2px; height: 10px; border-radius: 99px; overflow: hidden; background: var(--ds-surface-sunk); }
.tm-bar span { display: block; height: 100%; }
.tm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.tm-legend a { display: inline-flex; align-items: center; gap: 6px; color: var(--ds-ink-soft); }
.tm-legend a:hover { color: var(--ds-ink); }
.tm-legend b { color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.tm-dot { width: 9px; height: 9px; border-radius: 3px; }

.tm-count { margin-inline-start: 6px; padding: 0 8px; border-radius: var(--ds-radius-pill); background: var(--ds-surface-sunk); font-size: 12px; font-weight: 600; color: var(--ds-ink-mute); }

.tm-line { position: relative; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); padding: 6px 18px; }
.tm-row { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; }
.tm-row:not(:last-child)::before {
    content: ""; position: absolute;
    inset-inline-start: 17px; top: 50px; bottom: -14px;
    width: 2px; background: var(--ds-border);
}
.tm-node {
    position: relative; z-index: 1;
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--ds-surface-sunk); color: var(--ds-ink-mute);
    box-shadow: 0 0 0 4px var(--ds-surface);
    font-size: 17px;
}
.tm-row.is-active .tm-node { background: var(--ds-success); color: #fff; box-shadow: 0 0 0 4px var(--ds-surface), 0 0 0 7px var(--ds-success-bg); }
.tm-body { min-width: 0; padding-top: 4px; }
.tm-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.tm-title h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ds-ink); }
.tm-year { font-size: 13px; font-weight: 600; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.tm-badge { padding: 1px 8px; border-radius: var(--ds-radius-pill); background: var(--ds-success-bg); color: var(--ds-success); font-size: 11.5px; font-weight: 700; }
.tm-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12.5px; color: var(--ds-ink-mute); }
.tm-fact b { color: var(--ds-ink); font-variant-numeric: tabular-nums; margin-inline-end: 2px; }
a.tm-fact:hover { color: var(--ds-brand-600); }
.tm-size { display: block; max-width: 420px; height: 6px; margin-top: 10px; border-radius: 99px; background: var(--ds-surface-sunk); overflow: hidden; }
.tm-size > span { display: block; height: 100%; border-radius: 99px; background: var(--ds-border-strong); }
.tm-size > span > span { display: block; height: 100%; border-radius: 99px; background: var(--ds-accent); }
.tm-row.is-active .tm-size > span > span { background: var(--ds-success); }
.tm-empty { margin: 4px 0 0; font-size: 12.5px; color: var(--ds-ink-mute); }
.tm-actions { display: flex; align-items: center; gap: 6px; padding-top: 2px; }
.tm-actions .dropdown-item { font-size: 13px; }

/* نافذة التفعيل: الأرقام تحت كل جانب، والتأكيد الصريح */
.term-switch-side small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ds-ink-mute); }
.tm-confirm {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 14px 0 0; padding: 12px 14px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
    font-size: 13px; color: var(--ds-ink-soft); cursor: pointer;
}
.tm-confirm .form-check-input { flex: none; margin-top: 3px; }
.tm-confirm b { color: var(--ds-ink); }

@media (max-width: 767.98px) {
    .tm-now-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tm-row { grid-template-columns: 36px minmax(0, 1fr); }
    .tm-actions { grid-column: 2; }
    .tm-now-name { font-size: 22px; }
}

/* ==================== أنواع المشاريع ====================
   لكل نوع: مداه نقاطاً (الممتلئة داخل الحدّين)، وتوزيع أحجام فرقه الفعلية
   أعمدةً على المقياس نفسه — والخارج عن الحدود بلون تحذير. */
.pt-tabs {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    padding: 4px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
}
.pt-tabs::-webkit-scrollbar { display: none; }
.pt-tab {
    flex: none; display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: var(--ds-radius-md);
    font-size: 13px; font-weight: 600; color: var(--ds-ink-mute); white-space: nowrap;
}
.pt-tab:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
.pt-tab.is-active { background: var(--ds-accent); color: var(--ds-surface); }
.pt-tab-n { min-width: 20px; padding: 0 6px; border-radius: var(--ds-radius-pill); background: var(--ds-surface-sunk); color: var(--ds-ink-soft); font-size: 11.5px; text-align: center; }
.pt-tab.is-active .pt-tab-n { background: rgba(255, 255, 255, .18); color: inherit; }
.pt-tab-n.is-zero { background: var(--ds-warning-bg); color: #b45309; }

.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.pt-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface); overflow: hidden;
}
.pt-card.has-outside { border-color: #fde68a; }
.pt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.pt-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ds-ink); }
.pt-head .dropdown-item { font-size: 13px; }

.pt-range { display: flex; align-items: center; gap: 12px; padding: 4px 16px 14px; }
.pt-dots { display: inline-flex; gap: 4px; }
.pt-dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ds-border-strong); background: var(--ds-surface); }
.pt-dots i.is-in { border-color: var(--ds-accent); background: var(--ds-accent); }
.pt-dots.is-lg i { width: 18px; height: 18px; }
.pt-range-text { font-size: 12.5px; color: var(--ds-ink-mute); }
.pt-range-text b { color: var(--ds-ink); font-variant-numeric: tabular-nums; }

.pt-sizes { padding: 12px 16px; border-top: 1px solid var(--ds-border); }
.pt-sizes-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; color: var(--ds-ink-mute); }
.pt-hist { display: flex; align-items: flex-end; gap: 4px; height: 92px; }
.pt-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; min-width: 0; }
.pt-col-bar { width: 100%; max-width: 28px; border-radius: 5px 5px 2px 2px; background: var(--ds-accent); }
.pt-col.is-out .pt-col-bar { background: #f59e0b; }
.pt-col-n { font-size: 11px; font-weight: 700; color: var(--ds-ink-soft); font-variant-numeric: tabular-nums; }
.pt-col.is-out .pt-col-n { color: #b45309; }
.pt-col-x { font-size: 11px; color: var(--ds-ink-mute); border-top: 1px solid var(--ds-border); width: 100%; text-align: center; padding-top: 2px; }
.pt-none { margin: 0; font-size: 12.5px; color: var(--ds-ink-mute); }

.pt-outside {
    display: flex; align-items: flex-start; gap: 7px;
    margin: 0 16px 12px; padding: 9px 12px;
    border: 1px solid #fde68a; border-radius: var(--ds-radius-md);
    background: var(--ds-warning-bg);
    font-size: 12.5px; line-height: 1.7; color: #92400e;
}
.pt-outside .ti { font-size: 16px; flex: none; margin-top: 2px; }
.pt-foot { margin-top: auto; padding: 11px 16px; border-top: 1px solid var(--ds-border); background: var(--ds-surface-sunk); font-size: 12.5px; color: var(--ds-ink-mute); }
.pt-foot b { color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.pt-foot a { color: var(--ds-ink-soft); }
.pt-foot a:hover { color: var(--ds-brand-600); }

.pt-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 240px; padding: 20px;
    border: 2px dashed var(--ds-border-strong); border-radius: var(--ds-radius-lg);
    background: transparent; color: var(--ds-ink-mute); cursor: pointer;
    transition: border-color var(--ds-dur-fast) var(--ds-ease), background-color var(--ds-dur-fast) var(--ds-ease), color var(--ds-dur-fast) var(--ds-ease);
}
.pt-add .ti { font-size: 28px; }
.pt-add b { font-size: 14px; color: var(--ds-ink); }
.pt-add span { font-size: 12px; }
.pt-add:hover { border-color: var(--ds-brand-500); background: var(--ds-brand-50); color: var(--ds-brand-600); }

/* النافذتان: حدّان بعدّادين، ومعاينة حيّة، وتحذير التعديل */
.pt-range-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-step-field { display: grid; grid-template-columns: auto 34px 1fr 34px; align-items: center; gap: 6px; }
.pt-step-field > span { font-size: 12.5px; color: var(--ds-ink-mute); }
.pt-step-field button {
    display: grid; place-items: center; height: 36px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md);
    background: var(--ds-surface); color: var(--ds-ink-soft); cursor: pointer;
}
.pt-step-field button:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.pt-step-field input { text-align: center; font-weight: 700; -moz-appearance: textfield; }
.pt-step-field input::-webkit-outer-spin-button, .pt-step-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pt-range-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0 8px; padding: 12px 14px; border-radius: var(--ds-radius-md); background: var(--ds-surface-sunk); }
.pt-range-live { font-size: 13px; font-weight: 600; color: var(--ds-ink-soft); }
.pt-range-live.is-bad { color: var(--ds-danger); }
.pt-warn {
    display: flex; align-items: flex-start; gap: 7px;
    margin: 0 0 8px; padding: 9px 12px;
    border: 1px solid #fde68a; border-radius: var(--ds-radius-md);
    background: var(--ds-warning-bg);
    font-size: 12.5px; line-height: 1.7; color: #92400e;
}
.pt-warn[hidden] { display: none; }
.pt-warn .ti { font-size: 16px; flex: none; margin-top: 2px; }

@media (max-width: 575.98px) {
    .pt-grid { grid-template-columns: 1fr; }
    .pt-range-edit { grid-template-columns: 1fr; }
}

/* ==================== أنواع المشاريع — رسم واحد للحدود والفرق ====================
   المدى المسموح منطقة مظلّلة متّصلة خلف الأعمدة؛ العمود داخلها بلون العلامة،
   وخارجها برتقالي. والخلاصة سطر تحت الرسم يقول ما يعنيه التوزيع. */
.pt-summary {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px; background: var(--ds-border);
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); overflow: hidden;
}
.pt-sum { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; background: var(--ds-surface); }
.pt-sum b { font-family: var(--ds-font-display); font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.pt-sum span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ds-ink-mute); }
.pt-sum.is-warn b, .pt-sum.is-warn span { color: #b45309; }
.pt-sum.is-ok span { color: var(--ds-success); }

.pt-help { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface); }
.pt-help summary { display: flex; align-items: center; gap: 7px; padding: 9px 14px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--ds-ink-mute); width: max-content; }
.pt-help summary::-webkit-details-marker { display: none; }
.pt-help summary:hover { color: var(--ds-ink); }
.pt-help p { margin: 0; padding: 0 14px 12px; font-size: 13px; line-height: 1.85; color: var(--ds-ink-soft); }

.pt-head { padding: 16px 16px 2px; }
.pt-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0 16px 14px; font-size: 12.5px; color: var(--ds-ink-mute); }
.pt-limit {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: var(--ds-radius-pill);
    background: var(--ds-brand-50); color: var(--ds-brand-700, #1d4ed8);
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}

.pt-chart { display: flex; align-items: stretch; height: 120px; margin: 0 16px; border-bottom: 1px solid var(--ds-border); }
.pt-c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 8px 6px 0; min-width: 0; }
.pt-c.is-allowed { background: var(--ds-brand-50); }
.pt-c.is-first { border-start-start-radius: 10px; }
.pt-c.is-last { border-start-end-radius: 10px; }
.pt-c-bar { width: 100%; max-width: 30px; border-radius: 6px 6px 0 0; background: var(--ds-brand-600); transition: height .6s var(--ds-ease); }
.pt-c.is-out .pt-c-bar { background: #f59e0b; }
.pt-c-n { font-size: 12px; font-weight: 800; color: var(--ds-ink); font-variant-numeric: tabular-nums; min-height: 16px; }
.pt-c.is-out .pt-c-n { color: #b45309; }
.pt-axis { display: flex; margin: 0 16px; }
.pt-axis span { flex: 1; padding-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--ds-ink-mute); text-align: center; font-variant-numeric: tabular-nums; }
.pt-axis-note { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 6px 16px 0; font-size: 11px; color: var(--ds-ink-mute); }
.pt-axis-note > span:first-child { margin-inline-end: auto; }
.pt-key { display: inline-flex; align-items: center; gap: 5px; }
.pt-key i { width: 10px; height: 10px; border-radius: 3px; }
.pt-key i.is-allowed { background: var(--ds-brand-50); border: 1px solid var(--ds-brand-200); }
.pt-key i.is-out { background: #f59e0b; }

.pt-insight {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 12px 16px 14px; padding: 9px 12px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-sunk);
    font-size: 12.5px; font-weight: 600; line-height: 1.7; color: var(--ds-ink-soft);
}
.pt-insight .ti { font-size: 16px; flex: none; margin-top: 2px; color: var(--ds-brand-600); }
.pt-insight.is-warn { background: var(--ds-warning-bg); border: 1px solid #fde68a; color: #92400e; }
.pt-insight.is-warn .ti { color: #b45309; }
.pt-insight.is-muted { font-weight: 500; color: var(--ds-ink-mute); }
.pt-insight.is-muted .ti { color: var(--ds-ink-mute); }

.pt-foot { background: transparent; padding: 10px 16px; font-size: 12.5px; }
.pt-foot a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

.pt-add {
    flex-direction: row; justify-content: flex-start; gap: 14px;
    min-height: 0; padding: 18px 20px; text-align: start;
    border-width: 1.5px;
}
.pt-add-icon {
    flex: none; display: grid; place-items: center;
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--ds-surface-sunk); color: var(--ds-ink-soft);
}
.pt-add-icon .ti { font-size: 20px; }
.pt-add b { display: block; }
.pt-add small { display: block; margin-top: 2px; font-size: 12px; color: var(--ds-ink-mute); }
.pt-add:hover .pt-add-icon { background: var(--ds-brand-600); color: #fff; }

@media (max-width: 767.98px) {
    .pt-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* مبدّل اللغة في صفحة الدخول — يتبع اختيار الزائر في الموقع */
.auth-lang {
    margin-inline-start: auto;
    min-width: 40px; height: 32px; padding: 0 10px;
    border: 1px solid var(--auth-line); border-radius: 99px;
    background: transparent; color: var(--auth-text);
    font-family: var(--ds-font-display); font-size: 13px; font-weight: 700;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.auth-lang:hover { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.auth-lang:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* ==================== اللوحات على الجوال ====================
   ١) الفلاتر مطوية خلف «تصفية» — ٢) صفوف الجداول بطاقات —
   ٣) أهداف لمس لا تقلّ عن 40px. السلوك في public/js/dashboard-mobile.js */
.filter-toggle { display: none; }

@media (max-width: 768px) {
    .filter-form.is-collapsible .filter-toggle {
        display: inline-flex; align-items: center; gap: 8px;
        flex: 1 1 100%; justify-content: flex-start;
        height: 42px; padding: 0 14px;
        border: 1px solid var(--ds-border); border-radius: 10px;
        background: var(--ds-surface); color: var(--ds-ink-soft);
        font-weight: 600; font-size: 13.5px;
    }
    .filter-toggle .filter-toggle-caret { margin-inline-start: auto; transition: transform var(--ds-dur-fast) ease; }
    .filter-form.is-open .filter-toggle { border-color: var(--ds-brand-200); color: var(--ds-accent-strong); background: var(--ds-accent-soft); }
    .filter-form.is-open .filter-toggle-caret { transform: rotate(180deg); }
    .filter-toggle-count {
        display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
        border-radius: 99px; background: var(--ds-accent); color: #fff; font-size: 11.5px; font-weight: 700;
    }
    .filter-form.is-collapsible:not(.is-open) [data-filter-more] { display: none !important; }

    /* تبويبات الحالة سطر واحد يُمرَّر أفقياً بدل ثلاثة أسطر */
    .filter-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .filter-tabs::-webkit-scrollbar { display: none; }
    .filter-tab { white-space: nowrap; flex: none; }
}

/* الجدول: كل صف بطاقة، والخلية الأولى عنوانها، وبقية الخلايا «عنوان · قيمة» */
@media (max-width: 640px) {
    .dataTables_wrapper table.table { display: block; width: 100% !important; border: 0; }
    .dataTables_wrapper table.table thead { display: none; }
    .dataTables_wrapper table.table tbody { display: grid; gap: 10px; padding: 0; }
    /* البطاقات تقف وحدها: لا إطار بطاقة حولها فلا يتضاعف الحدّ */
    .card:has(.dataTables_wrapper) { border: 0; background: transparent; box-shadow: none; }
    .card:has(.dataTables_wrapper) .card-body, .card:has(.dataTables_wrapper) .table-responsive { padding: 0; }
    .dataTables_wrapper table.table tbody tr {
        display: block;
        padding: 12px 14px;
        border: 1px solid var(--ds-border); border-radius: 14px;
        background: var(--ds-surface);
    }
    .dataTables_wrapper table.table tbody td {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        width: auto !important; padding: 6px 0 !important;
        border: 0 !important; text-align: start;
    }
    .dataTables_wrapper table.table tbody td::before {
        content: attr(data-label);
        flex: none; max-width: 45%;
        font-size: 12px; font-weight: 600; color: var(--ds-ink-mute);
    }
    .dataTables_wrapper table.table tbody td[data-label=""]::before { display: none; }
    .dataTables_wrapper table.table tbody td:first-child {
        display: block; padding-bottom: 10px !important; margin-bottom: 4px;
        border-bottom: 1px dashed var(--ds-border) !important;
    }
    .dataTables_wrapper table.table tbody td:first-child::before { display: none; }
    /* الإجراءات بلا عنوان تنزل إلى طرف البطاقة */
    .dataTables_wrapper table.table tbody td[data-label=""]:last-child { justify-content: flex-end; padding-top: 10px !important; }
    /* الجدول الفارغ أو «جارٍ التحميل»: خلية واحدة بلا تنسيق البطاقة */
    .dataTables_wrapper table.table tbody td.dataTables_empty { display: block; text-align: center; border-bottom: 0 !important; }
}

/* أهداف اللمس: على الأجهزة اللمسية لا يقلّ الزر عن 40px */
@media (pointer: coarse) {
    .btn-action { min-width: 40px; min-height: 40px; }
    .page-link { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
    .ctx-head-link { min-height: 40px; display: inline-flex; align-items: center; }
    /* مربع المرحلة يبقى صغيراً في شكله، ومساحة النقر حوله أوسع */
    button.ms-check { position: relative; }
    button.ms-check::after { content: ""; position: absolute; inset: -10px; }
    /* روابط «الكل» و«إدارة» النصّية في رؤوس البطاقات */
    .dist-head a, .sp-types-head a { display: inline-flex; align-items: center; min-height: 40px; padding-inline: 8px; }
}

/* ==================== رسائل الاستفسار: فرز وسياق ====================
   مؤشّرات أعلى الصفحة، موضوع مستنتج لكل رسالة، ومن هو المُرسِل في
   المنصّة، وردود جاهزة. الأزرق للفعل، ولكل موضوع لون هادئ. */
.cx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.cx-stat {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface); color: inherit; text-decoration: none; min-width: 0;
}
a.cx-stat { transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease; }
a.cx-stat:hover { border-color: var(--ds-brand-200); box-shadow: 0 8px 20px -16px rgba(37, 99, 235, .5); }
.cx-stat.is-live { border-color: var(--ds-brand-200); background: linear-gradient(180deg, var(--ds-accent-soft), var(--ds-surface) 85%); }
.cx-stat > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cx-stat b { font-size: 22px; font-weight: 800; line-height: 1.2; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.cx-stat b.cx-stat-text { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-stat small { font-size: 12px; color: var(--ds-ink-mute); }
.cx-stat-icon {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--ds-accent-soft); color: var(--ds-accent); font-size: 19px;
}
.cx-stat.is-live .cx-stat-icon { background: var(--ds-accent); color: #fff; }

/* ألوان المواضيع — فاتحة، والنصّ بدرجة أغمق من اللون نفسه */
.is-rose   { --cx-bg: #fff1f2; --cx-fg: #be123c; --cx-bd: #fecdd3; }
.is-amber  { --cx-bg: #fffbeb; --cx-fg: #b45309; --cx-bd: #fde68a; }
.is-blue   { --cx-bg: #eff6ff; --cx-fg: #1d4ed8; --cx-bd: #bfdbfe; }
.is-violet { --cx-bg: #f5f3ff; --cx-fg: #6d28d9; --cx-bd: #ddd6fe; }
.is-teal   { --cx-bg: #f0fdfa; --cx-fg: #0f766e; --cx-bd: #99f6e4; }
.is-green  { --cx-bg: #ecfdf5; --cx-fg: #047857; --cx-bd: #a7f3d0; }
.is-gray   { --cx-bg: #f4f4f5; --cx-fg: #52525b; --cx-bd: #e4e4e7; }
.cx-stat-icon.is-rose, .cx-stat-icon.is-amber, .cx-stat-icon.is-blue, .cx-stat-icon.is-violet,
.cx-stat-icon.is-teal, .cx-stat-icon.is-green, .cx-stat-icon.is-gray { background: var(--cx-bg); color: var(--cx-fg); }

.cx-tag {
    display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
    padding: 2px 8px; border-radius: 99px; margin-top: 6px;
    background: var(--cx-bg, #f4f4f5); color: var(--cx-fg, #52525b);
    font-size: 11px; font-weight: 600;
}
.cx-tag i { font-size: 12px; }

.cx-topics { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cx-topics::-webkit-scrollbar { display: none; }
.cx-topic {
    flex: none; display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 99px; border: 1px solid var(--ds-border);
    background: var(--ds-surface); color: var(--ds-ink-soft); font-size: 12px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    transition: background-color var(--ds-dur-fast) ease, border-color var(--ds-dur-fast) ease;
}
.cx-topic i { color: var(--cx-fg, var(--ds-ink-mute)); font-size: 13px; }
.cx-topic span { font-size: 11px; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.cx-topic:hover { border-color: var(--cx-bd, var(--ds-brand-200)); background: var(--cx-bg, var(--ds-accent-soft)); }
.cx-topic.is-active { border-color: var(--cx-bd, var(--ds-accent)); background: var(--cx-bg, var(--ds-accent)); color: var(--cx-fg, #fff); }
.cx-topic.is-active span { color: inherit; }

/* فواصل الأيام في القائمة */
.cx-day {
    position: sticky; top: 0; z-index: 1;
    padding: 6px 14px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
    color: var(--ds-ink-mute); background: var(--ds-surface-sunk);
    border-bottom: 1px solid var(--ds-border);
}
.cx-day + .inbox-item { border-top: 0; }
.inbox-item-body { display: flex; flex-direction: column; }

/* دور المُرسِل: شارة صغيرة، وصورته الرمزية بلونه */
.cx-role { flex: none; padding: 1px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 700; margin-inline-end: auto; }
.cx-role-student    { background: var(--ds-accent-soft); color: var(--ds-accent-strong); }
.cx-role-supervisor { background: #f5f3ff; color: #6d28d9; }
.cx-role-admin      { background: #ecfdf5; color: #047857; }
.cx-role-guest      { background: var(--ds-surface-sunk); color: var(--ds-ink-mute); }
.msg-avatar.cx-av-supervisor { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.msg-avatar.cx-av-student { background: var(--ds-accent-soft); border-color: var(--ds-brand-100); color: var(--ds-accent-strong); }
.inbox-item.is-unread .msg-avatar { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }

/* القارئ */
.cx-reader-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cx-reader-bar .inbox-back { margin-bottom: 0; }
.cx-nav { display: inline-flex; gap: 4px; margin-inline-start: auto; }
.cx-nav-btn {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
    border: 1px solid var(--ds-border); color: var(--ds-ink-soft); text-decoration: none; background: var(--ds-surface);
    transition: border-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.cx-nav-btn:hover { border-color: var(--ds-brand-200); color: var(--ds-accent); }
.cx-nav-btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.reader-head .cx-tag { margin: 0 0 8px; }
.reader-head .reader-time { display: block; margin-top: 4px; }

.cx-sender {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px; margin-bottom: 18px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface-sunk);
}
.cx-sender .msg-avatar { width: 42px; height: 42px; font-size: 13px; }
.cx-sender-body { flex: 1 1 200px; min-width: 0; }
.cx-sender-name { display: flex; align-items: center; gap: 8px; }
.cx-sender-name b { font-size: 14px; color: var(--ds-ink); }
.cx-sender-name .cx-role { margin: 0; }
.cx-sender-mail { display: flex; align-items: center; gap: 4px; }
.cx-copy {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
    border: 0; background: transparent; color: var(--ds-ink-mute); cursor: pointer;
}
.cx-copy:hover { background: var(--ds-surface); color: var(--ds-accent); }
.cx-copy.is-done { color: #047857; }
.cx-sender-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: 12px; color: var(--ds-ink-mute); }
.cx-sender-meta span + span::before { content: "·"; margin-inline-end: 10px; }
.cx-sender-link {
    display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center;
    max-width: 280px; padding: 9px 12px; border-radius: 12px;
    background: var(--ds-surface); border: 1px solid var(--ds-brand-100); text-decoration: none;
    transition: border-color var(--ds-dur-fast) ease;
}
.cx-sender-link small { grid-column: 1; font-size: 11px; color: var(--ds-ink-mute); }
.cx-sender-link b { grid-column: 1; font-size: 13px; color: var(--ds-accent-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-sender-link i { grid-column: 2; grid-row: 1 / span 2; color: var(--ds-accent); }
.cx-sender-link:hover { border-color: var(--ds-brand-200); }
.cx-sender-link.is-muted { border-style: dashed; border-color: var(--ds-border); background: transparent; }

.cx-bubble {
    padding: 16px 18px; border-radius: 4px 16px 16px 16px;
    background: var(--ds-surface); border: 1px solid var(--ds-border);
    color: var(--ds-ink);
}
[dir="rtl"] .cx-bubble { border-radius: 16px 4px 16px 16px; }

.cx-history { margin: -6px 0 20px; }
.cx-history h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--ds-ink-soft); }
.cx-history h3 span { padding: 0 7px; border-radius: 99px; background: var(--ds-surface-sunk); font-size: 11px; color: var(--ds-ink-mute); }
.cx-history a {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 8px 12px; border: 1px solid var(--ds-border); border-radius: 10px;
    font-size: 13px; color: var(--ds-ink-soft); text-decoration: none;
}
.cx-history a + a { margin-top: 6px; }
.cx-history a:hover { border-color: var(--ds-brand-200); color: var(--ds-accent-strong); }
.cx-history time { flex: none; font-size: 11.5px; color: var(--ds-ink-mute); }

.cx-reply-menu { min-width: 260px; }
.cx-reply-menu .dropdown-header { font-size: 11.5px; }
.cx-suggest { margin-inline-start: auto; padding: 0 7px; border-radius: 99px; background: var(--ds-accent-soft); color: var(--ds-accent-strong); font-size: 10.5px; font-weight: 700; }
.cx-reply-menu .dropdown-item { display: flex; align-items: center; }

.cx-blank-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--ds-accent-soft); color: var(--ds-accent); font-size: 30px; margin-bottom: 6px; }
.cx-keys { margin-top: 10px; font-size: 11.5px; color: var(--ds-ink-mute); }
.cx-keys kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid var(--ds-border); background: var(--ds-surface); color: var(--ds-ink-soft); font-size: 11px; box-shadow: 0 1px 0 var(--ds-border); }

@media (max-width: 991.98px) {
    .cx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cx-stat b.cx-stat-text { white-space: normal; font-size: 14px; line-height: 1.4; }
    /* رسالة مفتوحة على الجوال: القارئ وحده، بلا مؤشّرات فوقه */
    body:has(.inbox-split.has-open) .cx-stats { display: none; }
    .cx-sender-link { max-width: none; flex: 1 1 100%; }
}
@media (pointer: coarse) {
    .cx-nav-btn, .cx-copy { width: 40px; height: 40px; }
    .cx-topic { min-height: 36px; }
}

/* ==================== مجموعات المشرف (الإدارة) ====================
   بطاقة المشرف بسعته، ملخّص، وبطاقة لكل مجموعة بتقدّمها ومرحلتها
   التالية ومشكلاتها وأعضائها — ثم الفصول السابقة. */
.sg-head {
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    padding: 18px 20px; margin-bottom: 14px;
    border: 1px solid var(--ds-brand-100); border-radius: var(--ds-radius-lg);
    background: radial-gradient(90% 120% at 100% 0%, rgba(37, 99, 235, .07), transparent 60%), var(--ds-surface);
}
.sg-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sg-avatar { width: 54px !important; height: 54px !important; font-size: 17px; flex: none; }
.sg-who-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg-who-body > b { font-size: 16px; color: var(--ds-ink); }
.sg-who-body > span { font-size: 12.5px; color: var(--ds-ink-mute); }
.sg-contact { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.sg-contact a { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ds-ink-soft); text-decoration: none; }
.sg-contact a:hover { color: var(--ds-accent); }
.sg-contact i { color: var(--ds-ink-mute); }

.sg-cap { display: flex; align-items: center; gap: 12px; }
.sg-cap-ring {
    width: 52px; height: 52px; border-radius: 50%;
    background:
        radial-gradient(closest-side, var(--ds-surface) calc(100% - 6px), transparent calc(100% - 5px)),
        conic-gradient(var(--ds-accent) calc(var(--p) * 1%), var(--ds-brand-100) 0);
}
.sg-cap.is-over .sg-cap-ring {
    background:
        radial-gradient(closest-side, var(--ds-surface) calc(100% - 6px), transparent calc(100% - 5px)),
        conic-gradient(#e11d48 100%, #fecdd3 0);
}
.sg-cap-text { display: flex; flex-direction: column; }
.sg-cap-text b { font-size: 20px; font-weight: 800; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.sg-cap-text small { font-size: 12px; color: var(--ds-ink-mute); }
.sg-cap.is-over .sg-cap-text small { color: #be123c; font-weight: 600; }

.sg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sg-stats > div {
    display: flex; flex-direction: column; padding: 12px 16px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface);
}
.sg-stats b { font-size: 22px; font-weight: 800; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.sg-stats small { font-size: 12px; color: var(--ds-ink-mute); }
.sg-stats .is-warn { border-color: #fde68a; background: #fffbeb; }
.sg-stats .is-warn b { color: #b45309; }

.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sg-card {
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px 18px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur) ease;
}
.sg-card:hover { border-color: var(--ds-brand-200); box-shadow: 0 16px 32px -26px rgba(37, 99, 235, .5); }
.sg-card.has-issues { border-inline-start: 3px solid #f59e0b; }
.sg-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sg-title { display: block; font-size: 15px; font-weight: 700; color: var(--ds-ink); text-decoration: none; line-height: 1.5; }
.sg-title:hover { color: var(--ds-accent); }
.sg-type { font-size: 12px; color: var(--ds-ink-mute); }

.sg-progress { display: flex; flex-direction: column; gap: 6px; }
.sg-bar { display: block; height: 7px; border-radius: 99px; background: var(--ds-brand-100); overflow: hidden; }
.sg-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ds-accent); }
.sg-progress-text { font-size: 12px; color: var(--ds-ink-mute); }
.sg-progress-text b { color: var(--ds-ink); }

.sg-next {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 9px 11px; border-radius: 10px; background: var(--ds-surface-sunk);
    font-size: 12.5px; color: var(--ds-ink-soft); line-height: 1.6;
}
.sg-next i { margin-top: 2px; color: var(--ds-accent); }
.sg-next b { color: var(--ds-ink); }
.sg-next.is-late { background: #fff1f2; color: #9f1239; }
.sg-next.is-late i, .sg-next.is-late b { color: #be123c; }

.sg-issues { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-issue {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px;
    background: #fffbeb; border: 1px solid #fde68a; color: #b45309; font-size: 11.5px; font-weight: 600;
}

.sg-members {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding-top: 12px; margin-top: auto; border-top: 1px dashed var(--ds-border);
}
.sg-member { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ds-ink-soft); }
.sg-member-av { width: 26px !important; height: 26px !important; font-size: 10px; }
.sg-member em { margin-inline-start: 4px; padding: 0 6px; border-radius: 99px; background: var(--ds-accent-soft); color: var(--ds-accent-strong); font-style: normal; font-size: 10.5px; font-weight: 700; }
.sg-open {
    margin-inline-start: auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
    border: 1px solid var(--ds-border); color: var(--ds-ink-soft); text-decoration: none;
}
.sg-open:hover { border-color: var(--ds-brand-200); color: var(--ds-accent); }

.sg-past { margin-top: 22px; }
.sg-past h2 { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ds-ink-soft); margin: 0 0 10px; }
.sg-past-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-past-list a {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px;
    border: 1px solid var(--ds-border); background: var(--ds-surface); text-decoration: none;
    font-size: 13px; color: var(--ds-ink-soft);
}
.sg-past-list a b { color: var(--ds-accent-strong); font-size: 12.5px; }
.sg-past-list a:hover { border-color: var(--ds-brand-200); }

@media (max-width: 991.98px) {
    .sg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .sg-grid { grid-template-columns: 1fr; }
    .sg-head { padding: 16px; }
}
@media (pointer: coarse) {
    .sg-open { width: 40px; height: 40px; }
}

/* ==================== المناقشات (الإدارة) ====================
   مؤشّرات، ثم تبويبات: بانتظار الجدولة بطاقاتٍ، والقادمة أجندةً باليوم
   بوقت كل مناقشة ومكانها ولجنتها، والسابقة سطوراً. */
.df-count { margin-inline-start: 6px; padding: 0 7px; border-radius: 99px; background: var(--ds-accent-soft); color: var(--ds-accent-strong); font-size: 11.5px; font-weight: 700; }

.df-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.df-stat {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-width: 0;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface);
    color: inherit; text-decoration: none; text-align: start; font: inherit;
}
a.df-stat, button.df-stat { cursor: pointer; transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease; }
a.df-stat:hover, button.df-stat:hover { border-color: var(--ds-brand-200); box-shadow: 0 8px 20px -16px rgba(37, 99, 235, .5); }
.df-stat.is-live { border-color: var(--ds-brand-200); background: linear-gradient(180deg, var(--ds-accent-soft), var(--ds-surface) 85%); }
.df-stat > span:last-child { display: flex; flex-direction: column; }
.df-stat b { font-size: 22px; font-weight: 800; line-height: 1.2; color: var(--ds-ink); font-variant-numeric: tabular-nums; }
.df-stat small { font-size: 12px; color: var(--ds-ink-mute); }
.df-stat-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ds-accent-soft); color: var(--ds-accent); font-size: 19px; }
.df-stat.is-live .df-stat-icon { background: var(--ds-accent); color: #fff; }

.df-note {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px;
    border-radius: 12px; border: 1px solid var(--ds-brand-100); background: var(--ds-accent-soft);
    font-size: 13px; color: var(--ds-accent-strong);
}

.df-title { display: block; font-size: 15px; font-weight: 700; color: var(--ds-ink); text-decoration: none; line-height: 1.5; }
a.df-title:hover { color: var(--ds-accent); }
.df-sub { display: block; font-size: 12.5px; color: var(--ds-ink-mute); line-height: 1.6; }
.df-av { width: 24px !important; height: 24px !important; font-size: 9.5px; }

/* بانتظار الجدولة */
.df-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.df-card {
    display: flex; flex-direction: column; gap: 12px; padding: 16px 18px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface);
    border-inline-start: 3px solid var(--ds-accent);
}
.df-team { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.df-team > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ds-ink-soft); }
.df-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.df-facts > span {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
    background: var(--ds-surface-sunk); font-size: 11.5px; color: var(--ds-ink-soft);
}
.df-facts > span.is-warn { background: #fffbeb; color: #b45309; }
.df-card footer { margin-top: auto; }

/* القادمة: أجندة */
.df-day { margin-bottom: 18px; }
.df-day-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 15px; font-weight: 800; color: var(--ds-ink); }
.df-day-title small { font-size: 12px; font-weight: 500; color: var(--ds-ink-mute); }
.df-agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.df-slot {
    display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 16px; align-items: center;
    padding: 14px 16px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface);
}
.df-slot.is-live { border-color: var(--ds-brand-200); box-shadow: 0 0 0 4px var(--ds-accent-soft); }
.df-time {
    display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px;
    background: var(--ds-accent-soft); color: var(--ds-accent-strong);
}
.df-time b { font-size: 17px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.df-time small { font-size: 11.5px; opacity: .8; font-variant-numeric: tabular-nums; }
.df-time em { font-style: normal; font-size: 10.5px; margin-top: 2px; opacity: .75; }
.df-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.df-mode, .df-member {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px;
    font-size: 12px; color: var(--ds-ink-soft); background: var(--ds-surface-sunk);
}
[dir="rtl"] .df-mode, [dir="rtl"] .df-member { padding: 3px 4px 3px 10px; }
.df-mode { padding: 3px 10px !important; font-weight: 600; }
.df-mode.is-in_person { background: #f0fdfa; color: #0f766e; }
.df-mode.is-online { background: var(--ds-accent-soft); color: var(--ds-accent-strong); }
.df-mode.is-hybrid { background: #f5f3ff; color: #6d28d9; }
.df-member em { font-style: normal; font-size: 10.5px; color: var(--ds-ink-mute); }
.df-actions { display: flex; align-items: center; gap: 6px; }

/* السابقة */
.df-past { display: flex; flex-direction: column; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); overflow: hidden; }
.df-past-row {
    position: relative; display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1.2fr) auto 34px; gap: 14px; align-items: center;
    padding: 12px 16px; text-decoration: none; color: inherit;
}
/* رابط العنوان يغطّي الصفّ، وزر المحضر فوقه */
.df-past-link { color: inherit; text-decoration: none; }
.df-past-link::after { content: ''; position: absolute; inset: 0; }
.df-past-link:focus-visible { outline: 0; }
.df-past-link:focus-visible::after { outline: 2px solid var(--ds-accent); outline-offset: -2px; }
.df-past-minutes { position: relative; z-index: 1; }
.df-past-row + .df-past-row { border-top: 1px solid var(--ds-border); }
.df-past-row:hover { background: var(--ds-surface-sunk); }
.df-past-row b { font-size: 13.5px; color: var(--ds-ink); }
.df-past-date { font-size: 12px; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.df-status { padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.df-status.is-done { background: #ecfdf5; color: #047857; }
.df-status.is-wait { background: #fffbeb; color: #b45309; }
.df-status.is-muted { background: var(--ds-surface-sunk); color: var(--ds-ink-mute); }

/* نافذة الجدولة */
.df-form .modal-header { align-items: flex-start; }
.df-form-project { margin-top: 4px; font-size: 12.5px; color: var(--ds-ink-mute); }
.df-fieldset { margin-bottom: 18px; padding: 14px 16px 16px; border: 1px solid var(--ds-border); border-radius: 14px; }
.df-fieldset legend { float: none; width: auto; margin: 0; padding: 0 6px; font-size: 12.5px; font-weight: 800; color: var(--ds-accent-strong); }
.df-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.df-mode-opt { position: relative; margin: 0; cursor: pointer; }
.df-mode-opt input { position: absolute; opacity: 0; inset: 0; }
.df-mode-opt span {
    display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px;
    border: 1px solid var(--ds-border); border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--ds-ink-soft);
    transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease;
}
.df-mode-opt input:checked + span { border-color: var(--ds-accent); background: var(--ds-accent-soft); color: var(--ds-accent-strong); }
.df-mode-opt input:focus-visible + span { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.df-when + .df-when { margin-top: 14px; }
.df-when[hidden] { display: none; }
.df-link-row { display: flex; gap: 8px; }
.df-link-row .form-control { flex: 1; }
.df-meet { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.df-committee { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.df-committee-fixed { padding: 10px 12px; border-radius: 12px; background: var(--ds-surface-sunk); }
.df-committee-fixed small { display: block; font-size: 11.5px; color: var(--ds-ink-mute); }
.df-committee-fixed b { font-size: 14px; color: var(--ds-ink); }
.df-foot-note { margin-inline-end: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ds-ink-mute); }

/* القاعات */
.df-room-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--ds-border); }
.df-room-add .form-control:first-of-type { flex: 1 1 100%; }
.df-room-add .form-control { flex: 1 1 120px; }
.df-room { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.df-room + .df-room { border-top: 1px dashed var(--ds-border); }
.df-room.is-off { opacity: .6; }
.df-room form { margin: 0; }
.df-room-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #f0fdfa; color: #0f766e; }
.df-room-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.df-room-body b { font-size: 13.5px; color: var(--ds-ink); }
.df-room-body small { font-size: 12px; color: var(--ds-ink-mute); }

@media (max-width: 991.98px) {
    .df-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .df-past-row { grid-template-columns: minmax(0, 1fr) auto 34px; }
    .df-past-row .df-sub, .df-past-row .df-past-date { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .df-slot { grid-template-columns: 64px minmax(0, 1fr); }
    .df-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .df-committee { grid-template-columns: 1fr; }
    .df-link-row { flex-direction: column; }
    .df-modes { grid-template-columns: 1fr; }
}

/* شريحة المناقشة في بطاقة الطالب: رابط الاجتماع وإضافتها إلى التقويم */
.hero-defense-links { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.upcoming-item.is-defense .upcoming-title i { color: var(--ds-accent); margin-inline-end: 2px; }

/* ==================== مناقشاتي (المشرف والممتحن) ==================== */
.dsv-block { margin-bottom: 22px; }
.dsv-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 800; color: var(--ds-ink); }
.dsv-title span { padding: 0 8px; border-radius: 99px; background: var(--ds-surface-sunk); font-size: 12px; color: var(--ds-ink-mute); }
.dsv-title.is-warn i { color: #b45309; }
.dsv-title.is-warn span { background: #fffbeb; color: #b45309; }
a.df-slot { text-decoration: none; color: inherit; }
.dsv-slot.is-warn { border-color: #fde68a; background: linear-gradient(90deg, #fffbeb, var(--ds-surface) 60%); }
[dir="rtl"] .dsv-slot.is-warn { background: linear-gradient(270deg, #fffbeb, var(--ds-surface) 60%); }
.dsv-role { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.dsv-role.is-supervisor { background: var(--ds-accent-soft); color: var(--ds-accent-strong); }
.dsv-role.is-examiner { background: #f5f3ff; color: #6d28d9; }

.dsv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.dsv-main, .dsv-side { display: flex; flex-direction: column; gap: 14px; }
.dsv-side { position: sticky; top: 76px; }
.dsv-card { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); padding: 16px 18px; }
.dsv-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dsv-card-head > span:first-child { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 800; color: var(--ds-ink); }
.dsv-card-head > span:first-child i { color: var(--ds-accent); }
.dsv-progress { font-size: 12px; color: var(--ds-ink-mute); }

.dsv-grade { border-color: var(--ds-brand-200); background: radial-gradient(90% 120% at 100% 0%, rgba(37, 99, 235, .06), transparent 60%), var(--ds-surface); }
.dsv-final { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--ds-accent); color: #fff; }
.dsv-final > b { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.dsv-final > span { display: flex; flex-direction: column; }
.dsv-final strong { font-size: 13.5px; }
.dsv-final em { font-style: normal; font-size: 12px; opacity: .85; }

.dsv-members { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dsv-members > li:not(.dsv-comment) { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--ds-border); border-radius: 12px; }
.dsv-members > li.is-me { border-color: var(--ds-brand-200); background: var(--ds-accent-soft); }
.dsv-av { width: 32px !important; height: 32px !important; font-size: 11px; }
.dsv-member-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dsv-member-body b { font-size: 13.5px; color: var(--ds-ink); }
.dsv-member-body b em, .dsv-team b em { margin-inline-start: 6px; padding: 0 7px; border-radius: 99px; background: var(--ds-accent); color: #fff; font-style: normal; font-size: 10.5px; }
.dsv-member-body small { font-size: 12px; color: var(--ds-ink-mute); }
.dsv-state { padding: 3px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.dsv-state.is-wait { background: var(--ds-surface-sunk); color: var(--ds-ink-mute); font-weight: 600; }
.dsv-state.is-done { background: #ecfdf5; color: #047857; }
.dsv-comment { display: flex; gap: 6px; margin: -2px 12px 2px; font-size: 12.5px; color: var(--ds-ink-soft); line-height: 1.7; }
.dsv-comment i { color: var(--ds-ink-mute); }
.dsv-blocker { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--ds-surface-sunk); font-size: 13px; color: var(--ds-ink-soft); }

.dsv-form { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding-top: 12px; border-top: 1px dashed var(--ds-border); }
.dsv-form-score input { font-size: 20px; font-weight: 800; text-align: center; }
.dsv-form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.dsv-desc { margin: 0; font-size: 14px; line-height: 1.9; color: var(--ds-ink-soft); }
.dsv-ms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dsv-ms li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; font-size: 13.5px; color: var(--ds-ink-soft); }
.dsv-ms li + li { border-top: 1px solid var(--ds-border); }
.dsv-ms li i { color: var(--ds-ink-mute); }
.dsv-ms li.is-done i { color: #047857; }
.dsv-ms small { font-size: 12px; color: var(--ds-ink-mute); }
.dsv-files { display: flex; flex-direction: column; gap: 8px; }
.dsv-file { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--ds-border); border-radius: 12px; text-decoration: none; color: inherit; }
.dsv-file:hover { border-color: var(--ds-brand-200); }
.dsv-file-ext { display: grid; place-items: center; min-width: 40px; height: 32px; padding: 0 6px; border-radius: 8px; background: #fff1f2; color: #be123c; font-size: 10.5px; font-weight: 800; }
.dsv-file-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dsv-file-body b { font-size: 13.5px; color: var(--ds-ink); }
.dsv-file-body small { font-size: 11.5px; color: var(--ds-ink-mute); }
.dsv-file > i { color: var(--ds-accent); }

.dsv-facts { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.dsv-facts > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.dsv-facts dt { font-weight: 500; color: var(--ds-ink-mute); }
.dsv-facts dd { margin: 0; font-weight: 700; color: var(--ds-ink); text-align: end; }
.dsv-notes { display: flex; gap: 6px; margin: 12px 0 0; padding: 9px 11px; border-radius: 10px; background: var(--ds-accent-soft); font-size: 12.5px; color: var(--ds-accent-strong); line-height: 1.7; }
.dsv-team { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dsv-team li { display: flex; align-items: center; gap: 10px; }
.dsv-team li > span { display: flex; flex-direction: column; min-width: 0; }
.dsv-team b { font-size: 13.5px; color: var(--ds-ink); }
.dsv-team small { font-size: 12px; color: var(--ds-ink-mute); }

/* صفحة المشروع: الدرجة من لجنة المناقشة */
.dsv-committee-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ds-accent-soft); font-size: 13px; color: var(--ds-accent-strong); }
.dsv-committee-note .btn { margin-inline-start: auto; }

@media (max-width: 991.98px) {
    .dsv-grid { grid-template-columns: 1fr; }
    .dsv-side { position: static; }
}
@media (max-width: 560px) {
    .dsv-form { grid-template-columns: 1fr; }
}

/* ==================== «مناقشتك» في لوحة الطالب ==================== */
.sdf {
    border: 1px solid var(--ds-brand-200); border-radius: var(--ds-radius-lg); padding: 18px 20px;
    background: radial-gradient(90% 140% at 100% 0%, rgba(37, 99, 235, .08), transparent 60%), var(--ds-surface);
}
.sdf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sdf-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 800; color: var(--ds-ink); }
.sdf-head h2 i { color: var(--ds-accent); }
.sdf-state { padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--ds-accent-soft); color: var(--ds-accent-strong); }
.sdf-state.is-today, .sdf-state.is-soon { background: #fffbeb; color: #b45309; }
.sdf-state.is-live { background: #ecfdf5; color: #047857; }
.sdf-state.is-done { background: var(--ds-surface-sunk); color: var(--ds-ink-soft); }

.sdf-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sdf-when { display: flex; align-items: center; gap: 14px; }
.sdf-date {
    flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 64px; height: 68px; border-radius: 16px; background: var(--ds-accent); color: #fff;
    box-shadow: 0 12px 24px -16px rgba(37, 99, 235, .9);
}
.sdf-date b { font-size: 26px; font-weight: 800; line-height: 1; }
.sdf-date span { font-size: 12px; opacity: .9; margin-top: 3px; }
.sdf-when-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sdf-when-body strong { font-size: 14.5px; color: var(--ds-ink); }
.sdf-range { font-size: 18px; font-weight: 800; color: var(--ds-accent-strong); font-variant-numeric: tabular-nums; text-align: start; }
.sdf-dur { font-size: 12px; color: var(--ds-ink-mute); }
.sdf-countdown { margin-top: 4px; align-self: flex-start; padding: 2px 10px; border-radius: 99px; background: var(--ds-surface); border: 1px solid var(--ds-brand-100); font-size: 12px; font-weight: 700; color: var(--ds-accent-strong); }
.sdf-countdown:empty { display: none; }

.sdf-where { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sdf-room { display: flex; flex-direction: column; }
.sdf-room b { font-size: 14px; color: var(--ds-ink); }
.sdf-room small { font-size: 12px; color: var(--ds-ink-mute); }

.sdf-committee small { display: block; font-size: 12px; color: var(--ds-ink-mute); margin-bottom: 6px; }
.sdf-committee ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sdf-committee li { display: flex; align-items: center; gap: 8px; }
.sdf-av { width: 30px !important; height: 30px !important; font-size: 10.5px; }
.sdf-committee li > span { display: flex; flex-direction: column; }
.sdf-committee b { font-size: 13px; color: var(--ds-ink); }
.sdf-committee em { font-style: normal; font-size: 11.5px; color: var(--ds-ink-mute); }

.sdf-notes { display: flex; gap: 6px; margin: 14px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--ds-accent-soft); font-size: 13px; color: var(--ds-accent-strong); line-height: 1.7; }
/* العرض التقديمي: صفّ في بطاقة الطالب، وبطاقة أعلى صفحة اللجنة */
.sdf-slides, .dsv-slides { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--ds-border-strong); border-radius: 14px; background: var(--ds-surface); color: inherit; text-decoration: none; }
.sdf-slides { margin-top: 14px; flex-wrap: wrap; }
.dsv-slides { margin-bottom: 16px; }
.sdf-slides.is-ok, .dsv-slides.is-ok { border-style: solid; border-color: #a7f3d0; background: #f0fdf4; }
a.dsv-slides:hover { border-color: #34d399; }
.sdf-slides-icon, .dsv-slides-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ds-surface-sunk); color: var(--ds-ink-mute); font-size: 20px; }
.is-ok > .sdf-slides-icon, .is-ok > .dsv-slides-icon { background: #d1fae5; color: #047857; }
.sdf-slides-body, .dsv-slides-body { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sdf-slides-body b, .dsv-slides-body b { font-size: 14px; color: var(--ds-ink); }
.sdf-slides-body small, .dsv-slides-body small { font-size: 12px; color: var(--ds-ink-mute); line-height: 1.6; }
.sdf-slides-actions { display: flex; align-items: center; gap: 6px; }
.sdf-slides-actions form { margin: 0; }
.sdf-slides-actions input:focus-visible + label { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.df-slides-mark { color: #047857; }
.sdf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--ds-border); }
.sdf-ready { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sdf-ready li { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ds-ink-mute); }
.sdf-ready li.is-ok { color: #047857; }
.sdf-cal { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 991.98px) {
    .sdf-body { grid-template-columns: 1fr 1fr; }
    .sdf-when { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .sdf-body { grid-template-columns: 1fr; }
}

/* ==================== المناقشات: مسار + مخطِّط الأسبوع ====================
   خطّ مراحل يحكي أين يقف كل مشروع، ثم لوحان: قائمة الانتظار باقتراح جاهز
   لكل مشروع (تُسحب بطاقاتها)، وأسبوع الدوام تقويماً لا جدول بيانات — ما
   جُدول كتلاً وما اقتُرح أشباحاً، والمرور على بطاقة يُضيء شبحها. */

/* ---- المسار: أربع محطات على خطّ واحد، بلا صناديق ---- */
.df-pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; padding: 16px 8px 14px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); }
.df-pipe-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 8px; color: inherit; text-decoration: none !important; text-align: center; }
/* الخطّ الواصل إلى المحطة السابقة، من مركز إلى مركز */
.df-pipe-step + .df-pipe-step::before { content: ""; position: absolute; top: 19px; inset-inline-end: 50%; width: 100%; height: 2px; background: var(--ds-border); }
.df-pipe-step.has-items + .df-pipe-step::before { background: linear-gradient(to left, var(--ds-brand-200), var(--ds-border)); }
[dir="ltr"] .df-pipe-step.has-items + .df-pipe-step::before { background: linear-gradient(to right, var(--ds-brand-200), var(--ds-border)); }
.df-pipe-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ds-surface); border: 2px solid var(--ds-border); color: var(--ds-ink-mute); font-size: 18px; box-shadow: 0 0 0 5px var(--ds-surface); transition: transform var(--ds-dur-fast) var(--ds-ease), border-color var(--ds-dur-fast) ease; }
.df-pipe-step:hover .df-pipe-icon { transform: translateY(-2px); border-color: var(--ds-brand-200); }
.df-pipe-body { display: flex; align-items: baseline; gap: 6px; }
.df-pipe-body b { font-size: 20px; font-weight: 800; line-height: 1; color: var(--ds-border-strong); font-variant-numeric: tabular-nums; }
.df-pipe-body small { font-size: 12.5px; font-weight: 600; color: var(--ds-ink-mute); }
.df-pipe-step.has-items .df-pipe-body b { color: var(--ds-ink); }
.df-pipe-step.has-items .df-pipe-body small { color: var(--ds-ink-soft); }
.df-pipe-step.has-items .df-pipe-icon { border-color: var(--ds-accent); color: var(--ds-accent); }
.df-pipe-step.is-grading.has-items .df-pipe-icon { border-color: #f59e0b; color: #b45309; }
.df-pipe-step.is-done.has-items .df-pipe-icon { border-color: #10b981; color: #047857; }
/* ما ينتظر فعلاً من الإدارة: محطة مملوءة */
.df-pipe-step.is-action .df-pipe-icon { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; box-shadow: 0 0 0 5px var(--ds-surface), 0 10px 20px -10px rgba(37, 99, 235, .8); }
.df-pipe-step.is-action .df-pipe-body b { color: var(--ds-accent-strong); }

/* ---- اللوحان ---- */
.df-plan { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.df-queue { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; padding-inline-end: 2px; scrollbar-width: thin; }
.df-queue h2, .df-week-head h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ds-ink); }
.df-queue h2 { display: flex; align-items: center; gap: 6px; }
.df-queue h2 span { padding: 0 8px; border-radius: 99px; background: var(--ds-accent-soft); color: var(--ds-accent-strong); font-size: 12px; }
.df-queue h2 small { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; color: var(--ds-ink-mute); }

.df-queue .df-card { gap: 9px; padding: 12px 14px; border-inline-start-width: 1px; border-inline-start-color: var(--ds-border); cursor: grab; transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur) ease, transform var(--ds-dur) var(--ds-ease); }
.df-queue .df-card:hover, .df-queue .df-card.is-linked { border-color: var(--ds-accent); box-shadow: 0 14px 28px -22px rgba(37, 99, 235, .7); }
.df-queue .df-card.is-dragging { opacity: .45; cursor: grabbing; }
.df-queue .df-card header { display: flex; gap: 6px; align-items: flex-start; }
.df-queue .df-card .df-title { font-size: 14px; }
.df-grip { margin-top: 3px; color: var(--ds-border-strong); font-size: 15px; }
.df-queue .df-card:hover .df-grip { color: var(--ds-accent); }
.df-queue .df-facts { gap: 5px; }
.df-queue .df-facts > span { padding: 2px 8px; font-size: 11.5px; }
.df-queue .df-facts > span.is-person { padding: 2px 8px 2px 3px; color: var(--ds-ink); font-weight: 600; }
[dir="rtl"] .df-queue .df-facts > span.is-person { padding: 2px 3px 2px 8px; }
.df-queue .df-av { width: 20px !important; height: 20px !important; font-size: 8.5px; }

.df-suggest { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--ds-accent-soft); }
.df-suggest-when { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ds-ink); }
.df-suggest-when i { color: var(--ds-accent); }
.df-suggest-when bdi { margin-inline-start: auto; padding: 0 8px; border-radius: 99px; background: var(--ds-surface); font-weight: 800; color: var(--ds-accent-strong); font-variant-numeric: tabular-nums; }
.df-suggest-who { font-size: 12px; color: var(--ds-ink-soft); padding-inline-start: 22px; }
.df-suggest-who em { margin-inline-start: 4px; padding: 0 6px; border-radius: 99px; background: var(--ds-surface); font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--ds-accent-strong); }
.df-queue .df-card footer { display: flex; gap: 6px; margin-top: 0; }
.df-queue .df-card footer form { margin: 0; flex: 1; }
.df-queue .df-card footer form .btn { width: 100%; }
.df-queue .df-card footer .btn { min-height: 34px; padding-block: 0; border-radius: 9px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.df-queue-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; text-align: center; border: 1px dashed var(--ds-border); border-radius: var(--ds-radius-lg); color: var(--ds-ink-mute); font-size: 12.5px; line-height: 1.7; }
.df-queue-empty i { font-size: 26px; color: #047857; }
.df-queue-empty b { font-size: 14px; color: var(--ds-ink); }

/* ---- أسبوع الدوام ---- */
.df-week { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); overflow: hidden; }
.df-week-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 16px; }
.df-week-nav { display: flex; align-items: center; gap: 4px; }
.df-week-nav h2 { margin-inline: 8px 10px; }
.df-nav-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--ds-ink-soft); text-decoration: none; transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease; }
.df-nav-btn:hover { background: var(--ds-accent-soft); color: var(--ds-accent); }
.df-nav-today { padding: 3px 12px; border-radius: 99px; border: 1px solid var(--ds-border); font-size: 12px; font-weight: 600; color: var(--ds-ink-soft); text-decoration: none; }
.df-nav-today:hover { border-color: var(--ds-brand-200); color: var(--ds-accent-strong); }
.df-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ds-ink-mute); }
.df-legend span { display: inline-flex; align-items: center; gap: 6px; }
.df-legend i { width: 9px; height: 9px; border-radius: 3px; }
.df-legend i.is-in_person { background: #0d9488; }
.df-legend i.is-online { background: #2563eb; }
.df-legend i.is-hybrid { background: #7c3aed; }
.df-legend i.is-ghost { border: 1.5px dashed var(--ds-accent); }

/* الكتل جنباً إلى جنب حين تتعدّد القاعات في الوقت نفسه */
.df-cell { position: relative; display: flex; gap: 3px; height: 100%; min-height: 72px; padding: 3px; }
.df-block {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border: 0; border-radius: 9px; text-align: start; cursor: pointer;
    border-inline-start: 3px solid var(--df-c, var(--ds-accent)); background: var(--df-bg, var(--ds-accent-soft)); color: var(--ds-ink);
    font: inherit; transition: box-shadow var(--ds-dur-fast) ease, transform var(--ds-dur-fast) var(--ds-ease);
}
.df-block:hover:not(:disabled) { box-shadow: 0 10px 20px -12px rgba(9, 9, 11, .45); transform: translateY(-1px); }
.df-block:disabled { cursor: default; }
.df-block b { font-size: 12px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.df-block small { font-size: 10.5px; color: var(--ds-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-who { display: flex; margin-top: auto; }
.df-who i { display: grid; place-items: center; width: 18px; height: 18px; margin-inline-end: -4px; border-radius: 50%; border: 1.5px solid var(--df-bg, #fff); background: var(--df-c, var(--ds-accent)); color: #fff; font-style: normal; font-size: 8px; font-weight: 800; }
.df-block.is-in_person { --df-c: #0d9488; --df-bg: #f0fdfa; }
.df-block.is-online { --df-c: #2563eb; --df-bg: #eff6ff; }
.df-block.is-hybrid { --df-c: #7c3aed; --df-bg: #f5f3ff; }
.df-block.is-done { opacity: .6; }
.df-block.is-ghost { border: 1.5px dashed var(--ds-brand-200); background: color-mix(in srgb, var(--ds-accent-soft) 50%, transparent); }
.df-block.is-ghost b { color: var(--ds-accent-strong); }
.df-block.is-ghost small { color: var(--ds-accent); }
.df-block.is-ghost.is-linked, .df-block.is-ghost:hover { border-color: var(--ds-accent); background: var(--ds-accent-soft); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
/* الخانة الفارغة تقول ما يحدث عند النقر */
.df-add {
    flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed transparent; border-radius: 9px;
    background: transparent; color: transparent; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
    transition: color var(--ds-dur-fast) ease, border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease;
}
.df-add:hover, .df-add:focus-visible { color: var(--ds-accent-strong); border-color: var(--ds-brand-200); background: var(--ds-accent-soft); outline: 0; }
/* خانة فيها كتل: الإضافة شريط نحيف بلا نصّ */
.df-cell:has(.df-block) .df-add { flex: 0 0 22px; }
.df-cell:has(.df-block) .df-add span { display: none; }

.df-pick { margin-top: 8px; max-width: 420px; }
.df-pick[hidden] { display: none; }
.df-plan-table th { font-size: 12px; color: var(--ds-ink-mute); font-weight: 700; background: var(--ds-surface-sunk); }
.df-plan-table td { vertical-align: middle; font-size: 13.5px; }
.df-plan-table td b { display: block; color: var(--ds-ink); }
.df-plan-table td small { display: block; font-size: 11.5px; color: var(--ds-ink-mute); }
.df-plan-left { display: flex; gap: 6px; margin: 0; padding: 10px 16px; background: #fffbeb; color: #b45309; font-size: 12.5px; }

@media (max-width: 1100px) {
    .df-plan { grid-template-columns: 1fr; }
    .df-queue { position: static; max-height: none; overflow: visible; }
    .df-queue h2 small { display: none; }
}
@media (max-width: 640px) {
    .df-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
    .df-pipe-step:nth-child(3)::before { display: none; }
    .df-legend { display: none; }
}
@media (pointer: coarse) {
    .df-add { color: var(--ds-border-strong); }
    .df-add span { display: none; }
    .df-queue .df-card { cursor: default; }
    .df-grip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .df-block, .df-pipe-icon, .df-queue .df-card { transition: none; }
    .df-block:hover:not(:disabled), .df-pipe-step:hover .df-pipe-icon { transform: none; }
}

/* ==================== نافذة جدولة المناقشة ====================
   رأس بأيقونة لا يُقصّ، أقسام بعناوين داخلها (لا legend فوق الحدّ)، مدة
   ونوع بأزرار، رابط اجتماع يتعرّف مزوّده، ولجنة ببطاقتين، وملخّص حيّ في
   الذيل بما سيُرسل. */
.df-form .dm-head { display: flex; align-items: center; gap: 12px; min-height: 0; height: auto; padding: 16px 20px; border-bottom: 1px solid var(--ds-border); }
.dm-head-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--ds-accent); color: #fff; font-size: 20px; box-shadow: 0 10px 20px -12px rgba(37, 99, 235, .8); }
.dm-head-body { flex: 1; min-width: 0; }
.df-form .dm-head .modal-title { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.5; color: var(--ds-ink); }
.df-form .dm-head .df-form-project { margin-top: 1px; font-size: 12.5px; line-height: 1.6; color: var(--ds-ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-form .dm-head .btn-close { position: static; margin: 0; flex: none; }

.dm-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; background: var(--ds-bg); }
.dm-sec { padding: 14px 16px 16px; border: 1px solid var(--ds-border); border-radius: 14px; background: var(--ds-surface); }
.dm-sec-title { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; font-size: 13.5px; font-weight: 800; color: var(--ds-ink); }
.dm-sec-title > i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ds-accent-soft); color: var(--ds-accent); font-size: 15px; }
.dm-sec-title label { margin: 0; font: inherit; }
.dm-sec-title small { font-size: 11.5px; font-weight: 500; color: var(--ds-ink-mute); }
.dm-body .form-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--ds-ink-soft); }
.dm-body .form-hint { margin-top: 8px; font-size: 12px; color: var(--ds-ink-mute); line-height: 1.6; }
.dm-body .form-hint.is-same { color: #047857; }

.dm-when { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.dm-chips { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--ds-border); border-radius: 10px; background: var(--ds-surface-sunk); }
.dm-chip { position: relative; margin: 0; cursor: pointer; }
.dm-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dm-chip span { display: block; padding: 6px 11px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--ds-ink-soft); white-space: nowrap; transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease; }
.dm-chip small { font-size: 11px; font-weight: 500; }
.dm-chip input:checked + span { background: var(--ds-surface); color: var(--ds-accent-strong); box-shadow: 0 1px 3px rgba(9, 9, 11, .12); }
.dm-chip input:focus-visible + span { outline: 2px solid var(--ds-accent); outline-offset: 1px; }

.dm-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dm-mode { position: relative; margin: 0; cursor: pointer; }
.dm-mode input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dm-mode > span { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--ds-border); border-radius: 12px; transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease; }
.dm-mode i { grid-row: 1 / span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ds-surface-sunk); color: var(--ds-ink-mute); font-size: 18px; }
.dm-mode b { font-size: 13.5px; color: var(--ds-ink); line-height: 1.4; }
.dm-mode small { font-size: 11.5px; color: var(--ds-ink-mute); line-height: 1.4; }
.dm-mode:hover > span { border-color: var(--ds-brand-200); }
.dm-mode input:checked + span { border-color: var(--ds-accent); background: var(--ds-accent-soft); }
.dm-mode input:checked + span i { background: var(--ds-accent); color: #fff; }
.dm-mode input:focus-visible + span { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.dm-field { margin-top: 14px; }
.dm-field[hidden] { display: none; }

/* رابط الاجتماع: حقل واحد بأيقونة وزر لصق، ويخضرّ حين يصحّ */
.dm-link { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--ds-border-strong); border-radius: 11px; background: var(--ds-surface); transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease; }
.dm-link:focus-within { border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.dm-link.is-ok { border-color: #34d399; }
.dm-link.is-invalid { border-color: var(--ds-danger, #e11d48); }
.dm-link-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ds-surface-sunk); color: var(--ds-ink-mute); }
.dm-link.is-ok .dm-link-icon { background: #ecfdf5; color: #047857; }
.dm-link input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 6px; font: inherit; font-size: 14px; color: var(--ds-ink); text-align: left; }
.dm-link input::placeholder { color: #a1a1aa; }
.dm-paste { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border: 0; border-radius: 8px; background: var(--ds-surface-sunk); color: var(--ds-ink-soft); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.dm-paste:hover { background: var(--ds-accent-soft); color: var(--ds-accent-strong); }
.dm-paste[hidden] { display: none; }
.dm-link-state { min-height: 0; margin-top: 6px; font-size: 12px; line-height: 1.6; }
.dm-link-state:empty { display: none; }
.dm-link-state.is-ok { color: #047857; }
.dm-link-state.is-bad { color: #be123c; }

/* زر Google Meet بشعاره: بطاقة لا زر حدود */
.dm-meet { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 11px 14px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-surface); text-decoration: none !important; color: inherit; transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur) ease, transform var(--ds-dur) var(--ds-ease); }
.dm-meet:hover { border-color: #00ac47; box-shadow: 0 12px 24px -18px rgba(0, 131, 45, .7); transform: translateY(-1px); }
.dm-meet-logo { flex: none; width: 34px; height: 28px; }
.dm-meet > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dm-meet b { font-size: 13.5px; color: var(--ds-ink); }
.dm-meet small { font-size: 11.5px; color: var(--ds-ink-mute); line-height: 1.6; }
.dm-meet > i { color: var(--ds-ink-mute); }

.dm-committee { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dm-member { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-surface-sunk); min-width: 0; }
.dm-member > span:not(.dm-member-av) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dm-member small { font-size: 11.5px; color: var(--ds-ink-mute); }
.dm-member small em { font-style: normal; color: #e11d48; }
.dm-member b { font-size: 14px; color: var(--ds-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-member > i { color: var(--ds-border-strong); }
.dm-member-av { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ds-accent); color: #fff; font-size: 13px; font-weight: 800; }
.dm-member-av.is-examiner { background: #f5f3ff; color: #6d28d9; font-size: 18px; }
.dm-member.is-pick { background: var(--ds-surface); border-color: var(--ds-border-strong); }
.dm-member.is-pick:focus-within { border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.dm-member-field label { margin: 0; }
/* ممتحن إضافي: زر بحجم بطاقة العضو، وإزالة هادئة داخل البطاقة */
.dm-member-add { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 60px; border: 1.5px dashed var(--ds-border-strong); border-radius: 12px; background: transparent; color: var(--ds-ink-soft); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease; }
.dm-member-add:hover, .dm-member-add:focus-visible { border-color: var(--ds-accent); color: var(--ds-accent-strong); background: var(--ds-accent-soft); outline: 0; }
.dm-member-add[hidden], .dm-member-remove[hidden] { display: none; }
.dm-member-remove { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ds-ink-mute); cursor: pointer; }
.dm-member-remove:hover, .dm-member-remove:focus-visible { background: #fff1f2; color: #be123c; outline: 0; }
.dm-member-field select option:disabled { color: var(--ds-border-strong); }
/* رئيس اللجنة: شارة اختيار واحدة على بطاقات الأعضاء */
.dm-chair { flex: none; position: relative; margin: 0; cursor: pointer; }
.dm-chair input { position: absolute; opacity: 0; pointer-events: none; }
.dm-chair span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--ds-border); border-radius: 99px; background: var(--ds-surface); color: var(--ds-ink-mute); font-size: 11.5px; font-weight: 700; transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease, border-color var(--ds-dur-fast) ease; }
.dm-chair:hover span { border-color: #fcd34d; color: #b45309; }
.dm-chair input:checked + span { border-color: #f59e0b; background: #fffbeb; color: #b45309; }
.dm-chair input:focus-visible + span { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.dm-member-field select { width: 100%; border: 0; outline: 0; background: transparent; padding: 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--ds-ink); cursor: pointer; text-overflow: ellipsis; }

.df-form .dm-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--ds-border); background: var(--ds-surface); }
.dm-summary { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; margin-inline-end: auto; }
.dm-summary > i { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ds-accent-soft); color: var(--ds-accent); }
.dm-summary > span { display: flex; flex-direction: column; min-width: 0; }
.dm-summary small { font-size: 11px; color: var(--ds-ink-mute); }
.dm-summary b { font-size: 12.5px; color: var(--ds-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== المخطِّط حين تكثر المناقشات ==================== */
.df-queue-search { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 12px; height: 38px; border: 1px solid var(--ds-border); border-radius: 10px; background: var(--ds-surface); color: var(--ds-ink-mute); position: sticky; top: 0; z-index: 2; }
.df-queue-search:focus-within { border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.df-queue-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ds-ink); }
.df-queue-none { margin: 0; padding: 14px; text-align: center; font-size: 12.5px; color: var(--ds-ink-mute); }
.df-queue .df-card[hidden] { display: none; }
.df-sub-sup { display: none; }
.df-expand { flex: none; margin-inline-start: auto; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--ds-ink-mute); cursor: pointer; transition: transform var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease; }
.df-expand:hover { background: var(--ds-surface-sunk); color: var(--ds-ink); }
/* المدمجة: العنوان والمشرف، والاقتراح سطراً واحداً، والتفاصيل عند الفتح */
.df-queue .df-card.is-dense { gap: 7px; padding: 10px 12px; }
.df-card.is-dense .df-sub-sup { display: inline; }
.df-card.is-dense .df-facts { display: none; }
.df-card.is-dense.is-open .df-facts { display: flex; }
.df-card.is-dense.is-open .df-expand { transform: rotate(180deg); }
.df-card.is-dense .df-suggest { flex-direction: row; align-items: center; gap: 8px; padding: 6px 9px; }
.df-card.is-dense .df-suggest-when { flex: 1; min-width: 0; font-size: 12.5px; }
.df-card.is-dense .df-suggest-who { display: none; }
.df-card.is-dense.is-open .df-suggest { flex-direction: column; align-items: stretch; }
.df-card.is-dense.is-open .df-suggest-who { display: block; }
.df-card.is-dense footer .btn { min-height: 30px; font-size: 12.5px; }

.df-blocks { flex: 1 1 0; min-width: 0; display: flex; gap: 3px; }
.df-cell.is-crowded:not(.is-open) .df-blocks .df-block:nth-child(n+3) { display: none; }
.df-cell.is-open .df-blocks { flex-direction: column; }
.df-cell.is-open .df-block { flex: none; }
.df-more { flex: 0 0 26px; align-self: stretch; border: 0; border-radius: 8px; background: var(--ds-surface-sunk); color: var(--ds-ink-soft); font: inherit; font-size: 11.5px; font-weight: 800; cursor: pointer; }
.df-more:hover { background: var(--ds-accent-soft); color: var(--ds-accent-strong); }

@media (max-width: 640px) {
    .dm-when { grid-template-columns: 1fr 1fr; }
    .dm-when > :last-child { grid-column: 1 / -1; }
    .dm-modes, .dm-committee { grid-template-columns: 1fr; }
    .df-form .dm-foot { flex-wrap: wrap; }
    .dm-summary { flex-basis: 100%; }
    .dm-meet small { display: none; }
}

/* ==================== نافذة القاعات ====================
   قاعة جديدة في بطاقة بحقول معنونة، وكل قاعة صفّ بمعلوماتها شاراتٍ،
   ومفتاح إتاحة بدل زر «تعطيل»، وحذف هادئ. */
.dm-head-icon.is-teal { background: #0d9488; box-shadow: 0 10px 20px -12px rgba(13, 148, 136, .8); }
.dr-add-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) 90px; gap: 10px 12px; }
.dr-add-name { grid-column: 1 / -1; }
.dr-add-btn { width: 100%; margin-top: 12px; min-height: 40px; border-radius: 10px; }
.dr-list { display: flex; flex-direction: column; gap: 8px; }
.dr-room { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--ds-border); border-radius: 14px; background: var(--ds-surface); transition: border-color var(--ds-dur-fast) ease; }
.dr-room:hover { border-color: var(--ds-border-strong); }
.dr-room form { margin: 0; }
.dr-room-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #f0fdfa; color: #0f766e; font-size: 18px; }
.dr-room-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dr-room-body b { font-size: 14px; color: var(--ds-ink); }
.dr-room-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 12px; color: var(--ds-ink-mute); }
.dr-room-meta span { display: inline-flex; align-items: center; gap: 4px; }
.dr-room-meta .is-busy { color: var(--ds-accent-strong); font-weight: 600; }
.dr-room.is-off .dr-room-icon { background: var(--ds-surface-sunk); color: var(--ds-ink-mute); }
.dr-room.is-off .dr-room-body b { color: var(--ds-ink-mute); }
.dr-switch-form { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dr-switch-form small { font-size: 10.5px; font-weight: 600; color: var(--ds-ink-mute); }
.dr-switch { position: relative; width: 40px; height: 22px; padding: 0; border: 0; border-radius: 99px; background: var(--ds-border-strong); cursor: pointer; transition: background-color var(--ds-dur) ease; }
.dr-switch span { position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(9, 9, 11, .3); transition: inset-inline-start var(--ds-dur) var(--ds-ease); }
.dr-switch.is-on { background: #10b981; }
.dr-switch.is-on span { inset-inline-start: 21px; }
.dr-switch:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.dr-delete { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--ds-ink-mute); cursor: pointer; transition: background-color var(--ds-dur-fast) ease, color var(--ds-dur-fast) ease; }
.dr-delete:hover, .dr-delete:focus-visible { background: #fff1f2; color: #be123c; outline: 0; }

/* تتمّات المخطِّط: حقل البحث بارتفاع ثابت، وزر «جدولة» داخل سطر الاقتراح للبطاقة المدمجة */
.df-queue-search { flex: none; min-height: 38px; }
.df-quick { display: none; flex: none; align-items: center; gap: 4px; padding: 4px 10px; border: 0; border-radius: 8px; background: var(--ds-accent); color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.df-quick:hover { background: var(--ds-accent-strong); }
.df-card.is-dense:not(.is-open) .df-quick { display: inline-flex; }
.df-card.is-dense:not(.is-open) footer { display: none; }
.df-card.is-dense .df-suggest-when bdi { margin-inline-start: 4px; }
@media (pointer: coarse) {
    .dr-delete, .df-quick { min-height: 40px; }
    .dr-delete { width: 40px; }
}

/* ==================== المخطِّط: يوم واحد كاملاً ====================
   بدل شبكة أسبوع أغلبها فارغ: شريط أيام بعدّاداتها، واليوم المختار قائمة
   زمنية ببطاقات تُقرأ كاملة (العنوان، القاعة، الممتحن). */
.df-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(112px, 1fr); gap: 8px; padding: 2px 16px 14px; overflow-x: auto; scrollbar-width: none; }
.df-daytab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--ds-border); border-radius: 14px; background: var(--ds-surface); color: var(--ds-ink); font: inherit; text-align: start; cursor: pointer; transition: border-color var(--ds-dur-fast) ease, background-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease; }
.df-daytab:hover, .df-daytab.is-hint { border-color: var(--ds-accent); }
.df-daytab.is-hint { box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.df-daytab:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.df-daytab-date { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.df-daytab-date small { font-size: 11.5px; font-weight: 600; color: var(--ds-ink-mute); }
.df-daytab-date b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.df-daytab-n { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--ds-accent-soft); color: var(--ds-accent-strong); font-size: 12.5px; font-weight: 800; }
.df-daytab.is-empty .df-daytab-n { background: transparent; color: var(--ds-border-strong); }
.df-daytab.is-today .df-daytab-date small { color: var(--ds-accent-strong); }
.df-daytab.is-active { border-color: var(--ds-accent); background: var(--ds-accent-soft); }
.df-daytab.is-active .df-daytab-n { background: var(--ds-accent); color: #fff; }
.df-daytab.is-active.is-empty .df-daytab-n { background: transparent; color: var(--ds-accent); }

.df-cal { border-top: 1px solid var(--ds-border); }
.df-tday { display: flex; flex-direction: column; padding: 4px 16px 12px; }
.df-tday[hidden] { display: none; }
.df-tslot { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 0 10px; padding: 6px 0; }
.df-tslot + .df-tslot { border-top: 1px solid color-mix(in srgb, var(--ds-border) 60%, transparent); }
.df-tslot-time { padding-top: 11px; text-align: center; font-size: 12px; font-weight: 700; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.df-tslot.has-items .df-tslot-time { color: var(--ds-ink); }
.df-tslot.is-past { opacity: .55; }
.df-cell { flex-wrap: wrap; gap: 6px; height: auto; min-height: 40px; padding: 0; border-radius: 12px; }
.df-tslot.is-drop .df-cell { background: var(--ds-accent-soft); box-shadow: 0 0 0 2px var(--ds-accent); }
.df-block { flex: 1 1 250px; flex-direction: row; align-items: center; gap: 10px; min-height: 56px; padding: 9px 12px; border-radius: 12px; }
.df-block-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.df-block b { font-size: 13px; -webkit-line-clamp: 1; }
.df-block small { display: flex; flex-wrap: wrap; gap: 2px 12px; white-space: normal; font-size: 11.5px; }
.df-block small span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.df-who { flex: none; margin-top: 0; padding-inline-end: 4px; }
.df-who i { width: 22px; height: 22px; font-size: 9px; }
.df-tag { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: var(--ds-surface); color: var(--ds-accent-strong); font-style: normal; font-size: 11px; font-weight: 700; }
/* الخانة الفارغة: صفّ متقطّع هادئ يُفصح عن نفسه عند المرور */
.df-add { flex: 1 1 100%; min-height: 40px; border-color: color-mix(in srgb, var(--ds-border) 90%, transparent); color: var(--ds-border-strong); border-radius: 12px; }
.df-add span { opacity: 0; transition: opacity var(--ds-dur-fast) ease; }
.df-add:hover span, .df-add:focus-visible span { opacity: 1; }
.df-cell:has(.df-block) .df-add { flex: 0 0 40px; min-height: 0; }
.df-plan.is-dragging .df-tslot[data-slot-date] .df-add { border-color: var(--ds-brand-200); color: var(--ds-accent); background: color-mix(in srgb, var(--ds-accent-soft) 45%, transparent); }
@media (max-width: 640px) {
    .df-days { grid-auto-columns: minmax(96px, 1fr); padding-inline: 12px; }
    .df-tday { padding-inline: 12px; }
    .df-tslot { grid-template-columns: 40px minmax(0, 1fr); gap: 0 6px; }
    .df-block { flex-basis: 100%; }
    .df-cell:has(.df-block) .df-add { flex: 1 1 100%; min-height: 34px; }
    .dm-summary b { white-space: normal; }
}

/* ==================== الإنجليزية (LTR) ====================
   الأسهم مرسومة لاتجاه العربية: «التالي» سهم لليسار. في LTR تنعكس كلها
   أفقياً فيبقى المعنى (السابق/التالي، الدخول إلى عنصر) صحيحاً. */
[dir="ltr"] .ti-arrow-left, [dir="ltr"] .ti-arrow-right,
[dir="ltr"] .ti-chevron-left, [dir="ltr"] .ti-chevron-right,
[dir="ltr"] .ti-chevrons-left, [dir="ltr"] .ti-chevrons-right,
[dir="ltr"] .ti-arrow-narrow-left, [dir="ltr"] .ti-arrow-narrow-right,
[dir="ltr"] .ti-arrow-back-up { display: inline-block; transform: scaleX(-1); }
/* زر الإرسال معكوس للعربية أصلاً — في LTR يعود لرسمه */
[dir="ltr"] .compose-send i { transform: none; }
/* البيانات العربية (الأسماء والعناوين) داخل واجهة إنجليزية: كل مقطع سطري
   يأخذ اتجاه أول حرف فيه، فلا تنقلب «د. هبة» إلى «هبة .د» ولا تتبعثر
   العناوين المختلطة. يحمي الواجهة العربية من الأثر لأنه في LTR وحدها. */
[dir="ltr"] :where(b, strong, span, a, small, em, label, td, th, h1, h2, h3, h4, h5, p, li, option) { unicode-bidi: plaintext; }

/* ==================== التحديث الحيّ (live.js) ====================
   الشارات تُرسم دائماً وتُخفى بـ hidden حين تكون صفراً؛ وتنبيه منبثق
   لكل إشعار يصل، يُفتح منه مكانه؛ والجرس يهتزّ مرة حين يزيد العدد. */
[data-live-count][hidden], [data-live-badge][hidden] { display: none !important; }
.topbar-bell.is-ringing .ti-bell { animation: bell-ring .9s ease; transform-origin: 50% 2px; }
@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); }
    45% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
    .topbar-bell.is-ringing .ti-bell { animation: none; }
}

/* ==================== النقاش الحيّ ====================
   الرسالة تصل بانزلاق خفيف، ورسالتي شفافة حتى يثبتها الخادم، والفاشلة
   بحدّ أحمر وزرّ يعيد نصّها؛ وزرّ «رسائل جديدة» يطفو فوق المجرى حين
   يكون القارئ في رسائل قديمة. */
.chat-stream-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
[data-chat-unread][hidden], [data-chat-unread-project][hidden] { display: none !important; }
.msg.is-arriving { animation: msg-in .28s var(--ds-ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg.is-sending { opacity: .55; }
.msg.is-sending .msg-time { font-style: italic; }
.msg.is-failed .msg-bubble { box-shadow: inset 0 0 0 1.5px var(--ds-danger); }
.msg.is-failed .msg-time { color: var(--ds-danger); }
.msg-retry { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--ds-danger); font: inherit; font-size: 12px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.msg.is-removing { opacity: 0; transform: scale(.97); transition: opacity .2s ease, transform .2s ease; }
.chat-jump {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 2;
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
    border: 0; border-radius: 999px; background: var(--ds-brand-600); color: #fff;
    font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
    box-shadow: 0 10px 24px -12px rgba(37, 99, 235, .8);
    animation: msg-in .25s var(--ds-ease) both;
}
.chat-jump[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
    .msg.is-arriving, .chat-jump { animation: none; }
    .msg.is-removing { transition: none; }
}

/* ==================== رفع الملفات بشريط تقدّم (upload.js) ==================== */
.up-progress { flex: 1 1 100%; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-surface); }
.up-progress[hidden] { display: none; }
.up-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.up-top[hidden], .up-bar[hidden] { display: none; }
.up-pct { font-size: 15px; font-weight: 800; color: var(--ds-brand-600); font-variant-numeric: tabular-nums; min-width: 42px; }
.up-meta { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ds-ink-mute); font-variant-numeric: tabular-nums; }
.up-cancel { padding: 3px 12px; border: 1px solid var(--ds-border-strong); border-radius: 999px; background: var(--ds-surface); color: var(--ds-ink-soft); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.up-cancel:hover { border-color: var(--ds-danger); color: var(--ds-danger); }
.up-cancel[hidden] { display: none; }
.up-bar { height: 6px; border-radius: 99px; background: var(--ds-accent-soft); overflow: hidden; }
.up-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ds-brand-600); transition: width .2s linear; }
.up-progress.is-saving .up-bar span { background: linear-gradient(90deg, var(--ds-brand-600), #60a5fa, var(--ds-brand-600)); background-size: 200% 100%; animation: up-saving 1.2s linear infinite; }
@keyframes up-saving { to { background-position: -200% 0; } }
.up-progress.is-error { border-color: #fecaca; background: #fff1f2; }
.up-msg { margin: 0; font-size: 13px; color: #be123c; }
form.is-uploading .file-drop, form.is-uploading input[type="file"] + label { pointer-events: none; opacity: .7; }
@media (prefers-reduced-motion: reduce) {
    .up-bar span { transition: none; }
    .up-progress.is-saving .up-bar span { animation: none; }
}

/* ==================== النسخة التجريبية (DEMO_MODE) ==================== */
.demo-try { margin-top: 18px; padding: 14px; border: 1.5px dashed var(--ds-brand-200); border-radius: 16px; background: var(--ds-accent-soft); }
.demo-try-title { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--ds-accent-strong); }
.demo-try-roles { display: grid; gap: 8px; }
.demo-try-roles form { margin: 0; }
.demo-role { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-surface); color: var(--ds-ink); font: inherit; text-align: start; cursor: pointer; transition: border-color var(--ds-dur-fast) ease, box-shadow var(--ds-dur-fast) ease, transform var(--ds-dur-fast) var(--ds-ease); }
.demo-role:hover, .demo-role:focus-visible { border-color: var(--ds-brand-600); box-shadow: 0 10px 22px -16px rgba(37, 99, 235, .7); transform: translateY(-1px); outline: 0; }
.demo-role-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ds-accent-soft); color: var(--ds-brand-600); font-size: 18px; }
.demo-role.is-supervisor .demo-role-icon { background: #f0fdfa; color: #0f766e; }
.demo-role.is-admin .demo-role-icon { background: #f5f3ff; color: #6d28d9; }
.demo-role-text { display: flex; flex-direction: column; min-width: 0; }
.demo-role-text b { font-size: 13.5px; }
.demo-role-text small { font-size: 11.5px; color: var(--ds-ink-mute); }

.demo-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; padding: 7px 20px; background: linear-gradient(90deg, #eff6ff, #f5f3ff); border-bottom: 1px solid var(--ds-brand-200); font-size: 12.5px; color: var(--ds-accent-strong); }
.demo-bar-note { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.demo-bar-roles { display: inline-flex; align-items: center; gap: 6px; }
.demo-bar-roles small { color: var(--ds-ink-mute); }
.demo-bar-roles form { margin: 0; }
.demo-chip { padding: 3px 12px; border: 1px solid var(--ds-brand-200); border-radius: 999px; background: var(--ds-surface); color: var(--ds-accent-strong); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.demo-chip:hover { border-color: var(--ds-brand-600); }
.demo-chip.is-on { background: var(--ds-brand-600); border-color: var(--ds-brand-600); color: #fff; cursor: default; }
@media (max-width: 640px) { .demo-bar { padding: 7px 12px; } .demo-bar-note { font-size: 11.5px; } }
@media (prefers-reduced-motion: reduce) { .demo-role:hover { transform: none; } }

/* ==================== لحظة التخرّج ====================
   نافذة احتفال مرة واحدة بعد اعتماد الدرجة (student/_project.blade.php):
   قصاصات تتساقط، والفريق يرمي قبعاته، والدرجة تُعدّ. */
.celebrate {
    width: min(460px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 26px;
    background: transparent;
    overflow: visible;
}
.celebrate[open] { animation: dlg-in .5s cubic-bezier(.21, 1.02, .73, 1); }
.celebrate::backdrop { background: rgba(15, 23, 42, .45); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: dlg-fade .3s ease; }
.celebrate-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 26px 28px 26px;
    border-radius: 26px;
    background:
        radial-gradient(80% 60% at 50% 0, #eff6ff, transparent 70%),
        radial-gradient(60% 50% at 100% 100%, #f5f3ff, transparent 70%),
        #fff;
    text-align: center;
    box-shadow: 0 40px 90px -30px rgba(15, 23, 42, .5);
    overflow: hidden;
}
.celebrate-confetti { position: absolute; inset: 0; pointer-events: none; }
.celebrate-confetti i {
    position: absolute;
    top: -14px;
    left: var(--x);
    width: 8px;
    height: 12px;
    border-radius: 2px;
    opacity: 0;
    animation: confetti-fall var(--d) cubic-bezier(.25, .6, .4, 1) var(--delay) forwards;
}
@keyframes confetti-fall {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); }
    85% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--drift), 520px) rotate(var(--spin)); }
}
.celebrate-team { position: relative; width: 200px; height: 146px; overflow: visible; margin-bottom: 6px; }
.celebrate-cap { transform-box: fill-box; transform-origin: center; animation: celebrate-toss 1.3s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes celebrate-toss {
    0% { translate: 0 0; rotate: 0deg; }
    45% { translate: 0 -42px; rotate: 220deg; }
    100% { translate: 0 0; rotate: 360deg; }
}
.celebrate-kicker {
    position: relative;
    margin: 0;
    padding: 4px 12px;
    border-radius: 99px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    font-weight: 800;
}
.celebrate-title { position: relative; margin: 10px 0 6px; font-family: var(--ds-font-display); font-size: 22px; font-weight: 800; color: var(--ds-ink); }
.celebrate-grade { position: relative; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 6px 8px; margin: 4px 0 8px; }
.celebrate-grade b {
    font-family: var(--ds-font-display);
    font-size: 54px;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.celebrate-grade span { font-size: 14px; color: var(--ds-ink-mute); }
.celebrate-grade .celebrate-label { align-self: center; padding: 3px 10px; border-radius: 99px; background: #ecfdf5; color: #047857; font-size: 12.5px; font-weight: 700; }
.celebrate-text { position: relative; margin: 0 0 18px; font-size: 14px; line-height: 1.8; color: var(--ds-ink-soft); }
.celebrate-ok { position: relative; min-width: 180px; min-height: 44px; border-radius: 12px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
    .celebrate[open], .celebrate::backdrop, .celebrate-cap { animation: none; }
}

/* ==================== الجولة التعريفية ====================
   بقعة تضيء العنصر وظلّها الواسع يعتم الصفحة، وبطاقة بشخصية الدور.
   السلوك في public/js/tour.js. */
.tour { position: fixed; inset: 0; z-index: 1100; }
.tour[hidden] { display: none; }
.tour-spot {
    position: fixed;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, .5), 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 7px rgba(37, 99, 235, .45);
    transition: left .4s var(--ds-ease), top .4s var(--ds-ease), width .4s var(--ds-ease), height .4s var(--ds-ease), border-radius .4s ease;
    pointer-events: none;
    animation: tour-fade .3s ease both;
}
.tour-spot.is-center { border-radius: 50%; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .5); }
.tour-pop {
    position: fixed;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 14px;
    width: min(380px, calc(100vw - 24px));
    padding: 18px 18px 14px;
    border-radius: 20px;
    background:
        radial-gradient(70% 60% at 0 0, var(--ds-brand-50), transparent 70%),
        var(--ds-surface);
    box-shadow: 0 30px 70px -24px rgba(15, 23, 42, .55), 0 0 0 1px rgba(15, 23, 42, .06);
    transition: left .4s var(--ds-ease), top .4s var(--ds-ease);
}
.tour-pop.is-in .tour-body { animation: tour-rise .4s var(--ds-ease) both; }
.tour-pop.is-in .tour-who { animation: tour-hop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.tour-who { grid-row: span 1; align-self: end; width: 52px; height: 82px; overflow: visible; }
[dir="ltr"] .tour-who { transform: scaleX(-1); }
.tour-body { min-width: 0; }
.tour-count { display: block; font-size: 11.5px; font-weight: 700; color: var(--ds-brand-600); }
.tour-title { margin: 2px 0 4px; font-family: var(--ds-font-display); font-size: 17px; font-weight: 800; color: var(--ds-ink); }
.tour-text { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--ds-ink-soft); }
.tour-foot {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ds-border);
}
.tour-dots { display: inline-flex; gap: 5px; margin-inline-end: auto; }
.tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--ds-border-strong); transition: width .3s var(--ds-ease), background-color .3s ease; }
.tour-dots i.is-on { width: 18px; background: var(--ds-brand-600); }
.tour-skip { padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--ds-ink-mute); cursor: pointer; }
.tour-skip:hover { color: var(--ds-ink); background: var(--ds-surface-sunk); }
.tour-foot .btn { min-height: 36px; padding-inline: 14px; border-radius: 10px; font-weight: 700; }
.tour-foot [hidden] { display: none; }
.tour.is-leaving { animation: tour-fade .25s ease reverse forwards; }
@keyframes tour-fade { from { opacity: 0; } }
@keyframes tour-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes tour-hop { from { opacity: 0; translate: 0 10px; } }
@media (prefers-reduced-motion: reduce) {
    .tour-spot, .tour-pop { transition: none; animation: none; }
    .tour-pop.is-in .tour-body, .tour-pop.is-in .tour-who, .tour.is-leaving { animation: none; }
}
