/* Oficina Portátil v53
   - Topbar com vidro realmente transparente (inclusive no tema escuro)
   - Blur progressivo aplicado ao backdrop real, sem imagem/cópia de fundo
   - Topbar persistente no mobile
   - Mantém notificações liquid glass, bottom bar APK e globo SAP da V52
*/

/* -------------------------------------------------------------------------
   TOPBAR — GLASS REAL.

   V52 ainda podia parecer opaca no tema escuro porque a regra dark da V50
   tinha especificidade maior e continuava aplicando um gradiente sólido.
   Aqui sobrescrevemos explicitamente TODOS os temas e removemos o isolamento
   que impedia as camadas de backdrop de enxergar corretamente o que está
   atrás da topbar.
   ------------------------------------------------------------------------- */
.app-shell > .workspace > .topbar {
  isolation: auto !important;
  overflow: visible !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-bottom-color: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

/* A regra específica é intencional: neutraliza o override dark da V50. */
html[data-theme="dark"] .app-shell > .workspace > .topbar,
html[data-theme="light"] .app-shell > .workspace > .topbar {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-bottom-color: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

/*
 * Camada principal: blur forte no topo e queda contínua até zero na base.
 * O preenchimento é praticamente transparente; o efeito visual vem do
 * backdrop-filter, isto é, dos PIXELS REAIS que estão atrás da barra.
 */
.app-shell > .workspace > .topbar::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, .018) !important;
  filter: none !important;
  opacity: 1 !important;
  -webkit-backdrop-filter: blur(38px) saturate(1.65) contrast(1.02);
  backdrop-filter: blur(38px) saturate(1.65) contrast(1.02);
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 24%,
    rgba(0,0,0,.93) 42%,
    rgba(0,0,0,.70) 61%,
    rgba(0,0,0,.38) 77%,
    rgba(0,0,0,.12) 91%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 24%,
    rgba(0,0,0,.93) 42%,
    rgba(0,0,0,.70) 61%,
    rgba(0,0,0,.38) 77%,
    rgba(0,0,0,.12) 91%,
    transparent 100%
  );
}

/* Segunda película, mais leve, evita uma quebra visual na dissolução. */
.app-shell > .workspace > .topbar::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, .010) !important;
  filter: none !important;
  opacity: 1 !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.32);
  backdrop-filter: blur(16px) saturate(1.32);
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,.82) 0%,
    rgba(0,0,0,.67) 48%,
    rgba(0,0,0,.28) 78%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,.82) 0%,
    rgba(0,0,0,.67) 48%,
    rgba(0,0,0,.28) 78%,
    transparent 100%
  );
  border-bottom: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
}

html[data-theme="dark"] .app-shell > .workspace > .topbar::before {
  background: rgba(4, 21, 19, .024) !important;
}
html[data-theme="dark"] .app-shell > .workspace > .topbar::after {
  background: rgba(4, 21, 19, .012) !important;
  border-bottom-color: rgba(220,255,248,.04);
}

/* Controles sempre acima do vidro. */
.app-shell > .workspace > .topbar > * {
  position: relative;
  z-index: 2;
}

/*
 * DESKTOP: o <main> é o scroller do portal. A topbar vira overlay absoluto,
 * enquanto o main ocupa toda a altura. Assim, quando o usuário rola, cards,
 * textos e imagens passam DE VERDADE atrás da topbar e são borrados por ela.
 */
@media (min-width: 821px) {
  .app-shell > .workspace {
    position: relative !important;
  }

  .app-shell > .workspace > .topbar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 19 !important;
    flex: none !important;
  }

  .app-shell > .workspace > main {
    flex: 1 1 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    padding-top: 118px !important; /* 86px da topbar + 32px originais */
  }
}

/*
 * MOBILE: preso ao viewport. Só o conteúdo rola; a topbar não se move.
 * Sem translateZ/will-change para não criar uma camada de composição que
 * possa bloquear o backdrop-filter em alguns WebViews Android.
 */
@media (max-width: 820px) {
  .app-shell > .workspace > .topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 19 !important;
    transform: none !important;
    will-change: auto !important;
  }

  .app-shell > .workspace > main {
    padding-top: calc(108px + env(safe-area-inset-top, 0px)) !important;
  }

  html {
    scroll-padding-top: calc(96px + env(safe-area-inset-top, 0px));
  }
}

/* -------------------------------------------------------------------------
   NOTIFICAÇÕES — mesmo material translúcido do botão/caixa de aparência.
   ------------------------------------------------------------------------- */
.topbar .notification-center > .notification {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel-solid) 34%, transparent) !important;
  border-color: color-mix(in srgb, var(--text) 13%, transparent) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent);
}

.topbar .notification-center:has(.notification-popover) > .notification {
  color: var(--on-accent, #fff);
  background: color-mix(in srgb, var(--accent) 88%, transparent) !important;
  border-color: color-mix(in srgb, var(--accent) 70%, #fff) !important;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 28%, transparent);
}

.notification-popover {
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--panel-solid) 72%, transparent),
      color-mix(in srgb, var(--panel-solid) 53%, transparent)
    ) !important;
  border-color: color-mix(in srgb, var(--text) 13%, transparent) !important;
  -webkit-backdrop-filter: blur(34px) saturate(1.75);
  backdrop-filter: blur(34px) saturate(1.75);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 50%, transparent),
    0 26px 70px rgba(0, 20, 18, .25) !important;
}

.notification-popover > header {
  background: color-mix(in srgb, var(--panel-solid) 11%, transparent);
}
.notification-popover > section > button {
  background: color-mix(in srgb, var(--panel-solid) 5%, transparent);
}
.notification-popover > section > button:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.notification-popover > section > button.unread {
  background: color-mix(in srgb, var(--accent) 11%, transparent) !important;
}

