/* ===================================================================
   CoreGuard Financeiro — complementos ao design system herdado do
   protótipo do BackOffice (style.css). Carregar DEPOIS do style.css.
   =================================================================== */

/* Cor do escudo do Financeiro (mediana dos pixels do corpo do escudo_financeiro.png) */
:root { --cor-escudo: #4B93CA; --cor-escudo-escura: #2F6FA3; }

/* Login no padrão da suíte (fundo do BI, cartão sólido, sem brilhos radiais) */
.login-fundo { background: linear-gradient(160deg, #0B1B2E 0%, #101828 55%, #13314D 100%); }
.login-fundo::before, .login-fundo::after { display: none; }
.login-card { background: #1D2939; backdrop-filter: none; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-marca img { border-radius: 0; }
.login-card .form-campo::placeholder { color: transparent; }
.login-card .form-campo:focus, .login-card .form-campo:focus-visible { background: rgba(255,255,255,.06); border-color: var(--cor-escudo); box-shadow: none; outline: none; }
.login-card .botao-primario { background: linear-gradient(135deg, var(--cor-escudo-escura) 0%, var(--cor-escudo) 100%); box-shadow: none; }
.login-card .botao-primario:hover { background: linear-gradient(135deg, var(--cor-escudo-escura) 0%, var(--cor-escudo) 100%); filter: brightness(1.08); }
.login-card a { color: var(--cor-escudo); }
.login-erro { display: none; text-align: center; font-size: 12px; font-weight: 600; color: #F87171; margin: -8px 0 14px; }
.otp-input { width: 44px; height: 52px; text-align: center; font-size: 20px; font-weight: 800; padding: 0; }
.login-demo { text-align: center; font-size: 12px; color: #8896AA; margin: 0 0 18px; line-height: 1.5; }

/* Agenda: linhas por situação (cores do protótipo do Mantis 31408) */
.tabela tr.dia-grupo td { background: var(--fundo-secao); font-weight: 700; font-size: 12px; padding: 6px 16px; color: var(--texto-secundario); cursor: default; }
.tabela tr.dia-grupo td .dia-total { float: right; font-variant-numeric: tabular-nums; color: var(--texto-primario); }
.tabela tr.sit-vencida td { background: rgba(220, 38, 38, 0.07); }
.tabela tr.sit-hoje td { background: rgba(217, 119, 6, 0.10); }
.tabela tr.sit-paga td { background: rgba(22, 163, 74, 0.07); }
.tabela tr.sit-cancelada td { background: #EEF1F5; color: var(--texto-terciario); text-decoration: line-through; }
body.tema-escuro .tabela tr.sit-cancelada td { background: #161D26; }
.tabela tr.selecionada td { box-shadow: inset 3px 0 0 var(--azul-coreguard); }
.tabela td.marca { width: 36px; padding-right: 0; }
.tabela td.marca input, .tabela th.marca input { width: 15px; height: 15px; accent-color: var(--azul-coreguard); cursor: pointer; }
.tabela.compacta td { padding: 8px 12px; font-size: 12.5px; }
.tabela.compacta th { padding: 8px 12px; }
.doc-liberado { color: var(--verde-forte); font-weight: 600; }
.doc-aguardando { color: var(--amarelo); font-weight: 700; }
.doc-recebido { color: var(--azul-coreguard); font-weight: 600; }
.doc-falta { color: var(--vermelho); font-weight: 700; }
.doc-debito { color: var(--verde-forte); font-weight: 600; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--texto-secundario); background: var(--fundo-input); border-radius: 6px; padding: 1px 6px; margin-right: 3px; letter-spacing: .2px; }
.clipe { font-size: 11px; color: var(--texto-terciario); margin-left: 4px; }

/* Rodapé de totais da agenda */
.totais { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-top: var(--borda-sutil); font-size: 12px; color: var(--texto-secundario); background: var(--fundo-secao); }
.totais span { background: var(--fundo-card); border: var(--borda-sutil); border-radius: 8px; padding: 4px 10px; }
.totais b { color: var(--texto-primario); }
.legenda-cores { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--texto-secundario); padding: 8px 18px; }
.legenda-cores i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid rgba(0,0,0,.08); }

/* Barra de ações */
.barra-acoes { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: var(--borda-sutil); align-items: center; }
.barra-acoes .direita { margin-left: auto; display: flex; gap: 8px; }

/* Filtros em linha */
.filtros-linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 14px 18px; border-bottom: var(--borda-sutil); }
.filtros-linha .form-grupo { margin: 0; }
.filtros-linha .form-campo { min-height: 34px; padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.filtros-linha select.form-campo { padding-right: 28px; background-position: right 10px center; }

/* Fluxo de caixa: gráfico de barras + linha do saldo (SVG) */
.fluxo-grafico { width: 100%; height: 250px; display: block; }
.fluxo-grafico text { font-size: 10px; fill: var(--texto-terciario); }
.fluxo-grafico .eixo { stroke: var(--texto-terciario); stroke-opacity: .3; }
.fluxo-grafico .ent { fill: var(--verde); }
.fluxo-grafico .sai { fill: var(--vermelho); }
.fluxo-grafico .saldo { fill: none; stroke: var(--azul-coreguard); stroke-width: 2; }
.fluxo-grafico .saldo-ponto { fill: var(--azul-coreguard); }
.fluxo-grafico .zero { stroke: var(--texto-terciario); stroke-dasharray: 3 3; stroke-opacity: .5; }
.valor-pos { color: var(--verde-forte); font-weight: 600; }
.valor-neg { color: var(--vermelho); font-weight: 600; }
body.tema-escuro .valor-pos { color: var(--verde); }

/* Caixa de entrada de notas */
.nota-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border: var(--borda-sutil); border-radius: 12px; background: var(--fundo-card); margin-bottom: 10px; }
.nota-card.nova { border-left: 4px solid var(--amarelo); }
.nota-card.reconhecida { border-left: 4px solid var(--verde); }
.nota-card.negada { border-left: 4px solid var(--vermelho); opacity: .85; }
.nota-card.ciencia { border-left: 4px solid var(--azul-coreguard); }
.nota-tipo { width: 56px; height: 56px; border-radius: 12px; background: var(--fundo-secao); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: var(--texto-secundario); letter-spacing: .5px; }
.nota-tipo b { font-size: 15px; }
.nota-titulo { font-weight: 700; font-size: 13.5px; }
.nota-sub { font-size: 12px; color: var(--texto-terciario); margin-top: 2px; }
.nota-valor { font-size: 16px; font-weight: 800; text-align: right; white-space: nowrap; }
.nota-acoes { display: flex; gap: 6px; margin-top: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Blocos dentro de modal */
.modal .lkv { grid-template-columns: 180px 1fr; }
.secao-modal { border: var(--borda-sutil); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.secao-modal-titulo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--texto-terciario); margin-bottom: 10px; }
.chips-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-tags label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; border: var(--borda-input); border-radius: 8px; padding: 4px 8px; cursor: pointer; background: var(--fundo-card); }
.chips-tags input { accent-color: var(--azul-coreguard); }
.radio-linha { display: flex; gap: 18px; font-size: 13px; flex-wrap: wrap; }
.radio-linha label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-linha input { accent-color: var(--azul-coreguard); }
.check-linha { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.check-linha input { accent-color: var(--azul-coreguard); }

/* Página de detalhe */
.detalhe-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .detalhe-grid { grid-template-columns: 1fr; } }
.linha-tempo { position: relative; padding-left: 18px; }
.linha-tempo::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--fundo-input); }
.linha-tempo-item { position: relative; padding-bottom: 14px; font-size: 12px; }
.linha-tempo-item::before { content: ''; position: absolute; left: -17px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--azul-coreguard); }
.linha-tempo-item b { display: block; font-size: 12.5px; color: var(--texto-primario); }
.linha-tempo-item span { color: var(--texto-terciario); }

