@media (max-width: 900px),
  (pointer: coarse) and (max-width: 1180px),
  (min-aspect-ratio: 4/5) and (max-aspect-ratio: 5/4) and (max-width: 1180px) {
  .dashboard-topbar {
    flex: 0 0 auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .dashboard-topbar .brand {
    flex: 1 1 100%;
    width: 100%;
  }

  .dashboard-topbar .brand a {
    min-height: 40px;
    padding-left: 46px;
    font-size: 16px;
    line-height: 1.2;
    white-space: normal;
  }

  .dashboard-topbar .brand a::before {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .dashboard-topbar .user-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    flex: 1 1 100%;
    gap: 8px;
  }

  .dashboard-topbar .user-panel > a:first-child,
  .dashboard-topbar #topUserName,
  .dashboard-topbar #topUserRole {
    width: 100%;
    min-height: 34px;
    justify-content: flex-start;
    font-size: 13px;
  }

  .dashboard-topbar #topCenterSelect {
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0;
    max-width: none;
    height: 46px;
    font-size: 15px;
  }

  .dashboard-topbar .btn {
    width: 100%;
    min-height: 46px;
    height: auto;
    padding: 0 12px;
    font-size: 15px;
  }

  .dashboard-menu {
    padding: 8px 10px;
    overflow: hidden;
  }

  .dashboard-menu ul.menu-horizontal {
    flex-wrap: nowrap !important;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-menu ul.menu-horizontal > li {
    width: auto !important;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .dashboard-menu ul.menu-horizontal > li > a {
    width: auto !important;
    min-height: 46px;
    padding: 0 13px;
    border-radius: 15px;
    font-size: 14px;
  }

  .dashboard-menu ul.menu-horizontal > li > a .mi {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .dashboard-menu .dropdown-menu,
  .dashboard-menu .menu-horizontal > li:last-child .dropdown-menu {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 12px;
    top: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(68dvh, 560px);
    overflow: auto;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  }

  .dashboard-menu .has-dropdown:hover > .dropdown-menu,
  .dashboard-menu .has-dropdown:focus-within > .dropdown-menu {
    display: none;
  }

  .dashboard-menu .has-dropdown.open > .dropdown-menu {
    display: block;
  }

  .dashboard-menu .dropdown-menu a {
    min-height: 46px;
    font-size: 14px;
  }
}

@media (max-width: 520px) {
  .dashboard-topbar .user-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px),
  (pointer: coarse) and (max-width: 1180px),
  (min-aspect-ratio: 4/5) and (max-aspect-ratio: 5/4) and (max-width: 1180px) {
  .dashboard-topbar {
    flex-wrap: nowrap !important;
    align-items: center;
    min-height: 50px;
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-topbar .brand {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px;
  }

  .dashboard-topbar .brand a {
    width: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    font-size: 0 !important;
    white-space: nowrap;
  }

  .dashboard-topbar .brand a::before {
    position: static;
    width: 36px;
    height: 36px;
    transform: none;
    font-size: 16px;
  }

  .dashboard-topbar .user-panel {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-start;
    width: auto !important;
    gap: 6px;
  }

  .dashboard-topbar .user-panel > a:first-child,
  .dashboard-topbar #topUserRole {
    display: none !important;
  }

  .dashboard-topbar #topUserName {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
    font-size: 0 !important;
  }

  .dashboard-topbar #topUserName::before {
    content: "\f007";
    font-family: "Font Awesome 7 Free";
    font-size: 16px;
    font-weight: 900;
  }

  .dashboard-topbar #topCenterSelect {
    grid-column: auto;
    flex: 0 0 clamp(150px, 44vw, 230px);
    width: clamp(150px, 44vw, 230px) !important;
    min-width: 150px;
    max-width: 230px;
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 13px;
  }

  .dashboard-topbar .btn {
    flex: 0 0 40px;
    width: 40px !important;
    min-width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    font-size: 0 !important;
  }

  .dashboard-topbar .btn::before {
    font-family: "Font Awesome 7 Free";
    font-size: 16px;
    font-weight: 900;
  }

  .dashboard-topbar #btnChangeSettings::before {
    content: "\f013";
  }

  .dashboard-topbar #btnChangePassword::before {
    content: "\f084";
  }

  .dashboard-topbar #btnLogout::before {
    content: "\f2f5";
  }
}

@media (max-width: 900px),
  (pointer: coarse) and (max-width: 1180px),
  (min-aspect-ratio: 4/5) and (max-aspect-ratio: 5/4) and (max-width: 1180px) {
  .dashboard-menu .has-dropdown:not(.open) > .dropdown-menu,
  .dashboard-menu .has-dropdown:not(.open):hover > .dropdown-menu,
  .dashboard-menu .has-dropdown:not(.open):focus-within > .dropdown-menu {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .dashboard-menu .has-dropdown.open > .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 4500;
  }

  .dashboard-menu .dropdown-menu,
  .dashboard-menu .menu-horizontal > li:last-child .dropdown-menu {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: var(--dashboard-menu-dropdown-top, 176px) !important;
    bottom: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: calc(100dvh - var(--dashboard-menu-dropdown-top, 176px) - 12px) !important;
    margin: 0 !important;
    overflow: auto;
    transform: none !important;
  }
}
