/* ObraGestão 8.6.3.28 — trava definitiva do modo fixo
   No modo pinned, hover NÃO altera geometria, opacidade, largura ou posição.
   A expansão por hover permanece exclusiva do modo compact. */
@media (min-width: 801px) {
  #nav[data-shell-mode="pinned"],
  #nav[data-shell-mode="pinned"]:hover,
  #nav[data-shell-mode="pinned"].force-open {
    width: var(--shell-sidebar-expanded, 238px) !important;
    min-width: var(--shell-sidebar-expanded, 238px) !important;
    max-width: var(--shell-sidebar-expanded, 238px) !important;
    box-shadow: none !important;
    transition: none !important;
    transform: none !important;
  }

  /* Marca do aplicativo: completamente imóvel no modo fixo. */
  #nav[data-shell-mode="pinned"] .nav-brand-mini,
  #nav[data-shell-mode="pinned"]:hover .nav-brand-mini,
  #nav[data-shell-mode="pinned"].force-open .nav-brand-mini {
    height: var(--shell-header-h, 64px) !important;
    min-height: var(--shell-header-h, 64px) !important;
    padding: 0 15px !important;
    gap: 10px !important;
    justify-content: flex-start !important;
    transform: none !important;
    transition: none !important;
  }
  #nav[data-shell-mode="pinned"] .brand-app-icon,
  #nav[data-shell-mode="pinned"]:hover .brand-app-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    margin: 0 !important;
    transform: none !important;
    transition: none !important;
  }
  #nav[data-shell-mode="pinned"] .nav-brand-mini b,
  #nav[data-shell-mode="pinned"]:hover .nav-brand-mini b,
  #nav[data-shell-mode="pinned"].force-open .nav-brand-mini b {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: auto !important;
    max-width: 160px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Itens: mesma geometria com ou sem hover. */
  #nav[data-shell-mode="pinned"] > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"] .nav-fixed-top > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"] .nav-scroll > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"] .nav-fixed-bottom > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"]:hover > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"]:hover .nav-fixed-top > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"]:hover .nav-scroll > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"]:hover .nav-fixed-bottom > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"].force-open > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"].force-open .nav-fixed-top > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"].force-open .nav-scroll > button:not(.sidebar-work-current),
  #nav[data-shell-mode="pinned"].force-open .nav-fixed-bottom > button:not(.sidebar-work-current) {
    width: calc(100% - 16px) !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 2px 8px !important;
    padding: 0 12px !important;
    gap: 12px !important;
    justify-content: flex-start !important;
    transform: none !important;
    transition: background .14s ease, color .14s ease !important;
  }
  #nav[data-shell-mode="pinned"] .nav-icon,
  #nav[data-shell-mode="pinned"]:hover .nav-icon,
  #nav[data-shell-mode="pinned"].force-open .nav-icon {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
    transform: none !important;
    transition: none !important;
  }
  #nav[data-shell-mode="pinned"] .nav-label,
  #nav[data-shell-mode="pinned"]:hover .nav-label,
  #nav[data-shell-mode="pinned"].force-open .nav-label {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: auto !important;
    max-width: 165px !important;
    margin: 0 !important;
    overflow: visible !important;
    transform: none !important;
    transition: none !important;
  }
  #nav[data-shell-mode="pinned"] .nav-section,
  #nav[data-shell-mode="pinned"]:hover .nav-section,
  #nav[data-shell-mode="pinned"].force-open .nav-section {
    font-size: 10px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 17px 5px !important;
    text-indent: 0 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Obra atual: mantém exatamente o mesmo layout. */
  #nav[data-shell-mode="pinned"] #sidebarWorkCurrent,
  #nav[data-shell-mode="pinned"]:hover #sidebarWorkCurrent,
  #nav[data-shell-mode="pinned"].force-open #sidebarWorkCurrent {
    position: relative !important;
    width: calc(100% - 16px) !important;
    height: 54px !important;
    min-height: 54px !important;
    margin: 4px 8px !important;
    padding: 6px 8px !important;
    gap: 10px !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    transform: none !important;
    transition: background .14s ease, color .14s ease, border-color .14s ease !important;
  }
  #nav[data-shell-mode="pinned"] #sidebarWorkCurrent .sidebar-work-thumb,
  #nav[data-shell-mode="pinned"]:hover #sidebarWorkCurrent .sidebar-work-thumb {
    position: static !important;
    left: auto !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    margin: 0 !important;
    transform: none !important;
    transition: none !important;
  }
  #nav[data-shell-mode="pinned"] #sidebarWorkCurrent .sidebar-work-copy,
  #nav[data-shell-mode="pinned"]:hover #sidebarWorkCurrent .sidebar-work-copy,
  #nav[data-shell-mode="pinned"].force-open #sidebarWorkCurrent .sidebar-work-copy {
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
  }
  #nav[data-shell-mode="pinned"] #sidebarWorkCurrent .sidebar-work-arrow,
  #nav[data-shell-mode="pinned"]:hover #sidebarWorkCurrent .sidebar-work-arrow,
  #nav[data-shell-mode="pinned"].force-open #sidebarWorkCurrent .sidebar-work-arrow {
    display: grid !important;
    position: static !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    margin: 0 !important;
    transform: none !important;
    transition: background .14s ease, color .14s ease, border-color .14s ease !important;
  }

  /* Scroll e versão não mudam quando o cursor entra no sidebar. */
  #nav[data-shell-mode="pinned"] .nav-scroll,
  #nav[data-shell-mode="pinned"]:hover .nav-scroll {
    scrollbar-width: none !important;
    overflow-x: hidden !important;
  }
  #nav[data-shell-mode="pinned"] .nav-scroll::-webkit-scrollbar,
  #nav[data-shell-mode="pinned"]:hover .nav-scroll::-webkit-scrollbar {
    width: 0 !important;
  }
  #nav[data-shell-mode="pinned"] .nav-version-footer strong,
  #nav[data-shell-mode="pinned"] .nav-version-footer span,
  #nav[data-shell-mode="pinned"]:hover .nav-version-footer strong,
  #nav[data-shell-mode="pinned"]:hover .nav-version-footer span {
    opacity: 1 !important;
    visibility: visible !important;
    width: auto !important;
    transform: none !important;
    transition: none !important;
  }

  /* Header e conteúdo permanecem no mesmo ponto no pinned, inclusive em hover. */
  body.sidebar-pinned header,
  body.sidebar-pinned:has(#nav:hover) header,
  body:has(#nav[data-shell-mode="pinned"]) header {
    margin-left: var(--shell-sidebar-expanded, 238px) !important;
    width: calc(100% - var(--shell-sidebar-expanded, 238px)) !important;
    transition: none !important;
  }
  body.sidebar-pinned main,
  body.sidebar-pinned:has(#nav:hover) main,
  body:has(#nav[data-shell-mode="pinned"]) main {
    margin-left: var(--shell-sidebar-expanded, 238px) !important;
    width: calc(100% - var(--shell-sidebar-expanded, 238px)) !important;
    transition: none !important;
  }
  body.sidebar-pinned .work-gate,
  body.sidebar-pinned:has(#nav:hover) .work-gate,
  body:has(#nav[data-shell-mode="pinned"]) .work-gate {
    left: var(--shell-sidebar-expanded, 238px) !important;
    transition: none !important;
  }
}

/* 8.6.3.30 — seletor de obra integrado ao menu escuro */
@media (min-width:801px){
  #nav .sidebar-work-submenu,
  #nav[data-shell-mode="pinned"] .sidebar-work-submenu,
  #nav[data-shell-mode="compact"] .sidebar-work-submenu {
    margin:2px 8px 10px!important;
    padding:2px 0!important;
    gap:3px!important;
    background:transparent!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
  }

  #nav .sidebar-work-submenu.open {
    display:flex!important;
  }

  #nav .sidebar-work-option,
  #nav[data-shell-mode="pinned"] .sidebar-work-option,
  #nav[data-shell-mode="compact"] .sidebar-work-option {
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    width:100%!important;
    min-height:42px!important;
    margin:0!important;
    padding:6px 9px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    color:#dce7f2!important;
    text-align:left!important;
    box-shadow:none!important;
    transform:none!important;
  }

  #nav .sidebar-work-option .sidebar-work-option-thumb {
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    border-radius:7px!important;
    background:rgba(255,255,255,.08)!important;
    border:1px solid rgba(255,255,255,.08)!important;
    overflow:hidden!important;
  }

  #nav .sidebar-work-option>span:nth-child(2) {
    display:flex!important;
    flex:1 1 auto!important;
    min-width:0!important;
    opacity:1!important;
    visibility:visible!important;
  }

  #nav .sidebar-work-option b,
  #nav .sidebar-work-option small {
    display:block!important;
    color:#e8f0f8!important;
    opacity:1!important;
    visibility:visible!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  #nav .sidebar-work-option b {
    font-size:11px!important;
    font-weight:700!important;
    line-height:1.25!important;
  }

  #nav .sidebar-work-option small {
    margin-top:2px!important;
    font-size:9px!important;
    color:#9fb3c8!important;
  }

  #nav .sidebar-work-option:hover {
    background:var(--shell-side-hover)!important;
    color:#fff!important;
  }

  #nav .sidebar-work-option.active,
  #nav .sidebar-work-option[aria-pressed="true"] {
    background:var(--shell-side-active)!important;
    color:#fff!important;
  }

  #nav .sidebar-work-option:hover b,
  #nav .sidebar-work-option.active b,
  #nav .sidebar-work-option[aria-pressed="true"] b {
    color:#fff!important;
  }

  #nav .sidebar-work-selected {
    flex:0 0 14px!important;
    width:14px!important;
    height:14px!important;
    margin-left:auto!important;
    border:2px solid #fff!important;
    background:transparent!important;
  }
  #nav .sidebar-work-selected::after { background:#fff!important; }

  /* quando o menu compacto abre o seletor, o nome da obra também fica visível */
  #nav[data-shell-mode="compact"].force-open .sidebar-work-option>span:nth-child(2),
  #nav[data-shell-mode="compact"]:hover .sidebar-work-option>span:nth-child(2) {
    display:flex!important;
    opacity:1!important;
    visibility:visible!important;
  }
}

