/* VP · páginas públicas claras (contrato e relatório técnico) no estilo do papel timbrado */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root { --navy: #1d2160; --blue: #24286b; --gold: #e9560d; --green: #c2410c; --ink: #161a33; --muted: #5d6d64; --line: #dfe7e1; --bg: #f3f4fa; --card: #fff; --font: 'Plus Jakarta Sans', -apple-system, sans-serif; }
html { -webkit-font-smoothing: antialiased; }
body.pub { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: var(--blue); }
img { max-width: 100%; display: block; }

.pub-top { position: relative; height: 92px; background: var(--navy); display: flex; align-items: center; justify-content: flex-end; padding: 0 max(16px, calc((100vw - 1100px) / 2)); overflow: hidden; }
.pub-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: linear-gradient(90deg, var(--green) 0 18%, var(--blue) 18% 82%, var(--green) 82%); }
.pub-brand img { height: 44px; width: auto; }

.pub-main { max-width: 860px; margin: 0 auto; padding: 36px 16px 56px; display: flex; flex-direction: column; gap: 18px; }
.pub-main--wide { max-width: 1100px; }
.pub-hero { padding: 8px 0 6px; }
.pub-eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.pub-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; margin: 6px 0; }
.pub-lead { color: var(--muted); }
.pub-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.pub-card h2 { font-size: 1.15rem; margin-bottom: 14px; padding-left: 12px; border-left: 4px solid var(--green); }
.pub-doc h3, .pub-doc h4 { font-size: .95rem; margin: 18px 0 6px; padding: 6px 10px; background: var(--navy); color: #fff; border-radius: 6px; }
.pub-doc p, .pub-doc li { font-size: .925rem; line-height: 1.75; color: #24342b; margin-bottom: 8px; }
.pub-doc ul { padding-left: 20px; }
.pub-muted { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.pub-error { padding: 10px 14px; border-radius: 10px; background: #fdecea; color: #9b1c1c; margin-bottom: 12px; }
.pub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.pub-grid label { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.pub-grid input { font: inherit; padding: 12px; border: 1px solid #cdd8d0; border-radius: 10px; }
.pub-agree { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; margin: 6px 0 14px; }
.pub-agree input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--green); }
.pub-btn { display: inline-flex; justify-content: center; padding: 14px 28px; border: 0; border-radius: 12px; background: var(--green); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.pub-btn--ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); margin-top: 12px; }
.pub-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pub-sigs div { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.pub-sigs img { height: 80px; width: auto; object-fit: contain; }
.pub-sigs small { font-size: .75rem; color: var(--muted); }
code { font-size: 11px; overflow-wrap: anywhere; }
.sig-pad { position: relative; margin: 6px 0 16px; border: 1.5px dashed #b8c7bd; border-radius: 14px; background: #fff; overflow: hidden; }
.sig-pad canvas { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.sig-pad-t { position: absolute; left: 14px; top: 10px; font-size: 12px; color: #889; pointer-events: none; }
.sig-pad.is-signed .sig-pad-t { display: none; }
.sig-clear { position: absolute; right: 10px; top: 8px; border: 0; background: rgba(0,0,0,.07); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; }

/* Relatório */
.pub-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pub-kpis div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.pub-kpis small { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pub-kpis b { font-size: 1.15rem; color: var(--navy); }
.pub-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pub-cols--chart { align-items: center; }
.pub-map { padding: 0; overflow: hidden; min-height: 260px; }
.pub-map iframe { width: 100%; height: 100%; min-height: 260px; border: 0; display: block; }
.pub-dl { display: grid; gap: 8px; }
.pub-dl div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; font-size: .9rem; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.pub-dl dt { color: var(--muted); }
.pub-dl dd { overflow-wrap: anywhere; }
.pub-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pt-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1fr; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: .875rem; align-items: center; }
.pt-row small { display: block; font-size: .75rem; color: var(--muted); }
.pt-head { border-top: 0; background: var(--navy); color: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.pub-pill { font-style: normal; display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; background: #eef2ef; color: #3c4b43; }
.pub-pill--ok { background: #e3f3e1; color: #9a3412; }
.pub-pill--warn { background: #fdf3d8; color: #8a5a00; }
.pub-pill--late { background: #fde6e4; color: #9b1c1c; }
.pub-conds, .pub-visits, .pub-docs { list-style: none; display: grid; gap: 10px; }
.pub-conds li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.pub-conds small { display: block; color: var(--muted); font-size: .78rem; }
.pc-ic { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: #eef2ef; flex-shrink: 0; font-weight: 700; }
.pub-conds .is-done .pc-ic { background: var(--green); color: #fff; }
.pub-conds .is-late { border-color: #f3c2bd; }
.pub-visits li { padding: 12px 14px; border-left: 3px solid var(--green); background: #f8fbf8; border-radius: 0 12px 12px 0; font-size: .9rem; }
.pub-visits span { color: var(--muted); }
.pub-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pub-thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; }
.pub-docs a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.pub-docs small { color: var(--muted); font-size: .78rem; }
.pub-sign { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: .9rem; }

/* Gráficos (mesmas classes do painel) */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: .85rem; }
.hbar div { height: 12px; border-radius: 6px; background: #eef2ef; overflow: hidden; }
.hbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #6cc35c); border-radius: 6px; }
.hbar b { text-align: right; }
.donut { position: relative; width: 190px; margin: 0 auto; }
.donut svg { width: 100%; transform: rotate(-90deg); }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-c b { font-size: 1.8rem; color: var(--navy); line-height: 1; }
.donut-c small { font-size: .72rem; color: var(--muted); }
.donut-leg { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 12px; font-size: .8rem; }
.donut-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.spark { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 18px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.spark span { position: relative; flex: 1; max-width: 56px; background: linear-gradient(180deg, #6cc35c, var(--green)); border-radius: 8px 8px 0 0; }
.spark b { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: .72rem; }
.spark i { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: .68rem; font-style: normal; color: var(--muted); }

.pub-foot { max-width: 1100px; margin: 0 auto; padding: 20px 16px 36px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.pub-foot div { display: flex; flex-direction: column; }
.eleve-credit { display: inline-flex; align-items: center; gap: 8px; font-size: .7rem; color: var(--muted); text-decoration: none; }
.eleve-credit img { height: 14px; width: auto; }

@media (max-width: 900px) {
	.pub-kpis { grid-template-columns: repeat(3, 1fr); }
	.pub-cols { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
	.pub-top { height: 72px; }
	.pub-brand img { height: 34px; }
	.pub-grid, .pub-sigs { grid-template-columns: 1fr; }
	.pub-kpis { grid-template-columns: repeat(2, 1fr); }
	.pt-row { grid-template-columns: 1fr 1fr; }
	.pt-head { display: none; }
	.hbar { grid-template-columns: 110px 1fr 56px; }
	.pub-dl div { grid-template-columns: 1fr; gap: 0; }
}
@media print {
	body.pub { background: #fff; }
	.no-print { display: none !important; }
	.pub-card, .pub-kpis div { break-inside: avoid; }
	.pub-top, .pt-head, .pub-doc h3, .pub-doc h4, .hbar i, .spark span, .pub-conds .is-done .pc-ic { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
