@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700;800&display=swap');

/*
 * Premium responsive sidebar layer
 * Keeps the platform's existing teal/green palette while unifying the
 * administrator, teacher and student navigation experiences.
 */
:root {
    --premium-sidebar-width: 268px;
    --premium-sidebar-mobile-width: min(86vw, 324px);
    --premium-sidebar-bg-start: #0d9488;
    --premium-sidebar-bg-mid: #0f766e;
    --premium-sidebar-bg-end: #115e59;
    --premium-sidebar-accent: #14b8a6;
    --premium-sidebar-text: rgba(255, 255, 255, .92);
    --premium-sidebar-muted: rgba(255, 255, 255, .68);
    --premium-sidebar-border: rgba(255, 255, 255, .12);
    --premium-sidebar-row: rgba(255, 255, 255, .055);
    --premium-sidebar-row-hover: rgba(255, 255, 255, .13);
    --premium-sidebar-row-open: rgba(5, 46, 43, .28);
    --premium-sidebar-submenu: rgba(5, 46, 43, .22);
    --premium-sidebar-shadow: -16px 0 40px rgba(15, 23, 42, .18);
}

/* Shared shell */
.sidebar.unified-sidebar,
.student-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: var(--premium-sidebar-width) !important;
    min-width: var(--premium-sidebar-width) !important;
    max-width: var(--premium-sidebar-width) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255,255,255,.30) rgba(255,255,255,.05) !important;
    background:
        radial-gradient(circle at 15% 8%, rgba(255,255,255,.13), transparent 25%),
        linear-gradient(180deg, var(--premium-sidebar-bg-start) 0%, var(--premium-sidebar-bg-mid) 47%, var(--premium-sidebar-bg-end) 100%) !important;
    color: #fff !important;
    border-right: 1px solid rgba(255,255,255,.08) !important;
    border-left: 0 !important;
    box-shadow: 16px 0 40px rgba(15, 23, 42, .18) !important;
    z-index: 1200 !important;
    direction: ltr !important;
    font-family: 'Tajawal', 'Inter', 'Segoe UI', Arial, sans-serif !important;
    isolation: isolate;
}

/* The interface changes direction at runtime. Use physical positioning so
   RTL always anchors the sidebar to the right and LTR to the left. */
html[dir="rtl"] .sidebar.unified-sidebar,
html[dir="rtl"] .student-sidebar,
body.rtl .sidebar.unified-sidebar,
body.rtl .student-sidebar {
    right: 0 !important;
    left: auto !important;
    direction: rtl !important;
    border-left: 1px solid rgba(255,255,255,.08) !important;
    border-right: 0 !important;
    box-shadow: -16px 0 40px rgba(15, 23, 42, .18) !important;
}

.sidebar.unified-sidebar::before,
.student-sidebar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    width: var(--premium-sidebar-width);
    height: 120px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.06), transparent);
    z-index: -1;
}
html[dir="rtl"] .sidebar.unified-sidebar::before,
html[dir="rtl"] .student-sidebar::before,
body.rtl .sidebar.unified-sidebar::before,
body.rtl .student-sidebar::before {
    right: 0 !important;
    left: auto !important;
}

.sidebar.unified-sidebar::-webkit-scrollbar,
.student-sidebar::-webkit-scrollbar,
.sidebar-submenu::-webkit-scrollbar,
.student-submenu::-webkit-scrollbar {
    width: 5px !important;
}
.sidebar.unified-sidebar::-webkit-scrollbar-track,
.student-sidebar::-webkit-scrollbar-track,
.sidebar-submenu::-webkit-scrollbar-track,
.student-submenu::-webkit-scrollbar-track {
    background: rgba(255,255,255,.045) !important;
}
.sidebar.unified-sidebar::-webkit-scrollbar-thumb,
.student-sidebar::-webkit-scrollbar-thumb,
.sidebar-submenu::-webkit-scrollbar-thumb,
.student-submenu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.28) !important;
    border-radius: 999px !important;
}

