/* ===================================================================
   EduTrack — منصّة التميّز المدرسي
   نظام تصميم داكن عصري (RTL) — مستوحى من الواجهة الأصلية ومحسّن
   =================================================================== */

:root {
    /* الخلفيات (ثيم فاتح هادئ) */
    --bg-900: #eef2f7;
    --bg-850: #e8edf4;
    --bg-800: #dde4ee;
    --bg-750: #cbd5e1;
    --bg-700: #b6c2d4;

    /* السطوح */
    --surface: #ffffff;
    --surface-2: #e8eef6;
    --border: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.18);

    /* النصوص (تباين واضح على خلفية فاتحة) */
    --text: #1e293b;
    --text-muted: #4b5563;
    --text-dim: #6b7280;

    /* العلامة */
    --brand: #2563eb;
    --brand-2: #4f46e5;
    --brand-glow: rgba(37, 99, 235, 0.18);

    /* الحالات */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;

    --radius: 13px;
    --radius-sm: 9px;
    --shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.14);
    --shadow-lg: 0 22px 50px -20px rgba(15, 23, 42, 0.20);

    --font: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(99, 102, 241, 0.07), transparent 60%),
        radial-gradient(900px 500px at -10% 10%, rgba(37, 99, 235, 0.06), transparent 55%),
        var(--bg-900);
    background-attachment: fixed;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color .15s ease;
}

a:hover {
    color: #1d4ed8;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
}

::selection {
    background: var(--brand-glow);
}

/* ---------- شريط التنقّل ---------- */
.et-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--border);
}

.et-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: #0f172a;
}

.et-brand:hover {
    color: var(--brand);
}

.et-brand .logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 6px 18px -4px var(--brand-glow);
}

.et-nav-link {
    color: var(--text-muted);
    font-weight: 600;
    padding: .5rem .9rem;
    border-radius: var(--radius-sm);
    transition: all .15s ease;
}

.et-nav-link:hover,
.et-nav-link.active {
    color: var(--brand);
    background: rgba(37, 99, 235, 0.08);
}

/* ---------- البطاقات الزجاجية ---------- */
.et-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.et-card-pad {
    padding: 1.1rem;
}

