/*==============================================================================
  SINO DE NOTIFICACOES

  Aviso em dois tempos: o contador no sino diz que existe algo novo, e o toast
  diz o que e — sem exigir que a pessoa esteja olhando para o sino no momento
  exato em que o agendamento entrou.
==============================================================================*/

.w-sino {
    position: relative;
}

.w-sino__botao {
    position: relative;
}

/* O contador precisa ser visivel de canto de olho: cor de alerta, numero
   pequeno, encostado no icone. */
.w-sino__contador {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--w-danger, #dc2626);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--w-surface);
}

.w-sino__painel {
    width: min(360px, calc(100vw - 2rem));
    padding: 0;
    border: 0;
    border-radius: var(--w-radius-lg, 14px);
    box-shadow: var(--w-shadow-lg, 0 12px 32px rgba(0, 0, 0, .14));
    overflow: hidden;
}

.w-sino__topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--w-border);
    background: var(--w-surface-sunken);
}

.w-sino__topo strong {
    font-size: var(--w-text-sm, .875rem);
    color: var(--w-text-primary);
}

.w-sino__marcar {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: var(--w-text-xs, .8125rem);
    font-weight: 600;
    color: var(--w-text-link, var(--w-accent));
    cursor: pointer;
}

.w-sino__lista {
    max-height: 380px;
    overflow-y: auto;
}

.w-sino__item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--w-border-subtle, var(--w-border));
    color: inherit;
    text-decoration: none;
}

.w-sino__item:hover {
    background: var(--w-surface-hover);
    color: inherit;
}

.w-sino__item:last-child {
    border-bottom: 0;
}

/* Nao lida ganha fundo e um marcador — a diferenca precisa sobreviver a quem
   nao distingue bem as cores, entao vem tambem o ponto a esquerda. */
.w-sino__item--nova {
    background: var(--w-accent-subtle, #eef2ff);
}

.w-sino__icone {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--w-surface-sunken);
    color: var(--w-accent);
    font-size: .8125rem;
}

.w-sino__texto strong {
    display: block;
    font-size: var(--w-text-sm, .875rem);
    color: var(--w-text-primary);
}

.w-sino__texto p {
    margin: .15rem 0 0;
    font-size: var(--w-text-xs, .8125rem);
    line-height: 1.45;
    color: var(--w-text-secondary);
}

.w-sino__texto time {
    display: block;
    margin-top: .2rem;
    font-size: var(--w-text-2xs, .75rem);
    color: var(--w-text-tertiary);
}

.w-sino__vazio {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    font-size: var(--w-text-sm, .875rem);
    color: var(--w-text-secondary);
}

/*------------------------------------------------------------------------------
  Toast
------------------------------------------------------------------------------*/

.w-toasts {
    position: fixed;
    top: 76px;
    right: 16px;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.w-toast {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .9rem 1rem;
    border-radius: var(--w-radius-lg, 14px);
    background: var(--w-surface);
    box-shadow: var(--w-shadow-lg, 0 12px 32px rgba(0, 0, 0, .18));
    border-left: 4px solid var(--w-accent);
    pointer-events: auto;
    animation: w-toast-entra .22s ease-out;
    text-decoration: none;
    color: inherit;
}

.w-toast:hover {
    color: inherit;
}

.w-toast--saindo {
    animation: w-toast-sai .2s ease-in forwards;
}

@keyframes w-toast-entra {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: none; }
}

@keyframes w-toast-sai {
    to { opacity: 0; transform: translateX(16px); }
}

@media (prefers-reduced-motion: reduce) {
    .w-toast,
    .w-toast--saindo {
        animation: none;
    }
}

.w-toast__icone {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--w-accent-subtle, #eef2ff);
    color: var(--w-accent);
}

.w-toast__texto strong {
    display: block;
    font-size: var(--w-text-sm, .875rem);
    color: var(--w-text-primary);
}

.w-toast__texto p {
    margin: .15rem 0 0;
    font-size: var(--w-text-xs, .8125rem);
    line-height: 1.45;
    color: var(--w-text-secondary);
}

.w-toast__fechar {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--w-text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0 0 .5rem;
}

@media (max-width: 40rem) {
    .w-toasts {
        top: auto;
        bottom: 16px;
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

/*==============================================================================
  SELETOR DE IDIOMA

  Vizinho do sino: as duas sao preferencias de exibicao e ficam juntas. O codigo
  curto (PT/EN/ES/IT) aparece ao lado do icone porque so o globo nao diz em que
  idioma o sistema esta agora.
==============================================================================*/

.w-idioma__botao {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.w-idioma__curto {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.w-idioma__lista {
    min-width: 190px;
    padding: .35rem;
    border: 0;
    border-radius: var(--w-radius-lg, 14px);
    box-shadow: var(--w-shadow-lg, 0 12px 32px rgba(0, 0, 0, .14));
}

.w-idioma__lista .dropdown-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .7rem;
    border-radius: var(--w-radius-sm, 8px);
    font-size: var(--w-text-sm, .875rem);
}

.w-idioma__lista .dropdown-item.is-ativo {
    background: var(--w-accent-subtle, #eef2ff);
    color: var(--w-accent);
    font-weight: 600;
}

.w-idioma__bandeira {
    font-size: 1.05rem;
    line-height: 1;
}

/* No celular o codigo curto sai: sobra o globo, e a lista continua completa. */
@media (max-width: 30rem) {
    .w-idioma__curto {
        display: none;
    }
}

/* ── Ações e rolagem infinita ───────────────────────────────────────────────
   A lista precisa de altura fixa para poder rolar: sem `max-height` o painel
   cresceria até sair da tela e a rolagem infinita nunca dispararia. */
.w-sino__total {
    font-size: var(--w-text-xs, 12px);
    color: var(--w-text-secondary, #64748b);
    font-weight: var(--w-weight-medium, 500);
}

.w-sino__acoes {
    display: flex;
    gap: 8px;
    padding: 0 var(--w-space-3, 12px) var(--w-space-2, 8px);
    border-bottom: 1px solid var(--w-border, #e2e8f0);
}

.w-sino__acao {
    flex: 1;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--w-radius-sm, 6px);
    background: transparent;
    color: var(--w-accent, #4f46e5);
    font-size: var(--w-text-xs, 12px);
    font-weight: var(--w-weight-medium, 500);
    cursor: pointer;
}

.w-sino__acao:hover { background: var(--w-surface-hover, #f1f5f9); }

.w-sino__acao--perigo { color: var(--w-danger, #dc2626); }

.w-sino__lista {
    max-height: 22rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* O botão de excluir só aparece no hover no desktop; no toque, onde hover não
   existe, ele fica sempre visível. */
.w-sino__item { position: relative; }

.w-sino__excluir {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--w-text-secondary, #64748b);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--w-duration-fast, .15s) ease;
}

.w-sino__item:hover .w-sino__excluir,
.w-sino__excluir:focus-visible { opacity: 1; }

.w-sino__excluir:hover {
    background: color-mix(in srgb, var(--w-danger, #dc2626) 14%, transparent);
    color: var(--w-danger, #dc2626);
}

@media (hover: none) {
    .w-sino__excluir { opacity: .7; }
}

.w-sino__rodape {
    padding: var(--w-space-2, 8px);
    text-align: center;
}

.w-sino__carregando {
    font-size: var(--w-text-xs, 12px);
    color: var(--w-text-secondary, #64748b);
}