@media (max-width:800px){
  #nav .sidebar-work-submenu{
    margin:2px 8px 10px!important;
    padding:2px 0!important;
    gap:3px!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  #nav .sidebar-work-option{
    width:100%!important;
    min-height:42px!important;
    margin:0!important;
    padding:6px 9px!important;
    gap:10px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    color:#dce7f2!important;
  }
  #nav .sidebar-work-option>span:nth-child(2){display:flex!important;opacity:1!important;visibility:visible!important;min-width:0!important;flex:1 1 auto!important}
  #nav .sidebar-work-option b{color:#e8f0f8!important;font-size:11px!important;font-weight:700!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #nav .sidebar-work-option:hover{background:var(--shell-side-hover)!important;color:#fff!important}
  #nav .sidebar-work-option.active,#nav .sidebar-work-option[aria-pressed="true"]{background:var(--shell-side-active)!important;color:#fff!important}
  #nav .sidebar-work-selected{border-color:#fff!important}
  #nav .sidebar-work-selected::after{background:#fff!important}
}

/* 8.6.3.31 — item ativo sem preenchimento de fundo */
#nav button.active,
#nav button.active:hover,
#nav #sidebarWorkCurrent.active,
#nav #sidebarWorkCurrent.active:hover,
#nav .sidebar-work-option.active,
#nav .sidebar-work-option.active:hover,
#nav .sidebar-work-option[aria-pressed="true"],
#nav .sidebar-work-option[aria-pressed="true"]:hover{
  background:transparent!important;
  box-shadow:none!important;
  border-color:transparent!important;
}

