/* TerapiaBinaural® Radar 7D PRO — Navegação TypeScript
 * Escopo visual/progressivo: não altera dados, metas, shortcodes, permissões,
 * relatórios ou backups. O objetivo é estabilizar menu terapeuta/cliente no
 * mobile e no desktop preservando os ícones já existentes.
*/
html[data-tb-react-navigationshell="ready"]{
  --tb-nav-ink:#253263;
  --tb-nav-muted:#64748b;
  --tb-nav-line:rgba(37,50,99,.14);
  --tb-nav-soft:#f8fafc;
  --tb-nav-card:#ffffff;
  --tb-nav-shadow:0 24px 64px rgba(15,23,42,.18);
  --tb-nav-accent:#f59e0b;
}

html[data-tb-react-navigationshell="ready"] body.tb-navigation-drawer-open{
  overflow:hidden;
  touch-action:none;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-mobilebar{
  position:relative;
  display:none;
  width:100%;
  max-width:100%;
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid var(--tb-nav-line);
  background:linear-gradient(135deg,#fff 0%,#f8fbff 100%);
  color:var(--tb-nav-ink);
  box-shadow:0 12px 28px rgba(37,50,99,.08);
  box-sizing:border-box;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-toggle{
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  border:1px solid rgba(37,50,99,.16);
  border-radius:14px;
  background:#fff;
  color:var(--tb-nav-ink);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
  padding:0 11px;
  box-shadow:0 10px 22px rgba(37,50,99,.08);
  cursor:pointer;
  touch-action:manipulation;
  box-sizing:border-box;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-toggle span{
  display:block;
  width:100%;
  height:2px;
  border-radius:999px;
  background:currentColor;
  transition:transform .18s ease, opacity .18s ease;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-toggle.is-open span:nth-child(1){
  transform:translateY(7px) rotate(45deg);
}
html[data-tb-react-navigationshell="ready"] .tb-navigation-toggle.is-open span:nth-child(2){
  opacity:0;
}
html[data-tb-react-navigationshell="ready"] .tb-navigation-toggle.is-open span:nth-child(3){
  transform:translateY(-7px) rotate(-45deg);
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-overlay{
  position:fixed;
  inset:0;
  z-index:100000;
  background:rgba(15,23,42,.38);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-overlay.is-open{
  opacity:1;
  pointer-events:auto;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer{
  color:var(--tb-nav-ink);
  -webkit-overflow-scrolling:touch;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer .tb-navigation-item{
  width:100%;
  min-height:48px;
  justify-content:flex-start;
  align-items:center;
  gap:10px;
  white-space:normal;
  text-align:left;
  border-radius:16px;
  box-sizing:border-box;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer .tb-navigation-item.tb-sidebtn-active,
html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer .tb-navigation-item.is-active,
html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer .tb-navigation-item[aria-current="page"]{
  border-color:rgba(245,158,11,.36);
  background:linear-gradient(135deg,rgba(245,158,11,.16),rgba(37,50,99,.06));
  color:var(--tb-nav-ink);
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-client{
  position:fixed;
  top:0;
  right:0;
  bottom:0;
  width:min(390px, 92dvw);
  max-width:92dvw;
  z-index:100002;
  padding:18px 14px 22px;
  background:linear-gradient(180deg,#fff 0%,#f8fafc 100%);
  border-left:1px solid var(--tb-nav-line);
  box-shadow:var(--tb-nav-shadow);
  transform:translateX(108%);
  visibility:hidden;
  overflow:auto;
  transition:transform .24s ease, visibility .24s ease;
  box-sizing:border-box;
}

html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-client.is-open{
  transform:translateX(0);
  visibility:visible;
}

html[data-tb-react-navigationshell="ready"] .tb-client-menu-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin:-18px -14px 14px;
  padding:18px 14px 12px;
  background:linear-gradient(180deg,#fff 0%,rgba(255,255,255,.94) 100%);
  border-bottom:1px solid rgba(37,50,99,.08);
}

html[data-tb-react-navigationshell="ready"] .tb-client-menu-title{
  font-size:17px;
  font-weight:900;
  color:var(--tb-nav-ink);
  line-height:1.2;
}

html[data-tb-react-navigationshell="ready"] .tb-client-menu-subtitle{
  margin-top:3px;
  color:var(--tb-nav-muted);
  font-size:12px;
  line-height:1.35;
}

html[data-tb-react-navigationshell="ready"] .tb-client-menu-close,
html[data-tb-react-navigationshell="ready"] #tbMobileMenuClose{
  width:40px;
  height:40px;
  min-width:40px;
  border:1px solid rgba(37,50,99,.14);
  border-radius:14px;
  background:#fff;
  color:var(--tb-nav-ink);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(37,50,99,.07);
}

html[data-tb-react-navigationshell="ready"] #tbClientMenuNav{
  display:grid;
  grid-template-columns:1fr;
  gap:9px;
}

html[data-tb-react-navigationshell="ready"] #tbClientMenuNav .tb-navigation-client-tab{
  min-height:54px;
  padding:10px 12px;
}

html[data-tb-react-navigationshell="ready"] .tb-client-menu-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  width:100%;
  margin-top:12px;
}

html[data-tb-react-navigationshell="ready"] .tb-client-menu-actions .tb-navigation-action,
html[data-tb-react-navigationshell="ready"] .tb-client-menu-actions .tb-btn{
  width:100%;
  min-height:48px;
  justify-content:flex-start;
  text-align:left;
  box-sizing:border-box;
}

html[data-tb-react-navigationshell="ready"] .tb-client-menu-divider{
  height:1px;
  background:rgba(37,50,99,.10);
  margin:14px 0 2px;
}

html[data-tb-react-navigationshell="ready"] .tb-client-portal-topbar .tb-client-portal-actions-menu{
  width:auto!important;
  max-width:100%;
  flex-wrap:nowrap;
}

html[data-tb-react-navigationshell="ready"] .tb-client-portal-topbar .tb-client-menu-toggle{
  display:inline-flex;
}

@media (min-width:981px){
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist{
    visibility:visible!important;
    transform:none!important;
  }
  html[data-tb-react-navigationshell="ready"] .tb-navigation-overlay-therapist{
    display:none!important;
  }
  html[data-tb-react-navigationshell="ready"] .tb-navigation-mobilebar-therapist{
    display:none!important;
  }
}

@media (max-width:980px){
  html[data-tb-react-navigationshell="ready"] .tb-navigation-mobilebar{
    display:flex!important;
    border-radius:0!important;
    margin:0 0 10px!important;
  }

  html[data-tb-react-navigationshell="ready"] .tb-mobilebar-text{
    min-width:0;
    flex:1 1 auto;
  }

  html[data-tb-react-navigationshell="ready"] .tb-mobilebar-title{
    font-size:14px;
    line-height:1.18;
    font-weight:900;
    color:var(--tb-nav-ink);
  }

  html[data-tb-react-navigationshell="ready"] .tb-mobilebar-sub{
    display:block;
    margin-top:3px;
    font-size:11.5px;
    line-height:1.25;
    color:var(--tb-nav-muted);
  }

  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist{
    position:fixed!important;
    top:0!important;
    left:0!important;
    bottom:0!important;
    z-index:100002!important;
    width:min(340px, 88dvw)!important;
    min-width:0!important;
    max-width:88dvw!important;
    padding:18px 14px 24px!important;
    background:linear-gradient(180deg,#fff 0%,#f8fafc 100%)!important;
    border-right:1px solid var(--tb-nav-line)!important;
    box-shadow:var(--tb-nav-shadow)!important;
    transform:translateX(-108%)!important;
    visibility:hidden!important;
    overflow:auto!important;
    transition:transform .24s ease, visibility .24s ease!important;
    box-sizing:border-box!important;
  }

  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist.is-open{
    transform:translateX(0)!important;
    visibility:visible!important;
  }

  html[data-tb-react-navigationshell="ready"] .tb-sidebar-head{
    position:sticky;
    top:0;
    z-index:2;
    margin:-18px -14px 12px;
    padding:18px 14px 12px;
    background:linear-gradient(180deg,#fff 0%,rgba(255,255,255,.94) 100%);
    border-bottom:1px solid rgba(37,50,99,.08);
  }

  html[data-tb-react-navigationshell="ready"] .tb-sidebar-title{
    font-size:17px;
    font-weight:900;
    color:var(--tb-nav-ink);
  }

  html[data-tb-react-navigationshell="ready"] .tb-sidebar-close{
    display:inline-flex!important;
  }

  html[data-tb-react-navigationshell="ready"] .tb-sidebar-mobile-tools{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    margin-top:14px!important;
  }

  html[data-tb-react-navigationshell="ready"] .tb-client-portal-topbar{
    display:flex;
    justify-content:flex-end;
    width:100%;
  }

  html[data-tb-react-navigationshell="ready"] .tb-client-portal-topbar .tb-client-portal-header-menu,
  html[data-tb-react-navigationshell="ready"] .tb-client-portal-topbar .tb-client-portal-actions-menu{
    width:auto!important;
    margin-left:auto!important;
  }

  html[data-tb-react-navigationshell="ready"] .tb-client-mobilebar-actions{
    display:inline-flex;
    align-items:center;
    gap:8px;
    flex:0 0 auto;
  }

  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-client{
    width:min(360px, 92dvw);
    max-width:92dvw;
  }
}

@media (max-width:430px){
  html[data-tb-react-navigationshell="ready"] .tb-navigation-toggle{
    width:42px;
    height:42px;
    min-width:42px;
    min-height:42px;
    border-radius:13px;
  }

  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-client,
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist{
    width:94dvw!important;
    max-width:94dvw!important;
  }

  html[data-tb-react-navigationshell="ready"] #tbClientMenuNav .tb-navigation-client-tab,
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer .tb-navigation-item{
    min-height:50px;
    font-size:13px;
  }
}

@media (prefers-reduced-motion: reduce){
  html[data-tb-react-navigationshell="ready"] .tb-navigation-toggle span,
  html[data-tb-react-navigationshell="ready"] .tb-navigation-overlay,
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-client,
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist{
    transition:none!important;
  }
}

/* Mobile: margem segura no topo do menu do terapeuta para evitar botão Clientes cortado.*/
@media (max-width:980px){
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist{
    padding-top:max(26px, calc(env(safe-area-inset-top, 0px) + 22px))!important;
    scroll-padding-top:max(28px, calc(env(safe-area-inset-top, 0px) + 24px))!important;
  }
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist .tb-sidebar-head{
    margin-top:0!important;
    padding-top:0!important;
  }
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist #tbNavClients{
    margin-top:8px!important;
  }
}

/* Desktop sem botão X no menu lateral; mobile com margem segura no topo.*/
@media (min-width:981px){
  html[data-tb-react-navigationshell="ready"] #tbMobileMenuClose,
  html[data-tb-react-navigationshell="ready"] .tb-sidebar-close{
    display:none!important;
    visibility:hidden!important;
  }
}
@media (max-width:980px){
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist{
    padding-top:max(44px, calc(env(safe-area-inset-top, 0px) + 38px))!important;
  }
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist #tbNavClients,
  html[data-tb-react-navigationshell="ready"] .tb-navigation-drawer-therapist .tb-sidebtn:first-of-type{
    margin-top:14px!important;
  }
}
