/* /servicios/sistemas-a-la-medida/ — "del Excel al sistema"
   .xl usa [data-progress] (servicios.js): data-at 0 = hoja de cálculo, 1 = app, 2 = app con menú y acciones. */
.xl-dev .dev__url { position: relative; }
.xl-u1 { display: none; }
.xl-dev:has(.xl:is([data-at="1"], [data-at="2"])) .xl-u0 { display: none; }
.xl-dev:has(.xl:is([data-at="1"], [data-at="2"])) .xl-u1 { display: inline; color: var(--ink); }

.xl { display: grid; grid-template-columns: var(--sw, 0em) minmax(0, 1fr); transition: grid-template-columns .9s var(--ease-out); min-height: 24em; background: #fff; }
.xl[data-at="2"] { --sw: 8.6em; background: var(--paper); }

/* menú lateral (sólo en la vista 3) */
.xl-side { overflow: hidden; background: var(--ink); color: var(--paper); display: flex; flex-direction: column; gap: .3em; padding: 1em 0; white-space: nowrap; }
.xl-brand { font-weight: 800; font-size: 1.05em; letter-spacing: -.02em; padding: 0 1em .8em; border-bottom: 1px solid var(--line-dark); margin-bottom: .4em; }
.xl-nav { padding: .45em 1em; font-size: .9em; color: var(--mute-dark); border-left: 3px solid transparent; }
.xl-nav.is-on { color: var(--paper); border-left-color: var(--chalk); background: var(--ink-2); }

.xl-main { display: flex; flex-direction: column; min-width: 0; padding: 0; transition: padding .8s var(--ease-out); }
.xl:is([data-at="1"], [data-at="2"]) .xl-main { padding: 1em 1.1em; gap: .3em; }

/* barra de fórmulas → buscador */
.xl-tool { display: flex; align-items: center; min-height: 2.4em; border-bottom: 1px solid #c9c9c9; background: #f6f6f6; }
.xl-fx { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: .76em; color: #444; padding: .5em .8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl-fx i { font-style: italic; font-weight: 700; color: #1f7a44; margin-right: .8em; }
.xl-app { display: none; flex: 1; gap: .6em; align-items: center; }
.xl-app .m-input { flex: 1; }
.xl:is([data-at="1"], [data-at="2"]) .xl-tool { border: 0; background: transparent; margin-bottom: .5em; }
.xl:is([data-at="1"], [data-at="2"]) .xl-fx { display: none; }
.xl:is([data-at="1"], [data-at="2"]) .xl-app { display: flex; animation: xl-in .6s var(--ease-out); }

/* la retícula */
.xl-grid { display: grid; gap: 0; transition: gap .8s var(--ease-out); }
.xl-row { display: grid; grid-template-columns: var(--nw, 2.2em) 4.8em minmax(0, 1fr) minmax(0, 1fr) 6.4em 7.6em var(--aw, 0em); align-items: stretch; font-size: .88em; transition: grid-template-columns .8s var(--ease-out), background-color .5s, border-radius .6s, box-shadow .6s; }
.xl-row > span { padding: .5em .55em; border-right: 1px solid #d6d6d6; border-bottom: 1px solid #d6d6d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: flex; align-items: center; gap: .4em; transition: border-color .6s, padding .6s; }
.xl-n { justify-content: center; background: #f0f0f0; color: #777; font-size: .85em; }
.xl-row--h > span { background: #f0f0f0; color: #555; font-weight: 600; justify-content: center; }
.xl-row--h i { font-style: normal; }
.xl-row--h em { display: none; font-style: normal; }
.xl-act { display: none !important; }
.xl-row--sel .xl-st { box-shadow: inset 0 0 0 2px #1f7a44; }
.xl-err { color: #c62828; font-weight: 700; }
.xl-fix { display: none; }
.xl-tabs { display: flex; gap: 0; margin-top: auto; padding-top: 1.2em; font-size: .78em; }
.xl-tabs span { padding: .35em .9em; border: 1px solid #d0d0d0; border-top: 0; background: #f6f6f6; color: #555; }
.xl-tabs span:first-child { background: #fff; color: #1f7a44; font-weight: 700; border-bottom: 2px solid #1f7a44; }

/* vista 2: de hoja a app */
.xl:is([data-at="1"], [data-at="2"]) .xl-row { --nw: 0em; }
.xl:is([data-at="1"], [data-at="2"]) .xl-row > span { border-right-color: transparent; border-bottom-color: var(--line); }
.xl:is([data-at="1"], [data-at="2"]) .xl-n { padding-inline: 0; background: transparent; color: transparent; }
.xl:is([data-at="1"], [data-at="2"]) .xl-row--h > span { background: transparent; justify-content: flex-start; font-family: var(--f-mono); font-size: .78em; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
.xl:is([data-at="1"], [data-at="2"]) .xl-row--h i { display: none; }
.xl:is([data-at="1"], [data-at="2"]) .xl-row--h em { display: inline; animation: xl-in .5s var(--ease-out); }
.xl:is([data-at="1"], [data-at="2"]) .xl-row--sel .xl-st { box-shadow: none; }
.xl:is([data-at="1"], [data-at="2"]) .xl-err { display: none; }
.xl:is([data-at="1"], [data-at="2"]) .xl-fix { display: inline; }
.xl:is([data-at="1"], [data-at="2"]) .xl-tabs { display: none; }
.xl:is([data-at="1"], [data-at="2"]) .xl-row:not(.xl-row--h) .xl-st { justify-content: flex-start; }
.xl:is([data-at="1"], [data-at="2"]) .xl-row:not(.xl-row--h) .xl-st { padding-block: .35em; }
.xl:is([data-at="1"], [data-at="2"]) .xl-row:not(.xl-row--h) .xl-st { color: var(--ink); }
.xl:is([data-at="1"], [data-at="2"]) .xl-row:not(.xl-row--h) .xl-st { font-weight: 650; font-size: .86em; }
.xl:is([data-at="1"], [data-at="2"]) .xl-row:not(.xl-row--h) .xl-st { border-radius: 100px; margin: .3em 0; border: 1px solid var(--line-strong); padding-inline: .7em; width: max-content; max-width: 100%; animation: xl-in .5s var(--ease-out); }
.xl:is([data-at="1"], [data-at="2"]) .xl-st[data-st="proc"] { background: var(--chalk-soft); border-color: var(--chalk); }
.xl:is([data-at="1"], [data-at="2"]) .xl-st[data-st="ok"] { background: #d9f3cd; border-color: #2fa35f; }
.xl:is([data-at="1"], [data-at="2"]) .xl-st[data-st="late"] { background: var(--chalk); border-color: var(--chalk); }

/* vista 3: tarjetas, responsables y acciones */
.xl[data-at="2"] .xl-grid { gap: .45em; }
.xl[data-at="2"] .xl-row { --aw: 4.8em; }
.xl[data-at="2"] .xl-row:not(.xl-row--h) { background: #fff; border-radius: 5px; box-shadow: 0 0 0 1px var(--line-strong), 0 .3em 0 -.1em rgba(20, 18, 16, .08); }
.xl[data-at="2"] .xl-row:not(.xl-row--h) > span { border-bottom-color: transparent; }
.xl[data-at="2"] .xl-row:not(.xl-row--h) > span:nth-child(2) { font-family: var(--f-mono); font-size: .86em; color: var(--mute); }
.xl[data-at="2"] .xl-row:not(.xl-row--h) > span:nth-child(3) { font-weight: 700; }
.xl[data-at="2"] .xl-who::before { content: attr(data-i); display: inline-grid; place-items: center; flex: none; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 700; font-size: .8em; }
.xl[data-at="2"] .xl-act { display: flex !important; justify-content: center; }
.xl[data-at="2"] .xl-row:not(.xl-row--h) .xl-act { margin: .35em .4em .35em 0; padding: 0 .4em; border-radius: 3px; background: #25d366; color: var(--ink); font-weight: 700; font-size: .84em; animation: xl-in .5s var(--ease-out); }

@keyframes xl-in { from { opacity: 0; transform: translateY(.35em); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .xl { min-height: 21em; }
  .xl[data-at="2"] { --sw: 0em; }
  .xl-row { grid-template-columns: var(--nw, 1.8em) 4.4em minmax(0, 1fr) 0 4.6em 5.6em var(--aw, 0em); }
  .xl-c3 { padding-inline: 0 !important; border: 0 !important; }
  .xl-c3 { visibility: hidden; }
  .xl[data-at="2"] .xl-row { --aw: 4.2em; }
  .xl[data-at="2"] .xl-row > span:nth-child(5) { font-size: 0; }
  .xl[data-at="2"] .xl-row--h > span:nth-child(5) em { visibility: hidden; }
  .xl-fx { font-size: .7em; }
}
@media (prefers-reduced-motion: reduce) { .xl, .xl-row, .xl-main, .xl-grid { transition: none; } }

/* la cota del tablero se encima con la maqueta en móvil (kit): más aire arriba */
@media (max-width: 600px) { .stage__board { padding-top: 36px; } .stage__cota span:last-child { display: none; } }
