/* Página de curso: Power BI (para empresas). Identidad propia: el lienzo de un informe de Power BI,
   amarillo de la herramienta, pestañas de página por área y gráficos que se filtran entre sí. */
.c-power-bi { --pb-y: #f2c811; --pb-y2: #e8a700; --pb-txt: #8a6400; --pb-bar: #252423; --pb-good: #1a8a52; }
:root[data-theme="dark"] .c-power-bi { --pb-txt: #f5d24a; --pb-good: #5fd59a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-power-bi { --pb-txt: #f5d24a; --pb-good: #5fd59a; } }

.c-power-bi .c-hero h1 { font-size: clamp(2.2rem, 1.3rem + 2.9vw, 3.6rem); max-width: 17ch; }
.c-power-bi .c-hero h1 em { color: var(--pb-txt); }
.c-power-bi h2 em { color: var(--pb-txt); }
.c-solo-emp { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--ink); background: color-mix(in srgb, var(--pb-y) 26%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pb-y2) 50%, var(--line)); }
.c-solo-emp::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--pb-y2); }

/* Las pestañas de página del informe como numeración de la historia */
.c-power-bi .cs-step-n { justify-self: start; padding: 4px 12px 5px; border-radius: 8px 8px 0 0; border-bottom: 3px solid var(--pb-y); background: var(--surface); color: var(--ink); font-size: .78rem; letter-spacing: .02em; }