/* Header */
.unified-sidebar .sidebar-header,
.student-sidebar .sidebar-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    margin: 0 0 .55rem !important;
    padding: 1.15rem 1rem 1rem !important;
    text-align: center !important;
    border: 0 !important;
    border-bottom: 1px solid var(--premium-sidebar-border) !important;
    background: linear-gradient(180deg, rgba(13,148,136,.98), rgba(15,118,110,.94)) !important;
    box-shadow: 0 8px 24px rgba(5,46,43,.12) !important;
    backdrop-filter: blur(12px);
}

.unified-sidebar .sidebar-header img,
.student-sidebar .sidebar-header img {
    width: 58px !important;
    height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    object-fit: contain !important;
    margin: 0 auto .55rem !important;
    padding: 5px !important;
    border: 1px solid rgba(255,255,255,.25) !important;
    border-radius: 17px !important;
    background: rgba(255,255,255,.11) !important;
    box-shadow: 0 10px 25px rgba(5,46,43,.22), inset 0 1px 0 rgba(255,255,255,.14) !important;
    transform: none !important;
}

.unified-sidebar .sidebar-header h3,
.student-sidebar .sidebar-header h4 {
    margin: 0 !important;
    color: #fff !important;
    font-family: 'Tajawal', 'Inter', sans-serif !important;
    font-size: 1.06rem !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    text-shadow: 0 2px 8px rgba(5,46,43,.22) !important;
}
.student-sidebar .sidebar-header small {
    display: block !important;
    margin-top: .18rem !important;
    color: rgba(204,251,241,.82) !important;
    font-size: .72rem !important;
    font-weight: 500 !important;
    letter-spacing: .02em !important;
}

/* Reset old numbering and hover artefacts */
.unified-sidebar .sidebar-link-number,
.unified-sidebar .sidebar-dropdown-meta small,
.student-sidebar .student-link-number,
.student-sidebar .student-dropdown-meta small {
    display: none !important;
}
.unified-sidebar a::before,
.student-sidebar a::before {
    display: none !important;
}
.unified-sidebar a::after,
.student-sidebar a::after {
    display: none !important;
}

/* Main rows */
.student-sidebar .sidebar-nav {
    width: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
}

.unified-sidebar > a.sidebar-main-link,
.unified-sidebar > a.logout-link,
.student-sidebar .sidebar-nav > a,
.unified-sidebar .sidebar-dropdown-title,
.student-sidebar .student-dropdown-title {
    position: relative !important;
    width: calc(100% - 1rem) !important;
    min-height: 49px !important;
    margin: .18rem .5rem !important;
    padding: .68rem .82rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .65rem !important;
    flex: 0 0 auto !important;
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    outline: none !important;
    background: var(--premium-sidebar-row) !important;
    color: var(--premium-sidebar-text) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-align: left !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-family: inherit !important;
    font-size: .91rem !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transform: none !important;
    overflow: visible !important;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease !important;
}
html[dir="rtl"] .unified-sidebar > a.sidebar-main-link,
html[dir="rtl"] .unified-sidebar > a.logout-link,
html[dir="rtl"] .student-sidebar .sidebar-nav > a,
html[dir="rtl"] .unified-sidebar .sidebar-dropdown-title,
html[dir="rtl"] .student-sidebar .student-dropdown-title,
body.rtl .unified-sidebar > a.sidebar-main-link,
body.rtl .unified-sidebar > a.logout-link,
body.rtl .student-sidebar .sidebar-nav > a,
body.rtl .unified-sidebar .sidebar-dropdown-title,
body.rtl .student-sidebar .student-dropdown-title {
    text-align: right !important;
}


/* v12.0.1: top-level direct items (notably Academic Chat) use the same
   right-aligned icon+label grouping as dropdown section titles. */
.unified-sidebar > a.sidebar-main-link .sidebar-direct-label,
.unified-sidebar > a.logout-link .sidebar-direct-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: .72rem !important;
    min-width: 0 !important;
}
html[dir="rtl"] .unified-sidebar > a.sidebar-main-link,
html[dir="rtl"] .unified-sidebar > a.logout-link,
body.rtl .unified-sidebar > a.sidebar-main-link,
body.rtl .unified-sidebar > a.logout-link {
    justify-content: flex-start !important;
    direction: rtl !important;
}

