/* Relatórios e indicadores. Série A = azul CTICOR, série B = âmbar claro (paleta validada para daltonismo). */
:root { --series-a: #25659b; --series-b: #d0802f; }

.report-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 18px 24px 12px; margin-bottom: 22px; background: #fafbfd; }
.report-filters > div { min-width: 0; }
.report-filters label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.report-filters select { min-height: 42px; width: 100%; color: var(--ink); background: white; border: 1px solid #d4dee8; border-radius: 6px; padding: 9px 10px; font-size: 12px; }
.report-filter-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.report-filter-footer .text-button { font-size: 12px; padding: 8px 0; }

.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; box-shadow: var(--shadow); }
.report-kpi { display: grid; gap: 2px; padding: 18px 24px; min-width: 0; }
.report-kpi:not(:nth-child(4n + 1)) { border-left: 1px solid var(--line); }
.report-kpi:nth-child(n + 5) { border-top: 1px solid var(--line); }
.report-kpi span { color: var(--muted); font-size: 12px; }
.report-kpi strong { font-size: 27px; font-weight: 650; letter-spacing: -.6px; line-height: 1.25; white-space: nowrap; }
.report-kpi strong small { font-size: 17px; font-weight: 500; }
.report-kpi small { color: var(--muted); font-size: 11px; }
.report-kpi.good strong { color: var(--green); }
.report-kpi.warn strong { color: var(--amber); }
.report-kpi.bad strong { color: #b03346; }

.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.report-panel { display: flex; flex-direction: column; }
.report-wide { grid-column: 1 / -1; }
.report-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px 24px 14px; }
.report-heading h2 { font-size: 16px; letter-spacing: -.3px; }
.report-heading p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.report-total { font-size: 11px; color: var(--muted); white-space: nowrap; padding-top: 3px; }
.report-footnote { font-size: 11px; color: var(--muted); padding: 12px 24px 16px; border-top: 1px solid #edf0f4; margin-top: auto; }
.report-empty { margin: 4px 24px 24px; padding: 22px; border-radius: 8px; background: #f5f8fb; color: var(--muted); font-size: 13px; text-align: center; }
.meta-tag { font-size: 11px; font-weight: 600; color: var(--amber); background: var(--warning-bg); border-radius: 5px; padding: 3px 8px; white-space: nowrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #eaf2fa; color: var(--blue); font-size: 12px; font-weight: 600; white-space: nowrap; }
.filter-chip:hover { background: #dbe9f6; }

/* Funil */
.funnel { list-style: none; margin: 0; padding: 4px 24px 22px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.funnel-step { width: 100%; display: grid; gap: 10px; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: white; transition: border-color .15s ease, opacity .15s ease, background .15s ease; }
.funnel-step:hover { border-color: #8ba7bf; background: #fbfcfe; }
.funnel-step.selected { border-color: var(--blue); background: #f5f9fd; box-shadow: 0 0 0 3px #25659b14; }
.funnel-step.dimmed { opacity: .55; }
.funnel-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.funnel-label b { font-size: 10px; color: var(--muted); font-weight: 700; }
.funnel-bar { height: 8px; border-radius: 4px; background: #edf1f5; overflow: hidden; }
.funnel-bar span { display: block; height: 100%; border-radius: 4px; background: var(--series-a); }
.funnel li:last-child .funnel-bar span { background: var(--green); }
.funnel-value { display: flex; align-items: baseline; gap: 8px; }
.funnel-value strong { font-size: 24px; font-weight: 650; letter-spacing: -.5px; }
.funnel-value small { font-size: 11px; color: var(--muted); }

/* Barras horizontais */
.hbars { display: grid; gap: 11px; padding: 6px 24px 22px; }
.hbar { display: grid; grid-template-columns: minmax(130px, 34%) minmax(0, 1fr) 32px; gap: 12px; align-items: center; font-size: 12px; }
.hbar-label { min-width: 0; }
.hbar-label small { display: block; font-size: 10px; color: var(--muted); }
.hbar-track { height: 12px; border-radius: 0 4px 4px 0; background: #f1f4f7; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--series-a); border-radius: 0 4px 4px 0; }
.hbar:hover .hbar-track span { background: var(--navy); }
.hbar-value { font-weight: 650; text-align: right; }

/* Evolução mensal */
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); white-space: nowrap; padding-top: 3px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch.a { background: var(--series-a); }
.swatch.b { background: var(--series-b); }
.chart-box { padding: 0 18px 6px; }
.evolution-chart { display: block; width: 100%; height: auto; }
.evolution-chart .series-a { fill: var(--series-a); }
.evolution-chart .series-b { fill: var(--series-b); }
.evolution-chart .is-illustrative path, .evolution-chart .is-illustrative rect { opacity: .45; }
.evolution-chart path:hover, .evolution-chart rect:hover { opacity: 1; }
.grid-line { stroke: #edf1f5; stroke-width: 1; }
.base-line { stroke: #c9d4df; stroke-width: 1; }
.axis-text { fill: #758496; font-size: 10px; font-family: var(--font); }
.value-text { fill: var(--ink); font-size: 11px; font-weight: 650; font-family: var(--font); }

/* Tempo de ativação e informes */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 24px; border: 1px solid var(--line); border-radius: 10px; }
.stat-row > div { display: grid; gap: 2px; padding: 12px 16px; min-width: 0; }
.stat-row > div + div { border-left: 1px solid var(--line); }
.stat-row span { font-size: 11px; color: var(--muted); }
.stat-row strong { font-size: 20px; font-weight: 650; letter-spacing: -.4px; }
.stat-row strong small { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-row small { font-size: 11px; color: var(--muted); }
.stat-row .warn strong { color: var(--amber); }
.activation-bars { display: grid; gap: 7px; padding: 16px 24px 16px; }
.activation-bar { display: grid; grid-template-columns: 70px minmax(0, 1fr) 30px; gap: 10px; align-items: center; font-size: 12px; }
.activation-bar:hover .activation-name { color: var(--blue); text-decoration: underline; }
.activation-track { position: relative; height: 10px; border-radius: 0 4px 4px 0; background: #f1f4f7; }
.activation-track span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-a); }
.activation-bar.over .activation-track span { background: var(--series-b); }
.activation-track i { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--navy); border-radius: 1px; }
.activation-value { font-weight: 650; text-align: right; }
.informe-stats { margin-top: 2px; }
.informe-note { margin: 16px 24px 22px; }

/* Pendências */
.pend-types { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 10px; }
.pend-type { font-size: 11px; color: var(--muted); background: #f3f6f9; border-radius: 999px; padding: 4px 10px; }
.pend-type b { color: var(--ink); margin-left: 3px; }
.pend-list { display: grid; padding: 0 12px 12px; max-height: 360px; overflow-y: auto; }
.pend-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; }
.pend-item:hover { background: #f5f8fc; }
.pend-item > .icon { width: 15px; color: #8195a8; margin-left: auto; }
.pend-copy { display: grid; gap: 1px; min-width: 0; }
.pend-copy strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.pend-copy small { font-size: 11px; color: var(--muted); }

/* Tabela de carteira */
.portfolio .report-heading .secondary-button { white-space: nowrap; }
.report-table { min-width: 980px; }
.report-table .num { text-align: right; white-space: nowrap; }
.report-table tfoot td { font-weight: 650; background: #fafbfd; border-top: 1px solid var(--line); padding-block: 14px; }

.chart-tip { position: fixed; top: 0; left: 0; z-index: 20; pointer-events: none; max-width: 260px; padding: 7px 10px; border-radius: 6px; background: var(--navy); color: white; font-size: 12px; box-shadow: 0 4px 16px #102e4f30; }

@media (max-width: 1199px) {
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-kpi { padding-inline: 18px; }
  .report-kpi strong { font-size: 23px; }
}
@media (max-width: 1023px) {
  .report-grid { grid-template-columns: 1fr; }
  .report-filters { grid-template-columns: 1fr 1fr; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .report-kpi:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .report-kpi:nth-child(even) { border-left: 1px solid var(--line); }
  .report-kpi:nth-child(-n + 2) { border-top: 0; }
}
@media (max-width: 700px) {
  .commercial-heading .heading-actions .heading-button { flex: 1; justify-content: center; }
  .report-filters { padding: 16px; gap: 12px 10px; }
  .report-filters select { font-size: 16px; }
  .report-kpi { padding: 14px 16px; }
  .report-kpi strong { font-size: 21px; }
  .report-heading { padding: 18px 16px 12px; flex-wrap: wrap; }
  .funnel { grid-template-columns: 1fr 1fr; padding-inline: 16px; }
  .hbars, .activation-bars { padding-inline: 16px; }
  .hbar { grid-template-columns: minmax(0, 1fr) 32px; gap: 4px 10px; }
  .hbar-track { grid-column: 1 / -1; grid-row: 2; }
  .stat-row { margin-inline: 16px; }
  .stat-row > div { padding: 10px 12px; }
  .stat-row strong { font-size: 17px; }
  .chart-box { padding-inline: 8px; }
  .pend-types { padding-inline: 16px; }
  .pend-list { padding-inline: 4px; }
  .informe-note { margin-inline: 16px; }
  .report-footnote { padding-inline: 16px; }
}
