/* ==========================================================================
   منصة المحاكاة التفاعلية — نظام التصميم
   --------------------------------------------------------------------------
   ملف واحد بلا إطار عمل خارجي. الأسلوب: كلاسيكي أكاديمي — كحلي وذهبي، خلفية
   ورقية دافئة، حدود 1px، زوايا صغيرة، ظل واحد هادئ.
   الترتيب: المتغيّرات ← إعادة الضبط ← البنية ← المكوّنات ← واجهات خاصة.
   ========================================================================== */

/* ---------------------------------------------------------------- المتغيّرات */
:root {
    --ink: #16283f;
    --ink-soft: #2f4a66;
    --navy: #1d3f6e;
    --navy-dark: #16325a;
    --navy-tint: #eaeff6;
    --gold: #a67c2e;
    --gold-tint: #f6efdf;

    --paper: #f4f3ef;
    --surface: #ffffff;
    --surface-soft: #faf9f6;
    --line: #dcd8ce;
    --line-soft: #e9e6de;
    --text: #232d39;
    --muted: #6c7683;
    --faint: #8b95a1;

    --ok: #1e6b46;
    --ok-tint: #eef5f0;
    --warn: #8a5a12;
    --warn-tint: #fbf5e7;
    --err: #8f2f2b;
    --err-tint: #fbf0ef;
    --info: #1d4f8a;
    --info-tint: #eef3fa;

    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 10px;
    --shadow: 0 1px 2px rgba(22, 40, 63, .07);
    --shadow-md: 0 6px 18px rgba(22, 40, 63, .12);

    --sidebar-w: 264px;
    --topbar-h: 58px;

    --font: "Readex Pro", "Segoe UI", Tahoma, Arial, sans-serif;
    --mono: "Consolas", "Courier New", monospace;
}

.dark {
    --ink: #e7ecf2;
    --ink-soft: #c3cfdd;
    --navy: #4b7db4;
    --navy-dark: #3d6da3;
    --navy-tint: #1d2a3a;
    --gold: #c9a259;
    --gold-tint: #2a2418;

    --paper: #0e141d;
    --surface: #151d28;
    --surface-soft: #1a2432;
    --line: #2a3646;
    --line-soft: #222d3c;
    --text: #d7dee7;
    --muted: #98a5b4;
    --faint: #7d8b9b;

    --ok: #63b98c;
    --ok-tint: #14251c;
    --warn: #d8a84f;
    --warn-tint: #241f14;
    --err: #d9837e;
    --err-tint: #261717;
    --info: #7fb0e0;
    --info-tint: #16202e;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 8px 22px rgba(0, 0, 0, .4);
}

/* ------------------------------------------------------------- إعادة الضبط */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.7;
}

h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 700; line-height: 1.45; }
h1 { font-size: 20px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 14px; }
p { margin: 0 0 8px; }
p:last-child { margin-bottom: 0; }

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img, canvas, svg, iframe { max-width: 100%; }
img { height: auto; }
svg { flex-shrink: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

table { border-collapse: collapse; width: 100%; }

code, kbd, samp {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
    direction: ltr;
    unicode-bidi: embed;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[x-cloak], .hidden { display: none !important; }
/* قفل تمرير الخلفية أثناء فتح نافذة منبثقة (يُضاف ويُزال من Alpine) */
body.no-scroll { overflow: hidden; }
::selection { background: var(--navy); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ============================================================ البنية العامة */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset-block: 0;
    /* RTL: inline-start = الحافة اليمنى (مكان الشريط الجانبي الصحيح) */
    inset-inline-start: 0;
    z-index: 40;
    display: flex;
    width: var(--sidebar-w);
    flex-direction: column;
    background: var(--surface);
    border-inline-end: 1px solid var(--line);
}
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--topbar-h);
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.brand-mark--lg { width: 58px; height: 58px; border-radius: var(--radius-lg); }
.brand-mark--lg img { padding: 6px; }
.sidebar__brand-text { min-width: 0; }
.sidebar__name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar__role { font-size: 11px; color: var(--muted); line-height: 1.4; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 10px; }
.nav-label {
    margin: 14px 8px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--faint);
}
.nav-label:first-child { margin-top: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    margin-bottom: 2px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    border-inline-start: 3px solid transparent;
}
.nav-item:hover { background: var(--surface-soft); color: var(--ink); text-decoration: none; }
.nav-item svg { width: 16px; height: 16px; color: var(--muted); }
.nav-item.is-active {
    background: var(--navy-tint);
    border-inline-start-color: var(--navy);
    color: var(--navy);
    font-weight: 700;
}
.nav-item.is-active svg { color: var(--navy); }

