/* ════════════════════════════════════════════════════════════════
   Mobile Branch Switcher — يظهر فى أعلى الـ Sidebar فى الموبايل
   ────────────────────────────────────────────────────────────────
   ▸ Card علوى يعرض الفرع الحالى مع اللوجو
   ▸ نقرة → Bottom Sheet لاختيار فرع آخر
   ▸ يُخفى على الديسكتوب (>991px) — موجود بالفعل فى Header
   ════════════════════════════════════════════════════════════════ */

/* الـ Card الرئيسى */
.fs-mob-branch-card {
    display: none;     /* مخفى على الديسكتوب */
}

/* Bottom Sheet — مخفى على الديسكتوب */
.fs-mob-branch-overlay,
.fs-mob-branch-sheet {
    display: none;
}

/* ═══ على الموبايل (≤991px) — اظهار وتفعيل ═══ */
@media (max-width: 991px) {

    /* الكارد العلوى */
    .fs-mob-branch-card {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 10px 12px 8px;
        padding: 12px 14px;
        background: linear-gradient(135deg, var(--fs-tint-2) 0%, var(--fs-tint-3) 100%);
        border: 1.5px solid var(--fs-tint-4);
        border-radius: 14px;
        cursor: pointer;
        transition: all .18s ease;
        position: relative;
        overflow: hidden;
        font-family: 'Tajawal', 'Segoe UI', sans-serif;
    }
    .fs-mob-branch-card::before {
        content: '';
        position: absolute;
        top: -10px;
        inset-inline-end: -10px;
        width: 60px;
        height: 60px;
        background: radial-gradient(circle, rgba(var(--fs-primary-rgb), .15), transparent 70%);
        pointer-events: none;
    }
    .fs-mob-branch-card:hover {
        background: linear-gradient(135deg, var(--fs-tint-3) 0%, var(--fs-tint-5) 100%);
        border-color: var(--fs-primary);
        transform: translateY(-1px);
        box-shadow: 0 4px 14px rgba(var(--fs-primary-rgb), .2);
    }
    .fs-mob-branch-card:active {
        transform: scale(.98);
    }

    .fs-mob-branch-avatar {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep));
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 18px;
        overflow: hidden;
        box-shadow: 0 3px 10px rgba(var(--fs-primary-rgb), .35);
        flex-shrink: 0;
    }
    .fs-mob-branch-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .fs-mob-branch-avatar i {
        font-size: 20px;
    }

    .fs-mob-branch-info {
        flex: 1;
        min-width: 0;
        text-align: start;
    }
    .fs-mob-branch-label {
        font-size: 10.5px;
        font-weight: 600;
        color: var(--fs-primary-ink);
        text-transform: uppercase;
        letter-spacing: .4px;
        margin-bottom: 2px;
    }
    .fs-mob-branch-name {
        font-size: 14px;
        font-weight: 800;
        color: var(--fs-primary-ink-2);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }

    .fs-mob-branch-switch {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(var(--fs-primary-rgb), .15);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--fs-primary-deep);
        font-size: 16px;
        flex-shrink: 0;
        animation: fs-mob-branch-spin 4s linear infinite;
    }
    @keyframes fs-mob-branch-spin {
        from { transform: rotate(0deg); }
        to   { transform: rotate(360deg); }
    }

    /* ═══ Bottom Sheet — Overlay ═══ */
    .fs-mob-branch-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 10000;
        animation: fs-mob-branch-overlay-in .25s ease;
    }
    @keyframes fs-mob-branch-overlay-in {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    /* ═══ Bottom Sheet — Card ═══ */
    .fs-mob-branch-sheet {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 10001;
        background: #fff;
        border-radius: 24px 24px 0 0;
        max-height: 75vh;
        max-height: 75dvh;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
        animation: fs-mob-branch-sheet-up .3s cubic-bezier(0.22, 1, 0.36, 1);
        font-family: 'Tajawal', 'Segoe UI', sans-serif;
    }
    @keyframes fs-mob-branch-sheet-up {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    /* Handle bar */
    .fs-mob-branch-sheet-handle {
        width: 40px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 999px;
        margin: 10px auto 6px;
        flex-shrink: 0;
    }

    /* Header */
    .fs-mob-branch-sheet-header {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 18px 14px;
        border-bottom: 1px solid #E3ECEF;
    }
    .fs-mob-branch-sheet-header > i:first-child {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--fs-tint-2), var(--fs-tint-3));
        color: var(--fs-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        flex-shrink: 0;
    }
    .fs-mob-branch-sheet-header > div {
        flex: 1;
        min-width: 0;
    }
    .fs-mob-branch-sheet-title {
        font-size: 15px;
        font-weight: 800;
        color: #1f2937;
        line-height: 1.2;
    }
    .fs-mob-branch-sheet-count {
        font-size: 12px;
        color: #64748b;
        font-weight: 600;
        margin-top: 2px;
    }
    .fs-mob-branch-sheet-close {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #f1f5f9;
        color: #64748b;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .15s, color .15s;
    }
    .fs-mob-branch-sheet-close:hover {
        background: #fee2e2;
        color: #ef4444;
    }

    /* List */
    .fs-mob-branch-sheet-list {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px;
        padding-bottom: 24px;
    }

    /* Item */
    .fs-mob-branch-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        border-radius: 12px;
        cursor: pointer;
        transition: background .15s, transform .12s;
        margin-bottom: 4px;
    }
    .fs-mob-branch-item:hover {
        background: var(--fs-tint-2);
    }
    .fs-mob-branch-item:active {
        transform: scale(.98);
    }
    .fs-mob-branch-item.active {
        background: linear-gradient(135deg, var(--fs-tint-2), var(--fs-tint-3));
        border: 1.5px solid var(--fs-primary);
    }

    .fs-mob-branch-item-avatar {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: #f1f5f9;
        color: #64748b;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        overflow: hidden;
        flex-shrink: 0;
    }
    .fs-mob-branch-item.active .fs-mob-branch-item-avatar {
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep));
        color: #fff;
        box-shadow: 0 2px 6px rgba(var(--fs-primary-rgb), .3);
    }
    .fs-mob-branch-item-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .fs-mob-branch-item-body {
        flex: 1;
        min-width: 0;
        text-align: start;
    }
    .fs-mob-branch-item-name {
        font-size: 13.5px;
        font-weight: 700;
        color: #1f2937;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .fs-mob-branch-item.active .fs-mob-branch-item-name {
        color: var(--fs-primary-ink-2);
    }

    .fs-mob-branch-item-check,
    .fs-mob-branch-item-arrow {
        flex: 0 0 28px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        flex-shrink: 0;
    }
    .fs-mob-branch-item-check {
        background: linear-gradient(135deg, #22c55e, #16a34a);
        color: #fff;
        box-shadow: 0 2px 6px rgba(34, 197, 94, .35);
    }
    .fs-mob-branch-item-arrow {
        background: #f1f5f9;
        color: #94a3b8;
    }
}

