/*
    Sistema de notificacoes do usuario (webnotificacao)
    - sininho e contador no navbar
    - painel com a lista de notificacoes
    - balao de nova notificacao
    - paginas de notificacoes e editor de texto do cadastro
*/

/* ---------- Sininho no navbar ---------- */
.top_nav .navbar-right li.wn-sino-item {
    position: relative;
    padding-left: 0;
    margin-right: 6px;
}

.wn-sino {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 34px;
    margin-top: -6px;
    line-height: 34px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.wn-sino:hover,
.wn-sino.wn-aberto {
    background-color: rgba(255, 255, 255, 0.22);
}

.top_nav li.wn-sino-item a.wn-sino i.fa {
    color: #ffffff;
    font-size: 20px;
    line-height: 34px;
}

.wn-sino.wn-animar i.fa {
    animation: wn-balanca 0.9s ease 2;
    transform-origin: 50% 0;
}

.wn-contador {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    border: 2px solid #0099cc;
    background-color: #e41e3f;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
}

@keyframes wn-balanca {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(18deg); }
    30% { transform: rotate(-16deg); }
    45% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
    100% { transform: rotate(0deg); }
}

/* ---------- Painel com a lista ---------- */
.wn-painel {
    display: none;
    position: absolute;
    top: 42px;
    right: -60px;
    width: 400px;
    max-width: calc(100vw - 16px);
    background-color: #ffffff;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    z-index: 10050;
    text-align: left;
    overflow: hidden;
    cursor: default;
}

.wn-painel.wn-aberto {
    display: block;
}

.wn-painel-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px 16px;
    border-bottom: 1px solid #eef0f3;
}

.wn-painel-titulo {
    font-size: 18px;
    font-weight: bold;
    color: #1c1e21;
}

.wn-painel-acao {
    font-size: 12px;
    color: #0077a3;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

.wn-painel-acao:hover {
    text-decoration: underline;
}

.wn-painel-lista {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 6px;
}

.wn-painel-rodape {
    display: block;
    padding: 10px 16px;
    border-top: 1px solid #eef0f3;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: #0077a3;
}

.wn-painel-rodape:hover {
    background-color: #f5f7f9;
    color: #005f82;
    text-decoration: none;
}

.wn-vazio {
    padding: 34px 20px;
    text-align: center;
    color: #8a8d91;
    font-size: 13px;
}

.wn-vazio i.fa {
    display: block;
    margin-bottom: 10px;
    font-size: 34px;
    color: #c9ced6;
}

/* ---------- Item da lista (painel, pagina e balao) ---------- */
.wn-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 10px 26px 10px 10px;
    border-radius: 8px;
    color: #1c1e21;
    text-decoration: none;
    cursor: pointer;
}

.wn-item:hover {
    background-color: #f0f2f5;
    color: #1c1e21;
    text-decoration: none;
}

.wn-item.wn-nao-lida {
    background-color: #eaf6fb;
}

.wn-item.wn-nao-lida:hover {
    background-color: #dcf0f8;
}

.wn-item.wn-nao-lida::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    border-radius: 50%;
    background-color: #0099cc;
}

.wn-item-imagem {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    margin-right: 12px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e4e6eb;
    text-align: center;
}

.wn-item-imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wn-item-imagem i.fa {
    font-size: 20px;
    line-height: 48px;
    color: #ffffff;
}

