/*
 * Cuadra · SpomBridge. La hoja de trabajo del estudio: tinta sobre papel, cobre para lo que importa ahora.
 * El sistema está escrito en DESIGN.md (tokens, tipografía, componentes y estados): un cambio acá va allá.
 *
 * Reglas de la casa:
 *   - Los colores salen de los tokens de :root. Texto ≥ 4,5:1, bordes y foco ≥ 3:1.
 *   - El estado nunca va solo en el color: color + forma (la marca de la insignia) + texto.
 *   - Las cifras van tabulares y a la derecha.
 *   - Todo movimiento nace dentro de prefers-reduced-motion: no-preference y dura 120-240 ms.
 */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/estaticos/atkinson-next-1.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Tinta: texto, barra lateral, botón principal */
  --tinta: #1a1a2e;
  --tinta-2: #3b3b52;
  --tinta-3: #5a5a70;
  --tinta-clara: #dcdce6;     /* texto sobre tinta */
  --tinta-tenue: #a9a9bd;     /* texto secundario sobre tinta (6,9:1) */
  /* Cobre: la marca y lo que importa ahora (foco, ubicación, avance) */
  --cobre: #c99383;
  --cobre-medio: #b07a6c;
  --cobre-fuerte: #8e5a4c;    /* texto y hover sobre papel (5,1:1) */
  --cobre-suave: #f6ece8;
  --cobre-borde: #dfbdb1;
  /* Papel */
  --fondo: #f5f4f1;
  --papel: #ffffff;
  --papel-2: #faf9f6;
  --linea: #e4e1da;
  --linea-2: #cdc8bd;
  --borde-campo: #857f73;     /* 3,9:1 sobre papel: el borde de un campo se ve */
  /* Estados */
  --verde: #059669;
  --verde-texto: #047857;
  --verde-suave: #e8f6f0;
  --verde-borde: #b9e2d2;
  --ambar: #d97706;
  --ambar-texto: #92400e;
  --ambar-suave: #fdf4e3;
  --ambar-borde: #f3d6a4;
  --rojo: #dc2626;
  --rojo-texto: #b91c1c;
  --rojo-suave: #fdeded;
  --rojo-borde: #f4c2c2;
  --gris: #77778a;
  --gris-suave: #efeee9;
  /* Forma */
  --radio: 8px;
  --radio-chico: 5px;
  --sombra: 0 1px 2px rgba(26, 26, 46, .05), 0 2px 8px -4px rgba(26, 26, 46, .08);
  --sombra-alta: 0 1px 2px rgba(26, 26, 46, .06), 0 14px 32px -16px rgba(26, 26, 46, .35);
  --fuente: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ancho-lateral: 15.5rem;
  --rapido: 140ms;
  --suave: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  font: 400 1rem/1.55 var(--fuente);
  font-size-adjust: from-font;
  color: var(--tinta);
  background: var(--fondo);
  min-height: 100vh;
  font-variant-numeric: lining-nums;
}

a { color: var(--tinta); text-decoration-color: var(--cobre); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--cobre-fuerte); text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; border-radius: 2px; }
::selection { background: #ecd3ca; color: var(--tinta); }
input, textarea { caret-color: var(--cobre-fuerte); }

h1, h2, h3 { text-wrap: balance; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 700; margin: 0 0 .4rem; letter-spacing: -.012em; }
h2 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; margin: 0 0 .75rem; letter-spacing: -.005em; }
h3 { font-size: 1rem; line-height: 1.35; font-weight: 700; margin: 1.1rem 0 .4rem; color: var(--tinta-2); }
p { margin: 0 0 .75rem; text-wrap: pretty; }
strong, b { font-weight: 700; }
abbr[title] { text-decoration: none; }

.oculto {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 30;
  background: var(--papel); color: var(--tinta); padding: .6rem 1rem; border: 2px solid var(--tinta); border-radius: var(--radio-chico);
  font-weight: 700;
}
.saltar:focus { top: .75rem; }

.icono { flex: none; width: 1.25rem; height: 1.25rem; }

/* ---------- Marca ---------- */

