/* =========================================================
   Smart Library Account Menu - stable compact dropdown
   إصلاح قائمة حساب مدير النظام بدون التأثير على بقية الهيدر
   ========================================================= */
.header .account-menu{
  position:relative !important;
  display:inline-flex !important;
  align-items:center !important;
  z-index:3000 !important;
}

.header .account-toggle{
  position:relative !important;
  z-index:2 !important;
}

.header .account-dropdown{
  position:absolute !important;
  top:calc(100% + 12px) !important;
  left:0 !important;
  right:auto !important;
  width:300px !important;
  max-width:min(300px, calc(100vw - 24px)) !important;
  display:none !important;
  grid-template-columns:1fr !important;
  gap:4px !important;
  padding:12px !important;
  background:rgba(255,253,249,.98) !important;
  border:1px solid rgba(15,74,66,.12) !important;
  border-radius:24px !important;
  box-shadow:0 26px 80px rgba(9,50,45,.18) !important;
  max-height:min(76vh,640px) !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  text-align:right !important;
  direction:rtl !important;
  z-index:5000 !important;
  scrollbar-width:thin !important;
}

.header .account-menu.open .account-dropdown{
  display:grid !important;
}

.header .account-dropdown .account-summary{
  padding:12px 14px !important;
  margin:0 0 6px !important;
  border-radius:18px !important;
  background:linear-gradient(135deg,#fff,#fbf8ef) !important;
  border:1px solid rgba(15,74,66,.08) !important;
}

.header .account-dropdown .account-summary strong{
  display:block !important;
  color:#08332e !important;
  font-weight:950 !important;
  line-height:1.25 !important;
}

.header .account-dropdown .account-summary small{
  display:block !important;
  margin-top:4px !important;
  color:#697672 !important;
  font-size:.76rem !important;
  line-height:1.35 !important;
  direction:ltr !important;
  unicode-bidi:plaintext !important;
  word-break:break-word !important;
}

.header .account-dropdown .account-section-title{
  color:#c8a35f !important;
  font-size:.76rem !important;
  font-weight:950 !important;
  margin:7px 8px 4px !important;
}

.header .account-dropdown a{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:9px !important;
  min-height:36px !important;
  padding:8px 10px !important;
  border-radius:13px !important;
  color:#0f4a42 !important;
  font-size:.88rem !important;
  font-weight:900 !important;
  line-height:1.2 !important;
  background:transparent !important;
  border:0 !important;
  white-space:normal !important;
  transition:.18s ease !important;
}

.header .account-dropdown a:hover{
  background:#fbf8ef !important;
  transform:none !important;
}

.header .account-dropdown a i{
  width:18px !important;
  min-width:18px !important;
  text-align:center !important;
  font-size:.9rem !important;
  color:#0f4a42 !important;
}

.header .account-dropdown a.danger{
  color:#b42318 !important;
  margin-top:4px !important;
}

.header .account-dropdown a.danger i{
  color:#b42318 !important;
}

/* Admin menu: two compact columns on desktop to reduce height */
@media (min-width:1081px){
  .header .account-dropdown.admin-account-dropdown{
    width:430px !important;
    max-width:430px !important;
    grid-template-columns:1fr 1fr !important;
    gap:5px 8px !important;
    max-height:min(68vh,560px) !important;
  }

  .header .account-dropdown.admin-account-dropdown .account-summary,
  .header .account-dropdown.admin-account-dropdown .account-section-title,
  .header .account-dropdown.admin-account-dropdown a.danger{
    grid-column:1 / -1 !important;
  }

  .header .account-dropdown.admin-account-dropdown .account-section-title{
    margin-top:5px !important;
  }

  .header .account-dropdown.admin-account-dropdown a{
    min-height:34px !important;
    padding:7px 9px !important;
    font-size:.84rem !important;
    border:1px solid rgba(15,74,66,.05) !important;
    background:rgba(255,255,255,.62) !important;
  }
}

/* Mobile keeps full-width dropdown from layout/home-mobile-safe rules */
@media (max-width:1080px){
  .header .account-dropdown{
    position:fixed !important;
    top:112px !important;
    right:16px !important;
    left:16px !important;
    width:auto !important;
    max-width:none !important;
    max-height:calc(100vh - 150px) !important;
    padding:16px !important;
    border-radius:26px !important;
  }

  .header .account-dropdown a{
    min-height:48px !important;
    padding:12px 14px !important;
    font-size:.96rem !important;
  }
}
