/* Educación Continua — sub de Traditional Brilliance.
 *
 * Redesign 26 oct 2026 (Miguel: "esta página está very ugly and very deadass… necesito poder ver y
 * entender esta data mejor"). Two CollectUI references, named in the header of educont.js:
 *   ed8312a0 "Dashboard Analytics UI" (@gabriell_lab) — the HERO: one big number with its delta
 *            pill over an area chart, the secondary numbers stacked in a column beside it.
 *   5c7d8fb8 savings dashboard (@sajon_co) — the GOALS list: name, "x of y", a fat rail with
 *            the % riding it, what is left on the right.
 * The components are still the /ui catalog defaults (pm-tile/pm-strip, tb-seg, ev-table,
 * tb-sec-head, tb-empty, tb-btn, bp-chip, .bbb-goal-row, .bbb-lb, .bbh-pop, BBChart, BBSpark);
 * this file lays them out on cards and sets a few tones. Tokens only (--bb-*).
 */
.ec-page { padding-bottom: 64px; }
.ec-root { display: flex; flex-direction: column; gap: 16px; }
.ec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ec-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --- the card ------------------------------------------------------------------------------- */
.ec-card {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 18px 20px;
  background: var(--bb-surface);
  border-radius: var(--bb-r-card);
  box-shadow: var(--bb-sh-card);
}
.ec-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; }
.ec-card-n { font-size: 13px; color: var(--bb-ink-3); }
.ec-card-n .bbb-n { font-size: 15px; }
.ec-more { display: flex; justify-content: center; padding-top: 2px; }
.ec-k {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bb-ink-3);
}

/* --- top: hero + side strip ----------------------------------------------------------------- */
.ec-top { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: stretch; }
.ec-hero { gap: 6px; }
.ec-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.ec-big { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.ec-big .bbb-n { font-family: var(--bb-display); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.ec-hero-sub { margin-top: 6px; min-height: 16px; font-size: 12.5px; color: var(--bb-ink-3); }
.ec-hero-sub b { font-family: var(--bb-mono); font-variant-numeric: tabular-nums; color: var(--bb-ink-2); font-weight: 600; }
.ec-delta {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--bb-mono); font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600;
  color: var(--bb-ink-2);
}
.ec-delta i {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px;
  font-style: normal; font-size: 13px; background: var(--bb-field);
}
.ec-delta.up { color: var(--bb-green); }
.ec-delta.up i { background: var(--bb-green-tint); }
.ec-delta.down { color: var(--bb-red); }
.ec-delta.down i { background: var(--bb-red-tint); }

.ec-hero-goal { min-width: 240px; flex: 0 1 300px; display: flex; flex-direction: column; gap: 6px; }
.ec-hero-gv { display: flex; align-items: baseline; gap: 2px; }
.ec-hero-gv .bbb-n { font-size: 22px; }
.ec-hero-gv em { margin-left: auto; font-style: normal; font-family: var(--bb-mono); font-weight: 600; font-size: 15px; color: var(--bb-ink); }
.ec-hero-goal .bbb-goal { height: 12px; }

.ec-chart { min-height: 120px; }
/* BBChart writes its palette as SVG presentation ATTRIBUTES (stroke="#0D2A5E"), where a var() is
   not valid, so in dark the navy series is navy on a navy card — invisible. CSS beats a
   presentation attribute, so the three colours this page uses are mapped back to the theme
   tokens here, matched by the literal the chart wrote. */
.ec-card .bbc [stroke="#0D2A5E"] { stroke: var(--bb-accent); }
.ec-card .bbc [fill="#0D2A5E"] { fill: var(--bb-accent); }
.ec-card .bbc [fill="#2E7D52"] { fill: var(--bb-green); }
.ec-card .bbc [stroke="#C77D1B"] { stroke: var(--bb-orange); }
/* The goal is the series' projection, drawn in the series' colour; on this page it is the amber of
   the legend. After the token map, and one class heavier, so it wins over it. */
.ec-hero .bbc path.bbc-proj { stroke: var(--bb-orange); opacity: 1; stroke-width: 2; stroke-dasharray: 6 5; }

.ec-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--bb-ink-3); }
.ec-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.ec-legend i { display: inline-block; flex: none; }
.ec-legend i.ln { width: 18px; height: 0; border-top: 2.5px solid var(--bb-accent); border-radius: 2px; }
.ec-legend i.ln.py { border-top: 2px dashed var(--bb-accent); opacity: .5; }
.ec-legend i.ln.goal { border-top: 2px dashed var(--bb-orange); }
.ec-legend i.sq { width: 10px; height: 10px; border-radius: 3px; background: var(--bb-accent); }
.ec-legend i.sq.l { background: var(--bb-field); box-shadow: inset 0 0 0 1px var(--bb-line); }
.ec-legend i.sq.good { background: var(--bb-green); }
.ec-legend i.tick { width: 14px; height: 0; border-top: 2.5px solid var(--bb-orange); }
.ec-legend-sm { gap: 12px; font-size: 11.5px; }