.unified-sidebar .sidebar-dropdown,
.student-sidebar .student-dropdown {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.unified-sidebar .sidebar-dropdown-label,
.unified-sidebar .sidebar-direct-label,
.student-sidebar .student-dropdown-title > span:first-child,
.unified-sidebar > a.sidebar-main-link span,
.unified-sidebar > a.logout-link span,
.student-sidebar .sidebar-nav > a span {
    display: inline-flex !important;
    align-items: center !important;
    gap: .72rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
    color: inherit !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.35 !important;
}

.unified-sidebar .sidebar-dropdown-label i,
.unified-sidebar .sidebar-direct-label > i,
.student-sidebar .student-dropdown-title > span:first-child i,
.unified-sidebar > a.sidebar-main-link i,
.unified-sidebar > a.logout-link i,
.student-sidebar .sidebar-nav > a i {
    width: 29px !important;
    min-width: 29px !important;
    height: 29px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9px !important;
    background: rgba(255,255,255,.085) !important;
    color: rgba(255,255,255,.88) !important;
    font-size: .95rem !important;
    transform: none !important;
    transition: background-color .2s ease, color .2s ease !important;
}

.unified-sidebar .sidebar-dropdown-meta,
.student-sidebar .student-dropdown-meta {
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--premium-sidebar-muted) !important;
    border-radius: 8px !important;
    transition: background-color .2s ease, color .2s ease !important;
}
.unified-sidebar .sidebar-dropdown-meta .fa-chevron-down,
.student-sidebar .student-dropdown-meta .fa-chevron-down {
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    background: transparent !important;
    color: inherit !important;
    font-size: .68rem !important;
    transform: rotate(0deg) !important;
    transition: transform .24s ease !important;
}

.unified-sidebar > a.sidebar-main-link:hover,
.unified-sidebar > a.logout-link:hover,
.student-sidebar .sidebar-nav > a:hover,
.unified-sidebar .sidebar-dropdown-title:hover,
.unified-sidebar .sidebar-dropdown-title:focus-visible,
.student-sidebar .student-dropdown-title:hover,
.student-sidebar .student-dropdown-title:focus-visible {
    background: var(--premium-sidebar-row-hover) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.09) !important;
    box-shadow: 0 8px 20px rgba(5,46,43,.12) !important;
    transform: none !important;
}
.unified-sidebar > a.sidebar-main-link:hover i,
.unified-sidebar > a.logout-link:hover i,
.student-sidebar .sidebar-nav > a:hover i,
.unified-sidebar .sidebar-dropdown-title:hover .sidebar-dropdown-label i,
.student-sidebar .student-dropdown-title:hover > span:first-child i {
    background: rgba(255,255,255,.15) !important;
    color: #fff !important;
}

.unified-sidebar .sidebar-dropdown.is-open > .sidebar-dropdown-title,
.unified-sidebar .sidebar-dropdown.has-active > .sidebar-dropdown-title,
.student-sidebar .student-dropdown.is-open > .student-dropdown-title,
.student-sidebar .student-dropdown.has-active > .student-dropdown-title {
    background: var(--premium-sidebar-row-open) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.11) !important;
    box-shadow: inset 3px 0 0 var(--premium-sidebar-accent), 0 8px 18px rgba(5,46,43,.11) !important;
}
.unified-sidebar .sidebar-dropdown.is-open .sidebar-dropdown-meta,
.student-sidebar .student-dropdown.is-open .student-dropdown-meta {
    color: #fff !important;
    background: rgba(255,255,255,.10) !important;
}
.unified-sidebar .sidebar-dropdown.is-open .sidebar-dropdown-meta .fa-chevron-down,
.student-sidebar .student-dropdown.is-open .student-dropdown-meta .fa-chevron-down {
    transform: rotate(180deg) !important;
}

