/* Teamtuli | Independent workspace content scrolling (desktop only).
   Intentionally does not change sidebar width, colors, logo, spacing, menu,
   footer, or navigation interactions. The last accepted sidebar CSS stays in use.
   Mobile keeps the native vertical document scroll and existing drawer behavior.
*/
@media (min-width: 901px) {
  /* Only lock the outer document after the technician workspace becomes visible.
     Login, customer-facing pages and specialized remote-connect mode are excluded. */
  body.ttu-admin:not(.remote-connect-active):has(#dashboardView.app-layout:not(.hidden)) {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.ttu-admin:not(.remote-connect-active) #dashboardView.app-layout:not(.hidden) {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    align-items: stretch !important;
  }

  /* Existing full-height sidebar is no longer bound to document scroll. */
  body.ttu-admin:not(.remote-connect-active) #dashboardView > #sidebar.sidebar {
    position: relative !important;
    top: auto !important;
    left: 0 !important;
    align-self: stretch !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    /* Its existing separately scrollable navigation is left unchanged. */
  }

  /* Keep the toolbar fixed above the one content scroller. */
  body.ttu-admin:not(.remote-connect-active) #dashboardView > .main-area {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  body.ttu-admin:not(.remote-connect-active) #dashboardView > .main-area > .topbar {
    flex: 0 0 auto !important;
    position: relative !important;
    top: auto !important;
  }

  /* Support Requests, Computers, Home and other workspaces all share this node.
     Keeping the scrollbar here ensures the sidebar stays in view on long pages. */
  body.ttu-admin:not(.remote-connect-active) #dashboardView > .main-area > .page-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #b9cad8 transparent;
  }
  body.ttu-admin:not(.remote-connect-active) #dashboardView > .main-area > .page-content::-webkit-scrollbar {
    width: 9px;
  }
  body.ttu-admin:not(.remote-connect-active) #dashboardView > .main-area > .page-content::-webkit-scrollbar-thumb {
    background: #b9cad8;
    border: 2px solid #f6f9fc;
    border-radius: 999px;
  }
  body.ttu-admin:not(.remote-connect-active) #dashboardView > .main-area > .page-content::-webkit-scrollbar-track {
    background: transparent;
  }
  body.ttu-admin:not(.remote-connect-active) #dashboardView > .main-area > .page-content:focus-visible {
    outline: 2px solid #00b5a6;
    outline-offset: -2px;
  }
}
