/* ============================================================
   ARA SMART — Navigation / Sidebar Visual Pilot Phase 3.14
   Scope: shared navigation only. CSS-only.
   ============================================================ */

.nav.nav-full,
.nav{
  border-color:rgba(255,255,255,.08)!important;
}

.nav .brand,
.topbarBrand,
.coach-sidebar-header,
.coach-sidebar-head{
  min-width:0;
}

.nav .title,
.topbarBrand .title,
.coach-sidebar-title{
  letter-spacing:-.02em;
}

.nav .row,
.topbarCenter,
.topbarRight{
  gap:8px!important;
}

.nav a.btn,
.nav button.btn,
.topbar .navlink,
.coach-sidebar-link,
.coach-sidebar-sub{
  transition:background .14s ease,border-color .14s ease,transform .14s ease,color .14s ease;
}

.nav a.btn:hover,
.nav button.btn:hover,
.topbar .navlink:hover,
.coach-sidebar-link:hover,
.coach-sidebar-sub:hover{
  transform:translateY(-1px);
}

.coach-float-sidebar{
  width:252px!important;
  max-width:252px!important;
  background:linear-gradient(180deg,rgba(16,20,28,.96),rgba(7,8,11,.94))!important;
  border:1px solid rgba(255,255,255,.08)!important;
  box-shadow:0 18px 55px rgba(0,0,0,.42)!important;
  backdrop-filter:blur(14px);
}

.coach-sidebar-header,
.coach-sidebar-head{
  border-bottom:1px solid rgba(255,255,255,.08);
}

.coach-sidebar-head{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  padding:14px 14px 12px!important;
}

.coach-sidebar-toggle{
  width:28px!important;
  height:28px!important;
  display:inline-grid!important;
  place-items:center!important;
  border-radius:12px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  background:rgba(255,255,255,.04)!important;
  color:#F7F8FA!important;
}

.coach-sidebar-links,
.coach-sidebar-nav{
  display:grid!important;
  gap:8px!important;
  padding:12px!important;
}

.coach-sidebar-link{
  min-height:58px!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding:10px 12px!important;
  border-radius:16px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  background:rgba(255,255,255,.025)!important;
  color:#F7F8FA!important;
  text-decoration:none!important;
  overflow:hidden!important;
}

