/* Tablero unificado World Mats — oscuro ámbar dínamo; claro = Investiga (GitHub SaaS) */
:root {
  --bg: #0d0f12;
  --panel: #14171c;
  --text: #e8e4da;
  --text-secondary: #c9c5b9;
  --muted: #8a8678;
  --accent: #e8a33d;
  --accent-dim: #8a6224;
  --accent-ink: #14100a;
  --banner-strong: #fff;
  --danger: #c4543a;
  --ok: #7da87b;
  --line: #2a2e35;
  --screen-bg: #0a0c0f;
  --screen-bar: #101319;
  --kpi-bg: #11141a;
  --screen-dot: #2e333b;
  --skel-1: #1a1e25;
  --skel-2: #23272f;
  --sep: #3a3f47;
  --frame-bg: #0a0c0e;
  --heat-0: #1a1c14;
  --heat-1: #3d3418;
  --heat-2: #6b5420;
  --heat-3: #8a6224;
  --heat-4: #e8a33d;
  --delay-0: #1a2418;
  --delay-1: #3d3418;
  --delay-2: #6b5420;
  --delay-3: #8a3a24;
  --delay-4: #c4543a;
  --shadow: 0 12px 32px rgba(0,0,0,0.45);
  --nav-h: 56px;
  --accent-soft: rgba(232,163,61,0.15);
  --accent-softer: rgba(232,163,61,0.055);
  --ok-soft: rgba(125,168,123,0.15);
  --ok-softer: rgba(125,168,123,0.06);
  --danger-soft: rgba(196,84,58,0.18);
  --danger-softer: rgba(196,84,58,0.06);
  --muted-soft: rgba(138,134,120,0.14);
  --ico-bg: rgba(125,168,123,0.15);
  --alert-bg: rgba(196,84,58,0.12);
}

body.theme-light {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #111827;
  --text-secondary: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #16a34a;
  --accent-dim: #86efac;
  --accent-ink: #ffffff;
  --banner-strong: #111827;
  --danger: #b91c1c;
  --ok: #16a34a;
  --screen-bg: #ffffff;
  --screen-bar: #f9fafb;
  --kpi-bg: #ffffff;
  --screen-dot: #d1d5db;
  --skel-1: #f3f4f6;
  --skel-2: #e5e7eb;
  --sep: #e5e7eb;
  --frame-bg: #f9fafb;
  --heat-0: #ebedf0;
  --heat-1: #9be9a8;
  --heat-2: #40c463;
  --heat-3: #30a14e;
  --heat-4: #216e39;
  --delay-0: #ebedf0;
  --delay-1: #fde68a;
  --delay-2: #fbbf24;
  --delay-3: #f87171;
  --delay-4: #b91c1c;
  --shadow: 0 1px 2px rgba(17,24,39,0.05);
  --accent-soft: #dcfce7;
  --accent-softer: #f0fdf4;
  --ok-soft: #dcfce7;
  --ok-softer: #f0fdf4;
  --danger-soft: #fecaca;
  --danger-softer: #fee2e2;
  --muted-soft: #f3f4f6;
  --ico-bg: #dcfce7;
  --alert-bg: #fecaca;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select { font-family: inherit; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }

/* ----- banner ----- */
.ejemplo-banda {
  background: var(--accent-dim);
  color: var(--text);
  text-align: center;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  padding: 9px 72px 9px 16px;
  position: relative;
  z-index: 20;
}
.ejemplo-banda b { color: var(--banner-strong); letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; }

/* ----- nav ----- */
.topnav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px 8px 18px;
  min-height: var(--nav-h);
}
.brand {
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  margin-right: 8px; white-space: nowrap;
}
.brand span { color: var(--accent); font-weight: 600; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav-links a {
  text-decoration: none; color: var(--muted);
  font-size: 13px; font-weight: 600;
  padding: 6px 11px; border-radius: 99px;
  border: 1px solid transparent;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.on {
  color: var(--accent); background: var(--accent-soft);
  border-color: var(--accent-dim);
}
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.clock { font-size: 12px; color: var(--muted); white-space: nowrap; }
.clock .led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 5px; vertical-align: 1px; opacity: 0.7; }

.tema-switch {
  display: flex; gap: 2px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 99px; padding: 3px;
}
.tema-btn {
  border: 0; background: transparent; color: var(--muted);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
  padding: 0.3rem 0.7rem; border-radius: 99px; cursor: pointer;
}
.tema-btn.activo { background: var(--accent); color: var(--accent-ink); }

/* ----- layout ----- */
.wrap { max-width: 1360px; margin: 0 auto; padding: 1.6rem 1.4rem 4.5rem; }
.view { display: none; }
.view.on { display: block; }
.kicker {
  color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.22em; font-size: 0.72rem; font-weight: 600;
  margin-bottom: 0.55rem;
}
h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 700; line-height: 1.12; margin: 0 0 0.55rem; }
h2 { font-size: clamp(1.2rem, 2.4vw, 1.55rem); font-weight: 700; line-height: 1.2; margin: 0 0 0.45rem; }
h3 { font-size: 1.02rem; color: var(--accent); margin: 0 0 0.4rem; font-weight: 600; }
.lead { color: var(--text-secondary); max-width: 68ch; font-size: 0.98rem; }
.subhead {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 1.15rem 0 0.45rem;
}