.ec-side.pm-strip { grid-template-columns: 1fr; margin: 0; align-content: stretch; }
.ec-side .pm-tile { display: flex; flex-direction: column; justify-content: center; padding: 14px 16px; }
/* bbui.css orders the tile by flex `order` (label 1, value 2, sub 3); the row that carries the
   value + its spark takes the value slot, and inside it the value leads. */
.ec-tile-row { order: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.ec-tile-row { flex-wrap: wrap; }
.ec-tile-row .pm-tv { order: 1; white-space: nowrap; }
.ec-tile-row .bbs { order: 2; flex: none; margin-bottom: 2px; }

/* --- courses + channels --------------------------------------------------------------------- */
.ec-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.ec-goals { display: flex; flex-direction: column; }
.ec-goal-row {
  grid-template-columns: minmax(150px, 1.3fr) minmax(120px, 1.6fr) auto;
  column-gap: 16px; row-gap: 6px;
  margin: 0 -10px; padding: 11px 10px;
  border-radius: 8px; cursor: pointer;
  border-bottom: 1px dashed var(--bb-line);
}
.ec-goal-row:last-child { border-bottom: 0; }
.ec-goal-row:hover, .ec-goal-row:focus-visible { background: var(--bb-hover); outline: none; }
.ec-goal-row .bbb-goal-l { line-height: 1.25; }
.ec-goal-row .bbb-goal-l b { display: block; font-size: 13.5px; font-weight: 600; color: var(--bb-ink); }
.ec-goal-row .bbb-goal-l span { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--bb-ink-3); }
.ec-goal-row .bbb-goal { height: 12px; }
.ec-goal-row .bbb-goal-v { display: flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.ec-goal-row .bbb-goal-v em {
  min-width: 44px; margin-left: 10px; text-align: right;
  font-style: normal; font-family: var(--bb-mono); font-size: 13px; font-weight: 600; color: var(--bb-ink-2);
}
.ec-goal-row .bbb-goal-cap { grid-column: 2 / 4; margin-top: -2px; font-size: 11px; }
.ec-rail-none { display: block; height: 12px; border-radius: 999px; background: repeating-linear-gradient(90deg, var(--bb-line) 0 4px, transparent 4px 8px); }

.ec-sub-h {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--bb-line);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bb-ink-3);
}
.ec-sub-h b { font-family: var(--bb-mono); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--bb-ink-2); }
.ec-loose { display: flex; flex-direction: column; }
.ec-loose-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; gap: 14px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed var(--bb-line); font-size: 12.5px; color: var(--bb-ink-2);
}
.ec-loose-row:last-child { border-bottom: 0; }
.ec-loose-row em { font-style: normal; font-size: 11.5px; color: var(--bb-ink-3); font-family: var(--bb-mono); }
.ec-loose-row b { text-align: right; }

.ec-channels .bbb-lb-row { grid-template-columns: 26px minmax(120px, 1.3fr) minmax(80px, 1.4fr) auto; }
.ec-channels .bbb-lb-sub { margin-top: 2px; }
.ec-channels .bbb-lb-sub .pm-dev { margin-left: 2px; }
.ec-dual { height: 12px; }
.ec-dual > i { position: absolute; left: 0; top: 0; }
.ec-dual > i.ec-dual-l { background: var(--bb-line-strong); opacity: .55; }
.ec-channels .bbb-lb-val .bbb-n { font-size: 16px; }
.ec-channels .bbb-lb-val .bbb-u { font-size: 11.5px; }