.sidebar__foot { border-top: 1px solid var(--line); padding: 12px 14px; }
.who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.who__body { min-width: 0; flex: 1; }
.who__name { font-size: 13px; font-weight: 700; color: var(--ink); }
.who__meta { font-size: 11px; color: var(--muted); }

.avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    background: var(--navy-tint);
    border: 1px solid var(--line-soft);
    border-radius: 50%;
}
.avatar--sm { width: 26px; height: 26px; font-size: 11.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; }
.topbar__title {
    min-width: 0;
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar__actions { display: flex; align-items: center; gap: 6px; }

.content { flex: 1; padding: 22px 18px 44px; }
.content__inner { max-width: 1280px; margin-inline: auto; }
.content__inner--slim { max-width: 860px; }
.content__inner--wide { max-width: 1520px; }

.scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 34, .5);
    border: 0;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}

/* Fallback drawer state (works even when the Alpine CDN is unavailable):
   the toggle button adds/removes html.sidebar-open (mobile) or
   html.sidebar-collapsed (desktop). */
@media (max-width: 1023px) {
    html.sidebar-open .sidebar { transform: none; }
    html.sidebar-open .scrim { opacity: 1; visibility: visible; }
}
@media (max-width: 1023px) {
    /* الشريط العلوي يبقى فوق الدرج ليبقى زر الفتح/الغلق متاحاً دائماً */
    .topbar { z-index: 45; }
    .sidebar {
        inset-block-start: var(--topbar-h);
        transform: translateX(100%);
        transition: transform .3s cubic-bezier(.4, 0, .2, 1);
        box-shadow: var(--shadow-md);
    }
    .scrim { top: var(--topbar-h); }
    .sidebar.is-open { transform: none; }
    .topbar__menu { display: inline-flex; }
    .content { padding: 16px 13px 36px; }
}

/* حاسوب: الشريط ثابت يميناً + المحتوى يأخذ إزاحة تساوي عرضه، وكلاهما يتحرّك بسلاسة */
@media (min-width: 1024px) {
    .sidebar {
        position: fixed;
        transform: none;
        transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .28s ease;
    }
    .main {
        padding-inline-start: var(--sidebar-w);
        transition: padding-inline-start .3s cubic-bezier(.4, 0, .2, 1);
    }
    html.sidebar-collapsed .sidebar { transform: translateX(100%); opacity: 0; }
    html.sidebar-collapsed .main { padding-inline-start: 0; }
}

/* ================================================================ المكوّنات */

/* --- ترويسة الصفحة -------------------------------------------------------- */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.page-head__main { min-width: 0; }
.page-head__title { display: flex; align-items: center; gap: 9px; }
.page-head__title svg { width: 18px; height: 18px; color: var(--navy); }
.page-head__sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--navy); }
.crumbs span.sep { color: var(--line); }