/* ═══ Phones (≤480px) — أصغر شوية ═══ */
@media (max-width: 480px) {
    .fs-mob-branch-card {
        margin: 8px 10px 6px;
        padding: 10px 12px;
        gap: 10px;
    }
    .fs-mob-branch-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
    .fs-mob-branch-name {
        font-size: 13.5px;
    }
    .fs-mob-branch-sheet-list {
        padding: 6px;
    }
    .fs-mob-branch-item {
        padding: 10px;
    }
}

/* ════════════════════════════════════════════════════════════════
   App Version Badge — Login Screen Only (small, bottom)
   ════════════════════════════════════════════════════════════════ */
.fs-login-version {
    position: fixed;
    bottom: 12px;
    inset-inline-end: 12px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--fs-primary-rgb), .25);
    border-radius: 999px;
    font-family: 'Tajawal', 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--fs-primary-ink-2);
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    user-select: none;
}
.fs-login-version:hover {
    background: rgba(255, 247, 237, .95);
    border-color: rgba(var(--fs-primary-rgb), .5);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(var(--fs-primary-rgb), .15);
}
.fs-login-version:active {
    transform: scale(.96);
}
.fs-login-version > i {
    font-size: 13px;
    color: var(--fs-primary);
}
.fs-login-version-num {
    color: var(--fs-primary-ink);
    font-weight: 700;
    font-family: 'SFMono-Regular', Consolas, monospace;
    letter-spacing: .3px;
    font-size: 10.5px;
    padding-inline-start: 4px;
    border-inline-start: 1px solid rgba(var(--fs-primary-rgb), .25);
}
/* Update available state — pulse green */
.fs-login-version.fs-has-update {
    background: rgba(220, 252, 231, .95);
    border-color: #22c55e;
    color: #166534;
    animation: fs-login-version-pulse 2s ease-in-out infinite;
}
.fs-login-version.fs-has-update > i,
.fs-login-version.fs-has-update .fs-login-version-num {
    color: #16a34a;
}
@keyframes fs-login-version-pulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(34, 197, 94, .25), 0 0 0 0 rgba(34, 197, 94, .4); }
    50%      { box-shadow: 0 2px 10px rgba(34, 197, 94, .35), 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* على الموبايل — أصغر */
@media (max-width: 480px) {
    .fs-login-version {
        bottom: 10px;
        inset-inline-end: 10px;
        padding: 5px 10px;
        font-size: 10.5px;
    }
    .fs-login-version-num {
        font-size: 10px;
    }
}

/* ════════════════════════════════════════════════════════════════
   Mobile Drawer / Side Menu — Pro Mobile Design
   ─────────────────────────────────────────────────────────────
   ▸ يحول الـ Sidebar الموجود لتصميم drawer احترافى على الموبايل
   ▸ Slide from end (right in RTL)
   ▸ Backdrop blur عند الفتح
   ▸ Profile card علوى
   ▸ Search box للقوائم
   ▸ Submenus قابلة للطى مع animations ناعمة
   ▸ Active state بارز
   ▸ ⚠️ يطبق على الموبايل فقط (≤991px)
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 991px) {

    /* ═══ Backdrop Overlay ═══ */
    html.menu-opened body::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .65);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        z-index: 9998;
        opacity: 0;
        animation: fs-drawer-fade-in .25s ease forwards;
    }

    @keyframes fs-drawer-fade-in {
        to { opacity: 1; }
    }

    /* ═══ Sidebar Container — يصبح drawer ═══ */
    body .sidebar {
        position: fixed !important;
        top: 0 !important;
        inset-inline-start: 0 !important;       /* RTL: right | LTR: left */
        bottom: 0 !important;
        width: min(86vw, 320px) !important;
        max-width: 320px !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: linear-gradient(180deg, #fff 0%, var(--fs-tint-2) 100%) !important;
        z-index: 9999 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, .25) !important;
        /* مخفى افتراضياً */
        transform: translateX(-100%) !important;
        transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1) !important;
        border: none !important;
        border-radius: 0 24px 24px 0 !important;
    }

    /* RTL: drawer يخرج من اليمين */
    [dir="rtl"] body .sidebar,
    body.layout-mode-rtl .sidebar {
        inset-inline-start: auto !important;
        right: 0 !important;
        left: auto !important;
        transform: translateX(100%) !important;
        border-radius: 24px 0 0 24px !important;
    }

    /* عند الفتح */
    html.menu-opened body .sidebar,
    html.slide-nav body .sidebar,
    body.slide-nav .sidebar {
        transform: translateX(0) !important;
    }

    /* ═══ 1) Logo Section — Header بسيط ═══ */
    body .sidebar .sidebar-logo {
        flex-shrink: 0 !important;
        padding: 16px 18px !important;
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep)) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        border-radius: 0 24px 0 0 !important;
        position: relative !important;
        overflow: hidden !important;
    }
    [dir="rtl"] body .sidebar .sidebar-logo,
    body.layout-mode-rtl .sidebar .sidebar-logo {
        border-radius: 24px 0 0 0 !important;
    }
    /* Pattern زخرفى */
    body .sidebar .sidebar-logo::after {
        content: '';
        position: absolute;
        top: -30px;
        right: -30px;
        width: 100px;
        height: 100px;
        background: radial-gradient(circle, rgba(255,255,255,.2), transparent 70%);
        pointer-events: none;
    }
    body .sidebar .sidebar-logo .logo,
    body .sidebar .sidebar-logo .logo-small,
    body .sidebar .sidebar-logo .logo-white,
    body .sidebar .sidebar-logo .logo-normal {
        display: flex !important;
        align-items: center !important;
    }
    body .sidebar .sidebar-logo img {
        height: 36px !important;
        width: auto !important;
        max-width: 140px !important;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)) !important;
    }
    body .sidebar .sidebar-logo #toggle_btn {
        width: 36px !important;
        height: 36px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, .25) !important;
        color: #fff !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        border: none !important;
    }

    /* ═══ 2) Profile Section — مدمج ═══ */
    body .sidebar .modern-profile {
        flex-shrink: 0 !important;
        padding: 14px 16px !important;
        background: #fff !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }
    body .sidebar .modern-profile .user-profile {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        background: linear-gradient(135deg, var(--fs-tint-2), #fef3c7) !important;
        border: 1px solid var(--fs-tint-4) !important;
        border-radius: 14px !important;
        padding: 12px !important;
        margin: 0 !important;
        text-align: start !important;
    }
    body .sidebar .modern-profile .avatar {
        width: 48px !important;
        height: 48px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        position: relative !important;
    }
    body .sidebar .modern-profile .avatar img {
        width: 48px !important;
        height: 48px !important;
        border-radius: 50% !important;
        border: 2px solid #fff !important;
        box-shadow: 0 2px 6px rgba(0,0,0,.1) !important;
    }
    body .sidebar .modern-profile .avatar.online::after {
        content: '';
        position: absolute;
        bottom: 2px;
        inset-inline-end: 2px;
        width: 12px;
        height: 12px;
        background: #22c55e;
        border-radius: 50%;
        border: 2px solid #fff;
    }
    body .sidebar .modern-profile h6 {
        font-size: 14px !important;
        font-weight: 800 !important;
        color: #1f2937 !important;
        margin: 0 0 2px !important;
    }
    body .sidebar .modern-profile p {
        font-size: 11.5px !important;
        color: #64748b !important;
        margin: 0 !important;
        font-weight: 500 !important;
    }
    /* الـ tabs والـ quick buttons — مخفى */
    body .sidebar .modern-profile .sidebar-nav,
    body .sidebar .sidebar-header {
        display: none !important;
    }

    /* ═══ 3) Search Box (نضيفه via CSS) ═══ */
    body .sidebar .sidebar-inner {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* ═══ 4) Menu Container ═══ */
    body .sidebar #sidebar-menu,
    body .sidebar .sidebar-menu {
        padding: 8px 10px 24px !important;
        background: transparent !important;
    }
    body .sidebar .sidebar-menu > ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ═══ 5) Section Header ═══ */
    body .sidebar .submenu-hdr {
        font-size: 11px !important;
        font-weight: 800 !important;
        color: var(--fs-primary) !important;
        text-transform: uppercase !important;
        letter-spacing: .8px !important;
        margin: 12px 12px 6px !important;
        padding: 0 !important;
        border-bottom: 1px solid rgba(var(--fs-primary-rgb), .15) !important;
        padding-bottom: 4px !important;
    }
    body .sidebar .submenu-hdr:first-child {
        margin-top: 0 !important;
    }

    /* ═══ 6) Menu Items — إخفاء كل bullets على كل المتصفحات (خصوصاً Android) ═══ */
    body .sidebar ul,
    body .sidebar ol,
    body .sidebar ul ul,
    body .sidebar ul ol {
        list-style: none !important;
        list-style-type: none !important;
        list-style-image: none !important;
        list-style-position: outside !important;
    }
    body .sidebar ul li,
    body .sidebar ol li,
    body .sidebar ul ul li,
    body .sidebar li.submenu > ul > li {
        list-style: none !important;
        list-style-type: none !important;
        list-style-image: none !important;
        margin: 2px 0 !important;
    }
    /* إخفاء marker pseudo-element (متصفحات حديثة) */
    body .sidebar ul li::marker,
    body .sidebar ol li::marker,
    body .sidebar li.submenu > ul > li::marker {
        content: '' !important;
        display: none !important;
        font-size: 0 !important;
        color: transparent !important;
    }
    /* إخفاء أى pseudo bullets */
    body .sidebar ul li::before {
        content: none !important;
    }
    body .sidebar ul li > a {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 11px 14px !important;
        font-size: 13.5px !important;
        font-weight: 600 !important;
        color: #334155 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 10px !important;
        text-decoration: none !important;
        transition: background .15s, color .15s, transform .12s !important;
        position: relative !important;
        line-height: 1.3 !important;
        min-height: 42px !important;
    }
    body .sidebar ul li > a > i {
        font-size: 18px !important;
        color: #64748b !important;
        flex-shrink: 0 !important;
        width: 22px !important;
        text-align: center !important;
        transition: color .15s !important;
    }
    body .sidebar ul li > a > span {
        flex: 1 !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: start !important;
    }

    /* ═══ 7) Hover & Active States ═══ */
    body .sidebar ul li > a:hover {
        background: rgba(var(--fs-primary-rgb), .08) !important;
        color: var(--fs-primary-ink) !important;
    }
    body .sidebar ul li > a:hover > i {
        color: var(--fs-primary) !important;
    }
    body .sidebar ul li > a:active {
        transform: scale(.98) !important;
    }
    body .sidebar ul li > a.active,
    body .sidebar ul li.active > a {
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep)) !important;
        color: #fff !important;
        box-shadow: 0 4px 12px rgba(var(--fs-primary-rgb), .35) !important;
    }
    body .sidebar ul li > a.active > i,
    body .sidebar ul li.active > a > i {
        color: #fff !important;
    }

    /* ═══ 8) Submenu (متداخل) ═══ */
    body .sidebar li.submenu > a .menu-arrow {
        margin-inline-start: auto !important;
        font-size: 14px !important;
        color: #94a3b8 !important;
        transition: transform .25s !important;
        flex-shrink: 0 !important;
    }
    body .sidebar li.submenu > a .menu-arrow::before {
        content: '\f105' !important;        /* FontAwesome chevron-right */
        font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free', FontAwesome !important;
        font-weight: 900 !important;
    }
    /* RTL: arrow يقلب */
    [dir="rtl"] body .sidebar li.submenu > a .menu-arrow,
    body.layout-mode-rtl .sidebar li.submenu > a .menu-arrow {
        transform: scaleX(-1) !important;
    }
    /* عند الفتح، الـ arrow يدور — يدعم كل الـ JS handlers */
    body .sidebar li.submenu.subdrop > a .menu-arrow,
    body .sidebar li.submenu > a.subdrop .menu-arrow,
    body .sidebar li.submenu.submenu-open > a .menu-arrow {
        transform: rotate(90deg) !important;
        color: var(--fs-primary) !important;
    }
    [dir="rtl"] body .sidebar li.submenu.subdrop > a .menu-arrow,
    [dir="rtl"] body .sidebar li.submenu > a.subdrop .menu-arrow,
    [dir="rtl"] body .sidebar li.submenu.submenu-open > a .menu-arrow,
    body.layout-mode-rtl .sidebar li.submenu.subdrop > a .menu-arrow,
    body.layout-mode-rtl .sidebar li.submenu > a.subdrop .menu-arrow,
    body.layout-mode-rtl .sidebar li.submenu.submenu-open > a .menu-arrow {
        transform: scaleX(-1) rotate(-90deg) !important;
    }

    /* قائمة الـ submenu المتداخلة */
    body .sidebar li.submenu > ul {
        list-style: none !important;
        padding-inline-start: 22px !important;
        margin: 4px 0 !important;
        background: transparent !important;
        border-inline-start: 2px solid rgba(var(--fs-primary-rgb), .15) !important;
        margin-inline-start: 18px !important;
    }
    /* ✦ شيل أى ::before pseudo قديم من تيمبليت Dreams على روابط الـ submenu ✦
       (الموجود بـ position: absolute عند right: 13px فى RTL — كان بيغطى أول حرف) */
    body .sidebar li.submenu > ul li > a::before,
    body .sidebar li.submenu > ul li > a::after {
        content: none !important;
        display: none !important;
    }
    body .sidebar li.submenu > ul li > a {
        font-size: 13px !important;
        font-weight: 500 !important;
        padding: 9px 14px !important;
        min-height: 36px !important;
        text-indent: 0 !important;
        position: relative !important;
        background-clip: padding-box !important;
        border-radius: 8px !important;
        margin: 2px 6px !important;
    }
    /* ✦ ضمان إن النص الـ Arabic يبقى محاذى للـ start بشكل صحيح ✦ */
    [dir="rtl"] body .sidebar li.submenu > ul li > a,
    body.layout-mode-rtl .sidebar li.submenu > ul li > a {
        text-align: right !important;
        padding-right: 14px !important;
        padding-left: 14px !important;
    }
    body .sidebar li.submenu > ul li > a:hover {
        background: rgba(var(--fs-primary-rgb), .12) !important;
    }
    body .sidebar li.submenu > ul li > a.active {
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep)) !important;
        color: #fff !important;
        font-weight: 700 !important;
    }

    /* Slide animation للـ submenu — تدعم كل الـ JS handlers (jQuery + my handler) */
    /* الـ jQuery يستخدم slideDown/slideUp فبيحط display/height inline */
    /* فى البداية، الـ submenu مخفى */
    body .sidebar li.submenu > ul {
        display: none;
    }
    /* عند الفتح — jQuery يضيف subdrop على الـ <a>، أنا بضيفها على الـ <li> */
    body .sidebar li.submenu > a.subdrop + ul,
    body .sidebar li.submenu.subdrop > ul,
    body .sidebar li.submenu.submenu-open > ul {
        display: block !important;
        animation: fs-submenu-slide-down .25s ease-out;
    }
    @keyframes fs-submenu-slide-down {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* ═══ 9) Scrollbar ناعم ═══ */
    body .sidebar .sidebar-inner::-webkit-scrollbar {
        width: 4px;
    }
    body .sidebar .sidebar-inner::-webkit-scrollbar-track {
        background: transparent;
    }
    body .sidebar .sidebar-inner::-webkit-scrollbar-thumb {
        background: rgba(var(--fs-primary-rgb), .3);
        border-radius: 4px;
    }
    body .sidebar .sidebar-inner::-webkit-scrollbar-thumb:hover {
        background: rgba(var(--fs-primary-rgb), .5);
    }

    /* ═══ 10) منع scroll الصفحة عند فتح الـ drawer ═══ */
    html.menu-opened,
    html.slide-nav,
    body.slide-nav {
        overflow: hidden !important;
    }

    /* ═══ 11) Body wrapper — يبقى static (لا يتحرك) ═══ */
    body .main-wrapper {
        transform: none !important;
    }
}

