/* ──────────────────────────────────────────────
   Coach Mode — Health Score, Insights, Quick Wins, Tooltips
   ────────────────────────────────────────────── */

/* ── Tooltip system (hover over .tip elements) ── */
.tip {
  border-bottom: 1px dotted var(--brand);
  cursor: help;
  position: relative;
}
.tip:hover { color: var(--brand); }
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 320px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--hair-3);
  border-radius: var(--r-sm);
  font-family: var(--ff-display);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  color: var(--ink);
  box-shadow: var(--shadow-2);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9000;
  white-space: normal;
}
.tip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ── Health Score widget ── */
.health-card {
  background: var(--bg-elev);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 28px 30px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.health-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--purple), var(--meta));
}

.health-gauge {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.health-gauge svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.health-gauge-bg { stroke: var(--hair-2); }
.health-gauge-fg {
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s;
}
.health-gauge-fg.green  { stroke: var(--success); }
.health-gauge-fg.cyan   { stroke: var(--cyan); }
.health-gauge-fg.gold   { stroke: var(--gold); }
.health-gauge-fg.orange { stroke: var(--warn); }
.health-gauge-fg.red    { stroke: var(--danger); }
.health-gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.health-gauge-num {
  font-family: var(--ff-display);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.health-gauge-of {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}

.health-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.health-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.health-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--ink);
}
.health-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 14px currentColor;
}
.health-status-dot.green  { background: var(--success); color: var(--success); }
.health-status-dot.cyan   { background: var(--cyan); color: var(--cyan); }
.health-status-dot.gold   { background: var(--gold); color: var(--gold); }
.health-status-dot.orange { background: var(--warn); color: var(--warn); }
.health-status-dot.red    { background: var(--danger); color: var(--danger); }

.health-summary {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 720px;
}

.health-breakdown {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.health-pillar {
  background: var(--surface-2);
  border: 1px solid var(--hair-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.health-pillar-l {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.health-pillar-v {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.health-pillar-v small {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  margin-left: 2px;
}
.health-pillar-bar {
  margin-top: 6px;
  height: 3px;
  background: var(--hair-2);
  border-radius: 2px;
  overflow: hidden;
}
.health-pillar-bar-fg {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 900px) {
  .health-card { grid-template-columns: 1fr; }
  .health-gauge { width: 120px; height: 120px; margin: 0 auto; }
  .health-breakdown { grid-template-columns: repeat(2, 1fr); }
}

/* ── Insights cards ── */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.insight-card {
  background: var(--bg-elev);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-mid), border-color var(--t-mid), box-shadow var(--t-mid);
}
.insight-card:hover {
  transform: translateY(-1px);
  border-color: var(--hair-3);
  box-shadow: var(--shadow-1);
}
.insight-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
}
.insight-card.critical::before { background: var(--danger); }
.insight-card.high::before     { background: var(--warn); }
.insight-card.medium::before   { background: var(--info); }
.insight-card.success::before  { background: var(--success); }
.insight-card.info::before     { background: var(--brand); }

.insight-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.insight-icon {
  font-size: 22px;
  line-height: 1;
}
.insight-sev {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-left: auto;
}
.insight-sev.critical { color: var(--danger); }
.insight-sev.high     { color: var(--warn); }
.insight-sev.medium   { color: var(--info); }
.insight-sev.success  { color: var(--success); }

.insight-title {
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
  line-height: 1.3;
}
.insight-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}
.insight-action {
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--hair-2);
}
.insight-action-l {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
  font-weight: 700;
}
.insight-action-v {
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.5;
}

.insight-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.insight-meta-pill {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--hair-2);
}

/* ── Quick Win row ── */
.qw-table tr {
  cursor: pointer;
}
.qw-effort {
  display: inline-flex;
  align-items: center;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.qw-effort.low    { background: rgba(76,209,122,0.12); color: var(--success); }
.qw-effort.medium { background: rgba(246,178,58,0.12); color: var(--warn); }
.qw-effort.high   { background: rgba(255,90,90,0.10); color: var(--danger); }
.qw-lift {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--success);
}
.qw-lift::before {
  content: '+';
  margin-right: 1px;
}

/* Quick Wins · acción recomendada con icono categorizado */
.qw-action {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}
.qw-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 7px 3px 6px;
  border-radius: 3px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--hair);
  white-space: nowrap;
}
.qw-action-chip .icon {
  width: 11px;
  height: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qw-action-chip .icon svg {
  width: 11px;
  height: 11px;
}
.qw-action-chip.qw-on-page   { background: rgba(94,192,232,0.10); color: #5EC0E8; border-color: rgba(94,192,232,0.25); }
.qw-action-chip.qw-contenido { background: rgba(234,143,215,0.10); color: var(--brand); border-color: rgba(234,143,215,0.25); }
.qw-action-chip.qw-estrategia{ background: rgba(200,168,118,0.10); color: var(--accent); border-color: rgba(200,168,118,0.25); }
.qw-action-text {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}