html[data-theme="dark"] .notification-popover {
  background: linear-gradient(145deg, rgba(16,42,39,.82), rgba(7,31,29,.67)) !important;
  border-color: rgba(226,255,250,.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 30px 80px rgba(0,0,0,.5) !important;
}

/* -------------------------------------------------------------------------
   GLOBO SAP — a silhueta enviada vira uma máscara; a cor segue currentColor.
   ------------------------------------------------------------------------- */
.material-card .sap-global-stock > svg,
.sap-global-icon > svg {
  display: none !important;
}

.material-card .sap-global-stock::before,
.sap-global-icon::before {
  content: "";
  display: block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url('/assets/world-globe-v51.svg?v=51.0.0') center / contain no-repeat;
  mask: url('/assets/world-globe-v51.svg?v=51.0.0') center / contain no-repeat;
}

.material-card .sap-global-stock::before {
  width: 22px;
  height: 22px;
}
.sap-global-icon::before {
  width: 25px;
  height: 25px;
}

/* -------------------------------------------------------------------------
   APK — substitui completamente a sidebar por uma bottom bar persistente.
   Fora do User-Agent OficinaPortatilApp nada abaixo é aplicado.
   ------------------------------------------------------------------------- */
#op-apk-bottom-bar { display: none; }

html.op-apk .app-shell {
  display: block !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
}

html.op-apk .app-shell > .sidebar {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.op-apk .app-shell > .workspace {
  width: 100% !important;
  min-width: 0 !important;
}

html.op-apk .menu-button,
html.op-apk .mobile-close,
html.op-apk .scrim {
  display: none !important;
}

html.op-apk .app-shell > .workspace > main {
  padding-bottom: calc(132px + env(safe-area-inset-bottom)) !important;
}

html.op-apk #op-native-root {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

html.op-apk #op-apk-bottom-bar {
  position: fixed;
  z-index: 100010;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(72px + env(safe-area-inset-bottom));
  padding: 6px 8px max(7px, env(safe-area-inset-bottom));
  display: flex;
  align-items: stretch;
  justify-content: safe center;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  color: var(--muted);
  border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--panel-solid) 56%, transparent),
      color-mix(in srgb, var(--panel-solid) 78%, transparent));
  -webkit-backdrop-filter: blur(34px) saturate(1.8);
  backdrop-filter: blur(34px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 36%, transparent),
    0 -16px 44px rgba(0, 20, 18, .10);
}

html.op-apk #op-apk-bottom-bar::-webkit-scrollbar { display: none; }

html.op-apk .op-apk-bottom-item {
  position: relative;
  isolation: isolate;
  flex: 0 0 clamp(68px, 15.5vw, 104px);
  min-width: 68px;
  min-height: 58px;
  padding: 6px 7px 5px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  display: grid;
  grid-template-rows: 31px 1fr;
  place-items: center;
  gap: 1px;
  scroll-snap-align: center;
  transition: color .18s ease, transform .18s ease, background .18s ease;
}

html.op-apk .op-apk-bottom-item:active {
  transform: scale(.96);
}