.marca { display: inline-flex; align-items: baseline; gap: .55rem; color: #fff; text-decoration: none; }
.marca:hover { color: #fff; }
.marca-sello {
  width: 1rem; height: 1rem; align-self: center; border: 2px solid var(--cobre); border-radius: 2px; flex: none;
  background: linear-gradient(135deg, var(--cobre) 0 50%, transparent 50% 100%);
}
.marca-nombre { font-weight: 800; font-size: 1.2rem; letter-spacing: .005em; }
.marca-de { font-size: .72rem; color: var(--tinta-tenue); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Marco con barra lateral (con sesión) ---------- */

.marco { min-height: 100vh; }
@media (min-width: 64rem) {
  /* La columna de la barra es tinta hasta abajo, aunque la página sea más larga que la ventana. */
  .marco { background: linear-gradient(to right, var(--tinta) var(--ancho-lateral), transparent 0); }
}
.lateral { background: var(--tinta); color: var(--tinta-clara); }
.lateral :focus-visible { outline-color: var(--cobre); }

.lateral-cabeza { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; }
.lateral-cabeza .marca { margin-right: auto; }

.boton-menu, .boton-cerrar-menu {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding: .4rem .85rem;
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--radio);
  font: inherit; font-weight: 700; cursor: pointer;
}
.boton-menu:hover, .boton-cerrar-menu:hover { background: rgba(255, 255, 255, .08); }

.menu { color: var(--tinta-clara); }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu-grupo a {
  display: flex; align-items: center; gap: .6rem; min-height: 2.6rem; padding: .45rem .75rem;
  color: var(--tinta-clara); text-decoration: none; border-radius: var(--radio-chico); font-weight: 500;
}
.menu-grupo a::before {
  content: ""; width: .7rem; height: .7rem; flex: none; border: 1.5px solid transparent; border-radius: 2px;
}
.menu-grupo a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.menu-grupo a[aria-current="page"] { color: #fff; font-weight: 700; background: rgba(255, 255, 255, .09); }
/* La ubicación lleva el sello de la marca: cuadrado cobre con la diagonal llena. */
.menu-grupo a[aria-current="page"]::before {
  border-color: var(--cobre);
  background: linear-gradient(135deg, var(--cobre) 0 50%, transparent 50% 100%);
}
.menu-grupo { padding: .35rem .75rem; }
.menu-grupo + .menu-grupo { border-top: 1px solid rgba(255, 255, 255, .08); }
.menu-grupo-titulo {
  margin: .5rem .75rem .25rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--tinta-tenue);
}
.menu-estudio { padding: .9rem 1.5rem .9rem; border-bottom: 1px solid rgba(255, 255, 255, .08); display: grid; gap: .1rem; }
.menu-estudio .cuenta-estudio { color: #fff; font-weight: 700; line-height: 1.3; }
.menu-estudio .cuenta-email {
  color: var(--tinta-tenue); font-size: .875rem; text-decoration-color: rgba(255, 255, 255, .3); overflow-wrap: anywhere;
}
.menu-estudio .cuenta-email:hover, .menu-estudio .cuenta-email[aria-current="page"] { color: #fff; text-decoration-color: var(--cobre); }
.menu-pie { padding: .75rem 1rem 1.25rem; display: grid; gap: .6rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.boton-salir {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; padding: .3rem .5rem;
  color: var(--tinta-clara); text-decoration: none; font-weight: 500;
}
.boton-salir:hover { color: #fff; }
.boton-cerrar-menu { margin: .5rem 1rem 1rem; }

.hoja { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

/* Celular y ventanas angostas (también 1280 px al 200 %): barra arriba y el menú en una hoja lateral. */
@media (max-width: 63.99rem) {
  .lateral { position: sticky; top: 0; z-index: 20; }
  .hoja { min-height: calc(100vh - 4rem); }
  .menu[popover] {
    margin: 0; inset: 0 0 0 auto; width: min(22rem, 90vw); height: 100dvh; max-height: none;
    padding: 0; border: 0; background: var(--tinta); color: var(--tinta-clara);
    overflow-y: auto; overscroll-behavior: contain; box-shadow: -18px 0 40px -20px rgba(0, 0, 0, .55);
  }
  .menu[popover]::backdrop { background: rgba(26, 26, 46, .45); }
  /* Sin popover (navegadores viejos) el menú queda visible abajo de la barra. */
  .menu:not([popover]) { display: block; }
  .boton-cerrar-menu { display: inline-flex; }
}
@media (max-width: 63.99rem) and (prefers-reduced-motion: no-preference) {
  .menu[popover] {
    transition: translate 220ms var(--suave), opacity 220ms var(--suave), overlay 220ms allow-discrete, display 220ms allow-discrete;
    translate: 100% 0;
  }
  .menu[popover]:popover-open { translate: 0 0; }
  @starting-style { .menu[popover]:popover-open { translate: 100% 0; } }
  .menu[popover]::backdrop { transition: opacity 220ms, overlay 220ms allow-discrete, display 220ms allow-discrete; opacity: 0; }
  .menu[popover]:popover-open::backdrop { opacity: 1; }
  @starting-style { .menu[popover]:popover-open::backdrop { opacity: 0; } }
}

/* Escritorio: la barra lateral fija, siempre a la vista. */
@media (min-width: 64rem) {
  .marco { display: grid; grid-template-columns: var(--ancho-lateral) minmax(0, 1fr); }
  .lateral {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
    scrollbar-color: rgba(255, 255, 255, .25) transparent; scrollbar-width: thin;
  }
  .lateral-cabeza { padding: 1.1rem 1.5rem .6rem; }
  .boton-menu, .boton-cerrar-menu, .whatsapp-compacto { display: none !important; }
  /* El mismo <nav popover> se muestra en línea: en escritorio no es una hoja que se abre. */
  .menu, .menu[popover] {
    display: flex; flex-direction: column; flex: 1; position: static; inset: auto; margin: 0; padding: 0;
    width: auto; height: auto; max-height: none; border: 0; background: transparent; color: inherit; overflow: visible;
  }
  .menu-pie { margin-top: auto; }
  .menu-grupo-ayuda { border-top: 0 !important; }
}

/* ---------- Barra simple (sin sesión) ---------- */

.barra { background: var(--tinta); color: #fff; }
.barra :focus-visible { outline-color: var(--cobre); }
.barra-interior {
  max-width: 76rem; margin: 0 auto; padding: .75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap;
}
.cuenta { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; font-size: .9rem; margin-left: auto; }
.cuenta-estudio { font-weight: 700; }
.cuenta-email { color: var(--tinta-tenue); }
.barra .boton-enlace { color: #fff; text-decoration-color: var(--cobre); }
.barra .boton-enlace:hover { color: var(--cobre); }

/* ---------- WhatsApp ---------- */

.whatsapp { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.whatsapp .icono { width: 1.35rem; height: 1.35rem; }
/* En la barra lateral: una tarjeta tranquila, siempre al pie. */
.whatsapp-barra {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .7rem .8rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radio);
  color: var(--tinta-clara); line-height: 1.3;
}
.whatsapp-barra:hover { color: #fff; background: rgba(255, 255, 255, .06); border-color: rgba(201, 147, 131, .6); }
.whatsapp-barra .icono { color: var(--cobre); margin-top: .1rem; }
.whatsapp-barra .whatsapp-texto { display: grid; }
.whatsapp-pregunta { font-size: .82rem; color: var(--tinta-tenue); }
.whatsapp-accion { font-weight: 700; }
.whatsapp-barra .whatsapp-horario { font-size: .78rem; color: var(--tinta-tenue); margin-top: .15rem; }
/* En la barra de arriba del celular: chico, al lado de «Menú», sin tapar nada. */
.whatsapp-compacto {
  min-height: 2.75rem; padding: .35rem .7rem; color: #fff; border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--radio);
}
.whatsapp-compacto:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.whatsapp-compacto .icono { color: var(--cobre); }
.whatsapp-compacto span { font-weight: 700; font-size: .9rem; }
/* En entrar y registro: discreto, arriba a la derecha. */
.whatsapp-acceso { color: var(--tinta-clara); font-size: .9rem; min-height: 2.75rem; }
.whatsapp-acceso:hover { color: #fff; }
.whatsapp-acceso .icono { color: var(--cobre); }
.whatsapp-acceso .whatsapp-pregunta { color: var(--tinta-tenue); }
.whatsapp-acceso .whatsapp-accion { font-weight: 700; text-decoration: underline; text-decoration-color: var(--cobre); text-underline-offset: 3px; }
.whatsapp-acceso .whatsapp-horario { display: none; }
/* En Ayuda y en las pantallas de error o bloqueo: el acceso destacado. */
.soporte-destacado {
  border: 1px solid var(--cobre-borde); background: var(--cobre-suave); border-radius: var(--radio);
  padding: 1rem 1.15rem; margin: 1.25rem 0;
}
.soporte-destacado > :last-child { margin-bottom: 0; }
.soporte-titulo { font-weight: 700; font-size: 1.05rem; margin-bottom: .3rem; }
.boton-whatsapp { margin-right: .5rem; }

@media (max-width: 26rem) {
  .whatsapp-acceso .whatsapp-pregunta { display: none; }
}
/* 320 px: en la barra de arriba solo el ícono (la palabra queda para el lector, igual que el resto del nombre). */
@media (max-width: 23.99rem) {
  .lateral-cabeza { gap: .5rem; padding-inline: .75rem; }
  .whatsapp-compacto { padding-inline: .6rem; }
  .whatsapp-compacto > span:first-of-type {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .boton-menu { padding-inline: .7rem; }
}

/* ---------- Página ---------- */

main { flex: 1; width: 100%; max-width: 76rem; margin: 0 auto; padding: 1.75rem 2rem 3rem; }
.sin-menu main { max-width: 76rem; }
main:focus { outline: none; }

.pie { color: var(--tinta-3); font-size: .82rem; text-align: center; padding: 1.25rem 1rem 1.5rem; }
.pie p { margin: 0; }
.pie p + p { margin-top: .3rem; }
.pie a { color: var(--tinta-3); }
.pie a:hover { color: var(--cobre-fuerte); }

.bajada { color: var(--tinta-2); margin-bottom: 1.4rem; max-width: 72ch; }
.miga { font-size: .9rem; margin-bottom: .5rem; }
.miga a { display: inline-flex; align-items: center; min-height: 1.75rem; }
.miga a::before { content: "← "; white-space: pre; }
.nota { color: var(--tinta-3); font-size: .9rem; max-width: 72ch; }
.vacio { color: var(--tinta-3); padding: 1rem 0; }
.filtro { font-size: .9rem; }

.panel {
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; box-shadow: var(--sombra);
}
.panel > :last-child { margin-bottom: 0; }
.panel-destacado, .panel-principal { border-color: var(--cobre-borde); box-shadow: var(--sombra-alta); }
.panel-principal h2 { font-size: 1.25rem; }
.panel-nota { background: var(--cobre-suave); border-color: #ecd9d2; box-shadow: none; }
.panel-peligro { border-color: var(--rojo-borde); max-width: 46rem; box-shadow: var(--sombra-alta); }
.panel-error { max-width: 42rem; }
.panel-angosto { max-width: 42rem; }

.grilla-dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 0 1.25rem; align-items: start; }
.grilla-dos > section, .grilla-dos > aside, .grilla-dos > div { min-width: 0; }
@media (min-width: 60rem) {
  .grilla-principal { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

/* ---------- Avisos ---------- */

/*
 * El tipo de aviso se lee en el fondo, el borde (1px, del mismo tono) y la marca de la izquierda, la misma
 * forma que las insignias de estado (✓ verde, triángulo ámbar, cruz roja, punto cobre). Nada de franjas.
 */
.aviso {
  --marca: var(--tinta-3);
  --forma: circle(50%);
  position: relative;
  border: 1px solid var(--linea); border-radius: var(--radio);
  padding: .75rem 1rem .75rem 2.4rem; margin: 0 0 1rem; background: var(--papel); max-width: 80ch;
}
.aviso::before {
  content: ""; position: absolute; left: 1rem; top: calc(.75rem + .775em - .4rem);
  width: .8rem; height: .8rem; background: var(--marca); clip-path: var(--forma);
}
.aviso > :last-child { margin-bottom: 0; }
.aviso-ok { --marca: var(--verde); --forma: polygon(8% 54%, 24% 38%, 42% 56%, 78% 16%, 94% 31%, 42% 86%); border-color: var(--verde-borde); background: var(--verde-suave); }
.aviso-info { --marca: var(--cobre-medio); border-color: #ecd9d2; background: var(--cobre-suave); }
.aviso-revisar { --marca: var(--ambar); --forma: polygon(50% 4%, 100% 94%, 0 94%); border-color: var(--ambar-borde); background: var(--ambar-suave); }
.aviso-error { --marca: var(--rojo); --forma: polygon(20% 6%, 50% 36%, 80% 6%, 94% 20%, 64% 50%, 94% 80%, 80% 94%, 50% 64%, 20% 94%, 6% 80%, 36% 50%, 6% 20%); border-color: var(--rojo-borde); background: var(--rojo-suave); }
.alertas { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.alertas .aviso { margin-bottom: .5rem; }
.texto-revisar { color: var(--ambar-texto); font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
  .aviso-nuevo { animation: aparecer 240ms var(--suave) both; }
}
@keyframes aparecer { from { opacity: 0; translate: 0 -6px; } }

/* ---------- Estados (insignias) ---------- */

/*
 * Cada clase tiene su forma, además del color y el texto: ✓ (bien, a favor), punto lleno (a pagar: es el
 * dato, no un error), triángulo (revisar), cruz (error), raya (no se liquida), círculo hueco (espera) y
 * medio círculo (en curso).
 */
.estado {
  --marca: var(--gris);
  --forma: circle(50%);
  display: inline-flex; align-items: center; gap: .4em; white-space: nowrap;
  font-size: .82rem; font-weight: 700; line-height: 1.5;
  padding: .1rem .6rem .1rem .5rem; border-radius: 999px;
  border: 1px solid var(--linea-2); background: var(--gris-suave); color: var(--tinta-2);
}
.estado::before { content: ""; width: .62rem; height: .62rem; background: var(--marca); clip-path: var(--forma); flex: none; }
.estado-ok, .estado-favor {
  --marca: var(--verde); --forma: polygon(6% 54%, 22% 38%, 40% 56%, 78% 14%, 94% 30%, 40% 88%);
  color: var(--verde-texto); background: var(--verde-suave); border-color: var(--verde-borde);
}
.estado-revisar { --marca: var(--ambar); --forma: polygon(50% 2%, 100% 96%, 0 96%); color: var(--ambar-texto); background: var(--ambar-suave); border-color: var(--ambar-borde); }
.estado-error {
  --marca: var(--rojo); --forma: polygon(20% 4%, 50% 34%, 80% 4%, 96% 20%, 66% 50%, 96% 80%, 80% 96%, 50% 66%, 20% 96%, 4% 80%, 34% 50%, 4% 20%);
  color: var(--rojo-texto); background: var(--rojo-suave); border-color: var(--rojo-borde);
}
.estado-pagar { --marca: var(--tinta); color: var(--tinta); background: var(--papel); border-color: var(--tinta-3); }
.estado-curso {
  --marca: conic-gradient(var(--cobre-fuerte) 0 50%, transparent 0); color: var(--tinta); background: var(--cobre-suave); border-color: var(--cobre-borde);
}
.estado-curso::before { background: var(--marca); box-shadow: inset 0 0 0 1.5px var(--cobre-fuerte); border-radius: 50%; clip-path: none; }
.estado-espera::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gris); border-radius: 50%; clip-path: none; }
.estado-info { --forma: inset(38% 0 38% 0 round 2px); }
.motivo { display: block; color: var(--rojo-texto); font-size: .82rem; margin-top: .2rem; }

/* ---------- Tablas ---------- */

.tabla-desplazable {
  position: relative; /* que los textos .oculto de adentro no estiren la página */
  overflow-x: auto; margin-bottom: 1.25rem; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--papel);
  box-shadow: var(--sombra);
}
.tabla-desplazable:focus-visible { outline-offset: 0; }

.tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; font-variant-numeric: tabular-nums; }
.tabla caption { text-align: left; font-weight: 700; padding: .75rem .85rem .35rem; }
.tabla th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 700; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--tinta-3); background: var(--papel-2); padding: .6rem .85rem; border-bottom: 1px solid var(--linea-2);
  white-space: nowrap; vertical-align: bottom;
}
.tabla td { padding: .6rem .85rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover td { background: #fbfaf7; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla .acciones { text-align: right; white-space: nowrap; }
.tabla .acciones a { display: inline-flex; align-items: center; min-height: 2rem; }
.fila-apagada td { color: var(--tinta-3); }

.tabla-resultados { min-width: 56rem; }
.tabla-resultados th, .tabla-resultados td { padding-inline: .65rem; }
.tabla-resultados td:first-child { min-width: 12rem; }
.tabla-resultados .saldo-rotulo { display: block; margin: 0; }
.nombre-cliente { display: block; font-weight: 700; }
.origen { display: block; color: var(--tinta-3); font-size: .82rem; margin-top: .15rem; }
.origen-automatica { color: var(--tinta-2); }
.observaciones { display: block; color: var(--tinta-2); font-size: .85rem; line-height: 1.45; margin-top: .3rem; }
.tabla-resultados .celda-estado { min-width: 15rem; max-width: 24rem; }

/*
 * Resultados de una corrida: con su propio scroll en pantallas medianas para que el encabezado quede fijo
 * mientras se baja por 100 clientes. En el celular no (un scroll adentro de otro), son tarjetas.
 */
@media (min-width: 48rem) {
  .tabla-desplazable:has(.tabla-resultados) { max-block-size: min(75vh, 48rem); overflow: auto; overscroll-behavior: contain; }
}
.tabla th:has(.orden) { padding: 0; }
.orden {
  display: inline-flex; align-items: center; gap: .35rem; inline-size: 100%; min-block-size: 2.75rem; padding: .6rem .85rem;
  border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: inherit; cursor: pointer;
}
.tabla-resultados .orden { padding-inline: .65rem; }
.num .orden { justify-content: flex-end; }
.orden:hover { color: var(--tinta); background: var(--linea); }
.orden-icono { flex: none; opacity: .45; }
th[aria-sort] .orden { color: var(--tinta); }
th[aria-sort] .orden-icono { opacity: 1; }
th[aria-sort="ascending"] .orden-abajo, th[aria-sort="descending"] .orden-arriba { visibility: hidden; }
.tabla-resultados tbody tr:target td { background: var(--cobre-suave); }
.tabla-resultados tbody tr { scroll-margin-block-start: 3.5rem; }

.cuit { font-variant-numeric: tabular-nums; color: var(--tinta-3); font-size: .88rem; white-space: nowrap; }
h1 .cuit { font-size: inherit; color: inherit; }
.sin-dato { color: var(--tinta-3); }
.saldo-pagar { font-weight: 700; }
.saldo-favor { font-weight: 700; color: var(--verde-texto); }
.saldo-cero { color: var(--verde-texto); }
.saldo-rotulo { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; margin-right: .25rem; }

/* Buscar y filtrar una tabla larga (estaticos/tabla.js). */
.tabla-herramientas { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; margin: 0 0 .9rem; }
.tabla-herramientas[hidden] { display: none; }
.tabla-buscar { flex: 1 1 16rem; max-width: 26rem; }
.tabla-buscar label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .3rem; }
.tabla-filtros { display: flex; flex-wrap: wrap; gap: .35rem; }
.filtro-boton {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding: .35rem .8rem;
  border: 1px solid var(--borde-campo); border-radius: 999px; background: var(--papel); color: var(--tinta-2);
  font-weight: 500; font-size: .92rem; cursor: pointer; transition: background-color var(--rapido), border-color var(--rapido);
}
.filtro-boton:hover { border-color: var(--tinta); color: var(--tinta); }
.filtro-boton[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; font-weight: 700; }
.filtro-cuenta { font-variant-numeric: tabular-nums; font-size: .82rem; padding: 0 .4rem; border-radius: 999px; background: var(--gris-suave); color: var(--tinta-2); }
.filtro-boton[aria-pressed="true"] .filtro-cuenta { background: rgba(255, 255, 255, .18); color: #fff; }
.tabla tr[hidden] { display: none !important; }

/*
 * En angosto, cada fila es una tarjeta: el título (la primera celda) arriba y cada dato con su rótulo
 * (data-rotulo). Depende del ancho de la tabla, no de la pantalla.
 */
.tabla-desplazable:has(.tabla-tarjetas) { container-type: inline-size; }
@container (width < 40rem) {
  .tabla-tarjetas, .tabla-tarjetas tbody, .tabla-tarjetas tr, .tabla-tarjetas td { display: block; }
  .tabla-tarjetas { min-width: 0 !important; }
  .tabla-tarjetas thead { display: none; }
  .tabla-tarjetas tr { padding: .75rem .9rem; border-bottom: 1px solid var(--linea); }
  .tabla-tarjetas tbody tr:last-child { border-bottom: 0; }
  .tabla-tarjetas td { border: 0; padding: .15rem 0; display: flex; gap: .75rem; justify-content: space-between; align-items: baseline; text-align: right; }
  .tabla-tarjetas td.celda-titulo { display: block; text-align: left; padding-bottom: .35rem; font-size: 1rem; }
  .tabla-tarjetas td[data-rotulo]::before {
    content: attr(data-rotulo); flex: none; text-align: left;
    font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tinta-3);
  }
  .tabla-tarjetas td.num { white-space: normal; }
  .tabla-tarjetas tbody tr:hover td { background: none; }
  .tabla-tarjetas td.celda-resultado { font-size: 1rem; padding-block: .3rem; }
  /* Resultados: el estado y lo que paga arriba; los cuatro montos de detalle en una grilla de 2 x 2. */
  .tabla-resultados.tabla-tarjetas tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
  .tabla-resultados.tabla-tarjetas td:not(.celda-detalle) { grid-column: 1 / -1; }
  .tabla-resultados.tabla-tarjetas td.celda-detalle { display: block; text-align: left; font-size: .88rem; color: var(--tinta-2); }
  .tabla-resultados.tabla-tarjetas td.celda-detalle::before { display: block; font-size: .7rem; }
  .tabla-resultados.tabla-tarjetas tr.sin-montos td.celda-detalle { display: none; }
  .tabla-resultados.tabla-tarjetas td.celda-estado { flex-wrap: wrap; max-width: none; }
  .tabla-resultados.tabla-tarjetas .observaciones { flex-basis: 100%; text-align: left; }
}

.desplegable-alta { margin-bottom: 1.25rem; }
.desplegable-alta > summary { font-weight: 700; padding-block: .6rem; }

code { font-family: var(--mono); font-size: .85rem; background: var(--gris-suave); padding: .05rem .3rem; border-radius: 3px; word-break: break-all; }

/* ---------- Formularios ---------- */

.campo { margin: 0 0 1.1rem; border: 0; padding: 0; min-width: 0; }
.campo label, .campo legend, .etiqueta { display: block; font-weight: 700; font-size: .92rem; margin-bottom: .35rem; padding: 0; }
.ayuda { color: var(--tinta-3); font-size: .85rem; margin: .35rem 0 0; max-width: 64ch; }
.error-campo { color: var(--rojo-texto); font-size: .88rem; font-weight: 700; margin: .35rem 0 0; }

input, select, textarea, button { font: inherit; color: inherit; }

input:not([type="radio"], [type="checkbox"], [type="hidden"]), select, textarea {
  width: 100%; min-height: 2.75rem; padding: .55rem .75rem;
  border: 1px solid var(--borde-campo); border-radius: var(--radio-chico); background: var(--papel);
  transition: border-color var(--rapido), box-shadow var(--rapido);
}
textarea { min-height: 9rem; resize: vertical; font-family: var(--mono); font-size: .88rem; line-height: 1.5; }
::placeholder { color: var(--tinta-3); opacity: 1; }
input:not([type="radio"], [type="checkbox"], [type="hidden"]):hover, select:hover, textarea:hover { border-color: var(--tinta-2); }
/* El foco de un campo se ve: borde tinta y anillo cobre (le gana al selector de arriba, que es más fuerte). */
input:not([type="radio"], [type="checkbox"], [type="hidden"]):focus-visible,
input:not([type="radio"], [type="checkbox"], [type="hidden"]):focus,
select:focus-visible, textarea:focus-visible, textarea:focus {
  outline: 2px solid transparent; border-color: var(--tinta); box-shadow: 0 0 0 3px var(--cobre);
}
input:not([type="radio"], [type="checkbox"], [type="hidden"])[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--rojo-texto); border-width: 2px;
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--tinta); width: 1.1rem; height: 1.1rem; }
input[type="radio"]:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }

.opcion { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400 !important; font-size: .95rem !important; margin-bottom: .5rem !important; cursor: pointer; min-height: 1.75rem; }
.opcion input { margin-top: .2rem; flex: none; }

.form-grilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 0 1rem; }
.form-grilla > input[type="hidden"] { display: none; }
.form-acciones { grid-column: 1 / -1; }
.form-correr .campo { max-width: 22rem; }
.form-programacion .campo { max-width: 14rem; margin-top: .5rem; }
.form-programacion + .nota { margin-top: .9rem; }
.en-linea { display: inline; margin: 0; }
.form-corto { margin-top: 1rem; max-width: 28rem; }
.form-filtro { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; margin-bottom: 1rem; }
.form-filtro .etiqueta { flex-basis: 100%; margin-bottom: 0; }
.form-filtro select { width: auto; min-width: min(100%, 16rem); }

/* Datos clave/valor: en grilla que se apila sola cuando no entra (Plan y pagos a 320 px). */
.datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .75rem 1.5rem; margin: 0 0 1rem; font-size: .95rem; }
.datos > div { min-width: 0; }
.datos dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tinta-3); font-weight: 700; }
.datos dd { margin: .15rem 0 0; min-width: 0; overflow-wrap: anywhere; }
.tabla-actividad .cuando { white-space: nowrap; font-variant-numeric: tabular-nums; }
.paginas { font-size: .9rem; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .55rem 1.15rem; border-radius: var(--radio-chico);
  border: 1px solid var(--cobre-medio); background: var(--cobre); color: var(--tinta); /* 6,4:1 */
  font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center;
  transition: background-color var(--rapido), border-color var(--rapido), color var(--rapido);
}
.boton:hover { background: var(--cobre-medio); border-color: var(--cobre-fuerte); color: var(--tinta); } /* 4,8:1 */
.boton:active { background: var(--cobre-fuerte); color: #fff; }
.boton:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }
.boton:disabled, .boton[aria-disabled="true"] {
  background: var(--gris-suave); border-color: var(--linea-2); color: var(--tinta-3); cursor: not-allowed;
}
.boton-grande { min-height: 3.1rem; padding: .7rem 1.6rem; font-size: 1.05rem; }
.boton-secundario { background: var(--papel); border-color: var(--borde-campo); color: var(--tinta); }
.boton-secundario:hover { background: var(--cobre-suave); border-color: var(--cobre-fuerte); color: var(--tinta); }
.boton-peligro { background: var(--rojo-texto); border-color: var(--rojo-texto); color: #fff; }
.boton-peligro:hover { background: #991b1b; border-color: #991b1b; color: #fff; }
.boton-peligro-suave { background: var(--papel); border-color: var(--rojo-borde); color: var(--rojo-texto); }
/* Chico de texto, no de blanco: sigue midiendo 44 px de alto para el dedo. */
.boton-chico { min-height: 2.75rem; padding: .4rem .85rem; font-size: .9rem; }
.boton-peligro-suave:hover { background: var(--rojo-suave); border-color: var(--rojo); color: var(--rojo-texto); }
.boton-ancho { width: 100%; }
.boton-enlace { background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--cobre); text-underline-offset: 3px; cursor: pointer; }
.boton-enlace:hover { color: var(--cobre-fuerte); }
.enlace-peligro { color: var(--rojo-texto); text-decoration-color: var(--rojo); }
.borrar { margin-top: 1.25rem; padding-top: .9rem; border-top: 1px solid var(--linea); font-size: .92rem; }
.acciones-peligro { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

.link-invitacion { font-family: var(--mono); font-size: .88rem; margin-bottom: 1rem; }

/* ---------- Acceso ---------- */

.acceso { display: grid; place-items: start center; padding-top: 5vh; }
.acceso-caja {
  width: 100%; max-width: 26rem; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.75rem 1.6rem; box-shadow: var(--sombra-alta);
}
.lema { color: var(--tinta-3); margin-bottom: 1.25rem; }
.acceso-caja form + .nota { margin: 1rem 0 0; }
.acceso-ayuda { width: 100%; max-width: 26rem; margin: 1.1rem auto 0; font-size: .92rem; color: var(--tinta-2); }
.acceso-caja .acceso-ayuda { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--linea); }
.acceso-ayuda p { margin-bottom: .6rem; }
/* El campo trampa de /crear-cuenta: fuera de la vista, del teclado (tabindex -1) y del lector (aria-hidden). Lo llenan los robots. */
.trampa { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.acceso-invitacion { grid-template-columns: minmax(0, 26rem) minmax(0, 26rem); gap: 2.5rem; justify-content: center; align-items: start; place-items: start stretch; }
.acceso-presentacion { padding-top: .6rem; }
/* «Cuánto sale» al lado de crear la cuenta: los tramos, con el precio tabular y a la derecha. */
.acceso-con-precios { align-items: start; }
.precios h2 { font-size: 1.15rem; margin-bottom: .5rem; }
.tabla-precios { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); margin-bottom: .9rem; font-size: .95rem; }
.tabla-precios th[scope="row"] { font-weight: 400; color: var(--tinta); text-transform: none; letter-spacing: 0; font-size: .95rem; background: none; border-bottom: 1px solid var(--linea); }
.tabla-precios td { vertical-align: middle; font-weight: 600; }
.tabla-precios tbody tr:last-child th, .tabla-precios tbody tr:last-child td { border-bottom: 0; }
.invita { font-size: 1.12rem; line-height: 1.45; margin-bottom: .9rem; }
.que-es { color: var(--tinta-2); margin-bottom: 1.4rem; }
.pasos-titulo { font-size: 1rem; margin-bottom: .6rem; }
.pasos-invitacion { list-style: none; margin: 0; padding: 0; counter-reset: paso; }
.pasos-invitacion li {
  counter-increment: paso; position: relative; padding: .5rem 0 .5rem 2.5rem; min-height: 2.3rem;
  border-bottom: 1px solid var(--linea); font-size: .95rem;
}
.pasos-invitacion li:last-child { border-bottom: 0; }
.pasos-invitacion li::before {
  content: counter(paso); position: absolute; left: 0; top: .45rem;
  width: 1.65rem; height: 1.65rem; border-radius: 50%; display: grid; place-items: center;
  font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--linea-2); color: var(--tinta-2); background: var(--papel);
}
.pasos-invitacion li span { display: block; color: var(--tinta-3); font-size: .88rem; }
.pasos-invitacion .paso-ahora::before { background: var(--tinta); border-color: var(--tinta); color: #fff; }

/* Contraseña con «Mostrar» adentro del campo (el botón aparece solo con JS). */
.contrasena { position: relative; }
.contrasena input { padding-right: 5.8rem !important; }
.boton-mostrar {
  position: absolute; right: .3rem; top: 50%; transform: translateY(-50%);
  min-height: 2.25rem; padding: .2rem .7rem; border-radius: 4px; border: 1px solid transparent;
  background: transparent; color: var(--tinta-2); font-size: .85rem; font-weight: 700; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--cobre); text-underline-offset: 3px;
}
.boton-mostrar:hover { background: var(--cobre-suave); color: var(--tinta); }

/* ---------- Términos y privacidad ---------- */

.legal { max-width: 48rem; }
.legal h1 { margin-bottom: .2rem; }
.legal-version { color: var(--tinta-3); font-size: .85rem; margin-bottom: 1.25rem; }
.legal section { margin-bottom: 1.4rem; }
.legal section > :last-child { margin-bottom: 0; }
.legal .lista-simple li { margin-bottom: .4rem; }
.legal-compuerta { margin-inline: auto; }
.resumen-legal { margin: 0 0 1rem; padding-left: 1.1rem; }
.resumen-legal li { margin-bottom: .55rem; }
.form-aceptar { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--linea); }

.progreso { list-style: none; margin: .25rem 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; counter-reset: progreso; font-size: .85rem; }
.progreso li {
  counter-increment: progreso; display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .7rem .25rem .3rem; border: 1px solid var(--linea); border-radius: 999px; color: var(--tinta-3); background: var(--papel);
}
.progreso li::before {
  content: counter(progreso); width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center;
  font-size: .74rem; font-weight: 700; background: var(--gris-suave); color: var(--tinta-2);
}
.progreso .progreso-ahora { color: var(--tinta); font-weight: 700; border-color: var(--cobre-borde); background: var(--cobre-suave); }
.progreso .progreso-ahora::before { background: var(--tinta); color: #fff; }
.casilla { margin-bottom: 1rem !important; font-size: 1rem !important; }

/* ---------- Corridas ---------- */

.corrida-titulo { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cabecera-corrida .datos { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.acciones-corrida { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.acciones-corrida:empty { display: none; }

progress {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: .6rem;
  border: 0; border-radius: 999px; background: var(--linea); overflow: hidden; margin: .25rem 0 .5rem;
  box-shadow: inset 0 0 0 1px var(--linea-2);
}
progress::-webkit-progress-bar { background: var(--linea); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--cobre-fuerte); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--cobre-fuerte); border-radius: 999px; }
@media (prefers-reduced-motion: no-preference) {
  progress::-webkit-progress-value { transition: inline-size 400ms var(--suave); }
}

.actividad { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow-y: auto; font-size: .9rem; }
.actividad li { padding: .35rem 0; border-bottom: 1px dashed var(--linea); }
.actividad li:last-child { border-bottom: 0; }
.actividad time { display: inline-block; min-width: 3.2rem; color: var(--tinta-3); font-variant-numeric: tabular-nums; }

.resumen { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.resumen li { font-size: .95rem; }
.resumen strong { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.resumen-favor strong, .resumen-ok strong { color: var(--verde-texto); }
.resumen-revisar strong { color: var(--ambar-texto); }
.resumen-error strong { color: var(--rojo-texto); }

.lista-cuidado { margin: 0; padding-left: 1.1rem; font-size: .95rem; color: var(--tinta-2); }
.lista-cuidado li { margin-bottom: .5rem; }
.lista-simple { margin: 0; padding-left: 1.1rem; }
.lista-simple li { margin-bottom: .25rem; }

/* ---------- Inicio ---------- */

/* Lo que hay que mirar (la corrida y «Para resolver») a la izquierda y ancho; correr, la automática y la agenda al costado. */
.inicio-grilla { display: grid; gap: 0 1.25rem; align-items: start; }
/* Sin corrida que mostrar (primera vez): los paneles de correr y la automática, de a dos, sin columna vacía. */
.inicio-grilla.inicio-grilla-sin-principal { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) {
  .inicio-grilla-sin-principal .inicio-lateral { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; align-items: start; }
}
.inicio-principal, .inicio-lateral { min-width: 0; }
@media (min-width: 76rem) {
  .inicio-grilla { grid-template-columns: minmax(0, 1.65fr) minmax(19rem, 1fr); }
}

/* Los números del resumen llevan a la corrida filtrada: parecen datos, se comportan como enlaces. */
.resumen-enlaces { gap: .35rem; margin: .4rem 0 1rem; }
.resumen-enlaces a {
  display: inline-flex; align-items: baseline; gap: .35rem; min-height: 2.5rem; padding: .35rem .75rem;
  border: 1px solid var(--linea); border-radius: var(--radio-chico); background: var(--papel-2);
  color: var(--tinta-2); text-decoration: none;
}
.resumen-enlaces a:hover { border-color: var(--cobre-fuerte); background: var(--cobre-suave); color: var(--tinta); }
.resumen-enlaces strong { font-size: 1.15rem; }

.resumen-final { margin: .25rem 0 .5rem; font-variant-numeric: tabular-nums; }
.aviso-motivo { margin: .75rem 0 1rem; }
.aviso-motivo .aviso-titulo { margin-bottom: .2rem; }
.avance-pulso { display: flex; align-items: center; gap: .5rem; }
.pulso { inline-size: .6rem; block-size: .6rem; border-radius: 50%; background: var(--cobre-fuerte); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  /* Tres latidos y queda fijo: algo que parpadea más de 5 s necesitaría un botón para pararlo (WCAG 2.2.2). */
  .pulso { animation: pulso 1.6s var(--suave) 3; }
  @keyframes pulso { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
}

.resolver { margin: 1.25rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--linea); }
.resolver h3 { margin: 0 0 .5rem; font-size: 1.05rem; color: var(--tinta); display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.resolver-cuenta { font-size: .9rem; font-weight: 500; color: var(--tinta-3); font-variant-numeric: tabular-nums; }
.resolver-grupos { list-style: none; margin: 0; padding: 0; }
.resolver-grupo { padding: .85rem 0; border-bottom: 1px solid var(--linea); }
.resolver-grupo:last-child { border-bottom: 0; padding-bottom: 0; }
.resolver-titulo { margin: 0 0 .2rem; }
.resolver-que { margin: 0 0 .5rem; color: var(--tinta-2); font-size: .92rem; max-width: 70ch; }
.resolver-clientes { list-style: none; margin: 0 0 .4rem; padding: 0; }
.resolver-clientes li { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; min-height: 2.25rem; padding: .2rem 0; border-bottom: 1px dashed var(--linea); }
.resolver-clientes a { font-weight: 700; overflow-wrap: anywhere; }
.resolver-clientes .estado { font-size: .74rem; }
.resolver-acciones { margin: .35rem 0 0; font-size: .92rem; }
.resolver-nada { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0; color: var(--tinta-2); }

.desplegable-programacion { margin-top: .75rem; }
.desplegable-programacion > summary { font-weight: 700; }



/* ---------- Primeros pasos ---------- */

.primeros-pasos-cabecera { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.primeros-pasos-cabecera h2 { margin-bottom: .35rem; }
.primeros-pasos-cuenta { margin: 0; font-size: .9rem; font-weight: 700; color: var(--tinta-2); font-variant-numeric: tabular-nums; }
.pasos { list-style: none; margin: .5rem 0 0; padding: 0; }
.paso {
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: .2rem .85rem; align-items: center;
  padding: .75rem 0; border-top: 1px solid var(--linea);
}
.paso-marca { width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 1.5px solid var(--linea-2); background: var(--papel); position: relative; }
.paso-texto p { margin: 0; }
.paso-titulo { font-weight: 700; }
.paso-detalle { color: var(--tinta-3); font-size: .9rem; }
.paso-opcional { font-weight: 500; font-size: .76rem; color: var(--tinta-3); border: 1px solid var(--linea-2); border-radius: 999px; padding: 0 .45rem; margin-left: .3rem; white-space: nowrap; }
.paso-accion { white-space: nowrap; }
.paso-hecho .paso-titulo { color: var(--tinta-2); font-weight: 500; }
.paso-hecho .paso-marca { background: var(--verde); border-color: var(--verde); }
.paso-hecho .paso-marca::after {
  content: ""; position: absolute; left: .43rem; top: .2rem; width: .32rem; height: .64rem;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.paso-siguiente .paso-marca { border-color: var(--tinta); background: var(--papel); }
.paso-siguiente .paso-marca::after { content: ""; position: absolute; inset: .3rem; border-radius: 50%; background: var(--tinta); }

.primera-corrida-que { max-width: 70ch; }
.primera-corrida-cuanto { color: var(--tinta-2); max-width: 70ch; }
.primera-corrida-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem 2rem; align-items: start; margin-top: 1rem; }
.primera-corrida-opciones .form-correr .boton-grande { margin-top: .25rem; }
.primera-corrida-alternativa { padding: 1rem 1.1rem; border-left: 1px solid var(--linea); }
.primera-corrida-alternativa .etiqueta { margin-bottom: .55rem; }
.primera-corrida-alternativa form { margin: 0 0 .5rem; }
.primera-corrida-alternativa .boton { white-space: normal; text-align: left; }

.desplegable { margin: 0 0 1rem; }
.desplegable > summary { cursor: pointer; padding: .4rem 0; font-size: .95rem; min-height: 2rem; }
.desplegable > summary:hover { color: var(--cobre-fuerte); }
.desplegable[open] > summary { margin-bottom: .6rem; }
.desplegable .nota { font-size: .88rem; }

.vacio-con-accion { padding: 1.25rem 0; }
.vacio-con-accion p:last-child { margin-bottom: 0; }

/* ---------- Clientes: pegar la lista ---------- */

.resumen-grande { gap: .4rem 1.5rem; margin-bottom: 1.25rem; }
.resumen-grande li { font-size: 1rem; }
.resumen-grande strong { font-size: 1.4rem; margin-right: .15rem; }
.confirmar-lista .acciones-corrida { margin-top: .75rem; }
.tabla-lista td { vertical-align: middle; }
.tabla-lista .num { width: 4.5rem; }
.tabla-lista code { word-break: break-word; }
.motivo-linea { display: inline; margin-left: .35rem; color: var(--tinta-2); }
.form-en-linea { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; margin-bottom: .75rem; }
.form-en-linea .campo { margin: 0; min-width: min(100%, 14rem); }

.preguntas { margin: 0 0 1rem; }
.preguntas > div { padding: .6rem 0; border-top: 1px solid #ecd9d2; }
.preguntas > div:first-child { border-top: 0; padding-top: 0; }
.preguntas dt { font-weight: 700; font-size: .95rem; margin-bottom: .15rem; }
.preguntas dd { margin: 0; font-size: .95rem; color: var(--tinta-2); }

/* ---------- Agenda ---------- */

.form-fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 0 1rem; }
.form-agenda .campo { max-width: 22rem; }

.agenda-lista { list-style: none; margin: 0 0 1rem; padding: 0; }
.agenda-item { padding: .65rem 0; border-bottom: 1px solid var(--linea); }
.agenda-item:last-child { border-bottom: 0; }
.agenda-item p { margin: 0; }
.agenda-item .nota { margin-top: .3rem; }
.agenda-cuando { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.agenda-que { color: var(--tinta-2); font-size: .95rem; }
.agenda-que .origen { display: inline; margin-left: .35rem; }
.agenda-automatica .agenda-cuando strong { font-weight: 500; }
.agenda-automatica { color: var(--tinta-2); }
/* Las que programó alguien se distinguen de las automáticas: fondo cobre suave y el botón para cancelar. */
.agenda-programada { background: var(--cobre-suave); border-radius: var(--radio); padding: .75rem .9rem; margin: .4rem 0; border-bottom: 0; }
.agenda-acciones { margin-top: .5rem !important; }
.tabla .fecha { white-space: nowrap; }
.agenda-acciones { margin-top: .25rem !important; font-size: .92rem; }
.motivo-agenda { display: block; color: var(--tinta-3); font-size: .82rem; margin-top: .15rem; }

.form-programacion .campo-dias { max-width: none; }
.dias-elegidos { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .2rem 1.7rem; }
.dia {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem; min-height: 2.25rem;
  border: 1px solid var(--borde-campo); border-radius: var(--radio-chico); background: var(--papel);
  font-weight: 400 !important; font-size: .9rem !important; margin: 0 !important; cursor: pointer;
}
.dia input { accent-color: var(--tinta); }
.dia:has(input:checked) { background: var(--cobre-suave); border-color: var(--cobre-fuerte); }
.dia:has(input:focus-visible) { outline: 2px solid var(--tinta); outline-offset: 1px; }
.campo-dias:has(input[name="dias_modo"]:checked):not(:has(input[name="dias_modo"][value="elegidos"]:checked)) .dias-elegidos { display: none; }

/* ---------- Ayuda (guía de uso) ---------- */

.guia { max-width: 54rem; }
.guia section { scroll-margin-top: 1rem; }
.guia h3 { font-size: .95rem; margin: 1.1rem 0 .4rem; }
.guia .preguntas > div { border-top-color: var(--linea); }
.guia .preguntas dd .lista-simple { margin-top: .35rem; }
.guia-indice ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .95rem; }
.guia-indice a { display: inline-flex; align-items: center; min-height: 2rem; }
/*
 * En pantallas anchas, el índice queda fijo a la izquierda mientras se lee: la guía es larga (5.600 px) y
 * así se salta de un tema a otro sin volver arriba.
 */
@media (min-width: 84rem) {
  .guia { max-width: 74rem; display: grid; grid-template-columns: 14rem minmax(0, 54rem); column-gap: 2rem; align-items: start; }
  .guia > * { grid-column: 2; }
  .guia > h1, .guia > .bajada { grid-column: 1 / -1; }
  .guia > .guia-indice { grid-column: 1; grid-row: 3 / span 20; position: sticky; top: 1rem; }
  .guia-indice ul { flex-direction: column; gap: 0; }
}
.guia-estados dt { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; }
.guia-codigo { font-size: .74rem; color: var(--tinta-3); font-weight: 400; }
.guia-otros { margin: 1rem 0 0; }
.guia-otros > summary { font-weight: 700; }

/* ---------- Transiciones entre páginas ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; animation-timing-function: var(--suave); }
  .lateral { view-transition-name: lateral; }
}


/* ---------- Diálogo de confirmación (correr ahora) ---------- */

.dialogo {
  inline-size: min(32rem, calc(100vw - 2rem)); max-block-size: calc(100dvh - 2rem); padding: 1.5rem 1.6rem 1.25rem;
  border: 1px solid var(--linea-2); border-radius: var(--radio); background: var(--papel); color: var(--tinta);
  box-shadow: 0 18px 48px rgba(26, 26, 46, .22);
}
.dialogo h1 { font-size: 1.35rem; margin: 0 0 .35rem; }
.dialogo-resumen { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cobre-fuerte); margin: 0 0 .75rem; }
.acciones-dialogo { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
/* Que el scroll adentro del diálogo o sobre el fondo no mueva la página de atrás. */
dialog:modal { overscroll-behavior: contain; }
/* Centrado aunque sea el último hijo de un panel (.panel > :last-child le saca el margen de abajo). */
.dialogo:modal { margin: auto; }
dialog::backdrop { background: rgba(26, 26, 46, .45); overflow: hidden; overscroll-behavior: contain; }
@media (prefers-reduced-motion: no-preference) {
  .dialogo[open] { animation: aparece 180ms var(--suave); }
  @keyframes aparece { from { opacity: 0; transform: translateY(.5rem); } }
}

/* ---------- Zona para borrar (lejos de la acción principal) ---------- */

.zona-peligro { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--linea-2); }
.zona-peligro h2 { font-size: 1rem; }

/* ---------- Angosto ---------- */

@media (max-width: 52rem) {
  .acceso-invitacion { grid-template-columns: minmax(0, 32rem); gap: 1.25rem; justify-content: center; }
}

@media (max-width: 40rem) {
  main { padding: 1.1rem 1rem 2.25rem; }
  .barra-interior { padding: .6rem 1rem; }
  .sin-menu .cuenta-email { display: none; }
  .panel { padding: 1.05rem 1.05rem; }
  h1 { font-size: 1.45rem; }
  .acceso { padding-top: 1rem; }
  .paso { grid-template-columns: 1.6rem minmax(0, 1fr); }
  .paso-accion { grid-column: 2; justify-self: start; margin-top: .35rem; }
  .boton-grande { width: 100%; }
  .primera-corrida-alternativa { border-left: 0; border-top: 1px solid var(--linea); padding: 1rem 0 0; }
  .lateral-cabeza .marca-de { display: none; }
}

@media print {
  .lateral, .barra, .pie, .acciones-corrida, form, .whatsapp, .soporte-destacado { display: none !important; }
  .marco { display: block; }
  body { background: #fff; }
  .panel, .tabla-desplazable { border: 0; box-shadow: none; }
}