/* --- الأزرار -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.btn:hover { background: var(--surface-soft); color: var(--ink); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn--primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.btn--primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn--gold { color: #fff; background: var(--gold); border-color: var(--gold); }
.btn--gold:hover { filter: brightness(.94); color: #fff; }
.btn--quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn--quiet:hover { background: var(--surface-soft); color: var(--ink); }
.btn--danger { color: var(--err); border-color: var(--line); }
.btn--danger:hover { background: var(--err-tint); border-color: var(--err); color: var(--err); }
.btn--sm { padding: 4px 9px; font-size: 12px; }
.btn--sm svg { width: 13px; height: 13px; }
.btn--lg { padding: 10px 20px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--icon { width: 34px; height: 34px; padding: 0; }
.btn--icon.btn--sm { width: 28px; height: 28px; }
.btn.is-on { color: #fff; background: var(--navy); border-color: var(--navy); }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-inline-start: -1px; }
.btn-group .btn:first-child { border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); margin-inline-start: 0; }
.btn-group .btn:last-child { border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }

/* --- الحقول --------------------------------------------------------------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid > .span-2 { grid-column: span 2; }
@media (max-width: 720px) {
    .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
    .form-grid > .span-2 { grid-column: auto; }
}

.field { display: block; min-width: 0; }
.field__label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-soft);
}
.req { color: var(--err); }
.field__hint { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.field__err { margin-top: 4px; font-size: 11.5px; font-weight: 700; color: var(--err); }

.input, .select, .textarea {
    display: block;
    width: 100%;
    padding: 8px 11px;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px var(--navy-tint);
}
.input[readonly], .input:disabled, .select:disabled { background: var(--surface-soft); color: var(--muted); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.input--ltr { direction: ltr; text-align: left; }
.input--sm, .select--sm { padding: 5px 8px; font-size: 12.5px; }
.input-group { display: flex; gap: 8px; }
.input-group > .input { flex: 1; min-width: 0; }

.check {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
}
.check input[type="checkbox"], .check input[type="radio"] {
    width: 15px;
    height: 15px;
    margin: 4px 0 0;
    accent-color: var(--navy);
    flex-shrink: 0;
}
.check__text { min-width: 0; }
.check-list { display: grid; gap: 8px; }
.check-list--inline { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.check-box {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.check-box:hover { border-color: var(--navy); }
.check-box input { accent-color: var(--navy); width: 15px; height: 15px; }
.check-box:has(input:checked) { background: var(--navy-tint); border-color: var(--navy); color: var(--navy); }

.switch { display: flex; align-items: center; gap: 10px; }
.switch input { width: 16px; height: 16px; accent-color: var(--navy); }
.switch__label { font-size: 13px; font-weight: 600; }
.switch__label small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }

form.stack, .stack { display: grid; gap: 14px; }
.stack--tight { gap: 9px; }

/* --- البطاقات ------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border-bottom: 1px solid var(--line-soft);
}
.card__title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.card__title svg { width: 16px; height: 16px; color: var(--muted); }
.card__hint { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.card__tools { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.card__body { padding: 15px; }
.card__body--flush { padding: 0; }
.card__foot {
    padding: 11px 15px;
    border-top: 1px solid var(--line-soft);
    background: var(--surface-soft);
    border-end-start-radius: var(--radius);
    border-end-end-radius: var(--radius);
}
.card--accent { border-inline-start: 3px solid var(--gold); }
.card--quiet { box-shadow: none; background: var(--surface-soft); }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr); }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* --- الجداول -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { font-size: 13.5px; }
.table th {
    padding: 9px 13px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-align: start;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 10px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table .chip { white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-soft); }
.table__num { font-weight: 700; color: var(--ink); }
.table__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.table__empty { padding: 30px 16px; text-align: center; color: var(--muted); }
/* صف عنوان مجموعة داخل الجدول (مثل: المرحلة الدراسية) */
.table__group td {
    padding: 8px 13px;
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
    background: var(--navy-tint);
    border-bottom: 1px solid var(--line);
}
.table__group svg { width: 14px; height: 14px; vertical-align: -2px; }

/* --- الشارات والوسوم ------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    white-space: nowrap;
}
.badge--ok { color: var(--ok); background: var(--ok-tint); border-color: var(--ok); }
.badge--warn { color: var(--warn); background: var(--warn-tint); border-color: var(--warn); }
.badge--err { color: var(--err); background: var(--err-tint); border-color: var(--err); }
.badge--info { color: var(--info); background: var(--info-tint); border-color: var(--info); }
.badge--gold { color: var(--gold); background: var(--gold-tint); border-color: var(--gold); }
.badge--plain { background: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}
.chip--stage { border-inline-start: 3px solid var(--navy); }
.chip--grade { border-inline-start: 3px solid var(--info); }
.chip--subject { border-inline-start: 3px solid var(--gold); }
.chip--unit { border-inline-start: 3px solid var(--ok); }

/* --- التنبيهات ------------------------------------------------------------ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 13px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--info);
    background: var(--info-tint);
    border: 1px solid var(--info);
    border-radius: var(--radius-sm);
}
.alert svg { width: 16px; height: 16px; margin-top: 3px; }
.alert__body { flex: 1; min-width: 0; }
.alert__close { border: 0; background: transparent; color: inherit; padding: 0; }
.alert--ok { color: var(--ok); background: var(--ok-tint); border-color: var(--ok); }
.alert--warn { color: var(--warn); background: var(--warn-tint); border-color: var(--warn); }
.alert--err { color: var(--err); background: var(--err-tint); border-color: var(--err); }

/* --- النافذة المنبثقة (Modal) -------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 20, 32, .55);
    backdrop-filter: blur(2px);
}
.modal__panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 980px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.modal__panel--sm { max-width: 620px; }
.modal__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-soft);
}
.modal__head > svg { width: 18px; height: 18px; color: var(--navy); }
.modal__title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.modal__body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.modal__body .card { box-shadow: none; }
.modal__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--line-soft);
    background: var(--surface-soft);
}
@media (max-width: 640px) {
    .modal { padding: 0; }
    .modal__panel { max-height: 100vh; border: 0; border-radius: 0; }
}

/* --- حركة النافذة المنبثقة (تُشغَّل من Alpine عبر x-transition) ------------ */
/* الخلفية تتلاشى، واللوحة تنزلق قليلاً من الأسفل مع تكبير بسيط — ظهور سلس بلا قفز. */
.modal--enter, .modal--leave { transition: opacity .3s ease; will-change: opacity; }
.modal--enter-from, .modal--leave-to { opacity: 0; }
.modal--enter-to, .modal--leave-from { opacity: 1; }