/* ----- chips / pills ----- */
.pill {
  display: inline-block; padding: 0.12rem 0.55rem; border-radius: 99px;
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}
.pill.g { background: var(--ok-soft); color: var(--ok); }
.pill.a { background: var(--accent-soft); color: var(--accent); }
.pill.r { background: var(--danger-soft); color: var(--danger); }
.pill.m { background: var(--muted-soft); color: var(--muted); }
.chip {
  font-size: 0.74rem; padding: 0.2rem 0.65rem; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); background: transparent;
  cursor: pointer; white-space: nowrap;
}
.chip.on { border-color: var(--accent-dim); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ----- cards / screen ----- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.15rem 1.25rem;
}
.screen {
  background: var(--screen-bg); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.screen .bar {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
  padding: 0.5rem 1rem; border-bottom: 1px solid var(--line);
  background: var(--screen-bar);
}
.screen .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--screen-dot); flex: none; }
.screen .bar .title { font-size: 0.72rem; color: var(--muted); margin-left: 0.5rem; letter-spacing: 0.08em; }
.screen .bar .right { margin-left: auto; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.screen .body { padding: 1.05rem 1.2rem 1.2rem; }
.screen .foot {
  border-top: 1px solid var(--line); padding: 0.55rem 1.2rem;
  font-size: 0.74rem; color: var(--muted); background: var(--screen-bar);
}

.kpis { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.kpi {
  flex: 1; min-width: 110px;
  background: var(--kpi-bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.6rem 0.8rem;
}
.kpi .v { font-size: 1.4rem; font-weight: 700; display: block; line-height: 1.15; }
.kpi .v.acc { color: var(--accent); }
.kpi .v.red { color: var(--danger); }
.kpi .v.ok { color: var(--ok); }
.kpi .l { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.kpi .s { font-size: 0.7rem; color: var(--muted); margin-top: 0.12rem; }

.frescura {
  display: flex; flex-wrap: wrap; gap: 0.45rem 0.9rem; align-items: center;
  background: var(--kpi-bg); border: 1px solid var(--line); border-left: 3px solid var(--ok);
  border-radius: 6px; padding: 0.45rem 0.75rem; font-size: 0.78rem; color: var(--muted);
  margin-bottom: 0.85rem;
}
.frescura.warn { border-left-color: var(--accent); }
.frescura.bad { border-left-color: var(--danger); color: var(--danger); }
.frescura b { color: var(--text-secondary); font-weight: 600; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.led.a { background: var(--accent); }
.led.r { background: var(--danger); }
.led.off { background: var(--muted); }

/* ----- alerts ----- */
.alerta {
  display: flex; gap: 0.8rem; align-items: flex-start;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--accent-softer);
  border-radius: 8px; padding: 0.65rem 0.85rem; margin-bottom: 0.5rem;
  text-decoration: none; color: inherit; cursor: pointer; width: 100%;
  text-align: left;
}
.alerta.roja { border-left-color: var(--danger); background: var(--danger-softer); }
.alerta.verde { border-left-color: var(--ok); background: var(--ok-softer); }
.alerta.gris { border-left-color: var(--muted); background: var(--muted-soft); }
.alerta .ico { color: var(--accent); flex: none; }
.alerta.roja .ico { color: var(--danger); }
.alerta.verde .ico { color: var(--ok); }
.alerta .t { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.alerta .d { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.1rem; }
.alerta .cta { font-size: 0.76rem; color: var(--accent); white-space: nowrap; align-self: center; font-weight: 600; margin-left: auto; }
.alerta:hover { border-color: var(--accent-dim); }

.nota {
  border-left: 3px solid var(--accent-dim);
  background: var(--accent-softer);
  padding: 0.65rem 0.9rem; border-radius: 0 8px 8px 0; margin: 0.8rem 0;
}
.nota p { color: var(--text-secondary); font-size: 0.86rem; max-width: 76ch; }
.nota.op { border-left-color: var(--danger); background: var(--danger-softer); }
.nota.hecho { border-left-color: var(--ok); background: var(--ok-softer); }

/* ----- seller rows ----- */
.seller-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 90px 110px 100px minmax(200px, 1.4fr);
  gap: 12px; align-items: center;
  padding: 0.7rem 0.35rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer; border-radius: 8px;
}
.seller-row:hover { background: var(--accent-softer); }
.seller-row:last-child { border-bottom: none; }
.seller-head {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 90px 110px 100px minmax(200px, 1.4fr);
  gap: 16px; padding: 0 0.5rem 0.4rem;
  font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.av {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  object-fit: cover; object-position: center;
  display: block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--accent-dim); color: var(--banner-strong);
}
span.av { display: grid; place-items: center; }
.who .nm { font-weight: 650; font-size: 0.92rem; }
.who .rg { font-size: 0.72rem; color: var(--muted); }
.st { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--muted); margin-top: 3px; }
.st i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st .dot-on { background: var(--ok); }
.st .dot-off { background: var(--danger); }
.st .dot-away { background: #9ca3af; }
.st-unknown { color: var(--muted); }
.st-unknown i { display: none; }
.st-hist { color: var(--muted); }
.st-hist i { display: none; }
.metric { font-size: 0.92rem; font-weight: 650; }
.metric .u { display: block; font-size: 0.66rem; font-weight: 500; color: var(--muted); }

/* ----- contribution grids ----- */
.contrib {
  display: grid;
  grid-template-rows: repeat(7, 9px);
  grid-auto-flow: column;
  grid-auto-columns: 9px;
  gap: 2px;
}
.cell { width: 9px; height: 9px; border-radius: 2px; background: var(--heat-0); }
.cell.lv1 { background: var(--heat-1); }
.cell.lv2 { background: var(--heat-2); }
.cell.lv3 { background: var(--heat-3); }
.cell.lv4 { background: var(--heat-4); }
.cell.dly1 { background: var(--delay-1); }
.cell.dly2 { background: var(--delay-2); }
.cell.dly3 { background: var(--delay-3); }
.cell.dly4 { background: var(--delay-4); }
.cell[title] { cursor: help; }

.year-grid {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  grid-auto-flow: column;
  grid-auto-columns: 11px;
  gap: 3px;
  overflow-x: auto; padding-bottom: 4px;
}
.year-grid .cell { width: 11px; height: 11px; border-radius: 2px; }

.hour-grid { display: grid; gap: 7px; overflow-x: auto; }
.hour-row { display: grid; grid-template-columns: 40px repeat(17, minmax(22px, 1fr)); gap: 5px; align-items: center; }
.hour-row.slots30 { grid-template-columns: 40px repeat(26, minmax(18px, 1fr)); }
.hour-lab { font-size: 0.64rem; color: var(--muted); font-weight: 500; letter-spacing: 0.01em; }
.hour-cell {
  height: 13px; border-radius: 7px; background: var(--heat-0);
  min-width: 22px;
}
.hour-cell.lv1 { background: var(--heat-1); }
.hour-cell.lv2 { background: var(--heat-2); }
.hour-cell.lv3 { background: var(--heat-3); }
.hour-cell.lv4 { background: var(--heat-4); }
.hour-cell.dly1 { background: var(--delay-1); }
.hour-cell.dly2 { background: var(--delay-2); }
.hour-cell.dly3 { background: var(--delay-3); }
.hour-cell.dly4 { background: var(--delay-4); }
.hour-cell[title] { cursor: help; }
.hour-axis { display: grid; grid-template-columns: 40px repeat(17, minmax(22px, 1fr)); gap: 5px; margin-bottom: 1px; }
.hour-axis.slots30 { grid-template-columns: 40px repeat(26, minmax(18px, 1fr)); }
.hour-axis span { font-size: 0.56rem; color: var(--muted); text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.heat-leg { display: flex; align-items: center; gap: 5px; font-size: 0.68rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.heat-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.heat-leg--end { width: max-content; max-width: 100%; margin-left: auto; }

/* ----- swimlane ----- */
.swim {
  display: grid; gap: 5px; overflow-x: auto;
}
.swim-row {
  display: grid;
  grid-template-columns: 118px repeat(26, minmax(18px, 1fr));
  gap: 2px; align-items: center; min-width: 720px;
}
.swim-lab { font-size: 0.68rem; color: var(--muted); line-height: 1.2; }
.swim-lab b { display: block; color: var(--text-secondary); font-weight: 600; font-size: 0.72rem; }
.swim-cell { height: 26px; border-radius: 3px; background: var(--heat-0); }
.swim-cell.lv1 { background: var(--heat-1); }
.swim-cell.lv2 { background: var(--heat-2); }
.swim-cell.lv3 { background: var(--heat-3); }
.swim-cell.lv4 { background: var(--heat-4); }
.swim-axis {
  display: grid;
  grid-template-columns: 118px repeat(26, minmax(18px, 1fr));
  gap: 2px; min-width: 720px;
}
.swim-axis span { font-size: 0.56rem; color: var(--muted); text-align: center; }

/* ----- tables ----- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
td, th { border-bottom: 1px solid var(--line); padding: 0.5rem 0.55rem; text-align: left; font-size: 0.86rem; }
th { color: var(--muted); font-weight: 500; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { border-top: 1px solid var(--accent-dim); font-weight: 700; color: var(--text); }
tr.dim td { color: var(--muted); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-softer); }

/* ----- bars ----- */
.tend { display: flex; align-items: stretch; gap: 0.45rem; height: 88px; padding-top: 0.2rem; }
.tend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 0.2rem; }
.tend .pair { display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; }
.tend .b1, .tend .b2 { flex: 1; border-radius: 2px 2px 0 0; min-height: 2px; }
.tend .bar2 { width:100%; border-radius:2px 2px 0 0; min-height:2px; }
.tl div { font-size:0.84rem; color:var(--muted); padding:0.22rem 0; }
.tl b { color:var(--text); font-weight:600; }

.tend .b1 { background: var(--accent-dim); }
.tend .b2 { background: var(--accent); }
.tend .lbl { font-size: 0.6rem; color: var(--muted); white-space: nowrap; }

.now-bars { display: flex; align-items: flex-end; gap: 4px; height: 92px; }
.now-bars .nb {
  flex: 1; background: var(--heat-2); border-radius: 3px 3px 0 0; min-height: 2px; position: relative;
}
.now-bars .nb.now { background: var(--accent); }
.now-bars .nb.on { background: var(--heat-3); }
.now-bars.real .nb.on { opacity: 1; }
.now-bars .nb.now::after {
  content: attr(data-t); position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; color: var(--accent); font-weight: 700; white-space: nowrap;
}

/* ----- grids ----- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.split { display: grid; grid-template-columns: 1fr 280px; gap: 1rem; }
.caso {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 1rem 1.1rem;
}
.caso .n { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.caso h4 { margin: 0.15rem 0 0.4rem; font-size: 0.98rem; }
.caso p { font-size: 0.84rem; color: var(--text-secondary); }

.filtros {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start;
  padding-bottom: 0.85rem; border-bottom: 1px solid var(--line); margin-bottom: 0.85rem;
}
.fgroup { min-width: 200px; }
.flabel { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 0.3rem; }
.btn {
  font-size: 0.78rem; font-weight: 700; padding: 0.36rem 0.9rem; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); border: none; cursor: pointer;
}
.btn.ghost { background: transparent; border: 1px solid var(--accent-dim); color: var(--accent); font-weight: 600; }

.migas { display: flex; align-items: center; gap: 0.35rem; font-size: 0.76rem; color: var(--muted); flex-wrap: wrap; margin-bottom: 0.5rem; }
.migas a { color: var(--accent); text-decoration: none; cursor: pointer; }
.migas .actual { color: var(--text); font-weight: 600; }

.side-card { background: var(--kpi-bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.85rem 0.95rem; margin-bottom: 0.75rem; }
.silencio-row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; padding: 0.28rem 0; border-bottom: 1px solid var(--line); color: var(--text-secondary); }
.silencio-row:last-child { border-bottom: none; }

.warn { color: var(--accent); font-weight: 700; }
.foot-note { font-size: 0.74rem; color: var(--muted); margin-top: 0.7rem; }

.cov { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
.cov-i { background: var(--kpi-bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.65rem; }
.cov-i .v { font-size: 1.15rem; font-weight: 700; }
.cov-i .l { font-size: 0.66rem; color: var(--muted); }

footer.appf {
  margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--muted); max-width: 78ch;
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 1.1rem 0.85rem 3.2rem; }
  .ejemplo-banda { padding-right: 16px; font-size: 12.5px; }
  .nav-links a { padding: 5px 8px; font-size: 12px; }
  .kpi { min-width: calc(50% - 0.4rem); }
}


/* ----- Investiga light refinements ----- */
body.theme-light .ejemplo-banda {
  background: #f3f4f6;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
body.theme-light .ejemplo-banda b { color: var(--text); }
body.theme-light h3 { color: var(--text); }
body.theme-light .kicker { color: var(--muted); letter-spacing: 0.14em; }
body.theme-light .av { background: #dcfce7; color: #166534; }
body.theme-light .screen { box-shadow: none; }
body.theme-light .card { box-shadow: none; }

/* pulso / vendedor headers */
.pulso-head, .vend-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.35rem;
}
.pulso-title, .vend-title { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; min-width: 0; }
.pulso-head h1, .vend-head h1 { font-size: 1.35rem; margin: 0; letter-spacing: -0.02em; }
.pulso-tools { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.vend-title .nm { font-weight: 700; font-size: 1.15rem; }

.back-btn {
  width: 34px; height: 34px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--text);
  cursor: pointer; font-size: 1.05rem; line-height: 1; flex: none;
}
.back-btn:hover { background: var(--muted-soft); }

.seg {
  display: flex; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: var(--panel);
}
.seg button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 0.75rem; font-weight: 600; padding: 0.35rem 0.8rem; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

.st-pill {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 5px; padding: 0.12rem 0.55rem; border-radius: 99px;
  font-size: 0.68rem; font-weight: 600; border: 1px solid transparent;
}
.st-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.st-pill.on { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.st-pill.off { background: var(--danger-soft); color: var(--danger); }
.st-pill.away { background: var(--muted-soft); color: var(--muted); }
.st-pill.unknown { background: var(--muted-soft); color: var(--muted); }
.st-pill.unknown i { display: none; }
body:not(.theme-light) .st-pill.on { border-color: transparent; }

/* seller table — pulso */
.pulso-table { padding: 1.05rem 1.35rem 0.55rem; }
.seller-head {
  grid-template-columns: minmax(260px, 1.7fr) 118px 132px 122px minmax(220px, 1.45fr);
}
.seller-row {
  grid-template-columns: minmax(260px, 1.7fr) 118px 132px 122px minmax(220px, 1.45fr);
  padding: 1.15rem 0.5rem;
}
.who { align-items: center; }
.strip12 { min-width: 0; }
.strip-labs {
  display: flex; justify-content: space-between;
  font-size: 0.58rem; color: var(--muted); margin-top: 4px;
}

/* metric chips (vendedor) */
.mchips { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 0 0 1.2rem; }
.mchip {
  flex: 1; min-width: 132px;
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.7rem 0.85rem;
}
.mchip-ico {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--ico-bg); color: var(--ok);
}
.mchip-ico svg { width: 18px; height: 18px; }
.mchip .v { font-size: 1.25rem; font-weight: 700; line-height: 1.1; display: block; }
.mchip .l { font-size: 0.72rem; color: var(--muted); }

/* summary cards (equipo footer) */
.sum-cards {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem; margin-top: 1.2rem;
}
.sum-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.85rem 1rem;
}
.sum-card.alert { background: var(--alert-bg); border-color: var(--alert-bg); color: var(--danger); }
.sum-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--ico-bg); color: var(--ok);
}
.sum-ico svg { width: 18px; height: 18px; }
.sum-card.alert .sum-ico { background: #fee2e2; color: var(--danger); }
body:not(.theme-light) .sum-card.alert .sum-ico { background: var(--danger-softer); }
.sum-v { font-size: 1.15rem; font-weight: 700; line-height: 1.15; color: var(--text); }
.sum-card.alert .sum-v { color: var(--danger); }
.sum-l { font-size: 0.75rem; color: var(--muted); }
.sum-card.alert .sum-l { color: var(--danger); }

/* year contribution chrome */
.year-wrap { overflow-x: auto; padding-bottom: 4px; }
.year-months {
  display: grid; grid-auto-flow: column; grid-auto-columns: 14px; gap: 3px;
  margin-left: 28px; margin-bottom: 4px;
  font-size: 0.62rem; color: var(--muted);
}
.year-months span { white-space: nowrap; }
.year-body { display: flex; gap: 6px; align-items: flex-start; }
.year-dows {
  display: grid; grid-template-rows: repeat(7, 11px); gap: 3px;
  font-size: 0.58rem; color: var(--muted); width: 22px; flex: none;
}
.year-dows span { line-height: 11px; }

.sil-ico {
  width: 18px; height: 18px; color: #8b5cf6; flex: none;
  display: grid; place-items: center;
}
.sil-ico svg { width: 16px; height: 16px; }
body:not(.theme-light) .sil-ico { color: var(--muted); }
.silencio-row { align-items: center; }
.silencio-row .when { color: var(--text); font-weight: 600; }

body.theme-light .now-bars .nb.now::after {
  background: #216e39; color: #fff; padding: 1px 7px;
  border-radius: 99px; top: -20px; font-size: 0.58rem;
}
body.theme-light .now-bars .nb.now { background: var(--heat-4); }

.side-kicker { font-size: 0.72rem; color: var(--muted); margin: -0.15rem 0 0.55rem; }

@media (max-width: 900px) {
  .sum-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .sum-cards { grid-template-columns: 1fr; }
  .pulso-head h1, .vend-head h1 { font-size: 1.15rem; }
}

#vend-who { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; min-width: 0; }
#vend-who h1 { font-size: 1.28rem; margin: 0; font-weight: 700; }
.metric.red { color: var(--danger); }
.year-months { grid-auto-columns: 11px; }


/* ----- pulso / vendedor: closer to Investiga mocks ----- */
.rango-cap {
  font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em; white-space: nowrap;
}
.pulso-head, .vend-head { margin-bottom: 1.55rem; }
.pulso-head h1, .vend-head h1 { font-size: 1.45rem; letter-spacing: -0.025em; }
.pulso-title { gap: 0.75rem; }
.pulso-tools { gap: 0.7rem; }
.seg { border-radius: 9px; }
.seg button { padding: 0.38rem 0.95rem; font-size: 0.76rem; }

.pulso-table { padding: 1.05rem 1.35rem 0.55rem; }
.seller-head {
  grid-template-columns: minmax(260px, 1.7fr) 118px 132px 122px minmax(220px, 1.45fr);
  padding: 0 0.5rem 0.65rem;
  font-size: 0.62rem;
}
.seller-row {
  grid-template-columns: minmax(260px, 1.7fr) 118px 132px 122px minmax(220px, 1.45fr);
  padding: 1.15rem 0.5rem;
  gap: 16px;
}
.who { align-items: center; gap: 12px; }
.who .nm { font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em; }
.who .rg { font-size: 0.74rem; }
.pulso-table .metric { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.02em; }
.pulso-table .metric .u { font-size: 0.68rem; margin-top: 2px; font-weight: 500; }

.strip7-cells {
  display: flex; gap: 3px;
}
.strip7 .cell { width: 13px; height: 13px; border-radius: 2px; }
.strip7-labs {
  display: flex; gap: 3px; margin-top: 4px;
  font-size: 0.56rem; color: var(--muted);
}
.strip7-labs span { width: 13px; text-align: center; }

.week-wrap { padding: 0.2rem 0 0.4rem; }
.week-grid { display: flex; gap: 8px; }
.week-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.week-col .cell { width: 18px; height: 18px; border-radius: 3px; }
.week-col span { font-size: 0.62rem; color: var(--muted); }

#vend-who { gap: 0.85rem; }
#vend-who .av, .av-lg { width: 52px; height: 52px; }
#vend-who h1 { font-size: 1.28rem; }

.mchips { gap: 0.85rem; margin: 0 0 1.4rem; }
.mchip { padding: 0.85rem 1rem; border-radius: 14px; min-width: 140px; }
.mchip-ico { width: 40px; height: 40px; }
.mchip .v { font-size: 1.35rem; }

.split { grid-template-columns: 1fr 300px; gap: 1.25rem; }
.side-card { padding: 1rem 1.1rem; border-radius: 12px; margin-bottom: 0.9rem; }
.sum-cards { gap: 0.9rem; margin-top: 1.4rem; }
.sum-card { padding: 1rem 1.15rem; border-radius: 14px; }
#view-equipo .card, #view-vendedor .card { padding: 1.25rem 1.4rem; }

body.theme-light img.av { background: #ebedf0; }

@media (max-width: 900px) {
  /* seller grid: v0.2 7-col rules below keep Ahora visible */
}


/* ===== v0.2: día, WM/FE ===== */
.world-note {
  display: block; width: 100%;
  font-size: 0.74rem; color: var(--muted); font-weight: 500;
  letter-spacing: 0;
}

.day-nav {
  display: flex; align-items: center; gap: 6px;
}
.day-arr {
  width: 28px; height: 28px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--panel); color: var(--text);
  cursor: pointer; font-size: 0.85rem; line-height: 1;
}
.day-arr:hover { background: var(--muted-soft); }
.day-arr:disabled, .day-arr[disabled] {
  opacity: 0.35; cursor: not-allowed;
}
.ayer-sq {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 6px; padding: 4px 6px 3px; cursor: pointer; color: var(--muted);
}
.ayer-sq i {
  display: block; width: 12px; height: 12px; border-radius: 3px;
  background: var(--heat-2);
}
.ayer-sq em { font-style: normal; font-size: 0.56rem; letter-spacing: 0.04em; }
.ayer-sq.on { border-color: var(--accent-dim); background: var(--accent-soft); color: var(--accent); }
.ayer-sq.on i { background: var(--heat-4); }

.emp-tag {
  display: inline-block; margin-left: 6px;
  font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em;
  padding: 0.08rem 0.4rem; border-radius: 99px; vertical-align: 2px;
}
.emp-tag.wm { background: #dbeafe; color: #1d4ed8; }
.emp-tag.fe { background: #fee2e2; color: #b91c1c; }
body:not(.theme-light) .emp-tag.wm { background: rgba(37,99,235,0.2); color: #93c5fd; }
body:not(.theme-light) .emp-tag.fe { background: rgba(220,38,38,0.2); color: #fca5a5; }

.grp { margin: 0.15rem 0 0.55rem; border-radius: 10px; position: relative; }
.grp.total { margin-top: 0; margin-bottom: 0.7rem; }
.grp::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  pointer-events: none;
  z-index: 1;
}
.grp.wm::before { background: #2563eb; }
.grp.fe::before { background: #dc2626; }
.grp.total::before { background: var(--accent); }
.grp-head {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) 88px 128px 110px 120px;
  gap: 16px; align-items: center;
  padding: 0.7rem 0.5rem;
  border-radius: 8px;
  font-weight: 700;
}
.grp-head.wm { background: #eff6ff; }
.grp-head.fe { background: #fef2f2; }
.grp-head.ar { background: var(--accent-softer); }
body:not(.theme-light) .grp-head.wm { background: rgba(37,99,235,0.12); }
body:not(.theme-light) .grp-head.fe { background: rgba(220,38,38,0.12); }
.grp-who { gap: 10px; }
.emp-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--accent);
}
.grp-head.wm .emp-dot { background: #2563eb; }
.grp-head.fe .emp-dot { background: #dc2626; }
.grp-head.eq-disc {
  width: 100%;
  margin: 0;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.grp-head.eq-disc:hover { filter: brightness(0.985); }
body:not(.theme-light) .grp-head.eq-disc:hover { filter: brightness(1.08); }
.grp-head.eq-disc:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.eq-chev {
  display: inline-block;
  width: 0.85em;
  flex: none;
  font-size: 0.68rem;
  line-height: 1;
  opacity: 0.65;
  color: var(--muted);
}
.eq-body .seller-row,
.eq-body .foot-note {
  padding-left: 1.65rem;
}
.grp-head .metric { font-size: 1.05rem; }
.grp-mini {
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 800; padding: 0.45rem 0.5rem 0.15rem;
}
.grp-mini.wm { color: #1d4ed8; }
.grp-mini.fe { color: #b91c1c; }

.extra-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) 88px 128px 110px 120px;
  gap: 16px; align-items: center;
  padding: 0.65rem 0.5rem;
  border-top: 1px dashed var(--line);
  opacity: 0.88;
}
.av.extra {
  display: grid; place-items: center;
  background: var(--muted-soft); color: var(--muted);
  font-size: 0.62rem; font-weight: 800;
}

.seller-head, .seller-row, .grp-head, .extra-row {
  grid-template-columns: minmax(240px, 1.6fr) 88px 128px 110px 120px;
}
.seller-row.toto-row {
  grid-template-columns: minmax(180px, 1.1fr) 1fr auto auto;
}
.toto-nums { font-size: 0.78rem; color: var(--muted); }

.who-strip { margin-top: 5px; max-width: 168px; overflow: hidden; }
.who-strip .contrib {
  grid-template-rows: repeat(7, 4px);
  grid-auto-columns: 4px;
  gap: 1px;
}
.who-strip .cell { width: 4px; height: 4px; border-radius: 1px; }

.week4 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem;
}
.week4-col {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0.7rem 0.75rem; background: var(--kpi-bg);
}
.week4-col.curso { border-color: var(--accent-dim); background: var(--accent-softer); }
.w4-lab { font-size: 0.68rem; color: var(--muted); margin-bottom: 0.45rem; font-weight: 600; }
.w4-v { font-size: 0.98rem; font-weight: 700; line-height: 1.15; margin: 0.28rem 0; }
.w4-v span { display: block; font-size: 0.62rem; font-weight: 500; color: var(--muted); margin-top: 1px; }

td.low-fxl { color: var(--danger); font-weight: 700; }
tr.subtotal td { background: var(--muted-soft); font-weight: 700; }

.sum-cards { grid-template-columns: repeat(5, 1fr); }

.pulso-title { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
.pulso-title h1 { display: inline; }

@media (max-width: 1100px) {
  .sum-cards { grid-template-columns: 1fr 1fr; }
  .week4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  /* overridden by v0.2 Ahora column rules */
}
@media (max-width: 720px) {
  .week4 { grid-template-columns: 1fr; }
  .sum-cards { grid-template-columns: 1fr; }
}


/* ===== v0.2 fix: Argentina only, 9-col pulso, Ahora sparkline ===== */
.seller-head, .seller-row, .grp-head, .extra-row {
  display: grid;
  grid-template-columns: minmax(168px, 1.15fr) 96px 86px 70px 86px 78px 104px 86px minmax(150px, 168px);
  gap: 12px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  box-sizing: border-box;
  min-width: 0;
}
.seller-row.toto-row {
  grid-template-columns: minmax(180px, 1.1fr) 1fr auto auto;
}

.ahora-col {
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  min-width: 150px;
  width: 100%;
  overflow: visible;
  position: relative;
}
.seller-head > .th-ahora {
  min-width: 150px;
  line-height: 1.15;
  letter-spacing: 0.06em;
}
.seller-head > .th-ahora {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}
.ahora-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.58rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ahora-axis i { font-style: normal; }
.now-bars.mini {
  height: 50px;
  gap: 2px;
  width: 100%;
  min-width: 140px;
  flex: 1 1 auto;
  overflow: visible;
}
.now-bars.mini .nb {
  flex: 1 1 0;
  min-width: 5px;
  border-radius: 3px 3px 0 0;
  min-height: 6px;
  background: var(--heat-2);
}
.now-bars.mini .nb.now { background: var(--heat-4); }
.now-bars.mini .nb.on { background: var(--heat-3); }
.now-bars.mini .nb.now::after { content: none; }
.now-bars.faint .nb { background: var(--heat-1); }
.now-bars.faint .nb.now { background: var(--heat-2); }
.now-bars .nb[data-tip]:hover::before {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
  background: var(--text);
  color: var(--panel);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

.ahora-card { position: relative; }
.ahora-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0.45rem;
}
.ahora-titles { flex: 1; text-align: center; min-width: 0; }
.ahora-titles h3 { margin: 0; }
.ahora-head .side-kicker { margin: 0.12rem 0 0; }
.ahora-head .day-arr { margin-top: 2px; flex: none; }

.now-axis {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
.now-axis span {
  flex: 1;
  font-size: 0.56rem;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1180px) {
  .seller-head, .seller-row, .grp-head, .extra-row {
    grid-template-columns: minmax(160px, 1.15fr) 90px 80px 66px 80px 74px 96px minmax(148px, 164px);
  }
  .seller-head > :nth-child(8),
  .seller-row > :nth-child(8),
  .grp-head > :nth-child(8),
  .extra-row > :nth-child(8) { display: none; }
}
@media (max-width: 980px) {
  .seller-head, .seller-row, .grp-head, .extra-row {
    grid-template-columns: minmax(150px, 1.1fr) 86px 76px 62px 78px 72px minmax(146px, 160px);
  }
  .seller-head > :nth-child(7),
  .seller-head > :nth-child(8),
  .seller-row > :nth-child(7),
  .seller-row > :nth-child(8),
  .grp-head > :nth-child(7),
  .grp-head > :nth-child(8),
  .extra-row > :nth-child(7),
  .extra-row > :nth-child(8) { display: none; }
}
@media (max-width: 820px) {
  .seller-head, .seller-row, .grp-head, .extra-row {
    grid-template-columns: minmax(142px, 1.1fr) 80px 70px 74px 68px minmax(140px, 156px);
  }
  .seller-head > :nth-child(4),
  .seller-head > :nth-child(7),
  .seller-head > :nth-child(8),
  .seller-row > :nth-child(4),
  .seller-row > :nth-child(7),
  .seller-row > :nth-child(8),
  .grp-head > :nth-child(4),
  .grp-head > :nth-child(7),
  .grp-head > :nth-child(8),
  .extra-row > :nth-child(4),
  .extra-row > :nth-child(7),
  .extra-row > :nth-child(8) { display: none; }
}
@media (max-width: 680px) {
  .seller-head, .seller-row, .grp-head, .extra-row {
    grid-template-columns: minmax(128px, 1.05fr) 72px 70px 64px minmax(136px, 150px);
  }
  .seller-head > :nth-child(3),
  .seller-head > :nth-child(4),
  .seller-head > :nth-child(7),
  .seller-head > :nth-child(8),
  .seller-row > :nth-child(3),
  .seller-row > :nth-child(4),
  .seller-row > :nth-child(7),
  .seller-row > :nth-child(8),
  .grp-head > :nth-child(3),
  .grp-head > :nth-child(4),
  .grp-head > :nth-child(7),
  .grp-head > :nth-child(8),
  .extra-row > :nth-child(3),
  .extra-row > :nth-child(4),
  .extra-row > :nth-child(7),
  .extra-row > :nth-child(8) { display: none; }
}

/* Ahora (9th col) is never display:none */
.seller-head > :nth-child(9),
.seller-row > .ahora-col,
.grp-head > .ahora-col,
.extra-row > .ahora-col {
  display: flex !important;
  min-width: 150px;
}
.seller-head > .th-ahora {
  display: flex !important;
  flex-direction: column;
}

.seller-row.toto-row > :nth-child(n) { display: revert; }

.ayer-mini {
  display: inline-block; margin-top: 0.28rem;
  border: 0; background: none; color: var(--muted);
  font-size: 0.68rem; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.ayer-mini:hover, .ayer-mini.on { color: var(--accent); }


/* Equipo header: native date picker, light-theme */
.date-pick {
  display: inline-flex;
  align-items: center;
}
.date-pick input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0.34rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color-scheme: light;
  cursor: pointer;
}
body:not(.theme-light) .date-pick input[type="date"] { color-scheme: dark; }
.date-pick input[type="date"]:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 1px;
}
.date-pick input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}


/* ===== Equipo: Meta-style range picker (GitHub greens) ===== */
.range-picker { position: relative; z-index: 30; }
.range-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0.38rem 0.75rem 0.38rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  max-width: min(420px, 72vw);
  box-shadow: 0 1px 2px rgba(17,24,39,0.04);
}
.range-chip:hover { border-color: var(--muted); }
.range-chip[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.range-chip-ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.range-chip[aria-expanded="true"] .range-chip-ico { color: var(--accent); }
#eq-range-chip-lab {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.range-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(780px, calc(100vw - 2rem));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(17,24,39,0.16), 0 2px 8px rgba(17,24,39,0.06);
  overflow: hidden;
}
.range-panel[hidden] { display: none !important; }
.range-panel-main {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 340px;
}
.range-presets {
  border-right: 1px solid var(--line);
  padding: 0.45rem 0;
  display: flex;
  flex-direction: column;
}
.range-preset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.48rem 0.95rem;
  cursor: pointer;
  text-align: left;
}
.range-preset:hover { background: var(--muted-soft); }
.range-preset.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.range-radio {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--muted);
  display: grid; place-items: center;
  background: var(--panel);
}
.range-preset.on .range-radio { border-color: var(--accent); }
.range-preset.on .range-radio::after {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

.range-cals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.range-cal { padding: 0.85rem 1rem 0.7rem; }
.range-cal + .range-cal { border-left: 1px solid var(--line); }
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.55rem; min-height: 28px;
}
.cal-head h4 {
  margin: 0; font-size: 0.86rem; font-weight: 700;
  text-transform: lowercase; letter-spacing: 0;
  flex: 1; text-align: center;
}
.cal-nav {
  width: 28px; height: 28px; border: 0; background: transparent;
  color: var(--text); border-radius: 6px; cursor: pointer;
  font-size: 0.95rem; line-height: 1;
}
.cal-nav:hover { background: var(--muted-soft); }
.cal-nav[disabled] { opacity: 0.28; cursor: default; }
.cal-nav.ghost { visibility: hidden; pointer-events: none; }
.cal-dows {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-dows span {
  text-align: center; font-size: 0.62rem; color: var(--muted);
  font-weight: 600; padding: 0.15rem 0; text-transform: lowercase;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  position: relative;
  height: 34px;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cal-cell .cal-num {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  position: relative; z-index: 1;
}
.cal-cell.in { background: var(--accent-soft); }
.cal-cell.start:not(.end) {
  background: linear-gradient(to right, transparent 50%, var(--accent-soft) 50%);
}
.cal-cell.end:not(.start) {
  background: linear-gradient(to right, var(--accent-soft) 50%, transparent 50%);
}
.cal-cell.start.end { background: transparent; }
.cal-cell.start .cal-num,
.cal-cell.end .cal-num {
  background: var(--heat-4);
  color: #fff;
}
.cal-cell.today .cal-num { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-cell.today.start .cal-num,
.cal-cell.today.end .cal-num { box-shadow: none; }
.cal-cell:hover:not(.dis) .cal-num { background: var(--heat-1); }
.cal-cell.start:hover .cal-num,
.cal-cell.end:hover .cal-num { background: var(--heat-3); color: #fff; }
.cal-cell.dis {
  color: var(--muted);
  opacity: 0.38;
  cursor: default;
}
.cal-cell.empty { cursor: default; }

.range-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--frame-bg);
  flex-wrap: wrap;
}
.range-dates { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.range-date {
  min-width: 148px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 0.28rem 0.7rem 0.36rem;
}
.range-date span {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.range-date b {
  font-size: 0.84rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.range-actions { display: flex; gap: 0.45rem; margin-left: auto; }
.range-actions .btn { padding: 0.4rem 0.95rem; }

.equipo-hora-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin: -0.15rem 0 0.75rem;
}
.equipo-hora-card .now-bars { height: 108px; }
.now-bars.real .nb { min-height: 0; }
.now-bars.real .nb.zero { min-height: 0; opacity: 0.35; }
.now-bars.real .nb.on { min-height: 2px; }
.eq-fe-hora-note { margin: 0.35rem 0 0.15rem; padding: 0 0.4rem; grid-column: 1 / -1; }
.equipo-hora-card .now-axis { margin-bottom: 0.15rem; }

@media (max-width: 860px) {
  .range-panel { right: auto; left: 0; width: min(100vw - 1.5rem, 520px); }
  .range-panel-main { grid-template-columns: 1fr; }
  .range-presets { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
  .range-preset { width: auto; flex: 1 1 46%; }
  .range-cals { grid-template-columns: 1fr; }
  .range-cal + .range-cal { border-left: 0; border-top: 1px solid var(--line); }
}


/* ===== v0.2: Equipo grid alignment + column sort ===== */
.pulso-table .metric,
.pulso-table .metric.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.pulso-table .metric .u {
  text-align: right;
}

.seller-head > .th {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  min-width: 0;
  width: 100%;
  line-height: 1.2;
}
.seller-head > .th-who {
  justify-content: flex-start;
  text-align: left;
}
.seller-head > .th-num {
  flex-direction: row-reverse;
  justify-content: flex-start;
  text-align: right;
}
.seller-head > .th-ahora {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  text-transform: uppercase;
}
.th-ahora-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}
.th-ahora-top #eq-ahora-h {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seller-head > .th:hover { color: var(--text); }
.seller-head > .th:hover .sort-ico { opacity: 0.7; }
.seller-head > .th:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.seller-head > .th[aria-sort="ascending"],
.seller-head > .th[aria-sort="descending"] {
  color: var(--text);
}

.sort-ico {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  flex: none;
  opacity: 0.32;
  line-height: 0;
}
.sort-ico::before,
.sort-ico::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
}
.sort-ico::before { border-bottom: 4px solid currentColor; }
.sort-ico::after { border-top: 4px solid currentColor; }
.th[aria-sort="descending"] .sort-ico,
.th[aria-sort="ascending"] .sort-ico {
  opacity: 1;
  color: var(--accent);
}
.th[aria-sort="descending"] .sort-ico::before { opacity: 0.22; }
.th[aria-sort="ascending"] .sort-ico::after { opacity: 0.22; }
