/* Engage — Reputation Timeline (tema claro) */
.ert-shell {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  color: #0f172a;
}

.ert-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
}

.ert-head h2 {
  margin: 0;
  font-size: 1.45rem;
  color: #0f1f4b;
  font-weight: 800;
}

.ert-lead {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.95rem;
  max-width: 40rem;
}

.ert-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ert-select,
.ert-btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}

.ert-btn:hover:not(:disabled) {
  background: #f8fafc;
}

.ert-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ert-btn--primary {
  background: #0f1f4b;
  border-color: #0f1f4b;
  color: #fff;
}

.ert-btn--primary:hover:not(:disabled) {
  background: #1e3a8a;
}

.ert-btn--ghost {
  background: #fff;
}

.ert-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 1100px) {
  .ert-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ert-kpis { grid-template-columns: 1fr 1fr; }
}

.ert-kpi {
  position: relative;
  padding: 0.9rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: 6.2rem;
}

.ert-kpi-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.ert-kpi-value {
  margin: 0.45rem 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f1f4b;
}

.ert-kpi-value.is-green { color: #16a34a; }
.ert-kpi-value.is-yellow { color: #ca8a04; }
.ert-kpi-value.is-red { color: #dc2626; }

.ert-kpi-sub {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ert-kpi-sub.is-good { color: #16a34a; font-weight: 600; }
.ert-kpi-sub.is-delta { color: #2563eb; font-weight: 600; }

.ert-kpi-icon {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 1.35rem;
  height: 1.35rem;
  opacity: 0.55;
  color: #64748b;
}

.ert-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16.5rem;
  gap: 0.9rem;
  align-items: start;
}

@media (max-width: 960px) {
  .ert-main { grid-template-columns: 1fr; }
}

.ert-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
}

.ert-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ert-card-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #0f1f4b;
}

.ert-chart-wrap {
  position: relative;
  height: 280px;
}

.ert-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: #64748b;
}

.ert-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ert-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  display: inline-block;
}

.ert-dot--health { background: #3b82f6; }
.ert-dot--volume { background: #22c55e; }
.ert-dot--trend { background: #f59e0b; }

.ert-filters h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: #0f1f4b;
}

.ert-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.ert-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.ert-field select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-size: 0.88rem;
}

.ert-filter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.ert-filter-actions .ert-btn {
  width: 100%;
  justify-content: center;
}

.ert-insights {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ert-insight {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
}

.ert-insight--critical {
  border-color: #fecaca;
  background: #fef2f2;
}

.ert-insight--info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.ert-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.ert-badge--alerta {
  background: #ffedd5;
  color: #c2410c;
}

.ert-badge--critical {
  background: #fee2e2;
  color: #b91c1c;
}

.ert-badge--info {
  background: #dbeafe;
  color: #1d4ed8;
}

.ert-badge--green {
  background: #dcfce7;
  color: #166534;
}

.ert-badge--yellow {
  background: #fef9c3;
  color: #a16207;
}

.ert-badge--red {
  background: #fee2e2;
  color: #b91c1c;
}

.ert-insight-msg {
  flex: 1 1 12rem;
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
}

.ert-link {
  appearance: none;
  border: 0;
  background: none;
  color: #2563eb;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.ert-table-wrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.ert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ert-table th,
.ert-table td {
  padding: 0.7rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.ert-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  white-space: nowrap;
}

.ert-alert-ok {
  color: #16a34a;
  font-weight: 600;
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.ert-alert-warn {
  color: #c2410c;
  font-weight: 600;
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.ert-more {
  display: flex;
  justify-content: center;
  padding: 0.85rem 0 0.2rem;
}

.ert-empty,
.ert-loading,
.ert-feedback {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
}

.ert-empty,
.ert-loading {
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.ert-feedback[data-tone="danger"] {
  background: #fee2e2;
  color: #b91c1c;
}

.ert-feedback[data-tone="info"] {
  background: #e0f2fe;
  color: #075985;
}

.ert-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.ert-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.ert-marker-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
}
