/* ===============================
   Dashboard dropdown menu
================================ */

.navbar {
  z-index: 1080;
}

.navbar .nav-link {
  color: #ffffff !important;
}

.navbar .dropdown-menu {
  margin-top: 12px;
  min-width: 230px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
  z-index: 2000;
}

.navbar .dropdown-menu.show {
  animation: dropdownFade .18s ease;
}

.navbar .dropdown-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 9px 12px;
  color: #0f172a !important;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus,
.navbar .dropdown-item.active {
  background: #eaf3ff;
  color: #0b4f8f !important;
}

.dropdown-mobile-head {
  display: none;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .navbar,
  .navbar .container,
  .navbar .container-fluid,
  .navbar .navbar-nav,
  .navbar .nav-item.dropdown {
    overflow: visible !important;
  }

  .navbar .nav-item.dropdown {
    position: static;
  }

  .navbar .dropdown-menu {
    display: none;
  }

  .navbar .dropdown-menu.show {
    display: block;
    position: fixed !important;
    top: var(--mobile-dropdown-top, 64px) !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    min-width: 0;
    max-width: none !important;
    max-height: calc(100dvh - var(--mobile-dropdown-top, 64px) - 18px);
    margin: 0;
    padding: 0 0 8px;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, .12);
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .32);
    transform: none !important;
    z-index: 2200;
    -webkit-overflow-scrolling: touch;
  }

  .dropdown-mobile-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 50px;
    padding: 10px 12px 10px 16px;
    background: linear-gradient(180deg, #f8fbff, #eef5ff);
    border-bottom: 1px solid rgba(15, 23, 42, .1);
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
  }

  .dropdown-mobile-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .dropdown-mobile-close:active {
    transform: scale(.97);
  }

  .navbar .dropdown-item {
    min-height: 46px;
    margin: 4px 8px 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    white-space: normal;
  }
}