/* --- tables --------------------------------------------------------------------------------- */
.ec-table td.num, .ec-table th.num { text-align: right; }
.ec-table td.num { font-family: var(--bb-mono); font-variant-numeric: tabular-nums; }
.ec-table .ec-strong { font-weight: 700; color: var(--bb-ink); }
.ec-table .ec-quiet, .ec-quiet { color: var(--bb-ink-3); }
.ec-table .ec-thin { opacity: .5; }
.ec-center { text-align: center; }
.ec-table tfoot td { font-weight: 700; border-top: 1px solid var(--bb-line); background: var(--bb-inset); }
.ec-table .ec-rail { width: 160px; min-width: 120px; padding-right: 4px; }
.ec-table .ec-rail .bbb-goal { display: block; }
.ec-table .ec-pct { width: 52px; }
.ec-table tr.ec-group td {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--bb-ink-3); background: var(--bb-inset); padding-top: 12px;
}
.ec-table tr.ec-future td { color: var(--bb-ink-3); }

.ec-ctable .ec-cname { min-width: 220px; max-width: 340px; white-space: normal; }
.ec-ctable .ec-cname .bp-chip { padding: 3px 7px; font-size: 10.5px; margin-right: 8px; vertical-align: 1px; }
.ec-ctable .ec-cname b { font-weight: 600; color: var(--bb-ink); }
.ec-ctable .ec-camp {
  display: block; margin-top: 3px;
  font-family: var(--bb-mono); font-size: 10.5px; color: var(--bb-ink-3);
  word-break: break-all; white-space: normal;
}
.ec-spend { min-width: 150px; }
.ec-spend-v { display: block; font-family: var(--bb-mono); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--bb-ink); }
.ec-bar { display: block; height: 6px; margin-top: 5px; border-radius: 999px; background: var(--bb-field); overflow: hidden; }
.ec-bar > i { display: block; height: 100%; width: calc(var(--p) * 1%); border-radius: 999px; background: var(--bb-accent); }
.ec-table td.ec-good { color: var(--bb-green); font-weight: 700; }
.ec-table td.ec-bad { color: var(--bb-red); font-weight: 700; }
/* An owned campaign that spent in the window and brought no lead: the money is the finding. */
.ec-table tr.ec-noleads td:nth-child(3) { color: var(--bb-red); font-weight: 700; }

/* --- the row detail: the catalog popover, fixed to the viewport (see popShow in educont.js) -- */
.bbh.ec-pop { position: fixed; z-index: 60; width: min(420px, calc(100vw - 16px)); max-height: min(70vh, 560px); overflow: auto; }
.bbh.ec-pop::before { display: none; }
.ec-pop-k {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin-bottom: 12px;
  font-size: 12px; color: var(--bb-ink-3);
}
.ec-pop-k b { font-family: var(--bb-mono); font-variant-numeric: tabular-nums; color: var(--bb-ink); text-align: right; }
.ec-pop-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ec-pop-t th { text-align: left; font-size: 11px; font-weight: 600; color: var(--bb-ink-3); padding: 0 0 6px; }
.ec-pop-t td { padding: 6px 0; border-top: 1px solid var(--bb-line); }
.ec-pop-t .num { text-align: right; font-family: var(--bb-mono); font-variant-numeric: tabular-nums; padding-left: 12px; }

/* --- narrow --------------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .ec-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ec-top { grid-template-columns: minmax(0, 1fr); }
  .ec-side.pm-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ec-card { padding: 14px 14px; }
  .ec-big .bbb-n { font-size: 34px; }
  .ec-hero-goal { min-width: 0; flex-basis: 100%; }
  .ec-goal-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ec-goal-row .bbb-goal { grid-column: 1 / -1; grid-row: 2; }
  .ec-goal-row .bbb-goal-cap { grid-column: 1 / -1; }
  .ec-channels .bbb-lb-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .ec-channels .ec-dual { grid-column: 2 / -1; grid-row: 2; }
  .ec-table .ec-rail { width: 90px; min-width: 70px; }
}
.ec-table tr.ec-more-row td { padding: 8px 0; background: transparent; }
.ec-table tr.ec-more-row:hover td { background: transparent; }
