/* Analytics — Financeiro — Faturamento (layout PDF) */
#analyticsFaturamentoView .af-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
#analyticsFaturamentoView .af-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}
#analyticsFaturamentoView .af-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
#analyticsFaturamentoView .af-tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
#analyticsFaturamentoView .af-tab.active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
#analyticsFaturamentoView .af-panel.hidden { display: none; }

#analyticsFaturamentoView .af-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
#analyticsFaturamentoView .af-kpi-strip--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  #analyticsFaturamentoView .af-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#analyticsFaturamentoView .af-kpi-main {
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, #fff5f5 0%, #ffffff 70%);
}
#analyticsFaturamentoView .af-kpi-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 0.3rem;
}
#analyticsFaturamentoView .af-kpi-main strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: #991b1b;
}

#analyticsFaturamentoView .af-compare-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 1100px) {
  #analyticsFaturamentoView .af-compare-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#analyticsFaturamentoView .af-compare-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
}
#analyticsFaturamentoView .af-compare-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.25rem;
}
#analyticsFaturamentoView .af-compare-row strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
#analyticsFaturamentoView .af-compare-var {
  margin-top: 0.45rem;
  font-size: 0.95rem;
  font-weight: 800;
}
#analyticsFaturamentoView .af-compare-var.is-up,
#analyticsFaturamentoView .af-delta.is-up { color: #047857; }
#analyticsFaturamentoView .af-compare-var.is-down,
#analyticsFaturamentoView .af-delta.is-down { color: #b91c1c; }
#analyticsFaturamentoView .af-compare-var.is-flat,
#analyticsFaturamentoView .af-delta.is-flat { color: #64748b; }

#analyticsFaturamentoView .af-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 1200px) {
  #analyticsFaturamentoView .af-grid-2 { grid-template-columns: 1fr; }
}
#analyticsFaturamentoView .af-section { padding: 14px; }
#analyticsFaturamentoView .af-section-title {
  margin: 0 0 0.7rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
}
#analyticsFaturamentoView .af-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#analyticsFaturamentoView .af-chart-wrap {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
#analyticsFaturamentoView .af-chart-hint {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}
#analyticsFaturamentoView .af-chart-canvas-wrap {
  position: relative;
  height: 260px;
  width: 100%;
}
#analyticsFaturamentoView .af-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
#analyticsFaturamentoView .af-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.92);
  border-radius: 8px;
}
#analyticsFaturamentoView .af-chart-empty.hidden {
  display: none;
}

#analyticsFaturamentoView .af-table-wrap {
  overflow: auto;
  max-height: 420px;
}
#analyticsFaturamentoView .af-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
#analyticsFaturamentoView .af-table th,
#analyticsFaturamentoView .af-table td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}
#analyticsFaturamentoView .af-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 1;
}
#analyticsFaturamentoView .af-table td.num,
#analyticsFaturamentoView .af-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#analyticsFaturamentoView .af-empty {
  text-align: center;
  color: #94a3b8;
  padding: 1.2rem !important;
}
#analyticsFaturamentoView .af-var-up { color: #047857; font-weight: 700; }
#analyticsFaturamentoView .af-var-down { color: #b91c1c; font-weight: 700; }

#analyticsFaturamentoView .af-seg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}
@media (max-width: 1000px) {
  #analyticsFaturamentoView .af-seg-grid { grid-template-columns: 1fr; }
}
#analyticsFaturamentoView .af-seg-card {
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 75%);
}
#analyticsFaturamentoView .af-seg-card h4 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: #9a3412;
}
#analyticsFaturamentoView .af-seg-card .af-compare-row strong {
  font-size: 1.05rem;
}
