/* =====================================================================
   Controle de Documentos – tema sobre o SB Admin 2 (Bootstrap 4)
   Cores da Enertop: azul #014AE7 / azul-escuro #06245C
   ===================================================================== */
:root {
    --primary: #014ae7;
    --primary-escuro: #06245c;
    --primary-hover: #013bb8;
    --primary-suave: rgba(1, 74, 231, .25);
}

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }
body { font-family: "Nunito", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
h1:focus { outline: none; }

#wrapper { min-height: 100vh; }
#content-wrapper { background-color: #f8f9fc; min-width: 0; }

/* ---------- cor primária ---------- */
.text-primary { color: var(--primary) !important; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
.bg-gradient-primary {
    background-color: var(--primary-escuro) !important;
    background-image: linear-gradient(180deg, #0b3fae 0%, var(--primary-escuro) 100%) !important;
}
.btn-primary { background-color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background-color: var(--primary-hover) !important; border-color: var(--primary-hover) !important; }
.btn-outline-primary { color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-outline-primary:hover, .btn-outline-primary:active { color: #fff !important; background-color: var(--primary) !important; }
.btn:focus, .form-control:focus, .custom-select:focus { box-shadow: 0 0 0 .2rem var(--primary-suave) !important; }
.form-control:focus, .custom-select:focus { border-color: var(--primary) !important; }
.border-left-primary { border-left: .25rem solid var(--primary) !important; }
.badge-primary { background-color: var(--primary); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.page-item.active .page-link { background-color: var(--primary); border-color: var(--primary); }
.card-header .text-primary, .card-header h6 { color: var(--primary) !important; }

/* ---------- sidebar ---------- */
.sidebar .sidebar-brand { height: 5.2rem; }
.sidebar .sidebar-brand .sidebar-brand-icon i { font-size: 1.9rem; }
.sidebar .sidebar-brand-text { font-size: .82rem; line-height: 1.15; text-align: left; letter-spacing: .04em; }
.sidebar .nav-item.active .nav-link { background: rgba(255, 255, 255, .10); border-radius: .35rem; margin: 0 .5rem; width: calc(100% - 1rem); }
.sidebar.toggled .nav-item.active .nav-link { margin: 0; width: 100%; }
.sidebar-dev { text-align: center; padding: .25rem 1rem 1rem; }
.sidebar-dev span { display: block; color: rgba(255, 255, 255, .55); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem; }
.sidebar-dev img { max-width: 150px; width: 100%; opacity: .92; }
.sidebar.toggled .sidebar-dev { display: none !important; }

/* ---------- topbar ---------- */
.topbar { height: 4.6rem; }
.seletor-projeto { display: flex; align-items: center; min-width: 0; }
.seletor-projeto select { min-width: 220px; max-width: 360px; font-weight: 700; color: #3a3b45; border-color: #d1d3e2; }
.logo-cliente { display: flex; align-items: center; padding: 0 .6rem; }
.logo-cliente img { max-height: 46px; max-width: 170px; object-fit: contain; }
@media (max-width: 575px) { .logo-cliente img { max-height: 32px; max-width: 90px; } .seletor-projeto select { min-width: 140px; } }

/* ---------- rodapé ---------- */
.sticky-footer { padding: 1.1rem 0; }
.rodape { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.rodape-dev { display: flex; align-items: center; }
.rodape-dev img { height: 30px; }

/* ---------- títulos de página ---------- */
.cabecalho-pagina { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.cabecalho-pagina h1 { font-size: 1.6rem; margin: 0; color: #3a3b45; font-weight: 700; }
.cabecalho-pagina h1 i { color: var(--primary); margin-right: .5rem; }
.cabecalho-pagina .sub { color: #858796; font-size: .9rem; margin-top: .15rem; }
.acoes { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- cards de indicador ---------- */
.kpi-link { text-decoration: none !important; }
.kpi-link .card { transition: transform .12s ease, box-shadow .12s ease; }
.kpi-link:hover .card { transform: translateY(-2px); box-shadow: 0 .5rem 1.5rem rgba(58, 59, 69, .2) !important; }
.border-left-danger2 { border-left: .25rem solid #9c0006 !important; }
.border-left-aguardando { border-left: .25rem solid #1f3864 !important; }
.border-left-avaliacao { border-left: .25rem solid #bf9000 !important; }
.border-left-emitir { border-left: .25rem solid #c55a11 !important; }

/* ---------- tabelas ---------- */
.tabela-docs { font-size: .82rem; margin-bottom: 0; }
.tabela-docs thead th {
    position: sticky; top: 0; z-index: 2;
    background: #f1f3f9; color: #4e5267; border-bottom: 2px solid #d1d3e2 !important;
    font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em;
    white-space: nowrap; cursor: pointer; user-select: none; vertical-align: middle;
}
.tabela-docs thead th.sem-ordem { cursor: default; }
.tabela-docs td { vertical-align: middle; border-color: #eaecf4; }
.tabela-docs tbody tr:hover td { background: #f5f8ff; }
.tabela-docs tr.mudou td { background: #fff8d6; }
.tabela-docs tr.mudou td:first-child { box-shadow: inset 3px 0 0 #f6c23e; }
.tabela-docs .cod { font-weight: 700; white-space: nowrap; }
.tabela-docs .num { text-align: right; white-space: nowrap; }
.tabela-docs .nowrap { white-space: nowrap; }
.tabela-docs .desc { min-width: 220px; }
.tabela-rolagem { max-height: calc(100vh - 330px); overflow: auto; }
.grupo-linha td { background: #e8eefc !important; color: var(--primary-escuro); font-weight: 800; font-size: .78rem; }
.grupo-linha .grupo-info { font-weight: 600; color: #5a5c69; margin-left: .75rem; }
.contador { font-size: .8rem; color: #858796; }
.seta { font-size: .65rem; margin-left: .25rem; color: var(--primary); }

/* ---------- etiquetas de situação (cores da planilha) ---------- */
.badge-sit, .badge-pri { display: inline-block; padding: .3em .65em; border-radius: 1rem; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.sit-emitir { background: #fde9d0; color: #7a4a00; }
.sit-avaliacao { background: #fff2cc; color: #7f6000; }
.sit-aguardando { background: #ddebf7; color: #1f3864; }
.sit-revisar { background: #ffc7ce; color: #9c0006; }
.sit-comentarios { background: #ffe699; color: #833c00; }
.sit-aprovado { background: #c6efce; color: #006100; }
.sit-neutro { background: #eaecf4; color: #5a5c69; }
.pri-atrasado { background: #c00000; color: #fff; }
.pri-atencao { background: #ffe699; color: #7f6000; }
.pri-concluido { background: #c6efce; color: #006100; }
.pri-normal { background: #eaecf4; color: #5a5c69; }
.dias-neg { color: #c00000; font-weight: 800; }

/* ---------- matriz do painel ---------- */
.matriz th { text-align: center; }
.matriz th:first-child, .matriz td:first-child { text-align: left; }
.matriz td a { display: block; text-align: center; font-weight: 700; text-decoration: none; border-radius: .3rem; }
.matriz td a:hover { background: #e8eefc; }
.matriz td.zero a { color: #c7c9d6; font-weight: 400; }

/* ---------- formulários ---------- */
label { font-weight: 600; color: #5a5c69; font-size: .82rem; margin-bottom: .25rem; }
.form-check-label { font-weight: 400; color: #3a3b45; font-size: .88rem; }
.filtros .form-group { margin-bottom: .6rem; }
.dica { font-size: .78rem; color: #858796; }

/* ---------- logos (cadastro) ---------- */
.caixa-logo { border: 1px dashed #d1d3e2; border-radius: .5rem; background: #fff; height: 110px; display: flex; align-items: center; justify-content: center; padding: .75rem; }
.caixa-logo img { max-height: 86px; max-width: 100%; object-fit: contain; }
.caixa-logo .vazio { color: #b7b9cc; font-size: .85rem; text-align: center; }
.logo-mini { max-height: 28px; max-width: 90px; object-fit: contain; }

/* ---------- linha do tempo ---------- */
.timeline { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.tl-col { min-width: 280px; max-width: 300px; flex-shrink: 0; }
.tl-cab { background: linear-gradient(135deg, #0b3fae, var(--primary-escuro)); color: #fff; border-radius: .5rem; padding: .6rem .8rem; margin-bottom: .6rem; box-shadow: 0 .15rem .5rem rgba(6, 36, 92, .25); }
.tl-cab .rev { font-size: 1.25rem; font-weight: 800; }
.tl-card { border: 1px solid #e3e6f0; border-left: 4px solid #b7b9cc; border-radius: .45rem; padding: .55rem .7rem; margin-bottom: .55rem; font-size: .8rem; background: #fff; box-shadow: 0 .1rem .3rem rgba(58, 59, 69, .08); }
.tl-card .acao { font-weight: 800; font-size: .84rem; }
.tl-card .meta { color: #858796; font-size: .75rem; }
.tl-card .com { margin-top: .35rem; white-space: pre-wrap; color: #3a3b45; }
.ev-reprovado { border-left-color: #e74a3b; background: #fff5f5; }
.ev-comentarios { border-left-color: #f6c23e; background: #fffbea; }
.ev-aprovado { border-left-color: #1cc88a; background: #f2fcf7; }
.ev-envio { border-left-color: var(--primary); background: #f3f7ff; }

/* ---------- log da sincronização ---------- */
.log { background: #0f172a; color: #c7f9e0; font-family: Consolas, "Courier New", monospace; font-size: .78rem; padding: .85rem 1rem; border-radius: .5rem; max-height: 380px; overflow: auto; white-space: pre-wrap; }

/* ---------- caixa de upload ---------- */
.upload { border: 2px dashed #d1d3e2; border-radius: .6rem; padding: 1.25rem; background: #fbfcff; text-align: center; }
.upload i { font-size: 2rem; color: #1cc88a; }

#blazor-error-ui { background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ajustes finos */
.matriz td:first-child a { text-align: left; padding-left: .25rem; }
.matriz thead th .badge-sit { font-size: .66rem; }
.progress-bar.sit-emitir { background: #f4b183; }
.progress-bar.sit-avaliacao { background: #ffd966; }
.progress-bar.sit-aguardando { background: #5b8bd6; }
.progress-bar.sit-revisar { background: #e74a3b; }
.progress-bar.sit-comentarios { background: #f6c23e; }
.progress-bar.sit-aprovado { background: #1cc88a; }
.progress-bar.sit-neutro { background: #b7b9cc; }
.sidebar .nav-item .nav-link { padding-top: .75rem; padding-bottom: .75rem; }

/* ---------- login ---------- */
.login-fundo {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
    background: linear-gradient(135deg, #0b3fae 0%, var(--primary-escuro) 100%);
}
.login-card { width: 440px; max-width: 100%; border: 0; border-radius: .9rem; }
.login-card .card-body { padding: 2.3rem 2.4rem; }
.login-logo { width: 230px; max-width: 80%; margin-bottom: 1rem; }
.login-titulo { font-size: 1.35rem; font-weight: 800; color: #3a3b45; }
.login-card .form-control { height: 46px; }
.login-card .input-group-text { background: var(--primary); border-color: var(--primary); color: #fff; width: 46px; justify-content: center; }
.btn-login { height: 46px; font-weight: 700; border-radius: .5rem; }

/* ---------- usuário na barra superior ---------- */
.usuario-menu { position: relative; }
.usuario-menu .dropdown-menu { display: block; right: 0; left: auto; min-width: 230px; }
.usuario-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; }
.usuario-avatar { overflow: hidden; }
.usuario-avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.usuario-avatar:has(img) { background: #fff; box-shadow: 0 0 0 1px #e3e6f0; }
.usuario-avatar-grande { width: 96px; height: 96px; font-size: 2rem; }
.badge-papel { font-size: .68rem; font-weight: 700; padding: .25em .6em; border-radius: 1rem; background: #e8eefc; color: var(--primary-escuro); }
.badge-papel.admin { background: #fde2e1; color: #9c0006; }

/* ---------- comentários do cliente ---------- */
.comentario-icone { color: #f6c23e; cursor: pointer; font-size: 1rem; }
.comentario-icone:hover { color: #dda20a; }
.cd-balao { position: fixed; z-index: 2000; max-width: min(420px, calc(100vw - 16px)); background: #fffbea; color: #3a3b45;
            border: 1px solid #f6c23e; border-radius: .45rem; font-size: .85rem; box-shadow: 0 .4rem 1rem rgba(58, 59, 69, .2); }
.cd-balao-txt { max-height: 50vh; overflow-y: auto; padding: .6rem .75rem; white-space: pre-wrap; }
.cd-balao::before { content: ""; position: absolute; top: -7px; left: calc(var(--seta, 20px) - 7px); border: 7px solid transparent;
                    border-top: 0; border-bottom-color: #f6c23e; }
.cd-balao.acima::before { top: auto; bottom: -7px; border-bottom: 0; border-top: 7px solid #f6c23e; }
.comentario-texto { background: #fffbea; border-left: 3px solid #f6c23e; padding: .6rem .75rem; border-radius: .35rem; font-size: .85rem; white-space: pre-wrap; }

/* ---------- painel: barra geral e matriz sem rolagem ---------- */
.barra-geral { height: 1.1rem; border-radius: .5rem; }
.matriz-larga { table-layout: fixed; width: 100%; }
.matriz-larga th { white-space: normal !important; vertical-align: bottom !important; }
.matriz-larga th:first-child, .matriz-larga td:first-child { width: 20%; }
.matriz-larga th .badge-sit { white-space: normal; line-height: 1.2; display: inline-block; }
.matriz-larga td:first-child a { white-space: normal; }
.matriz .linha-total td { background: #f1f3f9; font-weight: 800; color: #3a3b45; border-top: 2px solid #d1d3e2; }

/* ---------- Alterações: resumo por subestação cabe na tela (sem rolagem horizontal) ---------- */
.resumo-alteracoes { table-layout: fixed; width: 100%; font-size: .78rem; }
.resumo-alteracoes th, .resumo-alteracoes td { white-space: normal !important; padding: .3rem .25rem !important; word-break: break-word; }
.resumo-alteracoes th:first-child, .resumo-alteracoes td:first-child { width: 15%; text-align: left; }
.resumo-alteracoes thead th { vertical-align: bottom !important; }
.resumo-alteracoes th .badge-sit { white-space: normal; display: inline-block; line-height: 1.15; font-size: .64rem; padding: .2rem .35rem; letter-spacing: 0; }

/* caixinha marcar/desmarcar todas */
.marcar-todos { display:inline-flex; align-items:center; gap:.35rem; cursor:pointer; font-size:.85rem; font-weight:600;
  color:#4e73df; background:#eef2ff; border:1px solid #c9d4fb; border-radius:.35rem; padding:.15rem .55rem; user-select:none; }
.marcar-todos input { width:1rem; height:1rem; cursor:pointer; margin:0; }
.marcar-todos:hover { background:#e1e8ff; }

/* sino de avisos */
.sino-notificacoes { position: relative; list-style: none; }
.sino-notificacoes .nav-link { position: relative; color: #b7b9cc; padding: .5rem .6rem; }
.sino-notificacoes .nav-link:hover { color: #858796; }
.sino-icone { position: relative; display: inline-block; line-height: 1; }
.sino-contador { position: absolute; top: -.55rem; right: -.75rem; font-size: .6rem; line-height: 1; padding: .2em .4em; border-radius: .6rem; transform: none; margin: 0; }
.sino-lista { position: absolute; right: 0; left: auto; top: 100%; width: 24rem; max-width: 92vw; max-height: 70vh; overflow-y: auto; padding: 0; }
.sino-lista .dropdown-header { background: #4e73df; color: #fff; padding: .6rem 1rem; font-size: .8rem; text-transform: uppercase; }
.sino-lista .dropdown-item { white-space: normal; border-bottom: 1px solid #eaecf4; padding: .55rem 1rem; }
.sino-nao-lida { background: #f3f6ff; }
.sino-texto { white-space: pre-line; max-height: 4.6em; overflow: hidden; }

/* tramitação */
.portal-tabs .badge { font-size: .7rem; }
.portal-arquivo { display: inline-flex; align-items: center; gap: .25rem; margin: 0 .35rem .25rem 0; font-size: .8rem; }
.portal-analise textarea { min-height: 90px; }
.parecer-opcao { border: 1px solid #d1d3e2; border-radius: .35rem; padding: .5rem .75rem; cursor: pointer; flex: 1 1 180px; }
.parecer-opcao.ativo { border-color: #4e73df; background: #eef2ff; font-weight: 600; }
.sit-revisao-interna { background: #e8e0f8; color: #4b2a8a; }

/* fluxo de emissão (blocos) */
.fluxo-modelo { border: 1px solid #d1d3e2; background: #fff; border-radius: .5rem; padding: .5rem .75rem; text-align: left; flex: 1 1 200px; color: #5a5c69; }
.fluxo-modelo:hover:not(:disabled) { border-color: #4e73df; }
.fluxo-modelo.ativo { border: 2px solid #4e73df; background: #eef2ff; color: #2e59d9; }
.fluxo-diagrama { display: flex; align-items: stretch; flex-wrap: wrap; gap: .4rem; }
.fluxo-bloco { flex: 1 1 140px; min-width: 140px; border-radius: .6rem; padding: .7rem .6rem; text-align: center; border: 2px solid; position: relative; background: #fff; transition: opacity .2s; }
.fluxo-bloco.enertop { border-color: #4e73df; }
.fluxo-bloco.intermediario { border-color: #f6c23e; }
.fluxo-bloco.final { border-color: #1cc88a; }
.fluxo-bloco.off { opacity: .45; border-style: dashed; }
.fluxo-icone { font-size: 1.4rem; color: #5a5c69; }
.fluxo-nome { font-weight: 700; color: #3a3b45; }
.fluxo-org { font-size: .72rem; color: #858796; text-transform: uppercase; letter-spacing: .03em; }
.fluxo-tag { display: inline-block; margin-top: .35rem; font-size: .7rem; font-weight: 600; border-radius: 1rem; padding: .1rem .5rem; }
.fluxo-tag.posta { background: #4e73df; color: #fff; }
.fluxo-tag.semkc { background: #eaecf4; color: #858796; }
.fluxo-tag.kc { background: #1cc88a; color: #fff; }
.fluxo-tag.sistema { background: #f6c23e; color: #fff; }
.fluxo-chave { display: flex; align-items: center; justify-content: center; gap: .3rem; margin: .35rem 0 0; font-size: .8rem; cursor: pointer; }
.fluxo-seta { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #4e73df; min-width: 70px; }
.fluxo-seta span { font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.fluxo-seta i { font-size: 1.5rem; }
.fluxo-seta.off { color: #d1d3e2; }
.fluxo-passos li { margin-bottom: .2rem; }
@media (max-width: 991px) { .fluxo-seta { min-width: 100%; flex-direction: row; gap: .5rem; } .fluxo-seta i { transform: rotate(90deg); } }
.progress-bar.sit-revisao-interna { background: #a98be0; }

/* requisitos da senha (marcados enquanto digita) */
.regras-senha { list-style: none; padding: 0; margin: .25rem 0 .5rem; font-size: .8rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .1rem .75rem; }
.regras-senha li { color: #858796; }
.regras-senha li i { width: 1.1rem; font-size: .75rem; margin-right: .2rem; }
.regras-senha li.pendente i { color: #d1d3e2; font-size: .5rem; vertical-align: middle; }
.regras-senha li.ok { color: #13855c; }
.regras-senha li.ok i { color: #1cc88a; }
.regras-senha li.falta { color: #be2617; }
.regras-senha li.falta i { color: #e74a3b; }
