/* =====================================================================
   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; }
/* cabeçalho em duas linhas (ex.: "Prazo" sobre WEG / CPFL / Acordado): o cabeçalho inteiro fica fixo ao rolar */
.tabela-docs thead.cab-duplo { position: sticky; top: 0; z-index: 2; }
.tabela-docs thead.cab-duplo th { position: static; }
.tabela-docs thead th.cab-grupo { border-bottom: 1px solid #d1d3e2 !important; padding-top: .3rem; padding-bottom: .15rem; }
.tabela-docs thead th.cab-sub { padding-top: .15rem; font-size: .68rem; text-align: center; }
/* datas dos prazos centralizadas com o título (no computador; no celular segue o cartão) */
@media (min-width: 768px) { .tabela-docs td.col-prazo { text-align: center; } }
.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; }
/* data alterada à mão (a sincronização não muda): sublinhada em laranja */
.data-manual { text-decoration: underline dotted #e67e22; text-decoration-thickness: 2px; text-underline-offset: 3px; }
input.data-manual { border-color: #e67e22; text-decoration: none; }
.data-manual .fa-pen { color: #e67e22; }
.texto-manual { color: #a0560f; }
.texto-manual .fa-pen { color: #e67e22; }

/* ---------- 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; }

/* ---------- Emissão: colunas alinhadas entre as tabelas das subestações ---------- */
.tabela-emissao { table-layout: fixed; width: 100%; min-width: 960px; }
.tabela-emissao col.c-marca { width: 38px; }
.tabela-emissao col.c-cod { width: 215px; }
.tabela-emissao col.c-rev { width: 56px; }
.tabela-emissao col.c-sit { width: 160px; }
.tabela-emissao col.c-arq { width: 24%; }
.tabela-emissao col.c-envio { width: 290px; }
.tabela-emissao td { overflow-wrap: anywhere; }
.tabela-emissao td.cod { white-space: normal; }
.tabela-emissao .c-arquivos .badge { white-space: normal; text-align: left; max-width: 100%; }
.tabela-emissao .c-envio-td .btn { margin-bottom: .2rem; white-space: normal; }

/* ---------- Painel / indicadores ---------- */
.legenda-andamento { min-width: 0; }
.se-cartao { border: 1px solid #e3e6f0; border-radius: .45rem; padding: .55rem .65rem; margin-bottom: .5rem; background: #fff; }
.se-cartao .badge-sit { white-space: normal; }
.historico-sol { list-style: disc; }

/* ---------- tablet ---------- */
@media (max-width: 1199px) {
    .matriz-larga th .badge-sit { font-size: .62rem; padding: .2em .4em; letter-spacing: 0; }
    .matriz-larga th, .matriz-larga td { padding-left: .2rem; padding-right: .2rem; }
}

/* ---------- celular ---------- */
@media (max-width: 767px) {
    #content > .container-fluid, .container-fluid { padding-left: .6rem; padding-right: .6rem; }
    .topbar { height: auto; min-height: 3.6rem; }
    .seletor-projeto select { min-width: 0; max-width: 46vw; font-size: .85rem; }
    .cabecalho-pagina { margin-bottom: .85rem; }
    .cabecalho-pagina h1 { font-size: 1.2rem; }
    .cabecalho-pagina .sub { font-size: .8rem; }
    .cabecalho-pagina > div:first-child { min-width: 0; }
    .acoes { width: 100%; }
    .acoes .btn { flex: 1 1 auto; }
    .acoes .btn-icon-split .text { padding: .375rem .55rem; }
    .card-header { padding: .6rem .75rem !important; }
    .card-header.d-flex { flex-wrap: wrap; gap: .35rem; }
    .card-body { padding: .85rem; }
    .tabela-docs { font-size: .78rem; }
    .tabela-rolagem { max-height: none; }
    .kpi-compacto .card-body { padding: .6rem .7rem; }
    .kpi-compacto .h4 { font-size: 1.2rem; }
    .kpi-compacto .text-xs { font-size: .62rem; line-height: 1.2; }
    .kpi-compacto .col-auto { display: none; }
    .kpi-compacto .card.py-2 { padding-top: .25rem !important; padding-bottom: .25rem !important; }
    .login-card .card-body { padding: 1.5rem 1.25rem; }
    .timeline .tl-col { min-width: 240px; }
    .log { max-height: 260px; font-size: .72rem; }
    .alert { font-size: .85rem; }
    .btn-sm { margin-bottom: .15rem; }
}

/* =====================================================================
   Celular: tabelas viram cartões (sem barra de rolagem horizontal).
   .tabela-cards  → listas (rótulo à esquerda, valor à direita)
   .tabela-form   → tabelas com campos (rótulo em cima do campo)
   Classes nas células: m-titulo (linha de destaque), m-texto (texto corrido),
   m-inline (lado a lado no topo), m-acoes (rodapé do cartão), m-vazio (some no celular)
   ===================================================================== */
@media (max-width: 767px) {
    .card-tabela-cards { background: transparent; box-shadow: none !important; border: 0; }
    .card-tabela-cards > .card-body, .card-tabela-cards > .tabela-rolagem { padding: 0 !important; overflow: visible; max-height: none; }

    .tabela-cards, .tabela-cards tbody, .tabela-form, .tabela-form tbody, .tabela-form tfoot { display: block; width: 100%; }
    .tabela-cards thead, .tabela-form thead { display: none; }
    .tabela-cards tr, .tabela-form tr {
        display: flex; flex-wrap: wrap; align-items: center; column-gap: .5rem;
        background: #fff; border: 1px solid #e3e6f0; border-left: 4px solid var(--primary); border-radius: .55rem;
        margin: 0 0 .65rem; padding: .6rem .75rem; box-shadow: 0 .12rem .4rem rgba(58, 59, 69, .08);
    }
    .tabela-cards td, .tabela-form td {
        display: flex; width: 100%; border: 0 !important; padding: .14rem 0 !important; min-width: 0 !important;
        white-space: normal !important; overflow-wrap: anywhere;
    }
    .tabela-cards td { justify-content: space-between; align-items: baseline; gap: .75rem; text-align: right; font-size: .82rem; }
    .tabela-cards td[data-label]::before {
        content: attr(data-label); flex-shrink: 0; max-width: 48%; text-align: left;
        font-weight: 700; color: #858796; font-size: .68rem; text-transform: uppercase; letter-spacing: .02em;
    }
    .tabela-cards td.m-titulo { font-size: .98rem; font-weight: 800; text-align: left; justify-content: flex-start; padding-top: .3rem !important; }
    .tabela-cards td.m-texto { display: block; text-align: left; color: #5a5c69; margin-bottom: .2rem; }
    .tabela-cards td.m-inline, .tabela-form td.m-inline { width: auto; }
    .tabela-cards td.m-acoes, .tabela-form td.m-acoes {
        justify-content: flex-end; flex-wrap: wrap; gap: .35rem; text-align: right;
        border-top: 1px solid #eaecf4 !important; margin-top: .35rem; padding-top: .45rem !important;
    }
    .tabela-cards td.m-vazio, .tabela-form td.m-vazio { display: none; }
    .tabela-cards tbody tr:hover td { background: transparent; }
    .tabela-cards tr.table-active { background: #eef3ff; border-left-color: var(--primary-hover); }
    .tabela-cards tr.table-active td { background: transparent; }
    .tabela-cards tr.mudou { background: #fffbea; border-left-color: #f6c23e; }
    .tabela-cards tr.mudou td { background: transparent; box-shadow: none !important; }
    .tabela-cards tr.grupo-linha { background: #e8eefc; border-left-color: var(--primary-escuro); padding: .5rem .75rem; margin-top: .9rem; }
    .tabela-cards tr.grupo-linha td { display: block; background: transparent !important; text-align: left; }
    .tabela-cards tr.grupo-linha .grupo-info { display: block; margin: .15rem 0 0; font-size: .74rem; }
    .tabela-cards .badge-sit, .tabela-cards .badge-pri { white-space: normal; }
    .tabela-cards .logo-mini { max-height: 34px; }

    .tabela-form td { display: block; text-align: left; }
    .tabela-form td[data-label]::before {
        content: attr(data-label); display: block; margin-bottom: .1rem;
        font-weight: 700; color: #858796; font-size: .68rem; text-transform: uppercase; letter-spacing: .02em;
    }
    .tabela-form td[style] { width: 100% !important; }
    .tabela-form tfoot tr { border-left-color: #1cc88a; justify-content: space-between; }
    .tabela-form tfoot td { width: auto; }

    .abas-rolagem { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
    .abas-rolagem .nav-link { white-space: nowrap; }
    .input-group { flex-wrap: wrap; }
    .input-group > .form-control { min-width: 0; }
    .modal-dialog { margin: .75rem; }
}
@media (max-width: 767px) {
    .tabela-emissao { min-width: 0; table-layout: auto; }
    .tabela-emissao td.cod.m-titulo { width: auto; flex: 1 1 auto; }
    .p-2-celular { padding: .5rem !important; overflow: visible !important; }
    .tabela-emissao .c-arquivos { flex-wrap: wrap; justify-content: flex-end; }
    .tabela-emissao .c-envio-td .alert { width: 100%; text-align: left; }
}

/* ---------- filtro de múltipla escolha ---------- */
.filtro-multi { position: relative; }
.filtro-multi-botao { display: flex; align-items: center; justify-content: space-between; cursor: pointer; background: #fff; }
.filtro-multi-botao span { min-width: 0; }
.filtro-multi-fundo { position: fixed; inset: 0; z-index: 1040; }
.filtro-multi-lista { position: absolute; z-index: 1041; top: calc(100% + 2px); left: 0; min-width: 100%; width: max-content; max-width: min(340px, 92vw);
                      background: #fff; border: 1px solid #d1d3e2; border-radius: .4rem; }
.filtro-multi-lista > label, .filtro-multi-item { display: flex; align-items: center; gap: .45rem; margin: 0; padding: .3rem .6rem; font-weight: 400; color: #3a3b45;
                      font-size: .84rem; cursor: pointer; }
.filtro-multi-item:hover { background: #f3f6ff; }
.filtro-multi-lista { max-height: 60vh; overflow-y: auto; }
@media (max-width: 767px) {
    .tabela-cards.resumo-alteracoes td:first-child { width: 100%; text-align: left; }
    .tabela-cards.resumo-alteracoes { table-layout: auto; }
    .tabela-cards tr.linha-acao { border-left-color: #1cc88a; background: #f8fffb; margin-top: -.45rem; }
    .tabela-cards tr.linha-acao td { display: block; text-align: left; }
    .tabela-cards td.m-dias { width: auto; order: -1; }
}

/* =====================================================================
   Celular – regras gerais (todas as páginas): nada de barra horizontal,
   botões e textos quebram linha em vez de sobrepor.
   ===================================================================== */
@media (max-width: 767px) {
    html, body, #wrapper, #content-wrapper { max-width: 100%; overflow-x: hidden; }
    .container-fluid { overflow-x: hidden; }
    .btn { white-space: normal; }
    .btn-icon-split { max-width: 100%; }
    .btn-icon-split .text { white-space: normal; text-align: left; }
    .card-header h6 { min-width: 0; overflow-wrap: anywhere; }
    .card-header .ml-auto, .card-body .ml-auto { margin-left: 0 !important; }
    code, .text-break, .small { overflow-wrap: anywhere; }
    .table-responsive, .tabela-rolagem { overflow-x: visible; }
    .form-inline { flex-direction: column; align-items: stretch; }
    .form-inline > * { width: 100%; margin-right: 0 !important; }
    .d-flex { min-width: 0; }
    .nav-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
    .nav-tabs .nav-link { white-space: nowrap; }
    .dropdown-menu { max-width: 94vw; }
    .modal-dialog { max-width: calc(100vw - 1.5rem); }
    .input-group > .input-group-append > .btn, .input-group > .input-group-prepend > .input-group-text { white-space: nowrap; }

    /* tabelas convertidas automaticamente (app.js) */
    .tabela-cards { padding: .4rem; }
    .card-tabela-cards .tabela-cards { padding: 0; }
    .tabela-cards td.m-auto-vazio { display: none; }
    .tabela-cards td.m-cheia { display: block; text-align: left; }
    .tabela-cards td.m-primeiro { font-size: .92rem; font-weight: 700; color: #3a3b45; }
    .tabela-cards td.m-sem-titulo { justify-content: flex-end; flex-wrap: wrap; gap: .3rem; }
    .tabela-cards td .form-control, .tabela-cards td select { max-width: 60%; }
    .tabela-cards td .input-group { max-width: 70%; }
    .tabela-cards.cards-auto td[style*="width"] { width: 100% !important; }
    .tabela-cards tr[style] { background-clip: padding-box; }
    .tabela-cards tfoot { display: block; }
    .tabela-cards tfoot tr { border-left-color: #1cc88a; }

    /* linha de ações/entrada que vira coluna */
    .barra-celular { flex-direction: column; align-items: stretch !important; }
    .barra-celular > * { width: 100%; }
}
@media (max-width: 767px) {
    /* nada de itens lado a lado se sobrepondo: as linhas flexíveis quebram */
    .container-fluid .d-flex:not(.flex-nowrap):not(.flex-column) { flex-wrap: wrap; }
    .container-fluid .d-flex > .flex-grow-1 { min-width: 0; }

    .tabela-cards td.m-bloco { display: block; text-align: left; }
    .tabela-cards td.m-bloco[data-label]::before { display: block; max-width: none; margin-bottom: .15rem; }
    .tabela-cards td.m-bloco .badge-papel, .tabela-cards td.m-bloco .badge { display: inline-block; margin: 0 .25rem .25rem 0; white-space: normal; }
    .tabela-cards td.m-primeiro { justify-content: flex-start; text-align: left; }
    .tabela-cards td.m-primeiro::before { display: none; }
    .tabela-cards td.m-sem-titulo:last-child { border-top: 1px solid #eaecf4 !important; margin-top: .35rem; padding-top: .45rem !important; }
    .tabela-cards td .form-control[style*="width"] { width: 100% !important; max-width: 60%; }
    .tabela-cards td.m-bloco .form-control { max-width: 100%; }
}
@media (max-width: 767px) { .tabela-cards td.m-primeiro::before { display: none !important; } }

/* Emissão: área para escolher/arrastar os arquivos do computador */
.upload-emissao { position: relative; border: 2px dashed #b7c6f5; border-radius: .6rem; background: #f7f9ff; padding: 1rem; text-align: center; cursor: pointer; transition: background .15s; }
.upload-emissao:hover { background: #eef3ff; border-color: var(--primary); }
.upload-emissao.ocupado { opacity: .7; cursor: progress; }
.upload-emissao-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* legendas soltas (ex.: cores do BM): uma por linha no celular */
.legendas { display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: center; }
@media (max-width: 767px) { .legendas { flex-direction: column; align-items: flex-start; } }

/* celular: abas viram botões que quebram linha (nada de rolar para o lado para achar uma aba) */
@media (max-width: 767px) {
    .nav-tabs, .abas-rolagem { flex-wrap: wrap !important; overflow: visible !important; border-bottom: 0; gap: .35rem; }
    .nav-tabs .nav-item { flex: 1 1 calc(50% - .35rem); margin-bottom: 0; }
    .nav-tabs .nav-link { white-space: normal !important; text-align: center; border: 1px solid #d1d3e2 !important; border-radius: .45rem !important;
                          background: #fff; padding: .45rem .5rem; font-size: .82rem; height: 100%; }
    .nav-tabs .nav-link.active { background: var(--primary); color: #fff !important; border-color: var(--primary) !important; }
    .nav-tabs .nav-link.active .badge-light { background: rgba(255,255,255,.85); }
    .card-header-tabs { margin: 0 !important; }
}

/* Emissão: conferência dos arquivos antes de subir */
.conferencia-lista { max-height: 340px; overflow-y: auto; border: 1px solid #e3e6f0; border-radius: .45rem; }
.conferencia-item { display: flex; align-items: flex-start; gap: .5rem; margin: 0; padding: .45rem .6rem; border-bottom: 1px solid #eaecf4;
                    font-weight: 400; color: #3a3b45; cursor: pointer; font-size: .84rem; }
.conferencia-item:last-child { border-bottom: 0; }
.conferencia-item.aviso { background: #fffbea; }
.conferencia-item.erro { background: #fff5f5; cursor: default; opacity: .85; }
.conferencia-item input { margin-top: .2rem; }
.conferencia-item i { margin-top: .15rem; }

/* celular: botões do cabeçalho em grade de 2 colunas, todos do mesmo tamanho e alinhados */
@media (max-width: 767px) {
    .cabecalho-pagina > .acoes, .cabecalho-pagina > .d-flex { display: grid !important; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; }
    .cabecalho-pagina > .acoes > *, .cabecalho-pagina > .d-flex > * { width: 100%; min-width: 0; margin: 0 !important; }
    .cabecalho-pagina > .acoes > .btn, .cabecalho-pagina > .d-flex > .btn,
    .cabecalho-pagina > .acoes > .btn-group > .btn { display: flex; align-items: stretch; justify-content: flex-start; }
    .cabecalho-pagina > .acoes > .btn-group { display: flex; }
    .cabecalho-pagina > .acoes > .btn-group > .btn:first-child { flex: 1 1 auto; }
    .cabecalho-pagina > .acoes > .btn-group > .btn:not(:first-child) { flex: 0 0 auto; justify-content: center; align-items: center; }
    .cabecalho-pagina .btn-icon-split .text { display: flex; align-items: center; flex: 1 1 auto; }
    .cabecalho-pagina .btn:not(.btn-icon-split) { justify-content: center; align-items: center; }
}

/* celular: texto de botão nunca fica escondido (quebra até no meio de "Usuários/Acessos") */
@media (max-width: 767px) {
    .btn, .btn .text { overflow-wrap: anywhere; word-break: break-word; }
    .cabecalho-pagina > .acoes, .cabecalho-pagina > .d-flex { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .btn-icon-split { overflow: visible; }
    .btn-icon-split .icon { flex: 0 0 auto; }
}

/* rodapé: logo da Enertop sempre no centro (texto à esquerda, link à direita; no celular, tudo centralizado) */
.rodape { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; }
.rodape-esq { justify-self: start; }
.rodape-dev { justify-self: center; }
.rodape-dir { justify-self: end; }
@media (max-width: 767px) {
    .rodape { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .rodape-esq, .rodape-dev, .rodape-dir { justify-self: center; }
    .rodape-dev { order: -1; }
    .rodape-dir:empty { display: none; }
}

/* administração: cartões das pastas do projeto */
.pasta-adm { border: 1px solid #e3e6f0; border-radius: .55rem; padding: .75rem .85rem; background: #fff; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.pasta-adm.marcada { border-color: var(--primary); background: #f3f6ff; }
.pasta-adm.vazia { opacity: .6; }
.pasta-adm code { font-size: .72rem; }

/* quadro do upload em segundo plano (fica no canto, em qualquer página) */
#cd-upload-painel { position: fixed; right: 1rem; bottom: 1rem; width: 340px; max-width: calc(100vw - 1.5rem); z-index: 1060;
                    background: #fff; border: 1px solid #d1d3e2; border-left: 4px solid var(--primary); border-radius: .55rem;
                    box-shadow: 0 .5rem 1.5rem rgba(58, 59, 69, .25); font-size: .82rem; color: #3a3b45; }
#cd-upload-painel .cdu-cab { display: flex; justify-content: space-between; align-items: center; padding: .5rem .75rem; border-bottom: 1px solid #eaecf4; }
#cd-upload-painel .cdu-cab a { color: #858796; }
#cd-upload-painel .cdu-corpo { padding: .55rem .75rem .7rem; }
#cd-upload-painel .cdu-linha { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .2rem; }
#cd-upload-painel .cdu-linha span { min-width: 0; }
#cd-upload-painel .cdu-sub { color: #858796; font-size: .74rem; }
#cd-upload-painel .cdu-erros { max-height: 120px; overflow-y: auto; margin-top: .35rem; color: #be2617; font-size: .74rem; }
#cd-upload-painel.min .cdu-corpo { display: none; }
@media (max-width: 767px) { #cd-upload-painel { right: .5rem; left: .5rem; width: auto; bottom: .5rem; } }
.conferencia-item.igual { background: #f4f5f9; color: #6e707e; }
#cd-upload-painel [hidden] { display: none !important; }
#cd-upload-painel .cdu-btn { border: 0; background: none; color: #858796; padding: .2rem .45rem; cursor: pointer; border-radius: .3rem; line-height: 1; }
#cd-upload-painel .cdu-btn:hover { background: #eaecf4; color: #3a3b45; }
#cd-upload-painel .cdu-titulo { font-size: .84rem; }
#cd-upload-painel.min { width: 260px; }

/* sino: lista curta (o texto completo fica na página Avisos) */
.sino-texto { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: none; white-space: normal; }
.sino-ver-todos { border-top: 1px solid #eaecf4; background: #f8f9fc; }

/* página de avisos */
.aviso-cartao { border-left: 4px solid #d1d3e2; }
.aviso-cartao.nao-lido { border-left-color: var(--primary); background: #f7f9ff; }
.aviso-cartao.destaque { box-shadow: 0 0 0 2px var(--primary) !important; }
.aviso-titulo { overflow-wrap: anywhere; }
.aviso-texto { white-space: pre-line; font-size: .86rem; color: #3a3b45; overflow-wrap: anywhere; background: #fff; border: 1px solid #eaecf4; border-radius: .4rem; padding: .55rem .7rem; }

/* logos lado a lado (cartões dos projetos): mesma área visual, já sem as margens vazias */
.logo-par { height: 34px; width: auto; max-height: 52px; max-width: 120px; object-fit: contain; }   /* o app.js acerta o tamanho pela área */

/* as built (fases depois da aprovação: pós-TAF e pós-TAC, lidas dos BMs) */
.badge-asbuilt { background: #6f42c1; color: #fff; }
a.badge-asbuilt:hover { background: #5a32a3; color: #fff; }
.text-asbuilt { color: #6f42c1; }
.border-left-asbuilt { border-left: .25rem solid #6f42c1 !important; }
.fases-doc { display: flex; align-items: flex-start; }
.fase-passo { flex: 1; text-align: center; position: relative; }
.fase-passo + .fase-passo::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: #e3e6f0; z-index: 0; }
.fase-passo.feito + .fase-passo::before { background: #1cc88a; }
.fase-bola { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
             background: #eaecf4; color: #b7b9cc; font-size: .8rem; border: 3px solid #fff; }
.fase-passo.feito .fase-bola { background: #1cc88a; color: #fff; }
.fase-passo.pendente .fase-bola { background: #6f42c1; color: #fff; }
.fase-nome { font-weight: bold; font-size: .82rem; color: #3a3b45; margin-top: .25rem; }
.fase-texto { font-size: .75rem; color: #858796; }
.fase-passo.pendente .fase-texto { color: #6f42c1; font-weight: bold; }
/* fase da obra por subestação (página do BM): mesma linha do tempo das fases do documento, clicável pelo ADM */
.fase-se { display: flex; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid #eaecf4; }
.fase-se:last-of-type { border-bottom: 0; }
.fase-se-nome { width: 34%; min-width: 120px; font-weight: 700; color: #3a3b45; font-size: .9rem; }
.fase-clicavel { cursor: pointer; }
.fase-clicavel:hover .fase-bola { box-shadow: 0 0 0 4px rgba(111, 66, 193, .2); }
.fase-clicavel:hover .fase-nome { color: #6f42c1; }
@media (max-width: 767px) { .fase-se { flex-direction: column; align-items: stretch; gap: .4rem; } .fase-se-nome { width: auto; } }
/* quadro compacto: várias subestações lado a lado, linha do tempo pequena */
.fase-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; }
.fase-item { border: 1px solid #e3e6f0; border-radius: .5rem; padding: .45rem .6rem .35rem; background: #fff; }
.fase-item-nome { font-weight: 700; font-size: .78rem; color: #3a3b45; margin-bottom: .2rem; }
.fases-mini .fase-bola { width: 22px; height: 22px; font-size: .55rem; border-width: 2px; }
.fases-mini .fase-passo + .fase-passo::before { top: 10px; height: 2px; }
.fases-mini .fase-nome { font-size: .68rem; font-weight: 600; margin-top: .1rem; }
.fase-chip { display: inline-block; padding: .15rem .55rem; border-radius: 1rem; font-size: .75rem; background: #eaecf4; color: #5a5c69; text-decoration: none !important; }
.fase-chip b { margin-left: .2rem; }
.fase-chip.ativo { background: #4e73df; color: #fff; }
.fase-chip-0:not(.ativo) { background: #ede7f8; color: #5a32a3; }
.fase-chip-1:not(.ativo), .fase-chip-2:not(.ativo) { background: #e2efda; color: #375623; }

/* páginas públicas: Termos de uso e Política de privacidade */
.legal-fundo { min-height: 100vh; padding: 2rem 1rem; background: linear-gradient(135deg, #0b3fae 0%, var(--primary-escuro) 100%); }
.legal-card { max-width: 860px; margin: 0 auto; border: 0; border-radius: .9rem; }
.legal-card .card-body { padding: 2rem 2.2rem; }
.legal-texto { color: #3a3b45; line-height: 1.65; font-size: .95rem; }
.legal-texto h2 { font-size: 1.05rem; font-weight: bold; color: #1F3864; margin: 1.6rem 0 .5rem; }
.legal-texto ul { padding-left: 1.2rem; }
.legal-texto li { margin-bottom: .35rem; }
.rodape-legal a { color: #b7b9cc; font-size: .75rem; }
.rodape-legal a:hover { color: #4e73df; }
.login-legal { text-align: center; margin-top: 1.4rem; font-size: .75rem; color: #b7b9cc; }
.login-legal a { color: #858796; }
.login-legal a:hover { color: #4e73df; }
@media (max-width: 575.98px) { .legal-card .card-body { padding: 1.4rem 1.1rem; } }

/* página de contato */
.contato-logo { width: 220px; max-width: 80%; }
.contato-item { display: flex; align-items: flex-start; gap: .85rem; padding: .85rem .9rem; border-radius: .5rem; color: #3a3b45; text-decoration: none !important; }
.contato-item + .contato-item { border-top: 1px solid #eaecf4; }
.contato-item:hover { background: #f8f9fc; color: #3a3b45; }
.contato-icone { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: #eaf0fd; color: #4e73df; display: inline-flex; align-items: center; justify-content: center; }
.contato-rotulo { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #858796; font-weight: bold; }
.contato-mapa { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; border-radius: 0 0 .35rem .35rem; }
.contato-icone.contato-whats { background: #e7f8ee; color: #25d366; font-size: 1.25rem; }
.sit-asbuilt, .pri-asbuilt { background: #e9e1f7; color: #5a32a3; }
.sit-asbuilt2 { background: #d9ccf2; color: #3f2380; }
/* aprovado, aguardando a fase do as built (TAF/TAC ainda não começou) */
.sit-aguarda-ab { background: #e2efda; color: #375623; border: 1px dashed #a9d18e; }
.progress-bar.sit-asbuilt { background: #a08ad6; }
.progress-bar.sit-asbuilt2 { background: #6f42c1; }
.matriz .linha-total a { color: inherit; }
.matriz .linha-total a:hover { color: #4e73df; text-decoration: underline; }

/* menu "Exportar lista" (todos / só os filtrados / histórico completo) */
.menu-exportar { position: absolute; right: 0; top: calc(100% + 4px); z-index: 1050; min-width: 260px; background: #fff; border: 1px solid #e3e6f0; border-radius: .5rem; padding: .35rem 0; }
.menu-exportar-titulo { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: #858796; font-weight: bold; padding: .35rem .9rem .15rem; }
.menu-exportar-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .4rem .9rem; color: #3a3b45; font-size: .85rem; text-decoration: none !important; cursor: pointer; }
.menu-exportar-item:hover { background: #f1f3f9; color: #3a3b45; }
@media (max-width: 575.98px) { .menu-exportar { right: auto; left: 0; } }

/* equipe do projeto: no computador, colunas proporcionais; no celular vira cartão (regra geral das .tabela-docs) */
@media (min-width: 768px) {
    .tabela-equipe { table-layout: fixed; width: 100%; }
    .tabela-equipe td, .tabela-equipe th { vertical-align: middle; font-size: .85rem; }
    .tabela-equipe td .form-control-sm { max-width: 190px; }
    .tabela-equipe td:last-child { white-space: nowrap; text-align: right; }
    /* respiro entre Papel | Login na plataforma | Último acesso */
    .tabela-equipe th:nth-child(5), .tabela-equipe td:nth-child(5),
    .tabela-equipe th:nth-child(6), .tabela-equipe td:nth-child(6) { padding-left: 1.5rem; }
    .tabela-equipe th:nth-child(4), .tabela-equipe td:nth-child(4) { padding-right: 1rem; }
}
@media (max-width: 767px) {
    .tabela-equipe td .form-control-sm { max-width: 60%; }
    .tabela-equipe td.text-truncate { white-space: normal; overflow: visible; }
    .tabela-equipe-rolagem { overflow: visible !important; max-height: none !important; }
}

/* Boletim de medição: áreas separadas (nota fiscal · saldo · documentos) */
.secao-bm { padding: .6rem 1rem; border-bottom: 1px solid #e3e6f0; }
.secao-bm-nota { background: #f8f9fc; border-top: 1px solid #e3e6f0; }
.secao-bm-titulo { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #4e73df; }
@media (max-width: 767px) {
    .secao-bm { padding: .6rem .75rem; }
    .secao-bm .btn { white-space: normal; }
    .secao-bm .tabela-rolagem { overflow: visible; max-height: none; }
    .secao-bm-nota .badge { white-space: normal; text-align: left; }
}

/* Saldo do BM: total · medido · a medir em destaque */
.saldo-numeros { display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem; flex: 1 1 auto; }
.saldo-num { background: #fff; border: 1px solid #e3e6f0; border-left: 4px solid #858796; border-radius: .35rem; padding: .25rem .65rem; min-width: 150px; }
.saldo-num.saldo-medido { border-left-color: #1cc88a; }
.saldo-num.saldo-amedir { border-left-color: #f6c23e; }
.saldo-rot { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #858796; }
.saldo-val { font-size: .95rem; font-weight: 800; color: #3a3b45; white-space: nowrap; }
.saldo-val small { font-size: .75rem; font-weight: 700; color: #858796; margin-left: .2rem; }
@media (max-width: 767px) { .saldo-num { flex: 1 1 100%; } }
.saldo-num.saldo-este { border-left-color: #4e73df; background: #f3f6fd; }
.saldo-num.saldo-este .saldo-val { color: #224abe; }
.saldo-falta { font-size: .72rem; font-weight: 700; color: #b7791f; }

/* lista de documentos: balão de comentário centralizado na coluna (no celular, cartão: volta ao normal) */
@media (max-width: 767px) { .tabela-cards td.col-coment { text-align: right !important; } }

/* coluna do código do cliente final (Emissão, GRD, Alterações) */
.tabela-docs td.cod-cli { font-size: .8rem; font-weight: 600; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.tabela-docs td.cod-cli a { color: #4e6a8f; }
.tabela-emissao col.c-codf { width: 255px; }
/* computador: código do cliente numa linha só; Emissão com colunas redistribuídas (menos espaço vazio) */
@media (min-width: 768px) {
    .tabela-docs td.cod-cli { white-space: nowrap; overflow-wrap: normal; }
    .tabela-emissao:has(col.c-codf) { min-width: 1150px; }
    .tabela-emissao:has(col.c-codf) col.c-cod { width: 150px; }
    .tabela-emissao:has(col.c-codf) col.c-rev { width: 48px; }
    .tabela-emissao:has(col.c-codf) col.c-sit { width: 150px; }
    .tabela-emissao:has(col.c-codf) col.c-arq { width: 17%; }
    .tabela-emissao:has(col.c-codf) col.c-envio { width: 250px; }
    .tabela-alteracoes td.cod, .tabela-alteracoes td.cod-cli, .tabela-alteracoes td.c-campo { white-space: nowrap; }
    .tabela-alteracoes td.c-desc { min-width: 260px; }
    .tabela-alteracoes td.c-depara { max-width: 320px; overflow-wrap: anywhere; }
}

/* GRD – pendentes: mesmas larguras de coluna em todas as subestações */
.tabela-grd-pend { table-layout: fixed; width: 100%; }
.tabela-grd-pend td.desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabela-grd-pend td.cod, .tabela-grd-pend td.cod-cli { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991px) { .tabela-grd-pend { table-layout: auto; } }
