/* V36 — Student header menu visibility and compact controls fix. */
/* Loaded after V35 to override legacy desktop-sidebar child sizing. */

body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-dashboard-bar,
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-dashboard-header.is-scrolled .ks-dashboard-bar{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
}

/* Logo stays at the RTL start (right), controls stay compact on the left. */
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-dash-brand{
  order:1!important;
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  margin:0!important;
}
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-dashboard-tools{
  order:2!important;
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  margin-inline-start:auto!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
}
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-dashboard-tools .preference-controls{
  display:flex!important;
  flex:0 0 auto!important;
  width:auto!important;
  margin:0!important;
  padding:0!important;
  gap:6px!important;
}
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-dashboard-tools .icon-btn,
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-history-back{
  display:inline-grid!important;
  flex:0 0 40px!important;
  width:40px!important;
  min-width:40px!important;
  max-width:40px!important;
  height:40px!important;
  min-height:40px!important;
  padding:0!important;
  margin:0!important;
}

/* Menu button must be visible on desktop and mobile. */
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-mobile-menu{
  order:3!important;
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
  flex:0 0 auto!important;
  width:auto!important;
  min-width:112px!important;
  max-width:none!important;
  height:42px!important;
  margin:0!important;
  padding:0 14px!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  white-space:nowrap!important;
}
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-mobile-menu::after{
  content:"القائمة"!important;
  display:inline!important;
  font-size:15px!important;
  font-weight:800!important;
}

/* Student navigation remains a dropdown opened only by the menu button. */
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) #sidebar.ks-dashboard-nav{
  display:none!important;
}
body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) #sidebar.ks-dashboard-nav.open{
  display:flex!important;
}

@media(max-width:760px){
  body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-dashboard-tools{
    gap:5px!important;
  }
  body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-dashboard-tools .icon-btn,
  body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-history-back{
    flex-basis:36px!important;
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
  }
  body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-mobile-menu{
    min-width:96px!important;
    height:38px!important;
    padding:0 10px!important;
  }
  body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-mobile-menu::after{
    font-size:13px!important;
  }
}

@media(max-width:500px){
  body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-mobile-menu{
    min-width:40px!important;
    width:40px!important;
    padding:0!important;
  }
  body:has(.ks-dashboard #sidebar a[href="#/my-courses"]) .ks-mobile-menu::after{
    display:none!important;
  }
}
