/* EvoluiQ v7.0.8 — restaura as cores da logomarca oficial, mantendo o layout aprovado.
   Isolado do cadastro, agenda, RLS e fluxos clínicos. Cores da primeira referência aprovada. */
html body .stage1-header.hero-functional{
  display:grid!important;
  grid-template-columns:minmax(230px,300px) minmax(0,1fr) minmax(260px,350px)!important;
  grid-template-rows:92px 72px!important;
  grid-template-areas:"eqbrand eqinstitution eqaccount" "eqnav eqnav eqnav"!important;
  gap:0!important;
  width:100%!important;height:164px!important;min-height:164px!important;
  max-width:100%!important;margin:0!important;padding:0!important;
  align-items:stretch!important;overflow:visible!important;
  position:relative!important;border:0!important;border-radius:0!important;
  background:
    radial-gradient(ellipse at 56% -50%,rgba(67,222,192,.40),transparent 65%),
    linear-gradient(145deg,transparent 65%,rgba(53,201,169,.12) 65.5%,transparent 90%),
    linear-gradient(101deg,#005f53 0%,#008e7b 44%,#00695d 74%,#004c45 100%)!important;
  box-shadow:0 3px 12px rgba(9,80,65,.10)!important;
}
html body .stage1-header .stage1-brand{
  grid-area:eqbrand!important;min-width:0!important;width:100%!important;
  height:92px!important;padding:8px 12px 8px 20px!important;
  margin:0!important;display:flex!important;align-items:center!important;
  justify-content:flex-start!important;overflow:hidden!important;
}
html body .stage1-header .stage1-brand img{
  display:block!important;width:min(265px,100%)!important;
  max-width:100%!important;max-height:78px!important;height:auto!important;
  object-fit:contain!important;object-position:left center!important;filter:none!important;
}
html body .stage1-header .eq707-institution{
  grid-area:eqinstitution!important;align-self:center!important;min-width:0!important;
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;
  justify-content:center!important;gap:5px!important;
  margin:0 8px!important;padding:4px 20px 4px 24px!important;
  border-left:1px solid rgba(255,255,255,.48)!important;
  color:#fff!important;white-space:normal!important;
}
html body .stage1-header .eq707-institution strong{
  max-width:100%;font-size:clamp(17px,2vw,25px)!important;line-height:1.2!important;
  font-weight:800!important;letter-spacing:-.015em;overflow-wrap:anywhere;color:#fff!important;
}
html body .stage1-header .eq707-institution span{
  max-width:100%;font-size:13px!important;line-height:1.25!important;
  color:#e0faf2!important;overflow-wrap:anywhere;
}
html body .stage1-header .v6917-account{
  grid-area:eqaccount!important;justify-self:end!important;align-self:stretch!important;
  box-sizing:border-box!important;width:min(350px,100%)!important;min-width:0!important;
  height:92px!important;max-height:92px!important;margin:0!important;padding:0 12px!important;
  color:#fff!important;z-index:2!important;overflow:hidden!important;
}
/* Barra de navegação: verde-água claro fiel à primeira imagem aprovada. */
html body .stage1-header .hero-nav-real,
html body .stage1-header .hero-nav-real.eq192-admin-nav{
  grid-area:eqnav!important;position:relative!important;box-sizing:border-box!important;
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  align-items:center!important;gap:12px!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  height:72px!important;min-height:72px!important;overflow:hidden!important;
  margin:0!important;padding:8px clamp(12px,6vw,135px)!important;
  background:linear-gradient(100deg,#d1f4eb 0%,#c5e9e2 46%,#c7efe5 100%)!important;
  border:0!important;border-top:1px solid rgba(255,255,255,.45)!important;
  border-radius:0 0 16px 16px!important;
  box-shadow:none!important;
}
html body .stage1-header .hero-nav-real:not(.eq192-admin-nav){grid-template-columns:repeat(3,minmax(0,1fr))!important}
html body .stage1-header .hero-nav-btn,
html body .stage1-header .hero-nav-btn:hover,
html body .stage1-header .hero-nav-btn.active{
  box-sizing:border-box!important;width:100%!important;height:54px!important;min-height:54px!important;
  min-width:0!important;max-width:100%!important;display:flex!important;
  align-items:center!important;justify-content:center!important;flex-direction:row!important;
  gap:10px!important;padding:4px 10px!important;margin:0!important;
  background:transparent!important;background-image:none!important;
  border:1px solid transparent!important;border-radius:13px!important;
  color:#064a40!important;box-shadow:none!important;white-space:nowrap!important;
  font-size:15px!important;font-weight:750!important;line-height:1.1!important;
}
html body .stage1-header .hero-nav-btn .hicon,
html body .stage1-header .hero-nav-btn .hicon svg,
html body .stage1-header .hero-nav-btn span:last-child{
  color:#07584a!important;fill:currentColor!important;
}
html body .stage1-header .hero-nav-btn span:last-child{
  display:inline!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;
  font-size:15px!important;line-height:1.1!important;white-space:nowrap!important;
}
html body .stage1-header .hero-nav-btn:hover{background:rgba(255,255,255,.50)!important}
html body .stage1-header .hero-nav-btn.active,
html body .stage1-header .hero-nav-btn.active:hover{
  background:linear-gradient(110deg,#006b52,#008768)!important;
  border:1px solid #178b75!important;color:#fff!important;
  box-shadow:0 2px 8px rgba(1,93,72,.12)!important;
}
html body .stage1-header .hero-nav-btn.active .hicon,
html body .stage1-header .hero-nav-btn.active .hicon svg,
html body .stage1-header .hero-nav-btn.active span:last-child{
  color:#fff!important;fill:currentColor!important;
}
html body .stage1-header .hero-nav-btn.hidden{display:none!important}
/* Trigger invisível mantido apenas para ancorar o menu original do perfil. */
html body .stage1-header #eqProfileTrigger{
  position:absolute!important;top:6px!important;right:10px!important;
  width:335px!important;height:78px!important;pointer-events:none!important;
  z-index:0!important;
}
/* Elementos que dependiam da altura antiga devem continuar no fluxo do documento. */
html body .stage1-header + main{margin-top:0!important}
@media (max-width:1140px){
  html body .stage1-header.hero-functional{grid-template-columns:250px minmax(0,1fr) 295px!important}
  html body .stage1-header .stage1-brand{padding-left:12px!important}
  html body .stage1-header .stage1-brand img{width:min(235px,100%)!important}
  html body .stage1-header .eq707-institution{padding-left:14px!important;margin:0 4px!important}
  html body .stage1-header .eq707-institution strong{font-size:20px!important}
  html body .stage1-header .v6917-account{width:295px!important}
  html body .stage1-header .hero-nav-real,
  html body .stage1-header .hero-nav-real.eq192-admin-nav{padding-inline:22px!important;gap:8px!important}
}
@media (max-width:850px) and (min-width:601px){
  html body .stage1-header.hero-functional{grid-template-columns:215px minmax(0,1fr) 70px!important}
  html body .stage1-header .stage1-brand img{width:200px!important}
  html body .stage1-header .eq707-institution strong{font-size:18px!important}
  html body .stage1-header .v6917-account{width:70px!important;height:92px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important;overflow:visible!important}
  html body .stage1-header .v6917-account .v6917-bell,
  html body .stage1-header .v6917-account .v6917-divider,
  html body .stage1-header .v6917-account .v6917-user,
  html body .stage1-header .v6917-account .v6917-chevron{display:none!important}
  html body .stage1-header .hero-nav-btn span:last-child{font-size:13px!important}
  html body .stage1-header #eqProfileTrigger{width:70px!important}
}
@media (max-width:600px){
  html body .stage1-header.hero-functional{
    grid-template-columns:minmax(0,1fr) 68px!important;
    grid-template-rows:72px auto 65px!important;
    grid-template-areas:"eqbrand eqaccount" "eqinstitution eqinstitution" "eqnav eqnav"!important;
    height:auto!important;min-height:0!important;overflow:visible!important;
  }
  html body .stage1-header .stage1-brand{height:72px!important;padding:7px 5px 5px 12px!important}
  html body .stage1-header .stage1-brand img{width:min(245px,100%)!important;max-height:65px!important}
  html body .stage1-header .v6917-account{width:68px!important;height:72px!important;min-width:0!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:visible!important}
  html body .stage1-header .eq707-institution{
    padding:4px 14px 9px!important;margin:0!important;border-left:0!important;
    min-height:46px!important;gap:1px!important;align-self:stretch!important;
  }
  html body .stage1-header .eq707-institution strong{font-size:15px!important;line-height:1.18!important}
  html body .stage1-header .eq707-institution span{font-size:11px!important;line-height:1.15!important}
  html body .stage1-header .hero-nav-real,
  html body .stage1-header .hero-nav-real.eq192-admin-nav{
    height:65px!important;min-height:65px!important;max-height:65px!important;
    padding:5px 5px!important;gap:2px!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    overflow:hidden!important;border-radius:0 0 10px 10px!important;
  }
  html body .stage1-header .hero-nav-real:not(.eq192-admin-nav){grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body .stage1-header .hero-nav-btn,
  html body .stage1-header .hero-nav-btn:hover,
  html body .stage1-header .hero-nav-btn.active{
    height:52px!important;min-height:52px!important;padding:4px 2px!important;gap:3px!important;
    display:flex!important;flex-direction:column!important;border-radius:8px!important;
    white-space:normal!important;
  }
  html body .stage1-header .hero-nav-btn .hicon{width:20px!important;height:20px!important;flex:0 0 20px!important}
  html body .stage1-header .hero-nav-btn .hicon svg{width:19px!important;height:19px!important}
  html body .stage1-header .hero-nav-btn span:last-child{
    display:block!important;max-width:100%!important;white-space:normal!important;
    overflow:visible!important;line-height:1!important;font-size:10px!important;
    text-align:center!important;
  }
  html body .stage1-header #eqProfileTrigger{
    top:4px!important;right:3px!important;width:66px!important;height:65px!important;
  }
}
@media print{html body .stage1-header.hero-functional{display:none!important}}

/* v7.0.17 R2 — prioridade sobre o cabeçalho institucional responsivo.
   O prontuário aberto é exclusivo; o cabeçalho volta ao sair do paciente. */
html body.eq280-patient-focus > .stage1-header.hero-functional {
  display: none !important;
}
/* Também cobre as rotas legadas e o intervalo de abertura antes do modo care/view. */
html body:has(#clinicalGrid.patient-open:not(.hidden) #area:not(.hidden)) > .stage1-header.hero-functional {
  display: none !important;
}

/* R3: prevent browser scroll anchoring during the exclusive clinical layout. */
html:has(body.eq280-patient-focus), body.eq280-patient-focus { overflow-anchor: none; }

/* R4: no animated repositioning while the exclusive workspace opens. */
html:has(body.eq280-patient-focus),body.eq280-patient-focus{scroll-behavior:auto!important;overflow-anchor:none!important}
body.eq280-patient-focus #clinicalGrid,body.eq280-patient-focus #patientWorkspace,body.eq280-patient-focus #patientIdentityHeader,body.eq280-patient-focus #patientNav,body.eq280-patient-focus #area{transition:none!important;animation:none!important;overflow-anchor:none!important}