.coach-sidebar-link.active,
.coach-sidebar-sub.active{
  color:#111!important;
  background:linear-gradient(180deg,#F2B705,#E0A800)!important;
  border-color:rgba(242,183,5,.55)!important;
  box-shadow:none!important;
}

.coach-sidebar-link.active .coach-sidebar-link-sub,
.coach-sidebar-link.active .coach-sidebar-copy small,
.coach-sidebar-sub.active .coach-sidebar-sub-dot{
  color:rgba(0,0,0,.72)!important;
}

.coach-sidebar-link.active .coach-sidebar-copy b,
.coach-sidebar-link.active .coach-sidebar-link-title{
  color:#111!important;
}

.coach-sidebar-link-icon,
.coach-sidebar-icon{
  width:34px!important;
  height:34px!important;
  display:inline-grid!important;
  place-items:center!important;
  flex:0 0 34px!important;
  border-radius:13px!important;
  background:rgba(255,255,255,.055)!important;
  line-height:1!important;
}

.coach-sidebar-link.active .coach-sidebar-link-icon,
.coach-sidebar-link.active .coach-sidebar-icon{
  background:rgba(0,0,0,.12)!important;
}

.coach-sidebar-link-title,
.coach-sidebar-copy b{
  display:block!important;
  font-weight:950!important;
  font-size:15px!important;
  line-height:1.12!important;
  color:#F7F8FA!important;
  margin:0!important;
  padding:0!important;
  white-space:normal!important;
}

.coach-sidebar-link-sub,
.coach-sidebar-copy small{
  display:block!important;
  color:#A8B0BF!important;
  font-size:12px!important;
  line-height:1.25!important;
  margin-top:3px!important;
  white-space:normal!important;
}

.coach-sidebar-copy{
  min-width:0!important;
  display:block!important;
  flex:1 1 auto!important;
}

.coach-sidebar-submenu{
  display:grid!important;
  gap:6px!important;
  margin:6px 0 8px 42px!important;
}

.coach-sidebar-sub{
  min-height:34px;
  border-radius:999px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  background:rgba(255,255,255,.025)!important;
}

.coach-float-sidebar.collapsed{
  width:56px!important;
  max-width:56px!important;
}

.coach-float-sidebar.collapsed .coach-sidebar-title,
.coach-float-sidebar.collapsed .coach-sidebar-copy,
.coach-float-sidebar.collapsed .coach-sidebar-link-title,
.coach-float-sidebar.collapsed .coach-sidebar-link-sub{
  display:none!important;
}

.coach-float-sidebar.collapsed .coach-sidebar-link{
  justify-content:center!important;
  padding:10px!important;
}

.coach-float-sidebar.collapsed .coach-sidebar-nav,
.coach-float-sidebar.collapsed .coach-sidebar-links{
  padding:10px 8px!important;
}

@media(max-width:980px){
  .nav.nav-full,
  .nav{
    border-radius:0 0 18px 18px!important;
  }
  .nav .row,
  .topbarCenter{
    overflow-x:auto;
    flex-wrap:nowrap!important;
    -webkit-overflow-scrolling:touch;
    padding-bottom:4px;
  }
  .nav a.btn,
  .nav button.btn,
  .topbar .navlink{
    white-space:nowrap;
    flex:0 0 auto;
  }
  .coach-float-sidebar:not(.collapsed){
    max-width:min(360px,88vw)!important;
  }
}

/* ============================================================
   Coach mobile shell correction
   Fixes: sidebar overlay + oversized mobile topbar.
   ============================================================ */
@media(max-width:860px){
  body.ara-coach-mobile-shell-ready .coach-float-sidebar,
  body.ara-coach-mobile-shell-ready .coach-float-sidebar.ara-coach-generated,
  body.ara-coach-mobile-shell-ready .coach-float-sidebar:not(.collapsed){
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:translateX(-120%)!important;
  }

  body.ara-coach-layout-ready{
    padding-left:0!important;
    overflow-x:hidden!important;
  }

  body.ara-coach-layout-ready .coach-float-sidebar,
  body.ara-coach-layout-ready .coach-float-sidebar.ara-coach-generated,
  body.ara-coach-layout-ready .coach-float-sidebar:not(.collapsed){
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:translateX(-120%)!important;
  }

  body.ara-coach-layout-ready #topbarMount,
  body.ara-coach-layout-ready .ara-coach-topbar-mount{
    width:100%!important;
    max-width:100%!important;
    padding:10px!important;
    margin:0!important;
  }

  body.ara-coach-layout-ready .ara-coach-unified-topbar,
  body.ara-coach-layout-ready .topbar.ara-coach-unified-topbar{
    position:relative!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    border-radius:22px!important;
    overflow:hidden!important;
  }

  body.ara-coach-layout-ready .topbarInner{
    display:grid!important;
    grid-template-columns:1fr auto!important;
    gap:10px!important;
    padding:14px!important;
  }

  body.ara-coach-layout-ready .topbarLeft{
    min-width:0!important;
    width:100%!important;
  }

  body.ara-coach-layout-ready .topbarBrand{
    min-width:0!important;
  }

  body.ara-coach-layout-ready .topbarBrand .title{
    max-width:210px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    font-size:15px!important;
  }

  body.ara-coach-layout-ready .topbarBrand .sub{
    font-size:12px!important;
  }

  body.ara-coach-layout-ready .topbarSearch{
    grid-column:2!important;
    grid-row:1!important;
    width:54px!important;
    min-width:54px!important;
    height:54px!important;
    border-radius:999px!important;
    padding:0!important;
    justify-self:end!important;
  }

  body.ara-coach-layout-ready .topbarSearch input,
  body.ara-coach-layout-ready .topbarSearch .typeahead{
    display:none!important;
  }

  body.ara-coach-layout-ready .topbarSearch .tbSearchIcon{
    width:54px!important;
    height:54px!important;
    display:grid!important;
    place-items:center!important;
    font-size:18px!important;
  }

  body.ara-coach-layout-ready .topbarCenter{
    grid-column:1/-1!important;
    display:flex!important;
    width:100%!important;
    overflow-x:auto!important;
    flex-wrap:nowrap!important;
    gap:10px!important;
    padding:2px 0 6px!important;
    scrollbar-width:none!important;
  }

  body.ara-coach-layout-ready .topbarCenter::-webkit-scrollbar{display:none!important;}

  body.ara-coach-layout-ready .topbar .navlink{
    min-height:60px!important;
    flex:0 0 auto!important;
    border-radius:16px!important;
    padding:12px 14px!important;
    gap:8px!important;
    font-size:13px!important;
  }

  body.ara-coach-layout-ready .topbar .navlink .ico{
    font-size:18px!important;
  }

  body.ara-coach-layout-ready .topbarRight{
    grid-column:1/-1!important;
    display:grid!important;
    grid-template-columns:64px minmax(0,1fr) 110px!important;
    gap:10px!important;
    width:100%!important;
  }

  body.ara-coach-layout-ready .topbarRight .iconBtn{
    min-height:56px!important;
    border-radius:16px!important;
    justify-content:center!important;
    padding:10px 12px!important;
  }

  body.ara-coach-layout-ready .topbarRight .iconBtn[href*="coach_profile_social"]{
    justify-content:flex-start!important;
    min-width:0!important;
  }

  body.ara-coach-layout-ready .topbarRight .iconBtn[href*="coach_profile_social"] span:last-child{
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body.ara-coach-layout-ready .topbarRight #btnLogout{
    width:100%!important;
  }

  body.ara-coach-layout-ready .container,
  body.ara-coach-layout-ready .container-fullwidth,
  body.ara-coach-layout-ready main,
  body.ara-coach-layout-ready .main,
  body.ara-coach-layout-ready .page,
  body.ara-coach-layout-ready .coach-page,
  body.ara-coach-layout-ready .dashboardPage,
  body.ara-coach-layout-ready #heatContent{
    max-width:100%!important;
    margin-left:0!important;
    padding-left:12px!important;
    padding-right:12px!important;
  }

  body.ara-coach-layout-ready #heatContent{
    padding-top:12px!important;
  }
}

