/* PATCH 083.0.2 - correção global do menu mobile: nenhum submenu pode ser cortado */
@media (max-width:700px){
  .sidebar,
  body.sidebar-collapsed .sidebar{
    height:100dvh!important;
    max-height:100dvh!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    box-sizing:border-box!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
    touch-action:pan-y;
    padding-bottom:calc(190px + env(safe-area-inset-bottom,0px))!important;
    scroll-padding-bottom:210px;
  }

  .sidebar .menu-groups{
    display:flex!important;
    flex:0 0 auto!important;
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    overflow:visible!important;
  }

  .sidebar .menu-group{
    flex:0 0 auto!important;
    height:auto!important;
    max-height:none!important;
  }

  .sidebar .menu-group.is-open{
    overflow:visible!important;
  }

  .sidebar .menu-group.is-open > .menu-group-items{
    display:block!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    opacity:1!important;
    visibility:visible!important;
  }

  .sidebar .menu-group:not(.is-open) > .menu-group-items{
    max-height:0!important;
    overflow:hidden!important;
  }

  .sidebar-footer{
    flex:0 0 auto!important;
    margin-top:18px!important;
    margin-bottom:24px!important;
  }
}


/* PATCH 083.0.4 - cabeçalho mobile: compacta somente a faixa da logo.
   Este arquivo carrega depois do app.css, então neutraliza os patches antigos
   da logo sem tocar no desktop nem no conteúdo abaixo do cabeçalho. */
@media (max-width:700px){
  .topbar-primary{
    min-height:0!important;
    grid-template-columns:54px minmax(0,1fr) 54px!important;
    grid-template-rows:78px auto!important;
    column-gap:8px!important;
    row-gap:2px!important;
    padding:calc(4px + env(safe-area-inset-top)) 10px 7px!important;
    align-items:center!important;
  }

  .topbar-primary .mobile-menu-btn{
    grid-column:1!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:start!important;
  }

  .topbar-primary .user-menu{
    grid-column:3!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:end!important;
    margin:0!important;
  }

  .topbar-brand{
    position:static!important;
    grid-column:2!important;
    grid-row:1!important;
    left:auto!important;
    top:auto!important;
    width:100%!important;
    max-width:280px!important;
    height:72px!important;
    margin:0 auto!important;
    transform:none!important;
    transform-origin:center!important;
    justify-self:center!important;
    align-self:center!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  .topbar-brand-logo{
    width:100%!important;
    max-width:280px!important;
    height:72px!important;
    aspect-ratio:auto!important;
    overflow:visible!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  .topbar-brand-logo img{
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    object-fit:contain!important;
    object-position:center!important;
    transform:scale(2.15)!important;
    transform-origin:center!important;
  }

  .topbar-copy{
    grid-column:1 / -1!important;
    grid-row:2!important;
    width:100%!important;
    padding:6px 4px 1px!important;
    margin:0!important;
    border-top:1px solid var(--line)!important;
  }
}

@media (max-width:390px){
  .topbar-brand-logo img{
    transform:scale(2.05)!important;
  }

  .topbar-primary{
    grid-template-columns:48px minmax(0,1fr) 48px!important;
    grid-template-rows:72px auto!important;
    column-gap:6px!important;
    padding-left:8px!important;
    padding-right:8px!important;
  }

  .topbar-brand{
    max-width:250px!important;
    height:66px!important;
  }

  .topbar-brand-logo{
    max-width:250px!important;
    height:66px!important;
  }

  .topbar-copy{
    padding-top:5px!important;
  }
}
