/* Always keep login/logout controls visible on mobile. */
@media (max-width: 1100px) {
  .topbar {
    height: auto !important;
    min-height: 94px !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .topbar .brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .topbar .brand img {
    width: 72px !important;
    height: 72px !important;
  }

  .topbar .brand strong {
    font-size: 21px !important;
  }

  .topbar .brand span {
    display: none !important;
  }

  .topbar .actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    margin-left: auto !important;
    flex: 0 0 auto !important;
  }

  .topbar .actions .ghost,
  .topbar .actions .small,
  .topbar .actions .primary,
  .topbar .actions .secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  .topbar .actions .ghost {
    background: #eef4fa !important;
    color: #0c2848 !important;
  }

  .topbar .actions .primary.small {
    background: #dc1f2d !important;
    color: #ffffff !important;
  }

  .topbar .lang {
    display: inline-flex !important;
    min-height: 38px !important;
    padding: 8px !important;
    border-radius: 999px !important;
    background: #eef4fa !important;
  }

  .topbar .lang span:not(.flag-icon) {
    display: none !important;
  }

  .topbar .menu {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    border-radius: 999px !important;
    background: #0c2848 !important;
    color: #ffffff !important;
    font-size: 18px !important;
  }

  .topbar nav {
    top: 100% !important;
  }
}

@media (max-width: 420px) {
  .topbar {
    min-height: 84px !important;
  }

  .topbar .brand img {
    width: 54px !important;
    height: 54px !important;
  }

  .topbar .brand strong {
    font-size: 18px !important;
  }

  .topbar .actions .ghost,
  .topbar .actions .small,
  .topbar .actions .primary,
  .topbar .actions .secondary {
    min-height: 34px !important;
    padding: 7px 8px !important;
    font-size: 11px !important;
  }
}

/* Dashboard fallback: logout must remain visible even if the mobile-menu script is cached or blocked. */
@media (max-width: 980px) {
  .portal-body .dashboard-sidebar > .dashboard-logout,
  .portal-body #logoutBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    right: 12px !important;
    bottom: 12px !important;
    z-index: 9999 !important;
    width: auto !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 11px 16px !important;
    border-radius: 999px !important;
    background: #dc1f2d !important;
    color: #ffffff !important;
    box-shadow: 0 12px 30px rgba(7, 27, 49, 0.22) !important;
    font-size: 14px !important;
    font-weight: 900 !important;
  }

  .portal-body .dashboard-mobile-logout {
    display: inline-flex !important;
  }
}