@media(max-width:680px){
  .nav.nav-full,
  .nav{
    padding-left:12px!important;
    padding-right:12px!important;
  }
  .nav .brand,
  .topbarBrand{
    width:auto;
  }
  .coach-float-sidebar.collapsed{
    transform:translateX(calc(-100% + 48px));
  }
}

/* Official ARA SMART identity: keep special pages from reverting to legacy gradient marks. */
.topbarBrand .logo,
.nav .brand .logo,
body.only-athletes .topbarBrand .logo,
body.ara-coach-layout-ready .coach-sidebar-head:before,
body.only-athletes .coach-sidebar-head:before{
  background-color:#08090c!important;
  background-image:url("/assets/img/brand/ara-app-icon-dark-1024.png")!important;
  background-size:cover!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
}

body[data-theme="light"] .topbarBrand .logo,
body[data-theme="light"] .nav .brand .logo,
body[data-theme="light"].ara-coach-layout-ready .coach-sidebar-head:before,
body[data-theme="light"].only-athletes .topbarBrand .logo,
body[data-theme="light"].only-athletes .coach-sidebar-head:before{
  background-color:#fff!important;
  background-image:url("/assets/img/brand/ara-app-icon-light-1024.png")!important;
}

/* The shared shell owns its text palette. Explicit descendant colors in the
   legacy navigation layer must not keep dark-theme text on a light surface. */
