.system-body {
  background: radial-gradient(ellipse at top, #0f1626 0%, var(--bg) 55%);
}

.system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.system-header h1 { font-size: 18px; margin: 0; }
.system-header .header-right { display: flex; align-items: center; gap: 14px; }
.system-header .back-link { color: var(--accent); text-decoration: none; font-size: 13px; }
.system-header .back-link:hover { text-decoration: underline; }
.last-updated { color: var(--muted); font-size: 12px; }

.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  animation: livepulse 2s infinite;
}
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
.live-dot.stale { background: var(--red); animation: none; box-shadow: none; }

.system-main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }

/* ---- Hero: aro de confianza ---- */
.confidence-hero {
  display: flex;
  gap: 32px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.gauge-wrap { position: relative; width: 220px; height: 220px; flex-shrink: 0; margin: 0 auto; }
.gauge-svg { width: 220px; height: 220px; transform: rotate(-90deg); }
.gauge-track {
  fill: none;
  stroke: #1c2438;
  stroke-width: 14;
}
.gauge-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 578;
  stroke-dashoffset: 578;
  transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1), stroke 0.6s ease;
  filter: drop-shadow(0 0 6px currentColor);
}

.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.gauge-value { font-size: 40px; font-weight: 800; color: var(--text); line-height: 1; }
.gauge-label { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

.hero-side { flex: 1; min-width: 260px; }
.hero-explainer { color: var(--text); font-size: 13.5px; line-height: 1.6; margin: 0 0 12px; }
.hero-disclaimer {
  background: #3a2a10;
  color: var(--amber);
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #5a3f14;
  line-height: 1.5;
  margin: 0;
}

/* ---- Grilla de componentes ---- */
.components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.component-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.component-card .comp-icon { font-size: 18px; }
.component-card .comp-label { font-size: 12px; color: var(--muted); margin: 6px 0 8px; min-height: 30px; }
.component-card .comp-pct { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.comp-bar-track { height: 6px; border-radius: 3px; background: #1c2438; overflow: hidden; }
.comp-bar-fill { height: 100%; border-radius: 3px; transition: width 0.9s ease, background 0.6s ease; }
.comp-weight { font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.comp-na { color: var(--muted); font-size: 12px; font-style: italic; }

/* colores según score */
.score-good { color: var(--green); }
.score-mid { color: var(--amber); }
.score-bad { color: var(--red); }
.bar-good { background: var(--green); }
.bar-mid { background: var(--amber); }
.bar-bad { background: var(--red); }

/* ---- Tarjetas de detalle ---- */
.detail-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.detail-card h2 { font-size: 14px; margin: 0 0 14px; color: var(--text); }

.neural-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.neural-stat-item { text-align: center; }
.neural-stat-value { font-size: 20px; font-weight: 700; color: var(--text); }
.neural-stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.sparkline-wrap { border-top: 1px solid var(--border); padding-top: 14px; }
.sparkline-title { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.sparkline-svg { width: 100%; height: 100px; }
.sparkline-empty { color: var(--muted); font-size: 12.5px; padding: 20px 0; text-align: center; }

.detail-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.detail-row .detail-card { margin-bottom: 0; }

.detail-body { font-size: 13px; color: var(--text); line-height: 1.7; }
.detail-body .kv { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed #1c2438; }
.detail-body .kv:last-child { border-bottom: none; }
.detail-body .kv-label { color: var(--muted); }
.detail-body .kv-value { font-weight: 600; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 5px 0; display: flex; align-items: center; gap: 8px; }
.checklist .check-yes { color: var(--green); }
.checklist .check-no { color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-ok { background: rgba(46,204,113,0.15); color: var(--green); }
.badge-halt { background: rgba(255,92,92,0.15); color: var(--red); }
.badge-off { background: rgba(139,149,171,0.15); color: var(--muted); }

@media (max-width: 640px) {
  .confidence-hero { flex-direction: column; text-align: center; }
}
