:root {
  /* Identidade Grupo Line: grafite #383838 e verde #86ab1d */
  --fundo: #f5f5f4; --cartao: #fff; --texto: #262626; --suave: #6b6b6b; --borda: #e2e2e0;
  --marca: #383838; --marca-clara: #eef4dc; --destaque: #86ab1d; --sobre-marca: #fff; --bom: #15803d; --ruim: #c0392b; --atencao: #b45309;
  --bom-f: #e6f4ea; --ruim-f: #fdecea; --atencao-f: #fdf3e0; --info-f: #e8f0fb; --info: #1d4f91;
  --raio: 12px; --sombra: 0 1px 2px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #161616; --cartao: #212121; --texto: #ececec; --suave: #a3a3a3; --borda: #343434;
    --marca: #a8cf3c; --marca-clara: #2b3319; --destaque: #a8cf3c; --sobre-marca: #1c1c1c; --bom: #4ade80; --ruim: #f87171; --atencao: #fbbf24;
    --bom-f: #173022; --ruim-f: #3a1d1b; --atencao-f: #3a2c12; --info-f: #1a2940; --info: #93c5fd;
    --sombra: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
h1 { font-size: 1.45rem; margin: 0 0 .2rem; line-height: 1.2; }
h2 { font-size: 1rem; margin: 0 0 .6rem; }
p { margin: .4rem 0; }
small { color: var(--suave); font-size: .82rem; }
a { color: inherit; text-decoration: none; }
section { margin-top: 1.4rem; }
.carregando, .vazio { color: var(--suave); padding: 1rem 0; }
.carregando { text-align: center; padding-top: 30vh; }
.nota { color: var(--suave); font-size: .88rem; }
.t-bom { color: var(--bom); } .t-ruim { color: var(--ruim); }

/* Estrutura */
.topo { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1rem; background: var(--cartao); border-bottom: 1px solid var(--borda); }
.marca { display: inline-flex; align-items: center; gap: .6rem; }
.marca img { height: 26px; width: auto; display: block; }
.marca .l-escuro { display: none; }
.marca span { font-weight: 400; font-size: .92rem; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); border-left: 1px solid var(--borda); padding-left: .6rem; }
.marca.grande { flex-direction: column; align-items: flex-start; gap: .35rem; margin-bottom: .8rem; }
.marca.grande img { height: 38px; }
.marca.grande span { border: 0; padding: 0; }
@media (prefers-color-scheme: dark) { .marca .l-claro { display: none; } .marca .l-escuro { display: block; } }
@media (max-width: 520px) { .topo .marca img { height: 18px; } .topo .marca span { display: none; } }
.quem { display: flex; align-items: center; gap: .7rem; text-align: right; font-size: .88rem; line-height: 1.2; }
.quem small { display: block; }
.faixa-demo { background: var(--atencao-f); color: var(--atencao); font-size: .85rem; padding: .45rem 1rem; text-align: center; }
main { padding: 1rem 1rem 6rem; max-width: 1180px; margin: 0 auto; }
.menu { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--cartao); border-top: 1px solid var(--borda); padding-bottom: env(safe-area-inset-bottom); }
.menu a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem .1rem .45rem; font-size: .7rem; color: var(--suave); min-width: 0; }
.menu svg { width: 22px; height: 22px; }
.menu a.ativa { color: var(--marca); font-weight: 600; }
@media (min-width: 900px) {
  .menu { top: 53px; bottom: 0; right: auto; width: 200px; flex-direction: column; border-top: 0; border-right: 1px solid var(--borda); padding: .8rem .6rem; gap: .2rem; }
  .menu a { flex: none; flex-direction: row; gap: .7rem; font-size: .95rem; padding: .6rem .8rem; border-radius: 8px; }
  .menu a.ativa { background: var(--marca-clara); }
  main { margin-left: 200px; padding: 1.5rem 2rem 3rem; max-width: 1380px; }
  .faixa-demo { margin-left: 200px; }
}