.wn-icone-MANUAL { background-color: #0099cc; }
.wn-icone-SISTEMA { background-color: #5b6b7b; }
.wn-icone-PEDIDO_REABERTO { background-color: #e8890c; }
.wn-icone-PEDIDO_EXCLUIDO { background-color: #d9363e; }
.wn-icone-CHAMADO_RESOLVIDO { background-color: #1e9e55; }
.wn-icone-CHAMADO_RESPOSTA { background-color: #1d4ed8; }

.wn-item-corpo {
    flex: 1 1 auto;
    min-width: 0;
}

.wn-item-linha {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.wn-item-titulo {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: bold;
    color: #1c1e21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wn-item-data {
    flex: 0 0 auto;
    margin-left: 10px;
    font-size: 11px;
    color: #8a8d91;
    white-space: nowrap;
}

.wn-item-resumo {
    margin-top: 2px;
    font-size: 12px;
    line-height: 16px;
    color: #606770;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.wn-item-anexo {
    margin-top: 3px;
    font-size: 11px;
    color: #8a8d91;
}

/* ---------- Balao de nova notificacao ---------- */
.wn-balao {
    position: fixed;
    top: 62px;
    right: 18px;
    width: 360px;
    max-width: calc(100vw - 24px);
    background-color: #ffffff;
    border-radius: 12px;
    border-left: 5px solid #e41e3f;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
    z-index: 10060;
    opacity: 0;
    transform: translateY(-14px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: left;
}

.wn-balao.wn-visivel {
    opacity: 1;
    transform: translateY(0);
}

.wn-balao::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 96px;
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    transform: rotate(45deg);
    box-shadow: -3px -3px 6px rgba(0, 0, 0, 0.06);
}

.wn-balao-topo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 0 14px;
    font-size: 12px;
    font-weight: bold;
    color: #e41e3f;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.wn-balao-fechar {
    border: 0;
    background: none;
    padding: 0 4px;
    font-size: 20px;
    line-height: 20px;
    color: #8a8d91;
    cursor: pointer;
}

.wn-balao-fechar:hover {
    color: #1c1e21;
}

.wn-balao .wn-item {
    padding: 8px 14px 12px 14px;
    border-radius: 0 0 12px 0;
}

.wn-balao .wn-item:hover,
.wn-balao .wn-item.wn-nao-lida,
.wn-balao .wn-item.wn-nao-lida:hover {
    background-color: transparent;
}

.wn-balao .wn-item.wn-nao-lida::after {
    display: none;
}

.wn-balao-mais {
    padding: 0 14px 12px 74px;
    margin-top: -6px;
    font-size: 12px;
    color: #0077a3;
    font-weight: bold;
}

/* ---------- Pagina "minhas notificacoes" ---------- */
.wn-pagina {
    max-width: 900px;
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid #e7e5e5;
    border-radius: 10px;
    padding: 10px;
}

.wn-pagina .wn-item {
    padding: 14px 30px 14px 14px;
    border-bottom: 1px solid #f0f2f5;
    border-radius: 8px;
}

.wn-pagina .wn-item-titulo {
    font-size: 14px;
}

.wn-pagina .wn-item-resumo {
    font-size: 13px;
    line-height: 18px;
}

.wn-pagina .wn-item-imagem {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
}

.wn-pagina .wn-item-imagem i.fa {
    line-height: 56px;
    font-size: 23px;
}

.wn-carregar-mais {
    padding: 14px;
    text-align: center;
}

/* ---------- Pagina da notificacao completa ---------- */
.wn-leitura {
    max-width: 900px;
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid #e7e5e5;
    border-radius: 10px;
    padding: 26px 30px 30px 30px;
}

.wn-leitura-voltar {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: bold;
    color: #0077a3;
    cursor: pointer;
}

.wn-leitura-tipo {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.wn-leitura-titulo {
    margin: 12px 0 6px 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 30px;
    color: #1c1e21;
    word-break: break-word;
}

.wn-leitura-data {
    font-size: 13px;
    color: #8a8d91;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eef0f3;
}

.wn-leitura-imagem {
    margin-bottom: 20px;
    text-align: center;
}

.wn-leitura-imagem img {
    max-width: 100%;
    max-height: 520px;
    border-radius: 8px;
}

.wn-anexos {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid #eef0f3;
}

.wn-anexos-titulo {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: bold;
    color: #606770;
    text-transform: uppercase;
}

.wn-anexo {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background-color: #fafbfc;
}

.wn-anexo-icone {
    flex: 0 0 auto;
    width: 34px;
    font-size: 24px;
    color: #d9363e;
}

.wn-anexo-icone.wn-anexo-imagem {
    color: #0099cc;
}

.wn-anexo-nome {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: bold;
    color: #1c1e21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wn-anexo-nome small {
    display: block;
    font-weight: normal;
    color: #8a8d91;
}

.wn-anexo .btn {
    flex: 0 0 auto;
    margin: 0 0 0 8px;
}

.wn-modal-anexo .modal-body {
    height: 78vh;
    padding: 0;
}

/* ---------- Texto formatado (editor e leitura usam a mesma apresentacao) ---------- */
.wn-texto {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: #1c1e21;
    word-break: break-word;
}

.wn-texto p,
.wn-texto div {
    margin: 0 0 6px 0;
}

.wn-texto h1, .wn-texto h2, .wn-texto h3, .wn-texto h4 {
    margin: 14px 0 8px 0;
    font-weight: bold;
    color: inherit;
}

.wn-texto h1 { font-size: 26px; line-height: 32px; }
.wn-texto h2 { font-size: 22px; line-height: 28px; }
.wn-texto h3 { font-size: 19px; line-height: 25px; }
.wn-texto h4 { font-size: 16px; line-height: 22px; }

.wn-texto ul,
.wn-texto ol {
    margin: 0 0 10px 0;
    padding-left: 26px;
}

.wn-texto ul { list-style: disc; }
.wn-texto ol { list-style: decimal; }

.wn-texto blockquote {
    margin: 0 0 10px 0;
    padding: 6px 14px;
    border-left: 4px solid #c9ced6;
    color: #606770;
    font-size: 15px;
}

.wn-texto a {
    color: #0077a3;
    text-decoration: underline;
}

.wn-texto hr {
    margin: 14px 0;
    border-top: 1px solid #dfe3e8;
}

/* ---------- Editor de texto do cadastro ---------- */
.wn-editor {
    border: 2px solid #666666;
    border-radius: 5px;
    background-color: #ffffff;
}

.wn-editor-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 6px;
    border-bottom: 1px solid #c9ced6;
    background-color: #f3f5f7;
    border-radius: 4px 4px 0 0;
}

.wn-editor-grupo {
    position: relative;
    display: flex;
    align-items: center;
    margin: 2px 8px 2px 0;
    padding-right: 8px;
    border-right: 1px solid #d5dae0;
}

.wn-editor-grupo:last-child {
    border-right: 0;
}

.wn-editor-botao {
    min-width: 30px;
    height: 30px;
    margin: 0 1px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    color: #3b4450;
    font-size: 14px;
    line-height: 28px;
    cursor: pointer;
}

.wn-editor-botao:hover {
    background-color: #e2e6ea;
    border-color: #c9ced6;
}

.wn-editor-botao.wn-ativo {
    background-color: #cfe9f3;
    border-color: #0099cc;
    color: #005f82;
}

.wn-editor-select {
    height: 30px;
    margin: 0 1px;
    padding: 0 4px;
    border: 1px solid #c9ced6;
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 13px;
    color: #3b4450;
}

.wn-editor-cor-atual {
    display: block;
    width: 16px;
    height: 4px;
    margin: -6px auto 0 auto;
    border-radius: 1px;
}

.wn-editor-paleta {
    display: none;
    position: absolute;
    top: 34px;
    left: 0;
    width: 196px;
    padding: 8px;
    background-color: #ffffff;
    border: 1px solid #c9ced6;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.wn-editor-paleta.wn-aberto {
    display: block;
}

.wn-editor-paleta-titulo {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: bold;
    color: #606770;
    text-transform: uppercase;
}

.wn-editor-amostra {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin: 2px;
    padding: 0;
    border: 1px solid #c9ced6;
    border-radius: 4px;
    cursor: pointer;
}

.wn-editor-amostra:hover {
    transform: scale(1.15);
    border-color: #3b4450;
}

.wn-editor-area {
    min-height: 280px;
    max-height: 560px;
    overflow-y: auto;
    padding: 14px 16px;
    outline: none;
}

.wn-editor-area:empty::before {
    content: attr(data-placeholder);
    color: #a0a6ad;
}

.wn-editor-rodape {
    padding: 4px 10px;
    border-top: 1px solid #eef0f3;
    font-size: 11px;
    color: #8a8d91;
    text-align: right;
}

/* ---------- Distribuicao da notificacao (cadastro) ---------- */
.wn-bloco {
    margin-top: 14px;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid #e7e5e5;
    border-radius: 10px;
}

.wn-bloco-titulo {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: bold;
    color: #3b4450;
}

.wn-opcoes {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -6px;
}

.wn-opcao {
    flex: 1 1 200px;
    margin: 6px;
    padding: 14px;
    border: 2px solid #c9ced6;
    border-radius: 8px;
    background-color: #fafbfc;
    cursor: pointer;
    user-select: none;
}

.wn-opcao:hover {
    border-color: #0099cc;
}

.wn-opcao.wn-selecionada {
    border-color: #0099cc;
    background-color: #eaf6fb;
}

.wn-opcao i.fa {
    float: left;
    width: 34px;
    font-size: 24px;
    color: #0099cc;
}

.wn-opcao strong {
    display: block;
    font-size: 14px;
    color: #1c1e21;
}

.wn-opcao span {
    display: block;
    margin-left: 34px;
    font-size: 12px;
    color: #606770;
}

.wn-selecao {
    margin-top: 12px;
}

.wn-selecao-topo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 6px;
}

.wn-selecao-topo input[type="text"] {
    flex: 1 1 220px;
}

.wn-selecao-topo .btn {
    margin: 0 0 0 8px;
}

.wn-selecao-lista {
    max-height: 260px;
    overflow-y: auto;
    border: 2px solid #666666;
    border-radius: 5px;
    background-color: #ffffff;
}

.wn-selecao-item {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 7px 10px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
    font-weight: normal;
    color: #1c1e21;
    cursor: pointer;
}

.wn-selecao-item:hover {
    background-color: #f0f2f5;
}

.wn-selecao-item input {
    margin: 0 10px 0 0;
    width: 16px;
    height: 16px;
}

.wn-selecao-item small {
    margin-left: 8px;
    color: #8a8d91;
}

.wn-selecao-contador {
    margin-top: 6px;
    font-size: 12px;
    font-weight: bold;
    color: #606770;
}

.wn-destino {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background-color: #fff8e1;
    border: 1px solid #f2d98a;
    font-size: 13px;
    color: #6b5300;
}

.wn-arquivo-selecionado {
    display: flex;
    align-items: center;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background-color: #fafbfc;
    font-size: 13px;
}

.wn-arquivo-selecionado img {
    width: 54px;
    height: 54px;
    margin-right: 10px;
    object-fit: cover;
    border-radius: 6px;
}

.wn-arquivo-selecionado i.fa-file-pdf-o {
    margin-right: 10px;
    font-size: 22px;
    color: #d9363e;
}

.wn-arquivo-selecionado span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wn-arquivo-selecionado button {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: #d9363e;
    font-size: 16px;
    cursor: pointer;
}

.wn-progresso {
    display: inline-block;
    width: 90px;
    height: 8px;
    margin-right: 8px;
    border-radius: 4px;
    background-color: #e4e6eb;
    overflow: hidden;
    vertical-align: middle;
}

.wn-progresso div {
    height: 100%;
    background-color: #26b99a;
}

@media (max-width: 480px) {
    .wn-painel {
        position: fixed;
        top: 52px;
        right: 8px;
        left: 8px;
        width: auto;
    }

    .wn-leitura {
        padding: 18px 16px;
    }

    .wn-leitura-titulo {
        font-size: 20px;
        line-height: 26px;
    }
}
