﻿/* Central do BE — consulta de beneficiários efectivos
   Paleta: tinta (texto/cabeçalho), papel (fundo), verde-registo (vigente, entradas),
   vermelho (saídas), âmbar (alterações e discrepâncias). */
:root {
    --be-tinta: #1F2A44;
    --be-tinta-2: #4A5570;
    --be-tinta-3: #7A8399;
    --be-papel: #F5F6F8;
    --be-superficie: #FFFFFF;
    --be-linha: #DDE2EA;
    --be-linha-forte: #C5CCD8;
    --be-verde: #1E7A4F;
    --be-verde-fundo: #E7F3EC;
    --be-vermelho: #B42318;
    --be-vermelho-fundo: #FBEAE8;
    --be-ambar: #A15C07;
    --be-ambar-fundo: #FDF3E1;
    --be-raio: 6px;
    --be-fonte: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--be-fonte);
    color: var(--be-tinta);
    background-color: var(--be-papel);
}

a { color: #2459C6; text-underline-offset: 2px; }
a:hover { color: #1A4294; }

/* ---------- Foco visível ---------- */
:focus-visible {
    outline: 2px solid #2F6FDE;
    outline-offset: 2px;
}

/* Títulos que recebem o foco por script (para leitores de ecrã) não mostram contorno */
[tabindex="-1"]:focus { outline: none; }

/* ---------- Moldura da página ---------- */
html, body { height: 100%; }
body { margin: 0; }

.be-moldura {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.be-area {
    flex: 1;
    overflow: auto;
    position: relative;
}

/* ---------- Barra de navegação ---------- */
.be-topo { flex: 0 0 auto; }

.be-nav {
    background: var(--be-tinta);
    padding: .55rem 0;
}

.be-nav-contentor { gap: .75rem; }

.be-marca {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    text-decoration: none;
    margin-right: 1.75rem;
    white-space: nowrap;
}

    .be-marca:hover, .be-marca:focus-visible { color: #fff; }

.be-simbolo { color: #C9D2E3; flex: 0 0 auto; }

.be-marca-texto { display: flex; flex-direction: column; line-height: 1.1; }

.be-marca-nome {
    font-weight: 700;
    font-size: 1.08rem;
}

.be-marca-org {
    font-size: .78rem;
    color: #AEB6C8;
}

.be-menu-principal { gap: .25rem; }

.be-nav .nav-link {
    position: relative;
    color: #C9D0DD !important;
    font-weight: 500;
    padding: .45rem .8rem !important;
    border-radius: var(--be-raio);
    display: flex;
    align-items: center;
    gap: .45rem;
}

    .be-nav .nav-link i { font-size: .85rem; opacity: .75; }

    .be-nav .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.06); }

    /* Item activo: sublinhado verde-registo assente na base da barra */
    .be-nav .nav-link.active {
        color: #fff !important;
        font-weight: 600;
    }

        .be-nav .nav-link.active::after {
            content: "";
            position: absolute;
            left: .8rem;
            right: .8rem;
            bottom: -.55rem;
            height: 3px;
            border-radius: 3px 3px 0 0;
            background: #3FB37F;
        }

/* Pontos antigos que algumas páginas ainda acrescentam ao menu */
.dotmncss, .dotmnscss { display: none !important; }

.be-nav-procura {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: .75rem;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: var(--be-raio);
    padding: 0 .25rem 0 .7rem;
    min-width: 260px;
}

    .be-nav-procura input {
        flex: 1;
        min-width: 0;
        background: none;
        border: 0;
        color: #fff;
        font: inherit;
        padding: .4rem 0;
    }

        .be-nav-procura input::placeholder { color: #AEB6C8; }
        .be-nav-procura input:focus { outline: none; }

    .be-nav-procura button {
        background: none;
        border: 0;
        color: #C9D0DD;
        padding: .35rem .5rem;
    }

/* Menu do utilizador */
.be-utilizador { margin-left: auto; }
.be-nav-procura + .be-utilizador { margin-left: 0; }

.be-utilizador-btn {
    display: flex;
    align-items: center;
    gap: .55rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .2rem .7rem .2rem .2rem;
    color: #E3E7EF;
    font: inherit;
    font-weight: 500;
}

    .be-utilizador-btn:hover,
    .be-utilizador-btn[aria-expanded="true"] {
        background: rgba(255,255,255,.08);
        border-color: rgba(255,255,255,.14);
    }

.be-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #3FB37F;
    color: #0E2A1D;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .02em;
}

.be-utilizador-seta { font-size: .7rem; opacity: .7; }

.be-menu-utilizador {
    min-width: 270px;
    padding: .4rem;
    border: 1px solid var(--be-linha);
    border-radius: var(--be-raio);
    box-shadow: 0 10px 30px rgba(31, 42, 68, .16);
    font-family: var(--be-fonte);
}

    .be-menu-utilizador .dropdown-item {
        border-radius: 4px;
        padding: .5rem .65rem;
        display: flex;
        align-items: center;
        gap: .6rem;
        color: var(--be-tinta);
    }

        .be-menu-utilizador .dropdown-item i { width: 1rem; color: var(--be-tinta-3); }
        .be-menu-utilizador .dropdown-item:hover { background: var(--be-papel); }
        .be-menu-utilizador .dropdown-item.active { background: var(--be-papel); font-weight: 600; }
        .be-menu-utilizador .be-sair, .be-menu-utilizador .be-sair i { color: var(--be-vermelho); }

.be-menu-cab {
    display: flex;
    flex-direction: column;
    padding: .45rem .65rem .6rem;
    border-bottom: 1px solid var(--be-linha);
    margin-bottom: .3rem;
}

.be-menu-email { font-weight: 600; overflow-wrap: anywhere; }
.be-menu-perfil { color: var(--be-tinta-3); font-size: .88rem; }

@media (max-width: 767.98px) {
    .be-marca { margin-right: 0; }
    .be-marca-org { display: none; }
    .be-menu-principal { padding-top: .5rem; }
    .be-nav .nav-link.active::after { left: 0; right: auto; top: .55rem; bottom: .55rem; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
    .be-nav-procura { margin: .5rem 0; min-width: 0; }
    .be-utilizador { margin: .5rem 0 .25rem; }
    .be-utilizador-nome { display: inline; }
}

/* ---------- Rodapé ---------- */
.be-rodape {
    flex: 0 0 auto;
    border-top: 1px solid var(--be-linha);
    background: var(--be-superficie);
    color: var(--be-tinta-3);
    font-size: .88rem;
    padding: .55rem 0;
}

.be-rodape-contentor {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

    .be-rodape a { color: var(--be-tinta-2); }

/* ---------- Indicador de carregamento ---------- */
#loaddv {
    position: fixed;
    z-index: 9999;
    inset: 0;
    background-color: rgba(245, 246, 248, .7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-spin {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(31, 42, 68, .15);
    border-top-color: var(--be-tinta);
    border-radius: 50%;
    animation: be-girar 1s linear infinite;
}

@keyframes be-girar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .loader-spin { animation-duration: 3s; }
}

/* ---------- Pesquisa ---------- */
.be-procura {
    max-width: 1180px;
    margin: 0 auto;
    padding: 3.5rem 1rem 1.5rem;
    text-align: left;
    transition: padding .25s ease;
}

.be-procura-titulo {
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .35rem;
}

.be-procura-ajuda {
    color: var(--be-tinta-2);
    margin: 0 0 1.25rem;
    max-width: 60ch;
}

.be-procura-form {
    display: flex;
    gap: .5rem;
    max-width: 640px;
}

.be-procura-input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 1.05rem;
    padding: .65rem .9rem;
    border: 1px solid var(--be-linha-forte);
    border-radius: var(--be-raio);
    background: var(--be-superficie);
    color: var(--be-tinta);
}

    .be-procura-input:focus {
        outline: none;
        border-color: var(--be-tinta);
        box-shadow: 0 0 0 3px rgba(31, 42, 68, .12);
    }

.be-botao {
    font: inherit;
    font-weight: 600;
    padding: .6rem 1.1rem;
    border-radius: var(--be-raio);
    border: 1px solid var(--be-tinta);
    background: var(--be-tinta);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

    .be-botao:hover { background: #2B3A5E; }

.be-botao-sec {
    background: var(--be-superficie);
    color: var(--be-tinta);
    border-color: var(--be-linha-forte);
}

    .be-botao-sec:hover { background: var(--be-papel); }

.be-botao-peq {
    font-size: .9rem;
    padding: .35rem .75rem;
}

/* Depois da primeira pesquisa a barra encolhe e fica no topo */
.be-procura.be-compacto {
    padding-top: 1.25rem;
    padding-bottom: .75rem;
}

    .be-procura.be-compacto .be-procura-titulo,
    .be-procura.be-compacto .be-procura-ajuda {
        display: none;
    }

#Besdv {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
    text-align: left;
    border-top: 0;
}

/* ---------- Avisos e estados vazios ---------- */
.be-aviso {
    max-width: 560px;
    margin: 2.5rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--be-superficie);
    border: 1px solid var(--be-linha);
    border-radius: var(--be-raio);
}

    .be-aviso p { margin: 0; color: var(--be-tinta-2); }

    .be-aviso .be-aviso-titulo {
        color: var(--be-tinta);
        font-weight: 600;
        font-size: 1.05rem;
        margin-bottom: .25rem;
    }

/* ---------- Lista de entidades ---------- */
.be-entidades-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--be-tinta-2);
    margin: 1rem 0 .75rem;
}

.be-entidades {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--be-superficie);
    border: 1px solid var(--be-linha);
    border-radius: var(--be-raio);
}

    .be-entidades li + li { border-top: 1px solid var(--be-linha); }

.be-entidade {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .25rem 1rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: .85rem 1.1rem;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

    .be-entidade:hover { background: var(--be-papel); }

.be-entidade-nome { font-weight: 600; }

.be-entidade-meta {
    grid-column: 1;
    color: var(--be-tinta-2);
    font-size: .9rem;
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.be-entidade-abrir {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--be-tinta-3);
    font-size: .9rem;
}

/* ---------- Cabeçalho da entidade ---------- */
.be-entidade-cab {
    padding: .5rem 0 1.25rem;
    border-bottom: 1px solid var(--be-linha);
    margin-bottom: 1.5rem;
}

.be-entidade-cab h1 {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .5rem;
}

.be-factos {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 2rem;
    margin: 0;
}

    .be-factos div { display: flex; gap: .4rem; align-items: baseline; }
    .be-factos dt { font-weight: 400; color: var(--be-tinta-3); font-size: .9rem; }
    .be-factos dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Grelha: linha temporal | declaração ---------- */
.be-grelha {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

/* ---------- Linha temporal das declarações (o elemento central) ---------- */
.be-cronologia-titulo {
    font-size: .95rem;
    font-weight: 600;
    color: var(--be-tinta-2);
    margin: 0 0 .75rem;
}

.be-cronologia {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    position: sticky;
    top: 1rem;
}

    /* fio vertical */
    .be-cronologia::before {
        content: "";
        position: absolute;
        left: 9px;
        top: 14px;
        bottom: 14px;
        width: 2px;
        background: var(--be-linha);
    }

.be-decl {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--be-raio);
    padding: .6rem .75rem .65rem 2.1rem;
    margin-bottom: .25rem;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

    .be-decl:hover { background: var(--be-superficie); border-color: var(--be-linha); }

    .be-decl[aria-selected="true"] {
        background: var(--be-superficie);
        border-color: var(--be-tinta);
        box-shadow: 0 1px 0 var(--be-linha);
    }

    /* nó na linha */
    .be-decl::before {
        content: "";
        position: absolute;
        left: 4px;
        top: .95rem;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: var(--be-papel);
        border: 2px solid var(--be-linha-forte);
    }

    .be-decl[aria-selected="true"]::before { border-color: var(--be-tinta); background: var(--be-tinta); }
    .be-decl.be-vigente::before { border-color: var(--be-verde); background: var(--be-verde); }

.be-decl-topo {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
}

.be-decl-np { font-weight: 600; font-variant-numeric: tabular-nums; }
.be-decl-data { color: var(--be-tinta-2); font-size: .9rem; white-space: nowrap; }

.be-decl-estagio {
    display: block;
    color: var(--be-tinta-3);
    font-size: .85rem;
    margin-top: .1rem;
}

.be-decl-resumo {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .4rem;
}

.be-marca-vigente {
    font-size: .78rem;
    font-weight: 600;
    color: var(--be-verde);
}

/* contadores de mudanças */
.be-mud {
    font-size: .8rem;
    font-weight: 600;
    padding: .05rem .45rem;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.be-mud-entra { color: var(--be-verde); background: var(--be-verde-fundo); }
.be-mud-sai { color: var(--be-vermelho); background: var(--be-vermelho-fundo); }
.be-mud-altera { color: var(--be-ambar); background: var(--be-ambar-fundo); }
.be-mud-neutro { color: var(--be-tinta-3); background: #EEF0F4; font-weight: 500; }

/* ---------- Painel da declaração ---------- */
.be-painel {
    background: var(--be-superficie);
    border: 1px solid var(--be-linha);
    border-radius: var(--be-raio);
    min-width: 0;
}

    .be-painel[hidden] { display: none; }

.be-painel-cab {
    padding: 1.1rem 1.25rem .25rem;
}

    .be-painel-cab h2 {
        font-size: 1.3rem;
        font-weight: 600;
        margin: 0;
    }

.be-painel-sub {
    color: var(--be-tinta-2);
    margin: .2rem 0 0;
    font-size: .95rem;
}

.be-separadores {
    display: flex;
    gap: 1.5rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--be-linha);
    margin-top: .75rem;
}

.be-separador {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: .6rem 0;
    margin-bottom: -1px;
    font: inherit;
    font-weight: 600;
    color: var(--be-tinta-3);
    cursor: pointer;
}

    .be-separador[aria-selected="true"] {
        color: var(--be-tinta);
        border-bottom-color: var(--be-tinta);
    }

.be-conteudo { padding: 1rem 1.25rem 1.25rem; }
    .be-conteudo[hidden] { display: none; }

.be-ferramentas {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
    color: var(--be-tinta-2);
    font-size: .92rem;
}

.be-interruptor {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    user-select: none;
}

/* ---------- Tabela de beneficiários ---------- */
.be-tabela-wrap { overflow-x: auto; }

.be-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

    .be-tabela th {
        text-align: left;
        font-weight: 600;
        color: var(--be-tinta-2);
        font-size: .85rem;
        padding: .45rem .6rem;
        border-bottom: 1px solid var(--be-linha-forte);
        white-space: nowrap;
    }

    .be-tabela td {
        padding: .55rem .6rem;
        border-bottom: 1px solid var(--be-linha);
        vertical-align: top;
    }

    .be-tabela tr:last-child td { border-bottom: 0; }

    .be-tabela .be-num {
        text-align: right;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

.be-nome { font-weight: 600; }

.be-antes {
    display: block;
    font-size: .82rem;
    color: var(--be-tinta-3);
    font-weight: 400;
}

.be-etiqueta {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: 0 .4rem;
    border-radius: 3px;
    margin-left: .35rem;
    vertical-align: 1px;
}

/* Realce das mudanças — só quando o interruptor está ligado */
.be-realce tr.be-novo td:first-child { box-shadow: inset 3px 0 0 var(--be-verde); }
.be-realce tr.be-alterado td:first-child { box-shadow: inset 3px 0 0 var(--be-ambar); }
.be-realce tr.be-removido td:first-child { box-shadow: inset 3px 0 0 var(--be-vermelho); }
.be-realce tr.be-novo .be-etiqueta { color: var(--be-verde); background: var(--be-verde-fundo); }
.be-realce tr.be-alterado .be-etiqueta { color: var(--be-ambar); background: var(--be-ambar-fundo); }
.be-realce tr.be-removido .be-etiqueta { color: var(--be-vermelho); background: var(--be-vermelho-fundo); }
.be-realce .be-mudou { color: var(--be-ambar); font-weight: 600; }

.be-tabela tr.be-removido { display: none; }
.be-realce tr.be-removido { display: table-row; }
.be-realce tr.be-removido td { color: var(--be-tinta-3); }
.be-realce tr.be-removido .be-nome { text-decoration: line-through; font-weight: 500; }

.be-etiqueta { display: none; }
.be-realce .be-etiqueta { display: inline-block; }
.be-antes { display: none; }
.be-realce .be-antes { display: block; }

/* ---------- Documentos e discrepâncias ---------- */
.be-seccao-titulo {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 .5rem;
}

.be-seccao + .be-seccao { margin-top: 1.5rem; }

.be-docs {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .be-docs li + li { border-top: 1px solid var(--be-linha); }

.be-doc {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    background: none;
    border: 0;
    padding: .55rem 0;
    font: inherit;
    color: var(--be-tinta);
    text-align: left;
    cursor: pointer;
}

    .be-doc:hover .be-doc-titulo { text-decoration: underline; }
    .be-doc i { color: var(--be-tinta-3); width: 1rem; }

.be-doc-ficheiro { color: var(--be-tinta-3); font-size: .85rem; margin-left: auto; }

.be-disc {
    border: 1px solid var(--be-linha);
    border-left: 3px solid var(--be-ambar);
    border-radius: var(--be-raio);
    padding: .7rem .9rem;
    margin-bottom: .6rem;
}

.be-disc-topo {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 600;
}

.be-disc-data { color: var(--be-tinta-3); font-weight: 400; font-size: .9rem; white-space: nowrap; }

.be-disc p { margin: .35rem 0 0; white-space: pre-line; }

.be-disc-editar {
    background: none;
    border: 0;
    padding: 0;
    margin-top: .4rem;
    font: inherit;
    font-size: .9rem;
    color: #2F6FDE;
    cursor: pointer;
}

.be-vazio { color: var(--be-tinta-3); margin: 0; }

.be-form-disc {
    border: 1px solid var(--be-linha);
    border-radius: var(--be-raio);
    padding: 1rem;
    margin-top: 1rem;
    background: var(--be-papel);
}

    .be-form-disc .form-label { font-weight: 600; font-size: .92rem; }
    .be-form-disc textarea { min-height: 110px; }

.be-form-acoes { display: flex; gap: .5rem; margin-top: .9rem; }

.be-ok {
    color: var(--be-verde);
    font-weight: 600;
    margin: .5rem 0 0;
}

/* ---------- Ecrãs estreitos ---------- */
@media (max-width: 900px) {
    .be-grelha { grid-template-columns: minmax(0, 1fr); gap: 1rem; }

    .be-cronologia {
        position: static;
        display: flex;
        gap: .5rem;
        overflow-x: auto;
        padding-bottom: .25rem;
    }

        .be-cronologia::before { display: none; }

    .be-decl { min-width: 210px; padding-left: .75rem; border-color: var(--be-linha); background: var(--be-superficie); }
        .be-decl::before { display: none; }
        .be-decl.be-vigente { border-top: 3px solid var(--be-verde); }

    .be-procura { padding-top: 1.5rem; }
    .be-procura-titulo { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .be-procura { transition: none; }
}

/* =====================================================================
   Entrar, criar conta, recuperar palavra-passe (_AuthLayout)
   ===================================================================== */
.be-auth-corpo { background: var(--be-papel); }

.be-auth {
    display: grid;
    grid-template-columns: minmax(380px, 46%) minmax(0, 1fr);
    min-height: 100vh;
}

.be-auth-identidade {
    background: var(--be-tinta);
    color: #fff;
    padding: 2.5rem 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.be-auth-marca { margin-right: 0; }
.be-auth-marca .be-marca-org { max-width: 34ch; white-space: normal; }

.be-auth-mensagem { margin-top: auto; }

.be-auth-titulo {
    font-size: clamp(1.9rem, 2.6vw, 2.6rem);
    font-weight: 600;
    line-height: 1.15;
    max-width: 17ch;
    margin: 0 0 1rem;
    letter-spacing: -.01em;
}

.be-auth-texto {
    color: #C9D0DD;
    font-size: 1.05rem;
    line-height: 1.55;
    max-width: 46ch;
    margin: 0;
}

/* Desenho da estrutura de controlo */
.be-auth-estrutura { width: 100%; max-width: 440px; height: auto; margin-bottom: auto; }

.be-est-linhas path {
    fill: none;
    stroke: #6F7FA3;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-dasharray: 400;
    stroke-dashoffset: 0;
    animation: be-desenhar 1.6s ease-out .2s both;
}

.be-est-entidade { fill: none; stroke: #C9D2E3; stroke-width: 1.5; }
.be-est-holding { fill: none; stroke: #8C99B8; stroke-width: 1.5; stroke-dasharray: 4 3; }
.be-est-be { fill: #3FB37F; }
.be-est-indirecto { fill: none; stroke: #3FB37F; stroke-width: 2; }

.be-est-rotulo-claro, .be-est-rotulo { font: 600 13px var(--be-fonte); fill: #E3E7EF; }
.be-est-rotulo { fill: #C9D0DD; font-weight: 500; }
.be-est-pct { font: 600 13px var(--be-fonte); fill: #E3E7EF; font-variant-numeric: tabular-nums; }
.be-est-nota { font: 400 12px var(--be-fonte); fill: #AEB6C8; }

@keyframes be-desenhar {
    from { stroke-dashoffset: 400; }
    to { stroke-dashoffset: 0; }
}

.be-auth-rodape { color: #AEB6C8; font-size: .85rem; margin: 0; }
.be-auth-rodape a { color: #E3E7EF; }

/* Painel do formulário */
.be-auth-painel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.be-auth-caixa { width: 100%; max-width: 440px; }

.be-auth-form-titulo {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 .35rem;
}

.be-auth-form-sub {
    color: var(--be-tinta-2);
    margin: 0 0 1.75rem;
    line-height: 1.5;
}

.be-campo { margin-bottom: 1.1rem; }

.be-campos-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.be-rotulo {
    display: block;
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: .35rem;
    color: var(--be-tinta);
}

.be-rotulo-linha {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.be-ligacao-peq { font-size: .9rem; }

.be-input {
    display: block;
    width: 100%;
    font: inherit;
    font-size: 1rem;
    padding: .65rem .85rem;
    border: 1px solid var(--be-linha-forte);
    border-radius: var(--be-raio);
    background: var(--be-superficie);
    color: var(--be-tinta);
}

    .be-input:focus {
        outline: none;
        border-color: var(--be-tinta);
        box-shadow: 0 0 0 3px rgba(31, 42, 68, .12);
    }

    .be-input.input-validation-error { border-color: var(--be-vermelho); }

.be-senha { position: relative; }
.be-senha .be-input { padding-right: 2.75rem; }

.be-ver-senha {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2.75rem;
    background: none;
    border: 0;
    color: var(--be-tinta-3);
    border-radius: 0 var(--be-raio) var(--be-raio) 0;
}

    .be-ver-senha:hover { color: var(--be-tinta); }

.be-erro { display: block; color: var(--be-vermelho); font-size: .88rem; margin-top: .3rem; }
.be-erro ul { margin: 0; padding-left: 1.1rem; }
.be-erro:empty, .field-validation-valid, .validation-summary-valid { display: none; }

.be-verificar {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: .25rem 0 1.4rem;
    color: var(--be-tinta-2);
    cursor: pointer;
}

    .be-verificar input { width: 1.05rem; height: 1.05rem; accent-color: var(--be-tinta); }

.be-botao-largo { width: 100%; padding: .75rem 1rem; font-size: 1.02rem; }

.be-ajuda { color: var(--be-tinta-3); font-size: .88rem; margin: -.4rem 0 1.25rem; }

.be-auth-alternativa {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--be-linha);
    color: var(--be-tinta-2);
}

.be-auth-alerta {
    border-radius: var(--be-raio);
    padding: .7rem .9rem;
    margin-bottom: 1.25rem;
    font-size: .95rem;
}

    .be-auth-alerta ul { margin: 0; padding-left: 1rem; }
    .be-auth-alerta-ok { background: var(--be-verde-fundo); color: #14583A; }
    .be-auth-alerta-erro { background: var(--be-vermelho-fundo); color: #8C1D13; }

/* Painel com fotografia (wwwroot/images/login.*): a tinta escurece a imagem
   por baixo do texto para manter a leitura, e deixa-a respirar no meio. */
.be-auth-com-foto {
    background-color: var(--be-tinta);
    background-image:
        linear-gradient(180deg, rgba(31, 42, 68, .92) 0%, rgba(31, 42, 68, .55) 22%, rgba(31, 42, 68, .35) 45%, rgba(31, 42, 68, .82) 72%, rgba(31, 42, 68, .96) 100%),
        var(--be-foto);
    background-size: cover;
    background-position: center;
}

    .be-auth-com-foto .be-auth-mensagem { margin-top: auto; }
    .be-auth-com-foto .be-auth-titulo { text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
    .be-auth-com-foto .be-auth-texto { color: #E3E7EF; }

.be-auth-credito { display: block; margin-top: .25rem; font-size: .78rem; color: #AEB6C8; }

@media (max-width: 900px) {
    .be-auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .be-auth-com-foto {
        background-image:
            linear-gradient(180deg, rgba(31, 42, 68, .85), rgba(31, 42, 68, .9)),
            var(--be-foto);
    }
    .be-auth-identidade { padding: 1.25rem 1.25rem 1.5rem; gap: 1rem; }
    .be-auth-estrutura, .be-auth-texto, .be-auth-rodape { display: none; }
    .be-auth-mensagem { margin-top: .25rem; }
    .be-auth-titulo { font-size: 1.35rem; margin: 0; max-width: none; }
    .be-auth-painel { align-items: flex-start; padding: 2rem 1.25rem; }
    .be-campos-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .be-est-linhas path { animation: none; }
}

/* =====================================================================
   Termos de utilização e privacidade
   ===================================================================== */
.be-doc-pagina {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

.be-doc-cab {
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--be-linha);
}

    .be-doc-cab h1 {
        font-size: clamp(1.7rem, 2.4vw, 2.2rem);
        font-weight: 600;
        margin: 0 0 .6rem;
    }

.be-doc-voltar { display: inline-block; margin-bottom: 1rem; }

.be-doc-intro {
    font-size: 1.1rem;
    color: var(--be-tinta-2);
    max-width: 62ch;
    margin: 0;
    line-height: 1.55;
}

.be-doc-grelha {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
}

.be-doc-indice { position: sticky; top: 1.5rem; }

.be-doc-indice-titulo {
    font-weight: 600;
    color: var(--be-tinta-3);
    font-size: .9rem;
    margin: 0 0 .5rem;
}

.be-doc-indice ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--be-linha);
}

.be-doc-indice a {
    display: block;
    padding: .3rem 0 .3rem .9rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--be-tinta-2);
    text-decoration: none;
}

    .be-doc-indice a:hover { color: var(--be-tinta); border-left-color: var(--be-tinta-3); }
    .be-doc-indice a.be-actual { color: var(--be-tinta); font-weight: 600; border-left-color: var(--be-verde); }

.be-doc-texto {
    max-width: 68ch;
    font-size: 1.05rem;
    line-height: 1.65;
}

    .be-doc-texto section { scroll-margin-top: 1.5rem; }
    .be-doc-texto section + section { margin-top: 2.25rem; }

    .be-doc-texto h2 {
        font-size: 1.3rem;
        font-weight: 600;
        margin: 0 0 .6rem;
    }

    .be-doc-texto p { margin: 0 0 .8rem; }
    .be-doc-texto ul { padding-left: 1.2rem; margin: 0 0 .8rem; }
    .be-doc-texto li + li { margin-top: .35rem; }

.be-doc-lista { margin: 0 0 1rem; }

    .be-doc-lista div {
        display: grid;
        grid-template-columns: 11rem minmax(0, 1fr);
        gap: 1rem;
        padding: .7rem 0;
        border-top: 1px solid var(--be-linha);
    }

    .be-doc-lista div:last-child { border-bottom: 1px solid var(--be-linha); }
    .be-doc-lista dt { font-weight: 600; }
    .be-doc-lista dd { margin: 0; color: var(--be-tinta-2); }

@media (max-width: 800px) {
    .be-doc-grelha { grid-template-columns: 1fr; gap: 1.5rem; }
    .be-doc-indice { position: static; }
    .be-doc-lista div { grid-template-columns: 1fr; gap: .2rem; }
}

/* =====================================================================
   Mapa NPO
   Escala ordinal de risco (um só tom, validada): baixo → médio → alto
   ===================================================================== */
:root {
    --be-risco-baixo: #E8957F;
    --be-risco-medio: #C4513A;
    --be-risco-alto: #8A1E12;
    --be-r8: #1F2A44;
    --be-fora-r8: #C5CCD8;
}

.be-npo {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.be-npo-cab {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

    .be-npo-cab h1 {
        font-size: clamp(1.6rem, 2.3vw, 2.05rem);
        font-weight: 600;
        margin: 0 0 .4rem;
        line-height: 1.2;
    }

    .be-npo-cab p { color: var(--be-tinta-2); margin: 0; max-width: 64ch; line-height: 1.5; }
    .be-npo-cab .be-botao { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }

/* Resumo: número de destaque, divisão R8 e níveis */
.be-npo-resumo {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 2.5rem;
    align-items: center;
    background: var(--be-superficie);
    border: 1px solid var(--be-linha);
    border-radius: var(--be-raio);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

.be-npo-total { display: flex; flex-direction: column; }

.be-npo-numero {
    font-size: 3.4rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.be-npo-numero-rotulo { color: var(--be-tinta-2); margin-top: .35rem; }

.be-npo-divisao-rotulos {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .55rem;
    color: var(--be-tinta-2);
}

    .be-npo-divisao-rotulos strong { color: var(--be-tinta); font-variant-numeric: tabular-nums; margin-right: .2rem; }

.be-npo-pct { color: var(--be-tinta-3); font-variant-numeric: tabular-nums; margin-left: .2rem; }

.be-barra-100 {
    display: flex;
    gap: 2px;
    height: 14px;
}

    .be-barra-100 span:first-child { border-radius: 4px 0 0 4px; }
    .be-barra-100 span:last-child { border-radius: 0 4px 4px 0; }
    .be-seg-r8 { background: var(--be-r8); }
    .be-seg-fora { background: var(--be-fora-r8); }

.be-amostra {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: 2px;
    margin-right: .45rem;
    vertical-align: -1px;
}

.be-amostra-r8 { background: var(--be-r8); }
.be-amostra-fora { background: var(--be-fora-r8); }
.be-risco-baixo { background: var(--be-risco-baixo); }
.be-risco-medio { background: var(--be-risco-medio); }
.be-risco-alto { background: var(--be-risco-alto); }

.be-npo-niveis {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding-left: 2rem;
    border-left: 1px solid var(--be-linha);
}

    .be-npo-niveis div { display: flex; justify-content: space-between; gap: 1.5rem; }
    .be-npo-niveis dt { font-weight: 400; color: var(--be-tinta-2); white-space: nowrap; }
    .be-npo-niveis dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Barras por tipo */
.be-npo-tipos { padding: 1.4rem 1.75rem 1.6rem; }

.be-npo-tipos-cab {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}

    .be-npo-tipos-cab h2 { font-size: 1.2rem; font-weight: 600; margin: 0 0 .25rem; }
    .be-npo-tipos-cab p { color: var(--be-tinta-3); margin: 0; font-size: .92rem; }

.be-npo-controlos { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }

.be-legenda {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--be-tinta-2);
    font-size: .92rem;
}

.be-npo-grafico { display: flex; flex-direction: column; gap: .9rem; }

.be-npo-linha {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 6.5rem;
    gap: 1rem;
    align-items: center;
}

.be-npo-tipo { font-weight: 600; line-height: 1.25; }

.be-npo-pista { min-width: 0; }

.be-npo-barra {
    display: flex;
    gap: 2px;
    height: 30px;
    min-width: 6px;
}

.be-npo-seg {
    position: relative;
    flex-basis: 0;
    min-width: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    outline-offset: 1px;
}

    .be-npo-seg:first-child { border-radius: 4px 0 0 4px; }
    .be-npo-seg:last-child { border-radius: 0 4px 4px 0; }
    .be-npo-seg:only-child { border-radius: 4px; }
    .be-npo-seg:hover { filter: brightness(1.08); }

.be-npo-seg-n {
    font-size: .85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
}

.be-risco-baixo .be-npo-seg-n { color: var(--be-tinta); }

.be-npo-zero { color: var(--be-tinta-3); font-size: .9rem; }

.be-npo-soma {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.be-npo-soma-de { display: block; font-weight: 400; font-size: .82rem; color: var(--be-tinta-3); }

.be-npo-tab th[scope="row"] { font-weight: 600; color: var(--be-tinta); font-size: .95rem; }
.be-npo-tab tfoot th, .be-npo-tab tfoot td { border-top: 1px solid var(--be-linha-forte); font-weight: 700; }

/* Dica (tooltip) */
.be-dica {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    background: var(--be-tinta);
    color: #fff;
    border-radius: var(--be-raio);
    padding: .45rem .65rem;
    font-size: .88rem;
    line-height: 1.35;
    box-shadow: 0 6px 18px rgba(31, 42, 68, .25);
    display: flex;
    flex-direction: column;
    max-width: 280px;
}

    .be-dica[hidden] { display: none; }

@media (max-width: 900px) {
    .be-npo-resumo { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem; }
    .be-npo-niveis { padding-left: 0; border-left: 0; border-top: 1px solid var(--be-linha); padding-top: 1rem; }
    .be-npo-tipos { padding: 1.1rem 1.1rem 1.25rem; }
    .be-npo-linha { grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .75rem; }
    .be-npo-tipo { grid-column: 1 / -1; }
    .be-npo-numero { font-size: 2.8rem; }
}