/* ---------- Portada: lienzo de informe ---------- */
.pb-canvas { background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr auto; aspect-ratio: 3 / 2.2; font-size: .78rem; }
.pb-canvas-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--pb-bar); color: #f3f2f1; font-weight: 600; font-size: .8rem; }
.pb-canvas-bar b { margin-left: auto; font-weight: 500; font-size: .7rem; color: #c8c6c4; }
.pb-logo { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.pb-logo i { width: 4px; border-radius: 1px; background: var(--pb-y); } .pb-logo i:nth-child(1) { height: 50%; } .pb-logo i:nth-child(2) { height: 75%; } .pb-logo i:nth-child(3) { height: 100%; background: var(--pb-y2); }
.pb-canvas-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto 1fr; gap: 10px; padding: 12px; background: var(--bg); min-height: 0; }
.pb-k { padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 1px; }
.pb-k small, .pb-v small { color: var(--muted); font-size: .66rem; }
.pb-k b { font-family: var(--f-display); font-size: clamp(.9rem, 1.6vw, 1.2rem); }
.pb-k span { font-size: .64rem; font-weight: 600; }
.pb-k .up { color: var(--pb-good); } .pb-k .dn { color: var(--pb-good); }
.pb-v { padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr; gap: 6px; min-height: 0; }
.pb-col { grid-column: span 2; }
.pb-cols { display: flex; align-items: flex-end; gap: 6%; min-height: 70px; }
.pb-cols i { flex: 1; height: var(--h); border-radius: 3px 3px 0 0; background: var(--pb-y); transform-origin: bottom; animation: pb-grow 1s cubic-bezier(.2, .8, .2, 1) both; }
.pb-cols i:nth-child(even) { background: var(--pb-y2); }
.pb-cols i:nth-child(2) { animation-delay: .06s; } .pb-cols i:nth-child(3) { animation-delay: .12s; } .pb-cols i:nth-child(4) { animation-delay: .18s; } .pb-cols i:nth-child(5) { animation-delay: .24s; } .pb-cols i:nth-child(6) { animation-delay: .3s; } .pb-cols i:nth-child(7) { animation-delay: .36s; } .pb-cols i:nth-child(8) { animation-delay: .42s; }
.pb-fun { align-content: start; justify-items: center; gap: 3px; }
.pb-fun span { width: var(--w); padding: 3px 0; text-align: center; border-radius: 3px; font-size: .58rem; font-weight: 600; color: #3b2f00; background: color-mix(in srgb, var(--pb-y) calc(40% + var(--w) * .6), #fff3c4); white-space: nowrap; overflow: hidden; }
.pb-tabs { display: flex; gap: 2px; padding: 0 10px; background: var(--surface); border-top: 1px solid var(--line); font-size: .66rem; color: var(--muted); }
.pb-tabs span { padding: 6px 10px; border-top: 3px solid transparent; animation: pb-tab 8s infinite; }
.pb-tabs span:nth-child(2) { animation-delay: 2s; } .pb-tabs span:nth-child(3) { animation-delay: 4s; } .pb-tabs span:nth-child(4) { animation-delay: 6s; }
@keyframes pb-tab { 0%, 22% { border-top-color: var(--pb-y2); color: var(--ink); font-weight: 600; } 25%, 100% { border-top-color: transparent; } }
@keyframes pb-grow { from { transform: scaleY(0); } }
.pb-field { position: absolute; left: -18px; bottom: 22%; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; font-size: .86rem; animation: c-in .7s .6s both, pb-drag 6s 1.4s ease-in-out infinite; }
.pb-field small { color: var(--muted); font-weight: 500; font-size: .72rem; }
.pb-sigma { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--pb-y); color: #3b2f00; font-weight: 700; }
@keyframes pb-drag { 0%, 15% { transform: none; } 40%, 60% { transform: translate(34px, -46px) rotate(-2deg); } 85%, 100% { transform: none; } }

/* ---------- Historia ---------- */
.pb-stage { font-size: .86rem; }
.c-power-bi .s1 { background: none; }
.c-power-bi .s2, .c-power-bi .s4 { display: block; }
.c-power-bi .s5 { padding: 7%; }

/* Escena 1: pedidos */
.pb-req { position: absolute; width: 50%; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 26px -18px rgba(16, 42, 67, .5); line-height: 1.35; font-size: .84rem; }
.pb-req b { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pb-txt); margin-bottom: 3px; }
.r1 { left: 6%; top: 7%; } .r2 { right: 6%; top: 22%; --d: .12s; border-radius: 14px 14px 4px 14px; } .r3 { left: 9%; top: 44%; --d: .24s; } .r4 { right: 5%; top: 62%; --d: .36s; border-radius: 14px 14px 4px 14px; }
.pb-count { position: absolute; left: 7%; bottom: 7%; padding: 8px 14px; border-radius: 999px; background: #c2462e; color: #fff; font-weight: 600; font-size: .8rem; --d: .5s; }
.cs-stage:not([data-step="1"]) .s1 .pb-req { opacity: 0; transform: translateY(20px) scale(.96); }
.cs-stage:not([data-step="1"]) .s1 .pb-count { opacity: 0; transform: scale(.8); }

/* Escena 2: Power Query */
.pb-srcs { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pb-srcs li { padding: 5px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line); }
.pb-pq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); gap: 10px; --d: .15s; }
.pb-steps { display: grid; align-content: start; gap: 4px; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .72rem; }
.pb-steps small { color: var(--muted); font-size: .66rem; margin-bottom: 2px; }
.pb-steps span { padding: 4px 6px; border-radius: 5px; opacity: .35; transition: opacity .4s, background-color .4s; }
.cs-stage[data-step="2"] .pb-steps span { opacity: 1; }
.cs-stage[data-step="2"] .pb-steps span:last-child { background: color-mix(in srgb, var(--pb-y) 30%, var(--surface)); }
.pb-steps span:nth-child(3) { transition-delay: .2s; } .pb-steps span:nth-child(4) { transition-delay: .4s; } .pb-steps span:nth-child(5) { transition-delay: .6s; } .pb-steps span:nth-child(6) { transition-delay: .8s; }
.pb-grid { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); font-family: var(--f-data); font-size: .72rem; }
.pb-grid > div { display: grid; grid-template-columns: .9fr 1.1fr .9fr 1fr; padding: 7px 10px; border-top: 1px solid var(--line); }
.pb-grid > .h { border-top: 0; font-weight: 600; background: color-mix(in srgb, var(--pb-y) 18%, var(--surface)); }
.pb-grid span:last-child { text-align: right; }
.fix { display: grid; }
.fix::before, .fix::after { grid-area: 1 / 1; transition: opacity .4s; }
.fix::before { content: attr(data-a); color: var(--bad); }
.fix::after { content: attr(data-b); color: var(--pb-good); font-weight: 600; opacity: 0; }
.cs-stage[data-step="2"] .fix::before { opacity: 0; transition-delay: 1.1s; }
.cs-stage[data-step="2"] .fix::after { opacity: 1; transition-delay: 1.2s; }
.cs-stage:not([data-step="2"]) .s2 .pb-pq, .cs-stage:not([data-step="2"]) .s2 .pb-srcs { opacity: 0; transform: translateY(16px); }