html.op-apk .op-apk-bottom-icon {
  width: 38px;
  height: 30px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

html.op-apk .op-apk-bottom-icon svg,
html.op-apk .op-apk-bottom-icon img {
  display: block;
  width: 23px !important;
  height: 23px !important;
  object-fit: contain;
  color: currentColor;
}

html.op-apk .op-apk-bottom-label {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.01em;
}

html.op-apk .op-apk-bottom-item.active {
  color: var(--accent);
}

html.op-apk .op-apk-bottom-item.active .op-apk-bottom-icon {
  color: var(--on-accent, #fff);
  background: var(--accent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 25%, transparent);
}

html[data-theme="dark"].op-apk #op-apk-bottom-bar {
  background: linear-gradient(180deg, rgba(14,39,36,.68), rgba(8,29,27,.88));
  border-top-color: rgba(226,255,250,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 -18px 48px rgba(0,0,0,.22);
}

/* No APK a campainha continua acessível também em telas estreitas. */
@media (max-width: 520px) {
  html.op-apk .top-actions .notification { display: grid !important; }
  html.op-apk .topbar { padding-left: 14px !important; padding-right: 14px !important; }
  html.op-apk .top-actions { gap: 4px !important; }
  html.op-apk .topbar-title { min-width: 0; }
  html.op-apk .topbar-title > div { min-width: 0; }
  html.op-apk .topbar-title strong {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.op-apk .op-apk-bottom-item,
  html.op-apk .op-apk-bottom-icon { transition: none; }
}

/* ========================================================================
   V54 — refinamentos de topbar, notificações, popup do globo e tema
   ======================================================================== */

/* A topbar deixa de exibir "OFICINA PORTÁTIL + nome do aplicativo".
   O menu mobile continua existindo fora do APK; no APK entra o lockup oficial. */
.app-shell > .workspace > .topbar .topbar-title > div:not(.op-apk-top-brand) {
  display: none !important;
}

.app-shell > .workspace > .topbar .topbar-title {
  min-width: 0;
}

/* Lockup da Oficina Portátil no APK: reutiliza exatamente o mesmo conjunto
   de DIN + raizen-logo.png utilizado pela marca do portal. */
html.op-apk .topbar .op-apk-top-brand {
  display: flex !important;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--text);
  font-family: Din, "DIN Pro", DINPro, system-ui, sans-serif;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

html.op-apk .topbar .op-apk-top-brand .brand-name {
  display: grid !important;
  font-family: inherit;
  font-size: 21px;
  font-weight: 800;
  line-height: .82;
  letter-spacing: -.035em;
}

html.op-apk .topbar .op-apk-top-brand > i {
  display: block;
  width: 2px;
  height: 46px;
  flex: 0 0 2px;
  background: currentColor;
  opacity: .72;
}

html.op-apk .topbar .op-apk-top-brand .brand-partner {
  display: grid !important;
  align-content: center;
  gap: 1px;
}

html.op-apk .topbar .op-apk-top-brand .brand-partner small {
  display: block !important;
  color: currentColor !important;
  font-family: inherit;
  font-size: 8px;
  line-height: 1;
  letter-spacing: .01em;
  font-weight: 800;
}

html.op-apk .topbar .op-apk-top-brand .raizen-site-logo {
  display: block;
  width: 67px;
  height: 28px;
  object-fit: contain;
  object-position: left center;
}

/* No tema escuro a marca fica branca como no APK original. */
html[data-theme="dark"].op-apk .topbar .op-apk-top-brand .raizen-site-logo {
  filter: brightness(0) invert(1) !important;
}

/* Em aparelhos estreitos preservamos o lockup, compactando somente o necessário. */
@media (max-width: 620px) {
  html.op-apk .app-shell > .workspace > .topbar {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px;
  }

  html.op-apk .topbar .op-apk-top-brand {
    gap: 7px;
  }

  html.op-apk .topbar .op-apk-top-brand .brand-name {
    font-size: 17px;
  }

  html.op-apk .topbar .op-apk-top-brand > i {
    height: 38px;
  }

  html.op-apk .topbar .op-apk-top-brand .brand-partner small {
    font-size: 6.5px;
  }

  html.op-apk .topbar .op-apk-top-brand .raizen-site-logo {
    width: 52px;
    height: 22px;
  }

  html.op-apk .topbar .top-actions {
    min-width: 0;
    margin-left: auto;
  }

  html.op-apk .topbar .command-button {
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center;
  }

  html.op-apk .topbar .command-button > span,
  html.op-apk .topbar .command-button > kbd {
    display: none !important;
  }

  html.op-apk .topbar .icon-button,
  html.op-apk .topbar .notification {
    width: 42px !important;
    height: 42px !important;
  }
}

@media (max-width: 390px) {
  html.op-apk .topbar .op-apk-top-brand .brand-name { font-size: 15px; }
  html.op-apk .topbar .op-apk-top-brand > i { height: 34px; }
  html.op-apk .topbar .op-apk-top-brand .raizen-site-logo { width: 46px; height: 20px; }
  html.op-apk .topbar .top-actions { gap: 3px !important; }
  html.op-apk .topbar .command-button,
  html.op-apk .topbar .icon-button,
  html.op-apk .topbar .notification { width: 38px !important; height: 38px !important; }
}

/* NOTIFICAÇÕES — mesma entrada do Personalizar aparência. */
.notification-popover {
  transform-origin: top right;
  animation: op-appearance-in .2s cubic-bezier(.2, .8, .2, 1) both !important;
}

/* ------------------------------------------------------------------------
   GLOBO SAP — o conteúdo e a consulta continuam intactos. Só o container
   deixa de ser modal fullscreen e passa a se comportar como popover ancorado.
   O JS V54 calcula left/top a partir do botão clicado.
   ------------------------------------------------------------------------ */
.sap-global-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100030 !important;
  display: block !important;
  padding: 0 !important;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  pointer-events: none !important;
}

.sap-global-overlay .sap-global-modal {
  position: fixed !important;
  top: var(--op-globe-provisional-top, 12px);
  right: var(--op-globe-provisional-right, 12px);
  left: auto;
  width: min(700px, calc(100vw - 24px)) !important;
  max-height: min(72vh, 720px) !important;
  pointer-events: auto !important;
  color: var(--text);
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--panel-solid) 86%, transparent),
      color-mix(in srgb, var(--panel-solid) 72%, transparent)) !important;
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent) !important;
  border-radius: 22px !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.65);
  backdrop-filter: blur(30px) saturate(1.65);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 42%, transparent),
    0 24px 70px rgba(0, 20, 18, .28) !important;
  transform-origin: top right;
  animation: op-globe-popover-in .20s cubic-bezier(.2,.8,.2,1) both;
}

html[data-theme="dark"] .sap-global-overlay .sap-global-modal {
  background: linear-gradient(145deg, rgba(16,42,39,.91), rgba(7,31,29,.82)) !important;
  border-color: rgba(226,255,250,.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 28px 78px rgba(0,0,0,.52) !important;
}

.sap-global-overlay .sap-global-modal[data-op-placement="top"] {
  transform-origin: bottom right;
}

.sap-global-overlay .sap-global-modal > header {
  padding: 16px 18px !important;
}

.sap-global-overlay .sap-global-modal h2 {
  font-size: 21px !important;
}

.sap-global-overlay .sap-global-body {
  padding: 14px 16px 17px !important;
}

.sap-global-overlay .sap-global-units {
  gap: 9px;
}

.sap-global-overlay .sap-global-unit-row {
  padding: 12px 14px;
}

@keyframes op-globe-popover-in {
  from { opacity: 0; transform: translateY(-8px) scale(.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Em telas realmente pequenas continua sendo um POPUP, nunca fullscreen. */
@media (max-width: 620px) {
  .sap-global-overlay .sap-global-modal {
    width: calc(100vw - 20px) !important;
    max-height: min(68vh, 620px) !important;
    border-radius: 19px !important;
  }

  .sap-global-overlay .sap-global-modal > header {
    padding: 14px !important;
  }

  .sap-global-overlay .sap-global-body {
    padding: 11px !important;
  }
}

/* CROSSFADE de tema. O View Transition API faz a troca como duas imagens
   sobrepostas; o bloco fallback suaviza WebViews sem essa API. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .34s;
  animation-timing-function: cubic-bezier(.2,.7,.2,1);
}

::view-transition-old(root) { animation-name: op-theme-old-fade; }
::view-transition-new(root) { animation-name: op-theme-new-fade; }

@keyframes op-theme-old-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes op-theme-new-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

html.op-theme-fallback body,
html.op-theme-fallback .app-shell,
html.op-theme-fallback .surface,
html.op-theme-fallback .topbar,
html.op-theme-fallback .sidebar,
html.op-theme-fallback button,
html.op-theme-fallback input,
html.op-theme-fallback select,
html.op-theme-fallback textarea,
html.op-theme-fallback #op-apk-bottom-bar {
  transition:
    background-color .32s ease,
    border-color .32s ease,
    color .32s ease,
    box-shadow .32s ease,
    filter .32s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  .notification-popover,
  .sap-global-overlay .sap-global-modal,
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* ========================================================================
   V55 — desktop sem sidebar + navegação na topbar + menus com saída suave
   ======================================================================== */

/* A mesma animação de entrada agora possui a saída espelhada. */
@keyframes op-appearance-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.96); }
}

@keyframes op-globe-popover-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.965); }
}

