/* Dirección editorial (la misma del tablero de JEFT FIT): cifras grandes, blanco y negro, el color solo para avisar. */
:root {
  --bg: #ffffff;
  --ink: #0b0b0b;
  --ink-soft: #3d3d3d;
  --muted: #8a8a8a;
  --rule: #0b0b0b;
  --hairline: #e4e4e4;
  --fill: #f2f2f2;
  --bar: #cfcfcf;
  --bad: #d0021b;
  --bad-soft: #fdecee;
  --good: #1b7a46;
  --warn: #b25e00;
  --font-figure: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-text: "Montserrat", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: 14px; line-height: 1.45; }

.top {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 24px var(--gutter) 16px; border-bottom: 2px solid var(--rule);
}
.brand-mark { display: block; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--bad); }
.top h1 { margin: 4px 0 0; font-family: var(--font-figure); font-size: 36px; font-weight: 700; line-height: 1; }
.top-meta { display: flex; align-items: center; gap: 12px; }
.updated { font-size: 12px; color: var(--muted); }
.btn {
  min-height: 44px; padding: 0 18px; border: 1.5px solid var(--ink); background: var(--bg); color: var(--ink);
  font: 600 12px var(--font-text); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--bg); }
.btn:disabled { opacity: .4; cursor: wait; }

main { padding: 8px var(--gutter) 48px; max-width: 1200px; }
section { padding: 28px 0 8px; border-bottom: 1px solid var(--hairline); }
section:last-child { border-bottom: 0; }
.kicker { margin: 0 0 14px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.note { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); max-width: 60ch; }

/* Hoy */
.headline { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.headline strong { font-family: var(--font-figure); font-size: clamp(56px, 12vw, 96px); font-weight: 700; line-height: .9; }
.headline span { font-family: var(--font-figure); font-size: clamp(26px, 5vw, 36px); font-weight: 600; }
.delta { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.delta.up { color: var(--good); background: #e8f4ee; }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.same { color: var(--ink-soft); background: var(--fill); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--rule); }
.stat { padding: 14px 16px 16px 0; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--hairline); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.stat-value { font-family: var(--font-figure); font-size: 44px; font-weight: 700; line-height: 1.05; }
.stat-before { font-size: 12px; color: var(--muted); }

/* Llamadas por día: columnas en HTML para que el texto no cambie de tamaño con la pantalla. */
.bars { padding-top: 22px; }
.bars-plot { position: relative; display: flex; align-items: flex-end; gap: clamp(4px, 1.2vw, 12px); height: 200px; padding-bottom: 24px; }
.col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.col-bar { background: var(--bar); min-height: 2px; }
.col.today .col-bar { background: var(--ink); }
.col-value { text-align: center; font: 700 18px var(--font-figure); line-height: 1.2; }
.col-day { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.col.today .col-day { color: var(--ink); font-weight: 700; }
.avg-line { position: absolute; left: 0; right: 0; margin-bottom: 24px; border-top: 1.5px dashed var(--bad); pointer-events: none; }
.avg-line span { position: absolute; left: 0; bottom: 3px; padding: 0 4px 0 0; background: var(--bg); font-size: 11px; font-weight: 600; color: var(--bad); }

/* Embudo */
.funnel { display: grid; gap: 0; max-width: 820px; }
.step { display: grid; grid-template-columns: minmax(130px, 190px) 1fr 64px; align-items: center; gap: 14px; }
.step-name { font-size: 13px; font-weight: 600; }
.step-track { height: 36px; background: var(--fill); }
.step-fill { height: 100%; background: var(--ink); min-width: 3px; }
.step-num { font: 700 30px var(--font-figure); line-height: 1; text-align: right; }
.pass-row { min-height: 26px; }
.pass { font-size: 12px; color: var(--muted); }

.alert { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--warn); background: #fbf3e9; }
.alert.bad { border-color: var(--bad); background: var(--bad-soft); }
.alert strong { font: 700 40px var(--font-figure); line-height: 1; }
.alert span { font-size: 14px; font-weight: 600; }

/* Estados */
.skeleton { height: 120px; margin: 28px 0; background: linear-gradient(90deg, var(--fill), #fafafa, var(--fill)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.message { padding: 40px 0; max-width: 52ch; }
.message h2 { margin: 0 0 8px; font-family: var(--font-figure); font-size: 30px; }
.message p { margin: 0 0 16px; color: var(--ink-soft); }

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat { padding: 12px 0; border-left: 0; border-bottom: 1px solid var(--hairline); }
  .step { grid-template-columns: 1fr 52px; gap: 4px 12px; }
  .step-name { grid-column: 1 / -1; padding-top: 6px; }
  .pass-row { grid-template-columns: 1fr; min-height: 0; }
  .pass-row span { display: none; }
  .col-day { font-size: 10px; }
  .col-value { font-size: 15px; }
  .top h1 { font-size: 30px; }
}
