/* POLICLINICA-PACOTE 1.0 - identidade OBRA360: grafite + vinho, celular primeiro */
:root {
  --grafite: #23272F; --grafite-2: #2E333C; --vinho: #8A2B3A; --vinho-claro: #F4E4E7;
  --fundo: #F2F2F4; --cartao: #FFFFFF; --texto: #23272F; --suave: #626875; --linha: #DCDDE2;
  --bom: #2E7D4F; --ruim: #B3261E; --alerta: #B26A00; --custo: #4A5868; --receb: #8A2B3A;
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fundo); color: var(--texto); font: 15px/1.45 var(--fonte); }
a { color: var(--vinho); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15.5px; }
.num, table { font-variant-numeric: tabular-nums; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* topo e menu */
.topo { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; background: var(--grafite); color: #fff; padding: 10px 16px; }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.marca img { width: 34px; height: 34px; }
.marca b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca small { display: block; color: #B9BDC6; font-size: 12px; }
.quem { margin-left: auto; color: #D3D6DC; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 1px; }
.lateral { position: fixed; top: 54px; bottom: 0; left: 0; width: 230px; background: var(--grafite-2); padding: 12px 8px; overflow-y: auto; z-index: 25; display: flex; flex-direction: column; gap: 2px; }
.lateral a, .lateral button { display: flex; align-items: center; gap: 10px; color: #D3D6DC; text-decoration: none; padding: 10px 12px; border-radius: 8px; font: 500 14.5px var(--fonte); background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.lateral a:hover, .lateral button:hover { background: rgba(255,255,255,.07); color: #fff; }
.lateral a[aria-current="page"] { background: var(--vinho); color: #fff; }
.lateral .grupo summary { display: flex; align-items: center; gap: 10px; color: #D3D6DC; padding: 10px 12px; border-radius: 8px; font: 500 14.5px var(--fonte); cursor: pointer; list-style: none; user-select: none; }
.lateral .grupo summary::-webkit-details-marker { display: none; }
.lateral .grupo summary:hover { background: rgba(255,255,255,.07); color: #fff; }
.lateral .grupo[data-aqui] > summary { color: #fff; }
.lateral .grupo .seta { margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; opacity: .7; }
.lateral .grupo[open] .seta { transform: rotate(45deg); }
.lateral .grupo .sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.14); }
.lateral .grupo .sub a { padding: 8px 10px; font-size: 14px; font-weight: 400; color: #B9BDC6; }
.lateral .grupo .sub a[aria-current="page"] { color: #fff; font-weight: 500; }
.lateral form { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 8px; }
.versao { margin-top: auto; color: #8E939D; font-size: 12px; padding: 12px; }
.fundo-menu { display: none; }
main.com-menu { margin-left: 230px; padding: 20px 22px 48px; max-width: 1180px; display: flex; flex-direction: column; gap: 16px; }
main.sem-menu { max-width: 420px; margin: 8vh auto; padding: 16px; }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .lateral { transform: translateX(-100%); transition: transform .2s; }
  body.menu-aberto .lateral { transform: none; }
  body.menu-aberto .fundo-menu { display: block; position: fixed; inset: 54px 0 0 0; background: rgba(0,0,0,.35); z-index: 20; }
  main.com-menu { margin-left: 0; padding: 14px 14px 40px; }
}

/* blocos */
.cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cab p { margin: 4px 0 0; color: var(--suave); }
.card { background: var(--cartao); border: 1px solid var(--linha); border-radius: 12px; padding: 16px 18px; }
.card > h2 + p.lead, .card p.lead { color: var(--suave); margin: 4px 0 12px; font-size: 14px; }
.grade { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.duas { grid-template-columns: 1.4fr 1fr; } @media (max-width: 900px) { .duas { grid-template-columns: 1fr; } }
.kpi .rot { color: var(--suave); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.kpi .val { font-size: 26px; font-weight: 700; margin-top: 2px; }
.kpi .sub { color: var(--suave); font-size: 13px; }
.kpi.bom { border-left: 4px solid var(--bom); } .kpi.ruim { border-left: 4px solid var(--ruim); } .kpi.vinho { border-left: 4px solid var(--vinho); }
.pos { color: var(--bom); } .neg { color: var(--ruim); } .suave { color: var(--suave); }
.aviso { padding: 10px 14px; border-radius: 10px; background: var(--cartao); border: 1px solid var(--linha); border-left: 4px solid var(--suave); }
.aviso.ok { border-left-color: var(--bom); } .aviso.erro { border-left-color: var(--ruim); } .aviso.info { border-left-color: var(--vinho); }

/* tabelas */
.tabela { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--linha); text-align: right; white-space: nowrap; vertical-align: top; }
th:first-child, td:first-child, th.e, td.e { text-align: left; }
td.quebra { white-space: normal; min-width: 160px; }
thead th { color: var(--suave); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
tr.total td, tfoot td { font-weight: 700; border-top: 2px solid var(--texto); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill.bom { background: #E3F1E8; color: var(--bom); } .pill.ruim { background: #F9E3E1; color: var(--ruim); } .pill.neutra { background: var(--fundo); color: var(--suave); }
.barra { height: 8px; background: var(--fundo); border-radius: 4px; overflow: hidden; min-width: 90px; }
.barra div { height: 100%; background: var(--custo); } .barra div.estouro { background: var(--ruim); }

/* formulários */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; align-items: end; }
.form .largo { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--suave); margin-bottom: 5px; }
input, select, textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--linha); border-radius: 8px; background: #fff; color: var(--texto); font: 15px var(--fonte); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--vinho); outline-offset: 2px; }
.botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--linha); background: #fff; color: var(--texto); border-radius: 8px; padding: 10px 15px; font: 600 14px var(--fonte); cursor: pointer; text-decoration: none; }
.btn.prim { background: var(--vinho); border-color: var(--vinho); color: #fff; }
.btn.perigo { color: var(--ruim); }
.btn.peq { padding: 6px 10px; font-size: 13px; }
.seg { display: flex; border: 1px solid var(--linha); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 9px 6px; font: 500 14px var(--fonte); cursor: pointer; color: var(--texto); }
.seg button + button { border-left: 1px solid var(--linha); }
.seg button[aria-pressed="true"] { background: var(--vinho); color: #fff; }
input[type=range] { accent-color: var(--vinho); padding: 0; border: 0; }
.sim { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 22px; }
.sim label { display: flex; justify-content: space-between; gap: 10px; }
.sim output { font-weight: 700; color: var(--texto); white-space: nowrap; }

/* gráficos */
.grafico svg { display: block; width: 100%; height: auto; min-width: 560px; }
.grafico { overflow-x: auto; }
.legenda { display: flex; gap: 16px; flex-wrap: wrap; color: var(--suave); font-size: 13px; margin-top: 8px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.barras { display: flex; flex-direction: column; gap: 10px; }
.barras .l { display: grid; grid-template-columns: 210px 1fr 120px; gap: 10px; align-items: center; font-size: 14px; }
.barras .t { height: 12px; background: var(--fundo); border-radius: 6px; overflow: hidden; }
.barras .f { height: 100%; background: var(--custo); border-radius: 6px; }
@media (max-width: 560px) { .barras .l { grid-template-columns: 1fr 100px; } .barras .t { grid-column: 1 / -1; grid-row: 2; } }

/* casas */
.casas { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 5px; margin-top: 10px; }
.casas a { display: block; text-align: center; border: 1px solid var(--linha); border-radius: 6px; padding: 8px 0; font-weight: 600; font-size: 13px; text-decoration: none; color: var(--texto); background: var(--fundo); }
.casas a.n1 { background: #F1DDE1; } .casas a.n2 { background: #DDA9B3; } .casas a.n3 { background: #A9CDB6; } .casas a.n4 { background: var(--bom); color: #fff; border-color: var(--bom); }
.leg-casas { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--suave); }
.leg-casas span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; border: 1px solid var(--linha); background: var(--c); }

/* gantt e plano */
.gantt { display: grid; grid-template-columns: 230px 1fr; gap: 6px 12px; align-items: center; font-size: 13.5px; }
.gantt .trilho { position: relative; height: 22px; background: var(--fundo); border-radius: 5px; }
.gantt .seg-g { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--custo); }
.gantt .seg-g.crit { background: var(--vinho); } .gantt .seg-g.parado { background: var(--linha); }
@media (max-width: 640px) { .gantt { grid-template-columns: 1fr; } }
.meses { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.meses div { background: var(--fundo); border-radius: 8px; padding: 8px; text-align: center; }
.meses b { display: block; font-size: 20px; } .meses span { font-size: 12px; color: var(--suave); }
.meses div.feito { background: #E3F1E8; }

/* login */
.login { display: flex; flex-direction: column; gap: 14px; }
.login .marca-login { display: flex; align-items: center; gap: 10px; }
.login .marca-login img { width: 44px; }
.risco { display: grid; grid-template-columns: 6px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linha); }
.risco:last-child { border-bottom: 0; } .risco .s { border-radius: 3px; } .s.alta { background: var(--ruim); } .s.media { background: var(--alerta); } .s.baixa { background: var(--bom); }
.risco p { margin: 2px 0 0; color: var(--suave); font-size: 14px; }
ul.limpa { margin: 0; padding-left: 18px; } ul.limpa li { margin: 6px 0; }
@media (prefers-reduced-motion: reduce) { .lateral, .lateral .grupo .seta { transition: none; } }

/* Croqui, mês a mês e projeto */
.cab { align-items: stretch; }
.cab-txt { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; justify-content: flex-end; }
.cab-acoes { margin-top: 8px; }
.croqui { display: flex; align-items: center; gap: 10px; background: var(--cartao); border: 1px solid var(--linha); border-radius: 12px; padding: 8px 12px 8px 8px; text-decoration: none; color: var(--suave); font-size: 12px; line-height: 1.3; }
.croqui img { height: 92px; width: auto; display: block; }
.croqui:hover { border-color: var(--vinho); color: var(--vinho); }
@media (max-width: 600px) { .croqui img { height: 64px; } .croqui { padding: 6px 10px 6px 6px; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-mes { border: 1px solid var(--linha); background: #fff; border-radius: 999px; padding: 6px 12px; font: 600 13px var(--fonte); cursor: pointer; color: var(--texto); }
.chip-mes.on { background: var(--vinho); border-color: var(--vinho); color: #fff; }
.mm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .mm { grid-template-columns: 1fr; } }
.mm-col { background: var(--fundo); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.mm-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); margin-bottom: 4px; }
.mm-col .ln { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.mm-col .ln.grande b { font-size: 22px; }
.mm-col .ln.total { border-top: 1px solid var(--linha); padding-top: 6px; }
.mm-col p { margin: 2px 0 0; font-size: 13px; }
.mm-col .realizado { border-top: 1px dashed var(--linha); margin-top: 8px; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.mm-tab th.grupo { text-align: center; border-bottom: 2px solid var(--texto); color: var(--texto); }
.mm-tab .sep { border-left: 2px solid var(--linha); }
.mm-tab tr.sel td { background: var(--vinho-claro); }
.div-barra { position: relative; height: 6px; margin-top: 4px; background: var(--fundo); border-radius: 3px; min-width: 110px; }
.div-barra::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--suave); }
.div-barra span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.div-barra span.p { left: 50%; background: var(--bom); }
.div-barra span.n { right: 50%; background: var(--ruim); }
.destaque-proj { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: 20px; align-items: start; }
.destaque-proj img { width: 100%; height: auto; border: 1px solid var(--linha); border-radius: 8px; background: #fff; }
@media (max-width: 700px) { .destaque-proj { grid-template-columns: 1fr; } }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.galeria figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.galeria img { width: 100%; height: 230px; object-fit: contain; background: #fff; border: 1px solid var(--linha); border-radius: 8px; }
.galeria figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.galeria figcaption span { color: var(--suave); font-size: 13px; }
.sim .seg { margin-top: 2px; }

/* Estudos, mapa, materiais e solicitações */
figure.estudo { margin: 0; } figure.estudo img { width: 100%; max-width: 1280px; display: block; margin: 0 auto; border: 1px solid var(--linha); border-radius: 10px; background: #fff; }
figure.estudo figcaption { font-size: 13.5px; color: var(--suave); margin-top: 8px; }
.mapa-wrap { background: #F7F5F0; border: 1px solid var(--linha); border-radius: 10px; padding: 6px; margin: 10px 0; overflow-x: auto; }
.mapa-cond { width: 100%; min-width: 560px; height: auto; display: block; }
.mapa-cond a:hover .lote-casa, .mapa-cond a:focus .lote-casa { stroke: var(--vinho); stroke-width: 3; }
.kpi-mini { background: var(--fundo); border-radius: 8px; padding: 6px 12px; font-size: 13.5px; color: var(--suave); white-space: nowrap; } .kpi-mini b { font-size: 20px; color: var(--texto); }
.pill.alerta { background: #FBEBD3; color: var(--alerta); } .pill.info { background: #E2EAF2; color: #3C6E91; }
input.peq { padding: 5px 8px; max-width: 110px; font-size: 14px; }
tr.inativo td { opacity: .5; }
form.inline { display: inline-flex; gap: 6px; margin: 0; }
.chips a.chip-mes { text-decoration: none; }

.grade.duas > * { min-width: 0; } .grade.duas .tabela { overflow-x: auto; }

/* Encaixe e alinhamento */
/* valores nunca quebram; rótulos podem quebrar */
.num, b.num, span.num, .val, .pill, .btn, .chip-mes, .kpi-mini, output, .seg button, time { white-space: nowrap; }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .val { font-size: clamp(20px, 1.2vw + 12px, 26px); line-height: 1.15; }
.kpi .sub { margin-top: 2px; }
/* tabelas: tudo centrado na linha, 1ª coluna e colunas de texto quebram sem empurrar os números */
th, td { vertical-align: middle; }
thead th { vertical-align: bottom; }
.tabela td:first-child, .tabela th:first-child, td.e, th.e, td.quebra { white-space: normal; }
.tabela td:first-child { min-width: 9.5rem; }
.tabela td.e { min-width: 8rem; }
td .pill { margin-left: 6px; vertical-align: 1px; }
td > .pill:first-child { margin-left: 0; }
td.quebra .pill, td.e .pill { margin-left: 4px; }
.consumo { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.consumo .barra { flex: 1 1 70px; min-width: 60px; margin: 0; }
.consumo .num { min-width: 3.6em; text-align: right; }
@media (max-width: 700px) {
  .tabela { margin: 0 -18px; padding: 0 18px; }
  .tabela td:first-child, .tabela th:first-child { position: sticky; left: 0; z-index: 1; background: var(--cartao); box-shadow: 1px 0 0 var(--linha); min-width: 8.5rem; max-width: 11rem; }
  .tabela thead th:first-child { background: var(--cartao); }
  .tabela tr.sel td:first-child { background: var(--vinho-claro); }
  th, td { padding: 8px 8px; }
}
/* cabeçalho das páginas: título centrado ao lado do croqui */
.cab { align-items: center; }
.cab-txt { justify-content: center; }
.cab-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .cab:has(> .croqui) { flex-wrap: nowrap; align-items: flex-start; }
  .cab:has(> .croqui) .cab-txt { flex: 1 1 auto; min-width: 0; }
  .croqui { flex: 0 0 auto; padding: 4px; } .croqui span { display: none; } .croqui img { height: 58px; }
  h1 { font-size: 20px; }
}
/* barras horizontais (orçamento, materiais) */
.barras .l { grid-template-columns: minmax(150px, 240px) 1fr auto; }
.barras .l > :last-child { white-space: nowrap; text-align: right; min-width: 8.5em; }
@media (max-width: 560px) { .barras .l { grid-template-columns: 1fr auto; } .barras .l > :last-child { min-width: 0; } }
/* simulador: rótulo em cima, controle embaixo, todos alinhados */
.sim { align-items: start; }
.sim > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sim label { align-items: baseline; min-height: 20px; }
.sim .seg { align-self: flex-start; }
/* mês a mês: rótulo à esquerda, valor à direita na mesma linha */
.mm-col .ln { align-items: baseline; }
.mm-col .ln > span { flex: 1 1 auto; min-width: 0; }
.mm-col .ln > b { flex: 0 0 auto; text-align: right; }
.mm-col .ln.grande { align-items: center; }
/* formulários */
.form > div { min-width: 0; display: flex; flex-direction: column; }
.form > div > label { min-height: 1.45em; }
select { max-width: 100%; text-overflow: ellipsis; }
.botoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* mapa e grade de casas no celular */
@media (max-width: 600px) { .mapa-cond { min-width: 0; } .casas { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); } }
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 12px; } .kpi .rot { font-size: 11px; letter-spacing: .03em; } .kpi .val { font-size: 19px; } .kpi .sub { font-size: 12px; }
}
/* solicitações: etapas, seleção em lote */
fieldset.etapas-check { border: 1px solid var(--linha); border-radius: 10px; padding: 10px 14px 12px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
fieldset.etapas-check legend { font-size: 13px; color: var(--suave); padding: 0 6px; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; min-height: 30px; }
label.check input { width: 18px; height: 18px; accent-color: var(--vinho); margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--vinho); font: inherit; text-decoration: underline; cursor: pointer; }
.lote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
td.ck, th.ck { width: 36px; min-width: 36px !important; text-align: center; }
td.ck input { width: 18px; height: 18px; accent-color: var(--vinho); }
@media (max-width: 700px) { .tab-sol td.ck, .tab-sol th.ck { position: sticky; left: 0; z-index: 2; background: var(--cartao); } .tab-sol td:nth-child(2), .tab-sol th:nth-child(2) { position: static; box-shadow: none; min-width: 0; } .tab-sol td.ck { box-shadow: none; } }
@media (min-width: 701px) { .sim label { min-height: 2.6em; align-items: flex-start; } }

/* Ajustes finos de encaixe */
.grafico svg { min-width: 0; }
.tabela td.data, td.data, td.num, th.num { white-space: nowrap !important; }
.tabela td:first-child.data { min-width: 0; }
p b, .lead b, .suave b, li b, figcaption b { white-space: nowrap; }
td span.suave, .gantt span.suave, .meses span { white-space: nowrap; }
.kpi .rot, .kpi .sub { overflow-wrap: anywhere; }
.card > h2 { margin-bottom: 4px; }
.card { min-width: 0; }
.cab h1 { overflow-wrap: anywhere; }
.chips { row-gap: 8px; }
.seg { width: fit-content; max-width: 100%; }
.seg button { padding: 9px 12px; }
.lateral form button { white-space: nowrap; }
@media (max-width: 600px) {
  .card { padding: 14px 14px; }
  .tabela { margin: 0 -14px; padding: 0 14px; }
  .cab-acoes .btn, .botoes .btn { flex: 1 1 auto; }
  .form { grid-template-columns: 1fr; }
  .form .botoes .btn { flex: 1 1 100%; }
}
.form > .botoes, .form > div.botoes { flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.form > div.botoes .suave, .form > p { text-align: left; }
.form p { margin: 0; }
/* Comparar contratação e premissas editáveis */
.cmp .cab { align-items: flex-start; }
.cmp-ctrl { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.cmp-emp { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.cmp-emp input { width: 120px; padding: 6px 9px; text-align: right; }
.t-cmp th.sel, .t-cmp td.sel { background: var(--vinho-claro); }
.t-cmp td.sel { font-weight: 700; }
@media (max-width: 600px) { .cmp-ctrl { align-items: stretch; width: 100%; } .cmp-ctrl .seg { width: 100%; } .cmp-ctrl .seg button { flex: 1; } .cmp-emp { justify-content: space-between; } }
details.editar > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.editar > summary::-webkit-details-marker { display: none; }
details.editar > summary::before { content: "▸"; color: var(--vinho); font-size: 14px; }
details.editar[open] > summary::before { content: "▾"; }
details.editar[open] > summary { margin-bottom: 8px; }
.ed-form h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); margin: 4px 0 8px; }
.ed-linha { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px; margin-bottom: 8px; align-items: start; }
.ed-linha.risco-ed { grid-template-columns: minmax(140px, 220px) 110px 1fr; }
.ed-linha textarea { resize: vertical; min-height: 44px; font: 14px/1.4 var(--fonte); }
@media (max-width: 700px) { .ed-linha, .ed-linha.risco-ed { grid-template-columns: 1fr; padding-bottom: 8px; border-bottom: 1px dashed var(--linha); } }
/* Detalhes ao clique, fôrmas e impressão em PDF */
#tab-comp .mo-x { display: none; } #tab-comp.ver-mo .mo-x { display: table-cell; background: var(--vinho-claro); }
details.mo-cmp { margin-top: 10px; border-top: 1px dashed var(--linha); padding-top: 8px; }
details.mo-cmp > summary { cursor: pointer; color: var(--vinho); font-weight: 600; font-size: 14px; }
details.mo-cmp[open] > summary { margin-bottom: 6px; }
.nota-ln { font-size: 12.5px; margin: -2px 0 8px; line-height: 1.4; }
details.cmp > summary { flex-wrap: wrap; } details.cmp > summary h2 { margin: 0; } details.cmp > summary .suave { font-size: 13px; }
details.cmp:not([open]) { padding-bottom: 16px; }
.cab-acoes .btn svg { margin-right: 5px; vertical-align: -2px; }
.pdf-topo { display: none; }


.sub-ln { margin: -4px 0 8px 10px; padding-left: 8px; border-left: 2px solid var(--linha); }
.sub-ln .ln { font-size: 12.5px; padding: 2px 0; color: var(--suave); } .sub-ln .ln b { font-weight: 600; color: var(--texto); } .sub-ln i { font-style: normal; opacity: .8; }
.inv-mes { margin-top: 14px; border-top: 1px dashed var(--linha); padding-top: 12px; } .inv-mes .cab { margin-bottom: 8px; align-items: center; } .inv-mes tr.sel td { background: #EAF4EE; }

/* Impressão / PDF: A4 retrato, margens e rodapé padronizados, nada cortado */
table.t-mapa td { vertical-align: top; white-space: normal; } table.t-mapa td.num, table.t-mapa th { min-width: 150px; } table.t-mapa td.txt { min-width: 170px; max-width: 260px; text-align: left; font-size: .9em; } table.t-mapa td:first-child { min-width: 150px; font-weight: 500; } table.t-mapa tr.total td { background: var(--fundo); }
small.memoria { display: block; color: #6b7280; font-size: .78em; line-height: 1.3; margin-top: 2px; white-space: normal; }
@media print {
  @page {
    size: A4 portrait; margin: 12mm 10mm 14mm 10mm;
    @bottom-left { content: "Residencial São Rogério · parte cinza"; font: 8pt Arial, sans-serif; color: #777; }
    @bottom-right { content: "Página " counter(page) " de " counter(pages); font: 8pt Arial, sans-serif; color: #777; }
  }
  html, body { background: #fff !important; }
  body { font-size: 10px; line-height: 1.35; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lateral, .topo, .fundo-menu, .nao-imprime, .cab-acoes, .aviso, .chips, .seg, .cmp-emp, button, .btn,
  form .botoes, .ed-form, #editar-premissas, details.cmp > summary .suave, .div-barra, .mapa-wrap + .leg-casas ~ p { display: none !important; }
  main, main.com-menu { margin: 0 !important; padding: 0 !important; max-width: none !important; width: auto !important; }
  * { min-width: 0 !important; }
  .pdf-topo { display: flex !important; justify-content: space-between; gap: 8px; font-size: 8.5px; color: #555; border-bottom: 1.5px solid #8A2B3A; padding-bottom: 4px; margin-bottom: 10px; }
  .cab { margin: 0 0 8px; gap: 10px; } .cab h1 { font-size: 17px; margin: 0 0 2px; } .cab p { font-size: 9.5px; margin: 0; }
  .croqui { display: flex !important; width: 92px; padding: 4px; } .croqui img { width: 48px; } .croqui span { font-size: 8px; }
  .card { box-shadow: none !important; border: 1px solid #d5d7dc !important; border-radius: 6px; padding: 8px 10px !important; margin: 0 0 8px !important; break-inside: auto; }
  .card h2 { font-size: 12.5px; margin: 0 0 4px; break-after: avoid; } .card h3 { font-size: 11px; break-after: avoid; } .lead, .suave { font-size: 9px; }
  .grade { gap: 6px !important; } .grade.kpis { grid-template-columns: repeat(4, 1fr) !important; } .grade.duas { grid-template-columns: 1fr 1fr !important; }
  .kpi { padding: 6px 8px !important; break-inside: avoid; } .kpi .val { font-size: 15px !important; } .kpi .rot, .kpi .sub { font-size: 8px; }
  .tabela { overflow: visible !important; margin: 0 !important; padding: 0 !important; }
  .tabela table { width: 100% !important; min-width: 0 !important; font-size: 8px; table-layout: auto; border-collapse: collapse; }
  .tabela th { white-space: normal !important; font-size: 7px; padding: 3px 3px !important; line-height: 1.2; }
  .tabela td { padding: 2.5px 3px !important; position: static !important; box-shadow: none !important; }
  .tabela td.e, .tabela td.quebra, .tabela td:first-child { white-space: normal !important; }
  .tabela th, .tabela td { position: static !important; left: auto !important; }
  tr, .kpi, .risco, .grafico, .mm-col, figure, .ln { break-inside: avoid; page-break-inside: avoid; }
  .pill { font-size: 7px; padding: 0 4px; }
  input, select, textarea { border: 0 !important; background: transparent !important; padding: 0 !important; width: auto !important; max-width: 100% !important; font-size: 8px !important; box-shadow: none !important; appearance: none; }
  .grafico svg { width: 100% !important; height: auto !important; max-height: 230px; }
  .mm { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; } .mm-col { padding: 6px !important; } .mm-col .ln { font-size: 8.5px; } .mm-col .grande b { font-size: 12px !important; }
  .barras .l { font-size: 8.5px; } figure.estudo img, .galeria img, .destaque-proj img { max-height: 235mm; width: auto; max-width: 100%; }
  .mapa-cond { min-width: 0 !important; }
  details > summary::before { content: "" !important; } details.mo-cmp > summary { font-size: 9px; }
  #tab-comp .mo-x { display: table-cell; }
  details.recolher-pdf:not([open]) { display: none !important; }
  a { color: inherit; text-decoration: none; }
}
@media print {
  .tabela input, .tabela select { max-width: 92px !important; text-overflow: ellipsis; }
  .tabela td.e input, .tabela td:first-child input { max-width: 140px !important; }
}
@media print {
  .tabela table:has(input) td { white-space: normal !important; }
  .tabela table:has(input) input, .tabela table:has(input) select { max-width: 64px !important; }
  .tabela table:has(input) td:first-child input { max-width: 120px !important; }
}
@media print {
  /* Tabela não se divide entre folhas: se não couber no espaço que sobra, vai inteira (com o título do quadro) para a folha seguinte */
  .card, .tabela, .tabela table, .inv-mes, details.card { break-inside: avoid !important; page-break-inside: avoid !important; }
  .card > h2, .card > .cab, .card > p.lead { break-after: avoid; page-break-after: avoid; }
}
@media print {
  /* Formulários de inclusão/lançamento não vão para o PDF (exceto em Configurações) */
  main:not(.aba-config) .card:has(form.form):not(:has(table)) { display: none !important; }
}
.cmp-emp > span { font-weight: 600; font-size: 13px; min-width: 100px; }
.cmp-emp label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--suave); }
.cmp-emp input { width: 104px; }
@media (max-width: 600px) { .cmp-emp { flex-wrap: wrap; } .cmp-emp > span { width: 100%; } }

/* 4.2 – avanço físico e avaliação por casa */
.av-obra { display: flex; flex-direction: column; gap: 14px; }
.av-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.av-cab h2 { margin: 2px 0; font-size: 24px; }
.eb { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--vinho); font-weight: 700; }
.av-barra { position: relative; height: 12px; background: var(--fundo); border-radius: 6px; border: 1px solid var(--linha); }
.av-barra .r { position: absolute; inset: 0 auto 0 0; background: var(--vinho); border-radius: 6px; }
.av-barra .p { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--texto); }
.av-barra.mini { height: 8px; } .av-barra.mini .p { top: -3px; bottom: -3px; }
.av-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; margin: 0; }
.av-dl div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.av-dl dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); }
.av-dl dd { margin: 0; font-size: 22px; font-weight: 700; }
.av-dl small { font-size: 12px; color: var(--suave); }
.av-dl.mini dd { font-size: 16px; }
dd.neg, .neg { color: var(--ruim); } dd.pos { color: var(--bom); }
.mosaico { display: grid; grid-template-columns: repeat(auto-fill, minmax(12px, 1fr)); gap: 3px; }
.mz { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--linha); }
i.mz { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 5px; }
.mz.st-concluida { background: #1F5C3A; } .mz.st-emdia { background: #7DB993; } .mz.st-atrasada { background: var(--ruim); } .mz.st-atencao { background: var(--alerta); } .mz.st-adiantada { background: #3C6E91; } .mz.st-futura { background: #E4E5EA; }
.mz:hover, .mz:focus-visible { outline: 2px solid var(--texto); outline-offset: 1px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grade-casas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.casa-av { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; margin: 0; }
.casa-av:hover { border-color: var(--vinho); }
.ca-cab { display: flex; align-items: center; gap: 8px; } .ca-cab b { font-size: 17px; margin-right: auto; }
.nota { font-weight: 800; font-size: 16px; padding: 1px 8px; border-radius: 6px; background: var(--fundo); }
.nota small { font-weight: 600; font-size: 12px; } .nota.nA { color: var(--bom); } .nota.nB { color: #3C6E91; } .nota.nC { color: var(--alerta); } .nota.nD { color: var(--ruim); }
.campo { max-width: 720px; } .campo-lista li { padding: 6px 0; border-bottom: 1px solid var(--linha); } .campo-lista li:last-child { border: 0; }
@media (max-width: 560px) { .av-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .av-cab h2 { font-size: 20px; } }
.t-ed td.e { min-width: 280px; } .t-ed td.e input { width: 100%; }
.t-ed input.num { width: 120px; text-align: right; } .t-ed td { white-space: nowrap; } .t-ed td small { margin-left: 4px; }
.t-ed select { max-width: 230px; }
/* 4.3 – acompanhamento: abas, curva S, matriz, linha de balanço, metas e contratações */
.abas-av { display: flex; flex-wrap: wrap; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--linha); margin: 0 0 14px; scrollbar-width: thin; }
.abas-av a { white-space: nowrap; padding: 9px 12px 8px; color: var(--suave); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; }
.abas-av a[aria-current="page"] { color: var(--texto); border-bottom-color: var(--vinho); }
.abas-av a:hover { color: var(--texto); }
.av-g2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .av-g2 { grid-template-columns: 1fr; } }
svg.curva-s, svg.lob, svg.gantt-ct { width: 100%; height: auto; display: block; }
svg.curva-s { min-width: 460px; } svg.lob { min-width: 720px; } svg.gantt-ct { min-width: 760px; }
svg.curva-s text, svg.lob text, svg.gantt-ct text { fill: var(--suave); font: 11px var(--fonte); }
svg .gl { stroke: var(--linha); stroke-width: 1; } svg .ref { stroke: var(--ruim); stroke-width: 1.4; stroke-dasharray: 4 3; } svg .refl { fill: var(--ruim) !important; font-weight: 600; }
svg.curva-s polyline { fill: none; stroke-width: 2.4; stroke-linejoin: round; }
svg .lb { stroke: #626875; stroke-dasharray: 6 4; } svg .rl { stroke: var(--vinho); stroke-width: 3 !important; } svg .t1 { stroke: #C26F00; stroke-dasharray: 3 3; } svg .t2 { stroke: #6A4FC4; stroke-dasharray: 3 3; }
svg .pt { fill: var(--vinho); stroke: #fff; stroke-width: 2; }
.etapas { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.et { display: grid; grid-template-columns: minmax(0, 170px) 1fr 56px; gap: 10px; align-items: center; font-size: 13.5px; }
.et .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .et b { text-align: right; }
table.mx { width: auto; border-collapse: separate; border-spacing: 2px; font-size: 12px; }
table.mx th.pv { writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 2px; font-size: 11.5px; font-weight: 600; height: 70px; text-align: left; }
table.mx th.pv a { color: inherit; text-decoration: none; }
table.mx td.svn, table.mx th.svn { position: sticky; left: 0; background: var(--cartao); z-index: 1; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; text-align: left; }
table.mx td.c { width: 26px; min-width: 26px; height: 24px; padding: 0; text-align: center; font-weight: 700; font-size: 11px; color: #fff; border-radius: 3px; }
.c.ok { background: #2E7D4F; } .c.late { background: var(--ruim); } .c.prog { background: #3C6E91; } .c.idle { background: #E4E5EA; color: var(--suave) !important; }
.legenda i.c { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; }
.lob-f { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.lob-det summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.lob-leg { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.lob-leg label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; } .lob-leg i, i.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
table.q { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 900px; }
table.q th { text-align: center; } table.q th small { display: block; font-weight: 500; font-size: 11px; color: var(--suave); text-transform: none; letter-spacing: 0; }
table.q td { padding: 4px 6px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
table.q tr.p td { border-bottom: 1px dashed var(--linha); }
table.q td.sv { min-width: 200px; max-width: 260px; } table.q td.sv b { display: block; } table.q td.sv .g { font-size: 12px; color: var(--suave); }
table.q td.pr { font-weight: 800; width: 22px; text-align: center; } table.q tr.p td.pr { color: #3C6E91; } table.q tr.r td.pr { color: var(--vinho); }
table.q td.wk { text-align: center; width: 62px; font-weight: 600; } table.q tr.p td.wk.on { background: #E2EAF2; color: #23527A; }
table.q td.tot { text-align: center; font-weight: 800; } table.q td.dv { text-align: center; font-weight: 800; font-size: 17px; width: 60px; }
table.q td.dv.neg { color: var(--ruim); } table.q td.dv.pos { color: var(--bom); }
table.q td.ca textarea { width: 100%; min-width: 150px; min-height: 52px; font: inherit; font-size: 12.5px; }
table.q td.ca.need textarea { border-color: var(--ruim); background: #F9E3E1; }
textarea.enc { width: 100%; min-height: 170px; font: 13px/1.45 var(--fonte); background: var(--fundo); margin: 8px 0; }
.mes-at { display: inline-block; min-width: 70px; text-align: center; font-size: 17px; text-transform: capitalize; }
tr.grupo-l td { background: var(--fundo); font-weight: 700; }
svg.gantt-ct .it { fill: var(--texto); font-size: 12px; }
svg .b-cp { fill: #D9922B; } svg .b-en { fill: #3C6E91; } svg .b-fo { fill: #C9CCD3; } svg .b-in { stroke: var(--texto); stroke-width: 3; }
.form-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; margin-top: 10px; }
.form-grade label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--suave); } .form-grade .larga { grid-column: 1 / -1; }
form.inline { display: inline; }
.lob-f select, .editar select { width: auto; }
.campo-lista li b { white-space: normal; }
/* 4.4 – ordem de serviço e boletim de medição (documentos para assinatura) */
.doc { background: #fff; border: 1px solid var(--linha); border-radius: 10px; padding: 26px 30px; max-width: 900px; margin: 0 auto; color: #111; font-size: 14px; }
.doc-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 3px solid var(--vinho); padding-bottom: 10px; margin-bottom: 14px; }
.doc-cab b { display: block; font-size: 20px; letter-spacing: .02em; } .doc-cab span { color: var(--suave); font-size: 13px; }
.doc-st { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--vinho); border: 1.5px solid var(--vinho); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.doc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--suave); margin: 18px 0 6px; }
.doc-t, .doc-g, .doc-casas { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-t th { width: 170px; text-align: left; color: var(--suave); font-weight: 600; padding: 5px 8px; border-bottom: 1px solid var(--linha); vertical-align: top; }
.doc-t td { text-align: left; white-space: normal; padding: 5px 8px; }
.doc-g th, .doc-g td { padding: 5px 7px; border: 1px solid var(--linha); } .doc-g th { background: var(--fundo); font-size: 11.5px; }
.doc-g td.e, .doc-g th.e { text-align: left; white-space: normal; }
.doc-g tfoot td { font-weight: 700; background: var(--fundo); }
.doc-res { width: auto; min-width: 360px; margin: 10px 0 0 auto; }
.doc-casas td { border: 1px solid var(--linha); padding: 4px 5px; text-align: center; font-size: 12px; white-space: normal; }
.doc-p { text-align: justify; line-height: 1.5; margin: 6px 0; }
.assin { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 46px; }
.assin div { display: flex; flex-direction: column; align-items: center; text-align: center; font-weight: 600; gap: 2px; }
.assin span { display: block; width: 100%; border-top: 1px solid #111; margin-bottom: 4px; }
.assin small { font-weight: 400; color: var(--suave); }
.os-ass { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media print { .doc { border: 0; padding: 0; max-width: none; } .doc-g, .doc-t, .doc-casas, .assin { break-inside: avoid; } }

/* POLICLINICA 1.0 – complementos */
.busca-topo { flex: 1 1 260px; max-width: 420px; margin-left: 12px; }
.busca-topo input { padding: 7px 11px; border-radius: 999px; border: 0; background: #3A404B; color: #fff; font-size: 14px; }
.busca-topo input::placeholder { color: #B9BDC6; }
@media (max-width: 700px) { .busca-topo { display: none; } }
pre.texto-doc { white-space: pre-wrap; word-break: break-word; font: 13.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--fundo); border-radius: 8px; padding: 12px 14px; max-height: 70vh; overflow: auto; margin: 8px 0 0; }
details.secao { border-bottom: 1px solid var(--linha); padding: 10px 0; }
details.secao summary { cursor: pointer; }
details.secao pre.texto-doc { max-height: none; }
mark { background: #FFE58A; color: inherit; padding: 0 1px; border-radius: 2px; }
.resultado { padding: 10px 0; border-bottom: 1px solid var(--linha); }
.resultado:last-child { border-bottom: 0; }
.resultado p { margin: 4px 0 0; color: var(--suave); font-size: 14px; }
table.crono th, table.crono td { padding: 6px 6px; font-size: 13px; }
table.crono td.cel { text-align: center; min-width: 34px; }
table.crono tr.c-sub td { font-size: 12.5px; color: var(--suave); }
table.crono th small { font-weight: 400; text-transform: none; }
tr.grupo-orc td { background: var(--fundo); }
tr.grupo-orc.n0 td { background: var(--vinho-claro); }
.nota-card { padding: 12px 0; border-bottom: 1px solid var(--linha); }
.nota-card p { margin: 6px 0 0; }
.form small.suave { display: block; margin-top: 4px; font-size: 12px; }
.chips { overflow-x: auto; }
@media print { .topo, .lateral, .busca-topo, form, .chips { display: none !important; } main.com-menu { margin: 0; max-width: none; } }