@keyframes op-globe-popover-out-top {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(.965); }
}

.notification-popover.op-popover-closing,
.op-appearance-popover.op-popover-closing {
  pointer-events: none !important;
  animation: op-appearance-out .20s cubic-bezier(.4, 0, .8, .2) both !important;
}

.sap-global-overlay .sap-global-modal.op-popover-closing {
  pointer-events: none !important;
  animation: op-globe-popover-out .20s cubic-bezier(.4, 0, .8, .2) both !important;
}

.sap-global-overlay .sap-global-modal[data-op-placement="top"].op-popover-closing {
  animation-name: op-globe-popover-out-top !important;
}

/* ------------------------------------------------------------------------
   DESKTOP — sidebar eliminada; marca + aplicativos passam para a topbar.
   Mobile web continua com a sidebar tradicional e APK continua com bottom bar.
   ------------------------------------------------------------------------ */
@media (min-width: 821px) {
  html.op-desktop-shell:not(.op-apk) .app-shell {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
  }

  html.op-desktop-shell:not(.op-apk) .app-shell > .sidebar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  html.op-desktop-shell:not(.op-apk) .app-shell > .workspace {
    width: 100% !important;
    min-width: 0 !important;
  }

  html.op-desktop-shell:not(.op-apk) .app-shell > .workspace > .topbar {
    left: 0 !important;
    width: 100% !important;
    padding-left: clamp(18px, 2vw, 34px) !important;
    padding-right: clamp(18px, 2vw, 34px) !important;
    gap: 14px !important;
    border-left: 0 !important;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .desktop-sidebar-button,
  html.op-desktop-shell:not(.op-apk) .topbar .menu-button {
    display: none !important;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .topbar-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    gap: 14px !important;
    overflow: hidden !important;
  }

  /* neutraliza a regra V54 que escondia qualquer div textual da topbar */
  html.op-desktop-shell:not(.op-apk) .app-shell > .workspace > .topbar .topbar-title > div.op-desktop-top-brand {
    display: flex !important;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand {
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-family: Din, "DIN Pro", DINPro, system-ui, sans-serif;
    line-height: 1;
    user-select: none;
    pointer-events: none;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand .brand-name {
    display: grid !important;
    font-family: inherit;
    font-size: 18px;
    font-weight: 800;
    line-height: .82;
    letter-spacing: -.035em;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand > i {
    display: block !important;
    width: 2px;
    height: 40px;
    flex: 0 0 2px;
    background: currentColor;
    opacity: .72;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand .brand-partner {
    display: grid !important;
    align-content: center;
    gap: 1px;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand .brand-partner small {
    display: block !important;
    color: currentColor !important;
    font-size: 7px;
    line-height: 1;
    font-weight: 800;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand .raizen-site-logo {
    display: block;
    width: 58px;
    height: 24px;
    object-fit: contain;
    object-position: left center;
  }

  html[data-theme="dark"].op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand .raizen-site-logo {
    filter: brightness(0) invert(1) !important;
  }

  #op-desktop-top-nav {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);
  }

  #op-desktop-top-nav::-webkit-scrollbar { display: none; }

  .op-desktop-top-nav-item {
    position: relative;
    flex: 0 0 auto;
    min-height: 42px;
    max-width: 156px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    background: transparent;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
  }

  .op-desktop-top-nav-item:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--panel-solid) 30%, transparent);
    border-color: color-mix(in srgb, var(--text) 8%, transparent);
  }

  .op-desktop-top-nav-item:active { transform: scale(.97); }

  .op-desktop-top-nav-item.active {
    color: var(--on-accent, #fff);
    background: color-mix(in srgb, var(--accent) 90%, transparent);
    border-color: color-mix(in srgb, var(--accent) 70%, #fff);
    box-shadow: 0 9px 22px color-mix(in srgb, var(--accent) 20%, transparent);
  }

  .op-desktop-top-nav-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
  }

  .op-desktop-top-nav-icon svg,
  .op-desktop-top-nav-icon img {
    display: block;
    width: 19px !important;
    height: 19px !important;
    object-fit: contain;
    color: currentColor;
  }

  .op-desktop-top-nav-label {
    min-width: 0;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .top-actions {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .top-profile-button {
    display: grid !important;
    place-items: center;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    padding: 0 !important;
    border: 1px solid color-mix(in srgb, var(--text) 13%, transparent) !important;
    border-radius: 12px !important;
    background: color-mix(in srgb, var(--panel-solid) 34%, transparent) !important;
    color: var(--text);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    backdrop-filter: blur(24px) saturate(1.5);
    overflow: hidden;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .top-profile-button > * {
    max-width: 100% !important;
    max-height: 100% !important;
  }

  html.op-desktop-shell:not(.op-apk) .topbar .top-profile-button .avatar,
  html.op-desktop-shell:not(.op-apk) .topbar .top-profile-button .rank-avatar {
    width: 100% !important;
    height: 100% !important;
    border-radius: 11px !important;
  }
}

@media (min-width: 821px) and (max-width: 1450px) {
  html.op-desktop-shell:not(.op-apk) .topbar .command-button {
    width: 176px !important;
  }
  .op-desktop-top-nav-item { padding: 0 8px; }
}

@media (min-width: 821px) and (max-width: 1260px) {
  html.op-desktop-shell:not(.op-apk) .topbar .command-button {
    width: 44px !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center;
  }
  html.op-desktop-shell:not(.op-apk) .topbar .command-button > span,
  html.op-desktop-shell:not(.op-apk) .topbar .command-button > kbd { display: none !important; }
  .op-desktop-top-nav-label { display: none; }
  .op-desktop-top-nav-item { width: 42px; padding: 0; justify-content: center; }
}

@media (min-width: 821px) and (max-width: 1040px) {
  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand .brand-partner { display: none !important; }
  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand > i { display: none !important; }
  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand { gap: 0; }
  html.op-desktop-shell:not(.op-apk) .topbar .op-desktop-top-brand .brand-name { font-size: 16px; }
}

/* ------------------------------------------------------------------------
   PERFIL — configurações da antiga tela agora vivem num menu ancorado à foto.
   ------------------------------------------------------------------------ */
.op-profile-popover {
  position: fixed;
  z-index: 100035;
  width: min(480px, calc(100vw - 24px));
  max-height: min(76dvh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  color: var(--text);
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--panel-solid) 82%, transparent),
    color-mix(in srgb, var(--panel-solid) 65%, transparent)) !important;
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent);
  border-radius: 22px;
  -webkit-backdrop-filter: blur(32px) saturate(1.7);
  backdrop-filter: blur(32px) saturate(1.7);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 45%, transparent), 0 26px 72px rgba(0,20,18,.28);
  transform-origin: top right;
  animation: op-profile-popover-in .20s cubic-bezier(.2,.8,.2,1) both;
}

html[data-theme="dark"] .op-profile-popover {
  background: linear-gradient(145deg, rgba(16,42,39,.91), rgba(7,31,29,.80)) !important;
  border-color: rgba(226,255,250,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 28px 78px rgba(0,0,0,.52);
}

.op-profile-popover[data-op-placement="top"] { transform-origin: bottom right; }
.op-profile-popover.op-popover-closing { pointer-events: none; animation: op-profile-popover-out .20s cubic-bezier(.4,0,.8,.2) both !important; }
.op-profile-popover[data-op-placement="top"].op-popover-closing { animation-name: op-profile-popover-out-top !important; }

@keyframes op-profile-popover-in {
  from { opacity: 0; transform: translateY(-8px) scale(.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes op-profile-popover-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.965); }
}
@keyframes op-profile-popover-out-top {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(.965); }
}

.op-profile-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.op-profile-menu-head small,
.op-profile-menu-summary small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
}
.op-profile-menu-head strong { display: block; margin-top: 3px; font-size: 19px; }
.op-profile-menu-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-solid) 45%, transparent);
  color: var(--text);
  font-size: 22px;
}

