/* Header global do sistema
   Responsabilidade única:
   - topo público
   - topo de painel
   - topo mobile da referência
   - bloco do usuário do topo

   Não colocar aqui:
   - sidebar
   - navegação lateral/mobile
   - shell da página
   - botões genéricos
   - tabelas
*/

.sv-layout-public-topbar{
  min-height:83px;
  border-bottom:2px solid #C91F2C;
  background:#C91F2C;
  box-shadow:none;
}

.sv-layout-public-topbar-inner{
  width:100%;
  max-width:1100px;
  margin:0 auto;
  min-height:83px;
  padding:0 18px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.sv-layout-public-topbar img{
  height:50px;
  width:auto;
  max-width:min(320px, 62vw);
  display:block;
  object-fit:contain;
}

.sv-topbar{
  background:var(--sv-red);
  border-bottom:0;
  min-height:84px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.sv-topbar img{
  height:42px;
  width:auto;
  display:block;
}

.sv-topbar--painel{
  height:auto;
  min-height:80px;
  justify-content:center;
  background:var(--sv-red);
  box-shadow:none;
  position:relative;
  overflow:visible;
}

.sv-topbar--painel::before{
  content:none;
}

.sv-topbar-inner{
  width:100%;
  max-width:1100px;
  margin:0 auto;
  padding:0 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.sv-topbar-brand{
  display:flex;
  align-items:center;
  gap:16px;
  min-width:0;
}

.sv-topbar-rail{
  display:flex;
  align-items:center;
  min-width:0;
}

.sv-topbar-menuico{
  width:22px;
  height:22px;
  flex:0 0 22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:0;
  background:transparent;
  color:#ffffff;
  opacity:.98;
  cursor:pointer;
}

.sv-topbar-menuico svg{
  width:20px;
  height:20px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2.3;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sv-topbar-menuico:hover{
  opacity:1;
}

.sv-topbar-menuico:focus-visible{
  outline:2px solid rgba(255,255,255,.72);
  outline-offset:3px;
  border-radius:6px;
}

.sv-topbar-meta{
  color:#fff;
  font-size:var(--sv-font-normal);
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:40px;
  padding:0 14px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.06);
  border-radius:6px;
  line-height:1;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}

.sv-topbar-meta::before{
  content:"";
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-block;
  background-repeat:no-repeat;
  background-position:center;
  background-size:20px 20px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.15' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 12c2.48 0 4.5-2.02 4.5-4.5S14.48 3 12 3 7.5 5.02 7.5 7.5 9.52 12 12 12z'/%3E%3Cpath d='M4.5 20v-1.2c0-2.82 4.02-5.1 7.5-5.1s7.5 2.28 7.5 5.1V20z'/%3E%3C/svg%3E");
}

.sv-topbar-meta a{
  color:#fff;
  text-decoration:none;
}

.sv-topbar-meta a:hover{
  text-decoration:underline;
}

.sv-global-patient-search{
  position:relative;
  width:min(620px, 42vw);
  min-width:280px;
  min-height:42px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 7px 0 13px;
  border:1px solid rgba(255,255,255,.26);
  border-radius:6px;
  background:rgba(255,255,255,.12);
  box-shadow:none;
  color:#fff;
  z-index:20;
}

.sv-global-patient-search-icon{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-flex;
  color:#fff;
  opacity:.95;
}

.sv-global-patient-search-icon svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sv-global-patient-search-input{
  width:100%;
  min-width:0;
  height:40px;
  border:0 !important;
  outline:0 !important;
  background:transparent !important;
  color:#fff !important;
  box-shadow:none !important;
  font-size:15px !important;
  font-weight:500;
}

.sv-global-patient-search-input::placeholder{
  color:rgba(255,255,255,.78);
}

.sv-global-patient-search-submit{
  appearance:none;
  min-height:32px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:6px !important;
  background:#fff;
  color:var(--sv-red);
  box-shadow:none;
  font-size:13px;
  font-weight:700;
  letter-spacing:0;
  cursor:pointer;
}

.sv-global-patient-search-submit:hover,
.sv-global-patient-search-submit:focus{
  background:#fff7f7;
  border-color:#fff;
}

.sv-global-patient-search-results{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  z-index:4100;
  overflow:hidden;
  border:1px solid #d7dde5;
  border-radius:6px;
  background:#fff;
  box-shadow:0 18px 38px rgba(15,23,42,.18);
}

.sv-global-patient-result,
.sv-global-patient-result-message{
  appearance:none;
  width:100%;
  min-height:58px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:0;
  border-bottom:1px solid #edf0f4;
  background:#fff;
  color:#111827;
  font-family:inherit;
  font-weight:400;
  text-align:left;
  box-shadow:none;
}

.sv-global-patient-result:last-child,
.sv-global-patient-result-message:last-child{
  border-bottom:0;
}

.sv-global-patient-result{
  cursor:pointer;
}

.sv-global-patient-result:hover,
.sv-global-patient-result:focus{
  background:#fff7f7;
}

.sv-global-patient-result-avatar{
  width:38px;
  height:38px;
  flex:0 0 38px;
  border-radius:50%;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff1f2;
  color:var(--sv-red);
}

.sv-global-patient-result-avatar img{
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  object-fit:cover !important;
  display:block !important;
}

.sv-global-patient-result-avatar svg{
  width:23px;
  height:23px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sv-global-patient-result-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.sv-global-patient-result-copy strong{
  overflow:hidden;
  color:#111827;
  font-size:14px;
  font-weight:700;
  line-height:1.2;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.sv-global-patient-result-copy small,
.sv-global-patient-result-message{
  color:#64748b;
  font-size:13px;
  font-weight:500;
  line-height:1.25;
}

.sv-global-patient-modal[hidden]{
  display:none !important;
}

.sv-global-patient-modal{
  position:fixed;
  inset:0;
  z-index:5000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
}

.sv-global-patient-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.55);
}

.sv-global-patient-dialog{
  position:relative;
  z-index:1;
  width:min(1160px, calc(100vw - 36px));
  max-height:calc(100vh - 42px);
  overflow:hidden;
  border:1px solid #d7dde5;
  border-radius:6px;
  background:#fff;
  box-shadow:0 22px 70px rgba(15,23,42,.32);
}

.sv-global-patient-dialog-head{
  min-height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 16px;
  border-bottom:1px solid #e5e7eb;
  background:#fff;
}

.sv-global-patient-kicker{
  display:block;
  margin-bottom:2px;
  color:#94a3b8;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.sv-global-patient-dialog-head h2{
  margin:0;
  color:#111827;
  font-size:16px;
  font-weight:800;
  line-height:1.2;
}

.sv-global-patient-close{
  width:38px;
  height:38px;
  flex:0 0 38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #c91f2c;
  border-radius:6px;
  background:#c91f2c;
  color:#ffffff;
  box-shadow:none;
  cursor:pointer;
}

.sv-global-patient-close:hover{
  background:#d73838;
  border-color:#d73838;
  color:#ffffff;
}

.sv-global-patient-close svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2.3;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sv-global-patient-dialog-body{
  max-height:calc(100vh - 124px);
  overflow:auto;
  padding:16px;
  background:#fcfcfc;
}

.sv-global-patient-dialog-body .info-saude-root{
  margin:0 !important;
}

.sv-global-patient-loading,
.sv-global-patient-error{
  padding:18px;
  border:1px solid #e5e7eb;
  border-radius:6px;
  background:#fff;
  color:#64748b;
  font-size:15px;
  font-weight:700;
  text-align:center;
}

.sv-global-patient-error{
  color:#b91c1c;
  background:#fff7f7;
}

body.sv-global-patient-modal-open{
  overflow:hidden;
}

.sv-user-menu{
  position:relative;
  min-width:0;
  color:#fff;
}

.sv-user-menu-button{
  appearance:none;
  -webkit-appearance:none;
  border:0;
  min-height:58px;
  padding:4px 0;
  display:flex;
  align-items:center;
  gap:10px;
  background:transparent;
  color:#fff;
  cursor:pointer;
  text-align:left;
  box-shadow:none;
}

.sv-user-menu-button:hover{
  filter:brightness(1.06);
}

.sv-user-menu-button:focus-visible{
  outline:2px solid rgba(255,255,255,.72);
  outline-offset:4px;
  border-radius:6px;
}

.sv-user-menu-avatar,
.sv-user-menu-cardavatar{
  width:48px;
  height:48px;
  flex:0 0 48px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.88);
  background:#ffffff;
  color:#5b6472;
  font-size:14px;
  font-weight:800;
  letter-spacing:.04em;
  box-shadow:0 0 0 3px rgba(255,255,255,.16), 0 5px 14px rgba(15,23,42,.14);
}

.sv-user-menu-avatar.is-placeholder,
.sv-user-menu-cardavatar.is-placeholder,
.m-mobile-avatar.is-placeholder{
  background:#ffffff;
  color:#C91F2C;
}

.sv-user-menu-avatar img,
.sv-user-menu-cardavatar img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.sv-user-menu-avatar .sv-user-menu-placeholder-img,
.sv-user-menu-cardavatar .sv-user-menu-placeholder-img,
.m-mobile-avatar .sv-user-menu-placeholder-img{
  width:100%;
  height:100%;
  padding:5px;
  object-fit:contain;
}

.sv-topbar--painel .sv-user-menu-avatar img,
.sv-topbar--painel .sv-user-menu-cardavatar img{
  width:100%;
  max-width:none;
  height:100%;
  margin:0;
  object-fit:cover;
}

.sv-user-menu-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
  line-height:1.1;
}

.sv-user-menu-main .sv-user-menu-name{
  max-width:220px;
  overflow:hidden;
  color:#ffffff;
  font-size:15px;
  font-weight:400;
  line-height:1.1;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.sv-user-menu-main .sv-user-menu-name span{
  font-weight:400;
}

.sv-user-menu-main .sv-user-menu-name b{
  font-weight:600;
}

.sv-user-menu-main > span:not(.sv-user-menu-name){
  max-width:220px;
  overflow:hidden;
  color:rgba(255,255,255,.88);
  font-size:13px;
  font-weight:700;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.sv-user-menu-chevron{
  width:18px;
  height:18px;
  flex:0 0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#ffffff;
  transition:transform .16s ease;
}

.sv-user-menu-chevron svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:2.4;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sv-user-menu.is-open .sv-user-menu-chevron{
  transform:rotate(180deg);
}

.sv-user-menu-popover{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  width:312px;
  display:none;
  padding:10px;
  border:1px solid #e4e7ee;
  border-radius:6px;
  background:#ffffff;
  color:#111827;
  box-shadow:0 18px 42px rgba(15,23,42,.18);
  z-index:9900;
}

.sv-user-menu.is-open .sv-user-menu-popover{
  display:block;
}

.sv-user-menu-cardhead{
  display:flex;
  align-items:center;
  gap:10px;
  padding:4px 4px 10px;
  border-bottom:1px solid #edf0f5;
}

.sv-user-menu-cardavatar{
  width:54px;
  height:54px;
  flex-basis:54px;
  border-color:#ffffff;
  background:#C91F2C;
  color:#ffffff;
  box-shadow:0 0 0 1px #e4e7ee, 0 8px 18px rgba(15,23,42,.10);
}

.sv-user-menu-cardhead div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.sv-user-menu-cardhead strong{
  overflow:hidden;
  color:#111827;
  font-size:15px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.sv-user-menu-cardhead span{
  color:#6b7280;
  font-size:13px;
  font-weight:700;
}

.sv-user-menu-details{
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
  padding:10px 4px;
  border-bottom:1px solid #edf0f5;
}

.sv-user-menu-details div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:24px;
}

.sv-user-menu-details span{
  color:#6b7280;
  font-size:12px;
  font-weight:700;
}

.sv-user-menu-details strong{
  min-width:0;
  overflow:hidden;
  color:#111827;
  font-size:13px;
  font-weight:800;
  text-align:right;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.sv-user-menu-actions{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-top:8px;
}

.sv-user-menu-item{
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  min-height:38px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#111827;
  font-size:14px;
  font-weight:700;
  line-height:1.2;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
}

.sv-user-menu-item:hover{
  background:#f6f7fb;
  color:#111827;
  text-decoration:none;
}

.sv-user-menu-item svg{
  width:18px;
  height:18px;
  flex:0 0 18px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sv-user-menu-item span{
  flex:1 1 auto;
}

.sv-user-menu-item b{
  color:#6b7280;
  font-size:12px;
  font-weight:800;
}

.sv-user-menu-item-danger{
  color:#C91F2C;
}

.sv-user-menu-item-danger:hover{
  background:rgba(201,31,44,.08);
  color:#C91F2C;
}

body.sv-theme-dark .sv-user-menu-popover,
body.sv-theme-dark .m-mobile-usermenu{
  border-color:#334155;
  background:#111827;
  color:#e5e7eb;
  box-shadow:0 18px 42px rgba(0,0,0,.32);
}

body.sv-theme-dark .sv-user-menu-cardhead,
body.sv-theme-dark .sv-user-menu-details,
body.sv-theme-dark .m-mobile-userlabel{
  border-color:#334155;
}

body.sv-theme-dark .sv-user-menu-cardhead strong,
body.sv-theme-dark .sv-user-menu-details strong,
body.sv-theme-dark .sv-user-menu-item,
body.sv-theme-dark .m-mobile-userlabel strong,
body.sv-theme-dark .m-mobile-userdetail strong,
body.sv-theme-dark .m-mobile-userlink{
  color:#e5e7eb;
}

body.sv-theme-dark .sv-user-menu-cardhead span,
body.sv-theme-dark .sv-user-menu-details span,
body.sv-theme-dark .sv-user-menu-item b,
body.sv-theme-dark .m-mobile-userlabel small,
body.sv-theme-dark .m-mobile-userdetail,
body.sv-theme-dark .m-mobile-userbutton b{
  color:#a7b0c0;
}

body.sv-theme-dark .sv-user-menu-item:hover,
body.sv-theme-dark .m-mobile-userlink:hover{
  background:#1f2937;
  color:#ffffff;
}

body.sv-theme-dark .sv-user-menu-item-danger,
body.sv-theme-dark .sv-user-menu-item-danger:hover{
  color:#f87171;
}

.sv-topbar--painel .sv-topbar-inner{
  max-width:none;
  margin:0;
  width:100%;
  min-height:80px;
  padding:0 28px 0 0;
  display:grid;
  grid-template-columns:var(--sv-sidebar-width) minmax(170px, 260px) minmax(240px, 1fr) auto auto;
  align-items:center;
  justify-content:stretch;
  gap:18px;
  position:relative;
}

.sv-topbar--painel .sv-topbar-rail{
  position:absolute;
  left:22px;
  top:50%;
  z-index:2;
  min-height:0;
  padding-left:0;
  transform:translateY(-50%);
  justify-self:auto;
}

.sv-topbar--painel .sv-topbar-brand{
  grid-column:2;
  min-height:80px;
  padding-left:28px;
  justify-self:start;
}

.sv-topbar--painel .sv-topbar-inner img{
  margin:0;
  max-width:min(220px, 34vw);
  height:50px;
  width:auto;
  justify-self:start;
}

.sv-topbar--painel .sv-topbar-meta{
  grid-column:4;
  margin:0;
  white-space:nowrap;
  justify-self:end;
  margin-left:0;
}

.sv-topbar--painel .sv-user-menu{
  grid-column:5;
  justify-self:end;
}

.sv-topbar--painel .sv-global-patient-search--desktop{
  grid-column:3;
  justify-self:center;
  width:min(560px, 100%);
  max-width:100%;
  min-width:240px;
}

.sv-topbar-extra-actions{
  grid-column:4;
  justify-self:end;
  display:flex;
  align-items:center;
  gap:10px;
  position:relative;
  z-index:60;
}

body.sv-sidebar-collapsed .sv-topbar--painel .sv-topbar-inner{
  grid-template-columns:var(--sv-sidebar-width-collapsed) minmax(170px, 260px) minmax(240px, 1fr) auto auto;
}

.sv-topbar--painel .chat-topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.sv-topbar--painel .chat-topbar-menu{
  position:relative;
}

.sv-topbar--painel .chat-topbar-btn{
  width:48px;
  height:48px;
  border:1px solid rgba(255,255,255,.26);
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  position:relative;
  box-shadow:none;
  cursor:pointer;
}

.sv-topbar--painel .chat-topbar-btn:hover,
.sv-topbar--painel .chat-topbar-btn[aria-expanded="true"]{
  background:rgba(255,255,255,.16);
}

.sv-topbar--painel .chat-topbar-icon,
.sv-topbar--painel .chat-topbar-icon svg{
  width:22px;
  height:22px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
}

.sv-topbar--painel .chat-topbar-badge,
.sv-topbar--painel .chat-drop-item b{
  border-radius:999px;
  background:var(--sv-ds-red, #c91f2c);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
}

.sv-topbar--painel .chat-topbar-badge{
  position:absolute;
  right:-5px;
  top:-7px;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border:2px solid var(--sv-ds-red, #c91f2c);
  background:#fff;
  color:var(--sv-ds-red, #c91f2c);
  font-size:12px;
}

.sv-topbar--painel .chat-topbar-badge[hidden],
.m-mobile-chat-actions .chat-topbar-badge[hidden]{
  display:none !important;
}

.sv-topbar--painel .chat-topbar-btn.has-unread,
.m-mobile-chat-actions .chat-topbar-btn.has-unread{
  background:rgba(255,255,255,.18);
}

.sv-topbar--painel .chat-topbar-dropdown{
  position:absolute;
  top:58px;
  right:0;
  width:360px;
  max-width:min(360px, calc(100vw - 24px));
  border:1px solid #d7dce3;
  border-radius:6px;
  background:#fff;
  box-shadow:0 18px 44px rgba(15,23,42,.18);
  color:#111827;
  overflow:hidden;
  z-index:3000;
}

.sv-topbar--painel .chat-topbar-dropdown--notificacoes{
  width:390px;
}

.sv-topbar--painel .chat-drop-head,
.sv-topbar--painel .chat-drop-footer{
  min-height:52px;
  padding:0 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid #edf0f4;
}

.sv-topbar--painel .chat-drop-head strong{
  font-size:14px;
  font-weight:800;
}

.sv-topbar--painel .chat-drop-head a,
.sv-topbar--painel .chat-drop-head button,
.sv-topbar--painel .chat-drop-footer{
  border:0;
  background:transparent;
  color:#1d4ed8;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}

.sv-topbar--painel .chat-drop-list{
  display:flex;
  flex-direction:column;
}

.sv-topbar--painel .chat-drop-item{
  min-height:78px;
  padding:12px 16px;
  display:grid;
  grid-template-columns:42px minmax(0, 1fr) auto;
  gap:12px;
  align-items:center;
  border-bottom:1px solid #edf0f4;
}

.sv-topbar--painel .chat-drop-empty{
  min-height:82px;
  padding:14px 16px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  color:#64748b;
  border-bottom:1px solid #edf0f4;
}

.sv-topbar--painel .chat-drop-empty strong{
  color:#111827;
  font-size:13px;
  font-weight:800;
}

.sv-topbar--painel .chat-drop-empty small{
  font-size:12px;
  font-weight:600;
  line-height:1.35;
}

.sv-topbar--painel .chat-drop-item strong,
.sv-topbar--painel .chat-drop-item small{
  display:block;
}

.sv-topbar--painel .chat-drop-item strong{
  color:#111827;
  font-size:13px;
  font-weight:800;
}

.sv-topbar--painel .chat-drop-item small{
  margin-top:3px;
  color:#64748b;
  font-size:12px;
  line-height:1.35;
}

.sv-topbar--painel .chat-drop-item time{
  align-self:start;
  color:#64748b;
  font-size:11px;
}

.sv-topbar--painel .chat-drop-item b{
  min-width:20px;
  height:20px;
  padding:0 6px;
  font-size:11px;
}

.sv-topbar--painel .chat-drop-status,
.sv-topbar--painel .chat-avatar{
  width:42px;
  height:42px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 42px;
}

.sv-topbar--painel .chat-drop-status svg{
  width:21px;
  height:21px;
}

.sv-topbar--painel .chat-drop-status--info{ background:#e8f1ff; color:#2563eb; }
.sv-topbar--painel .chat-drop-status--warn{ background:#fff4df; color:#f59e0b; }
.sv-topbar--painel .chat-drop-status--ok{ background:#dcfce7; color:#16a34a; }

.sv-topbar--painel .chat-avatar{
  color:#fff;
  font-size:13px;
  font-weight:900;
}

.sv-topbar--painel .chat-avatar--photo{ background:linear-gradient(135deg, #c91f2c, #8f1520); }
.sv-topbar--painel .chat-avatar--brand{ background:linear-gradient(135deg, #16a34a, #047857); }
.sv-topbar--painel .chat-avatar--team{ background:linear-gradient(135deg, #2563eb, #1e40af); }
.sv-topbar--painel .chat-avatar--lab{ background:linear-gradient(135deg, #f59e0b, #b45309); }

.sv-topbar--painel .sv-topbar-meta a{
  font-weight:700;
}

.sv-ref-page .sv-topbar--painel{
  min-height:var(--sv-ds-topbar-height);
  background:var(--sv-ds-red);
  box-shadow:none;
}

.sv-ref-page .sv-topbar--painel .sv-topbar-inner{
  min-height:var(--sv-ds-topbar-height);
}

.sv-ref-page .sv-topbar-meta{
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  border-radius:var(--sv-ds-radius);
  box-shadow:none;
}

.sv-ref-mobile-chrome{
  margin:-14px -14px 14px;
}

.m-mobile-topbar{
  position:relative;
  z-index:4300;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px;
  min-height:72px;
  background:var(--sv-ref-red);
  box-shadow:0 6px 18px rgba(201, 31, 44, .18);
  overflow:visible;
}

.m-mobile-logo{
  height:44px;
  width:auto;
  flex:0 0 auto;
  display:block;
}

.m-mobile-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  min-width:0;
}

.m-mobile-chat-actions,
.m-mobile-chat-actions .chat-topbar-actions{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
}

.m-mobile-chat-actions .chat-topbar-menu{
  position:relative;
}

.m-mobile-chat-actions .chat-topbar-btn{
  width:38px;
  height:38px;
  border:1px solid rgba(255,255,255,.28);
  border-radius:6px;
  background:rgba(255,255,255,.12);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  position:relative;
  box-shadow:none;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

.m-mobile-chat-actions .chat-topbar-btn:active,
.m-mobile-chat-actions .chat-topbar-btn[aria-expanded="true"]{
  background:rgba(255,255,255,.2);
}

.m-mobile-chat-actions .chat-topbar-icon,
.m-mobile-chat-actions .chat-topbar-icon svg{
  width:19px;
  height:19px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
}

.m-mobile-chat-actions .chat-topbar-badge{
  position:absolute;
  top:-6px;
  right:-5px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border:2px solid var(--sv-ref-red);
  border-radius:999px;
  background:#fff;
  color:var(--sv-ref-red);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  font-weight:900;
  line-height:1;
}

.m-mobile-chat-actions .chat-topbar-dropdown{
  position:fixed;
  top:72px;
  left:14px;
  right:14px;
  width:auto;
  max-width:none;
  max-height:calc(100vh - 88px);
  overflow:auto;
  border:1px solid #d7dce3;
  border-radius:6px;
  background:#fff;
  box-shadow:0 18px 44px rgba(15,23,42,.2);
  color:#111827;
  z-index:3000;
}

.m-mobile-chat-actions .chat-drop-head,
.m-mobile-chat-actions .chat-drop-footer{
  min-height:50px;
  padding:0 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid #edf0f4;
}

.m-mobile-chat-actions .chat-drop-head strong{
  font-size:14px;
  font-weight:800;
}

.m-mobile-chat-actions .chat-drop-head a,
.m-mobile-chat-actions .chat-drop-head button,
.m-mobile-chat-actions .chat-drop-footer{
  border:0;
  background:transparent;
  color:#1d4ed8;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}

.m-mobile-chat-actions .chat-drop-list{
  display:flex;
  flex-direction:column;
}

.m-mobile-chat-actions .chat-drop-item{
  min-height:72px;
  padding:11px 14px;
  display:grid;
  grid-template-columns:40px minmax(0, 1fr) auto;
  gap:11px;
  align-items:center;
  border-bottom:1px solid #edf0f4;
}

.m-mobile-chat-actions .chat-drop-empty{
  min-height:78px;
  padding:13px 14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  color:#64748b;
  border-bottom:1px solid #edf0f4;
}

.m-mobile-chat-actions .chat-drop-empty strong{
  color:#111827;
  font-size:13px;
  font-weight:800;
}

.m-mobile-chat-actions .chat-drop-empty small{
  font-size:12px;
  font-weight:600;
  line-height:1.35;
}

.m-mobile-chat-actions .chat-drop-item strong,
.m-mobile-chat-actions .chat-drop-item small{
  display:block;
}

.m-mobile-chat-actions .chat-drop-item strong{
  color:#111827;
  font-size:13px;
  font-weight:800;
}

.m-mobile-chat-actions .chat-drop-item small{
  margin-top:3px;
  color:#64748b;
  font-size:12px;
  line-height:1.35;
}

.m-mobile-chat-actions .chat-drop-item time{
  align-self:start;
  color:#64748b;
  font-size:11px;
}

.m-mobile-chat-actions .chat-drop-item b{
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:var(--sv-ref-red);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:800;
}

.m-mobile-chat-actions .chat-drop-status,
.m-mobile-chat-actions .chat-avatar{
  width:40px;
  height:40px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 40px;
}

.m-mobile-chat-actions .chat-drop-status svg{
  width:20px;
  height:20px;
}

.m-mobile-chat-actions .chat-drop-status--info{ background:#e8f1ff; color:#2563eb; }
.m-mobile-chat-actions .chat-drop-status--warn{ background:#fff4df; color:#f59e0b; }
.m-mobile-chat-actions .chat-drop-status--ok{ background:#dcfce7; color:#16a34a; }

.m-mobile-chat-actions .chat-avatar{
  color:#fff;
  font-size:12px;
  font-weight:900;
}

.m-mobile-chat-actions .chat-avatar--photo{ background:linear-gradient(135deg, #c91f2c, #8f1520); }
.m-mobile-chat-actions .chat-avatar--brand{ background:linear-gradient(135deg, #16a34a, #047857); }
.m-mobile-chat-actions .chat-avatar--team{ background:linear-gradient(135deg, #2563eb, #1e40af); }
.m-mobile-chat-actions .chat-avatar--lab{ background:linear-gradient(135deg, #f59e0b, #b45309); }

.m-mobile-menu-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.18);
  border-radius:6px;
  height:38px;
  min-height:38px;
  padding:1px 12px 0;
  box-sizing:border-box;
  background:#fff;
  color:var(--sv-ref-red);
  font-size:var(--sv-font-normal);
  font-weight:700;
  line-height:1;
  letter-spacing:.02em;
  cursor:pointer;
  box-shadow:0 4px 10px rgba(15, 23, 42, .10);
}

.m-mobile-user{
  position:relative;
  z-index:5200;
}

.m-mobile-userbtn{
  appearance:none;
  -webkit-appearance:none;
  -webkit-tap-highlight-color:transparent;
  width:38px;
  height:38px;
  border:1px solid rgba(255,255,255,.28);
  border-radius:50%;
  padding:0;
  background:transparent;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  box-shadow:none;
  outline:0;
  touch-action:manipulation;
  user-select:none;
  -webkit-user-select:none;
}

.m-mobile-userbtn *{
  -webkit-tap-highlight-color:transparent;
}

.m-mobile-userbtn::-moz-focus-inner{
  border:0;
}

.m-mobile-userbtn:focus,
.m-mobile-userbtn:active{
  background:transparent;
  box-shadow:none;
  outline:0;
  transform:none;
}

.m-mobile-userbtn:focus-visible{
  box-shadow:0 0 0 2px rgba(255,255,255,.32);
}

.m-mobile-avatar{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding-top:0;
  box-sizing:border-box;
  border-radius:50%;
  background:var(--sv-ref-red);
  color:#fff;
  font-size:var(--sv-font-normal);
  font-weight:700;
  line-height:1;
  letter-spacing:.03em;
}

.m-mobile-avatar img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.m-mobile-avatar.is-placeholder{
  background:transparent;
}

.m-mobile-avatar .sv-user-menu-placeholder-img{
  padding:0;
  object-fit:cover;
}

@media (max-width:390px){
  .m-mobile-topbar{
    gap:8px;
    padding:12px 10px;
  }

  .m-mobile-logo{
    height:40px;
  }

  .m-mobile-actions{
    gap:6px;
  }

  .m-mobile-chat-actions,
  .m-mobile-chat-actions .chat-topbar-actions{
    gap:5px;
  }

  .m-mobile-chat-actions .chat-topbar-btn,
  .m-mobile-menu-toggle,
  .m-mobile-userbtn{
    width:36px;
    height:36px;
    min-height:36px;
  }

  .m-mobile-menu-toggle{
    width:auto;
    padding:1px 9px 0;
    font-size:13px;
  }

  .m-mobile-chat-actions .chat-topbar-icon,
  .m-mobile-chat-actions .chat-topbar-icon svg{
    width:18px;
    height:18px;
  }
}

.m-mobile-usermenu{
  position:absolute;
  top:44px;
  right:0;
  min-width:228px;
  padding:8px;
  border:1px solid #e4e4e4;
  border-radius:6px;
  background:#fff;
  box-shadow:0 12px 26px rgba(15, 23, 42, .12);
  display:none;
  z-index:5300;
}

.m-mobile-user.is-open .m-mobile-usermenu{
  display:block;
}

.m-mobile-userlabel{
  display:block;
  padding:4px 6px 8px;
  color:#6b7280;
  font-size:var(--sv-font-small);
  border-bottom:1px solid #ececec;
  margin-bottom:6px;
}

.m-mobile-userlabel strong,
.m-mobile-userlabel small{
  display:block;
}

.m-mobile-userlabel strong{
  overflow:hidden;
  color:#111827;
  font-size:14px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.m-mobile-userlabel small{
  margin-top:3px;
  color:#6b7280;
  font-size:12px;
  font-weight:700;
}

.m-mobile-userdetail{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:4px 6px;
  color:#6b7280;
  font-size:12px;
  font-weight:700;
}

.m-mobile-userdetail strong{
  min-width:0;
  overflow:hidden;
  color:#111827;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.m-mobile-userlink{
  display:block;
  padding:8px 10px;
  border-radius:6px;
  color:#111827;
  text-decoration:none;
  font-size:var(--sv-font-normal);
}

.m-mobile-userbutton{
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  border:0;
  text-align:left;
  cursor:pointer;
}

.m-mobile-userbutton b{
  float:right;
  color:#6b7280;
  font-size:12px;
}

.m-mobile-userlink:hover{
  background:#f7f8fb;
}

@media (max-width:991px){
  .sv-layout-public-topbar{
    min-height:76px;
  }

  .sv-layout-public-topbar-inner{
    min-height:76px;
    padding:0 16px;
  }

  .sv-layout-public-topbar img{
    height:40px;
    max-width:min(280px, 72vw);
  }

  .sv-topbar--painel{
    min-height:72px;
  }

  .sv-topbar--painel .sv-topbar-inner{
    max-width:1100px;
    min-height:72px;
    padding:0 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
  }

  .sv-topbar--painel .sv-topbar-rail{
    position:static;
    left:auto;
    top:auto;
    z-index:auto;
    min-height:72px;
    padding-left:0;
    transform:none;
  }

  .sv-topbar--painel .sv-topbar-brand{
    min-height:72px;
    padding-left:0;
    gap:14px;
  }

  .sv-topbar--painel .sv-topbar-inner img{
    max-width:min(210px, 52vw);
    height:32px;
    margin-left:0;
  }

  .sv-topbar-meta{
    min-height:38px;
    padding:0 12px;
    font-size:var(--sv-font-normal);
  }

  .sv-topbar--painel .sv-topbar-meta{
    margin-right:0;
  }

  .sv-topbar-menuico{
    width:20px;
    height:20px;
    flex-basis:20px;
  }

  .sv-topbar-menuico svg{
    width:18px;
    height:18px;
  }

  .sv-global-patient-search--mobile{
    width:calc(100% - 28px);
    min-width:0;
    min-height:46px;
    margin:10px 14px 0;
    padding:0 6px 0 12px;
    border:1px solid #d7dde5;
    background:#fff;
    color:#111827;
  }

  .sv-global-patient-search--mobile .sv-global-patient-search-icon{
    color:#c91f2c;
  }

  .sv-global-patient-search--mobile .sv-global-patient-search-input{
    height:44px;
    color:#111827 !important;
    font-size:15px !important;
  }

  .sv-global-patient-search--mobile .sv-global-patient-search-input::placeholder{
    color:#94a3b8;
  }

  .sv-global-patient-search--mobile .sv-global-patient-search-submit{
    min-height:36px;
    background:#c91f2c;
    border-color:#c91f2c;
    color:#fff;
  }

  .sv-global-patient-search-results{
    left:0;
    right:0;
  }

  .sv-global-patient-modal{
    padding:12px;
  }

  .sv-global-patient-dialog{
    width:calc(100vw - 24px);
    max-height:calc(100vh - 24px);
  }

  .sv-global-patient-dialog-body{
    max-height:calc(100vh - 100px);
    padding:10px;
  }

  body.sv-ref-page > .sv-topbar--painel{
    display:none;
  }
}

@media print{
  .sv-global-patient-search,
  .sv-global-patient-modal{
    display:none !important;
  }

  .sv-topbar-meta{
    display:none !important;
  }

  .sv-topbar,
  .sv-topbar--painel{
    background:#ffffff !important;
    border-bottom:2px solid #C91F2C !important;
    min-height:auto !important;
    height:auto !important;
  }

  .sv-topbar-inner,
  .sv-topbar--painel .sv-topbar-inner{
    max-width:none !important;
    width:100% !important;
    min-height:auto !important;
    padding:0 0 10px !important;
    display:flex !important;
    grid-template-columns:none !important;
    justify-content:flex-start !important;
  }

  .sv-topbar img,
  .sv-topbar--painel .sv-topbar-inner img{
    display:none !important;
  }
}
