/* Cloud Design v1.3.11 — navigation rebuild
   Desktop: viewport-bounded sidebar with its own scroll.
   Mobile: one admin navigation system (bottom bar + drawer), no duplicate public/top workspace menus. */

/* ---------- Desktop / laptop workspace ---------- */
@media (min-width:901px){
  .dashboard-shell>.container.dashboard-grid,
  .dashboard-grid{
    display:grid!important;
    grid-template-columns:minmax(228px,250px) minmax(0,1fr)!important;
    gap:22px!important;
    align-items:start!important;
  }

  /* app.css turns the sidebar into a horizontal strip below 1060px.
     For the admin workspace that is counterproductive, so keep the normal sidebar down to 901px. */
  .dashboard-shell .workspace-nav.workspace-drawer,
  .dashboard-shell .side-nav.side-nav-final.workspace-nav{
    display:block!important;
    position:sticky!important;
    top:calc(var(--header) + 14px)!important;
    align-self:start!important;
    width:100%!important;
    height:auto!important;
    max-height:calc(100dvh - var(--header) - 28px)!important;
    margin:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
    scrollbar-width:thin!important;
    scrollbar-color:rgba(155,129,226,.35) transparent!important;
  }
  .dashboard-shell .workspace-nav.workspace-drawer::-webkit-scrollbar{width:7px!important}
  .dashboard-shell .workspace-nav.workspace-drawer::-webkit-scrollbar-track{background:transparent!important}
  .dashboard-shell .workspace-nav.workspace-drawer::-webkit-scrollbar-thumb{
    background:rgba(155,129,226,.28)!important;
    border-radius:999px!important;
    border:2px solid transparent!important;
    background-clip:padding-box!important;
  }
  .dashboard-shell .workspace-nav.workspace-drawer:hover::-webkit-scrollbar-thumb{background:rgba(166,137,242,.48)!important;background-clip:padding-box!important}

  /* Do not let legacy <=1060 rules turn items into nowrap horizontal pills. */
  .dashboard-shell .workspace-nav.workspace-drawer a.workspace-menu-item{
    min-width:0!important;
    white-space:normal!important;
  }
  .dashboard-shell .workspace-nav.workspace-drawer .workspace-nav-text{
    min-width:0!important;
    overflow-wrap:anywhere!important;
  }
}

/* ---------- Mobile workspace ---------- */
@media (max-width:900px){
  :root{--mobile-workspace-bottom:76px}

  /* Staff pages should have one navigation system. Hide the public website header
     and the old additional workspace topbar; the bottom bar opens the admin drawer. */
  body.has-mobile-workspace .site-header,
  body.has-mobile-workspace .mobile-menu,
  body.has-mobile-workspace .mobile-workspace-topbar{display:none!important}
  body.has-mobile-workspace .scroll-progress{top:0!important}

  body.has-mobile-workspace{
    padding-bottom:calc(var(--mobile-workspace-bottom) + env(safe-area-inset-bottom,0px))!important;
  }
  body.has-mobile-workspace .dashboard-shell{
    padding-top:12px!important;
    padding-bottom:18px!important;
  }

  /* Drawer is the complete secondary navigation and scrolls independently of the page. */
  body.has-mobile-workspace .workspace-nav.workspace-drawer{
    top:0!important;
    bottom:0!important;
    height:100dvh!important;
    max-height:100dvh!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))!important;
  }
  body.has-mobile-workspace .workspace-drawer-head{
    top:0!important;
  }

  /* One familiar bottom navigation: the four everyday staff sections + Menu. */
  body.has-mobile-workspace .mobile-admin-bottom-nav{
    display:grid!important;
    left:8px!important;
    right:8px!important;
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    min-height:64px!important;
    padding:6px!important;
    gap:2px!important;
    border-radius:20px!important;
  }
  body.has-mobile-workspace .mobile-admin-bottom-nav.mobile-admin-bottom-nav-five{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
  }
  body.has-mobile-workspace .mobile-admin-bottom-nav.mobile-admin-bottom-nav-four{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  body.has-mobile-workspace .mobile-admin-bottom-nav>a,
  body.has-mobile-workspace .mobile-admin-bottom-nav>button{
    min-width:0!important;
    min-height:52px!important;
    padding:4px 2px!important;
    gap:2px!important;
    border-radius:14px!important;
  }
  body.has-mobile-workspace .mobile-admin-bottom-nav small{
    display:block!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:.59rem!important;
    line-height:1.05!important;
    letter-spacing:-.015em!important;
  }
  body.has-mobile-workspace .mobile-admin-bottom-nav .mobile-tab-icon{
    width:23px!important;height:23px!important;
  }
  body.has-mobile-workspace .mobile-admin-bottom-nav .mobile-tab-icon svg{
    width:20px!important;height:20px!important;
  }

  /* The page itself no longer reserves room for the removed secondary topbar. */
  body.has-mobile-workspace .dashboard-head{margin-top:4px!important}
  body.has-mobile-workspace .project-savebar-final,
  body.has-mobile-workspace .mobile-sticky-save{
    bottom:calc(var(--mobile-workspace-bottom) + 14px + env(safe-area-inset-bottom,0px))!important;
  }
  body.has-mobile-workspace .chat-composer,
  body.has-mobile-workspace .composer-shell{
    margin-bottom:calc(var(--mobile-workspace-bottom) + 8px)!important;
  }
}

@media (max-width:430px){
  body.has-mobile-workspace .mobile-admin-bottom-nav{
    left:5px!important;right:5px!important;bottom:calc(5px + env(safe-area-inset-bottom,0px))!important;
    padding:5px!important;border-radius:18px!important;
  }
  body.has-mobile-workspace .mobile-admin-bottom-nav>a,
  body.has-mobile-workspace .mobile-admin-bottom-nav>button{min-height:50px!important}
  body.has-mobile-workspace .mobile-admin-bottom-nav small{font-size:.56rem!important}
}