.op-profile-menu-body { padding-top: 14px; }
.op-profile-menu-summary {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 13px;
}
.op-profile-menu-summary > div:last-child { min-width: 0; display: grid; gap: 2px; }
.op-profile-menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.op-profile-menu-summary span { color: var(--muted); font-size: 11px; font-weight: 750; }
.op-profile-menu-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb,var(--accent) 76%,#20aa91), var(--accent));
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 20%, transparent);
}
.op-profile-menu-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }

.op-profile-photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 13px;
}
.op-profile-photo-actions .secondary { min-height: 42px; padding: 0 12px; cursor: pointer; }
.op-profile-photo-actions label { position: relative; }
.op-profile-photo-actions input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.op-profile-settings-form { display: grid; gap: 10px; }
.op-profile-settings-form > label {
  display: grid;
  grid-template-columns: minmax(135px,.85fr) minmax(180px,1.15fr);
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-solid) 25%, transparent);
}
.op-profile-settings-form > label > span { display: grid; gap: 2px; font-size: 13px; font-weight: 850; }
.op-profile-settings-form > label small { color: var(--muted); font-size: 10px; line-height: 1.25; font-weight: 500; }
.op-profile-settings-form input {
  width: 100%;
  min-width: 0;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 11px;
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  color: var(--text);
}
.op-profile-save { width: 100%; min-height: 44px; }
.op-profile-menu-status { min-height: 17px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; }
.op-profile-menu-status[data-error="true"] { color: #d65b5b; }
.op-profile-menu-loading { min-height: 160px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); }
.op-profile-menu-loading i { width: 27px; height: 27px; border: 3px solid color-mix(in srgb,var(--accent) 22%,transparent); border-top-color: var(--accent); border-radius: 50%; animation: op-profile-spin .8s linear infinite; }
.op-profile-menu-error { padding: 24px 12px; color: #d65b5b; text-align: center; font-weight: 750; }
@keyframes op-profile-spin { to { transform: rotate(360deg); } }

.op-profile-crop-layer { z-index: 100060 !important; }
.op-profile-crop-layer .photo-crop-modal { max-height: calc(100dvh - 28px); overflow: auto; }
.op-profile-crop-layer .crop-zoom > span { text-align: center; color: var(--muted); font-weight: 900; }

@media (max-width: 620px) {
  .op-profile-popover { width: calc(100vw - 20px) !important; max-height: min(72dvh, 650px); padding: 14px; border-radius: 19px; }
  .op-profile-settings-form > label { grid-template-columns: 1fr; gap: 8px; }
  .op-profile-photo-actions { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .notification-popover.op-popover-closing,
  .op-appearance-popover.op-popover-closing,
  .sap-global-overlay .sap-global-modal.op-popover-closing,
  .op-profile-popover,
  .op-profile-popover.op-popover-closing { animation: none !important; }
}


/* ========================================================================
   V56 — iOS theme stability, ícone RGB, topbar limpa e tipografia clara
   ======================================================================== */

/* O pseudo-elemento antigo da V50 ainda carregava width/height/radius e
   acabava virando a "elipse/polígono" visível na topbar. Zeramos TODAS as
   dimensões herdadas antes de usar a película de blur em tela cheia. */
.app-shell > .workspace > .topbar::before,
.app-shell > .workspace > .topbar::after {
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  transform: none !important;
}

/* Ícone Aparência: substitui definitivamente sol/lua pelo SVG RGB enviado. */
.topbar .op-appearance-trigger > svg { opacity: 0 !important; }
.topbar .op-appearance-trigger::before,
.topbar .op-appearance-trigger[data-op-theme="dark"]::before,
.topbar .op-appearance-trigger[data-op-theme="light"]::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  background: url('/assets/appearance-color-circle-v56.svg?v=56.0.0') center / 25px 25px no-repeat !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

/* Sem X no menu Aparência: clique fora, botão Aparência e Esc continuam
   fechando o painel com a animação de saída já existente. */
.op-appearance-head { justify-content: flex-start !important; }
.op-appearance-close { display: none !important; }

/* Safari/iOS: durante a troca de tema mantemos uma película física no DOM.
   Isso evita o frame transparente causado por snapshot de backdrop-filter. */
html.op-theme-ios-transition .app-shell > .workspace > .topbar::before {
  background: color-mix(in srgb, var(--panel-solid) 16%, transparent) !important;
  -webkit-backdrop-filter: blur(38px) saturate(1.55) !important;
  backdrop-filter: blur(38px) saturate(1.55) !important;
}
html.op-theme-ios-transition .app-shell > .workspace > .topbar::after {
  background: color-mix(in srgb, var(--panel-solid) 9%, transparent) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.28) !important;
  backdrop-filter: blur(16px) saturate(1.28) !important;
}
html.op-theme-ios-transition .op-appearance-popover,
html.op-theme-ios-transition .notification-popover,
html.op-theme-ios-transition .sap-global-overlay .sap-global-modal,
html.op-theme-ios-transition .op-profile-popover {
  opacity: 1 !important;
  background-color: color-mix(in srgb, var(--panel-solid) 72%, transparent) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.55) !important;
  backdrop-filter: blur(32px) saturate(1.55) !important;
}

