/* Widget flutuante de notificações (canto inferior direito) */
.ntf-widget {
  --ntf-bg: #ffffff;
  --ntf-creme: #faf9f5;
  --ntf-tinta: #141413;
  --ntf-texto-2: #5e5d59;
  --ntf-texto-3: #87867f;
  --ntf-borda: rgba(31, 30, 29, 0.15);
  --ntf-divisor: rgba(31, 30, 29, 0.1);
  --ntf-hover: rgba(115, 114, 108, 0.1);
  --ntf-destaque: #d97757;
  --ntf-mascote: #3ec1b4;
  --ntf-sans: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ntf-serif: Georgia, 'Times New Roman', Times, serif;

  position: fixed;
  right: 28px;
  bottom: 28px;
  /* Abaixo do drawer do tema (overlay 109, drawer 110) e dos modais; acima de header/aside/scrolltop (≤105). */
  z-index: 108;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: var(--ntf-sans);
  color: var(--ntf-tinta);
  pointer-events: none;
}

.ntf-widget > * {
  pointer-events: auto;
}

.ntf-widget [hidden] {
  display: none !important;
}

.ntf-widget button {
  font-family: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

@keyframes ntf-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes ntf-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

@keyframes ntf-pop {
  0% { transform: translateY(8px) scale(0.97); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.ntf-mascote {
  animation: ntf-bob 2.8s ease-in-out infinite;
}

.ntf-olho {
  transform-box: fill-box;
  transform-origin: center;
  animation: ntf-blink 4.5s infinite;
}

/* Painel */
.ntf-painel {
  width: min(360px, calc(100vw - 24px));
  background: var(--ntf-bg);
  border-radius: 20px;
  border: 0.5px solid var(--ntf-borda);
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.04), 0 12px 32px rgba(20, 20, 19, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ntf-pop 0.22s ease-out;
  transform-origin: bottom right;
}

.ntf-cabecalho {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 14px 12px 18px;
}

.ntf-cabecalho .ntf-mascote {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.ntf-titulos {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ntf-titulo {
  margin: 0;
  font-family: var(--ntf-serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ntf-tinta);
}

.ntf-fala {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ntf-texto-2);
}

.ntf-widget .ntf-btn-icone {
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ntf-texto-2);
}

.ntf-widget .ntf-btn-icone:hover {
  background: var(--ntf-hover);
}

.ntf-widget .ntf-minimizar {
  width: 44px;
  height: 44px;
}

.ntf-barra {
  padding: 0 10px 4px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--ntf-divisor);
}

.ntf-contador {
  font-size: 12px;
  color: var(--ntf-texto-2);
}

.ntf-widget .ntf-limpar {
  height: 36px;
  padding: 0 10px;
  gap: 6px;
  font-size: 13px;
}

/* Lista */
.ntf-lista {
  list-style: none;
  margin: 0;
  padding: 4px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 232px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ntf-lista::-webkit-scrollbar {
  width: 6px;
}

.ntf-lista::-webkit-scrollbar-thumb {
  background: #dedcd1;
  border-radius: 6px;
}

.ntf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  border-radius: 12px;
}

.ntf-item:hover {
  background: rgba(115, 114, 108, 0.08);
}

.ntf-ponto {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ntf-destaque);
}

.ntf-corpo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ntf-texto {
  font-size: 15px;
  line-height: 1.4;
  color: var(--ntf-tinta);
  overflow-wrap: anywhere;
}

.ntf-data {
  font-size: 12px;
  line-height: 1.3;
  color: var(--ntf-texto-3);
}

.ntf-widget .ntf-remover {
  width: 40px;
  height: 40px;
  color: var(--ntf-texto-3);
}

.ntf-vazio,
.ntf-mais {
  padding: 20px 12px;
  text-align: center;
  font-size: 14px;
  color: var(--ntf-texto-2);
}

.ntf-mais {
  padding: 6px 4px 0;
}

.ntf-widget .ntf-ver-mais {
  width: 100%;
  height: 36px;
  font-size: 13px;
}

.ntf-widget .ntf-ver-mais:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Lançador */
.ntf-lancador-linha {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ntf-balao {
  padding: 9px 14px;
  background: var(--ntf-bg);
  border: 0.5px solid var(--ntf-borda);
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 4px 16px rgba(20, 20, 19, 0.06);
  font-size: 14px;
  color: var(--ntf-tinta);
}

.ntf-widget .ntf-lancador {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0.5px solid var(--ntf-borda);
  background: var(--ntf-bg);
  box-shadow: 0 2px 4px rgba(20, 20, 19, 0.05), 0 8px 24px rgba(20, 20, 19, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ntf-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--ntf-tinta);
  color: var(--ntf-creme);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ntf-creme);
}

@media (max-width: 575.98px) {
  .ntf-widget {
    right: 12px;
    bottom: 12px;
  }
}

/* Escolha do canto */
.ntf-widget .ntf-btn-posicao {
  width: 36px;
  height: 44px;
  margin-right: -10px;
}

.ntf-posicoes {
  padding: 2px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--ntf-divisor);
}