/* Cabeçalhos e ações */
.cab { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.cab h1, .cab h2 { margin: 0; }
.cab small { display: block; }
.acoes { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.voltar { display: inline-block; color: var(--suave); margin-bottom: .4rem; font-size: .9rem; }
button, .mini, .primario, .secundario { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--borda); background: var(--cartao); color: var(--texto); padding: .5rem .9rem; white-space: nowrap; display: inline-block; text-align: center; }
button:disabled { opacity: .5; cursor: default; }
.mini { padding: .3rem .65rem; font-size: .85rem; }
.primario { background: var(--marca); border-color: var(--marca); color: var(--sobre-marca); font-weight: 600; }
@media (prefers-color-scheme: dark) { .primario { color: #0c1a11; } }
.perigo { color: var(--ruim); border-color: var(--ruim); background: transparent; }
.grande { display: block; width: 100%; padding: .8rem; font-size: 1rem; margin-top: .6rem; }
.link { border: 0; background: none; color: var(--marca); text-decoration: underline; padding: .3rem; }
.faixa-demo .link { color: inherit; padding: 0; }

/* Cartões de número */
.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin-top: .8rem; }
.cartao, .bloco, .obra { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: .85rem 1rem; box-shadow: var(--sombra); }
.cartao .rot { display: block; color: var(--suave); font-size: .82rem; }
.cartao strong { display: block; font-size: 1.3rem; margin: .1rem 0; font-variant-numeric: tabular-nums; }
.cartao.bom strong { color: var(--bom); } .cartao.ruim strong { color: var(--ruim); }
.cartao small { display: block; }
.bloco { margin-top: 1rem; }
.duas { display: grid; gap: 0 1.2rem; }
@media (min-width: 760px) { .duas { grid-template-columns: 1fr 1fr; } .duas.larga { grid-template-columns: 3fr 2fr; } }

/* Barras */
.barra { height: 6px; background: var(--borda); border-radius: 3px; overflow: hidden; margin: .3rem 0 .5rem; }
.barra i { display: block; height: 100%; background: var(--bom); border-radius: 3px; }
.barra.neutra i { background: var(--suave); }

/* Pares rótulo-valor */
.par { display: flex; justify-content: space-between; gap: 1rem; padding: .28rem 0; font-size: .92rem; font-variant-numeric: tabular-nums; }
.par span:last-child { text-align: right; white-space: nowrap; }
.par.forte { font-weight: 700; }
.par.total { border-top: 1px solid var(--borda); margin-top: .3rem; padding-top: .55rem; font-size: 1rem; }

/* Obras */
.grade-obras { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.obra { display: block; }
.obra:hover, .linha[data-acao]:hover { border-color: var(--marca); }
.abas { display: flex; gap: .2rem; border-bottom: 1px solid var(--borda); margin-top: .8rem; overflow-x: auto; }
.abas a { padding: .55rem .9rem; color: var(--suave); border-bottom: 2px solid transparent; white-space: nowrap; }
.abas a.ativa { color: var(--marca); border-color: var(--marca); font-weight: 600; }

/* Linhas de lançamento */
.linha { display: flex; justify-content: space-between; align-items: center; gap: .8rem; background: var(--cartao); border: 1px solid var(--borda); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .45rem; }
.linha[data-acao] { cursor: pointer; }
.l-txt { min-width: 0; }
.l-txt b { display: block; overflow-wrap: anywhere; }
.l-txt small { display: block; overflow-wrap: anywhere; }
.l-dir { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; max-width: 55%; }
.l-valor { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.chip { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; background: var(--borda); color: var(--texto); white-space: nowrap; }
.chip.bom { background: var(--bom-f); color: var(--bom); } .chip.ruim { background: var(--ruim-f); color: var(--ruim); } .chip.atencao { background: var(--atencao-f); color: var(--atencao); }
.forn .linha { background: var(--fundo); }
.quatro { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .5rem 0; }
.quatro span { display: block; color: var(--suave); font-size: .78rem; }
.quatro b { font-variant-numeric: tabular-nums; font-size: .95rem; }
.quatro small { display: block; }
@media (max-width: 520px) { .quatro { grid-template-columns: 1fr 1fr; } }

/* Avisos do painel */
.alerta { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem .8rem; border-radius: 10px; margin: .45rem 0; font-size: .92rem; border-left: 4px solid; }
.alerta b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.alerta.ruim { background: var(--ruim-f); border-color: var(--ruim); }
.alerta.atencao { background: var(--atencao-f); border-color: var(--atencao); }
.alerta.info { background: var(--info-f); border-color: var(--info); }

/* Mês / tabela */
.navmes { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: .6rem; }
.rolagem { overflow-x: auto; background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { padding: .55rem .8rem; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--borda); }
th { color: var(--suave); font-weight: 600; font-size: .8rem; }
th:first-child, td:first-child { text-align: left; }
tr:last-child td { border-bottom: 0; }
.mini-barras i { display: block; height: 4px; border-radius: 2px; margin-top: 3px; min-width: 2px; }
.mini-barras .e { background: var(--bom); } .mini-barras .s { background: var(--ruim); }

/* Formulários */
.campo { display: block; margin-bottom: .75rem; }
.campo > span { display: block; font-size: .85rem; color: var(--suave); margin-bottom: .2rem; }
.campo.check { display: flex; align-items: center; gap: .5rem; }
input, select, textarea { font: inherit; width: 100%; padding: .6rem .7rem; border: 1px solid var(--borda); border-radius: 8px; background: var(--cartao); color: var(--texto); }
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--marca); outline-offset: 1px; }
.l-dir select { width: auto; padding: .35rem .5rem; }
dialog { border: 0; border-radius: 14px; padding: 0; width: min(480px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); background: var(--cartao); color: var(--texto); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog form { padding: 1.1rem; }
dialog h2 { font-size: 1.15rem; margin-bottom: .9rem; }
.botoes { display: flex; gap: .5rem; align-items: center; margin-top: .4rem; }
.espaco { flex: 1; }
.foto-grande img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto .6rem; }
.form-gasto { max-width: 520px; }
.foto-btn { display: block; text-align: center; padding: 1rem; border: 2px dashed var(--marca); border-radius: var(--raio); color: var(--marca); font-weight: 600; cursor: pointer; margin-bottom: .75rem; background: var(--marca-clara); }
#previa { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; margin: 0 auto .75rem; }
[hidden] { display: none !important; }

/* Entrada */
.entrada { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.cartao-entrada { background: var(--cartao); border: 1px solid var(--borda); border-radius: 16px; padding: 1.6rem; width: min(400px, 100%); box-shadow: var(--sombra); }

#aviso { position: fixed; left: 50%; bottom: 5rem; transform: translate(-50%, 20px); background: #1c211e; color: #fff; padding: .6rem 1rem; border-radius: 99px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100vw - 2rem); text-align: center; }
#aviso.visivel { opacity: 1; transform: translate(-50%, 0); }
#aviso.erro { background: var(--ruim); color: #fff; border-radius: 12px; }

/* Subir proposta */
dialog.larga { width: min(760px, calc(100vw - 1.5rem)); }
details { margin: .3rem 0 .6rem; font-size: .88rem; }
summary { cursor: pointer; color: var(--marca); }
.pre { white-space: pre-line; color: var(--suave); font-size: .84rem; }

/* Cronograma */
:root { --serie1: #2a78d6; --serie2: #eb6834; --serie1-f: #cde2fb; }
@media (prefers-color-scheme: dark) { :root { --serie1: #3987e5; --serie2: #d95926; --serie1-f: #184f95; } }
.seletor { display: flex; gap: .3rem; }
.mini.ativa { background: var(--marca-clara); border-color: var(--marca); color: var(--marca); font-weight: 600; }
.curva { width: 100%; height: auto; max-height: 280px; display: block; }
.curva .grade { stroke: var(--borda); stroke-width: 1; }
.curva .eixo { fill: var(--suave); font-size: 11px; }
.curva .hoje { stroke: var(--suave); stroke-width: 1; stroke-dasharray: 4 3; }
.curva .prev { fill: none; stroke: var(--serie1); stroke-width: 2; stroke-linejoin: round; }
.curva .pt { fill: var(--serie1); stroke: var(--cartao); stroke-width: 2; }
.curva .alvo { fill: transparent; }
.curva .real { fill: var(--serie2); stroke: var(--cartao); stroke-width: 2; }
.legenda { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: var(--suave); margin-top: .3rem; }
.legenda i { display: inline-block; vertical-align: middle; margin-right: .35rem; }
.l-prev { width: 18px; height: 2px; background: var(--serie1); }
.l-real { width: 10px; height: 10px; border-radius: 50%; background: var(--serie2); }
table.cron { font-size: .82rem; }
table.cron th small { display: block; font-weight: 400; }
table.cron td, table.cron th { padding: .4rem .5rem; }
table.cron td:first-child, table.cron th:first-child { position: sticky; left: 0; background: var(--cartao); min-width: 190px; max-width: 260px; white-space: normal; z-index: 1; }
table.cron td:first-child small { display: block; }
table.cron td.ativo { background: var(--serie1-f); color: var(--texto); font-weight: 600; }
table.cron tr.clicavel { cursor: pointer; }
table.cron tfoot td { font-weight: 600; border-top: 1px solid var(--borda); }
table.cron .barra { margin: .25rem 0 0; height: 4px; }

.so-impressao { display: none; }
@media print {
  .so-impressao { display: block; font-size: 9pt; color: #444; margin: 0 0 6pt; }
  :root { --fundo: #fff; --cartao: #fff; --texto: #000; --suave: #444; --borda: #bbb; --marca: #383838; --marca-clara: #eef4dc; --destaque: #86ab1d; --bom: #15803d; --ruim: #c0392b; --serie1: #2a78d6; --serie2: #eb6834; --serie1-f: #cde2fb; --sombra: none; }
  @page { size: A4 landscape; margin: 10mm; }
  .topo, .menu, .faixa-demo, .abas, .voltar, .acoes, .so-tela, #aviso, button, .nota { display: none !important; }
  main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .rolagem { overflow: visible; }
  table.cron { font-size: 8pt; }
  table.cron td:first-child, table.cron th:first-child { position: static; }
  table.cron td.ativo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  section, .bloco, .cartao { break-inside: avoid; }
}

/* Resultado */
.par.sub { font-size: .84rem; color: var(--suave); padding: .05rem 0 .3rem .8rem; }
a.par { color: inherit; text-decoration: none; }

/* Previsto x fechado */
.quatro.cinco { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 720px) { .quatro.cinco { grid-template-columns: 1fr 1fr; } }
table.pxf td:first-child { white-space: normal; min-width: 150px; }
table.pxf td:first-child small { display: block; color: var(--suave); }
table.pxf tr.clicavel { cursor: pointer; }
table.pxf tfoot td { font-weight: 600; }
.t-suave { color: var(--suave); }

/* Conferência da proposta: complementares com caixa de marcar */
.marca-ad { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.marca-ad > input { flex: none; width: 1.1rem; height: 1.1rem; }
.marca-ad > :not(input) { flex: 1; min-width: 0; }

/* Contratos */
.editor-barra { position: sticky; top: 53px; z-index: 4; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .5rem 0; background: var(--fundo); }
.editor-barra .espaco { flex: 1; }
.chips-campo { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0; }
.chips-campo button { font-size: .8rem; padding: .25rem .55rem; }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("fonts/poppins-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("fonts/poppins-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("fonts/poppins-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-display: swap; src: url("fonts/lora-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/lora-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 600; font-display: swap; src: url("fonts/lora-600-normal.woff2") format("woff2"); }
/* Linhas de preencher (____) saem contínuas: o traço vem da Arial, o resto da fonte do documento. */
@font-face { font-family: "Traco"; src: local("Arial"), local("Helvetica"), local("Liberation Sans"); unicode-range: U+5F; }
/* Na tela a folha tem o tamanho e as margens do A4 impresso. */
.folha { background: #fff; color: #2B2A26; box-sizing: border-box; width: 210mm; max-width: 100%; min-height: 297mm; margin: .6rem auto 2rem; padding: 20mm 18mm; border: 1px solid var(--borda); box-shadow: var(--sombra); page: contrato; }
.timbre { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; border-bottom: 1.5px solid #86ab1d; padding-bottom: .3cm; margin-bottom: .8cm; }
.timbre img { height: 1.05cm; width: auto; }
.timbre small { color: #7A766C; font: 7.5pt/1.45 "Poppins", "Segoe UI", Arial, sans-serif; letter-spacing: .03em; text-align: right; }
.papel { color: #2B2A26; font: 10.5pt/1.55 "Traco", "Lora", Georgia, "Times New Roman", serif; text-align: justify; outline: none; min-height: 40vh; overflow-wrap: break-word; }
.papel h1, .papel > h2:first-child { font: 400 20pt/1.2 "Lora", Georgia, serif; letter-spacing: 0; text-transform: none; text-align: left; color: #2B2A26; margin: .1em 0 .25em; padding: 0; border: 0; }
.papel > p:first-child:has(+ h1) { font: 500 7pt/1.4 "Traco", "Poppins", "Segoe UI", Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #7A766C; text-align: left; margin-bottom: .5em; }
.papel h1 + p { font-style: italic; color: #4d4a43; text-align: left; padding-bottom: .9em; border-bottom: 1px solid #2B2A26; margin-bottom: 1.1em; }
.papel h2 { font: 600 8pt/1.4 "Poppins", "Segoe UI", Arial, sans-serif; letter-spacing: .18em; text-transform: uppercase; text-align: left; color: #2B2A26; margin: 1.7em 0 .7em; padding-bottom: .4em; border-bottom: 1px solid #DDD7CA; break-after: avoid; }
.papel h3 { font: 600 7.5pt/1.4 "Poppins", "Segoe UI", Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; text-align: left; color: #2B2A26; margin: 1.5em 0 .4em; break-after: avoid; }
.papel p { margin: 0 0 .55em; orphans: 2; widows: 2; }
.papel strong, .papel b { font-weight: 600; }
.papel table { border-collapse: collapse; width: 100%; margin: .3em 0 1em; font: 500 9pt/1.45 "Traco", "Poppins", "Segoe UI", Arial, sans-serif; text-align: left; }
.papel td, .papel th { border: 0; border-bottom: 1px solid #DDD7CA; padding: 5px 10px 5px 0; text-align: left; vertical-align: top; white-space: normal; }
.papel tr:last-child td { border-bottom: 1px solid #DDD7CA; }
.papel tr:first-child td, .papel tr:first-child th { border-top: 1px solid #DDD7CA; }
.papel tr { break-inside: avoid; }
.papel td p { margin: 0; }
.papel td:first-child:nth-last-child(2) { width: 25%; color: #7A766C; font-weight: 400; font-size: 8pt; padding-top: 6px; }
.papel img { max-width: 100%; }
.papel img.assinatura { max-height: 1.9cm; max-width: 6.5cm; width: auto; height: auto; vertical-align: bottom; margin: 0 0 -.4cm .3cm; }
.previa-assinatura { background: #fff; border: 1px solid var(--borda); border-radius: 8px; padding: .6rem 1rem; margin-top: .7rem; display: inline-block; }
.previa-assinatura img { display: block; max-height: 2.2cm; max-width: 100%; }
.papel mark.campo-falta { background: #ffe58a; color: #111; padding: 0 2px; }
.papel[contenteditable=true] .campo-ok { background: #e3f2e7; }
@media (max-width: 720px) { .folha { padding: 1rem; min-height: 0; } .timbre img { height: .8cm; } .editor-barra { top: 49px; } }
@page contrato { size: A4 portrait; margin: 20mm 18mm; }
@media print {
  .folha { border: 0; box-shadow: none; padding: 0; margin: 0; width: auto; max-width: none; min-height: 0; }
  .papel { min-height: 0; }
  .timbre { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .papel mark.campo-falta, .papel .campo-ok { background: none !important; }
}

/* Detalhes em verde da marca */
.abas a.ativa { border-color: var(--destaque); }
.menu a.ativa svg { color: var(--destaque); }

/* ───────────── Planejamento, equipe, diário e portal do cliente ───────────── */
h3 { font-size: .92rem; margin: 1.1rem 0 .45rem; color: var(--suave); font-weight: 600; }
.t-suave { color: var(--suave); }
@media (max-width: 899px) { .menu { overflow-x: auto; } .menu a { min-width: 58px; } }

.etapa { display: flex; gap: .8rem; background: var(--cartao); border: 1px solid var(--borda); border-radius: 10px; padding: .7rem .8rem; margin-bottom: .5rem; }
.etapa.clicavel { cursor: pointer; }
.etapa.clicavel:hover { border-color: var(--marca); }
.e-num { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--marca-clara); color: var(--marca); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.e-corpo { flex: 1; min-width: 0; }
.e-corpo .cab { align-items: flex-start; flex-wrap: wrap; }
.e-corpo .chips { margin-top: 0; justify-content: flex-end; }
.gantt { position: relative; height: 12px; background: var(--fundo); border: 1px solid var(--borda); border-radius: 6px; margin: .35rem 0 .2rem; overflow: hidden; }
.gantt i { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--destaque) 35%, transparent); border-radius: 6px; overflow: hidden; }
.gantt i b { display: block; height: 100%; background: var(--destaque); }
.gantt u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ruim); }

table.padroes td { white-space: normal; }
table.padroes td:first-child { min-width: 200px; }
table.padroes td small { display: block; }
table.padroes input { width: 5.2rem; text-align: right; padding: .35rem .5rem; }

.permissoes { border: 1px solid var(--borda); border-radius: 10px; overflow: hidden; }
.perm { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .55rem .7rem; border-bottom: 1px solid var(--borda); flex-wrap: wrap; }
.perm:last-child { border-bottom: 0; }
.perm > div:first-child { flex: 1; min-width: 180px; }
.perm small { display: block; }
.niveis { display: inline-flex; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; flex: none; }
.niveis label { cursor: pointer; }
.niveis input { position: absolute; opacity: 0; pointer-events: none; }
.niveis span { display: block; padding: .32rem .7rem; font-size: .85rem; white-space: nowrap; border-left: 1px solid var(--borda); }
.niveis label:first-child span { border-left: 0; }
.niveis input:checked + span { background: var(--marca); color: var(--sobre-marca); font-weight: 600; }
.niveis input:focus-visible + span { outline: 2px solid var(--destaque); outline-offset: -2px; }
.obras-vis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 .8rem; }
.obras-vis .campo { margin-bottom: .35rem; }
dialog h3:first-child { margin-top: 0; }
.entrar-como { text-align: left; }
.entrar-como small { display: block; font-weight: 400; white-space: normal; color: inherit; opacity: .75; }

.post .acoes { margin-top: .5rem; }
.txt { white-space: pre-wrap; overflow-wrap: anywhere; margin: .3rem 0; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .4rem; margin-top: .5rem; }
.fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; background: var(--borda); }
.mini-foto { position: relative; display: block; }
.mini-foto button { position: absolute; top: 4px; right: 4px; width: 1.6rem; height: 1.6rem; padding: 0; border-radius: 50%; line-height: 1; background: rgba(0,0,0,.65); color: #fff; border: 0; }

.conversa { display: flex; flex-direction: column; gap: .45rem; }
.msg { max-width: 85%; padding: .5rem .75rem; border-radius: 12px; background: var(--cartao); border: 1px solid var(--borda); }
.msg p { margin: .1rem 0 0; }
.msg.nossa { align-self: flex-end; background: var(--marca-clara); border-color: transparent; }
.msg.deles { align-self: flex-start; }
.resposta { display: flex; gap: .5rem; align-items: flex-end; margin-top: .6rem; }
.resposta textarea { flex: 1; }

main.portal { margin: 0 auto; max-width: 760px; padding: 1rem 1rem 3rem; }
main.portal .cab strong { font-size: 1.15rem; white-space: nowrap; }
main.portal .bloco .acoes { margin-top: .6rem; }
main.portal .linha .l-dir { min-width: 9.5rem; }
a.linha { color: inherit; }
a.linha:hover { border-color: var(--marca); }

@media print {
  .etapa { break-inside: avoid; border-color: #bbb; }
  .gantt i { background: #cfe0a3; } .gantt i b { background: #6b8a17; }
}

/* ───────────── Painel novo, andamento da obra e notas ───────────── */
.painel-cab { align-items: flex-start; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: .7rem; margin-top: .8rem; }
.kpi { display: flex; gap: .75rem; align-items: flex-start; background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: .85rem .9rem; box-shadow: var(--sombra); min-width: 0; }
a.kpi:hover { border-color: var(--marca); }
.kpi-ic { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 10px; display: grid; place-items: center; background: var(--marca-clara); color: var(--marca); }
.kpi-ic svg { width: 1.25rem; height: 1.25rem; }
.kpi.bom .kpi-ic { background: var(--bom-f); color: var(--bom); }
.kpi.ruim .kpi-ic { background: var(--ruim-f); color: var(--ruim); }
.kpi-txt { min-width: 0; }
.kpi .rot { display: block; color: var(--suave); font-size: .8rem; }
.kpi strong { display: block; font-size: 1.32rem; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi.ruim strong { color: var(--ruim); }
.kpi small { display: block; }
.painel-meio > .bloco { min-width: 0; }
.alerta { color: inherit; }
.al-ic { flex: none; width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .8rem; color: #fff; background: var(--info); }
.alerta.ruim .al-ic { background: var(--ruim); } .alerta.atencao .al-ic { background: var(--atencao); }
@media (prefers-color-scheme: dark) { .al-ic { color: #161616; } }
.alerta > span { flex: 1; min-width: 0; }
a.alerta:hover { filter: brightness(.97); }
.tudo-ok { color: var(--bom); background: var(--bom-f); border-radius: 10px; padding: .7rem .8rem; }
details.mais > summary { padding: .3rem 0; font-size: .9rem; }
.agenda { display: flex; flex-direction: column; }
.ag { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; border-bottom: 1px solid var(--borda); }
.agenda .ag:last-child { border-bottom: 0; }
.ag:hover .ag-txt b { text-decoration: underline; }
.ag-data { flex: none; width: 2.6rem; text-align: center; background: var(--fundo); border: 1px solid var(--borda); border-radius: 8px; padding: .15rem 0; line-height: 1.1; }
.ag-data b { display: block; font-size: 1rem; } .ag-data small { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.ag-txt { flex: 1; min-width: 0; }
.ag-txt b { display: block; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; } .ag-txt small { display: block; }
.ag-valor { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .92rem; }

/* Gráfico de caixa: entradas e saídas por mês, mesma escala */
.gcx { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .5rem; align-items: end; margin-top: .4rem; }
.gcx-col { text-align: center; min-width: 0; }
.gcx-barras { height: 130px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--borda); }
.gcx-barras i { display: block; width: min(22px, 38%); border-radius: 4px 4px 0 0; }
.gcx-barras .e, .q-e { background: var(--serie1); } .gcx-barras .s, .q-s { background: var(--serie2); }
.gcx-col:hover .gcx-barras i { filter: brightness(1.1); }
.gcx-col b { display: block; font-size: .8rem; font-weight: 600; margin-top: .25rem; }
.gcx-col small { display: block; font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-e, .q-s { width: 10px; height: 10px; border-radius: 2px; }

/* Avanço com a marca do previsto */
.barra.av { position: relative; height: 8px; border-radius: 4px; overflow: visible; }
.barra.av i { border-radius: 4px; background: var(--destaque); }
.barra.av u { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--texto); border-radius: 1px; }
.obra .prazo { display: block; margin: -.15rem 0 .5rem; }
.obra .par small { font-weight: 400; }

/* Andamento dentro da obra */
.andamento .cab { flex-wrap: wrap; }
.and-topo { display: flex; gap: 1.2rem; align-items: center; margin-top: .4rem; }
.anel { flex: none; width: 128px; height: 128px; }
.anel circle { fill: none; stroke-width: 11; }
.anel .a-fundo { stroke: var(--borda); } .anel .a-valor { stroke: var(--destaque); stroke-linecap: round; }
.anel .a-num { font-size: 25px; font-weight: 700; fill: var(--texto); } .anel .a-rot { font-size: 11px; fill: var(--suave); }
.and-medidas { flex: 1; min-width: 0; }
.and-medidas .par span:last-child { white-space: normal; }
.and-conta { margin: .5rem 0 .2rem; }
.and-etapa { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(70px, 1fr) 3.2rem 8.5rem; gap: .7rem; align-items: center; padding: .45rem .2rem; border-bottom: 1px solid var(--borda); }
.and-etapa .chip { justify-self: start; }
.and-etapa.clicavel { cursor: pointer; } .and-etapa.clicavel:hover { background: var(--fundo); }
.ae-nome b { display: block; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; } .ae-nome small { display: block; }
.ae-barra .barra { margin: 0; }
.ae-pct { text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; }
@media (max-width: 620px) {
  .and-topo { flex-direction: column; align-items: stretch; } .anel { align-self: center; }
  .and-etapa { grid-template-columns: 1fr auto; row-gap: .3rem; } .ae-barra { grid-column: 1 / -1; order: 3; } .ae-pct { order: 1; } .and-etapa .chip { order: 2; grid-column: 1 / -1; } .ae-nome { order: 0; }
}

/* Notas: miniatura ao lado do lançamento, arquivo e galeria */
.nota-mini { flex: none; width: 46px; height: 58px; padding: 0; border-radius: 6px; border: 1px solid var(--borda); background: var(--fundo); overflow: hidden; display: grid; place-items: center; align-content: center; font-size: 1.1rem; line-height: 1; color: var(--suave); }
.nota-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nota-mini img:not([src]) { visibility: hidden; }
button.nota-mini { cursor: zoom-in; } button.nota-mini:hover { border-color: var(--marca); }
.nota-mini.vazia { border-style: dashed; } button.nota-mini.vazia { cursor: pointer; color: var(--marca); border-color: var(--marca); background: var(--marca-clara); }
.nota-mini small { display: block; font-size: .58rem; line-height: 1.1; color: inherit; white-space: normal; text-align: center; padding: 0 2px; }
.nota-mini.pdf { font-size: .72rem; font-weight: 700; color: var(--ruim); background: var(--ruim-f); border-color: transparent; letter-spacing: .04em; cursor: pointer; }
.linha > .nota-mini + .l-txt { flex: 1; }
.arq-atual { display: flex; align-items: center; gap: .7rem; margin-bottom: .75rem; padding: .5rem; border: 1px solid var(--borda); border-radius: 10px; }
.arq-atual > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; } .arq-atual small { display: block; }
.filtros { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.filtros select { width: auto; max-width: 100%; padding: .4rem .6rem; } .filtros input { flex: 1; min-width: 200px; padding: .4rem .7rem; }
.filtros .seletor { flex-wrap: wrap; }
.galeria-notas { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .6rem; }
.gn { padding: 0; overflow: hidden; text-align: left; white-space: normal; display: flex; flex-direction: column; cursor: zoom-in; }
.gn:hover { border-color: var(--marca); }
.gn img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: var(--borda); }
.gn span { padding: .35rem .5rem .45rem; } .gn b { display: block; font-size: .88rem; font-variant-numeric: tabular-nums; } .gn small { display: block; font-size: .74rem; }
.foto-grande h2 { font-size: 1rem; }
@media print { .kpi, .and-etapa { break-inside: avoid; } }
/* Número do painel: ícone e rótulo em cima, valor na largura toda (não quebra em valores grandes) */
.kpi { display: grid; grid-template-columns: auto 1fr; column-gap: .6rem; row-gap: .15rem; align-items: center; }
.kpi-txt { display: contents; }
.kpi-ic { width: 2rem; height: 2rem; border-radius: 8px; }
.kpi strong { grid-column: 1 / -1; white-space: nowrap; overflow-wrap: normal; margin-top: .25rem; }
.kpi small { grid-column: 1 / -1; }

/* ───────────── Medição de obra ───────────── */
.med-etapa { align-items: center; }
.med-etapa .e-corpo > small { display: block; overflow-wrap: anywhere; }
.med-acao { flex: none; }
.med-acao .primario { padding: .55rem 1.1rem; }
a.primario.mini { padding: .3rem .65rem; font-size: .85rem; }
.form-med .med-total { position: sticky; top: 0; z-index: 2; background: var(--cartao); padding: .3rem 0 .5rem; margin-bottom: .4rem; border-bottom: 1px solid var(--borda); }
.form-med #med-pct { font-size: 1.25rem; color: var(--destaque); }
.form-med .barra.av i { transition: width .15s; }
.med-item { display: flex; gap: .8rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--borda); }
.mi-txt { flex: 1; min-width: 0; }
.mi-txt b { display: block; font-weight: 600; font-size: .93rem; overflow-wrap: anywhere; } .mi-txt small { display: block; }
.mi-txt .barra { margin: .3rem 0 0; height: 4px; }
.mi-ent { flex: none; display: flex; align-items: center; gap: .35rem; }
.mi-ent input { width: 5.6rem; text-align: right; padding: .5rem .55rem; font-variant-numeric: tabular-nums; }
.mi-ent span { min-width: 1.6rem; color: var(--suave); font-size: .85rem; }
.med-direto { display: flex; align-items: center; gap: .6rem; }
.med-direto input[type=range] { flex: 1; padding: 0; accent-color: var(--destaque); }
.med-direto input:not([type=range]) { width: 5rem; text-align: right; }
.form-med .med-item:last-of-type { margin-bottom: .8rem; }
@media (max-width: 520px) { .med-item { flex-direction: column; align-items: stretch; } .mi-ent { justify-content: flex-end; } .med-etapa { flex-direction: column; align-items: stretch; } .med-acao .primario, .med-acao .mini { display: block; width: 100%; } }

/* ───────────── Fotos e projetos da obra ───────────── */
h2 .conta { font-weight: 400; margin-left: .3rem; }
.fotos-obra { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.fo { padding: 0; overflow: hidden; display: flex; flex-direction: column; white-space: normal; text-align: left; cursor: zoom-in; }
.fo:hover { border-color: var(--marca); }
.fo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--borda); }
.fo img:not([src]) { visibility: hidden; }
.fo span { padding: .3rem .5rem .4rem; font-size: .78rem; color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-foto .cab { margin-bottom: .6rem; }
.ver-foto img { border-radius: 8px; }
.campos.tres { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 .6rem; }
@media (max-width: 620px) { .campos.tres { grid-template-columns: 1fr; } .fotos-obra { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } }
.nota-mini.ext { font-size: .68rem; font-weight: 700; letter-spacing: .04em; color: var(--info); background: var(--info-f); border-color: transparent; cursor: pointer; }

/* Serviços e quantidades da etapa */
.med-acao { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; }
.sv-linha { display: grid; grid-template-columns: minmax(0, 1fr) 4.6rem 5.6rem 5.6rem 2.2rem; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.sv-linha input { padding: .5rem .55rem; }
.sv-linha input[name=qtd], .sv-linha input[name=peso] { text-align: right; }
.sv-cab { font-size: .8rem; color: var(--suave); margin-bottom: .2rem; }
.sv-linha button { padding: .3rem 0; }
@media (max-width: 560px) { .sv-linha { grid-template-columns: 1fr 1fr 1fr 2.2rem; } .sv-linha input[name=descricao] { grid-column: 1 / -1; } .sv-cab { display: none; } }

/* Foto que o cliente vê */
.fo { position: relative; }
.selo-cli { position: absolute; top: .35rem; left: .35rem; background: var(--marca); color: #fff; font-style: normal; font-size: .68rem; font-weight: 600; padding: .1rem .4rem; border-radius: 99px; }