.modal--enter .modal__panel,
.modal--leave .modal__panel {
    /* نفس مدة الخلفية: Alpine يقيس المدة من العنصر الأب، فتساوي المدد يمنع أي قطع للحركة */
    transition: opacity .3s ease, transform .3s cubic-bezier(.22, .9, .28, 1);
    will-change: opacity, transform;
    transform-origin: 50% 46%;
}
.modal--enter-from .modal__panel,
.modal--leave-to .modal__panel { opacity: 0; transform: translateY(16px) scale(.975); }
.modal--enter-to .modal__panel,
.modal--leave-from .modal__panel { opacity: 1; transform: none; }

/* احترام تفضيل تقليل الحركة: تلاشٍ قصير بلا انزلاق أو تكبير */
@media (prefers-reduced-motion: reduce) {
    .modal--enter, .modal--leave,
    .modal--enter .modal__panel, .modal--leave .modal__panel { transition: opacity .12s ease; }
    .modal--enter-from .modal__panel,
    .modal--leave-to .modal__panel { transform: none; }
}

/* --- شريط التواصل (رقم الهاتف لطلب إضافة تجربة) --------------------------- */
.contact-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: var(--ink);
    background: var(--gold-tint);
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
}
.contact-note > svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; }
.contact-note__body { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.contact-note__body b { font-size: 13.5px; font-weight: 700; }

/* --- التبويبات والترقيم --------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    margin-bottom: -1px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--ink); background: var(--surface-soft); text-decoration: none; }
.tab.is-active { color: var(--navy); background: var(--surface); border-color: var(--line) var(--line) transparent; }
.tabs--pill { gap: 6px; border-bottom: 0; margin-bottom: 12px; }
.tabs--pill .tab { flex: 1; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 0; color: var(--ink-soft); background: var(--surface); }
.tabs--pill .tab:hover { background: var(--surface-soft); }
.tabs--pill .tab.is-active { color: #fff; background: var(--navy); border-color: var(--navy); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; margin-top: 18px; font-size: 13px; }
.pager a, .pager span {
    min-width: 32px;
    padding: 5px 9px;
    text-align: center;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.pager a:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.pager .is-current { color: #fff; background: var(--navy); border-color: var(--navy); }
.pager .is-gap { border-color: transparent; background: transparent; color: var(--faint); }

/* --- حالات ومساعدات ------------------------------------------------------- */
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.empty svg { width: 32px; height: 32px; color: var(--faint); margin-bottom: 8px; }
.empty__title { font-size: 14px; font-weight: 700; color: var(--ink); }
.empty__sub { margin-top: 3px; font-size: 12.5px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 700; color: var(--ink); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; }
.row { display: flex; align-items: center; gap: 8px; }
.row--wrap { flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }
.row--top { align-items: flex-start; }
.push { margin-inline-start: auto; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { width: 1px; height: 20px; background: var(--line); }
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.stat {
    padding: 12px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stat__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat svg { width: 16px; height: 16px; color: var(--muted); }
.stat__value { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.stat__label { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
a.stat { display: block; }
a.stat:hover { border-color: var(--navy); text-decoration: none; }
a.stat:hover .stat__value { color: var(--navy); }

.kv { display: grid; gap: 8px; font-size: 13px; }
.kv__row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line-soft); }
.kv__row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv__k { font-size: 12.5px; font-weight: 700; color: var(--muted); }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}
.filters { display: grid; gap: 12px; grid-template-columns: minmax(190px, 2fr) repeat(3, minmax(130px, 1fr)) auto; align-items: end; }
@media (max-width: 1000px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .filters { grid-template-columns: 1fr; } }

.star { border: 0; background: transparent; padding: 2px; font-size: 17px; line-height: 1; color: var(--line); }
.star:hover { color: var(--gold); }
.star.is-on { color: var(--gold); }

.toast {
    position: fixed;
    inset-block-end: 18px;
    inset-inline-start: 18px;
    z-index: 60;
    max-width: 320px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--ink);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity .2s;
}
.toast--ok { background: var(--ok); }
.toast--err { background: var(--err); }

/* ============================================================ بطاقات المحاكاة */
.sim-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.sim-card:hover { border-color: var(--navy); }
.sim-card__top { display: flex; align-items: flex-start; gap: 8px; }
.sim-card__title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.sim-card__title a { color: inherit; }
.sim-card__title a:hover { color: var(--navy); text-decoration: none; }
.sim-card__desc {
    font-size: 12.5px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}
.sim-card__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-card__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.sim-card__no {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}

.group {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}
.group__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    border-inline-start: 3px solid var(--navy);
}
.group__title { font-size: 14px; font-weight: 700; color: var(--ink); }
.group__sub { font-size: 11.5px; color: var(--muted); }
.group__body { padding: 14px; }

