/* v8 exact fix for current layout: [data-sidebar-toggle] */

/* Desktop: sidebar is already visible, so hamburger button must not appear */
@media (min-width: 981px) {
  .app-topbar-left > [data-sidebar-toggle],
  header.app-topbar [data-sidebar-toggle],
  button.sidebar-toggle[data-sidebar-toggle] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
}

/* Mobile/PWA: show a clear menu button in the top bar, left and vertically centered */
@media (max-width: 980px) {
  .app-topbar {
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
  }

  .app-topbar-left {
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
  }

  .app-topbar-left > [data-sidebar-toggle],
  header.app-topbar [data-sidebar-toggle],
  button.sidebar-toggle[data-sidebar-toggle] {
    position: relative !important;
    z-index: 2147482500 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 112px !important;
    height: 46px !important;
    padding: 0 15px !important;
    margin: 0 10px 0 0 !important;
    border: 1px solid rgba(255,255,255,.55) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #2563eb 0%, #1749c9 100%) !important;
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(37,99,235,.30), 0 2px 8px rgba(15,23,42,.18) !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: .01em !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .app-topbar-left > [data-sidebar-toggle] .menu-exact-icon,
  header.app-topbar [data-sidebar-toggle] .menu-exact-icon,
  button.sidebar-toggle[data-sidebar-toggle] .menu-exact-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
  }

  .app-topbar-left > [data-sidebar-toggle] .menu-exact-text,
  header.app-topbar [data-sidebar-toggle] .menu-exact-text,
  button.sidebar-toggle[data-sidebar-toggle] .menu-exact-text {
    display: inline-block !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.sidebar-open .app-topbar-left > [data-sidebar-toggle],
  body.sidebar-open header.app-topbar [data-sidebar-toggle],
  body.sidebar-open button.sidebar-toggle[data-sidebar-toggle] {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 8px 22px rgba(220,38,38,.28), 0 2px 8px rgba(15,23,42,.18) !important;
  }

  .app-topbar-left > [data-sidebar-toggle]:active,
  header.app-topbar [data-sidebar-toggle]:active,
  button.sidebar-toggle[data-sidebar-toggle]:active {
    transform: scale(.97) !important;
  }
}

@media (max-width: 380px) {
  .app-topbar-left > [data-sidebar-toggle],
  header.app-topbar [data-sidebar-toggle],
  button.sidebar-toggle[data-sidebar-toggle] {
    min-width: 102px !important;
    height: 44px !important;
    padding: 0 12px !important;
  }

  .app-topbar-left > [data-sidebar-toggle] .menu-exact-text,
  header.app-topbar [data-sidebar-toggle] .menu-exact-text,
  button.sidebar-toggle[data-sidebar-toggle] .menu-exact-text {
    font-size: 16px !important;
  }
}