.ntf-posicoes-grade {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 4px;
}

.ntf-widget .ntf-posicao {
  position: relative;
  width: 30px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--ntf-borda);
  background: var(--ntf-creme);
}

.ntf-widget .ntf-posicao:hover {
  background: var(--ntf-hover);
}

.ntf-posicao::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ntf-texto-3);
}

.ntf-posicao[data-pos^="s"]::after { top: 3px; }
.ntf-posicao[data-pos^="i"]::after { bottom: 3px; }
.ntf-posicao[data-pos$="e"]::after { left: 3px; }
.ntf-posicao[data-pos$="d"]::after { right: 3px; }

.ntf-widget .ntf-posicao[aria-pressed="true"] {
  border-color: var(--ntf-tinta);
}

.ntf-posicao[aria-pressed="true"]::after {
  background: var(--ntf-destaque);
}

/* Cantos: `data-ntf-pos` no <html> (se/sd/ie/id); sem atributo = inferior direito.
   --ntf-esquerda = largura do menu lateral, medida pelo JS. */
html[data-ntf-pos$="e"] .ntf-widget {
  right: auto;
  left: calc(var(--ntf-esquerda, 0px) + 28px);
  align-items: flex-start;
}

html[data-ntf-pos$="e"] .ntf-lancador-linha {
  flex-direction: row-reverse;
}

html[data-ntf-pos^="s"] .ntf-widget {
  bottom: auto;
  top: 28px;
  flex-direction: column-reverse;
}

/* Header só existe no mobile (d-lg-none): lá o widget desce pra não cobri-lo. */
@media (max-width: 991.98px) {
  html[data-ntf-pos^="s"] .ntf-widget {
    top: 72px;
  }
}

html[data-ntf-pos="ie"] .ntf-painel { transform-origin: bottom left; }
html[data-ntf-pos="sd"] .ntf-painel { transform-origin: top right; }
html[data-ntf-pos="se"] .ntf-painel { transform-origin: top left; }

html[data-ntf-pos="ie"] .ntf-balao { border-radius: 14px 14px 14px 4px; }
html[data-ntf-pos="sd"] .ntf-balao { border-radius: 14px 4px 14px 14px; }
html[data-ntf-pos="se"] .ntf-balao { border-radius: 4px 14px 14px 14px; }

@media (max-width: 575.98px) {
  html[data-ntf-pos$="e"] .ntf-widget {
    left: 12px;
  }
}

/* Vizinhos do canto inferior direito: sobem/afastam pra não ficar sob o widget */
html[data-ntf-pos="id"] #kt_scrolltop {
  right: 38px;
  bottom: 104px;
}

html[data-ntf-pos="id"] #toast-container.toast-bottom-right {
  right: 28px;
  bottom: 104px;
}

@media (min-width: 576px) {
  html[data-ntf-pos="id"].ntf-aberto #kt_scrolltop,
  html[data-ntf-pos="id"].ntf-aberto #toast-container.toast-bottom-right {
    right: 404px;
    bottom: 28px;
  }
}

@media (max-width: 575.98px) {
  html[data-ntf-pos="id"].ntf-aberto #kt_scrolltop {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ntf-mascote,
  .ntf-olho,
  .ntf-painel {
    animation: none;
  }
}