/* ============================================================ منصة التشغيل */
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage__bar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 9px 11px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-soft);
    border-start-start-radius: var(--radius);
    border-start-end-radius: var(--radius);
}
.stage__frame {
    position: relative;
    overflow: hidden;
    background: #0b1220;
    border-radius: 0 0 var(--radius) var(--radius);
}
#sim-canvas-host { display: flex; align-items: center; justify-content: center; min-height: 360px; }
#sim-annotation-layer { position: absolute; inset: 0; pointer-events: none; }
/* ملء الشاشة: منصة التشغيل تملأ الشاشة، ويتمدّد إطار الرسم/التجربة ليملأ الارتفاع */
.stage:fullscreen,
.stage:-webkit-full-screen,
.stage.is-fullscreen {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.stage:fullscreen .stage__bar,
.stage:-webkit-full-screen .stage__bar,
.stage.is-fullscreen .stage__bar { border-radius: 0; }
.stage:fullscreen .stage__frame,
.stage:-webkit-full-screen .stage__frame,
.stage.is-fullscreen .stage__frame {
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 0;
}
.stage:fullscreen #sim-canvas-host,
.stage:-webkit-full-screen #sim-canvas-host,
.stage.is-fullscreen #sim-canvas-host {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
}
/* التجارب المدمجة (iframe) تتجاهل ارتفاعها المسجّل في وضع ملء الشاشة */
.stage:fullscreen #sim-canvas-host iframe,
.stage:-webkit-full-screen #sim-canvas-host iframe,
.stage.is-fullscreen #sim-canvas-host iframe {
    height: 100% !important;
    min-height: 0 !important;
}
.stage:fullscreen #sim-canvas-host canvas,
.stage:-webkit-full-screen #sim-canvas-host canvas,
.stage.is-fullscreen #sim-canvas-host canvas { max-height: 100%; }

/* أشرطة التحكم الحيّة: جزء من المنصة نفسها (لا قسم منفصل)، وتُبنى فقط
   للمحاكايات التي لها معاملات، فتظهر أيضاً في وضع ملء الشاشة. */
.stage__controls {
    display: grid;
    gap: 12px 18px;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    padding: 12px;
    background: var(--surface-soft);
    border-top: 1px solid var(--line-soft);
    border-radius: 0 0 var(--radius) var(--radius);
}
.stage__frame--attached { border-radius: 0; }
.stage__controls .ctl { padding-bottom: 0; border-bottom: 0; }
.stage__controls:empty { display: none; }
.stage:fullscreen .stage__controls,
.stage:-webkit-full-screen .stage__controls,
.stage.is-fullscreen .stage__controls {
    max-height: 40vh;
    overflow-y: auto;
    border-radius: 0;
}

/* شعار صاحب الحساب (اسم الأستاذ) — يظهر داخل المنصة لا في هيكل الصفحة. */
.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--navy);
    white-space: nowrap;
    background: var(--navy-tint);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.owner-badge svg { width: 15px; height: 15px; }
.owner-badge__label { font-weight: 600; color: var(--muted); }
.owner-badge__name { font-weight: 700; color: var(--navy); }
.owner-badge__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.owner-badge__app { font-weight: 700; color: var(--gold); }

