/* Acodex v9 · «Así se pasa», la escena de la migración (04/12/2026; paginas.py, escena_migracion; js/migracion.js).
   Una ventana que enseña un Excel de años (miles de filas, una pestaña por año, colores a mano), le marca los problemas, lo carga
   y se convierte en el programa nuevo («Huella», una clínica veterinaria inventada; lo dibuja js/migracion.js). En el ordenador: los pasos a la izquierda, uno por pantalla, y la ventana fija a la
   derecha, como «Pantalla a pantalla» de los proyectos. En el móvil: la ventana arriba y los pasos en un carrusel debajo. */

.mig { --mig-marca: #e0303c; --mig-puntos: #0f766e; --xl-verde: #217346; position: relative; margin-top: clamp(40px, 7svh, 72px); }

/* ================= LA VENTANA ================= */
.mig-escenario { position: relative; width: 100%; }
/* detrás, la misma trama de puntos que en los proyectos, del color del programa nuevo */
.mig-escenario::before { content: ""; position: absolute; z-index: 0; inset: -12% -8% -14% -10%; pointer-events: none;
  background: radial-gradient(var(--mig-puntos) 1.6px, transparent 2px) 0 0 / 16px 16px; opacity: .4;
  -webkit-mask: radial-gradient(closest-side, #000 40%, transparent); mask: radial-gradient(closest-side, #000 40%, transparent); }
.mig-ventana { position: relative; z-index: 1; width: 100%; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid rgba(20, 30, 70, .1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 30px 60px -36px rgba(10, 12, 20, .45); }
.mig-barra { position: relative; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-bottom: 1px solid rgba(0, 0, 0, .06);
  background: #f1f0ec; transition: background .6s ease; }
.mig-barra i { width: 11px; height: 11px; border-radius: 50%; background: #d9d6cf; }
.mig-nombre { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; max-width: calc(100% - 140px); }
.mig-nombre b { grid-area: 1 / 1; padding: 3px 16px; border-radius: 6px; background: #fff; font-size: 12px; font-weight: 500; color: var(--gris);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; transition: opacity .4s ease, transform .5s var(--curva); }
/* el nombre del archivo, con el icono verde de Excel delante; al pasar al programa, el suyo */
.mig-n-excel::before { content: "X"; display: inline-grid; place-items: center; width: 14px; height: 14px; margin-right: 7px; border-radius: 3px; vertical-align: -2px;
  background: var(--xl-verde); color: #fff; font: 700 9px/1 system-ui, sans-serif; }
.mig-n-crm { opacity: 0; transform: translateY(6px); }
.mig-ventana[data-fase="crm"] .mig-n-excel { opacity: 0; transform: translateY(-6px); }
.mig-ventana[data-fase="crm"] .mig-n-crm { opacity: 1; transform: none; }

.mig-pantalla { position: relative; aspect-ratio: 1440 / 900; overflow: hidden; background: #fff; container-type: inline-size; }

/* ---- las capas: el Excel, el informe, la carga y el programa (en el ordenador, el de escritorio; en el móvil, el de móvil) */
.xl, .mig-crm, .mig-crm-movil { position: absolute; inset: 0; width: 100%; height: 100%; }
.mig-crm, .mig-crm-movil { z-index: 1; opacity: 0; visibility: hidden; transform: scale(1.02); transition: opacity .6s ease, transform .8s var(--curva), visibility 0s .6s; }
.mig-crm-movil { display: none; }
.xl { transition: opacity .6s ease, filter .6s ease, transform .8s var(--curva); }
.mig-ventana[data-fase="crm"] .xl { opacity: 0; transform: scale(.98); }
.mig-ventana[data-fase="crm"] .mig-crm { opacity: 1; visibility: visible; transform: none; transition: opacity .6s ease .15s, transform .8s var(--curva) .15s, visibility 0s; }
.mig-ventana[data-fase="carga"] .xl { filter: blur(2px) saturate(.6); opacity: .55; }

/* ================= EL EXCEL =================
   Se dibuja a 1120px de ancho (lo de la derecha se corta, como en una pantalla de verdad) y se escala a la ventana (--k, js) */
.xl { --k: 1; overflow: hidden; background: #fff; color: #1f1f1f; font: 400 12px/1 "Segoe UI", Calibri, Carlito, Arial, sans-serif; }
.xl-lienzo { display: flex; flex-direction: column; width: 1120px; height: calc(100% / var(--k)); transform: scale(var(--k)); transform-origin: 0 0; }
/* la cinta de opciones */
.xl-pestanas { flex: none; display: flex; align-items: flex-end; gap: 2px; height: 30px; padding: 0 10px; background: #f3f2f1; border-bottom: 1px solid #e1dfdd; }
.xl-pestanas span { padding: 7px 10px 8px; font-size: 12px; color: #444; }
.xl-pestanas .on { color: var(--xl-verde); font-weight: 600; box-shadow: inset 0 -2px 0 var(--xl-verde); }
.xl-pestanas .xl-archivo { margin-right: 4px; background: var(--xl-verde); color: #fff; border-radius: 3px 3px 0 0; }
.xl-cinta { flex: none; display: flex; align-items: stretch; gap: 0; height: 66px; padding: 6px 8px; background: #fbfbfb; border-bottom: 1px solid #e1dfdd; }
.xl-grupo { display: flex; flex-direction: column; justify-content: space-between; padding: 0 12px; border-right: 1px solid #e1dfdd; }
.xl-grupo small { align-self: center; font-size: 10.5px; color: #7a7774; }
.xl-herr { display: flex; align-items: center; gap: 5px; }
.xl-herr span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 3px; font-size: 12px; color: #333; }
.xl-herr .caja { min-width: 92px; justify-content: start; border: 1px solid #c8c6c4; background: #fff; }
.xl-herr .caja.corta { min-width: 34px; }
.xl-herr b { font-weight: 700; } .xl-herr em { font-style: italic; } .xl-herr u { text-decoration: underline; }
.xl-herr .relleno { box-shadow: inset 0 -4px 0 #ffd84d; } .xl-herr .letra { box-shadow: inset 0 -4px 0 #e03a2f; }
.xl-herr .grande { height: 46px; min-width: 64px; flex-direction: column; gap: 3px; font-size: 10.5px; line-height: 1.1; text-align: center; }
.xl-herr .grande i { width: 20px; height: 16px; border-radius: 2px; background: linear-gradient(90deg, #f4b183 0 33%, #ffe699 0 66%, #a9d08e 0); }
/* la barra de fórmulas */
.xl-formula { flex: none; display: flex; align-items: center; height: 26px; border-bottom: 1px solid #e1dfdd; background: #fff; }
.xl-celda { width: 76px; height: 100%; display: grid; place-items: center start; padding-left: 8px; border-right: 1px solid #e1dfdd; font-size: 12px; }
.xl-fx { width: 34px; text-align: center; color: #7a7774; font-style: italic; border-right: 1px solid #e1dfdd; line-height: 26px; }
.xl-valor { flex: 1; padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* la cuadrícula: la cabecera de columnas, la fila 1 (los títulos, fija) y el resto, que se desplaza */
.xl-rejilla { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #fff; }
.xl-fila { display: grid; grid-template-columns: var(--xl-cols); height: 22px; }
.xl-fila > span { padding: 0 6px; border-right: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2; line-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.xl-fila > span:first-child { padding: 0 6px 0 0; text-align: right; background: #f3f2f1; color: #605e5c; border-right-color: #d2d0ce; font-size: 11px; }
.xl-letras { position: relative; z-index: 2; height: 20px; background: #f3f2f1; }
.xl-letras > span { text-align: center; color: #605e5c; font-size: 11px; line-height: 19px; border-bottom-color: #d2d0ce; }
.xl-titulos { position: relative; z-index: 2; box-shadow: 0 1.5px 0 #9a9a9a; }   /* la fila 1, inmovilizada: la línea de debajo */
.xl-titulos > span:not(:first-child) { background: #ffe699; font-weight: 700; font-size: 11.5px; }
.xl-cuerpo { position: absolute; left: 0; right: 0; top: 42px; bottom: 0; overflow: hidden; }
.xl-mover { will-change: transform; }
/* las filas: como las deja cada uno, a mano */
.xl-fila.amarilla > span:not(:first-child) { background: #fff2a8; }
.xl-fila.verde > span:not(:first-child) { background: #e2efda; }
.xl-fila.roja > span:not(:first-child) { color: #c00000; }
.xl-fila.baja > span:not(:first-child) { text-decoration: line-through; color: #8a8886; }
.xl-fila .nota { color: #8a5a00; }
/* la celda activa, con su recuadro verde */
.xl-activa { position: absolute; z-index: 3; pointer-events: none; border: 2px solid var(--xl-verde); transition: transform .5s var(--curva), width .5s var(--curva); }
.xl-activa::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 6px; height: 6px; background: var(--xl-verde); border: 1px solid #fff; }
/* las pestañas de abajo: una por año, la buena con un nombre que da miedo tocar */
.xl-hojas { flex: none; display: flex; align-items: stretch; gap: 0; height: 26px; padding-left: 64px; background: #f3f2f1; border-top: 1px solid #d2d0ce; overflow: hidden; }
.xl-hojas span { padding: 0 12px; border-right: 1px solid #d2d0ce; font-size: 11.5px; line-height: 25px; color: #444; white-space: nowrap; }
.xl-hojas .on { background: #fff; color: var(--xl-verde); font-weight: 600; box-shadow: inset 0 -2px 0 var(--xl-verde); }
.xl-estado { flex: none; display: flex; align-items: center; gap: 24px; height: 22px; padding: 0 12px; background: var(--xl-verde); color: rgba(255, 255, 255, .92); font-size: 11px; }
.xl-estado span:nth-child(2) { margin-left: auto; }

/* ---- los problemas, marcados (fase «problemas»): las celdas con algo raro, en rojo; las filas repetidas, en naranja */
.xl [data-p] { transition: background .4s ease, box-shadow .4s ease; }
.mig-ventana[data-fase="problemas"] .xl [data-p] { background: rgba(224, 48, 60, .14) !important; box-shadow: inset 0 0 0 1.5px var(--mig-marca); color: #8f1720; }
.mig-ventana[data-fase="problemas"] .xl .xl-fila.dup > span:not(:first-child) { background: #ffd9b8 !important; }
.mig-ventana[data-fase="problemas"] .xl .xl-fila.dup > span:first-child { background: #f39a4c; color: #fff; }

/* ---- el informe (fase «problemas») y la carga (fase «carga»): una tarjeta encima del Excel */
.mig-informe, .mig-carga { position: absolute; z-index: 4; right: 4%; bottom: 7%; width: min(46%, 360px); padding: clamp(14px, 2cqi, 22px); border-radius: 14px;
  background: rgba(17, 17, 20, .94); color: #fff; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55);
  opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .4s ease, transform .6s var(--curva), visibility 0s .4s; }
.mig-ventana[data-fase="problemas"] .mig-informe, .mig-ventana[data-fase="carga"] .mig-carga {
  opacity: 1; visibility: visible; transform: none; transition: opacity .4s ease .25s, transform .6s var(--curva) .25s, visibility 0s; }
.mig-carga { left: 50%; right: auto; top: 50%; bottom: auto; width: min(60%, 430px); translate: -50% -50%; }
.mig-informe-t, .mig-carga-t { font-size: clamp(10px, 1.3cqi, 12px); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #ff8a93; }
.mig-carga-t { color: #9fd3b4; }
.mig-informe ul, .mig-carga ul { display: grid; gap: clamp(6px, 1cqi, 10px); margin-top: clamp(8px, 1.4cqi, 14px); list-style: none; font-size: clamp(11px, 1.55cqi, 15px); }
.mig-informe li { display: flex; align-items: baseline; gap: 10px; color: rgba(255, 255, 255, .78); }
.mig-informe li b { min-width: 3.6em; font: 600 1.35em/1 var(--titulo); color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mig-carga li { display: grid; grid-template-columns: 9.5em 1fr 4.2em; align-items: center; gap: 10px; color: rgba(255, 255, 255, .8); }
.mig-carga li i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.mig-carga li i b { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2fa36b, #7fd6a4); }
.mig-carga li em { font-style: normal; font-weight: 600; text-align: right; color: #fff; font-variant-numeric: tabular-nums; }
.mig-carga-ok { display: flex; align-items: center; gap: 8px; margin-top: clamp(10px, 1.6cqi, 16px); font-size: clamp(11px, 1.4cqi, 13px); color: #9fd3b4;
  opacity: 0; transition: opacity .4s ease; }
.mig-carga-ok::before { content: "✓"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #2fa36b; color: #fff; font-size: 11px; }
.mig-carga.hecha .mig-carga-ok { opacity: 1; }

/* ---- el móvil, delante de la ventana, en el último paso (en el ordenador) */
.mig-tel { position: absolute; z-index: 3; right: -4%; bottom: -9%; width: 20%; aspect-ratio: 390 / 844; padding: 5px; border-radius: 24px; background: #111;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 30px 50px -24px rgba(10, 12, 20, .6);
  opacity: 0; visibility: hidden; transform: translateY(24px) rotate(2deg); transition: opacity .5s ease, transform .8s var(--curva), visibility 0s .5s; }
.mig-tel-pantalla { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 19px; background: #fff; }
.mig-tel-crm { position: absolute; inset: 0; width: 100%; height: 100%; }
.mig-escenario.con-movil .mig-tel { opacity: 1; visibility: visible; transform: none; transition: opacity .5s ease .2s, transform .8s var(--curva) .2s, visibility 0s; }

/* ================= LOS PASOS ================= */
.mig-num { font-size: 14px; font-weight: 600; color: var(--acento); font-variant-numeric: tabular-nums; }
.mig-paso h3 { margin-top: 10px; font: 600 clamp(28px, 3vw, 44px)/1.04 var(--titulo); letter-spacing: -0.045em; text-wrap: balance; }
.mig-paso h3 + p { margin-top: 14px; max-width: 38ch; font-size: clamp(16px, 1.2vw, 19px); line-height: 1.5; color: var(--gris); }

/* ---- en el ordenador: los pasos a la izquierda, uno por pantalla; la ventana fija a la derecha (como «Pantalla a pantalla») */
@media (min-width: 861px) {
  .mig { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 4vw, 72px); }
  .mig-pasos { grid-column: 1; grid-row: 1; }
  .mig-paso { display: flex; flex-direction: column; justify-content: center; min-height: 86svh; padding-block: 10svh; transition: opacity .5s ease; }
  .mig-paso :is(.mig-num, h3, h3 + p) { transition: color .5s ease; }
  .mig-paso:not(.activo) :is(.mig-num, h3, h3 + p) { color: #8a8883; }
  .mig-fijo { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100svh; display: flex; align-items: center; padding-right: 3%; }
  .mig-ventana { border-radius: 14px; }
}

/* ---- en el móvil: la ventana arriba, más alta que ancha, con el Excel recortado (se lee) o el programa en su versión de móvil; debajo,
   los pasos en un carrusel, como los demás de la web */
@media (max-width: 860px) {
  .mig-escenario::before { inset: -8% -12%; opacity: .35; }
  .mig-barra { height: 26px; padding: 0 10px; gap: 5px; }
  .mig-barra i { width: 8px; height: 8px; }
  .mig-nombre { max-width: calc(100% - 80px); }
  .mig-nombre b { padding: 2px 10px; font-size: 11px; }
  .mig-pantalla { aspect-ratio: auto; height: min(112vw, 50svh); }
  /* el Excel en el móvil: fuera el número, la especie y las vacunas (columnas A, C y G); la letra, algo más grande */
  .xl-lienzo { width: 470px; }
  .xl .xl-fila { --xl-cols: 34px 96px 168px 182px 86px 300px 54px; font-size: 12.5px; }
  .xl .xl-fila > span:is(:nth-child(2), :nth-child(4), :nth-child(8)) { display: none; }
  .xl-activa, .xl-cinta .xl-grupo:nth-child(n+4) { display: none; }
  .xl-hojas { padding-left: 8px; }
  .mig-crm { display: none; }
  .mig-crm-movil { display: block; }
  .mig-ventana[data-fase="crm"] .mig-crm-movil { opacity: 1; visibility: visible; transform: none; transition: opacity .6s ease .15s, transform .8s var(--curva) .15s, visibility 0s; }
  .mig-tel { display: none; }
  .mig-informe, .mig-carga { left: 4%; right: 4%; bottom: 4%; width: auto; }
  .mig-carga { top: auto; translate: none; }
  .mig-informe ul, .mig-carga ul { font-size: 13px; }
  .mig-informe-t, .mig-carga-t { font-size: 11px; }
  .mig-carga li { grid-template-columns: 8.4em 1fr 3.8em; }

  .mig-pasos { display: flex; gap: 14px; margin: 26px calc(-1 * var(--m)) 0; padding: 0 var(--m); overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--m); scrollbar-width: none; }
  .mig-pasos::-webkit-scrollbar { display: none; }
  .mig { display: flex; flex-direction: column; }
  .mig-fijo { order: -1; }
  .mig-paso { flex: 0 0 86%; padding: 20px 0 4px; scroll-snap-align: start; border-top: 1px solid rgba(24, 24, 26, .14); transition: opacity .3s ease, border-color .3s ease; }
  .mig-paso:not(.activo) { opacity: .4; }
  .mig-paso.activo { border-top-color: var(--acento); }
  .mig-paso h3 { font-size: clamp(26px, 7.4vw, 34px); }
  .mig-paso h3 + p { max-width: none; margin-top: 10px; font-size: 16px; }
  .mig .ln-nav { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 18px; }
}

/* ================= EL PROGRAMA NUEVO: «Huella» =================
   Se dibuja a un ancho fijo (1120px en el ordenador, 390px en el móvil: data-ancho) y se escala a su caja (--k, js).
   En el ordenador, con barra lateral y tablas; en el móvil (.crm-chica), con la marca arriba, tarjetas y las pestañas abajo */
.crm { --k: 1; --v: #0f766e; --v-suave: #e6f2f0; --tinta: #17211f; --gris-crm: #66716e; --linea: #e5e9e7;
  overflow: hidden; background: #f5f7f6; color: var(--tinta); font: 400 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.crm-lienzo { position: relative; display: grid; grid-template-columns: 208px minmax(0, 1fr); height: calc(100% / var(--k)); transform: scale(var(--k)); transform-origin: 0 0; }
.crm svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.crm-marca svg { width: 26px; height: 26px; fill: var(--v); stroke: none; }
.crm-marca { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.crm-marca b { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.crm-marca small { grid-column: 2; margin-top: -2px; font-size: 11.5px; color: var(--gris-crm); }
.crm-av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--v-suave); color: var(--v); font: 600 11.5px/1 system-ui, sans-serif; font-style: normal; flex: none; }
/* la barra lateral */
.crm-lado { display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; background: #fff; border-right: 1px solid var(--linea); }
.crm-lado nav { display: grid; gap: 3px; }
.crm-lado nav span { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #3f4a47; font-size: 14px; }
.crm-lado nav b { font-weight: 500; }
.crm-lado nav span.on { background: var(--v); color: #fff; }
.crm-yo { margin-top: auto; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px 8px 0; border-top: 1px solid var(--linea); }
.crm-yo .crm-av { grid-row: span 2; }
.crm-yo b { font-size: 13px; font-weight: 600; } .crm-yo small { font-size: 11.5px; color: var(--gris-crm); }
.crm-arriba, .crm-abajo { display: none; }
/* el contenido: una vista cada vez; al entrar, sus filas aparecen una tras otra */
.crm-main { position: relative; min-width: 0; overflow: hidden; }
.crm-vista { position: absolute; inset: 0; padding: 26px 30px; display: none; }
.crm-vista.activa { display: block; }
.crm-tit { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crm-tit h4 { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.crm-boton { padding: 8px 14px; border-radius: 9px; background: var(--v); color: #fff; font-size: 13px; font-weight: 600; }
.crm-fecha { font-size: 13px; color: var(--gris-crm); }
.crm-sub { margin: 22px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gris-crm); }
.crm-busca { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 11px 14px; border-radius: 11px; background: #fff; border: 1.5px solid var(--v);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12); font-size: 16px; color: var(--gris-crm); }
.crm-escribe { color: var(--tinta); font-weight: 500; }
.crm-cursor { width: 1.5px; height: 18px; margin-left: -8px; background: var(--tinta); animation: crm-parpadeo 1s steps(1) infinite; }
@keyframes crm-parpadeo { 50% { opacity: 0; } }
.crm-cuenta { margin-top: 12px; font-size: 13px; color: var(--gris-crm); opacity: 0; transition: opacity .3s ease; }
.crm-cuenta b { color: var(--tinta); }
.crm-tabla { margin-top: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--linea); overflow: hidden; }
.crm-fila { display: grid; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--linea); }
.crm-fila:last-child { border-bottom: 0; }
.crm-cab { padding-block: 9px; background: #fafbfa; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gris-crm); }
.crm-pacientes .crm-fila { grid-template-columns: 60px 1.3fr 1.5fr 104px 128px; }
.crm-equipo .crm-fila { grid-template-columns: 1.3fr 120px 1.6fr 100px; }
.crm-fila small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--gris-crm); }
.crm-id { font-size: 12.5px; color: var(--gris-crm); font-variant-numeric: tabular-nums; }
.crm-masc b, .crm-quien b { font-weight: 600; }
.crm-visita, .crm-cuando, .crm-ve { font-size: 13px; color: #3f4a47; }
.crm-quien { display: flex; align-items: center; gap: 10px; }
.crm-et, .crm-rol { display: inline-block; padding: 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; font-style: normal; white-space: nowrap; }
.crm-et.ok { background: #dcf3e6; color: #13653a; } .crm-et.vence { background: #fdf0d5; color: #8a5300; } .crm-et.falta { background: #fde2e2; color: #a61b1b; }
.crm-rol { background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.crm-cambios, .crm-agenda, .crm-avisos { display: grid; gap: 8px; list-style: none; }
.crm-cambios li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 11px; background: #fff; border: 1px solid var(--linea); font-size: 13.5px; }
.crm-cambios b { font-weight: 600; }
.crm-cambios small { display: inline; margin-left: 8px; font-size: 12px; color: var(--gris-crm); }
.crm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.crm-kpis p { padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--linea); font-size: 12.5px; color: var(--gris-crm); }
.crm-kpis b { display: block; margin-bottom: 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--tinta); font-variant-numeric: tabular-nums; }
.crm-kpis p:first-child { background: var(--v); border-color: var(--v); color: rgba(255, 255, 255, .8); }
.crm-kpis p:first-child b { color: #fff; }
.crm-dos { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; }
.crm-agenda li { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 11px; background: #fff; border: 1px solid var(--linea); }
.crm-agenda time { font-weight: 600; font-variant-numeric: tabular-nums; }
.crm-agenda b { font-weight: 600; }
.crm-agenda small { display: block; font-size: 12.5px; color: var(--gris-crm); }
.crm-agenda em { padding: 3px 9px; border-radius: 99px; background: #f1edfd; color: #6d28d9; font-size: 12px; font-style: normal; font-weight: 600; }
.crm-avisos li { padding: 12px 14px 12px 16px; border-radius: 11px; background: #fff; border: 1px solid var(--linea); border-left: 3px solid var(--c, var(--v)); font-size: 13.5px; }
.crm-avisos li.vence { --c: #d97706; } .crm-avisos li.falta { --c: #dc2626; }
.crm-avisos span { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--v); }
/* la entrada: lo que está en la vista aparece en cascada; en «Pacientes», las filas esperan a que se termine de escribir */
@keyframes crm-entra { from { opacity: 0; transform: translateY(8px); } }
.crm-vista.activa :is(.crm-tit, .crm-busca) { animation: crm-entra .45s var(--curva) both; }
.crm-vista.activa :is(.crm-fila:not(.crm-cab), .crm-cambios li, .crm-kpis p, .crm-agenda li, .crm-avisos li) { opacity: 0; }
.crm-vista.activa.lista :is(.crm-fila:not(.crm-cab), .crm-cambios li, .crm-kpis p, .crm-agenda li, .crm-avisos li) { opacity: 1; animation: crm-entra .5s var(--curva) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
.crm-vista.lista .crm-cuenta { opacity: 1; }

/* ---- el programa en el móvil */
.crm-chica .crm-lienzo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.crm-chica .crm-lado { display: none; }
.crm-chica .crm-arriba { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--linea); }
.crm-chica .crm-abajo { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px 14px; background: #fff; border-top: 1px solid var(--linea); }
.crm-chica .crm-abajo span { display: grid; justify-items: center; gap: 4px; padding: 4px 0; color: #7b8683; font-size: 11px; }
.crm-chica .crm-abajo span svg { width: 22px; height: 22px; }
.crm-chica .crm-abajo b { font-weight: 500; }
.crm-chica .crm-abajo span.on { color: var(--v); }
.crm-chica .crm-abajo span.on b { font-weight: 700; }
.crm-chica .crm-vista { padding: 18px 16px; }
.crm-chica .crm-tit h4 { font-size: 21px; }
.crm-chica .crm-boton { padding: 7px 11px; font-size: 12px; }
.crm-chica .crm-cab { display: none; }
.crm-chica .crm-tabla { background: none; border: 0; display: grid; gap: 8px; }
.crm-chica .crm-fila { border: 1px solid var(--linea); border-radius: 12px; background: #fff; }
.crm-chica .crm-pacientes .crm-fila { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 11px 13px; }
.crm-chica .crm-pacientes :is(.crm-id, .crm-visita) { display: none; }
.crm-chica .crm-duenyo { grid-column: 1; font-size: 13px; }
.crm-chica .crm-pacientes .crm-fila > span:last-child { grid-column: 2; grid-row: 1; }
.crm-chica .crm-equipo .crm-fila { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 13px; }
.crm-chica .crm-ve { grid-column: 1 / -1; padding-left: 40px; font-size: 12.5px; color: var(--gris-crm); }
.crm-chica .crm-cuando { display: none; }
.crm-chica .crm-cambios small { display: block; margin: 2px 0 0; }
.crm-chica .crm-fecha { display: none; }
.crm-chica .crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.crm-chica .crm-kpis b { font-size: 22px; }
.crm-chica .crm-dos { grid-template-columns: minmax(0, 1fr); gap: 0; }
.crm-chica .crm-dos > div:last-child { display: none; }

@media (prefers-reduced-motion: reduce) {
  .xl, .mig-crm, .mig-crm-movil, .mig-informe, .mig-carga, .mig-tel, .mig-paso, .mig-nombre b { transition: none !important; }
  .crm * { animation: none !important; }
}