.et-card-hover {
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.et-card-hover:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

/* ---------- الأزرار ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 700;
    padding: .45rem 1rem;
    transition: all .15s ease;
    border: 1px solid transparent;
}

.btn-sm {
    padding: .3rem .65rem;
    font-size: .8rem;
}

.btn-brand {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 8px 22px -8px var(--brand-glow);
}

.btn-brand:hover {
    color: #fff;
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--text);
    background: rgba(148, 163, 184, 0.1);
    border-color: var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(15, 23, 42, 0.07);
}

.btn-outline-light-soft {
    color: var(--text);
    border-color: var(--border-strong);
    background: transparent;
}

.btn-outline-light-soft:hover {
    color: var(--text);
    background: rgba(15, 23, 42, 0.06);
}

/* ---------- الشارات ---------- */
.et-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .74rem;
    font-weight: 700;
    padding: .22rem .55rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.et-badge-emerald { color: #047857; background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .35); }
/* «البنفسجي» أُعيد لونه إلى الأزرق (هوية الموقع) — يبقى الاسم للاتّساق مع 24 وجهة تستعمله. */
.et-badge-violet  { color: #1e40af; background: rgba(37, 99, 235, .12); border-color: rgba(37, 99, 235, .35); }
.et-badge-orange  { color: #c2410c; background: rgba(249, 115, 22, .12); border-color: rgba(249, 115, 22, .35); }
.et-badge-blue    { color: #1d4ed8; background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .35); }

/* ---------- النماذج ---------- */
.form-label {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: .4rem;
}

.form-control,
.form-select {
    background: #ffffff;
    border: 1px solid #c3cedd;
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
}

.form-control-sm,
.form-select-sm {
    padding: .35rem .6rem;
    font-size: .82rem;
}

.form-label {
    margin-bottom: .3rem;
}

.form-control:focus,
.form-select:focus {
    background: #ffffff;
    color: var(--text);
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem var(--brand-glow);
}

.form-control::placeholder {
    color: var(--text-dim);
}

.form-check-input {
    background-color: var(--surface-2);
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.text-danger, .field-validation-error, .validation-summary-errors {
    color: var(--danger) !important;
}

/* ---------- شريط التقدّم ---------- */
.et-progress {
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.et-progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* ---------- الجداول ---------- */
.et-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.et-table th {
    color: var(--text-muted);
    font-weight: 700;
    text-align: right;
    padding: .55rem .8rem;
    border-bottom: 1px solid var(--border);
}

.et-table td {
    padding: .55rem .8rem;
    border-bottom: 1px solid var(--border);
}

.et-table tr:hover td {
    background: rgba(148, 163, 184, 0.05);
}

/* ---------- التذييل ---------- */
.et-footer {
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    padding: 1.1rem 0;
    margin-top: 2rem;
}

/* ---------- أدوات مساعدة ---------- */
.text-muted-2 { color: var(--text-muted) !important; }
.text-dim { color: var(--text-dim) !important; }
.bg-surface { background: var(--surface) !important; }
/* نصّ تلميحيّ مصغّر (يظهر بين قوسين بجانب عناوين الحقول) */
.et-hint { font-size: .68rem; font-weight: 400; }

.et-hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 300px at 50% 0%, var(--brand-glow), transparent 70%);
    pointer-events: none;
}

/* القسم البطولي على الجوال: تصغير العناصر حتى لا تتجاوز عرض الشاشة وتبدو متناسقة */
@media (max-width: 575.98px) {
    .et-hero { padding-top: 1.25rem !important; padding-bottom: 1.5rem !important; }
    .et-hero h1.display-5 { font-size: 1.5rem; line-height: 1.35; }
    .et-hero p.fs-5 { font-size: 1.05rem !important; max-width: 100% !important; }
    .et-hero .btn-lg { padding: .55rem 1rem; font-size: 1rem; }
    .et-hero .d-flex.flex-wrap.gap-3 .btn-lg { flex: 1 1 auto; } /* الأزرار تملأ العرض دون تجاوزه */
}

.et-icon-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, .12);
    border: 1px solid rgba(59, 130, 246, .3);
    color: var(--brand);
}

/* انتقالات ظهور */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.fade-up { animation: fadeUp .5s ease both; }

/* ===================  هيكل لوحة التحكّم  =================== */
.et-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.et-topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.1rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.et-topbar .btn svg { width: 18px; height: 18px; }

.et-body {
    flex: 1;
    display: flex;
    align-items: stretch;
}

.et-sidebar {
    width: 234px;
    flex-shrink: 0;
    padding: .7rem .55rem;
    border-inline-start: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    gap: .12rem;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.et-side-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .48rem .7rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .9rem;
    transition: all .15s ease;
    border: 1px solid transparent;
}

.et-side-link:hover {
    color: var(--text);
    background: rgba(15, 23, 42, 0.05);
}

.et-side-link.active {
    color: var(--brand);
    background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(79, 70, 229, .10));
    border-color: rgba(37, 99, 235, .3);
}

.et-side-link .ico {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.et-side-link .ico svg { width: 17px; height: 17px; }

/* ── تنقّل شجري (tree navigation) ── */
.et-tree { position: relative; padding-inline-start: .2rem; }
.et-tree-item { position: relative; padding-inline-start: .95rem; }
.et-tree-item::before { /* العمود الرأسي للشجرة */
    content: "";
    position: absolute;
    inset-inline-start: .1rem;
    top: 0;
    bottom: 0;
    border-inline-start: 1.5px solid var(--border-strong);
}
.et-tree-item:last-child::before { bottom: auto; height: 1rem; }
.et-tree-item::after { /* الفرع الأفقي */
    content: "";
    position: absolute;
    inset-inline-start: .1rem;
    top: 1rem;
    width: .55rem;
    border-top: 1.5px solid var(--border-strong);
}
/* روابط الشجرة في الشريط الجانبي: أكثر إحكاماً */
.et-tree .et-side-link { font-size: .85rem; padding: .35rem .6rem; }
.et-tree .et-side-link .ico { width: 17px; height: 17px; }
.et-tree .et-side-link .ico svg { width: 15px; height: 15px; }

.et-tree-head {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: var(--text-dim);
    font-weight: 800;
    font-size: .76rem;
    text-transform: none;
    padding: .1rem .2rem .25rem;
}
/* رابط فهرس داخل الصفحة */
.et-tree-link {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .32rem .5rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .84rem;
    border: 1px solid transparent;
    transition: all .15s ease;
}
.et-tree-link:hover { color: var(--text); background: rgba(15, 23, 42, 0.05); }
.et-tree-link.active {
    color: var(--brand);
    background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(79, 70, 229, .10));
    border-color: rgba(37, 99, 235, .3);
}
/* إزاحة المرساة أسفل الشريط العلوي عند القفز */
.et-anchor { scroll-margin-top: 70px; }

/* ── طيّ موحّد للعناصر الفرعية (collapsible: كل ما هو فرعي عن أصل) ── */
details.et-fold { border-radius: var(--radius-sm); }
details.et-fold > summary.et-fold-head {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .55rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 700;
    transition: background .15s ease;
}
details.et-fold > summary.et-fold-head::-webkit-details-marker { display: none; }
details.et-fold > summary.et-fold-head::before {
    content: "\25C0"; /* ◀ مغلق (اتجاه RTL) — مثلّث كامل الحجم */
    display: inline-block;
    font-size: .8rem;
    line-height: 1;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: color .15s ease;
}
details.et-fold[open] > summary.et-fold-head::before { content: "\25BC"; /* ▼ مفتوح */ }
details.et-fold > summary.et-fold-head:hover { background: rgba(148, 163, 184, 0.08); }
details.et-fold > summary.et-fold-head:hover::before { color: var(--text); }
.et-fold-count { margin-inline-start: auto; font-size: .72rem; font-weight: 600; color: var(--text-dim); }
.et-fold-body { padding-top: .5rem; }

/* ومضة تعريفية عند فتح/طيّ أي بطاقة بفعل المستخدم (على مستوى الموقع).
   نستخدم outline لا box-shadow/background حتى لا نمسّ ظلّ البطاقة أو خلفيتها. */
.et-fold-flash { animation: etFoldFlash 1s ease-out; }
.et-fold-flash-close { animation: etFoldFlashClose 1s ease-out; }

@keyframes etFoldFlash {
    0% { outline: 2px solid var(--brand); outline-offset: 0; }
    60% { outline: 2px solid var(--brand); outline-offset: 5px; }
    100% { outline: 2px solid transparent; outline-offset: 7px; }
}

@keyframes etFoldFlashClose {
    0% { outline: 2px solid var(--border-strong); outline-offset: 0; }
    60% { outline: 2px solid var(--border-strong); outline-offset: 5px; }
    100% { outline: 2px solid transparent; outline-offset: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    .et-fold-flash, .et-fold-flash-close { animation: none; }
}

/* أزرار «إضافة …» المطويّة: مظهر زرّ مريح وواضح (شريط بنفسجي متقطّع) */
details.et-fold > summary.et-fold-head:has(.et-badge-violet) {
    padding: .6rem .9rem;
    border: 1px dashed rgba(37, 99, 235, .45);
    background: rgba(37, 99, 235, .10);
    color: #1e40af;
}
details.et-fold > summary.et-fold-head:has(.et-badge-violet):hover {
    background: rgba(37, 99, 235, .18);
    border-color: rgba(37, 99, 235, .6);
}
details.et-fold > summary.et-fold-head:has(.et-badge-violet)::before { color: #1e40af; }
/* داخل زرّ الإضافة: تظهر الشارة كنصّ عادي ضمن الزرّ بدل حبّة منفصلة */
details.et-fold > summary.et-fold-head .et-badge-violet {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: .9rem;
}

.et-content {
    flex: 1;
    min-width: 0;
    padding: 1.25rem;
}

/* خلفية معتمة خلف الشريط الجانبي عند فتحه على الجوال */
.et-backdrop { display: none; }

@media (max-width: 991.98px) {
    body { overflow-x: hidden; } /* يمنع التمرير الأفقي بسبب الشريط المخفي خارج الشاشة */
    .et-sidebar {
        position: fixed;
        inset-inline-start: 0;
        top: 56px;
        bottom: 0;
        height: auto;
        transform: translateX(110%);
        transition: transform .2s ease;
        z-index: 1045;
        box-shadow: var(--shadow-lg);
        background: var(--bg-850); /* غير شفاف على الجوال حتى لا يظهر المحتوى خلفه */
    }
    .et-sidebar.open { transform: none; }
    .et-backdrop.show {
        display: block;
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(2, 6, 23, .55);
        z-index: 1040;
    }
}

/* بطاقة قسم في النظرة العامة */
.et-section-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all .18s ease;
}

.et-section-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.et-section-card .ico {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, .12);
    border: 1px solid rgba(59, 130, 246, .3);
    color: var(--brand);
    flex-shrink: 0;
}

/* ===== توافق الثيم الفاتح: تصحيح ألوان مضمّنة (inline) كانت معدّة للثيم الداكن ===== */
/* أحمر فاتح للحذف/الخطأ → أحمر واضح على الخلفية الفاتحة */
[style*="fca5a5"] { color: var(--danger) !important; }
/* أزرق فاتح (أرقام/روابط) → أزرق العلامة الواضح */
[style*="93c5fd"] { color: var(--brand) !important; }
/* أخضر فاتح → أخضر النجاح الواضح */
[style*="6ee7b7"] { color: var(--success) !important; }
.text-emerald { color: var(--success) !important; }

/* ============================================================
   الوضع الليلي (data-theme="dark") — يستعيد الثيم الداكن السابق
   ============================================================ */
:root[data-theme="dark"] {
    --bg-900: #0b1120;
    --bg-850: #0f172a;
    --bg-800: #1e293b;
    --bg-750: #243349;
    --bg-700: #334155;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-2: rgba(15, 23, 42, 0.6);
    --border: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(148, 163, 184, 0.3);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --brand: #3b82f6;
    --brand-2: #6366f1;
    --brand-glow: rgba(59, 130, 246, 0.35);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 60px -15px rgba(0, 0, 0, 0.7);
}

/* تجاوزات الألوان المثبّتة (غير المتغيّرات) في الوضع الليلي */
[data-theme="dark"] body {
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(99, 102, 241, 0.12), transparent 60%),
        radial-gradient(900px 500px at -10% 10%, rgba(59, 130, 246, 0.10), transparent 55%),
        var(--bg-900);
}
/* ‎:not(.btn)‎ إلزامي: خصوصية هذه القاعدة (0,2,1) تتفوّق على ‎.btn-brand:hover‎ (0,2,0)،
   فبدونها يفقد نصّ الأزرار الرابطة (‎<a class="btn btn-brand">‎) بياضه عند المرور. */
[data-theme="dark"] a:not(.btn):hover { color: #93c5fd; }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 { color: #f1f5f9; }
[data-theme="dark"] .et-navbar { background: rgba(11, 17, 32, 0.72); }
[data-theme="dark"] .et-brand { color: #f8fafc; }
[data-theme="dark"] .et-nav-link:hover,
[data-theme="dark"] .et-nav-link.active { background: rgba(148, 163, 184, 0.1); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(148, 163, 184, 0.18); }
[data-theme="dark"] .btn-outline-light-soft:hover { background: rgba(148, 163, 184, 0.12); }
[data-theme="dark"] .et-badge-emerald { color: #6ee7b7; }
[data-theme="dark"] .et-badge-violet  { color: #93c5fd; }
[data-theme="dark"] .et-badge-orange  { color: #fdba74; }
[data-theme="dark"] .et-badge-blue    { color: #93c5fd; }
[data-theme="dark"] .et-topbar { background: rgba(11, 17, 32, 0.82); }
/* الجوال: النافبار العلوي غير شفّاف في الوضع الليلي حتى لا يظهر المحتوى خلفه عند التمرير */
@media (max-width: 991.98px) {
    [data-theme="dark"] .et-topbar { background: #0b1120; }
}
[data-theme="dark"] .et-sidebar { background: rgba(15, 23, 42, 0.5); }
/* الجوال: الشريط الجانبي المنزلق غير شفّاف في الوضع الليلي (يتفوّق على القاعدة أعلاه بترتيب المصدر) */
@media (max-width: 991.98px) {
    [data-theme="dark"] .et-sidebar { background: var(--bg-850); }
}
[data-theme="dark"] .et-side-link:hover { background: rgba(148, 163, 184, 0.1); }
[data-theme="dark"] .et-side-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59, 130, 246, .22), rgba(99, 102, 241, .18));
    border-color: rgba(59, 130, 246, .35);
}
[data-theme="dark"] .et-tree-link:hover { background: rgba(148, 163, 184, 0.1); }
[data-theme="dark"] .et-tree-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59, 130, 246, .2), rgba(99, 102, 241, .16));
    border-color: rgba(59, 130, 246, .32);
}
[data-theme="dark"] details.et-fold > summary.et-fold-head:has(.et-badge-violet) { color: #93c5fd; }
[data-theme="dark"] details.et-fold > summary.et-fold-head:has(.et-badge-violet)::before { color: #93c5fd; }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus { background: var(--surface-2); }

/* زرّ تبديل الوضع — أيقونتان (قمر/شمس) بأسلوب أيقونات الموقع (currentColor، بلا رموز تعبيرية ملوّنة).
   تُعرَض أيقونة القمر في الوضع النهاري (للتبديل إلى الليلي) والشمس في الوضع الليلي، عبر data-theme. */
.et-theme-toggle { display: inline-flex; align-items: center; justify-content: center; }
.et-theme-toggle .et-theme-ico { display: inline-flex; align-items: center; line-height: 0; }
.et-theme-toggle .et-theme-ico svg { width: 18px; height: 18px; }
.et-theme-toggle .et-theme-ico--sun { display: none; }
[data-theme="dark"] .et-theme-toggle .et-theme-ico--moon { display: none; }
[data-theme="dark"] .et-theme-toggle .et-theme-ico--sun { display: inline-flex; }

/* ===== مكوّن الشرح الموحّد (علامة !) — انقر لعرض التوضيح، وانقر خارجه للإغلاق ===== */
details.et-hint { display: inline-block; position: relative; vertical-align: middle; margin-inline-start: .3rem; }
details.et-hint > summary {
    list-style: none; cursor: help; user-select: none;
    width: 17px; height: 17px; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--border-strong);
    color: var(--text-muted); font-size: .7rem; font-weight: 800; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
details.et-hint > summary::-webkit-details-marker { display: none; }
details.et-hint > summary:hover { color: var(--text); border-color: var(--brand); }
details.et-hint[open] > summary { background: var(--brand); border-color: var(--brand); color: #fff; }
details.et-hint > .et-hint-pop {
    position: absolute; top: calc(100% + 7px); inset-inline-start: -8px; z-index: 1500;
    width: max-content; min-width: 200px; max-width: min(320px, 78vw);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    padding: .6rem .8rem; font-size: .8rem; font-weight: 400; line-height: 1.9;
    color: var(--text); text-align: start; white-space: normal; box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] details.et-hint > .et-hint-pop { background: #1e293b; }
@media print { details.et-hint { display: none; } }

/* شاشة تحميل تغطّي الصفحة أثناء استعادة حالة البطاقات والتمرير بعد الحفظ
   (تمنع رؤية القفز التلقائي). تظهر فور وضع html.et-restoring قبل الرسم، وتُزال بعد الاستعادة. */
html.et-restoring::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: var(--bg-900);
}
html.et-restoring::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    z-index: 3001;
    border: 4px solid var(--border-strong);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: et-spin .7s linear infinite;
}
@keyframes et-spin { to { transform: rotate(360deg); } }

/* ===== البحث الشامل (لوحة الأوامر) ===== */
/* ضوابط الشريط العلوي الموحّدة (بحث/صلاحية/خروج/الوضع النهاري-الليلي) — تصميم متناغم على كل الأحجام */
.et-search-trigger,
.et-tbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.et-search-trigger:hover,
.et-tbtn:hover { color: var(--text); border-color: var(--border-strong); }
.et-search-trigger svg,
.et-tbtn svg { width: 17px; height: 17px; }
.et-tbtn--icon { width: 36px; padding: 0; }                    /* أيقونة فقط (خروج/الوضع) */
.et-tbtn--role { cursor: default; font-weight: 700; }          /* شارة الصلاحية (غير قابلة للنقر) */
/* مدير/عضو بلون العلامة الأزرق لا البنفسجي — متناغم مع بقيّة عناصر الشريط. */
.et-tbtn--role.mgr,
.et-tbtn--role.mbr { color: var(--brand); border-color: rgba(37, 99, 235, .32); }

/* توحيد عناصر الشريط العلوي (شارات النوع/المرحلة/الصلاحية + الأزرار + القائمة) على ارتفاعٍ
   وحوافّ واحدة فتبدو بروح واحدة متقاربة. */
.et-topbar .et-badge {
    height: 36px; padding: 0 12px; border-radius: 10px;
    font-size: .82rem; font-weight: 600;
}
.et-topbar .form-select-sm { height: 36px; border-radius: 10px; }
.et-search-trigger .et-kbd {
    font-size: .68rem;
    background: var(--bg-800);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 1px 6px;
    color: var(--text-dim);
}

.et-srch { display: none; position: fixed; inset: 0; z-index: 2400; }
.et-srch.open { display: block; }
.et-srch-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(3px); }
.et-srch-panel {
    position: relative;
    margin: 8vh auto 0;
    max-width: 620px;
    width: calc(100% - 28px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: et-srch-in .14s ease;
}
@keyframes et-srch-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.et-srch-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.et-srch-bar-ico { color: var(--text-dim); display: inline-flex; }
.et-srch-bar-ico svg { width: 20px; height: 20px; }
.et-srch-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 1.05rem;
    color: var(--text);
}
.et-srch-input::placeholder { color: var(--text-dim); }
.et-srch-close {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    border-radius: 7px;
    padding: 3px 9px;
    font-size: .95rem;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.et-srch-close:hover { color: var(--text); border-color: var(--border-strong, var(--border)); }
.et-srch-list { overflow-y: auto; padding: 6px; }
.et-srch-group { font-size: .72rem; color: var(--text-dim); font-weight: 700; padding: 8px 12px 4px; }
.et-srch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
}
.et-srch-ico { display: inline-flex; color: var(--text-muted); flex: 0 0 auto; }
.et-srch-ico svg { width: 19px; height: 19px; }
.et-srch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.et-srch-label { font-size: .95rem; }
.et-srch-sub { font-size: .72rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; }
.et-srch-loading { padding: 10px 14px; font-size: .85rem; color: var(--text-dim); }

/* إبراز عنصر الوجهة بعد اختياره من البحث (تمرير + توسيع البطاقات) */
.et-find-hit { animation: et-find-flash 2.5s ease; border-radius: 10px; scroll-margin: 80px; }
@keyframes et-find-flash {
    0% { box-shadow: 0 0 0 3px var(--brand), 0 0 0 7px var(--brand-glow); background-color: var(--brand-glow); }
    70% { box-shadow: 0 0 0 3px var(--brand), 0 0 0 7px var(--brand-glow); background-color: var(--brand-glow); }
    100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; background-color: transparent; }
}
.et-srch-row.sel, .et-srch-row:hover { background: var(--brand-glow); }
.et-srch-row.sel .et-srch-ico, .et-srch-row:hover .et-srch-ico { color: var(--brand); }
.et-srch-hl { background: rgba(37, 99, 235, .22); color: inherit; border-radius: 4px; padding: 0 1px; font-weight: 700; }
.et-srch-empty { padding: 28px 16px; text-align: center; color: var(--text-dim); }
.et-srch-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 9px 16px;
    border-top: 1px solid var(--border);
    font-size: .72rem;
    color: var(--text-dim);
}
.et-srch-foot kbd {
    margin-inline-end: 3px;
    font-family: inherit;
    font-size: .68rem;
    background: var(--bg-800);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 1px 6px;
    color: var(--text-dim);
}
html.et-search-open, html.et-search-open body { overflow: hidden; }
/* لا تُغطِّ شاشةُ الاستعادة لوحةَ البحث المفتوحة (z=3000 فوق اللوحة z=2400) */
html.et-search-open.et-restoring::before, html.et-search-open.et-restoring::after { display: none; }
@media (max-width: 575.98px) {
    .et-srch-panel { margin-top: 0; width: 100%; height: 100%; max-height: 100vh; border-radius: 0; border: 0; }
    /* تحسين ملاءمة المحتوى للجوال: حشو أقل وحوافّ ألطف ومنع أي تجاوز أفقي */
    .et-content { padding: .7rem; }
    .et-card-pad { padding: .8rem; }
    .et-card { border-radius: 12px; }
    .et-topbar { padding: 0 .55rem; gap: .3rem; }
    img, svg, canvas, iframe { max-width: 100%; }
    .et-card { overflow-x: auto; } /* أي جدول/محتوى عريض داخل بطاقة يمرّر أفقياً بدل تجاوز الشاشة */

    /* الشريط العلوي على الجوال: نفس ضوابط 36px الموحّدة، تتّسع دون تجاوز */
    .et-topbar .d-flex.align-items-center.gap-2 { gap: .3rem !important; }
    .et-topbar .btn.btn-sm {                       /* زرّ القائمة ☰ ليطابق بقية الضوابط */
        width: 36px; height: 36px; padding: 0; border-radius: 10px;
        display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .et-search-trigger, .et-tbtn { flex-shrink: 0; }
    .et-search-trigger { width: 36px; padding: 0; } /* البحث أيقونة فقط (النصّ مخفيّ على الجوال) */
    .et-topbar .form-select-sm { min-width: 0 !important; max-width: 88px; }
    /* شارة النطاق تُخفى على الجوال: صارت تحمل النوع وتركيبة المراحل معاً («حكومي ابتدائي - متوسط»)
       فلا يتّسع لها الشريط، والقصّ بالنقاط يجعلها بلا فائدة. وهي متاحةٌ في «البيانات الرئيسية». */
    .et-type-badge { display: none; }
    .et-brand .logo { flex-shrink: 0; }
}
/* الوضع الليلي: لوحة أكثر تعتيماً وإبراز تطابق أوضح */
:root[data-theme="dark"] .et-srch-panel { background: rgba(30, 41, 59, .96); }
:root[data-theme="dark"] .et-srch-hl { background: rgba(59, 130, 246, .42); color: #dbeafe; }

/* شريط التعميمات المتحرّك أعلى الموقع (Marquee) — غير قابل للإغلاق */
.et-marquee {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: linear-gradient(90deg, rgba(59, 130, 246, .16), rgba(139, 92, 246, .16));
    border-bottom: 1px solid var(--border);
    box-shadow: inset 0 -1px 0 rgba(148, 163, 184, .12);
}
.et-marq-track {
    display: flex;
    width: max-content;
    animation: et-marq-scroll 34s linear infinite;
    will-change: transform;
}
.et-marquee:hover .et-marq-track { animation-play-state: paused; }
.et-marq-copy {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding-inline: 1.5rem;
    white-space: nowrap;
}
.et-marq-item {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .84rem;
    padding-block: .5rem;
}
.et-marq-item .ttl { font-weight: 700; color: var(--text); }
.et-marq-item .bd { color: var(--text-muted); }
.et-marq-item a { color: var(--brand); font-weight: 700; text-decoration: none; }
.et-marq-item a:hover { text-decoration: underline; }
@keyframes et-marq-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .et-marq-track { animation: none; flex-wrap: wrap; }
    .et-marq-copy[aria-hidden="true"] { display: none; }
}

/* شريط تقدّم تحليل التقويم الخارجي — يبقى ظاهراً أسفل كل صفحات المدرسة أثناء التحليل، غير حاجب.
   الخلفية مُعتِمة تماماً (غير شفافة) كي لا يظهر محتوى الصفحة خلف الشريط. */
.et-anbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 1080; background: #ffffff;
    border-top: 1px solid var(--border); box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
:root[data-theme="dark"] .et-anbar { background: #1e293b; }
.et-anbar[hidden] { display: none; }
.et-anbar-progress { position: absolute; top: 0; inset-inline-start: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg,var(--brand),var(--brand-2)); transition: width .9s linear; }
.et-anbar-row { display: flex; align-items: center; gap: .75rem; max-width: 1100px; margin: 0 auto; padding: .6rem 1rem; }
.et-anbar-row[hidden] { display: none; }
.et-anbar-spinner { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
    border: 3px solid var(--surface-2); border-top-color: var(--brand); animation: et-anbar-spin .9s linear infinite; }
.et-anbar-tag { font-size: .78rem; font-weight: 700; color: var(--text-dim); flex-shrink: 0; white-space: nowrap; }
.et-anbar-phrase { flex: 1; min-width: 0; font-size: .9rem; font-weight: 600; text-align: start;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .22s; }
.et-anbar-time { font-size: .8rem; color: var(--text-dim); flex-shrink: 0; white-space: nowrap; }
.et-anbar-pct { font-size: 1rem; font-weight: 800; flex-shrink: 0; min-width: 3.2ch; text-align: end; letter-spacing: .3px; }
.et-anbar-check { font-size: 1.35rem; line-height: 1; color: #34d399; flex-shrink: 0; }
.et-anbar-x { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.et-anbar-msg { flex: 1; min-width: 0; font-size: .9rem; font-weight: 600; text-align: start; }
.et-anbar-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.05rem; line-height: 1; padding: .1rem .4rem; border-radius: 6px; flex-shrink: 0; }
.et-anbar-close:hover { background: var(--surface-2); color: var(--text); }
@keyframes et-anbar-spin { to { transform: rotate(360deg); } }

/* تجاوب شريط التحليل مع مختلف أحجام الشاشات — يبقى سطراً واحداً سليماً بإخفاء الأقل أهميّةً تدريجياً */
@media (max-width: 768px) {
    .et-anbar-row { gap: .5rem; padding: .55rem .7rem; }
    .et-anbar-time { display: none; }              /* الوقت التفصيلي يختفي على الأجهزة اللوحية والأصغر */
}
@media (max-width: 560px) {
    .et-anbar-row { gap: .45rem; padding: .5rem .65rem; }
    .et-anbar-phrase { display: none; }            /* العبارة المتغيّرة تختفي؛ يبقى المؤشّر + الوسم + النسبة */
    .et-anbar-tag { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .et-anbar-spinner { width: 18px; height: 18px; border-width: 2px; }
    .et-anbar-pct { font-size: .92rem; min-width: 2.6ch; }
    .et-anbar-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .et-anbar-check, .et-anbar-x { font-size: 1.1rem; }
    /* أهداف لمس مريحة على الجوال (~44px) في حالتَي «تم/خطأ» — صفّ التحميل يبقى نحيفاً بلا أزرار */
    .et-anbar-close { min-width: 44px; min-height: 44px; padding: 0 .35rem;
        display: inline-flex; align-items: center; justify-content: center; }
    .et-anbar-row .btn { min-height: 44px; padding-inline: .8rem;
        display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 380px) {
    .et-anbar-tag { font-size: .72rem; }
    .et-anbar-row { gap: .35rem; padding: .5rem .55rem; }
}
/* احترام تفضيل تقليل الحركة: إيقاف دوران المؤشّر (كما في الشريط المتحرّك) */
@media (prefers-reduced-motion: reduce) {
    .et-anbar-spinner { animation: none; }
}

/* ─── نافذة حوار أصلية <dialog> (استيراد Excel وغيرها) — بلا Bootstrap JS ─── */
.et-dialog {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 0;
    width: min(440px, calc(100vw - 2rem));
    box-shadow: 0 24px 64px rgba(2, 6, 23, .45);
}

.et-dialog::backdrop {
    background: rgba(2, 6, 23, .55);
    backdrop-filter: blur(2px);
}

.et-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .9rem 1.1rem .35rem;
}

.et-dialog-body {
    padding: .35rem 1.1rem 1.1rem;
}

/* شارة إشعار بجانب رابط التنقّل (رسائل دعم جديدة) */
/* شارات شواهد البرامج التشغيلية: أيقونة + عدد (لا دائرة حمراء) — تُستخدم في الشريط الجانبي وفي بطاقات البرامج */
.et-ev-chips { display: inline-flex; align-items: center; gap: 4px; }
.et-side-link .et-ev-chips { margin-inline-start: auto; }

.et-ev-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: .7rem;
    font-weight: 800;
    line-height: 1.7;
    white-space: nowrap;
}

.et-ev-chip--pending { color: #fbbf24; background: rgba(245, 158, 11, .16); }
.et-ev-chip--rejected { color: #fca5a5; background: rgba(239, 68, 68, .16); }

.et-nav-badge {
    margin-inline-start: auto;
    background: #e05c5c;
    color: #fff;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(224, 92, 92, .25);
}

/* ── إشعارات منبثقة في زاوية الموقع (Toasts) — بدل شريط الرسائل أعلى الصفحة ── */
.et-toasts {
    position: fixed;
    inset-block-end: 18px;
    inset-inline-start: 18px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    width: min(380px, 92vw);
    pointer-events: none;
}
.et-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: .55rem;
    background: var(--surface, #1e293b);
    border: 1px solid var(--border, rgba(148, 163, 184, .25));
    border-inline-start-width: 4px;
    border-radius: 12px;
    padding: .7rem .85rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .38);
    animation: etToastIn .25s ease;
}
.et-toast-ok { border-inline-start-color: #10b981; }
.et-toast-err { border-inline-start-color: #ef4444; }
.et-toast-info { border-inline-start-color: #3b82f6; }
.et-toast-warn { border-inline-start-color: #f59e0b; }
.et-toast .et-toast-msg { flex: 1; font-size: .9rem; line-height: 1.5; }
.et-toast .et-toast-x {
    margin-inline-start: auto;
    background: none;
    border: 0;
    color: var(--text-dim, #94a3b8);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 .2rem;
}
.et-toast .et-toast-x:hover { color: var(--text, #e2e8f0); }
.et-toast.et-hide { animation: etToastOut .3s ease forwards; }
@keyframes etToastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes etToastOut { to { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .et-toast, .et-toast.et-hide { animation: none; } }

/* ── عناصر ثانوية في الشريط الجانبي (الواجهة المبسّطة): «المزيد» + روابط أخفت ── */
.et-side-more {
    margin: .9rem .6rem .25rem;
    padding-top: .55rem;
    border-top: 1px solid var(--border, rgba(148, 163, 184, .25));
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-dim, #94a3b8);
    opacity: .8;
}
.et-side-link.et-side-sec { opacity: .72; font-size: .88rem; }
.et-side-link.et-side-sec:hover, .et-side-link.et-side-sec.active { opacity: 1; }

/* ============================================================
   عرض الشواهد الموحّد (_EvidenceFile + evidence.js)
   مصغّرة + QR + تحميل + عرض مباشر — بمتغيّرات الثيم فيتبع الوضعين والثيمين.
   ============================================================ */
.ev-file { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; vertical-align: middle; }
/* حين يقع الشاهد داخل شارة (حالة/اعتماد) تُسطَّح حوافّها الدائرية 999px حتى لا تظهر
   أطرافٌ فارغة حول المصغّرة المربّعة — تصير الشارة مستطيلاً مستدير الحواف. */
.et-badge:has(.ev-file) { border-radius: var(--radius-sm); }
.ev-file--paper { color: var(--text-dim); font-size: .82rem; }
.ev-thumb {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    object-fit: cover; border: 1px solid var(--border); background: var(--surface-2);
    cursor: zoom-in; flex: 0 0 auto;
}
.ev-name {
    color: inherit; text-decoration: none; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch;
}
.ev-name:hover { text-decoration: underline; }
.ev-tools { display: inline-flex; align-items: center; gap: .15rem; flex: 0 0 auto; }
.ev-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
    background: transparent; color: var(--text-dim); cursor: pointer;
    font-size: .82rem; line-height: 1; text-decoration: none;
}
.ev-btn:hover { background: rgba(148, 163, 184, .18); color: var(--text); }

/* النافذة العائمة للمعاينة/الرمز */
.ev-modal {
    display: none; position: fixed; inset: 0; z-index: 1090;
    background: rgba(2, 6, 23, .6); padding: 3vmin;
    align-items: center; justify-content: center;
}
.ev-modal.show { display: flex; }
.ev-modal-box {
    background: var(--bg-850); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); width: min(960px, 96vw); max-height: 92vh;
    display: flex; flex-direction: column; overflow: hidden;
}
.ev-modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .6rem .9rem; border-bottom: 1px solid var(--border);
}
.ev-modal-title { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-modal-x {
    border: 0; background: transparent; color: var(--text-dim);
    font-size: 1.1rem; cursor: pointer; line-height: 1; padding: .2rem .4rem; border-radius: 6px;
}
.ev-modal-x:hover { background: rgba(148, 163, 184, .18); color: var(--text); }
.ev-modal-body { padding: .8rem; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: .6rem; }

.ev-view-img { max-width: 100%; max-height: 80vh; border-radius: var(--radius-sm); }
.ev-view-vid { max-width: 100%; max-height: 80vh; border-radius: var(--radius-sm); background: #000; }
.ev-view-frame { width: 100%; height: 78vh; border: 0; border-radius: var(--radius-sm); background: #fff; }
.ev-view-note { font-size: .8rem; color: var(--text-dim); }
.ev-view-fallback { text-align: center; padding: 1.5rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.ev-view-fallback-ico { font-size: 2.4rem; }
.ev-view-fallback p { margin: 0; color: var(--text-muted); max-width: 40ch; }

.ev-qr { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: .5rem; }
.ev-qr-img { width: 220px; height: 220px; background: #fff; padding: 10px; border-radius: var(--radius-sm); }
.ev-qr-hint { margin: 0; color: var(--text-muted); font-size: .85rem; }
.ev-qr-link { font-size: .78rem; word-break: break-all; max-width: 90%; }

/* ── شريط الدخول كمستخدم (وضع التشخيص) — بطاقة منفصلة أعلى الصفحة، ليست لاصقة فلا تحجب النافبار ── */
.et-impbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
    margin: .6rem; padding: .5rem .85rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, #7f1d1d, #b91c1c);
    color: #fff; font-size: .82rem; line-height: 1.55;
    box-shadow: 0 6px 18px -6px rgba(0,0,0,.4);
}
.et-impbar-text { flex: 1 1 240px; min-width: 0; }
.et-impbar-warn { display: inline-block; margin-inline-start: .4rem; color: #fde68a; font-weight: 700; }
.et-impbar-back { background: #fff; color: #7f1d1d; border: 0; font-weight: 800; white-space: nowrap; }
.et-impbar-back:hover { background: #fee2e2; color: #7f1d1d; }
@media (max-width: 576px) { .et-impbar { margin: .5rem; font-size: .78rem; } }
@media print { .et-impbar { display: none; } }