/* Submenus */
.unified-sidebar .sidebar-submenu,
.student-sidebar .student-submenu {
    position: relative !important;
    width: calc(100% - 1.35rem) !important;
    max-height: 0 !important;
    margin: 0 .68rem !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    border: 0 solid rgba(255,255,255,.08) !important;
    border-radius: 13px !important;
    background: var(--premium-sidebar-submenu) !important;
    transition: max-height .3s cubic-bezier(.4,0,.2,1), opacity .2s ease, padding .25s ease, margin .25s ease, visibility .2s ease !important;
}
.unified-sidebar .sidebar-submenu::before,
.student-sidebar .student-submenu::before {
    content: '';
    position: absolute;
    top: .55rem;
    bottom: .55rem;
    left: 1rem;
    right: auto;
    width: 1px;
    border-radius: 999px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,.23) 12%, rgba(255,255,255,.18) 88%, transparent);
    pointer-events: none;
}
html[dir="rtl"] .unified-sidebar .sidebar-submenu::before,
html[dir="rtl"] .student-sidebar .student-submenu::before,
body.rtl .unified-sidebar .sidebar-submenu::before,
body.rtl .student-sidebar .student-submenu::before {
    right: 1rem !important;
    left: auto !important;
}
.unified-sidebar .sidebar-dropdown:hover > .sidebar-submenu,
.unified-sidebar .sidebar-dropdown:focus-within > .sidebar-submenu,
.student-sidebar .student-dropdown:hover > .student-submenu,
.student-sidebar .student-dropdown:focus-within > .student-submenu {
    max-height: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
}
.unified-sidebar .sidebar-dropdown.is-open > .sidebar-submenu,
.student-sidebar .student-dropdown.is-open > .student-submenu,
.unified-sidebar .sidebar-dropdown.is-open:hover > .sidebar-submenu,
.unified-sidebar .sidebar-dropdown.is-open:focus-within > .sidebar-submenu,
.student-sidebar .student-dropdown.is-open:hover > .student-submenu,
.student-sidebar .student-dropdown.is-open:focus-within > .student-submenu {
    max-height: min(58vh, 610px) !important;
    margin-top: .1rem !important;
    margin-bottom: .3rem !important;
    padding: .38rem .34rem !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    border-width: 1px !important;
}

.unified-sidebar .sidebar-submenu a,
.student-sidebar .student-submenu a {
    position: relative !important;
    width: 100% !important;
    min-height: 39px !important;
    margin: .08rem 0 !important;
    padding: .5rem .58rem .5rem 1.85rem !important;
    display: flex !important;
    align-items: center !important;
    gap: .55rem !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: rgba(255,255,255,.78) !important;
    box-shadow: none !important;
    font-size: .82rem !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transform: none !important;
    overflow: visible !important;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease !important;
}
.unified-sidebar .sidebar-submenu a::before,
.student-sidebar .student-submenu a::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: .79rem !important;
    right: auto !important;
    width: 7px !important;
    height: 7px !important;
    border: 2px solid rgba(255,255,255,.46) !important;
    border-radius: 50% !important;
    background: var(--premium-sidebar-bg-mid) !important;
    opacity: 1 !important;
    transform: translateY(-50%) !important;
}
html[dir="rtl"] .unified-sidebar .sidebar-submenu a,
html[dir="rtl"] .student-sidebar .student-submenu a,
body.rtl .unified-sidebar .sidebar-submenu a,
body.rtl .student-sidebar .student-submenu a {
    padding: .5rem 1.85rem .5rem .58rem !important;
}
html[dir="rtl"] .unified-sidebar .sidebar-submenu a::before,
html[dir="rtl"] .student-sidebar .student-submenu a::before,
body.rtl .unified-sidebar .sidebar-submenu a::before,
body.rtl .student-sidebar .student-submenu a::before {
    right: .79rem !important;
    left: auto !important;
}
.unified-sidebar .sidebar-submenu a i,
.student-sidebar .student-submenu a i {
    width: 22px !important;
    min-width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 7px !important;
    background: rgba(255,255,255,.06) !important;
    color: rgba(255,255,255,.70) !important;
    font-size: .76rem !important;
    transform: none !important;
}
.unified-sidebar .sidebar-submenu a span,
.student-sidebar .student-submenu a span {
    display: block !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    line-height: 1.35 !important;
}
.unified-sidebar .sidebar-submenu a:hover,
.student-sidebar .student-submenu a:hover {
    background: rgba(255,255,255,.09) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.07) !important;
    transform: none !important;
}
.unified-sidebar .sidebar-submenu a.active,
.student-sidebar .student-submenu a.active,
.unified-sidebar > a.sidebar-main-link.active,
.student-sidebar .sidebar-nav > a.active {
    background: linear-gradient(135deg, rgba(20,184,166,.32), rgba(255,255,255,.12)) !important;
    color: #fff !important;
    border-color: rgba(153,246,228,.22) !important;
    box-shadow: inset 3px 0 0 #5eead4, 0 8px 20px rgba(5,46,43,.14) !important;
    font-weight: 700 !important;
}
.unified-sidebar .sidebar-submenu a.active::before,
.student-sidebar .student-submenu a.active::before {
    border-color: #99f6e4 !important;
    background: #5eead4 !important;
    box-shadow: 0 0 0 4px rgba(94,234,212,.12) !important;
}