/* No modo claro a tipografia orientada pelas variáveis do portal é preta.
   Mantemos componentes deliberadamente coloridos (cards/sidebars) livres para
   usar suas cores próprias, mas topbar, páginas e popovers ficam mais legíveis. */
html[data-theme="light"] {
  --text: #000000 !important;
  --muted: #111111 !important;
  color: #000000 !important;
}
html[data-theme="light"] body,
html[data-theme="light"] .topbar,
html[data-theme="light"] .op-appearance-popover,
html[data-theme="light"] .notification-popover,
html[data-theme="light"] .sap-global-overlay .sap-global-modal,
html[data-theme="light"] .op-profile-popover,
html[data-theme="light"] .mention-menu,
html[data-theme="light"] .global-command {
  color: #000000 !important;
}
html[data-theme="light"] .topbar :is(span, small, strong, kbd),
html[data-theme="light"] .op-appearance-popover :is(span, small, strong, output, button),
html[data-theme="light"] .notification-popover :is(span, small, strong, time, button),
html[data-theme="light"] .sap-global-overlay .sap-global-modal :is(span, small, strong, h2, p, button),
html[data-theme="light"] .op-profile-popover :is(span, small, strong, label, p, button),
html[data-theme="light"] .mention-menu :is(span, small, strong, button),
html[data-theme="light"] .global-command :is(span, small, strong, button, kbd) {
  color: #000000 !important;
}

/* O logo Raízen da marca na topbar também fica preto no tema claro. */
html[data-theme="light"] .topbar .raizen-site-logo {
  filter: brightness(0) saturate(100%) !important;
}
html[data-theme="light"] .topbar .op-apk-top-brand,
html[data-theme="light"].op-desktop-shell .topbar .op-desktop-top-brand {
  color: #000000 !important;
}

/* Forms: o novo SVG é monocromático e deve acompanhar currentColor sem o
   recorte sobreposto que aparecia no painel Buscar ou navegar. */
.forms-materials-card-icon {
  width: 26px !important;
  height: 26px !important;
  display: block !important;
  object-fit: contain !important;
}

@media (prefers-reduced-motion: reduce) {
  html.op-theme-ios-transition .app-shell > .workspace > .topbar::before,
  html.op-theme-ios-transition .app-shell > .workspace > .topbar::after {
    -webkit-backdrop-filter: inherit !important;
    backdrop-filter: inherit !important;
  }
}

/* Forms fora da sidebar/app-card (busca global, topnav desktop e bottom bar). */
.global-command .forms-materials-card-icon,
.op-desktop-top-nav-icon .forms-materials-card-icon,
#op-apk-bottom-bar .forms-materials-card-icon {
  width: 24px !important;
  height: 24px !important;
  object-fit: contain !important;
}
html[data-theme="light"] .global-command .forms-materials-card-icon,
html[data-theme="light"] .op-desktop-top-nav-icon .forms-materials-card-icon,
html[data-theme="light"] #op-apk-bottom-bar .forms-materials-card-icon {
  filter: brightness(0) saturate(100%) !important;
}
html[data-theme="dark"] .global-command .forms-materials-card-icon,
html[data-theme="dark"] .op-desktop-top-nav-icon .forms-materials-card-icon,
html[data-theme="dark"] #op-apk-bottom-bar .forms-materials-card-icon {
  filter: brightness(0) invert(1) !important;
}