/* Mantém indicação do item selecionado somente pela cor do conteúdo. */
#nav button.active .nav-icon,
#nav button.active .nav-label{
  color:#69aefc!important;
}
#nav #sidebarWorkCurrent.active .sidebar-work-icon,
#nav #sidebarWorkCurrent.active .sidebar-work-arrow{
  color:#69aefc!important;
}
#nav .sidebar-work-option.active b,
#nav .sidebar-work-option[aria-pressed="true"] b{
  color:#69aefc!important;
}
#nav .sidebar-work-option.active .sidebar-work-selected,
#nav .sidebar-work-option[aria-pressed="true"] .sidebar-work-selected{
  border-color:#69aefc!important;
}
#nav .sidebar-work-option.active .sidebar-work-selected::after,
#nav .sidebar-work-option[aria-pressed="true"] .sidebar-work-selected::after{
  background:#69aefc!important;
}


/* 8.6.3.32 — estado ativo do menu sem preenchimento (alta especificidade) */
@media(min-width:801px){
  #nav[data-shell-mode] > button.active,
  #nav[data-shell-mode] .nav-fixed-top > button.active,
  #nav[data-shell-mode] .nav-scroll > button.active,
  #nav[data-shell-mode] .nav-fixed-bottom > button.active,
  #nav[data-shell-mode] > button.active:hover,
  #nav[data-shell-mode] .nav-fixed-top > button.active:hover,
  #nav[data-shell-mode] .nav-scroll > button.active:hover,
  #nav[data-shell-mode] .nav-fixed-bottom > button.active:hover,
  #nav[data-shell-mode] button[aria-current="page"],
  #nav[data-shell-mode] button[aria-current="page"]:hover{
    background:transparent!important;
    background-color:transparent!important;
    background-image:none!important;
    box-shadow:none!important;
    border-color:transparent!important;
    border-left:0!important;
    outline:0!important;
    transform:none!important;
    color:#69aefc!important;
  }
  #nav[data-shell-mode] > button.active .nav-icon,
  #nav[data-shell-mode] > button.active .nav-label,
  #nav[data-shell-mode] .nav-fixed-top > button.active .nav-icon,
  #nav[data-shell-mode] .nav-fixed-top > button.active .nav-label,
  #nav[data-shell-mode] .nav-scroll > button.active .nav-icon,
  #nav[data-shell-mode] .nav-scroll > button.active .nav-label,
  #nav[data-shell-mode] .nav-fixed-bottom > button.active .nav-icon,
  #nav[data-shell-mode] .nav-fixed-bottom > button.active .nav-label,
  #nav[data-shell-mode] button[aria-current="page"] .nav-icon,
  #nav[data-shell-mode] button[aria-current="page"] .nav-label{
    color:#69aefc!important;
  }
}

@media(max-width:800px){
  #nav.open button.active,
  #nav.open button.active:hover,
  #nav.open button[aria-current="page"],
  #nav.open button[aria-current="page"]:hover{
    background:transparent!important;
    background-color:transparent!important;
    background-image:none!important;
    box-shadow:none!important;
    border:0!important;
    color:#69aefc!important;
  }
  #nav.open button.active .nav-icon,
  #nav.open button.active .nav-label,
  #nav.open button[aria-current="page"] .nav-icon,
  #nav.open button[aria-current="page"] .nav-label{
    color:#69aefc!important;
  }
}