/* Logout remains visually part of the palette, with a restrained warning hint. */
.unified-sidebar > a.logout-link,
.student-sidebar .sidebar-nav > a.logout {
    margin-top: auto !important;
    margin-bottom: .65rem !important;
    color: rgba(255,255,255,.80) !important;
    background: rgba(69,10,10,.10) !important;
}
.unified-sidebar > a.logout-link:hover,
.student-sidebar .sidebar-nav > a.logout:hover {
    background: rgba(239,68,68,.16) !important;
    color: #fff !important;
    border-color: rgba(254,202,202,.15) !important;
    box-shadow: inset 3px 0 0 #fca5a5 !important;
}

html[dir="rtl"] .unified-sidebar .sidebar-dropdown.is-open > .sidebar-dropdown-title,
html[dir="rtl"] .unified-sidebar .sidebar-dropdown.has-active > .sidebar-dropdown-title,
html[dir="rtl"] .student-sidebar .student-dropdown.is-open > .student-dropdown-title,
html[dir="rtl"] .student-sidebar .student-dropdown.has-active > .student-dropdown-title,
body.rtl .unified-sidebar .sidebar-dropdown.is-open > .sidebar-dropdown-title,
body.rtl .unified-sidebar .sidebar-dropdown.has-active > .sidebar-dropdown-title,
body.rtl .student-sidebar .student-dropdown.is-open > .student-dropdown-title,
body.rtl .student-sidebar .student-dropdown.has-active > .student-dropdown-title {
    box-shadow: inset -3px 0 0 var(--premium-sidebar-accent), 0 8px 18px rgba(5,46,43,.11) !important;
}
html[dir="rtl"] .unified-sidebar .sidebar-submenu a.active,
html[dir="rtl"] .student-sidebar .student-submenu a.active,
html[dir="rtl"] .unified-sidebar > a.sidebar-main-link.active,
html[dir="rtl"] .student-sidebar .sidebar-nav > a.active,
body.rtl .unified-sidebar .sidebar-submenu a.active,
body.rtl .student-sidebar .student-submenu a.active,
body.rtl .unified-sidebar > a.sidebar-main-link.active,
body.rtl .student-sidebar .sidebar-nav > a.active {
    box-shadow: inset -3px 0 0 #5eead4, 0 8px 20px rgba(5,46,43,.14) !important;
}
html[dir="rtl"] .unified-sidebar > a.logout-link:hover,
html[dir="rtl"] .student-sidebar .sidebar-nav > a.logout:hover,
body.rtl .unified-sidebar > a.logout-link:hover,
body.rtl .student-sidebar .sidebar-nav > a.logout:hover {
    box-shadow: inset -3px 0 0 #fca5a5 !important;
}

/* Desktop content offsets: LTR on the left, RTL on the right. */
.sidebar.unified-sidebar ~ .navbar {
    left: var(--premium-sidebar-width) !important;
    right: 0 !important;
}
.sidebar.unified-sidebar ~ .content,
.sidebar.unified-sidebar ~ main.content {
    margin-left: var(--premium-sidebar-width) !important;
    margin-right: 0 !important;
}
.student-content {
    margin-left: var(--premium-sidebar-width) !important;
    margin-right: 0 !important;
}
html[dir="rtl"] .sidebar.unified-sidebar ~ .navbar,
body.rtl .sidebar.unified-sidebar ~ .navbar {
    right: var(--premium-sidebar-width) !important;
    left: 0 !important;
}
html[dir="rtl"] .sidebar.unified-sidebar ~ .content,
html[dir="rtl"] .sidebar.unified-sidebar ~ main.content,
body.rtl .sidebar.unified-sidebar ~ .content,
body.rtl .sidebar.unified-sidebar ~ main.content {
    margin-right: var(--premium-sidebar-width) !important;
    margin-left: 0 !important;
}
html[dir="rtl"] .student-content,
body.rtl .student-content {
    margin-right: var(--premium-sidebar-width) !important;
    margin-left: 0 !important;
}