/* Escena 3: tipos de gráfico */
.c-power-bi .s3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pb-viz { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr; gap: 6px; min-height: 0; }
.pb-viz small { font-size: .7rem; color: var(--muted); }
.pb-viz svg { width: 100%; height: 100%; min-height: 0; overflow: visible; }
.z2 { --d: .1s; } .z3 { --d: .2s; } .z4 { --d: .3s; }
.pb-dots circle { fill: var(--pb-y2); opacity: .85; }
.pb-line { fill: none; stroke: var(--pb-y2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset 1.2s .4s ease; }
.cs-stage[data-step="3"] .pb-line { stroke-dashoffset: 0; }
.pb-mini-fun { display: grid; justify-items: center; align-content: center; gap: 4px; }
.pb-mini-fun i { width: var(--w); height: 12px; border-radius: 3px; background: var(--pb-y); }
.pb-mini-fun i:nth-child(even) { background: var(--pb-y2); }
.pb-hbars { display: grid; align-content: center; gap: 6px; }
.pb-hbars i { width: var(--w); height: 11px; border-radius: 0 3px 3px 0; background: var(--pb-y2); transform-origin: left; transition: transform .8s .3s cubic-bezier(.2, .8, .2, 1); }
.cs-stage:not([data-step="3"]) .pb-hbars i { transform: scaleX(0); }
.cs-stage:not([data-step="3"]) .s3 .pb-viz { opacity: 0; transform: scale(.92); }

/* Escena 4: interacción entre gráficos */
.pb-rep { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; height: 84%; }
.pb-zones, .pb-kk, .pb-map { position: relative; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.pb-zones { display: grid; grid-template-rows: auto 1fr; gap: 8px; }
.pb-zones small, .pb-kk small, .pb-map small { font-size: .7rem; color: var(--muted); }
.pb-zb { display: flex; align-items: flex-end; gap: 10%; padding-bottom: 18px; min-height: 0; }
.pb-zb i { position: relative; flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: var(--pb-y2); transition: opacity .4s 1.3s; }
.pb-zb em { position: absolute; left: 50%; bottom: -18px; translate: -50% 0; font-style: normal; font-size: .64rem; color: var(--muted); }
.cs-stage[data-step="4"] .pb-zb i:not(.sel) { opacity: .25; }
.pb-cursor { position: absolute; left: 22%; top: 44%; width: 18px; height: 18px; clip-path: polygon(0 0, 0 100%, 30% 72%, 52% 100%, 66% 92%, 46% 66%, 82% 64%); background: var(--ink); filter: drop-shadow(0 0 1.5px var(--surface)); transition: transform .9s .3s cubic-bezier(.2, .8, .2, 1); transform: translate(120px, 60px); }
.cs-stage[data-step="4"] .pb-cursor { transform: none; }
.pb-side { display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.pb-kk { display: grid; gap: 2px; }
.pb-kk b { display: grid; font-family: var(--f-display); font-size: 1.3rem; }
.pb-kk b span { grid-area: 1 / 1; transition: opacity .4s 1.3s; }
.pb-kk .flt { opacity: 0; color: var(--pb-txt); }
.cs-stage[data-step="4"] .pb-kk .all { opacity: 0; } .cs-stage[data-step="4"] .pb-kk .flt { opacity: 1; }
.pb-map { overflow: hidden; background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--accent-soft) 22%, var(--surface)), var(--surface) 70%); }
.pb-map i { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; border-radius: 50%; background: var(--pb-y2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pb-y) 30%, transparent); transition: opacity .4s 1.3s; }
.cs-stage[data-step="4"] .pb-map i:not(.n) { opacity: .15; }
.pb-hint { position: absolute; left: 7%; bottom: 6%; margin: 0; font-size: .8rem; color: var(--muted); --d: 1.4s; }
.pb-hint b { color: var(--pb-txt); }
.cs-stage:not([data-step="4"]) .s4 .pb-rep { opacity: 0; transform: translateY(16px); }
.cs-stage:not([data-step="4"]) .s4 .pb-hint { opacity: 0; transition-delay: 0s; }

