:root {
  --bg: #f7f5f0; --panel: #ffffff; --fg: #1f2430; --muted: #6b6f7a; --line: #e3dfd6;
  --accent: #1f3a5f; --gold: #a67c2e; --ok: #2e7d4f; --warn: #b26a00; --bad: #b3261e; --empty: #e8e4da;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --panel: #1c2027; --fg: #e8e6e1; --muted: #9aa0ab; --line: #2c313a;
    --accent: #8fb3e0; --gold: #d6aa58; --ok: #6cc28f; --warn: #e3a447; --bad: #ef7a72; --empty: #2c313a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 32px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; margin: 0; }
h1 { font-size: 28px; color: var(--accent); }
h2 { font-size: 21px; margin-bottom: 12px; }
.sub { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.lede { margin: 10px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile .lbl { color: var(--muted); font-size: 13px; }
.tile .num { font-family: Georgia, serif; font-size: 34px; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.acao { overflow-wrap: anywhere; min-width: 0; }
.acao h3 { margin: 0 0 2px; font-size: 16px; }
.acao .autor { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.acao .rot { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--gold); margin-top: 8px; }
.acao p { margin: 2px 0 0; }
.acao .meta { color: var(--muted); font-size: 12px; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.aviso { color: var(--warn); font-size: 13px; margin-top: 8px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; border: 1px solid currentColor; font-size: 12px; white-space: nowrap; }
.s-ok { color: var(--ok); } .s-warn { color: var(--warn); } .s-bad { color: var(--bad); } .s-muted { color: var(--muted); }
.obra-cob { margin-bottom: 18px; }
.obra-cob:last-child { margin-bottom: 0; }
.obra-cob .t { font-weight: 600; margin-bottom: 6px; }
.linha { display: grid; grid-template-columns: minmax(120px, 170px) 1fr 46px; gap: 10px; align-items: center; font-size: 13px; margin: 5px 0; }
.linha .nome { color: var(--muted); }
.linha .pct { text-align: right; font-variant-numeric: tabular-nums; }
.barra { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--empty); }
.barra span { height: 100%; }
.barra .Feito { background: var(--accent); }
.barra .Falta { background: var(--empty); }
.legenda { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
details { font-size: 13px; color: var(--muted); }
details ul { padding-left: 18px; }
.erro { color: var(--bad); }
footer { color: var(--muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.chip:hover { background: var(--accent); color: var(--panel); }
.pr-ctl { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .pr-ctl { grid-template-columns: 2fr 1fr; } }
.pr-ctl label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
select { font: inherit; font-size: 14px; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); width: 100%; }
.pr-info { overflow-wrap: anywhere; font-size: 13px; color: var(--muted); margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.pr-info .aviso { margin: 0; }
textarea.pr-texto { width: 100%; min-height: 260px; max-height: 60vh; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); resize: vertical; }
.pr-acoes { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.btn { font: inherit; font-size: 15px; padding: 10px 18px; border-radius: 8px; border: 0; background: var(--accent); color: var(--panel); cursor: pointer; }
.pr-ok { font-size: 13px; color: var(--ok); }

.sw-feito { background: var(--accent); }
.sw-falta { background: var(--empty); }
.alerta { color: var(--bad); font-weight: 600; margin: 0; }
.ciente { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-top: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.chip-pend { border-color: var(--bad); color: var(--bad); }
textarea.aprov-valor { min-height: 80px; }
#aprov ul { font-size: 13px; overflow-wrap: anywhere; }
a { color: var(--accent); }
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; padding-top: 6px; }
.aba { font: inherit; font-size: 15px; padding: 10px 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.aba.ativa { color: var(--accent); border-bottom-color: var(--gold); font-weight: 600; }
#aba-obras, #aba-escritos { display: flex; flex-direction: column; gap: 32px; }
#aba-obras[hidden], #aba-escritos[hidden] { display: none; }
.es-cab h2 { margin: 0; }
.filtros { margin-bottom: 8px; }
@media (min-width: 720px) { .filtros { grid-template-columns: 1fr 1fr; } }
.es-tit { font-weight: 600; }
.es-aut { color: var(--muted); font-size: 12px; }
.es-est { color: var(--muted); font-size: 12px; }
td.num-c { white-space: nowrap; font-variant-numeric: tabular-nums; }
