/* Análise da investigação (abas abaixo da maquete) e relatório em PDF. Tema por html[data-theme]. */
#analysisPanel, #printReport {
  --an-bg: #1F262E; --an-bg2: #171C22; --an-field: #12161B; --an-line: #2E3742; --an-line2: #3A4551;
  --an-ink: #E6EAEE; --an-ink2: #C3CCD3; --an-muted: #8FA0AE; --an-accent: #74D6A3; --an-green: #3E7C59;
}
html[data-theme="light"] #analysisPanel, #printReport {
  --an-bg: #FBFAF6; --an-bg2: #F4F1E9; --an-field: #FFFFFF; --an-line: #DCE3E8; --an-line2: #C7D0D6;
  --an-ink: #1F2E3D; --an-ink2: #33475A; --an-muted: #5E6E7C; --an-accent: #2F7D55; --an-green: #2F6B4A;
}
#analysisPanel { margin-top: 26px; padding-top: 18px; border-top: 1.5px solid var(--an-line2); color: var(--an-ink); }
#analysisPanel h2 { font-size: 20px; margin: 2px 0 0; color: var(--an-ink); }
#analysisPanel h3 { font-size: 14px; margin: 0 0 8px; color: var(--an-ink); }
#analysisPanel p, #analysisPanel li { font-size: 13px; color: var(--an-ink2); }
#analysisPanel ul, #analysisPanel ol { margin: 6px 0 10px; padding-left: 18px; }
.an-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.an-eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--an-muted); }
.an-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.an-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.an-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 16px 0 0; border-bottom: 1px solid var(--an-line); }
.an-tabs button { font: inherit; font-size: 13px; font-weight: 600; padding: 9px 14px; border: 1px solid transparent; border-bottom: none; border-radius: 4px 4px 0 0; background: none; color: var(--an-muted); cursor: pointer; margin-bottom: -1px; }
.an-tabs button[aria-selected="true"] { color: var(--an-ink); background: var(--an-bg); border-color: var(--an-line); }
.an-body { padding: 18px 0 8px; }
.an-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.an-grid.sim { grid-template-columns: 1fr 1.25fr; }
.an-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.an-card { background: var(--an-bg); border: 1px solid var(--an-line); border-radius: 4px; padding: 14px 16px; min-width: 0; }
.an-help { font-size: 12px !important; color: var(--an-muted) !important; margin: 4px 0 8px; }
.an-opt { font-weight: 400; color: var(--an-muted); font-size: 12px; }
.an-empty { font-size: 13px; color: var(--an-muted) !important; }
.an-desc { font-size: 14px !important; line-height: 1.55; }
#analysisPanel .an-text, #analysisPanel input[type=text], #analysisPanel input[type=date], #analysisPanel select {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 9px; border-radius: 3px; border: 1px solid var(--an-line2) !important; background: var(--an-field) !important; color: var(--an-ink) !important;
}
#analysisPanel .an-text { resize: vertical; min-height: 44px; }
.an-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.an-kpi { background: var(--an-bg2); border: 1px solid var(--an-line); border-radius: 4px; padding: 9px 10px; }
.an-kpi b { display: block; font-size: 20px; line-height: 1.2; }
.an-kpi span { font-size: 11px; color: var(--an-muted); }
.an-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.an-chip { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--an-line2); color: var(--an-ink2); }
.an-chip.accent { border-color: var(--an-accent); color: var(--an-accent); }
.an-level { padding: 2px 8px; border-radius: 3px; color: #fff; }
.an-level.l0 { background: #C9A227; } .an-level.l1 { background: #D9822B; } .an-level.l2 { background: #C1443C; }
.an-seg { display: inline-flex; border: 1px solid var(--an-line2); border-radius: 4px; overflow: hidden; }
.an-seg button { font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border: none; border-right: 1px solid var(--an-line2); background: var(--an-bg); color: var(--an-ink); cursor: pointer; }
.an-seg button:last-child { border-right: none; }
.an-seg button[aria-pressed="true"] { background: #3E7C59; color: #fff; }
.an-progress { height: 8px; border-radius: 4px; background: var(--an-line); overflow: hidden; margin-top: 6px; display: flex; }
.an-progress i { display: block; height: 100%; background: #3E7C59; }
.an-progress i.mid { background: #C9A227; }

/* 10 passos */
.an-passos { list-style: none; padding: 0 !important; margin: 0 !important; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.an-passos li { display: flex; gap: 10px; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--an-line); background: var(--an-bg); }
.an-passos li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.an-passos .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid var(--an-line2); }
.an-passos li.andamento { border-color: #C9A227; } .an-passos li.andamento .n { background: #C9A227; border-color: #C9A227; color: #fff; }
.an-passos li.concluido { border-color: var(--an-accent); } .an-passos li.concluido .n { background: #3E7C59; border-color: #3E7C59; color: #fff; }
.an-passos b { font-size: 13px; }
.an-passos select { width: auto !important; font-size: 12px !important; padding: 3px 6px !important; }
.an-passos .txt { font-size: 12px; color: var(--an-ink2); }
.an-hint { font-size: 12px; color: var(--an-ink2); background: var(--an-bg2); border-left: 3px solid var(--an-accent); padding: 6px 9px; border-radius: 2px; }
.btn.small-an { font-size: 11px; padding: 2px 7px; margin-left: 4px; }

/* gráficos */
.an-chart { width: 100%; height: auto; display: block; }
.an-chart text { fill: var(--an-muted); font-size: 11px; font-family: inherit; }
.an-chart .axis { stroke: var(--an-line2); }
.an-chart .grid { stroke: var(--an-line); }
.an-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--an-muted); margin-top: 8px; }
.an-legend i { display: inline-block; width: 14px; height: 10px; margin-right: 5px; vertical-align: middle; border-radius: 1px; }
.an-hbars { display: flex; flex-direction: column; gap: 7px; }
.an-hbar { display: grid; grid-template-columns: minmax(0, 1.3fr) 2fr 44px; gap: 8px; align-items: center; font-size: 12px; color: var(--an-ink2); }
.an-hbar .lbl, .an-gantt-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-hbar .track { position: relative; height: 12px; background: var(--an-bg2); border-radius: 2px; overflow: hidden; }
.an-hbar .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.an-hbar .track i.bg { background: var(--an-line); }
.an-hbar b { text-align: right; font-size: 12px; }
.an-gantt { display: flex; flex-direction: column; gap: 6px; }
.an-gantt-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 2fr; gap: 8px; align-items: center; font-size: 12px; color: var(--an-ink2); }
.an-gantt-row .track { position: relative; height: 12px; background: var(--an-bg2); border-radius: 2px; }
.an-gantt-row .track i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }

/* medidas */
.an-measure { padding: 10px 0; border-bottom: 1px solid var(--an-line); }
.an-measure:last-of-type { border-bottom: none; }
.an-measure.off .an-check span { color: var(--an-muted); text-decoration: line-through; }
.an-mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 8px; padding-left: 24px; }
.an-mgrid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--an-muted); }
.an-mgrid label.wide { grid-column: 1 / -1; }
.an-mgrid input[type=range] { accent-color: #3E7C59; width: 100%; }
.an-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--an-ink2); margin: 5px 0; cursor: pointer; }
.an-check input { margin-top: 3px; accent-color: #3E7C59; width: 16px; height: 16px; flex: none; }
.an-check.done span { text-decoration: line-through; color: var(--an-muted); }
.an-check .tag { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 3px; border: 1px solid var(--an-accent); color: var(--an-accent); text-decoration: none; display: inline-block; }
.an-x { background: none; border: none; color: #C1443C; cursor: pointer; font-size: 13px; padding: 0 4px; flex: none; }
.an-add { display: flex; gap: 8px; margin-top: 10px; }
.an-add.small { margin-top: 6px; }
.an-add.small input { font-size: 12px !important; padding: 5px 7px !important; }
.an-sug { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--an-line); }
.an-sug:last-child { border-bottom: none; }
.an-sug b { display: block; font-size: 13px; font-weight: 600; }
.an-sug span { font-size: 11px; color: var(--an-muted); }
.an-sug .an-row { flex: none; }

/* plano */
.an-step { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--an-line); }
.an-step:last-child { border-bottom: none; }
.an-step .big { width: 34px; height: 34px; border-radius: 50%; background: #3E7C59; color: #fff; display: grid; place-items: center; font-weight: 700; }
.an-step h3 { margin: 4px 0 0 !important; }
.an-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.an-lv { display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--an-line); border-radius: 4px; padding: 8px 10px; background: var(--an-bg2); font-size: 12px; }
.an-lv.l0 { border-top: 3px solid #C9A227; } .an-lv.l1 { border-top: 3px solid #D9822B; } .an-lv.l2 { border-top: 3px solid #C1443C; }
.an-lv.now { box-shadow: 0 0 0 2px var(--an-accent); }
.an-eixos { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.an-eixo { border: 1px solid var(--an-line); border-radius: 4px; padding: 9px 11px; background: var(--an-bg2); }
.an-eixo > b { font-size: 12px; display: block; margin-bottom: 4px; }
.an-sphere { border: 1px dashed var(--an-accent); border-radius: 4px; padding: 9px 11px; margin-top: 10px; }
.an-sphere b { color: var(--an-accent); font-size: 12px; }
.an-sub { display: block; font-size: 12px; margin: 10px 0 4px; }
.an-flow { padding-left: 18px; }
.an-tl { display: grid; grid-template-columns: 110px 1fr; gap: 5px 10px; font-size: 12px; margin-top: 6px; }
.an-tl b { color: var(--an-accent); }
.an-tl span { color: var(--an-ink2); }

/* indicador de última edição e equipe (barra de sincronização) */
.last-edit { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid #3E7C59; color: #3E7C59; font-weight: 600; }
.team-chip { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid #9B6FE0; color: #9B6FE0; text-decoration: none; font-weight: 600; }
html[data-theme="dark"] .last-edit { color: #74D6A3 !important; border-color: #3E7C59 !important; }
html[data-theme="dark"] .team-chip { color: #B79CF0 !important; }
.lock-note { font-size: 11px; color: #8FA0AE; }

@media (max-width: 980px) {
  .an-grid, .an-grid.sim, .an-passos, .an-levels { grid-template-columns: 1fr; }
  .an-kpis { grid-template-columns: 1fr 1fr; }
  .an-mgrid { grid-template-columns: 1fr; padding-left: 0; }
}

/* relatório (só aparece na impressão / PDF) */
#printReport { display: none; }
@media print {
  #printReport { display: block; color: #1F2E3D; margin-top: 18px; }
  body.print-report-only .wrap > *:not(#printReport) { display: none !important; }
  body.print-report-only #printReport { margin-top: 0; }
  body:not(.print-report-only) #printReport { break-before: page; }
  #printReport .an-card, #printReport .an-kpi { background: #fff; border-color: #DCE3E8; break-inside: avoid; }
  #printReport .an-chart { max-height: 230px; }
}
.rp-head { border-bottom: 2px solid #3E7C59; padding-bottom: 8px; margin-bottom: 10px; }
.rp-brand { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #3E7C59; font-weight: 700; }
#printReport h1 { font-size: 22px; margin: 4px 0; color: #1F2E3D; }
#printReport h2 { font-size: 15px; margin: 0 0 6px; color: #1F2E3D; border-bottom: 1px solid #DCE3E8; padding-bottom: 3px; }
#printReport h3 { font-size: 13px; margin: 0 0 6px; }
#printReport p, #printReport li, #printReport td, #printReport th { font-size: 11.5px; color: #33475A; }
.rp-meta { font-size: 11px; color: #5E6E7C; }
.rp-sec { margin: 14px 0; break-inside: auto; }
.rp-pre { white-space: pre-wrap; }
.rp-table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.rp-table th, .rp-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #E4E9EC; }
.rp-table th { font-size: 10px !important; text-transform: uppercase; color: #5E6E7C; }
.rp-passos { list-style: none; padding: 0; columns: 2; column-gap: 18px; }
.rp-passos li { break-inside: avoid; margin-bottom: 6px; }
.rp-st { font-size: 10px; padding: 0 6px; border-radius: 3px; border: 1px solid #9AA5AC; color: #5E6E7C; }
.rp-st.andamento { border-color: #C9A227; color: #8A6D1E; } .rp-st.concluido { border-color: #3E7C59; color: #2F6B4A; }
.rp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.rp-cols ul { margin: 2px 0 8px; padding-left: 16px; }
.rp-foot { margin-top: 18px; font-size: 10px; color: #8A96A0; border-top: 1px solid #DCE3E8; padding-top: 6px; }
#printReport .an-kpis { grid-template-columns: repeat(4, 1fr); }
#printReport .an-chart text { fill: #5E6E7C; }
#printReport .an-chart .grid { stroke: #E4E9EC; } #printReport .an-chart .axis { stroke: #B9C3CA; }