/* ========================================================================
   V57 — ajustes de legibilidade, ícones, room booking e glass buttons
   ======================================================================== */

/* Busca global removida da topbar em todas as plataformas. */
.topbar .command-button {
  display: none !important;
}

/* Agendar Sala: remove o cabeçalho redundante do container nativo e aproveita a área útil. */
#op-native-root > .op-native-page[data-native-page="room"] > .op-native-heading {
  display: none !important;
}
#op-native-root > .op-native-page[data-native-page="room"] {
  padding-top: 0 !important;
}
#op-native-root > .op-native-page[data-native-page="room"] #rb-app.rb-embedded {
  margin-top: 0 !important;
}
#op-native-root > .op-native-page[data-native-page="room"] #rb-app.rb-embedded .rb-tabs {
  margin-top: 0 !important;
}

/* Botões/toggles desmarcados com visual liquid glass mais evidente. */
.op-theme-choice button:not([aria-pressed="true"]),
#rb-app .rb-tab:not(.active),
#rb-app .rb-segment button:not(.active),
#rb-app .rb-filterbar button:not(.active),
#rb-app .rb-weekday:not(.active) span,
#rb-app.rb-embedded .rb-tabs button:not(.active) {
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--panel-solid) 62%, transparent),
    color-mix(in srgb, var(--panel-solid) 36%, transparent)) !important;
  border-color: color-mix(in srgb, var(--text) 11%, transparent) !important;
  color: var(--text) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.42),
    0 10px 24px rgba(4, 33, 29, .08) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.45) !important;
  backdrop-filter: blur(20px) saturate(1.45) !important;
}

/* Ícones customizados. */
.op-custom-app-icon,
.forms-materials-card-icon,
.op-aprovisionamento-box-icon {
  display: block !important;
  object-fit: contain !important;
}
.app-card .op-custom-app-icon,
.navigation button .op-custom-app-icon,
.navigation button .forms-materials-card-icon,
.navigation button .op-aprovisionamento-box-icon,
.op-desktop-top-nav-item.active .op-custom-app-icon,
#op-apk-bottom-bar .op-apk-bottom-item.active .op-custom-app-icon {
  filter: brightness(0) invert(1) !important;
}
html[data-theme="light"] .op-desktop-top-nav-item:not(.active) .op-custom-app-icon,
html[data-theme="light"] .global-command .op-custom-app-icon,
html[data-theme="light"] #op-apk-bottom-bar .op-apk-bottom-item:not(.active) .op-custom-app-icon {
  filter: brightness(0) saturate(100%) !important;
}
html[data-theme="dark"] .op-desktop-top-nav-item:not(.active) .op-custom-app-icon,
html[data-theme="dark"] .global-command .op-custom-app-icon,
html[data-theme="dark"] #op-apk-bottom-bar .op-apk-bottom-item:not(.active) .op-custom-app-icon {
  filter: brightness(0) invert(1) !important;
}
/* Garante o Forms branco nos cards coloridos. */
.app-card .forms-materials-card-icon,
.app-card .op-aprovisionamento-box-icon {
  filter: brightness(0) invert(1) !important;
}

/* Aparência: quando a cor personalizada estiver desligada, a UI usa sempre o padrão base. */
html[data-accent-enabled="false"] {
  --accent: #006b63 !important;
}


/* ========================================================================
   V58 — SAP oficial + active state sem vazamento de blur
   ======================================================================== */

/* O brilho externo do item ativo era percebido como vazamento do blur da topbar. */
@media (min-width:821px) {
  .op-desktop-top-nav-item.active {
    box-shadow: inset 0 1px 0 color-mix(in srgb,#fff 34%,transparent) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    overflow: hidden !important;
    isolation: isolate;
  }
}
html.op-apk .op-apk-bottom-item.active .op-apk-bottom-icon {
  box-shadow: inset 0 1px 0 color-mix(in srgb,#fff 28%,transparent) !important;
  overflow: hidden !important;
}

/* SAP: usa exatamente o arquivo enviado, encapsulado em SVG válido, sem recolorir. */
.op-sap-app-logo {
  display:block !important;
  width:26px !important;
  height:20px !important;
  object-fit:contain !important;
  filter:none !important;
}
.app-card .op-sap-app-logo { width:30px !important; height:24px !important; }
.op-desktop-top-nav-icon .op-sap-app-logo,
#op-apk-bottom-bar .op-sap-app-logo { width:24px !important; height:19px !important; }

/* ========================================================================
   V59 — presença online e cabeçalho compacto do popup de estoque global
   ======================================================================== */

/* Terceiro indicador flutuante da Visão Geral. */
.hero-visual .floating-card.fc-online {
  left: 3% !important;
  right: auto !important;
  top: auto !important;
  bottom: 10% !important;
  animation-delay: -1.15s;
  max-width: 240px;
  color: #fff;
}
.hero-visual .floating-card.fc-online > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.hero-visual .floating-card.fc-online strong {
  line-height: 1.08;
  white-space: nowrap;
}
.hero-visual .floating-card.fc-online small {
  margin-top: 3px;
}

/* Popup do Globo: a imagem do globo fica exclusivamente no botão do card. */
.sap-global-overlay .sap-global-modal > header > .sap-global-heading-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid !important;
  gap: 4px !important;
  align-items: start !important;
}
.sap-global-overlay .sap-global-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  overflow: hidden;
}
.sap-global-overlay .sap-global-sap-logo {
  display: block;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  object-fit: contain;
}
.sap-global-overlay .sap-global-title-line h2 {
  flex: 0 0 auto;
  margin: 0 !important;
  font-size: 21px !important;
  line-height: 1.1;
}
.sap-global-overlay .sap-global-title-line p {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0 !important;
  max-width: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.15;
}

