/* /servicios/erp/ — recorrido de un documento por 5 áreas sobre un bus de datos ([data-progress] steps=5) */
.erp-board { padding-top: clamp(40px, 4.4vw, 70px); }
.erp { --n: 5; font-size: clamp(11px, .55rem + .45vw, 15px); display: grid; gap: 1.8em; color: var(--paper); }

/* estaciones (módulos) + bus de datos: guía punteada de plano y conexión activa que se enciende con el avance */
.erp-st { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding-top: 2.2em; }
.erp-st::before, .erp-st::after { content: ""; position: absolute; top: .55em; height: 0; left: 10%; }
.erp-st::before { right: 10%; border-top: 1.5px dashed var(--line-dark-strong); }
.erp-st::after { width: calc(var(--p, 0) * 80%); border-top: 2.5px solid var(--chalk); box-shadow: 0 0 10px rgba(255, 74, 28, .45); transition: width .15s linear; }
.erp-st li { position: relative; display: grid; justify-items: center; text-align: center; gap: .2em; padding: 0 .4em; min-width: 0; }
.erp-st li::before { content: ""; position: absolute; top: -2.15em; left: 50%; width: 1.1em; height: 1.1em; margin-left: -.55em; border-radius: 2px; background: var(--ink-2); border: 1.5px solid var(--line-dark-strong); transition: background-color .4s, border-color .4s, box-shadow .4s, transform .5s var(--ease-out); z-index: 1; }
.erp-st__n { font-family: var(--f-mono); font-size: .72em; letter-spacing: .1em; color: var(--mute-dark); }
.erp-st b { font-size: 1.15em; font-weight: 780; letter-spacing: -.02em; line-height: 1.1; transition: color .4s; }
.erp-st li > span:last-child { font-size: .82em; color: var(--mute-dark); line-height: 1.3; }

.erp:not([data-at]) .erp-st li:nth-child(1)::before { background: var(--chalk); border-color: var(--chalk); }
.erp[data-at="0"] .erp-st li:nth-child(-n+1)::before, .erp[data-at="1"] .erp-st li:nth-child(-n+2)::before, .erp[data-at="2"] .erp-st li:nth-child(-n+3)::before,
.erp[data-at="3"] .erp-st li:nth-child(-n+4)::before, .erp[data-at="4"] .erp-st li:nth-child(-n+5)::before { background: var(--chalk); border-color: var(--chalk); }
.erp[data-at="0"] .erp-st li:nth-child(1)::before, .erp[data-at="1"] .erp-st li:nth-child(2)::before, .erp[data-at="2"] .erp-st li:nth-child(3)::before,
.erp[data-at="3"] .erp-st li:nth-child(4)::before, .erp[data-at="4"] .erp-st li:nth-child(5)::before { box-shadow: 0 0 0 .4em rgba(255, 74, 28, .25); transform: scale(1.25); }
.erp[data-at="0"] .erp-st li:nth-child(1) b, .erp[data-at="1"] .erp-st li:nth-child(2) b, .erp[data-at="2"] .erp-st li:nth-child(3) b,
.erp[data-at="3"] .erp-st li:nth-child(4) b, .erp[data-at="4"] .erp-st li:nth-child(5) b { color: var(--chalk); }

/* el documento que viaja */
.erp-lane { position: relative; height: 7.4em; }
.erp-doc { position: absolute; left: 0; top: 0; width: calc(100% / var(--n)); padding: 0 .35em; transition: transform 1s cubic-bezier(.7, 0, .2, 1); }
.erp-doc__s { display: none; position: relative; background: var(--paper); color: var(--ink); border-radius: 3px; padding: .75em .85em .8em; box-shadow: .5em .5em 0 -.1em rgba(255, 74, 28, .3); gap: .15em; }
.erp-doc__s::before { content: ""; position: absolute; left: 50%; top: -.9em; width: 1.5px; height: .9em; background: var(--chalk); }
.erp-doc__s b { font-size: 1.05em; font-weight: 780; letter-spacing: -.015em; line-height: 1.15; }
.erp-doc__s > span:last-child { font-size: .8em; color: var(--mute); }
.erp:not([data-at]) .erp-doc__s[data-s="0"] { display: grid; }
.erp[data-at="0"] .erp-doc__s[data-s="0"], .erp[data-at="1"] .erp-doc__s[data-s="1"], .erp[data-at="2"] .erp-doc__s[data-s="2"],
.erp[data-at="3"] .erp-doc__s[data-s="3"], .erp[data-at="4"] .erp-doc__s[data-s="4"] { display: grid; animation: erp-in .6s var(--ease-out); }
.erp[data-at="1"] .erp-doc { transform: translateX(100%); }
.erp[data-at="2"] .erp-doc { transform: translateX(200%); }
.erp[data-at="3"] .erp-doc { transform: translateX(300%); }
.erp[data-at="4"] .erp-doc { transform: translateX(400%); }

/* tablero que se actualiza */
.erp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-dark-strong); }
.erp-k { display: grid; gap: .3em; padding: 1em 1em .2em 0; min-width: 0; }
.erp-k + .erp-k { padding-left: 1em; border-left: 1px solid var(--line-dark); }
.erp-k > span { font-family: var(--f-mono); font-size: .72em; letter-spacing: .07em; text-transform: uppercase; color: var(--mute-dark); }
.erp-k b { font-size: 1.9em; font-weight: 820; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 84; white-space: nowrap; }
.erp-k i { font-style: normal; display: none; }
.erp:not([data-at]) .erp-k i[data-s="0"] { display: inline; }
.erp[data-at="0"] .erp-k i[data-s="0"], .erp[data-at="1"] .erp-k i[data-s="1"], .erp[data-at="2"] .erp-k i[data-s="2"],
.erp[data-at="3"] .erp-k i[data-s="3"], .erp[data-at="4"] .erp-k i[data-s="4"] { display: inline; animation: erp-flash 1.1s var(--ease-out); }
@keyframes erp-in { from { opacity: 0; transform: translateY(.5em); } to { opacity: 1; transform: none; } }
@keyframes erp-flash { 0% { color: var(--chalk); } 100% { color: var(--paper); } }
.erp-foot { margin-top: 18px; color: var(--mute-dark); font-size: var(--fs-mono); letter-spacing: .08em; text-transform: uppercase; }

.erp-compare { margin-top: clamp(48px, 6vw, 90px); }

@media (max-width: 760px) {
  .erp-st li > span:last-child { display: none; }
  .erp-st b { font-size: .86em; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
  .erp-st li { padding: 0 .1em; }
  .erp-lane { height: auto; }
  .erp-doc { position: relative; width: 100%; transform: none !important; padding: 0; }
  .erp-doc__s::before { left: calc(10% + var(--k, 0) * 20%); transition: left .6s; }
  .erp[data-at="1"] .erp-doc__s::before { --k: 1; } .erp[data-at="2"] .erp-doc__s::before { --k: 2; }
  .erp[data-at="3"] .erp-doc__s::before { --k: 3; } .erp[data-at="4"] .erp-doc__s::before { --k: 4; }
  .erp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-k:nth-child(3) { padding-left: 0; border-left: 0; }
  .erp-k:nth-child(n+3) { border-top: 1px solid var(--line-dark); }
  .erp-k b { font-size: 1.6em; }
}
@media (prefers-reduced-motion: reduce) { .erp-doc, .erp-st::after { transition: none; } .erp-k i, .erp-doc__s { animation: none !important; } }
@media (max-width: 600px) {
  .erp-board .stage__cota span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .erp-board .stage__cota span:last-child { display: none; }
  .erp-st b { font-size: .8em; }
}