/* ═══ على شاشات الموبايل الصغيرة (≤480px) ═══ */
@media (max-width: 480px) {
    body .sidebar {
        width: 88vw !important;
        max-width: 300px !important;
    }
    body .sidebar .sidebar-logo {
        padding: 14px 16px !important;
    }
    body .sidebar .sidebar-logo img {
        height: 32px !important;
    }
    body .sidebar .modern-profile {
        padding: 12px 14px !important;
    }
    body .sidebar .modern-profile .avatar,
    body .sidebar .modern-profile .avatar img {
        width: 42px !important;
        height: 42px !important;
    }
    body .sidebar ul li > a {
        font-size: 13px !important;
        padding: 10px 12px !important;
        min-height: 40px !important;
    }
    body .sidebar ul li > a > i {
        font-size: 17px !important;
    }
    body .sidebar li.submenu > ul li > a {
        font-size: 12.5px !important;
        padding: 8px 12px !important;
        margin: 2px 4px !important;
    }
    /* ✦ نفس فيكس الـ ::before للهواتف الصغيرة ✦ */
    body .sidebar li.submenu > ul li > a::before,
    body .sidebar li.submenu > ul li > a::after {
        content: none !important;
        display: none !important;
    }
    [dir="rtl"] body .sidebar li.submenu > ul li > a,
    body.layout-mode-rtl .sidebar li.submenu > ul li > a {
        text-align: right !important;
        padding-right: 12px !important;
        padding-left: 12px !important;
    }
}

/* ═══ Reduced motion ═══ */
@media (prefers-reduced-motion: reduce) {
    body .sidebar,
    body .sidebar li.submenu > ul {
        transition: opacity .15s ease !important;
    }
}