/* Mobile controls */
.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    width: 46px;
    height: 46px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.30);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--premium-sidebar-bg-start), var(--premium-sidebar-bg-mid));
    color: #fff;
    box-shadow: 0 10px 28px rgba(15,118,110,.28);
    z-index: 1302;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
html[dir="rtl"] .sidebar-mobile-toggle,
body.rtl .sidebar-mobile-toggle {
    right: max(12px, env(safe-area-inset-right));
    left: auto;
}
.sidebar-mobile-toggle:hover,
.sidebar-mobile-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(15,118,110,.34);
    outline: 3px solid rgba(20,184,166,.20);
    outline-offset: 2px;
}
.sidebar-mobile-toggle .toggle-icon,
.sidebar-mobile-toggle .toggle-icon::before,
.sidebar-mobile-toggle .toggle-icon::after {
    position: relative;
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .24s ease, opacity .2s ease, top .24s ease;
}
.sidebar-mobile-toggle .toggle-icon::before,
.sidebar-mobile-toggle .toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
}
.sidebar-mobile-toggle .toggle-icon::before { top: -6px; }
.sidebar-mobile-toggle .toggle-icon::after { top: 6px; }
body.sidebar-mobile-open .sidebar-mobile-toggle .toggle-icon { background: transparent; }
body.sidebar-mobile-open .sidebar-mobile-toggle .toggle-icon::before { top: 0; transform: rotate(45deg); }
body.sidebar-mobile-open .sidebar-mobile-toggle .toggle-icon::after { top: 0; transform: rotate(-45deg); }

.sidebar-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.50);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    z-index: 1190;
    transition: opacity .25s ease, visibility .25s ease;
}

@media (max-width: 991.98px) {
    .sidebar.unified-sidebar,
    .student-sidebar {
        width: var(--premium-sidebar-mobile-width) !important;
        min-width: var(--premium-sidebar-mobile-width) !important;
        max-width: var(--premium-sidebar-mobile-width) !important;
        transform: translateX(-105%) !important;
        visibility: hidden !important;
        transition: transform .3s cubic-bezier(.4,0,.2,1), visibility .3s ease !important;
        box-shadow: 18px 0 45px rgba(15,23,42,.28) !important;
    }
    html[dir="rtl"] .sidebar.unified-sidebar,
    html[dir="rtl"] .student-sidebar,
    body.rtl .sidebar.unified-sidebar,
    body.rtl .student-sidebar {
        transform: translateX(105%) !important;
        box-shadow: -18px 0 45px rgba(15,23,42,.28) !important;
    }
    .sidebar.unified-sidebar::before,
    .student-sidebar::before {
        width: var(--premium-sidebar-mobile-width) !important;
    }
    body.sidebar-mobile-open .sidebar.unified-sidebar,
    body.sidebar-mobile-open .student-sidebar {
        transform: translateX(0) !important;
        visibility: visible !important;
    }
    body.sidebar-mobile-open {
        overflow: hidden !important;
        touch-action: none;
    }
    .sidebar-mobile-toggle {
        display: inline-flex;
    }
    .sidebar-mobile-overlay {
        display: block;
    }
    body.sidebar-mobile-open .sidebar-mobile-overlay {
        opacity: 1;
        visibility: visible;
    }
    .unified-sidebar .sidebar-header,
    .student-sidebar .sidebar-header {
        min-height: 78px !important;
        padding: .75rem .8rem .7rem 4.2rem !important;
        display: grid !important;
        grid-template-columns: 45px minmax(0,1fr) !important;
        grid-template-rows: auto auto !important;
        column-gap: .7rem !important;
        align-items: center !important;
        text-align: left !important;
    }
    html[dir="rtl"] .unified-sidebar .sidebar-header,
    html[dir="rtl"] .student-sidebar .sidebar-header,
    body.rtl .unified-sidebar .sidebar-header,
    body.rtl .student-sidebar .sidebar-header {
        padding: .75rem 4.2rem .7rem .8rem !important;
        text-align: right !important;
    }
    .unified-sidebar .sidebar-header img,
    .student-sidebar .sidebar-header img {
        grid-row: 1 / span 2 !important;
        width: 45px !important;
        height: 45px !important;
        max-width: 45px !important;
        max-height: 45px !important;
        margin: 0 !important;
        border-radius: 13px !important;
    }
    .unified-sidebar .sidebar-header h3,
    .student-sidebar .sidebar-header h4 {
        font-size: .94rem !important;
        text-align: left !important;
    }
    .student-sidebar .sidebar-header small {
        margin: 0 !important;
        text-align: left !important;
    }
    html[dir="rtl"] .unified-sidebar .sidebar-header h3,
    html[dir="rtl"] .student-sidebar .sidebar-header h4,
    html[dir="rtl"] .student-sidebar .sidebar-header small,
    body.rtl .unified-sidebar .sidebar-header h3,
    body.rtl .student-sidebar .sidebar-header h4,
    body.rtl .student-sidebar .sidebar-header small {
        text-align: right !important;
    }
    .sidebar.unified-sidebar ~ .navbar {
        right: 0 !important;
        left: 0 !important;
        padding-left: 4.5rem !important;
        padding-right: initial !important;
    }
    html[dir="rtl"] .sidebar.unified-sidebar ~ .navbar,
    body.rtl .sidebar.unified-sidebar ~ .navbar {
        padding-right: 4.5rem !important;
        padding-left: initial !important;
    }
    .sidebar.unified-sidebar ~ .content,
    .sidebar.unified-sidebar ~ main.content,
    .student-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    .student-content {
        padding: 1rem !important;
    }
    .student-content .topbar {
        min-height: 66px !important;
        padding-left: 4.25rem !important;
        padding-right: initial !important;
    }
    html[dir="rtl"] .student-content .topbar,
    body.rtl .student-content .topbar {
        padding-right: 4.25rem !important;
        padding-left: initial !important;
    }
}

