﻿:root {
    --lm-primary-light-blue: #e0f2fe;
    --lm-text-ink: #0c4a6e;
}

body {
    font-family: 'Inter', sans-serif;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .lm-content,
body.rtl .lm-header,
body.rtl .lm-item {
    direction: rtl;
}

body.rtl .language-selector select {
    text-align: right;
}

.language-selector-wrapper {
    min-width: 140px;
    display: flex;
    align-items: center;
}

.language-selector {
    width: 100%;
}

.language-selector select {
    min-width: 140px;
    padding-inline: .5rem;
}

.language-selector-simple {
    display: flex;
    justify-content: flex-end;
    padding: 1rem;
}

body.rtl .language-selector-simple {
    justify-content: flex-start;
}

/* الحاوية العامة */
.lm-shell {
    min-height: 100vh;
    display: flex;
}

/* السايدبار */
.lm-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #fff;
    width: 260px;
    transition: width .3s ease, transform .3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    z-index: 50;
}

    /* حالة الطي */
    .lm-sidebar.collapsed {
        width: 72px;
    }

        .lm-sidebar.collapsed .lm-text,
        .lm-sidebar.collapsed .lm-arrow,
        .lm-sidebar.collapsed .lm-badge {
            opacity: 0;
            width: 0;
            visibility: hidden;
        }

/* أيقونات/أزرار */
.lm-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: .5rem;
    font-weight: 500;
    font-size: .9rem;
    color: #374151;
    position: relative;
    transition: background-color .2s, transform .1s;
}

    .lm-item:hover {
        background: #f1f5f9;
        text-decoration: none;
        color: #374151;
    }

    .lm-item.active, .lm-subitem.active {
        background: var(--lm-primary-light-blue);
        color: var(--lm-text-ink);
        font-weight: 600;
    }

        .lm-item.active .material-symbols-outlined,
        .lm-subitem.active .material-symbols-outlined {
            color: var(--lm-text-ink);
        }

.lm-subitem .material-symbols-outlined {
    font-size: 20px;
}

.lm-arrow {
    transition: transform .3s ease;
}

/* شارة الإشعارات */
.lm-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-weight: 700;
    font-size: .75rem;
    border-radius: 9999px;
    height: 20px;
    width: 20px;
}

/* ترويسة السايدبار */
.lm-sidehead {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.lm-logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

/* القوائم الداخلية */
.lm-nav {
    padding: .5rem;
}

.lm-submenu {
    padding-left: 1rem;
    margin-top: .25rem;
    display: none;
}

    .lm-submenu.open {
        display: block;
    }

    .lm-submenu .lm-item {
        padding: .45rem .6rem;
    }

/* تلميحات (عند الطي) */
.lm-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: .5rem;
    background: #111827;
    color: #fff;
    font-size: .75rem;
    padding: .2rem .4rem;
    border-radius: .375rem;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s;
}

.lm-sidebar.collapsed .lm-item:hover .lm-tooltip {
    opacity: 1;
    visibility: visible;
}
/*.lm-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
}*/

/* السلوك على الشاشات < 1024px: السايدبار يصير drawer */
@media (max-width: 1024px) {
    .lm-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        width: 260px;
    }

        .lm-sidebar.open {
            transform: translateX(0);
        }
}

/* الهيدر */
.lm-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 15px;
    /* padding: .75rem 1rem;*/
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* زر الهامبرجر */
#lm-toggle {
    border: 0;
    background: transparent;
    padding: .4rem;
    border-radius: .5rem;
}

    #lm-toggle:hover {
        background: #f3f4f6;
    }

/* الـ overlay للجوال */
.lm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 40;
    display: none;
}

    .lm-overlay.show {
        display: block;
    }

/* منطقة المحتوى */
.lm-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ltr {
    direction: ltr;
    unicode-bidi: plaintext; /* يمنع إعادة ترتيب الأرقام/الشرطات في RTL */
}
