/* Telas do sistema (fluxo, contas, orçamento...): complementos ao contabil.css (classes ct-*). */

.tl-subtitulo { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--ct-text); }
.tl-margem { margin: 12px 16px; }
.tl-tabs-dentro { padding: 0 16px; }
.tl-oculto { display: none !important; }

/* Barra de composição (custo / resultado / lucro). */
.tl-composicao { display: flex; height: 22px; border-radius: 6px; overflow: hidden; font-size: 11px; font-weight: 600; color: #fff; margin-top: 6px; }
.tl-composicao span { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; min-width: 0; }
.tl-comp-custo { background: var(--ct-bar-a); }
.tl-comp-resultado { background: var(--ct-bar-b); }
.tl-comp-lucro { background: var(--ct-pos); }

/* Matriz temporal. */
.tl-matriz th, .tl-matriz td { white-space: nowrap; }
.tl-matriz .tl-matriz-rotulo, .tl-matriz td:first-child { position: sticky; left: 0; z-index: 1; background: var(--ct-surface); min-width: 240px; }
.tl-matriz thead th.tl-matriz-rotulo { background: var(--ct-muted); z-index: 2; }
.tl-matriz .ct-row-subtotal td:first-child, .tl-matriz .ct-row-total td:first-child { background: inherit; }
.tl-col--tri { background: var(--ct-muted); font-weight: 600; border-left: 1px solid var(--ct-border); }
.tl-col--ano { background: var(--ct-accent-soft); font-weight: 700; border-left: 2px solid var(--ct-accent); }
.tl-celula { width: 104px; text-align: right; height: 28px; padding: 0 6px; border: 1px solid var(--ct-accent); border-radius: 6px; background: var(--ct-surface); color: var(--ct-text); font-variant-numeric: tabular-nums; }

/* Selos de status genéricos. */
.tl-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tl-status--ok { background: var(--ct-accent-soft); color: var(--ct-accent); }
.tl-status--alerta { background: var(--ct-warn-bg); color: var(--ct-warn); }
.tl-status--critico { background: #fde8e7; color: #a4221b; }
.tl-status--neutro { background: var(--ct-muted); color: var(--ct-text-2); }
html.dark .tl-status--critico { background: #3a1716; color: #f79c95; }

/* Selo de funcionalidade simulada (sem integração real nesta versão). */
.tl-simulado { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--ct-warn-bg); color: var(--ct-warn); border: 1px solid var(--ct-warn-border); vertical-align: middle; }

/* Formulário em grade dentro de um card ou <details>. */
.tl-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.tl-form .ct-field { min-width: 0; }
.tl-form .tl-largo { grid-column: 1 / -1; }
.tl-form textarea { min-height: 70px; padding: 8px 10px; border: 1px solid var(--ct-border); border-radius: 8px; background: var(--ct-surface); color: var(--ct-text); font: inherit; font-size: 13px; }
.tl-form input[type="range"] { width: 100%; }

/* Painel destacado (cadastro aberto). */
.tl-painel { border: 1px solid var(--ct-accent); border-radius: var(--ct-radius); background: var(--ct-surface); padding: 18px 20px; box-shadow: var(--ct-sombra); }
.tl-painel > h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }

/* Barras de progresso (consumo do orçamento, conversão). */
.tl-progresso { height: 8px; border-radius: 4px; background: var(--ct-muted); overflow: hidden; min-width: 80px; }
.tl-progresso > span { display: block; height: 100%; background: var(--ct-accent); }
.tl-progresso--alerta > span { background: #d97706; }
.tl-progresso--critico > span { background: var(--ct-neg); }

/* Cartões de lista (recomendações, cenários, notificações). */
.tl-cartoes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tl-cartao { border: 1px solid var(--ct-border); border-radius: var(--ct-radius); background: var(--ct-surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.tl-cartao h3 { font-size: 14px; font-weight: 600; margin: 0; }
.tl-cartao--lida { opacity: 0.6; }

/* Diagramas Mermaid e prints da metodologia. */
.tl-diagrama { overflow-x: auto; display: flex; justify-content: center; padding: 8px 0; }
.tl-diagrama svg { max-width: 100%; height: auto; }
.tl-print { display: block; width: 100%; border: 1px solid var(--ct-border); border-radius: 8px; }
.tl-passos { display: flex; flex-direction: column; gap: 16px; counter-reset: passo; list-style: none; margin: 0; padding: 0; }
.tl-passos > li { counter-increment: passo; }
.tl-passos > li > .ct-card > h2::before { content: counter(passo); display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 999px; background: var(--ct-accent); color: #fff; font-size: 12px; }

@media print {
    .app-lateral, .app-topo, .app-rodape, .app-toasts, .tl-sem-impressao, .chat-widget { display: none !important; }
    .app-principal, .app-conteudo { margin: 0 !important; padding: 0 !important; }
    .ct-card, .ct-kpi { box-shadow: none !important; break-inside: avoid; }
}

/* Metodologia: listas e código. */
.tl-pontos, .tl-instrucoes { margin: 12px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--ct-text); }
.tl-instrucoes { margin-bottom: 14px; }
.tl-codigo { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--ct-muted); color: var(--ct-text-2); font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; }
pre.mermaid { background: transparent; margin: 0; font-family: inherit; }