@media (max-width: 575.98px) {
    :root { --premium-sidebar-mobile-width: min(90vw, 310px); }
    .sidebar-mobile-toggle {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }
    .unified-sidebar > a.sidebar-main-link,
    .unified-sidebar > a.logout-link,
    .student-sidebar .sidebar-nav > a,
    .unified-sidebar .sidebar-dropdown-title,
    .student-sidebar .student-dropdown-title {
        min-height: 46px !important;
        font-size: .86rem !important;
    }
    .unified-sidebar .sidebar-submenu a,
    .student-sidebar .student-submenu a {
        min-height: 37px !important;
        font-size: .78rem !important;
    }
    .student-content {
        padding: .75rem !important;
    }
    .student-content .topbar {
        padding: .85rem .85rem .85rem 3.85rem !important;
        border-radius: 14px !important;
    }
    html[dir="rtl"] .student-content .topbar,
    body.rtl .student-content .topbar {
        padding: .85rem 3.85rem .85rem .85rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar.unified-sidebar,
    .student-sidebar,
    .sidebar-mobile-toggle,
    .sidebar-mobile-overlay,
    .sidebar-submenu,
    .student-submenu,
    .sidebar-dropdown-meta .fa-chevron-down,
    .student-dropdown-meta .fa-chevron-down {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Keep translated labels and their icons together in both directions. */
.unified-sidebar .sidebar-dropdown-label,
.unified-sidebar .sidebar-direct-label { flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; }
.unified-sidebar .sidebar-dropdown-label > i,
.unified-sidebar .sidebar-direct-label > i { flex: 0 0 1.25rem !important; margin: 0 !important; }
.unified-sidebar .sidebar-dropdown-label > span,
.unified-sidebar .sidebar-direct-label > span { min-width: 0 !important; display: block !important; }

/* Override the more-specific submenu span rule (which used display:block). */
.unified-sidebar .sidebar-submenu a > span.sidebar-direct-label {
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
    align-items: center !important; gap: .65rem !important; width: 100% !important;
}
.unified-sidebar .sidebar-submenu a > .sidebar-direct-label > i { flex: 0 0 22px !important; }
.unified-sidebar .sidebar-submenu a > .sidebar-direct-label > span { flex: 1 1 auto !important; min-width: 0 !important; }