body:not(.ara-coach-layout-ready) :is([data-ara-coach-sidebar-owner="unified"],[data-ara-coach-mobile-owner="unified"]){visibility:hidden!important;}
body.ara-coach-layout-ready [data-coach-module][aria-hidden="true"]{display:none!important;}
body.ara-coach-layout-ready{
  --coach-menu-text:#f1f5f9;
  --coach-menu-muted:#abb8ca;
  --coach-menu-active:#fff2c6;
  --coach-menu-active-muted:#eed79b;
  --coach-menu-focus:#ffd35a;
  --coach-menu-sub-bg:rgba(255,255,255,.045);
  --coach-menu-border:rgba(255,255,255,.14);
}
body[data-theme="light"].ara-coach-layout-ready{
  --coach-menu-text:#253247;
  --coach-menu-muted:#52647a;
  --coach-menu-active:#493300;
  --coach-menu-active-muted:#695018;
  --coach-menu-focus:#805800;
  --coach-menu-sub-bg:#f4f7fb;
  --coach-menu-border:#d3dce7;
}
body.ara-coach-layout-ready .coach-sidebar-link,
body.ara-coach-layout-ready .coach-sidebar-sub{color:var(--coach-menu-text)!important;}
body.ara-coach-layout-ready .coach-sidebar-link.active{color:var(--coach-menu-active)!important;}
body.ara-coach-layout-ready .coach-sidebar-link .coach-sidebar-copy b,
body.ara-coach-layout-ready .coach-sidebar-link .coach-sidebar-link-title,
body.ara-coach-layout-ready .coach-sidebar-sub .coach-sidebar-sub-label{color:inherit!important;}
body.ara-coach-layout-ready .coach-sidebar-link .coach-sidebar-copy b,
body.ara-coach-layout-ready .coach-sidebar-link .coach-sidebar-link-title{font-weight:800!important;}
body.ara-coach-layout-ready .coach-sidebar-link .coach-sidebar-copy small,
body.ara-coach-layout-ready .coach-sidebar-link .coach-sidebar-link-sub{color:var(--coach-menu-muted)!important;font-weight:600!important;}
body.ara-coach-layout-ready .coach-sidebar-link.active .coach-sidebar-copy small,
body.ara-coach-layout-ready .coach-sidebar-link.active .coach-sidebar-link-sub{color:var(--coach-menu-active-muted)!important;}
body.ara-coach-layout-ready .coach-sidebar-sub{
  min-height:44px;
  background:var(--coach-menu-sub-bg)!important;
  border-color:var(--coach-menu-border)!important;
  font-size:13px;
  line-height:1.35;
}
body.ara-coach-layout-ready .coach-sidebar-sub.active{
  color:#302100!important;
  background:#f7d471!important;
  border-color:#ad7b00!important;
}
body.ara-coach-layout-ready .coach-sidebar-sub .coach-sidebar-sub-label{
  min-width:0;
  white-space:normal;
  overflow-wrap:anywhere;
}
body.ara-coach-layout-ready :is(.coach-float-sidebar,.ara-coach-unified-topbar,.ara-coach-mobile-bottom,.ara-coach-mobile-more) :is(a,button,input):focus-visible{
  outline:3px solid var(--coach-menu-focus)!important;
  outline-offset:2px!important;
  scroll-margin-block:12px;
}
body.ara-coach-layout-ready .coach-sidebar-head > div{min-width:0;}
body.ara-coach-layout-ready .coach-sidebar-title{white-space:normal;line-height:1.25!important;}
body.ara-coach-layout-ready .coach-sidebar-link .coach-sidebar-copy{overflow-wrap:anywhere;}
body.ara-coach-layout-ready .ara-coach-mobile-more .ara-zones-menu-highlight{
  background:var(--coach-menu-sub-bg)!important;
  border-color:var(--coach-menu-focus)!important;
  color:var(--coach-menu-text)!important;
}
body.ara-coach-layout-ready .ara-coach-mobile-more .ara-zones-menu-highlight b{color:inherit!important;}

@media(max-width:1024px){
  body.ara-coach-layout-ready .ara-coach-mobile-more-close{
    min-width:44px;
    min-height:44px;
    flex-shrink:0;
  }
  body.ara-coach-layout-ready .ara-coach-mobile-more-link > span:last-child{min-width:0;overflow-wrap:anywhere;}
  body.ara-coach-layout-ready .ara-coach-mobile-more-link b{font-size:14px;line-height:1.3;}
  body.ara-coach-layout-ready .ara-coach-mobile-more-link small{font-size:12px;line-height:1.4;}
  body.ara-coach-layout-ready .ara-coach-mobile-more-sub a{min-height:44px;line-height:1.35;}
  body.ara-coach-layout-ready .ara-coach-mobile-more-card{overscroll-behavior:contain;scroll-padding-block:10px;}
  body.ara-coach-layout-ready .ara-coach-mobile-bottom .mobileNavItem{line-height:1.25;text-align:center;}
}
@media(max-width:420px){
  body.ara-coach-layout-ready .ara-coach-mobile-more-grid{grid-template-columns:minmax(0,1fr);}
}
@media(prefers-reduced-motion:reduce){
  body.ara-coach-layout-ready :is(.coach-float-sidebar,.coach-sidebar-title,.coach-sidebar-copy,.coach-sidebar-link,.coach-sidebar-sub,.mobileNavItem){transition:none!important;}
}
