/* NES Risk Engine — Central de Risco Clínico — v1.0 — 2026-06-27 */

/* ── Painel principal ─────────────────────────────────────── */
.nes-risk-panel {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin: 16px 0;
  max-width: 900px;
}

/* ── Header com score ─────────────────────────────────────── */
.nes-risk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.nes-risk-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f4c66;
  margin: 0;
}

.nes-risk-score {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f4c66;
}

/* ── Score gauge ──────────────────────────────────────────── */
.nes-risk-gauge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  flex-shrink: 0;
}

.nes-risk-gauge.verde    { background: #dcfce7; color: #166534; border: 3px solid #86efac; }
.nes-risk-gauge.amarelo  { background: #fef9c3; color: #854d0e; border: 3px solid #fcd34d; }
.nes-risk-gauge.vermelho { background: #fee2e2; color: #991b1b; border: 3px solid #fca5a5; }

/* ── Grid de dimensões de risco ───────────────────────────── */
.nes-risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.nes-risk-dim {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  transition: background 0.1s;
}

.nes-risk-dim:hover { background: #f1f5f9; }

.nes-risk-dim.destaque-vermelho { border-color: #fca5a5; background: #fef2f2; }
.nes-risk-dim.destaque-amarelo  { border-color: #fcd34d; background: #fffbeb; }

/* ── Badges ───────────────────────────────────────────────── */
.nes-risk-badge {
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
}

.nes-risk-verde   { background: #dcfce7; color: #166534; }
.nes-risk-amarelo { background: #fef9c3; color: #854d0e; }
.nes-risk-vermelho{ background: #fee2e2; color: #991b1b; }

/* ── Alertas priorizados ──────────────────────────────────── */
.nes-risk-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f4c66;
  margin: 16px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
}

.nes-risk-alerts {
  padding-left: 0;
  list-style: none;
  margin: 0 0 14px;
}

.nes-risk-alert {
  border-left: 4px solid #cbd5e1;
  background: #f8fafc;
  padding: 9px 12px;
  margin-bottom: 7px;
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.nes-risk-alert strong { color: #0f4c66; }

.nes-risk-priority-alta   { border-left-color: #dc2626; background: #fef2f2; }
.nes-risk-priority-media  { border-left-color: #ca8a04; background: #fffbeb; }
.nes-risk-priority-baixa  { border-left-color: #16a34a; background: #f0fdf4; }

/* ── Recomendações ────────────────────────────────────────── */
.nes-risk-recomendacoes {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #1e40af;
  line-height: 1.6;
}

.nes-risk-recomendacoes ul { margin: 4px 0 0; padding-left: 18px; }
.nes-risk-recomendacoes li { margin-bottom: 3px; }

/* ── Meta info ────────────────────────────────────────────── */
.nes-risk-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.nes-risk-meta span strong { color: #374151; }

/* ── Histórico ────────────────────────────────────────────── */
.nes-risk-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 10px;
}

.nes-risk-hist-table th,
.nes-risk-hist-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 9px;
  text-align: left;
}

.nes-risk-hist-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #0f4c66;
}

.nes-risk-hist-table tbody tr:nth-child(even) { background: #f8fafc; }

/* ── Dashboard cards ──────────────────────────────────────── */
.nes-risk-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.nes-risk-dash-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.nes-risk-dash-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.nes-risk-dash-card.alerta-vermelho { border-color: #fca5a5; background: #fef2f2; }
.nes-risk-dash-card.alerta-amarelo  { border-color: #fcd34d; background: #fffbeb; }

.nes-risk-dash-val {
  font-size: 2rem;
  font-weight: 800;
  color: #0f4c66;
  display: block;
}

.nes-risk-dash-lbl {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

/* ── Barra de progresso score ─────────────────────────────── */
.nes-risk-bar-wrap {
  background: #e2e8f0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 6px 0 2px;
}

.nes-risk-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.nes-risk-bar.verde    { background: #22c55e; }
.nes-risk-bar.amarelo  { background: #f59e0b; }
.nes-risk-bar.vermelho { background: #ef4444; }

/* ── Loading / empty ──────────────────────────────────────── */
.nes-risk-empty {
  text-align: center;
  padding: 32px 16px;
  color: #64748b;
  font-size: 0.88rem;
}

.nes-risk-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }

/* ── Disclaimer ───────────────────────────────────────────── */
.nes-risk-disclaimer {
  font-size: 0.71rem;
  color: #94a3b8;
  margin-top: 14px;
  line-height: 1.5;
}

/* ── Footer botões ────────────────────────────────────────── */
.nes-risk-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  align-items: center;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nes-risk-grid { grid-template-columns: 1fr 1fr; }
  .nes-risk-dashboard { grid-template-columns: 1fr 1fr; }
  .nes-risk-header { flex-direction: column; align-items: flex-start; }
  .nes-risk-footer { flex-direction: column; }
}
