/* =============================================================
   SGE 2.0 — Módulo: Termômetro Diário
   ============================================================= */

/* ── Score: número grande com cor gradiente ── */
.termo-score-value {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  transition: color var(--transition-base);
}
.termo-score-positive { color: var(--success); }
.termo-score-neutral  { color: var(--warning); }
.termo-score-negative { color: var(--danger);  }

/* ── Cards de resumo ── */
.termo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}
@media (max-width: 1024px) {
  .termo-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .termo-kpi-grid { grid-template-columns: 1fr; }
}

.termo-kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.termo-kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.termo-kpi-card.clickable { cursor: pointer; }
.termo-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.termo-kpi-value {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
  color: var(--text-primary);
}
.termo-kpi-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Gráfico ── */
.termo-chart-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 22px;
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
}
.termo-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.termo-chart-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}
.termo-period-btns {
  display: flex;
  gap: 4px;
}
.termo-period-btn {
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.termo-period-btn.active,
.termo-period-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.termo-chart-container {
  position: relative;
  height: 240px;
}

/* ── Layout 2 colunas (posts + perfis) ── */
.termo-two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}
@media (max-width: 1100px) {
  .termo-two-col { grid-template-columns: 1fr; }
}

/* ── Posts ── */
.termo-posts-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.termo-posts-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.termo-posts-filters {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.termo-posts-list {
  padding: 0;
}
.termo-post-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
.termo-post-item:last-child { border-bottom: none; }
.termo-post-item:hover { background: var(--bg-section); }
.termo-post-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.termo-post-dot.positivo { background: var(--success); }
.termo-post-dot.negativo { background: var(--danger); }
.termo-post-dot.neutro   { background: var(--text-muted); }
.termo-post-dot.pendente { background: var(--warning); }
.termo-post-body { flex: 1; min-width: 0; }
.termo-post-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.termo-post-author:hover { text-decoration: underline; }
.termo-post-text {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 3px 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.termo-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.73rem;
  color: var(--text-muted);
}
.termo-post-meta i { font-size: 0.7rem; }
.termo-posts-more {
  padding: 14px 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ── Badge de sentimento ── */
.termo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.termo-badge.positivo { background: var(--success-bg); color: var(--success); }
.termo-badge.negativo { background: var(--danger-bg);  color: var(--danger);  }
.termo-badge.neutro   { background: var(--bg-section); color: var(--text-muted); border: 1px solid var(--border); }
.termo-badge.pendente { background: var(--warning-bg); color: var(--warning); }

/* ── Relevância ── */
.termo-rel-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 1px 6px;
}
.termo-rel-badge.alta { color: var(--primary-light); border-color: var(--primary-bg); background: var(--primary-bg); }

/* ── Perfis em destaque ── */
.termo-perfis-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.termo-perfis-section {
  border-bottom: 1px solid var(--border);
}
.termo-perfis-section:last-child { border-bottom: none; }
.termo-perfis-section-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  background: var(--bg-section);
}
.termo-perfis-section-header:hover { background: var(--border); }
.termo-perfis-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.termo-perfis-list {
  padding: 4px 0;
}
.termo-perfil-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.termo-perfil-item:last-child { border-bottom: none; }
.termo-perfil-item:hover { background: var(--bg-section); }
.termo-perfil-username { font-weight: 600; color: var(--primary); }
.termo-perfil-stats { color: var(--text-muted); font-size: 0.73rem; }

/* ── Alertas ── */
.termo-alertas-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--spacing-xl);
}
.termo-alertas-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.termo-alerta-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
.termo-alerta-item:last-child { border-bottom: none; }
.termo-alerta-item.lido { opacity: 0.55; }
.termo-alerta-item:hover { background: var(--bg-section); }
.termo-alerta-severidade {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.sev-critica { background: var(--danger); }
.sev-alta    { background: #F97316; }    /* orange */
.sev-media   { background: var(--warning); }
.sev-baixa   { background: var(--success); }
.termo-alerta-body { flex: 1; min-width: 0; }
.termo-alerta-titulo {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.termo-alerta-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.termo-alerta-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Botão Modo Crise ── */
.termo-crise-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.termo-crise-btn:hover { filter: brightness(0.88); }
.termo-crise-btn.ativo {
  background: #B91C1C;
  animation: termo-pulse 1.8s ease-in-out infinite;
}
@keyframes termo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50%       { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* ── Empty state compacto ── */
.termo-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.termo-empty i { font-size: 1.8rem; margin-bottom: 8px; display: block; }

/* ── Loading inline ── */
.termo-loading {
  padding: 28px;
  display: flex;
  justify-content: center;
}

/* ── Skeleton dos cards ── */
.termo-kpi-skel {
  height: 24px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-section) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: termo-shimmer 1.4s ease infinite;
}
@keyframes termo-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Modo Crise: banner ── */
.termo-crise-banner {
  background: linear-gradient(135deg, #991B1B, #B91C1C);
  color: white;
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: var(--spacing-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: termo-pulse 2s ease-in-out infinite;
}
.termo-crise-banner i { font-size: 1.2rem; }
.termo-crise-banner-text { flex: 1; font-size: 0.85rem; font-weight: 600; }
.termo-crise-banner-timer { font-size: 1.1rem; font-weight: 900; font-variant-numeric: tabular-nums; }