/* Garante que nenhuma herança antiga recrie o globo dentro do popup. */
.sap-global-overlay .sap-global-icon,
.sap-global-overlay .sap-global-icon::before,
.sap-global-overlay .sap-global-icon::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 620px) {
  .hero-visual .floating-card.fc-online {
    max-width: 210px;
  }
  .hero-visual .floating-card.fc-online strong {
    font-size: 12px;
  }
  .sap-global-overlay .sap-global-sap-logo {
    width: 34px;
    height: 19px;
  }
  .sap-global-overlay .sap-global-title-line h2 {
    font-size: 18px !important;
  }
  .sap-global-overlay .sap-global-title-line p {
    font-size: 13px;
  }
}

/* ========================================================================
   V60 — sidebar iOS + KPI materiais com estoque + popup globo simplificado
   ======================================================================== */

/* Safari/iOS respeita o tamanho intrínseco de <img> SVG de maneira diferente
   do SVG inline. Fixamos a caixa do ícone de Aprovisionamento na navegação. */
.navigation > button > img.op-aprovisionamento-box-icon,
.navigation button img.op-aprovisionamento-box-icon {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center !important;
  align-self: center !important;
  justify-self: center !important;
  flex: 0 0 20px !important;
}

/* Também normaliza o ícone no card, topnav e bottom bar. */
.app-card img.op-aprovisionamento-box-icon { width: 23px !important; height: 23px !important; }
.op-desktop-top-nav-icon img.op-aprovisionamento-box-icon { width: 19px !important; height: 19px !important; }
#op-apk-bottom-bar img.op-aprovisionamento-box-icon { width: 22px !important; height: 22px !important; }

/* O total por unidade foi removido do HTML; se uma versão antiga ainda estiver
   em cache, esta regra garante que ele não reapareça. */
.sap-global-modal .sap-global-total { display: none !important; }
.sap-global-modal .sap-global-unit-row > header { justify-content: flex-start !important; }


/* ========================================================================
   V67 — preto personalizado aplicado nos assets ATIVOS
   ======================================================================== */
html[data-accent-enabled="true"][data-accent-tone="black"] .material-card .sap-global-stock {
  color: #fff !important;
  background: rgba(0,0,0,.78) !important;
  border-color: rgba(255,255,255,.12) !important;
}
html[data-accent-enabled="true"][data-accent-tone="black"] .material-card .sap-global-stock::before {
  background: #fff !important;
}
html[data-accent-enabled="true"][data-accent-tone="black"] .material-card .sap-global-stock:hover,
html[data-accent-enabled="true"][data-accent-tone="black"] .material-card .sap-global-stock:focus-visible {
  color: #fff !important;
  background: rgba(12,12,12,.96) !important;
}
html[data-accent-enabled="true"][data-accent-tone="black"] .material-card .sap-global-stock:hover::before,
html[data-accent-enabled="true"][data-accent-tone="black"] .material-card .sap-global-stock:focus-visible::before {
  background: #fff !important;
}

html[data-accent-enabled="true"][data-accent-tone="black"] .op-appearance-popover,
html[data-accent-enabled="true"][data-accent-tone="black"] .notification-popover,
html[data-accent-enabled="true"][data-accent-tone="black"] .sap-global-overlay .sap-global-modal {
  color: #f5f7f7 !important;
  background: linear-gradient(145deg, rgba(10,10,10,.94), rgba(0,0,0,.88)) !important;
  border-color: rgba(255,255,255,.11) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 26px 76px rgba(0,0,0,.62) !important;
}
html[data-accent-enabled="true"][data-accent-tone="black"] .op-appearance-popover :is(span,small,strong,output,button),
html[data-accent-enabled="true"][data-accent-tone="black"] .notification-popover :is(span,small,strong,time,button),
html[data-accent-enabled="true"][data-accent-tone="black"] .sap-global-overlay .sap-global-modal :is(span,small,strong,h2,p,button) {
  color: #f5f7f7 !important;
}
html[data-accent-enabled="true"][data-accent-tone="black"] .op-appearance-popover .op-theme-choice,
html[data-accent-enabled="true"][data-accent-tone="black"] .op-appearance-popover .op-accent-picker,
html[data-accent-enabled="true"][data-accent-tone="black"] .notification-popover .notification-item,
html[data-accent-enabled="true"][data-accent-tone="black"] .sap-global-overlay .sap-global-unit,
html[data-accent-enabled="true"][data-accent-tone="black"] .sap-global-overlay .sap-global-row,
html[data-accent-enabled="true"][data-accent-tone="black"] .sap-global-overlay .sap-global-unit-row {
  background: rgba(0,0,0,.58) !important;
  border-color: rgba(255,255,255,.10) !important;
}
html[data-accent-enabled="true"][data-accent-tone="black"] .op-appearance-popover .op-theme-choice button[aria-pressed="true"] {
  background: rgba(0,0,0,.96) !important;
  border-color: rgba(255,255,255,.16) !important;
}
html[data-accent-enabled="true"][data-accent-tone="black"] .op-appearance-popover .op-theme-choice button:not([aria-pressed="true"]) {
  background: linear-gradient(145deg, rgba(26,26,26,.78), rgba(7,7,7,.68)) !important;
  border-color: rgba(255,255,255,.08) !important;
}


/* V69 — o status do PC Agent é informativo; o portal permanece utilizável. */
.server-status.online > i{background:#52e4ad!important;box-shadow:0 0 0 6px rgba(82,228,173,.10)!important}
.server-status.offline > i{background:#e6a53a!important;box-shadow:0 0 0 6px rgba(230,165,58,.12)!important}
.server-status.offline strong{color:#fff!important}
.server-status.offline small{color:rgba(255,255,255,.62)!important}
.hero-visual .fc-two.op-status-offline{border-color:rgba(230,165,58,.42)!important;box-shadow:0 16px 35px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.10)!important}
html.op-agent-offline .sap-global-stock{opacity:.78}