/* Escena 5: publicado */
.pb-web { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 14px 30px -20px rgba(16, 42, 67, .5); }
.pb-web-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--pb-bar); color: #e1dfdd; font-size: .72rem; }
.pb-web-bar i { width: 8px; height: 8px; border-radius: 50%; background: #605e5c; }
.pb-web-bar span { margin-left: 8px; }
.pb-web-body { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px; }
.pb-pages { display: grid; align-content: start; gap: 4px; font-size: .72rem; }
.pb-pages span { padding: 5px 10px; border-left: 3px solid transparent; color: var(--muted); }
.pb-pages .on { border-left-color: var(--pb-y2); color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--pb-y) 16%, var(--surface)); }
.pb-web-viz { display: flex; align-items: flex-end; gap: 7%; height: 110px; border-bottom: 1px solid var(--line); }
.pb-web-viz i { flex: 1; height: var(--h); border-radius: 3px 3px 0 0; background: var(--pb-y); }
.pb-pub { position: absolute; right: 7%; top: 5%; padding: 7px 12px; border-radius: 999px; background: var(--pb-good); color: #fff; font-weight: 600; font-size: .78rem; --d: .4s; }
:root[data-theme="dark"] .pb-pub { color: #062b18; }
.pb-exp { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; --d: .55s; }
.pb-exp li { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: .78rem; font-weight: 600; }
.pb-exp li:first-child { background: var(--pb-y); color: #3b2f00; border-color: var(--pb-y2); }
.cs-stage:not([data-step="5"]) .s5 .pb-web { opacity: 0; transform: translateY(20px); }
.cs-stage:not([data-step="5"]) .s5 .pb-pub, .cs-stage:not([data-step="5"]) .s5 .pb-exp { opacity: 0; transform: translateY(12px); }

/* ---------- Programa ---------- */
.c-power-bi .unit-n { color: var(--pb-txt); }
.c-power-bi .unit li::before { background: var(--pb-y2); border-radius: 1px; }
.c-power-bi .gain-list span { -webkit-text-stroke-color: var(--pb-y2); }

@media (max-width: 900px) {
  .pb-field { left: -8px; }
}
@media (max-width: 560px) {
  .pb-stage { font-size: .74rem; }
  .pb-canvas { font-size: .7rem; }
  .pb-canvas-body { gap: 6px; padding: 8px; }
  .pb-k { padding: 6px; } .pb-k small { font-size: .58rem; }
  .pb-tabs span { padding: 5px 6px; font-size: .6rem; }
  .pb-req { width: 56%; padding: 7px 9px; font-size: .66rem; } .pb-req b { font-size: .58rem; }
  .r1 { top: 4%; } .r2 { top: 22%; } .r3 { top: 42%; left: 4%; } .r4 { top: 60%; }
  .pb-count { font-size: .66rem; padding: 5px 10px; bottom: 5%; }
  .pb-srcs { margin-bottom: 6px; gap: 4px; } .pb-srcs li { font-size: .6rem; padding: 3px 7px; }
  .pb-pq { grid-template-columns: minmax(0, 1fr); }
  .pb-steps { display: none; }
  .pb-grid { font-size: .62rem; } .pb-grid > div { padding: 4px 8px; }
  .c-power-bi .s3 { gap: 6px; }
  .pb-viz { padding: 6px 8px; gap: 2px; } .pb-viz small { font-size: .58rem; }
  .pb-mini-fun i { height: 8px; } .pb-hbars { gap: 4px; } .pb-hbars i { height: 7px; }
  .pb-rep { gap: 6px; height: 80%; }
  .pb-zones, .pb-kk, .pb-map { padding: 6px 8px; } .pb-zones small, .pb-kk small, .pb-map small { font-size: .58rem; }
  .pb-kk b { font-size: .95rem; } .pb-side { gap: 6px; }
  .pb-hint { font-size: .66rem; bottom: 4%; }
  .pb-web-body { padding: 8px; gap: 8px; } .pb-pages { font-size: .6rem; } .pb-pages span { padding: 3px 6px; }
  .pb-web-viz { height: 60px; }
  .pb-exp { margin-top: 8px; gap: 5px; } .pb-exp li { font-size: .62rem; padding: 4px 8px; }
  .pb-pub { font-size: .64rem; padding: 4px 9px; top: 3%; }
}
@media (prefers-reduced-motion: reduce) {
  .pb-cols i, .pb-tabs span, .pb-field { animation: none !important; }
  .pb-line, .pb-hbars i, .pb-zb i, .pb-cursor, .pb-kk b span, .pb-map i, .fix::before, .fix::after, .pb-steps span { transition: none !important; }
}

/* Recorrido: clases, casos prácticos y certificado */
.pb-road { grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 900px) { .pb-road { grid-template-columns: minmax(0, 1fr); } }