/* Integrações */
.integ-card { display: flex; gap: 14px; align-items: flex-start; }
.integ-icone { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--fundo-secao); flex-shrink: 0; }

/* Tema escuro: cores de linha mais discretas */
body.tema-escuro .tabela tr.sit-vencida td { background: rgba(248, 113, 113, 0.10); }
body.tema-escuro .tabela tr.sit-hoje td { background: rgba(251, 191, 36, 0.10); }
body.tema-escuro .tabela tr.sit-paga td { background: rgba(52, 211, 153, 0.08); }
body.tema-escuro .badge.cinza { background: #202A36; color: #B6C0CC; }
body.tema-escuro .chip:hover { background: #2A3441; }
body.tema-escuro .chips-tags label { background: var(--fundo-input); }

@media print {
  .barra-acoes, .filtros-linha, .legenda-cores, .modal-fundo, #toast-container { display: none !important; }
  .conteudo { overflow: visible; }
}

/* ===== Alçadas de aprovação ===== */
.tabela tr.sit-liquidacao td { background: rgba(27, 111, 168, 0.07); }
body.tema-escuro .tabela tr.sit-liquidacao td { background: rgba(96, 165, 250, 0.10); }
.aprov { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aprov-pend { background: var(--amarelo-palido); color: var(--amarelo-forte); }
.aprov-ok { background: var(--verde-palido); color: var(--verde-forte); }
.aprov-rep { background: var(--vermelho-palido); color: var(--vermelho-forte); }
.aprov-disp { background: var(--fundo-input); color: var(--texto-terciario); font-weight: 600; }
.votos { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.voto { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border: var(--borda-sutil); border-radius: 999px; padding: 3px 10px 3px 3px; background: var(--fundo-card); }
.voto .avatar-mini { width: 22px; height: 22px; border-radius: 50%; font-size: 9px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; color: white; background: var(--azul-coreguard); }
.voto.reprovou .avatar-mini { background: var(--vermelho); }
.voto.vaga { border-style: dashed; color: var(--texto-terciario); }
.voto.vaga .avatar-mini { background: var(--fundo-input); color: var(--texto-terciario); }
.alcada-faixa { display: grid; grid-template-columns: 60px 1fr 1fr 2fr auto; gap: 12px; align-items: center; padding: 10px 14px; border: var(--borda-sutil); border-radius: 10px; margin-bottom: 8px; background: var(--fundo-card); font-size: 13px; }
.alcada-faixa .nivel { font-size: 20px; font-weight: 800; color: var(--azul-coreguard); font-family: 'Krona One', sans-serif; }
@media (max-width: 900px) { .alcada-faixa { grid-template-columns: 1fr 1fr; } }

/* ===== Bancos e pagamentos ===== */
.banco-card { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; }
.banco-icone { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--fundo-secao); }
.recursos { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.recursos span { font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 2px 7px; background: var(--azul-coreguard-palido); color: var(--azul-coreguard); }
.linha-digitavel { font-family: ui-monospace, Consolas, monospace; font-size: 11px; letter-spacing: .3px; color: var(--texto-secundario); }

/* ===== Comunicação interna ===== */
.msg-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; padding: 12px 14px; border: var(--borda-sutil); border-radius: 12px; background: var(--fundo-card); margin-bottom: 8px; cursor: pointer; transition: background .12s; }
.msg-item:hover { background: var(--fundo-hover); }
.msg-item.nao-lida { border-left: 4px solid var(--azul-coreguard); }
.msg-item.nao-lida .msg-assunto { font-weight: 800; }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--azul-coreguard); color: white; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.msg-avatar.sistema { background: var(--fundo-secao); color: var(--texto-secundario); font-size: 18px; }
.msg-assunto { font-size: 13.5px; font-weight: 600; }
.msg-texto { font-size: 12.5px; color: var(--texto-secundario); margin-top: 3px; line-height: 1.45; }
.msg-meta { font-size: 11px; color: var(--texto-terciario); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg-quando { font-size: 11px; color: var(--texto-terciario); white-space: nowrap; text-align: right; }
.ref-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--azul-coreguard); background: var(--azul-coreguard-palido); border-radius: 6px; padding: 2px 8px; }
.tipo-chip { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; border-radius: 5px; padding: 2px 6px; }
.tipo-aprovacao { background: var(--amarelo-palido); color: var(--amarelo-forte); }
.tipo-mencao { background: var(--roxo-palido); color: var(--roxo-forte); }
.tipo-solicitacao { background: var(--azul-coreguard-palido); color: var(--azul-coreguard); }
.tipo-sistema { background: var(--fundo-input); color: var(--texto-secundario); }
.tipo-mensagem { background: var(--verde-palido); color: var(--verde-forte); }
.conversa { display: flex; flex-direction: column; gap: 10px; }
.conversa-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.conversa-item .avatar-mini { width: 30px; height: 30px; border-radius: 50%; background: var(--azul-coreguard); color: white; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.conversa-item.eu .avatar-mini { background: var(--verde); }
.conversa-balao { background: var(--fundo-secao); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; line-height: 1.45; }
.conversa-balao b { font-size: 12px; }
.conversa-balao .quando { color: var(--texto-terciario); font-size: 11px; margin-left: 6px; font-weight: 500; }
.conversa-balao .mencao { color: var(--azul-coreguard); font-weight: 700; }
.conversa-form textarea { min-height: 64px; resize: vertical; }
.canal-chips { display: inline-flex; gap: 4px; }
.canal-chips span { font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1px 6px; background: var(--fundo-input); color: var(--texto-secundario); }
.canal-chips span.on { background: var(--verde-palido); color: var(--verde-forte); }
