/* ============================================================
   smgr · css/pages/viz_analisis_jornada.css — DISEÑO de las CINCO tarjetas
   capturables de "Análisis de jornada" (visualizacion_analisis_jornada.php).
   Portado del clásico (que renderizaba con Chart.js vía AJAX); aquí todo es
   server-render: los gráficos son SVG inline (sobreviven a cloneNode, sin
   rasterizado) y las tablas HTML.

   MULTI-CAPTURA: hay cinco targets (capResumen, capHist, capComparativa,
   capRangos, capTablas), no #captureArea, así que el reset scopeado de viz.css
   no los cubre → aquí se replica ese reset bajo la clase .viz-card (común a las
   cinco). Todo el diseño va scopeado bajo .viz-card; sólo los helpers de
   maquetación fuera de las tarjetas (.viz-capbar / .viz-scroll / .viz-jnav /
   .aj-empty) van sin scope. Ancho fijo 1080px; en móvil se hace scroll horizontal.
   ============================================================ */

/* ---------- Maquetación fuera de las tarjetas (chrome Foco) ---------- */
.viz-capbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: var(--sp-4); }
.viz-capbar__title { font-size: 15px; font-weight: 700; color: var(--ink); }
.viz-scroll { margin-top: var(--sp-2); overflow-x: auto; }

.viz-jnav { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: var(--sp-4); }
.viz-jnav form { display: inline-flex; align-items: center; gap: 8px; }
.viz-jnav select {
  font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-input, 8px);
  background: var(--surface); color: var(--ink);
}

.aj-empty {
  margin-top: var(--sp-4);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card, 16px);
}

