/* Teamtuli | My Account: restore the original light menu and scroll only the
   account details panel on desktop. The navy PRIMARY sidebar and topbar stay
   untouched. The previous dark secondary-nav stylesheet is UNLINKED by the
   installer, which also restores Settings/Deployment's earlier light palette.
   Do not change business logic, routes, authentication or form handlers. */

@media (min-width: 901px) {
  /* The existing workspace shell already locks document scroll and keeps the
     global sidebar/header still. Give My Account the remaining content height. */
  body.ttu-admin:not(.remote-connect-active) #dashboardView:not(.hidden) > .main-area > .page-content:has(> #accountView:not(.hidden)) {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding-bottom: 14px !important;
  }
  body.ttu-admin #dashboardView #accountView:not(.hidden) {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  body.ttu-admin #dashboardView #accountView:not(.hidden) > .account-page-header {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    margin-bottom: 16px !important;
  }
  body.ttu-admin #dashboardView #accountView:not(.hidden) > .account-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 292px) minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 18px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }
  /* LEFT: a visible, non-scrolling list with every account menu item. */
  body.ttu-admin #dashboardView #accountView .account-nav {
    position: static !important;
    top: auto !important;
    display: grid !important;
    grid-auto-rows: min-content !important;
    align-content: start !important;
    align-self: stretch !important;
    gap: 1px !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    padding: 8px 9px !important;
    border-radius: 15px !important;
    background: #fff !important;
    color: #475467 !important;
    box-sizing: border-box !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 5px 11px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #475467 !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    text-align: left !important;
    white-space: normal !important;
    box-sizing: border-box !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button:hover {
    background: #f8fafc !important;
    color: #344054 !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button.active {
    background: #eef3ff !important;
    color: #3159d8 !important;
    box-shadow: none !important;
    border: 0 !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button span {
    color: inherit !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
  }
  /* Descriptions aren't menu options. Hide them to fit ALL 14 menu options. */
  body.ttu-admin #dashboardView #accountView .account-nav button small { display: none !important; }
  body.ttu-admin #dashboardView #accountView .account-nav-label {
    display: block !important;
    margin: 0 !important;
    padding: 11px 11px 3px !important;
    color: #98a2b3 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: .09em !important;
    text-transform: uppercase !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button:focus-visible {
    outline: 2px solid #3159d8 !important;
    outline-offset: -2px !important;
  }
  /* RIGHT: the only scrolling panel inside the account view. */
  body.ttu-admin #dashboardView #accountView .account-content {
    display: block !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain !important;
    scrollbar-gutter: stable !important;
    padding-right: 3px !important;
  }
  body.ttu-admin #dashboardView #accountView .account-content:focus-visible {
    outline: 2px solid #3159d8 !important;
    outline-offset: -2px !important;
  }
}

@media (min-width: 901px) and (max-width: 1349px) {
  body.ttu-admin #dashboardView #accountView:not(.hidden) > .account-layout {
    grid-template-columns: minmax(0, 272px) minmax(0, 1fr) !important;
  }
}

/* Very short desktop windows: use compact two-column account navigation to
   keep EVERY item visible rather than introducing another scrollbar. */
@media (min-width: 901px) and (max-height: 820px) {
  body.ttu-admin #dashboardView #accountView .account-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3px 5px !important;
    padding: 8px !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav-label {
    display: none !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button {
    min-height: 35px !important;
    height: auto !important;
    padding: 6px 8px !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button span {
    font-size: 10.5px !important;
    line-height: 1.22 !important;
  }
}

/* Mobile has one document scroller. Render every option as a light 2-column
   grid (not an inner scroll strip), with account details following below. */
@media (max-width: 900px) {
  body.ttu-admin #dashboardView #accountView .account-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-content: start !important;
    gap: 6px !important;
    padding: 11px !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    background: #fff !important;
    border-radius: 14px !important;
    color: #475467 !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav-label { display: none !important; }
  body.ttu-admin #dashboardView #accountView .account-nav button {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 38px !important;
    height: auto !important;
    padding: 9px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    color: #475467 !important;
    text-align: left !important;
    white-space: normal !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button.active {
    background: #eef3ff !important;
    color: #3159d8 !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button span {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: inherit !important;
  }
  body.ttu-admin #dashboardView #accountView .account-nav button small { display: none !important; }
  body.ttu-admin #dashboardView #accountView .account-content {
    overflow: visible !important;
    min-height: 0 !important;
    height: auto !important;
  }
}