/* داخل المنصة: في وسط شريط الأزرار، طبقة شفافة لا تعترض النقر. */
.stage__owner {
    position: absolute;
    z-index: 4;
    inset-inline: 0;
    inset-block-start: 50%;
    width: max-content;
    max-width: calc(100% - 20px);
    margin-inline: auto;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    font-size: 12.5px;
    color: #fff;
    background: linear-gradient(135deg, rgba(22, 50, 90, .96), rgba(29, 63, 110, .96));
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    pointer-events: none;
}
.stage__owner .owner-badge__label { color: #cbd7e6; }
.stage__owner .owner-badge__name { color: #fff; }
.stage__owner .owner-badge__app { color: #e7c98a; }
.stage__owner .owner-badge__dot { background: rgba(255, 255, 255, .45); }

.stage:fullscreen .stage__owner,
.stage:-webkit-full-screen .stage__owner,
.stage.is-fullscreen .stage__owner,
.stage--present .stage__owner { display: inline-flex; }

.stage--present .stage__owner { padding: 7px 18px; font-size: 14px; }
@media (max-width: 860px) {
    /* على الشاشات الضيقة يزدحم الشريط: نخفي الشعار بدل تغطية الأزرار */
    .stage__owner { display: none !important; }
}

#sim-canvas-host.sim-host--block { display: block; }
@media (min-width: 768px) { #sim-canvas-host { min-height: 440px; } }

.readouts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: 12px; }
.readout {
    padding: 10px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.readout__label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.readout__value { margin-top: 2px; font-size: 17px; font-weight: 700; color: var(--navy); }

.chart-box { position: relative; height: 230px; }
#sim-chart { width: 100%; height: 100%; display: block; }

.ctl { padding-bottom: 12px; border-bottom: 1px dashed var(--line-soft); }
.ctl:last-child { padding-bottom: 0; border-bottom: 0; }
.ctl__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.ctl__label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.ctl__value { min-width: 46px; padding: 1px 6px; font-size: 11.5px; font-weight: 700; text-align: center; color: var(--navy); background: var(--navy-tint); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.ctl input[type="range"] { width: 100%; accent-color: var(--navy); }
.ctl input[type="number"], .ctl select { width: 100%; padding: 5px 8px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }

.panel-list { display: grid; gap: 8px; }
.panel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}
.panel-item__name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; text-align: start; background: transparent; border: 0; padding: 0; color: var(--ink-soft); }
.panel-item__name:hover { color: var(--navy); text-decoration: underline; }

.shots { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shot { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.shot__del {
    position: absolute;
    inset-inline-end: 5px;
    inset-block-start: 5px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(15, 23, 34, .72);
    border: 0;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity .15s;
}
.shot:hover .shot__del { opacity: 1; }

/* أدوات الرسم على المنصة */
.annot-bar {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    z-index: 12;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(12, 18, 28, .94);
    border: 1px solid #33455c;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.annot-bar.is-on { display: flex; }
.annot-dot {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 0;
}
.annot-btn {
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    color: #e8eef7;
    background: #24344a;
    border: 1px solid #33455c;
    border-radius: var(--radius-sm);
}
.annot-btn:hover { background: #2d415c; }
.annot-btn--danger { background: #8f2f2b; border-color: #a13834; }
.annot-btn--danger:hover { background: #a13834; }

.narrow { max-width: 780px; margin-inline: auto; }
.narrow--sm { max-width: 620px; margin-inline: auto; }
.row-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.num { direction: ltr; unicode-bidi: embed; text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot th {
    padding: 9px 13px;
    font-size: 12.5px;
    color: var(--ink);
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
    text-align: start;
}
.table tfoot th.num { text-align: end; }

.badge--money { color: var(--navy); background: var(--navy-tint); border-color: var(--navy); }

/* ================================================================ الدخول */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.auth__box {
    width: 100%;
    max-width: 860px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.auth--wide .auth__box { max-width: 1120px; grid-template-columns: 320px minmax(0, 1fr); }
.auth__side {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 32px 28px;
    background: var(--navy);
    color: #fff;
}
.dark .auth__side { background: #1b2c42; }

/* صورة back.svg كعنصر تزييني شفاف يندمج مع الخلفية الكحلية */
.auth__art {
    position: absolute;
    left: 50%;
    bottom: -10%;
    transform: translateX(-50%);
    width: 118%;
    max-width: none;
    opacity: .52;
    z-index: 0;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to top, #000 42%, transparent 100%);
    mask-image: linear-gradient(to top, #000 42%, transparent 100%);
}
.auth__side::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(16, 42, 68, .92) 0%, rgba(16, 42, 68, .45) 52%, rgba(16, 42, 68, .08) 100%);
}
.auth__side-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}
.auth__title { color: #fff; font-size: 21px; line-height: 1.4; }
.auth__tagline {
    margin-top: 4px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gold);
}
.auth__desc { margin-top: 8px; font-size: 12.5px; line-height: 1.95; color: rgba(255, 255, 255, .86); }
.auth__side p { color: rgba(255, 255, 255, .86); font-size: 13px; }
.auth__side .brand-mark {
    width: 58px;
    height: 58px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .45);
    box-shadow: var(--shadow-md);
}
.auth__side .brand-mark svg { width: 26px; height: 26px; }

/* رأس اللوحة: الشعار في الوسط وبحجم أكبر، والنص تحته في الوسط */
.auth__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding-top: 8px;
}
.auth__head .brand-mark--xl {
    width: 116px;
    height: 116px;
    border-radius: 26px;
    border-color: rgba(255, 255, 255, .55);
}
.auth__head .brand-mark--xl img { padding: 12px; }
@media (max-width: 780px) {
    .auth__head .brand-mark--xl { width: 96px; height: 96px; border-radius: 22px; }
}
.auth__form { padding: 32px 28px; }
.auth__note { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--muted); }
@media (max-width: 780px) {
    .auth__box { grid-template-columns: 1fr; max-width: 420px; }
    .auth__side { display: none; }
}

/* ============================================================ العرض التقديمي */
.board { display: flex; flex-direction: column; height: 100vh; background: var(--paper); }
.board__top {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.board__title { font-size: 14px; font-weight: 700; color: var(--ink); }
.board__stage { flex: 1; min-height: 0; padding: 12px; }
.board__stage > .stage { height: 100%; display: flex; flex-direction: column; }
.board__stage > .stage .stage__frame { flex: 1; }
.board__stage #sim-canvas-host { min-height: 0; height: 100%; }
.board__list {
    position: fixed;
    inset-block: 52px 0;
    inset-inline-start: 0;
    z-index: 45;
    width: 300px;
    overflow-y: auto;
    padding: 12px;
    background: var(--surface);
    border-inline-end: 1px solid var(--line);
}
.board__item { display: block; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--ink-soft); border-radius: var(--radius-sm); }
.board__item:hover { background: var(--surface-soft); text-decoration: none; }
.board__item.is-active { background: var(--navy-tint); color: var(--navy); font-weight: 700; }

@media (min-width: 1024px) { .scrim { display: none !important; } }

.content > .stack { gap: 16px; }
.content__inner > .stack > .card:first-child { margin-top: 0; }

/* زر فتح/طيّ القائمة: ظاهر دائماً في الشريط العلوي (زر واحد للفتح والغلق) */
.topbar__menu { display: inline-flex; position: relative; }
.topbar__menu .icon-menu,
.topbar__menu .icon-close {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transition: opacity .22s ease, transform .28s cubic-bezier(.4, 0, .2, 1);
}
.topbar__menu .icon-close { opacity: 0; transform: rotate(-90deg) scale(.6); }

/* جوال: مغلق → ☰ ، مفتوح → ✕ */
@media (max-width: 1023px) {
    html.sidebar-open .topbar__menu .icon-menu { opacity: 0; transform: rotate(90deg) scale(.6); }
    html.sidebar-open .topbar__menu .icon-close { opacity: 1; transform: none; }
}

/* حاسوب: الشريط ظاهر → ✕ (طيّ) ، مطوي → ☰ (إظهار) */
@media (min-width: 1024px) {
    .topbar__menu .icon-menu { opacity: 0; transform: rotate(-90deg) scale(.6); }
    .topbar__menu .icon-close { opacity: 1; transform: none; }
    html.sidebar-collapsed .topbar__menu .icon-menu { opacity: 1; transform: none; }
    html.sidebar-collapsed .topbar__menu .icon-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
}

.board__body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 12px;
    padding: 12px;
}
.board__aside { overflow-y: auto; }
@media (max-width: 980px) {
    .board__body { grid-template-columns: 1fr; overflow-y: auto; }
}