/* ---------- Reset scopeado (equivalente al de viz.css para #captureArea) ---------- */
.viz-card, .viz-card * { margin: 0; padding: 0; box-sizing: border-box; }
.viz-card { line-height: normal; color: #1a202c; }
.viz-card img { display: inline; max-width: none; vertical-align: baseline; }

/* ---------- Tarjeta (blanca) ---------- */
.viz-card {
  font-family: 'Inter', sans-serif;
  background: #f7fafc;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  overflow: hidden;
  width: 1080px;
}

.viz-card .header {
  background: linear-gradient(135deg, #2c5282 0%, #2a4365 100%);
  color: white; padding: 12px 20px; text-align: center;
}
.viz-card .logo-section { display: flex; align-items: center; justify-content: center; gap: 15px; }
.viz-card .logo {
  width: 64px; height: 50px; background: white; border-radius: 15%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.3); overflow: hidden;
}
.viz-card .logo img { width: 100%; height: 100%; object-fit: contain; }
.viz-card .header h1 { font-size: 22px; font-weight: 900; }
.viz-card .header p { font-size: 12.5px; opacity: 0.92; margin-top: 3px; }

.viz-card .footer {
  background: #2d3748; color: white; padding: 9px 20px; text-align: center;
  font-size: 11.5px; display: flex; justify-content: center; gap: 22px;
}
.viz-card .footer span { opacity: 0.82; }

/* ---------- Tarjeta 1: KPIs + percentiles ---------- */
.viz-card .kpi-body { padding: 20px; }
.viz-card .kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.viz-card .kpi-card {
  background: #fff; border-radius: 12px; padding: 16px 14px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.viz-card .kpi-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #718096; margin-bottom: 6px;
}
.viz-card .kpi-value { font-size: 26px; font-weight: 900; color: #2d3748; font-variant-numeric: tabular-nums; }
.viz-card .kpi-value.green { color: #059669; }
.viz-card .kpi-value.gold { color: #b45309; }
.viz-card .kpi-value.red { color: #dc2626; }
.viz-card .kpi-value.blue { color: #2c5282; }
.viz-card .kpi-sub {
  font-size: 11.5px; color: #a0aec0; margin-top: 3px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.viz-card .pct-bar {
  display: flex; justify-content: center; gap: 26px; flex-wrap: wrap;
  padding: 14px 15px; margin-top: 14px;
  background: #edf2f7; border-radius: 10px;
}
.viz-card .pct-item { text-align: center; }
.viz-card .pct-label { font-size: 10.5px; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: .3px; }
.viz-card .pct-value { font-size: 18px; font-weight: 900; color: #2d3748; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---------- Tarjetas 2-4: gráficos (oscuras) ---------- */
.viz-card.chart-card { background: #2d3748; }
.viz-card.chart-card .chart-title-bar { padding: 16px 24px 4px; }
.viz-card.chart-card .chart-title-bar h3 { color: #e2e8f0; font-size: 17px; font-weight: 800; }
.viz-card.chart-card .chart-sub { color: #a0aec0; font-size: 12.5px; margin-top: 3px; font-weight: 500; }
.viz-card.chart-card .chart-legend {
  display: flex; justify-content: center; gap: 22px; flex-wrap: wrap;
  padding: 8px 20px 0; font-size: 12px; font-weight: 600; color: #cbd5e0;
}
.viz-card.chart-card .chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-card.chart-card .lg-box { display: inline-block; width: 14px; height: 14px; border-radius: 2px; }
.viz-card.chart-card .lg-line { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.viz-card.chart-card .lg-dash { display: inline-block; width: 16px; height: 0; border-top: 2px dashed #d4a76a; }
.viz-card.chart-card .chart-body { padding: 8px 16px 4px; }
.viz-card.chart-card svg { display: block; width: 100%; height: auto; }
.viz-card.chart-card .chart-footer {
  padding: 8px 20px 12px; text-align: center; font-size: 11.5px;
  display: flex; justify-content: center; gap: 22px;
}
.viz-card.chart-card .chart-footer span { color: #fff; opacity: 0.72; }
.viz-card.chart-card .chart-empty { color: #cbd5e0; text-align: center; padding: 60px 20px; font-size: 14px; }

/* ---------- Tarjeta 5: Top 10 / Bottom 10 ---------- */
.viz-card .split { display: flex; gap: 0; background: #fff; }
.viz-card .split > div { flex: 1; }
.viz-card .split-divider { border-left: 2px solid #e2e8f0; }
.viz-card .panel-title {
  text-align: center; font-weight: 800; font-size: 13px; padding: 9px;
  text-transform: uppercase; letter-spacing: .4px; color: #fff;
}
.viz-card .panel-title.top { background: #1a7a5a; }
.viz-card .panel-title.bottom { background: #b23b3b; }
.viz-card table { width: 100%; border-collapse: collapse; }
.viz-card thead th {
  background: #edf2f7; color: #4a5568; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
  padding: 7px 8px; text-align: center; font-size: 10px; white-space: nowrap;
}
.viz-card thead th.left { text-align: left; }
.viz-card tbody td { padding: 6px 8px; border-bottom: 1px solid #e8edf3; font-size: 13px; font-weight: 600; text-align: center; color: #2d3748; }
.viz-card tbody tr:nth-child(even) td { background: rgba(0,0,0,0.018); }
.viz-card td.rank { font-weight: 900; color: #2c5282; font-size: 15px; }
.viz-card td.mgr { text-align: left; }
.viz-card .username { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; font-weight: 800; color: #1a365d; vertical-align: bottom; }
.viz-card .teamname { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; font-style: italic; color: #718096; font-weight: 600; font-size: 12px; vertical-align: bottom; }
.viz-card td.score { font-weight: 800; font-variant-numeric: tabular-nums; }
.viz-card td.score.top { color: #059669; }
.viz-card td.score.bottom { color: #dc2626; }
.viz-card td.prevpos { color: #718096; font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-card tr.hl-top td { background: rgba(5, 150, 105, 0.10) !important; }
.viz-card tr.hl-bottom td { background: rgba(220, 80, 80, 0.10) !important; }
