/* Mobile-first: el vendedor cotiza desde el teléfono. Sin framework. */
* { box-sizing: border-box; }
/* [hidden] gana siempre: un display de componente (.btn, .tier…) no puede
   volver a mostrar lo que el HTML o un controller escondió. */
[hidden] { display: none !important; }
/* overflow-wrap: una palabra más larga que su caja (un correo, un código) se
   parte antes que correr la página de lado. */
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; color: #1a2330; background: #f5f6f8; overflow-wrap: break-word; }
.container { max-width: 60rem; margin: 0 auto; padding: 1rem; }
/* El ancho único de las secciones con sesión: el mismo del panel de gerencia (.shell) y de la barra superior. */
.container--wide { max-width: 78rem; }

/* La barra queda fija arriba y el menú lateral se cuelga justo debajo, así que
   los dos dependen de esta altura. El min-height la vuelve determinista: sin
   él la barra mide lo que midan sus links y el offset del menú sería a ojo. */
:root { --topbar-h: 3rem; }


/* Botón con aspecto de enlace (datos maestros, simulador). */
.linklike { background: none; border: none; color: #d6e3f0; cursor: pointer; font: inherit; padding: 0; }

.flash { padding: .6rem .9rem; border-radius: .4rem; }
.flash--notice { background: #e2f4e5; color: #17632a; transition: opacity .4s ease; }
.flash--alert { background: #fbe4e4; color: #922; }
.flash--hiding { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .flash--notice { transition: none; } }

h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; margin-top: 1.4rem; }

.card { background: #fff; border: 1px solid #e2e6ec; border-radius: .5rem; padding: 1rem; margin-bottom: .8rem; }
/* Los enlaces-botón traen su propio color: excluirlos evita que el texto del
   botón quede del mismo tono que su fondo (`.card a` le gana en especificidad
   a `.btn`, y la cascada resuelve por especificidad antes que por orden). */
.card a:not(.btn) { color: #16324f; text-decoration: none; font-weight: 600; }
/* Nombre del cliente con su botón "Editar cliente" al lado (ficha de cotización). */
.client-line { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.client-line p { margin: 0; }
.card__meta { color: #5a6a7c; font-size: .85rem; margin-top: .25rem; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 1rem; font-size: .75rem; font-weight: 600; }
.badge--created { background: #e8eef7; color: #16324f; }
.badge--accepted { background: #e2f4e5; color: #17632a; }
.badge--in_production { background: #fdf1dc; color: #8a5a00; }
.badge--rejected { background: #fbe4e4; color: #922; }
/* Vencida no es un estado guardado: se deriva de la fecha de validez. */
.badge--expired { background: #eceff3; color: #5a6a7c; }
/* Un dato secundario de una fila: "Inactivo", "Sin cliente" (artículos, ADR-0029). */
.badge--muted { background: #eceff3; color: #5a6a7c; }
.badge--test { background: #f3e8ff; color: #6b21a8; }
/* No vigente: la reemplazó otra versión. Tachado suave, para que no se lea como abierta. */
.badge--superseded { background: #f1f5f9; color: #5a6a7c; text-decoration: line-through; }

form .field { margin-bottom: .9rem; }
form label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
form input[type=text], form input[type=email], form input[type=password], form input[type=number],
form input[type=search], form input[type=tel], form input[type=date], form select, form textarea {
  width: 100%; padding: .55rem .6rem; border: 1px solid #c4ccd6; border-radius: .4rem; font-size: 1rem; background: #fff;
}
/* WebKit no deja estilar un type=search: en iOS lo redondea en píldora y en
   macOS ignora borde y padding. Solo al search: en el select quitaría la flecha. */
form input[type=search] { -webkit-appearance: none; appearance: none; }
/* Campo calculado (nombre y estructura del compuesto): se ve, no se escribe. */
form input.input--readonly { background: #eceff3; color: #16324f; font-weight: 600; cursor: default; }
form .field--inline { display: flex; gap: .5rem; align-items: center; }
form .field--inline label { margin: 0; font-weight: 400; }
.btn { display: inline-block; background: #16324f; color: #fff; border: none; border-radius: .4rem; padding: .65rem 1.1rem; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn--secondary { background: #5a6a7c; }
.btn--small { padding: .3rem .7rem; font-size: .85rem; }
/* Los botones del menú se muestran con display flex, que le gana al atributo
   hidden del navegador: el de "Instalar la app" nace oculto y así se queda. */
.usermenu__item[hidden], .drawer__link[hidden] { display: none; }
/* La descarga del PDF: el botón que el vendedor busca al terminar, grande y del
   naranja de "Nueva cotización" para que se lea como la acción principal. */
.pdf-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin: 1rem 0 1.2rem; }
.pdf-cta .card__meta { margin: 0; }
.btn--pdf { display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  background: #3f7a1f; font-size: 1.15rem; font-weight: 700; padding: .95rem 1.6rem;
  border-radius: .6rem; box-shadow: 0 2px 6px rgba(63, 122, 31, .35); }
.btn--pdf:hover { background: #33661a; }
@media (max-width: 40rem) { .btn--pdf { width: 100%; } }
/* Los cinco formatos del PDF para que el cliente elija. */
/* TODO(G27): selector de los 5 formatos del PDF. La ficha ya ofrece uno solo
   (2026-10-06); cuando el cliente confirme el formato, borrar estas reglas,
   quotations.pdf.formats / download_format y las clases Pdf::Formal…Propuesta. */
.pdf-formats { margin: 0 0 1.4rem; }
.pdf-formats h2 { font-size: 1rem; margin: 0 0 .2rem; }
.pdf-formats__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .5rem; margin-top: .6rem; }
.pdf-format { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; background: #fff; border: 1px solid #e2e6ec;
              border-radius: .5rem; color: #1a2330; text-decoration: none; }
.pdf-format:hover { border-color: #3f7a1f; }
.pdf-format span:last-child { display: flex; flex-direction: column; }
.pdf-format small { color: #5a6a7c; font-size: .78rem; }
.pdf-format__num { display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem; flex: none;
                   border-radius: 50%; background: #16324f; color: #fff; font-weight: 700; font-size: .9rem; }
.envase-card svg { display: block; max-width: 36rem; max-height: 22rem; margin: 0 auto; }
/* El tamaño de letra lo calcula envase_svg según el envase (un atributo que el
   PDF también lee); los 13px del simulador lo pisaban y la cota no se leía. */
.envase-card .press__dim { font-size: inherit; }
/* Ficha de cotización: simulador congelado (gerencia). */
.frozen-sim { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid #e2e6ec; }

.errors { background: #fbe4e4; color: #922; border-radius: .4rem; padding: .7rem .9rem; margin-bottom: 1rem; }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* relative: una etiqueta .visually-hidden (absoluta) dentro de una celda se
   ubica contra el contenedor con scroll y no estira la página en el teléfono. */
.table-wrap { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; background: #fff; }
/* Ninguna tabla se corre de lado (Alejandro, 2026-11-18): cuando no cabe, el
   texto de sus celdas baja de línea. Una tabla que cabe se ve igual que antes,
   porque el navegador solo parte el texto cuando falta ancho. No se parten los
   números con su unidad, los estados ni los botones. */
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid #e2e6ec; font-size: .9rem; overflow-wrap: break-word; }
th { background: #eef1f5; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #44536a; }
td.num, th.num { text-align: right; }
td.num, td.nowrap, td.phone, td .badge, td .btn, td .linklike, td time { white-space: nowrap; }
/* Un segundo dato bajo el número de una celda (los kilos bajo las unidades). */
td.num .num__detail { display: block; color: #5a6a7c; font-size: .8rem; }
/* Un correo no tiene espacios: se parte solo cuando de verdad no cabe (y ahí la tabla pasa a tarjetas). */
td.email { overflow-wrap: break-word; }
/* Una celda de texto largo (el nombre de un artículo llega a 150 letras):
   envuelve en vez de ensanchar la tabla y sacar de la vista las demás columnas. */
td.cell-wrap { white-space: normal; min-width: 14rem; overflow-wrap: anywhere; }

.grid-2 { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr 1fr; }


/* --- Lista de cotizaciones ------------------------------------------------ */
/* Teléfono: tarjetas que se tocan enteras; desde 45rem, la tabla. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-head h1 { margin-right: auto; }
.page-head__cta { background: #3f7a1f; font-weight: 700; }
.page-head__cta:hover { background: #33661a; }
.list-filters { margin: .2rem 0 .7rem; }
.list-filters__search { display: flex; gap: .5rem; }
.list-filters__search input[type=search] { flex: 1; }
.list-filters__go[hidden] { display: none; }
.list-count { margin: .7rem 0 .5rem; color: #5a6a7c; font-size: .85rem; }
.empty { text-align: center; padding: 2rem 1rem; background: #fff; border: 1px dashed #c4ccd6; border-radius: .6rem; margin-top: 1rem; }
.empty p { margin: 0 0 1rem; color: #44536a; }
.qcards { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.qcard { display: grid; gap: .2rem; padding: .85rem 1rem; background: #fff; border: 1px solid #e2e6ec; border-radius: .6rem;
         color: inherit; text-decoration: none; }
.qcard:active { background: #f1f5f9; }
.qcard__top { display: flex; justify-content: space-between; align-items: center; }
.qcard__client { font-weight: 600; color: #16324f; }
.qcard__meta { color: #5a6a7c; font-size: .85rem; }
.qcard__price { font-weight: 700; font-variant-numeric: tabular-nums; }
.qtable { display: none; }
/* 45rem y no 40: con la columna de casillas, entre 640 y 720 px la tabla ya
   no cabía y la página se corría de lado; ahí van las tarjetas. */
@media (min-width: 45rem) {
  .qcards { display: none; }
  .qtable { display: block; }
}
@media (max-width: 40rem) {
  .page-head__cta { display: none; } /* en el teléfono ya está el "+" de la barra */
}

/* --- Cotizador: el formulario ---------------------------------------------- */
/* En secciones, porque veinte campos seguidos no se leen en el teléfono. */
.backlink { display: inline-block; margin: .1rem 0 .3rem; color: #5a6a7c; font-size: .9rem; text-decoration: none; }
.backlink:hover { color: #16324f; text-decoration: underline; }
.qform__section { background: #fff; border: 1px solid #e2e6ec; border-radius: .6rem; padding: 1rem 1rem .15rem; margin-bottom: 1rem; }
.qform__section > h2 { margin: 0 0 .8rem; font-size: .8rem; color: #16324f; text-transform: uppercase; letter-spacing: .06em; }
.qform__subtitle { margin: .4rem 0 .6rem; font-size: .9rem; color: #44536a; }
.btn--lg { padding: .9rem 1.5rem; font-size: 1.1rem; font-weight: 700; }
.btn--block { display: block; width: 100%; padding: .85rem; font-size: 1.05rem; }
.card--row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.card--row p { margin: 0; }

/* Buscador de clientes: un cuadro de búsqueda sobre el <select> real. */
.picker { position: relative; }
.picker__head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.picker__head .linklike { font-size: .85rem; font-weight: 600; color: #3f7a1f; text-decoration: none; }
.picker__list { position: absolute; z-index: 8; left: 0; right: 0; top: 100%; margin: .2rem 0 0; padding: .3rem 0;
                list-style: none; max-height: 16rem; overflow-y: auto; background: #fff; border: 1px solid #c4ccd6;
                border-radius: .5rem; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); }
.picker__group { padding: .45rem .8rem .2rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #5a6a7c; }
.picker__item { display: flex; justify-content: space-between; gap: .6rem; padding: .6rem .8rem; cursor: pointer; }
.picker__item:hover { background: #eef1f5; }
.picker__item small { color: #5a6a7c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.picker__empty { padding: .6rem .8rem; color: #5a6a7c; font-size: .9rem; }

/* Productos recientes del cliente y aviso de "cotizar de nuevo". */
.recent-products { margin: -.2rem 0 .9rem; }
.recent-products__title { margin: 0 0 .35rem; font-size: .8rem; font-weight: 600; color: #44536a; }
.chip--product { white-space: normal; text-align: left; line-height: 1.25; border-color: #bfdbfe; background: #eff6ff; color: #16324f; }
.chip--product:hover { border-color: #2563eb; }
.notice { border: 1px solid transparent; border-radius: .5rem; padding: .7rem .9rem; margin-bottom: 1rem; font-size: .92rem; }
.notice ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.notice--info { background: #eff6ff; color: #1e3a5f; border-color: #bfdbfe; }
.notice--ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.btn--share { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .95rem 1.4rem;
              font-size: 1.05rem; font-weight: 700; border-radius: .6rem; background: #16a34a; }
.btn--share[hidden] { display: none; }
@media (max-width: 40rem) { .btn--share { width: 100%; } }
.draft-banner p { margin: 0 0 .5rem; }
.notice--warn { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.notice[hidden] { display: none; }
.draft-banner__actions { display: flex; gap: .5rem; }
.draft-banner[hidden] { display: none; }
.btn--requote { display: inline-flex; align-items: center; padding: .95rem 1.4rem; font-size: 1.05rem; border-radius: .6rem; }
@media (max-width: 40rem) { .btn--requote { width: 100%; justify-content: center; } }

/* Cantidades: chips de un toque y las cinco visibles en una fila; las que se
   agregan (hasta 10) bajan a una segunda fila de cinco. */
.chips--wrap { flex-wrap: wrap; overflow: visible; margin-bottom: .7rem; }
.chip--button { border: 1px dashed #94a3b8; background: #f8fafc; cursor: pointer; font: inherit; font-size: .85rem; color: #16324f; }
.chip--button:hover { background: #eef1f5; border-style: solid; }
.tiers-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
/* Las ocultas siguen ocultas aunque una regla les ponga display (gerencia, en
   el teléfono, arma cada cantidad como grilla con su margen). */
.tiers-grid .tier[hidden], .tiers-grid > .field[hidden] { display: none; }
.tier .field { margin-bottom: .6rem; }
/* Rótulo de la cantidad con su "×" para quitarla (desde la segunda). */
.tier__head { display: flex; align-items: center; justify-content: space-between; gap: .3rem; }
.tier__remove { border: none; background: none; color: #5a6a7c; font-size: 1.15rem; line-height: 1; padding: .1rem .35rem; border-radius: .3rem; cursor: pointer; }
.tier__remove:hover, .tier__remove:focus-visible { background: #fbe4e4; color: #922; }
.qform__optional { margin: .2rem 0 .9rem; }
.qform__optional summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: #16324f; }
.qform__optional > div { margin-top: .6rem; }

/* Diálogos del cotizador (cliente y contacto nuevos): hoja desde abajo en el
   teléfono, ventana centrada en el computador. */
.sheet { border: 0; padding: 0; width: 100%; max-width: none; margin: auto 0 0; border-radius: 1rem 1rem 0 0;
         max-height: 92vh; overflow-y: auto; box-shadow: 0 -8px 24px rgba(15, 23, 42, .18); }
.sheet::backdrop { background: rgba(15, 23, 42, .45); }
.sheet__body { padding: 1rem 1rem 1.25rem; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .3rem; }
.sheet__head h2 { margin: 0; font-size: 1.1rem; }
.sheet__close { display: inline-flex; padding: .4rem; border: 0; background: none; color: #475569; cursor: pointer; }
@media (min-width: 40rem) {
  .sheet { width: 32rem; margin: auto; border-radius: .8rem; }
}
@media (max-width: 40rem) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child { grid-column: 1 / -1; }
  .tiers-grid { grid-template-columns: 1fr 1fr; }
  .tiers-grid--margins { grid-template-columns: 1fr; }
  /* Cantidad, margen y descuento (ADR-0015) en una fila. */
  .tiers-grid--margins .tier { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: .5rem; }
}

.auth { max-width: 22rem; margin: 3rem auto; }
.auth h1 { text-align: center; }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-bottom: 1.8rem; }
.auth__logo { width: 100%; max-width: 17rem; height: auto; }
.auth__brand span { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #5a6a7c; }

.metrics { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .metrics { grid-template-columns: repeat(3, 1fr); } }
.metric { background: #fff; border: 1px solid #e2e6ec; border-radius: .5rem; padding: 1rem; }
.metric b { display: block; font-size: 1.4rem; }

.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }

/* --- Barra superior ------------------------------------------------------ */
/* Una sola fila siempre: en el teléfono, marca + ☰ + acción destacada; los
   accesos y la cuenta aparecen recién cuando hay ancho para ellos. */
/* Guiños de marca (logo de https://sjp.cl): el azul marino del cotizador se
   queda; el verde de SJP entra en los acentos. #6cb33e y #a0cf67 son los del
   logo; para texto blanco sobre verde se usa #3f7a1f (contraste 5,2:1: el
   verde de marca con blanco da 2,6:1 y no se lee). La línea verde bajo la
   barra es la del sitio. Los avisos de "cuidado" (demo, advertencias,
   pendientes) siguen en tonos cálidos a propósito. */
.appbar { background: #16324f; color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 3px 0 #6cb33e; }
.appbar__inner { max-width: 60rem; margin: 0 auto; padding: 0 .75rem; min-height: var(--topbar-h);
                 display: flex; align-items: center; gap: .5rem; }
.appbar__inner--wide { max-width: 78rem; }

.appbar__menu { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
                margin-left: -.35rem; border: 0; border-radius: .4rem; background: none; color: #fff; cursor: pointer; }
.appbar__menu:hover, .appbar__menu:focus-visible { background: rgba(255, 255, 255, .12); }

/* Atrás, adelante y actualizar: solo en la app instalada (sin barra del navegador),
   en Windows y en el teléfono. */
.appbar__history { display: none; gap: .1rem; margin-right: .2rem; }
.appbar__history-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border: 0;
                       border-radius: .4rem; background: none; color: #fff; cursor: pointer; }
.appbar__history-btn:hover, .appbar__history-btn:focus-visible { background: rgba(255, 255, 255, .14); }
@media (display-mode: standalone), (display-mode: minimal-ui), (display-mode: window-controls-overlay) {
  .appbar__history { display: inline-flex; }
}
.appbar__brand { display: inline-flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; min-width: 0; }
/* El monograma "sj::p" del sitio de SJP, en su versión clara para la barra oscura. */
.appbar__mark { display: block; height: 1.35rem; width: auto; flex: none; }
.appbar__name { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.appbar__name small { font-weight: 500; font-size: .72rem; color: #9fb6cc; letter-spacing: .04em; text-transform: uppercase; }
/* En el teléfono no caben junto al nombre: instalada, la marca queda en su monograma. Va DESPUÉS de
   .appbar__name: con la misma especificidad gana la regla de más abajo. */
@media (max-width: 640px) and (display-mode: standalone), (max-width: 640px) and (display-mode: minimal-ui) {
  .appbar__name { display: none; }
  .appbar__history { gap: 0; margin-right: 0; }
  .appbar__history-btn { width: 1.9rem; }
}

.appbar__nav { display: none; }
.appbar__link { color: #c9d7e6; text-decoration: none; font-size: .9rem; font-weight: 500; padding: .45rem .7rem; border-radius: .4rem; }
.appbar__link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.appbar__link--current { color: #fff; background: rgba(255, 255, 255, .14); }

.appbar__cta { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .65rem;
               border-radius: .45rem; background: #3f7a1f; color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; }
.appbar__cta:hover { background: #33661a; }
.appbar__cta span { display: none; }

/* Avisos de la app: campana con el número rojo de sin leer, junto al avatar. */
.appbar__bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
                width: 2.3rem; height: 2.3rem; border-radius: 50%; color: #c9d7e6; text-decoration: none; }
.appbar__bell:hover, .appbar__bell--unread { color: #fff; }
.appbar__bell:hover { background: rgba(255, 255, 255, .1); }
.appbar__badge { position: absolute; top: .05rem; right: -.1rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
                 border-radius: .6rem; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700;
                 line-height: 1.15rem; text-align: center; box-shadow: 0 0 0 2px #16324f; }

.usermenu { display: none; position: relative; }
.usermenu__trigger { list-style: none; cursor: pointer; border-radius: 50%; }
.usermenu__trigger::-webkit-details-marker { display: none; }
.usermenu__trigger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 14rem; padding: .4rem;
                   background: #fff; color: #1a2330; border: 1px solid #e2e6ec; border-radius: .6rem;
                   box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
.usermenu__who { margin: 0; padding: .55rem .65rem .6rem; border-bottom: 1px solid #eef1f5; }
.usermenu__who b { display: block; font-size: .9rem; }
.usermenu__who span { font-size: .78rem; color: #5a6a7c; }
.usermenu__item, .usermenu form button.usermenu__item { display: flex; align-items: center; gap: .55rem; width: 100%;
                   padding: .55rem .65rem; border: 0; border-radius: .4rem; background: none; color: inherit;
                   font: inherit; font-size: .9rem; text-decoration: none; cursor: pointer; text-align: left; }
.usermenu__item:hover { background: #f1f5f9; }
.usermenu form { margin: 0; }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; flex: none;
          border-radius: 50%; background: #2c5078; color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .03em; }

.icon { flex: none; }

@media (min-width: 64rem) {
  .appbar__inner { padding: 0 1rem; gap: 1rem; }
  .appbar__menu { display: none; }
  .appbar__nav { display: flex; gap: .15rem; margin-left: 1rem; }
  .appbar__cta { padding: .5rem .9rem; }
  .appbar__cta span { display: inline; }
  .usermenu { display: block; }
}

/* --- Panel del ☰ --------------------------------------------------------- */
.drawer { margin: 0; padding: 0; border: 0; height: 100%; max-height: 100%; width: min(20rem, 86vw);
          display: none; flex-direction: column; background: #fff; color: #1a2330;
          box-shadow: 8px 0 30px rgba(15, 23, 42, .25); }
.drawer[open] { display: flex; animation: drawer-in .18s ease-out; }
.drawer::backdrop { background: rgba(15, 23, 42, .45); }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }

.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
                padding: .7rem .75rem .7rem 1rem; background: #16324f; }
.drawer__close { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
                 border: 0; border-radius: .4rem; background: none; color: #fff; cursor: pointer; }
.drawer__close:hover, .drawer__close:focus-visible { background: rgba(255, 255, 255, .12); }

.drawer__body { flex: 1; overflow-y: auto; padding: .9rem .6rem; }
.drawer__cta { display: flex; align-items: center; justify-content: center; gap: .4rem; margin: 0 .4rem .9rem;
               padding: .7rem; border-radius: .5rem; background: #3f7a1f; color: #fff; font-weight: 600; text-decoration: none; }
.drawer__list { list-style: none; margin: 0; padding: 0; }
.drawer__group-title { margin: 1.1rem .75rem .3rem; font-size: .68rem; font-weight: 700; letter-spacing: .09em;
                       text-transform: uppercase; color: #6b7a8c; }
.drawer__link, .drawer form button.drawer__link { display: flex; align-items: center; gap: .7rem; width: 100%;
               min-height: 2.75rem; padding: .5rem .75rem; border: 0; border-radius: .45rem; background: none;
               color: #1a2330; font: inherit; font-size: .95rem; text-decoration: none; text-align: left; cursor: pointer; }
.drawer__link .icon { color: #5a6a7c; }
.drawer__link:hover { background: #f1f5f9; }
.drawer__link--sub { min-height: 2.4rem; padding-left: 1rem; font-size: .9rem; color: #33445a; }
.drawer__link--current { background: #e8eef7; color: #16324f; font-weight: 700; }
.drawer__link--current .icon { color: #16324f; }
.drawer form { margin: 0; }

.drawer__foot { border-top: 1px solid #e2e6ec; padding: .6rem; }
.drawer__who { display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem .7rem; }
.drawer__who b { display: block; font-size: .9rem; }
.drawer__who small { font-size: .78rem; color: #5a6a7c; }
.drawer__signout { color: #922; }

/* Shell con menú lateral. El contenido conserva su medida cómoda y la barra
   se suma al costado: por eso este ancho es mayor que el de .container. */
.shell { max-width: 78rem; margin: 0 auto; padding: 1rem; display: grid; gap: 1.25rem; align-items: start; }
.shell__main { min-width: 0; }
.footer { font-size: .8rem; color: #5a6a7c; }
.footer--wide { max-width: 78rem; margin: 0 auto; padding: 1rem; }

/* Menú lateral de gerencia: solo escritorio. En el teléfono las mismas
   secciones van en el panel del ☰. */
.sidenav { display: none; }

.sidenav__eyebrow {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: #44536a; margin: 1.1rem 0 .35rem; padding-bottom: .3rem; border-bottom: 1px solid #e2e6ec;
}
.sidenav__eyebrow:first-child { margin-top: 0; }
.sidenav__icon { vertical-align: -.12em; margin-right: .3rem; }
.sidenav__list { list-style: none; margin: 0; padding: 0; }
.sidenav__link {
  display: block; padding: .4rem .6rem; border-radius: .35rem; text-decoration: none;
  color: #1a2330; font-size: .9rem; border-left: 2px solid transparent;
}
.sidenav__link:hover { background: #eef1f5; }
.sidenav__link:focus-visible { outline: 2px solid #16324f; outline-offset: 1px; }
.sidenav__link--current { background: #e8eef7; color: #16324f; font-weight: 700; border-left-color: #16324f; }

@media (min-width: 64rem) {
  .shell { grid-template-columns: 15rem minmax(0, 1fr); }
  .sidenav { display: block; }

  /* El sticky va en el item del grid y no en el panel: el panel mide lo mismo
     que su contenido, así que ahí adentro no tendría recorrido para pegarse.
     Si el menú no cabe en la pantalla, scrollea solo en vez de cortarse. */
  .sidenav {
    position: sticky; top: calc(var(--topbar-h) + 1rem);
    max-height: calc(100vh - var(--topbar-h) - 2rem); overflow-y: auto;
  }
}

/* --- Datos maestros ----------------------------------------------------- */
.mdata__block { margin: 2rem 0; }
.mdata__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.mdata__head h2 { margin: 0 0 .5rem; }

.mdata { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.mdata th, .mdata td { padding: .4rem .6rem; border-bottom: 1px solid #e5e7eb; }
.mdata thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
/* Primera columna clavada: en el celular se navega con el dedo sin perder de
   vista de qué fila se trata. */
.mdata tbody th, .mdata thead th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; font-weight: 600; }
.mdata thead th:first-child { z-index: 3; background: #f8fafc; }
.mdata tbody tr:hover td, .mdata tbody tr:hover th { background: #f1f5f9; }
.mdata .num { text-align: right; }
/* Cálculos de SCRAP: los subtotales destacados de la tabla del Excel. */
.scrap caption { caption-side: top; text-align: left; padding: .4rem .6rem; }
.scrap .scrap__row--total th, .scrap .scrap__row--total td { font-weight: 700; background: #e0f2fe; }
.scrap__source { color: #64748b; font-size: .78rem; }
.scrap__unit { font-weight: 400; text-transform: none; color: #64748b; }

.mdata__cell { width: 100%; min-width: 6rem; padding: .25rem .4rem; border: 1px solid transparent; border-radius: .25rem; text-align: right; font: inherit; font-variant-numeric: tabular-nums; background: transparent; }
.mdata__cell:hover { border-color: #cbd5e1; }
.mdata__cell:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px #bfdbfe; background: #fff; }
.mdata__cell--changed { background: #fef9c3; border-color: #eab308; font-weight: 600; }
/* Valor congelado en el simulador de una cotización: se lee como dato, no como campo. */
.mdata__frozen { display: inline-block; min-width: 5rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.mdata__bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1rem; margin: 1rem 0; padding: .75rem 1rem; border-radius: .5rem; background: #1e293b; color: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .15); }
.mdata__bar span { font-weight: 600; margin-right: auto; }

@media (max-width: 640px) {
  .mdata th, .mdata td { padding: .35rem .45rem; font-size: .85rem; }
  .mdata__cell { min-width: 5rem; }
  .mdata__bar { flex-wrap: wrap; }
}

/* --- Dashboard ---------------------------------------------------------- */
.dashboard__charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.dashboard__charts .card h2 { margin: 0 0 .75rem; font-size: 1rem; }

@media (max-width: 640px) {
  .dashboard__charts { grid-template-columns: 1fr; }
}

/* Barra de filtros del panel. Teléfono: períodos de un toque, los filtros
   puestos como chips, y el formulario completo en un panel que sube desde
   abajo (<dialog> modal). Computador: el mismo <dialog> se muestra en línea,
   sin botón, como siempre estuvo el formulario. */
.dashboard__toolbar { margin: 0 0 1rem; }
/* Sin scroll horizontal (2026-11-18): los que no caben bajan a otra fila. Antes la fila se corría
   de lado con la barra oculta, y el último ("Borrar filtros") quedaba fuera de la pantalla. */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; padding-bottom: .15rem; }
.chip { flex: none; display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .8rem; border-radius: 999px;
        border: 1px solid #d5dbe3; background: #fff; color: #334155; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: #16324f; }
.chip--current { background: #16324f; border-color: #16324f; color: #fff; font-weight: 600; }
.chip--active { background: #f1f8ea; border-color: #b5d98f; color: #33661a; }
.dashboard__periods { display: flex; align-items: center; gap: .4rem; }
.dashboard__periods .chips { min-width: 0; }
/* Un enlace con forma de chip, distinto de los períodos: lleva a otra pantalla. */
.chip--link { border-color: #bfdbfe; background: #eff6ff; color: #16324f; font-weight: 600; text-decoration: none; }
.chip--link:hover { border-color: #2563eb; }
.dashboard__active { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin-top: .6rem; }
.dashboard__range { color: #5a6a7c; font-size: .85rem; }
.dashboard__filters-open { display: inline-flex; align-items: center; gap: .35rem; }
.dashboard__filters-open .count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.2rem;
        height: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: #3f7a1f; color: #fff; font-size: .75rem; font-weight: 700; }
.filters-sheet { border: 0; padding: 0; width: 100%; max-width: none; margin: auto 0 0; border-radius: 1rem 1rem 0 0;
        max-height: 88vh; overflow-y: auto; box-shadow: 0 -8px 24px rgba(15, 23, 42, .18); }
.filters-sheet::backdrop { background: rgba(15, 23, 42, .45); }
.filters-sheet .dashboard__filters { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1rem 1.25rem; margin: 0; }
.filters-sheet .field { margin-bottom: .6rem; }
.filters-sheet .field input, .filters-sheet .field select { width: 100%; box-sizing: border-box; }
.filters-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.filters-sheet__head h2 { margin: 0; font-size: 1.1rem; }
.filters-sheet__close { display: inline-flex; padding: .4rem; border: 0; background: none; color: #475569; cursor: pointer; }
.dashboard__apply { width: 100%; padding: .85rem; font-size: 1.05rem; margin-top: .4rem; }

@media (min-width: 64rem) {
  .dashboard__filters-open { display: none; }
  /* Cerrado, el <dialog> no se ve (hoja de estilos del navegador); acá se lo
     muestra en línea, que es como el gerente usa los filtros en el escritorio. */
  .filters-sheet, .filters-sheet[open] { display: block; position: static; margin: 1rem 0 0; width: auto;
        max-height: none; overflow: visible; border-radius: 0; box-shadow: none; background: transparent; }
  .filters-sheet .dashboard__filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 1rem; padding: 0; }
  .filters-sheet .field { margin: 0; }
  .filters-sheet .field input, .filters-sheet .field select { width: auto; }
  .filters-sheet__head { display: none; }
  .dashboard__apply { width: auto; padding: .65rem 1.1rem; font-size: 1rem; margin: 0; }
}

/* Indicadores: en el teléfono, de a dos y con la cifra más chica para que un
   monto de diez dígitos no rompa la columna. */
@media (max-width: 639px) {
  .metrics--six { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .metrics--six .metric { padding: .75rem; }
  .metrics--six .metric b { font-size: 1.1rem; overflow-wrap: anywhere; }
  .metrics--six .metric span { font-size: .8rem; }
}

/* Interruptor del modo demostración: el estado se ve de lejos. */
.switch { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem; border: 0; background: none;
          color: inherit; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.switch__track { position: relative; width: 2.4rem; height: 1.35rem; border-radius: 999px; background: #94a3b8; transition: background .15s; }
.switch__thumb { position: absolute; top: .15rem; left: .15rem; width: 1.05rem; height: 1.05rem; border-radius: 50%;
                 background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch[aria-checked="true"] .switch__track { background: #6cb33e; }
.switch[aria-checked="true"] .switch__thumb { transform: translateX(1.05rem); }


/* --- Cascada de costos --------------------------------------------------- */
/* Registro visual: cifras tabulares alineadas a la derecha, micro-etiquetas en
   mayúscula (el idiom que ya usa .mdata thead th), reglas de 1px en vez de
   cajas dentro de cajas, dos tonos sobre el #16324f de la topbar, cero emoji.
   Motivo unificador: UNA barra apilada repetida a tres escalas — riel,
   acumulado por fase y bus de cierre. */
.casc__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; }
.casc__toggle { display: inline-flex; border: 1px solid #cbd5e1; border-radius: .4rem; overflow: hidden; }
.casc__toggle-link { padding: .3rem .8rem; font-size: .8rem; text-decoration: none; color: #44536a; background: #fff; }
.casc__toggle-link--on { background: #16324f; color: #fff; font-weight: 600; }

.casc__golden { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; padding: .55rem .9rem; border-radius: .4rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.casc__golden--ok { background: #e2f4e5; color: #17632a; }
.casc__golden--drift { background: #fbe4e4; color: #922; }
.casc__golden-tag, .casc__scenario-tag, .casc__edges-tag, .casc__out-tag, .casc__cell-label,
.casc__reach { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
.casc__golden-values { display: flex; gap: .8rem; margin-left: auto; }

.casc__scenario { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .9rem; margin: .6rem 0 1rem; padding: .55rem .9rem; border: 1px solid #e2e6ec; border-radius: .4rem; background: #fff; font-size: .85rem; }

/* Riel: índice sticky con la canasta entera en una barra. */
.casc__rail { position: sticky; top: 0; z-index: 4; padding: .5rem .6rem; margin-bottom: 1.2rem; border-radius: .4rem; background: #fff; border: 1px solid #e2e6ec; }
.casc__rail-bar { display: block; width: 100%; border-radius: .2rem; overflow: hidden; }
.casc__rail-steps { display: flex; flex-wrap: wrap; gap: .4rem; margin: .45rem 0 0; padding: 0; list-style: none; }
.casc__rail-step { flex: 1 0 5.2rem; }
.casc__rail-step a { display: block; padding: .3rem .4rem; border-radius: .25rem; text-decoration: none; color: #1a2330; background: #f8fafc; }
.casc__rail-step--gate a { background: #eef1f5; }
.casc__rail-num { display: block; font-size: .7rem; color: #64748b; }
.casc__rail-name { display: block; font-size: .78rem; font-weight: 600; }
.casc__rail-pct { display: block; font-size: .82rem; font-variant-numeric: tabular-nums; color: #16324f; }

.casc__band { margin: 1.8rem 0; }
.casc__band-title { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: #16324f; }
.casc__band-hint { margin: .15rem 0 .9rem; font-size: .8rem; color: #5a6a7c; }

.casc__phase { margin: 0 0 1.4rem; padding-top: .8rem; border-top: 1px solid #d8dee7; font-variant-numeric: tabular-nums; }
.casc__phase:target { border-top-color: #2563eb; box-shadow: inset 0 2px 0 #2563eb; }
.casc__phase-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .7rem; }
.casc__phase-num { min-width: 1.4rem; font-size: .8rem; font-weight: 700; color: #94a3b8; }
.casc__phase-title { margin: 0; font-size: .95rem; }
.casc__phase-value { font-size: .9rem; font-weight: 600; }
.casc__phase-pct { font-size: .9rem; color: #16324f; }
.casc__phase-src { margin-left: auto; font-size: .7rem; color: #94a3b8; }
.casc__phase-what { margin: .25rem 0 .6rem; font-size: .82rem; color: #5a6a7c; }
.casc__off { margin: .3rem 0; padding: .3rem .55rem; border-left: 2px solid #eab308; font-size: .8rem; color: #8a5a00; background: #fdf9e7; }

.casc__fields th, .casc__fields td { border-bottom: none; vertical-align: baseline; }
.casc__cell-label { display: block; }
.casc__row-value, .casc__row-pct { color: #16324f; font-weight: 600; }
.casc__row-why td { padding-top: 0; border-bottom: 1px solid #eef1f5; }

.casc__why summary { cursor: pointer; list-style: none; font-size: .78rem; }
.casc__why summary::-webkit-details-marker { display: none; }
.casc__why-item { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .3rem; margin-right: .9rem; }
.casc__why-perturb { color: #64748b; }
.casc__delta { font-variant-numeric: tabular-nums; }
.casc__delta--up { color: #922; }
.casc__delta--down { color: #17632a; }
.casc__delta--flat, .casc__delta--broken { color: #8a5a00; }

.casc__phase-bar { display: block; width: 100%; margin: .5rem 0 .35rem; border-radius: .15rem; overflow: hidden; }
.chart__seg--a, .chart__seg--now { fill: #16324f; }
.chart__seg--b { fill: #4b7ba8; }
.chart__seg--past { fill: #b9c6d6; }
.chart__seg--rest { fill: #e8edf3; }

.casc__out { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .3rem 0; font-size: .82rem; }
.casc__out-item b { font-weight: 600; }
.casc__edges { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem; margin: .3rem 0; }
.casc__edge { display: inline-flex; align-items: baseline; gap: .25rem; padding: .1rem .45rem; border: 1px solid #cbd5e1; border-radius: 1rem; font-size: .74rem; text-decoration: none; color: #16324f; background: #fff; }
.casc__edge:hover { border-color: #16324f; }
.casc__edge-target { font-weight: 700; }

@media (max-width: 640px) {
  .casc__rail-steps { gap: .3rem; }
  .casc__rail-step { flex: 0 0 6.5rem; }
  .casc__phase-src { margin-left: 0; width: 100%; }
  .casc__fields, .casc__fields tbody, .casc__fields tr, .casc__fields th, .casc__fields td { display: block; width: 100%; }
  .casc__fields td { text-align: left; padding: .2rem 0; }
  .casc__fields .num { text-align: left; }
  .casc__row-value, .casc__row-pct { display: inline-block; width: auto; margin-right: .8rem; }
}

/* --- Simulador de impresión ---------------------------------------------- */
/* Mismo registro que la cascada: cifras tabulares, micro-etiquetas en
   mayúscula, reglas de 1px, dos tonos sobre el #16324f de la topbar. Lo que
   cambia es que acá el protagonista es el dibujo: los SVG traen el viewBox en
   milímetros reales, así que el CSS solo los deja respirar — nunca los escala
   con transform, que rompería la proporción que se está revisando. */
.press__specimen { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 1rem 0 2rem; padding: .9rem 1.1rem; border: 1px solid #e2e6ec; border-radius: .4rem; background: #fff; }
.press__specimen-id h2 { margin: 0; font-size: 1.05rem; }
.press__dims { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; margin: 0; }
.press__dims dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
.press__dims dd { margin: 0; font-size: .95rem; font-weight: 600; color: #16324f; font-variant-numeric: tabular-nums; }

.press__block { margin: 2.2rem 0; padding-top: .9rem; border-top: 1px solid #d8dee7; }
.press__head h2 { margin: 0; font-size: .95rem; }
.press__head .card__meta { margin: .15rem 0 .9rem; font-size: .8rem; color: #5a6a7c; }

/* El escenario del dibujo: fondo neutro para que el film claro no se pierda. */
.press__stage { padding: 1.2rem 1rem; border-radius: .4rem; background: #f8fafc; border: 1px solid #eef1f5; overflow-x: auto; }
.press__stage--wide { padding: .9rem 1rem; }
.press__web, .press__cylinder { display: block; width: 100%; height: auto; overflow: visible; }
.press__dim { font-size: 13px; fill: #475569; font-variant-numeric: tabular-nums; }
.press__rep-num { font-size: 26px; fill: #64748b; font-variant-numeric: tabular-nums; }

.press__caption { margin: .6rem 0 0; font-size: .82rem; color: #5a6a7c; }
.press__caption b { color: #16324f; }
.press__legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: .6rem 0 0; padding: 0; list-style: none; font-size: .78rem; color: #5a6a7c; }
.press__legend li { display: inline-flex; align-items: center; gap: .35rem; }
.press__chip { display: inline-block; width: .85rem; height: .85rem; border-radius: .15rem; border: 1px solid #94a3b8; }
.press__chip--face { background: #fff; }
.press__chip--gusset { background: #dbeafe; border-color: #2563eb; }
.press__chip--knife { width: 0; height: 1rem; border: 0; border-left: 2px dashed #dc2626; border-radius: 0; }
.press__chip--refile { background: #fecaca; border-color: #dc2626; }
.press__chip--accessory { background: #ede9fe; border-color: #7c3aed; }

/* Los cuatro números que hay que poder leer de un vistazo en la reunión. */
.press__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; margin: 1rem 0 0; }
.press__fact { padding: .55rem .7rem; border-radius: .35rem; background: #f8fafc; border-left: 3px solid #cbd5e1; }
.press__fact span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
.press__fact b { display: block; font-size: 1.25rem; font-weight: 600; color: #16324f; font-variant-numeric: tabular-nums; }
.press__fact small { display: block; font-size: .74rem; color: #64748b; }
.press__fact--strong { border-left-color: #16324f; }
.press__fact--warn { border-left-color: #dc2626; }
.press__fact--warn b { color: #922; }

.press__editable { margin-top: 1rem; }
.press__editable td, .press__editable th { vertical-align: baseline; }
.press__note { white-space: normal; font-size: .78rem; color: #5a6a7c; }

/* La línea: una tarjeta por estación, en el orden en que corre el material. */
.press__line { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .7rem; margin: 0; padding: 0; list-style: none; }
.press__station { position: relative; display: flex; flex-direction: column; gap: .4rem; padding: .8rem .9rem; border: 1px solid #e2e6ec; border-radius: .4rem; background: #fff; }
.press__station h3 { margin: 0; font-size: .88rem; }
.press__station .card__meta { margin: 0; font-size: .78rem; color: #5a6a7c; }
.press__station-num { position: absolute; top: .5rem; right: .7rem; font-size: .8rem; font-weight: 700; color: #cbd5e1; }
.press__station-cost { margin-top: auto; padding-top: .4rem; border-top: 1px solid #eef1f5; font-size: .85rem; font-weight: 600; color: #16324f; font-variant-numeric: tabular-nums; }
.press__station--ink { border-color: #cbd5e1; }
.press__station--off { background: #f8fafc; color: #94a3b8; }
.press__station--off h3, .press__station--off .press__station-cost { color: #94a3b8; }

.press__inks { display: flex; flex-wrap: wrap; gap: .5rem; }
.press__ink-body { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.press__ink-body small { font-size: .68rem; color: #64748b; }
.press__ink { display: block; }
.press__ink-label { font-size: 11px; font-weight: 700; fill: #fff; }
.press__ink-label--dark { fill: #334155; }

.press__layers, .press__passes, .press__knives, .press__accessories { display: flex; flex-wrap: wrap; gap: .35rem; }
.press__layer, .press__pass, .press__knife, .press__acc { display: inline-flex; align-items: baseline; gap: .3rem; padding: .12rem .5rem; border: 1px solid #cbd5e1; border-radius: 1rem; font-size: .75rem; color: #16324f; background: #fff; }
.press__layer small { font-size: .68rem; color: #64748b; }
.press__knife { border-color: #fca5a5; color: #922; font-variant-numeric: tabular-nums; }
.press__pass { border-color: #bfdbfe; color: #1e40af; }

@media (max-width: 640px) {
  .press__specimen { flex-direction: column; align-items: flex-start; }
  .press__dims { gap: .3rem 1rem; }
  .press__stage { padding: 1rem .5rem; }
  .press__line { grid-template-columns: 1fr; }
}

/* --- Simulador: el escenario editable ------------------------------------ */
/* El formulario vive FUERA del turbo-frame del dibujo: se re-simula sin que el
   gerente pierda el campo que está moviendo. Por eso puede verse como un
   panel de control fijo y no como parte del contenido. */
.sim__form { margin: 1rem 0 .8rem; padding: .9rem 1.1rem; border: 1px solid #cbd5e1; border-radius: .4rem; background: #fff; }
.sim__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .7rem 1rem; }
.sim__form .field { margin: 0; }
.sim__form label { display: block; margin-bottom: .15rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; font-weight: 600; }
.sim__control { width: 100%; padding: .35rem .5rem; border: 1px solid #cbd5e1; border-radius: .25rem; font: inherit; font-size: .9rem; background: #fff; }
.sim__control:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px #bfdbfe; }
.sim__control--num { text-align: right; font-variant-numeric: tabular-nums; }

.sim__accessories { margin: .8rem 0 0; padding: .5rem .7rem; border: 1px solid #e2e6ec; border-radius: .3rem; }
.sim__accessories legend { padding: 0 .3rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; font-weight: 600; }
.sim__check { display: inline-flex; align-items: center; gap: .3rem; margin-right: .9rem; font-size: .85rem; text-transform: none; letter-spacing: 0; color: #1a2330; font-weight: 400; }
.sim__check input { margin: 0; }

.sim__actions { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; }

.sim__state { margin: 0 0 1rem; padding: .5rem .9rem; border-radius: .35rem; font-size: .84rem; }
.sim__state--golden { background: #e2f4e5; color: #17632a; }
.sim__state--custom { background: #fdf1dc; color: #8a5a00; }
.sim__state a { color: inherit; }
.sim__rejected { margin: -.6rem 0 1rem; padding: .45rem .9rem; border-radius: .35rem; font-size: .82rem; background: #fbe4e4; color: #922; }

/* El cierre del ruteo: la spec de arriba llega hasta acá. */
.sim__prices { margin-top: 1.4rem; }
.sim__tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; }
.sim__tier { padding: .55rem .7rem; border-radius: .35rem; background: #16324f; color: #fff; }
.sim__tier span { display: block; font-size: .72rem; letter-spacing: .03em; color: #b9c6d6; }
.sim__tier b { display: block; font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sim__tier small { display: block; font-size: .72rem; color: #b9c6d6; }

@media (max-width: 640px) {
  .sim__grid { grid-template-columns: 1fr; }
  .sim__tiers { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
}

/* --- Cotizador: precio en vivo ------------------------------------------- */
/* El vendedor cotiza en el celular: el precio queda pegado abajo para verlo
   sin dejar de escribir. .live--stale lo apaga mientras viaja el recálculo —
   un número atenuado se lee como "esto todavía no es el final". */
.live { position: sticky; bottom: 0; z-index: 6; margin: .6rem 0 1.2rem; padding: .7rem .9rem; border: 1px solid #16324f; border-radius: .5rem; background: #16324f; color: #fff; box-shadow: 0 -2px 10px rgb(0 0 0 / .12); transition: opacity .15s ease; }
.live--stale { opacity: .45; }
.live__empty { margin: 0; font-size: .85rem; color: #b9c6d6; }
.live__errors { font-size: .85rem; color: #fecaca; }
.live__errors ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.live__trigger { margin-bottom: .5rem; }
/* Con JavaScript el recálculo es automático y el controlador lo esconde; .btn
   fija display y le ganaría al atributo hidden. */
.live__trigger[hidden] { display: none; }

.live__tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .5rem; }
.live__tier { padding: .4rem .55rem; border-radius: .35rem; background: rgb(255 255 255 / .07); }
.live__qty { display: block; font-size: .72rem; letter-spacing: .03em; color: #b9c6d6; }
/* Con descuento de gerencia: el precio de lista tachado sobre el final. */
.live__list-price { display: block; font-size: .72rem; color: #b9c6d6; }
.live__price { display: block; font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.live__total, .live__meta { display: block; font-size: .72rem; color: #b9c6d6; font-variant-numeric: tabular-nums; }

.live__costs { margin-top: .6rem; }
.live__costs summary { cursor: pointer; font-size: .78rem; color: #b9c6d6; }
.live__costs .mdata { background: #fff; color: #1a2330; border-radius: .3rem; margin-top: .4rem; }

.live__meta-item { white-space: nowrap; }
@media (max-width: 640px) {
  .live__meta-item--meters { display: none; }
  /* Una sola fila que se desliza: con 10 cantidades, en filas el panel fijo
     tapaba medio formulario mientras se escribe. */
  .live__tiers { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(7.5rem, 1fr);
                 overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
  .live__tier { scroll-snap-align: start; }
  .live__price { font-size: 1.2rem; }
}

/* --- Panel comercial ------------------------------------------------------ */
/* Seis indicadores: de a dos en el teléfono, de a tres desde tablet. */
.metrics--six { margin-bottom: 1rem; }
@media (min-width: 640px) { .metrics--six { grid-template-columns: repeat(3, 1fr); } }
.metric small { display: block; color: #5a6a7c; font-size: .75rem; margin-top: .15rem; }
.metric--warn { border-left: 3px solid #ea580c; }

/* Franja del modo demostración del panel: tiene que ser imposible confundir
   los números inventados con los reales. */
.demo-bar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between;
            padding: .6rem .9rem; border-radius: .4rem; margin-bottom: 1rem; background: #eef1f5; color: #44536a; font-size: .9rem; }
.demo-bar--on { background: #fdf1dc; color: #8a5a00; border: 1px dashed #ea580c; }
.demo-bar form { margin: 0; }
/* En el teléfono, una línea: el aviso y el interruptor. Va DESPUÉS de .demo-bar,
   que con la misma especificidad le ganaba el flex-wrap (code review). */
@media (max-width: 639px) { .demo-bar__explain { display: none; } .demo-bar { flex-wrap: nowrap; } }

/* --- Diferencias con el Excel (gerencia) ---------------------------------- */
.xdiff-intro ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.xdiff-intro li { margin-bottom: .35rem; }
.xdiff-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1rem 0; }
@media (min-width: 640px) { .xdiff-summary { grid-template-columns: repeat(4, 1fr); } }
.xdiff-summary__item { display: block; padding: .6rem .75rem; border-radius: .45rem; background: #fff; border: 1px solid #e2e6ec; border-left-width: 4px; color: #1a2330; text-decoration: none; }
.xdiff-summary__item b { display: block; font-size: 1.4rem; }
.xdiff-summary__item span { font-size: .8rem; color: #5a6a7c; }
.xdiff-summary__item--precio, .xdiff--precio { border-left-color: #c2410c; }
.xdiff-summary__item--validacion, .xdiff--validacion { border-left-color: #16324f; }
.xdiff-summary__item--configurable, .xdiff--configurable { border-left-color: #3f7a1f; }
.xdiff-summary__item--datos, .xdiff--datos { border-left-color: #8a99ab; }
.xdiff { border-left-width: 4px; }
.xdiff__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .7rem; }
.xdiff__head h3 { margin: 0; font-size: 1rem; flex: 1 1 100%; }
@media (min-width: 640px) { .xdiff__head h3 { flex: 1 1 auto; } }
.xdiff__code { font-family: ui-monospace, monospace; font-size: .8rem; color: #16324f; }
.xdiff__state { background: #eceff3; color: #16324f; }
.xdiff__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem 1.2rem; margin: .8rem 0 .4rem; }
@media (min-width: 760px) { .xdiff__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.xdiff__grid dt { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5a6a7c; }
.xdiff__grid dd { margin: .2rem 0 0; }
.xdiff__grid dd p { margin: 0 0 .35rem; }
.xdiff__refs { word-break: break-word; }

/* --- Versiones de una cotización (ficha) ---------------------------------- */
.versions__list { list-style: none; margin: .4rem 0 1rem; padding: 0; border-left: 2px solid #e2e6ec; }
.versions__item { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; padding: .35rem 0 .35rem .8rem; position: relative; }
.versions__item::before { content: ""; position: absolute; left: -6px; top: .75rem; width: 10px; height: 10px; border-radius: 50%; background: #c4ccd6; }
.versions__item--current::before { background: #6CB33F; }
.versions__n { font-size: .78rem; font-weight: 700; color: #5a6a7c; min-width: 4.6rem; }

/* --- Descuentos y avisos (ADR-0006) --------------------------------------- */
.discount-ask { margin: .6rem 0; }
.discount-pending a { margin-left: .4rem; font-weight: 600; }
.discount-card { display: block; text-decoration: none; color: inherit; border-left: 4px solid #dc2626; }
.discount-card span { display: block; }
/* El pedido de descuento, un % por cantidad (ADR-0015). */
.discount-tiers { border: 0; padding: 0; margin: 0 0 .8rem; }
.discount-tiers legend { font-weight: 600; margin-bottom: .4rem; }
.discount-tiers input[type=number] { width: 7rem; }
.notif-list { list-style: none; margin: 1rem 0; padding: 0; }
.notif__form { margin: 0; }
button.notif { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.notif { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; padding: .7rem .9rem;
         margin-bottom: .5rem; border: 1px solid #e2e6ec; border-radius: .5rem; background: #fff; color: #1a2330; text-decoration: none; }
.notif--unread { border-left: 4px solid #dc2626; background: #fffafa; }
.notif--unread .notif__text { font-weight: 600; }
.discount-alert { border-left: 4px solid #dc2626; }
.discount-alert h2 { margin: 0 0 .4rem; display: flex; align-items: center; gap: .5rem; }
.discount-alert__count { position: static; box-shadow: none; }
.discount-alert ul { margin: 0; padding-left: 1.1rem; }

/* Paginador de las listas: páginas a la izquierda, rango y filas por página
   a la derecha; en el teléfono se apilan. */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: 1rem 0; }
.pager__pages { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.pager__link { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; height: 2.2rem;
        padding: 0 .6rem; border-radius: .5rem; border: 1px solid #d5dbe3; background: #fff; color: #334155;
        font-size: .85rem; text-decoration: none; }
.pager__link:hover { border-color: #16324f; }
.pager__link--current { background: #16324f; border-color: #16324f; color: #fff; font-weight: 600; }
.pager__gap { color: #5a6a7c; padding: 0 .2rem; }
.pager__range { margin: 0; color: #5a6a7c; font-size: .85rem; }
.pager__size { display: flex; align-items: center; gap: .4rem; margin: 0; }
.pager__size label { margin: 0; font-weight: 400; font-size: .85rem; color: #5a6a7c; }
form.pager__size select { width: auto; margin: 0; }

/* Botones seguidos (gerencia, 2026-10-06: se veían pegados y en columna).
   button_to envuelve cada botón en su propio <form class="button_to">, que es
   de bloque: se lo deja en línea, como los enlaces con .btn, y todos llevan
   un respiro que también separa las filas cuando no caben en una. */
form.button_to { display: inline-block; margin: 0; vertical-align: middle; }
:is(a.btn, button.btn, input.btn, form.button_to) { margin: .15rem .35rem .15rem 0; vertical-align: middle; }
form.button_to .btn { margin: 0; }
/* Cerrar sesión en el menú del teléfono y el del usuario: botón a todo el ancho. */
:is(.drawer, .usermenu) form.button_to { display: block; margin: 0; }
/* Donde el contenedor ya separa con gap (flex), el margen sobra. */
:is(.pdf-cta, .page-head, .actions, .draft-banner__actions, .sim__actions) > :is(.btn, form.button_to) { margin: 0; }

/* Filas que se abren con un click en cualquier parte (row-link). */
[data-controller~="row-link"] { cursor: pointer; }
tr[data-controller~="row-link"]:hover td { background: #f1f5f9; }
.card[data-controller~="row-link"]:hover { border-color: #16324f; }

/* Encabezado que ordena la columna (catálogo de clientes de gerencia). */
.th-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.th-sort:hover { text-decoration: underline; }
.th-sort span { font-size: .75em; color: #5a6a7c; }

/* Lista de cotizaciones: filtros de gerencia (vendedor y fechas) y el aviso
   de las pendientes que vencen en 3 días o menos. */
.list-filters__more { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .6rem; min-width: 0; max-width: 100%; }
.list-filters__more .field { margin: 0; min-width: 10rem; max-width: 100%; }
.list-filters__more select { max-width: 100%; }
.badge--warn { background: #fdf1dc; color: #8a5a00; white-space: nowrap; }

/* Qué hace cada botón de la ficha, e historial como lista sin viñetas. */
.action-hints { margin: .4rem 0 0; padding-left: 1.1rem; }
.action-hints li { margin: .15rem 0; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { margin: .3rem 0; }

/* Tramos cotizados en el teléfono: una tarjeta por cantidad, el rótulo a la
   izquierda y el valor a la derecha, sin tabla que se corte de lado. */
@media (max-width: 40rem) {
  .tiers-table { background: none; }
  .tiers-table thead { display: none; }
  .tiers-table, .tiers-table tbody, .tiers-table tr, .tiers-table td { display: block; width: 100%; }
  .tiers-table tr { background: #fff; border: 1px solid #e2e8f0; border-radius: .6rem; padding: .5rem .8rem; margin-bottom: .6rem; }
  .tiers-table td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .2rem 0; }
  .tiers-table td::before { content: attr(data-label); color: #5a6a7c; font-weight: 600; text-align: left; }
  .tiers-table td:first-child { font-size: 1.05rem; font-weight: 700; border-bottom: 1px solid #eef2f6; padding-bottom: .4rem; margin-bottom: .2rem; }
}
@media (max-width: 40rem) { .table-wrap:has(> .tiers-table) { overflow: visible; } }

/* Precio en vivo + guardar, pegados abajo juntos (el precio ya no se pega
   solo: lo lleva la barra). */
.qform__bar { position: sticky; bottom: 0; z-index: 6; padding-bottom: .5rem;
  background: linear-gradient(to bottom, transparent, #f5f6f8 1.2rem); }
.qform__bar .live { position: static; margin: .6rem 0 .5rem; }
.qform__save { display: block; width: 100%; }
/* Con la barra pegada abajo, el campo que toma el foco no queda tapado. */
html:has(.qform__bar) { scroll-padding-bottom: 12rem; }
@media (min-width: 40rem) { .qform__save { display: inline-block; width: auto; } }

/* Accesorios del cotizador como chips: el checkbox queda (accesible) pero
   no se ve; el chip marcado toma el color del chip elegido. */
.qform__accessories { border: 0; padding: 0; margin: 0 0 .9rem; }
.qform__accessories legend { font-size: .85rem; font-weight: 600; margin-bottom: .35rem; padding: 0; }
.chips--wrap { flex-wrap: wrap; overflow: visible; }
.chip--check { position: relative; cursor: pointer; user-select: none; }
.chip--check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip--check:has(input:checked) { background: #16324f; border-color: #16324f; color: #fff; font-weight: 600; }
.chip--check:has(input:checked)::before { content: "✓"; }
.chip--check:has(input:focus-visible) { outline: 2px solid #6cb33e; outline-offset: 2px; }

/* Razón social larga en las tablas (lista, fichas, panel): la celda se recorta
   con puntos suspensivos y el nombre entero va en title; sin esto una de 100
   letras corría Total y Vendedor fuera de la pantalla. */
td.client, td.application { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Listados de cotizaciones (lista, ficha del cliente, panel): entran en el
   ancho de la página sin scroll horizontal (gerencia, 2026-10-16). Los
   encabezados y el rango de totales parten en dos líneas; cliente, aplicación
   y vendedor se cortan con "…" y se leen enteros al pasar el mouse. */
.table-wrap--fit th, .table-wrap--fit .th-sort { white-space: normal; }
.table-wrap--fit td.client, .table-wrap--fit td.application { max-width: 18ch; }
.table-wrap--fit td.seller { max-width: 13ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap--fit td.range { white-space: normal; min-width: 9ch; }
/* En pantallas angostas (un notebook chico, una tableta, un teléfono) todas
   las tablas van más juntas: es lo que les falta para entrar. */
@media (max-width: 68rem) {
  th, td { padding: .4rem .4rem; font-size: .85rem; }
  th { font-size: .74rem; letter-spacing: 0; }
  .shell .table-wrap--fit td.client, .shell .table-wrap--fit td.application { max-width: 12ch; }
}
/* La tabla que no cabe ni bajando el texto de línea pasa a tarjetas: cada fila
   una tarjeta, cada celda con el nombre de su columna al lado (lo pone
   table_stack.js, que también decide cuándo, midiendo). Es el mismo formato
   que ya tenían los tramos de la cotización en el teléfono. */
.table-wrap:has(> .table-stack), .table-wrap:has(.table-stack) { overflow-x: visible; }
.table-wrap table.table-stack { display: block; background: none; }
.table-wrap table.table-stack thead { display: none; }
.table-wrap table.table-stack caption, .table-wrap table.table-stack tbody, .table-wrap table.table-stack tfoot, .table-wrap table.table-stack tr { display: block; }
.table-wrap table.table-stack tr { background: #fff; border: 1px solid #e2e8f0; border-radius: .6rem; padding: .35rem .8rem; margin-bottom: .6rem; }
.table-wrap table.table-stack tr[hidden] { display: none; }
.table-wrap table.table-stack td, .table-wrap table.table-stack tbody th, .table-wrap table.table-stack tfoot th {
  display: block; width: auto; max-width: none; min-width: 0; overflow: hidden; border: 0; border-bottom: 1px solid #eef2f6;
  padding: .3rem 0; text-align: right; white-space: normal; position: static; background: none; }
.table-wrap table.table-stack tr > :last-child { border-bottom: 0; }
.table-wrap table.table-stack td:empty, .table-wrap table.table-stack td[data-empty] { display: none; }
.table-wrap table.table-stack td[data-label]::before { content: attr(data-label); float: left; max-width: 45%; margin-right: .8rem; text-align: left;
  color: #5a6a7c; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; line-height: 1.5; }
/* Sin rótulo (los botones de la fila, un título que abarca la fila): a la izquierda, a todo el ancho. */
.table-wrap table.table-stack td:not([data-label]), .table-wrap table.table-stack tbody th { text-align: left; }
.table-wrap table.table-stack tbody th { font-weight: 700; font-size: .95rem; text-transform: none; letter-spacing: 0; color: inherit; }
.table-wrap table.table-stack td .btn, .table-wrap table.table-stack td form { margin: .1rem 0; }
.table-wrap table.table-stack input:not([type=checkbox]):not([type=radio]), .table-wrap table.table-stack select { max-width: 60%; }
/* Una lista con muchas columnas (Formatos tiene trece): celdas más juntas y
   letra un punto más chica, para que entre sin correrse de lado. */
.table-wrap--dense th, .table-wrap--dense td { padding: .45rem .35rem; font-size: .84rem; }
.table-wrap--dense th { font-size: .7rem; letter-spacing: 0; }
/* "Usar <cliente>" dentro del bloque de error del diálogo, separado del texto. */
.errors .btn { margin-top: .5rem; }
/* Objetivos táctiles de 44px (2.75rem) en pantallas táctiles: enlaces-botón,
   botones chicos, «← Volver», paginador, «+ Nuevo cliente/contacto» y el
   desplegable de precios de referencia. Con puntero fino (computador) nada
   cambia: los botones chicos de las tablas siguen iguales. */
@media (pointer: coarse) {
  .linklike, .btn--small, .backlink, .pager__link, .picker__head .linklike {
    min-height: 2.75rem; display: inline-flex; align-items: center;
  }
  /* El summary sigue siendo list-item: con inline-flex perdería el triángulo. */
  .qform__optional summary { min-height: 2.75rem; padding: .6rem 0; box-sizing: border-box; }
}
/* Chip de cantidad ya cargada: se ve apretado y tocarlo de nuevo no duplica. */
.chip--button[aria-pressed="true"] { background: #16324f; border-color: #16324f; border-style: solid; color: #fff; font-weight: 600; }
/* Productos recientes: el chip se encoge al ancho del teléfono en vez de desbordar. */
.chip--product { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
/* Los diseños de la ficha técnica: un nombre largo baja de línea dentro de su chip. */
.tsheet-designs .chip { flex: 0 1 auto; max-width: 100%; white-space: normal; }
/* «Editar nombres» en datos maestros va sobre fondo claro: el color de .linklike
   (pensado para la barra oscura) no se leía (1.2:1). */
.mdata__head .linklike { color: #16324f; text-decoration: underline; }

/* --- Solicitud por precio objetivo (2026-10-15) ---------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
form input.input--price { width: 7.5rem; text-align: right; }
/* El % a aprobar por cantidad (ADR-0015): "12,25" entra. */
form input.input--pct { width: 5rem; text-align: right; }
td.negative { color: #922; font-weight: 600; }
.target-price-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }

/* --- Ficha técnica (2026-10-15) --------------------------------------------- */
.tsheet-form textarea { min-height: 6rem; }
.tsheet-field__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tsheet-field__action { border: none; background: none; color: #5a6a7c; font-size: .8rem; cursor: pointer; padding: .1rem .3rem; border-radius: .3rem; }
.tsheet-field__action:hover, .tsheet-field__action:focus-visible { background: #eceff3; color: #16324f; }
.tsheet-field--removed input, .tsheet-field--removed textarea { background: #f5f6f8; border-style: dashed; }
.tsheet-extra { display: grid; grid-template-columns: 1fr 2fr auto; gap: .5rem; align-items: end; margin-bottom: .5rem; }
.tsheet-extra .field { margin-bottom: 0; }
.tsheet-extra-section .tsheet-remove { margin-top: .25rem; }
@media (max-width: 40rem) { .tsheet-extra { grid-template-columns: 1fr; } }

/* Gráficos de Chart.js (ADR-0014): el alto va por clase, no como style inline
   (CSP, S7). Chart.js llena la caja con maintainAspectRatio: false. */
.chart-box { position: relative; height: 220px; }
.chart-box--donut { height: 280px; } /* la leyenda va dentro del lienzo */
.chart-box--ranking { height: 200px; } /* solo hasta que el controlador lo ajusta a los vendedores */

/* --- Tablero del negocio (Manager::BusinessController) --------------------- */
.business__intro { margin: -.25rem 0 1rem; max-width: 60rem; }
.business__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; }
.business__filter { display: flex; align-items: center; gap: .5rem; margin: 0; }
.business__filter label { margin: 0; font-weight: 600; font-size: .85rem; }
.business__filter select { width: auto; min-width: 12rem; max-width: 100%; }
.business__filter { max-width: 100%; }
.business__kpis { grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); margin-bottom: 1.5rem; }
.business__kpis .metric b { font-size: 1.25rem; overflow-wrap: anywhere; }
.business__kpis .metric small { display: block; color: #5a6a7c; font-size: .75rem; margin-top: .2rem; }
.business__section { margin-bottom: 1.5rem; }
.business__section > h2 { font-size: 1.15rem; margin: 0 0 .6rem; padding-bottom: .3rem; border-bottom: 2px solid #e2e8f0; }
.business__card h3 { margin: 0 0 .2rem; font-size: 1rem; }
.business__card .card__meta { margin: 0 0 .6rem; font-size: .8rem; }
/* Los gráficos con muchas categorías o con línea de tendencia ocupan dos columnas. */
@media (min-width: 900px) { .business__card--wide { grid-column: span 2; } }
.chart-box--chart { height: 240px; }

/* Ficha de cliente (gerencia, 2026-10-23): el formulario en grupos, el
   listado en cuadrícula con sus acciones y la ficha con sus datos. */
.client-form__group { border: 1px solid #e2e6ec; border-radius: .5rem; padding: .6rem .9rem .3rem; margin: 0 0 1rem; background: #fff; }
.client-form__group legend { font-weight: 600; padding: 0 .3rem; }
.required { color: #b91c1c; }
.hidden-form { display: none; }
.clients__filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.clients__filter select { max-width: 18rem; }
.clients-table__actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.clients-table td.client { font-weight: 600; }
.client-profile__data { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .5rem 1.2rem; margin: 0 0 .6rem; }
.client-profile__data dt { font-size: .75rem; color: #5a6a7c; }
.client-profile__data dd { margin: 0; }
.client-profile__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 0; }
.assignment-resolve { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin-top: .5rem; }
.assignment-resolve .field { flex: 1 1 14rem; margin: 0; }
/* Solo para lectores de pantalla: el encabezado de la columna de acciones. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Novedades: el changelog leído en la app */
.release-notes { max-width: 52rem; }
.release-notes h2 { margin-top: 1.6rem; border-top: 1px solid #e2e6ec; padding-top: 1rem; }
.release-notes h2 small { font-weight: 400; color: #5a6a7c; margin-left: .5rem; }
.release-notes h3 { font-size: .95rem; margin: .9rem 0 .3rem; color: #5a6a7c; text-transform: uppercase; letter-spacing: .03em; }
.release-notes li { margin-bottom: .35rem; }
.release-notes__current { color: #5a6a7c; }
.welcome .sheet__body { max-width: 34rem; }
.welcome__intro { margin: .2rem 0 .8rem; line-height: 1.5; }
.welcome__items { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.welcome__items li { position: relative; padding-left: 1.1rem; line-height: 1.45; }
.welcome__items li::before { content: ""; position: absolute; left: .1rem; top: .55em; width: .45rem; height: .45rem; border-radius: 50%; background: #16324f; }
.welcome__items strong { display: block; margin-bottom: .1rem; }
.welcome__items span { display: block; color: #475569; }
.welcome__items strong + span::first-letter { text-transform: uppercase; }
.welcome__actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }

/* Confirmaciones (shared/_confirm_dialog): reemplaza el confirm() del
   navegador. La advertencia (todo retroceso de estado) va en ámbar, con el
   título que lo dice. */
.confirm { border: 0; border-radius: .75rem; padding: 1.25rem 1.25rem 1rem; width: min(30rem, calc(100vw - 2rem));
           box-shadow: 0 12px 32px rgba(15, 23, 42, .25); border-top: .4rem solid #16324f; }
.confirm::backdrop { background: rgba(15, 23, 42, .45); }
.confirm__title { margin: 0 0 .6rem; font-size: 1.1rem; }
.confirm__message { margin: 0 0 1.1rem; white-space: pre-line; line-height: 1.45; }
.confirm__actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.confirm--warning { border-top-color: #d97706; }
.confirm--warning .confirm__title { color: #8a5a00; }
.confirm--warning .confirm__title::before { content: "⚠ "; }
.confirm--warning .confirm__ok { background: #b45309; }

/* El ▾ del estado en la lista (quotations/_status_menu): aparece al pasar el
   cursor en el computador; en el teléfono se ve siempre. */
/* Sin scroll propio, para que los menús no queden recortados; entre teléfono
   y escritorio la Aplicación (que está en el detalle rápido) cede su lugar
   para que la tabla quepa. */
.qtable.table-wrap { overflow: visible; }
@media (max-width: 64rem) { .qtable th.application, .qtable td.application { display: none; } }
.status-menu { position: relative; display: inline-block; }
.status-menu summary, .bulk-actions summary { list-style: none; }
.status-menu summary::-webkit-details-marker, .bulk-actions summary::-webkit-details-marker { display: none; }
.status-menu summary { cursor: pointer; display: inline-flex; align-items: center; gap: .15rem; border-radius: 1rem; }
.status-menu summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.status-menu__caret { font-size: .8rem; color: #16324f; width: .9rem; text-align: center; }
@media (hover: hover) {
  .status-menu__caret { visibility: hidden; }
  tr:hover .status-menu__caret, .status-menu:hover .status-menu__caret, .status-menu[open] .status-menu__caret,
  .status-menu summary:focus-visible .status-menu__caret { visibility: visible; }
  .status-menu summary:hover .badge { box-shadow: 0 0 0 2px #16324f33; }
}
.status-menu__list, .bulk-actions__list { position: absolute; z-index: 20; top: calc(100% + .3rem); left: 0; min-width: 12rem;
        padding: .4rem; background: #fff; border: 1px solid #d5dbe3; border-radius: .5rem; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.status-menu__title { margin: .1rem .4rem .35rem; font-size: .75rem; color: #5a6a7c; text-transform: uppercase; letter-spacing: .03em; }
.status-menu__list form { margin: 0; }
.status-menu__option { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%;
        padding: .45rem .4rem; border: 0; border-radius: .35rem; background: none; cursor: pointer; text-align: left; font: inherit; }
.status-menu__option:hover, .status-menu__option:focus-visible { background: #f1f5f9; }
.status-menu__option small { color: #b45309; font-size: .75rem; }
.status-menu__option--forward small { color: #5a6a7c; }
a.status-menu__option { text-decoration: none; color: inherit; }
/* El diálogo de tramos (ADR-0024): un radio por tramo, como una lista. */
.accept-dialog__tiers { border: 0; padding: 0; margin: .6rem 0; display: grid; gap: .4rem; }
.accept-dialog__option { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid #e2e8f0; border-radius: .5rem; cursor: pointer; }
.accept-dialog__option:has(input:checked) { border-color: #17632a; background: #e2f4e5; }
.tiers-table__row--accepted td:first-child { font-weight: 700; }
.tiers-table__accepted { margin-left: .5rem; vertical-align: middle; }
.order-block .btn { margin-top: .5rem; }
/* Documentos de la orden: fichas con ícono y la marca PDF, para que se entienda que se descargan. */
.op-docs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; margin: .8rem 0; }
.op-docs--step { margin: .7rem 0 .2rem; padding-top: .6rem; border-top: 1px dashed #e2e8f0; }
.op-docs__title { font-weight: 600; color: #16324f; margin-right: .2rem; }
/* En la hoja: una fila por tipo de documento, con su rótulo a la izquierda. */
.op-docs--grouped { display: block; }
.op-docs--grouped .op-docs__title { font-size: 1rem; margin: 0 0 .5rem; }
.op-docs__groups { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; align-items: center; margin: 0; }
.op-docs__groups dt { color: #64748b; font-size: .9rem; }
.op-docs__groups dd { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
@media (max-width: 640px) { .op-docs__groups { grid-template-columns: 1fr; gap: .2rem; } .op-docs__groups dd { margin-bottom: .5rem; } }
.op-docs--step .op-docs__title { font-weight: 400; color: #64748b; font-size: .9rem; }
.op-doc { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .7rem; border: 1px solid #cbd5e1; border-radius: .6rem;
  background: #fff; color: #16324f; text-decoration: none; font-weight: 600; max-width: 100%; }
.op-doc:hover, .op-doc:focus-visible { border-color: #3d7a1e; background: #f0f7ec; }
.op-doc__icon { flex: none; color: #3d7a1e; }
.op-doc__name { overflow-wrap: anywhere; }
.op-doc__type { flex: none; font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: #fff; background: #b91c1c; border-radius: .25rem; padding: .05rem .3rem; }
/* Los tramos en el paso Cotización de la orden: una tabla chica; el aceptado, en verde. */
.tiers-summary { width: auto; min-width: min(100%, 28rem); margin: .2rem 0 .8rem; }
.tiers-summary caption { text-align: left; color: #64748b; padding-bottom: .3rem; }
.tiers-summary th, .tiers-summary td { padding: .35rem .7rem; white-space: nowrap; }
.tiers-summary__row--accepted td { background: #e2f4e5; font-weight: 600; }
.wo-guide__others { margin: 0; padding-left: 1rem; }
.wo-guide__missing { color: #9a3412; font-size: 1.05rem; }
.wo-available { display: block; margin: -.3rem 0 .6rem; }
/* El recuadro del lote (ADR-0025): una fila por diseño con nombre y cantidad. */
.batch-form { margin-top: .8rem; padding: .8rem 1rem; border: 1px solid #e2e8f0; border-radius: .5rem; background: #f8fafc; flex-basis: 100%; }
.batch-form__title { margin: 0 0 .3rem; font-size: 1rem; }
.batch-form__rows { display: grid; gap: .4rem; margin: .6rem 0; }
.batch-form__row { display: grid; grid-template-columns: 5.5rem minmax(10rem, 1fr) 9rem; gap: .5rem; align-items: center; }
.batch-form__design { color: #64748b; font-weight: 600; }
.batch-form__row input { width: 100%; }
.batch-form__sum { font-weight: 700; margin: .2rem 0 .6rem; }
.batch-form__sum--ok { color: #17632a; }
.batch-form__sum--off { color: #9a3412; }
.sum-confirm-dialog__rows { margin: .4rem 0 .8rem; padding-left: 1.1rem; }
/* Cada bloque (pedido, enviado, cada etapa) separado por una línea, con su título. */
.recalculate { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: .8rem 0 0; }
.batch-result__section { border-top: 2px solid #94a3b8; }
.batch-result__title { background: #eef2f7; color: #16324f; text-align: left; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
.batch-result tbody th[scope=row] { font-weight: 400; text-align: left; white-space: normal; text-transform: none; letter-spacing: 0; font-size: .9rem; background: transparent; color: inherit; }
.batch-result__expected th[scope=row], .batch-result__expected td { color: #1e5aa8; background: #f5f9ff; }
.batch-result td.batch-result__negative { color: #b42318; font-weight: 600; }
.batch-result__funnel-title { margin: 1.4rem 0 .2rem; font-size: 1rem; color: #16324f; }
.batch-result__funnel tbody th[scope=row] { font-weight: 600; }
.batch-result td.batch-result__ok { color: #17632a; font-weight: 700; white-space: normal; }
.batch-result td.batch-result__over { color: #b42318; font-weight: 700; white-space: normal; }
.batch-result__funnel-total th, .batch-result__funnel-total td { border-top: 2px solid #94a3b8; background: #eef2f7; font-weight: 700; }
.batch-result__difference th[scope=row], .batch-result__difference td { color: #475569; font-style: italic; background: #fafbfc; }
.batch-result thead th { white-space: normal; vertical-align: bottom; }
@media (max-width: 640px) { .batch-form__row { grid-template-columns: 1fr; } }
/* El artículo de cada diseño en el recuadro del lote (ADR-0029): ocupa toda la
   fila, bajo el nombre y la cantidad, con la misma primera columna. */
.batch-form__article { grid-column: 1 / -1; display: grid; grid-template-columns: 5.5rem minmax(9rem, .8fr) minmax(12rem, 1.4fr); gap: .5rem; align-items: center; margin-bottom: .5rem; }
.batch-form__article label { color: #64748b; font-size: .85rem; }
.batch-form__article select { width: 100%; min-width: 0; }
@media (max-width: 640px) { .batch-form__article { grid-template-columns: 1fr; } }
/* El modal del artículo de una OT: más ancho que los demás; el nombre envuelve y
   "Usar" queda siempre a la vista. En el teléfono cada artículo es una tarjeta. */
.bulk-dialog.article-dialog { width: min(48rem, calc(100vw - 2rem)); }
.article-dialog .list-filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.article-dialog .list-filters input[type=search] { flex: 1; min-width: 10rem; }
.article-options th, .article-options td { white-space: normal; vertical-align: top; }
.article-options td:first-child, .article-options td:last-child, .article-options .badge { white-space: nowrap; }
.article-options td:last-child { text-align: right; }
@media (max-width: 640px) {
  .article-options thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .article-options tr { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; padding: .5rem 0; border-bottom: 1px solid #e2e6ec; }
  .article-options td { border: 0; padding: 0; }
  .article-options td:nth-child(1) { font-weight: 600; }
  .article-options td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .article-options td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; color: #64748b; font-size: .82rem; }
  .article-options td:nth-child(4) { grid-column: 2; grid-row: 1; }
}
.quantity-dialog__source { margin-top: .4rem; }
.quantity-dialog__row input { width: 10rem; }
.quantity-dialog__over { color: #b91c1c; }
.quantity-dialog__warning { margin: .2rem 0; }
.sum-confirm { display: flex; gap: .5rem; align-items: flex-start; margin: .4rem 0 .8rem; font-weight: 600; }
.qcards li { position: relative; }
.qcard__status { position: absolute; top: .75rem; right: 1rem; }
.qcard__status .status-menu__list { left: auto; right: 0; }

/* Cambio de estado masivo (quotations/_bulk_status_dialog): solo computador. */
.bulk-bar { display: none; }
@media (min-width: 45rem) {
  .bulk-bar { display: flex; align-items: center; gap: .8rem; margin: 0 0 .5rem; }
}
.bulk-bar__hint { color: #5a6a7c; font-size: .85rem; }
.bulk-actions { position: relative; }
.bulk-actions summary::after { content: " ▾"; }
.bulk-actions--empty summary { opacity: .55; cursor: not-allowed; }
.qtable th.select, .qtable td.select { width: 2rem; text-align: center; }
.qtable td.select input, .qtable th.select input { width: 1.05rem; height: 1.05rem; cursor: pointer; }
.bulk-dialog { border: 0; border-radius: .75rem; padding: 0; margin: auto; max-height: 90vh; width: min(36rem, calc(100vw - 2rem));
        box-shadow: 0 12px 32px rgba(15, 23, 42, .25); }
.bulk-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.bulk-dialog__body { padding: 1.1rem 1.25rem 1rem; }
.bulk-dialog .field select { width: 100%; }
.bulk-dialog__selected { margin: .8rem 0 .3rem; font-weight: 600; font-size: .9rem; }
.bulk-dialog__items { list-style: none; margin: 0 0 .8rem; padding: 0; max-height: 45vh; overflow-y: auto;
        border: 1px solid #e2e6ec; border-radius: .5rem; }
.bulk-dialog__items li { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: .2rem .6rem; align-items: center;
        padding: .45rem .7rem; border-bottom: 1px solid #eef1f5; }
.bulk-dialog__items li:last-child { border-bottom: 0; }
.bulk-dialog__client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-dialog__mark { grid-column: 2 / -1; font-size: .82rem; color: #5a6a7c; }
.bulk-dialog__mark:empty { display: none; }
.bulk-dialog__mark--forward { color: #17632a; }
.bulk-dialog__mark--rollback { color: #b45309; font-weight: 600; }
.bulk-dialog__mark--invalid_transition, .bulk-dialog__mark--manager_only { color: #922; font-weight: 600; }

/* Detalle rápido bajo la fila (quotations/quick_view): el ▾ junto al número
   aparece al pasar el cursor; abierto, queda a la vista. */
.quick-toggle { border: 0; background: none; color: #16324f; cursor: pointer; padding: 0 .25rem; font-size: .85rem;
        border-radius: .25rem; transition: transform .15s ease; }
@media (hover: hover) {
  .quick-toggle { visibility: hidden; }
  tr:hover .quick-toggle, .quick-toggle:focus-visible, .quick-toggle[aria-expanded="true"] { visibility: visible; }
}
.quick-toggle[aria-expanded="true"] { transform: rotate(180deg); }
.quick-toggle:hover { background: #e8eef7; }
.quick-row > td { background: #f8fafc; padding: .9rem 1rem 1rem; white-space: normal; }
.quick-view { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 1.25rem; }
.quick-view h3 { margin: 0 0 .5rem; font-size: .8rem; color: #5a6a7c; text-transform: uppercase; letter-spacing: .03em; }
.quick-view p { margin: 0 0 .5rem; }
.quick-view dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; margin: 0; font-size: .9rem; }
.quick-view dt { color: #5a6a7c; }
.quick-view dd { margin: 0; }
.quick-view__tiers { width: 100%; font-size: .9rem; border-collapse: collapse; margin-bottom: .6rem; }
.quick-view__tiers th { font-size: .75rem; color: #5a6a7c; font-weight: 600; border-bottom: 1px solid #e2e6ec; }
.quick-view__tiers td, .quick-view__tiers th { padding: .25rem .4rem; }
.quick-view__open { float: right; }
@media (max-width: 64rem) { .quick-view { grid-template-columns: 1fr 1fr; } .quick-view section:last-child { grid-column: 1 / -1; } }

/* "Borrar filtros" al final de los chips de estado (el embudo con ✕ de Excel). */
/* Pegado al último chip, no empujado al borde: si la fila se llena baja con los demás, no solo. */
.list-clear { color: #922; border-color: #f0c4c4; }
.list-clear--icon { padding: .4rem .55rem; }
.list-clear--icon .list-clear__icon { width: 18px; height: 18px; }
.list-clear:hover { border-color: #c62828; }
.list-clear__icon { flex: none; }

/* Fichas técnicas, una por diseño (ADR-0019), en la cotización. */
.tsheet-list { flex-basis: 100%; margin: .4rem 0 .2rem; }
.tsheet-list h2 { margin: 0 0 .4rem; font-size: .95rem; }
.tsheet-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.tsheet-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .5rem .7rem;
        background: #f8fafc; border: 1px solid #e2e6ec; border-radius: .5rem; }
.tsheet-list__name { font-weight: 600; color: #16324f; flex: 1 1 14rem; }
.tsheet-list__actions { display: flex; gap: .4rem; }
/* Cada OT del lote se despliega (<details>): el renglón entero es el botón, con su flecha. */
.tsheet-list li.wo-batch__item { display: block; padding: 0; }
.wo-batch__details > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .5rem .7rem;
  cursor: pointer; list-style: none; border-radius: inherit; }
.wo-batch__details > summary::-webkit-details-marker { display: none; }
.wo-batch__details > summary:hover { background: #f1f5f9; }
.wo-batch__details > summary:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.wo-batch__article { display: block; font-weight: 400; color: #475569; font-size: .9rem; overflow-wrap: anywhere; }
.wo-batch__article b { color: #16324f; }
.tsheet-list__actions { align-items: center; }
.wo-batch__chevron { display: inline-block; width: 1.6rem; text-align: center; color: #16324f; font-size: 1.5rem; line-height: 1; transition: transform .15s; }
.wo-batch__chevron::before { content: "▾"; }
.wo-batch__details[open] .wo-batch__chevron { transform: rotate(180deg); }
.wo-batch__body { padding: .2rem .9rem .8rem; border-top: 1px solid #e2e8f0; }
.wo-batch__body .wo-values { margin: .6rem 0 .4rem; }
.wo-batch__pending-note { margin: .4rem 0 0; }
.wo-batch__pending-note::before { content: none; }
/* La carga de producción dentro de la orden: los bloques de etapa, dentro del desplegable de su OT. */
.prod-inline .wo-batch__body { padding-top: .6rem; }
.prod-inline .stage-block { margin: 0 0 .7rem; box-shadow: none; border: 1px solid #e2e8f0; }
.prod-inline .stage-block h2 { font-size: 1rem; }
.stage-block__result { margin: .4rem 0; }
/* Lo pendiente de una OT del lote: en su fila, debajo, y en el detalle del botón de enviar. */
.wo-batch__pending { flex: 1 1 100%; color: #9a3412; font-size: .9rem; }
.wo-batch__pending::before { content: "⚠ "; }
.wo-batch__pending a, .wo-batch__pending-list a { font-weight: 600; }
.wo-batch__pending-list { margin: .4rem 0 .8rem; padding-left: 1.2rem; display: grid; gap: .4rem; }
.tsheet-list__rename { display: flex; gap: .4rem; flex: 1 1 100%; margin: 0; }
.tsheet-list__rename input[type=text] { flex: 1; min-width: 0; }
/* Recién guardado: verde un momento y vuelve a lo normal (2026-11-18). */
.tsheet-list__rename input.tsheet-list__input--saved { animation: tsheet-saved 2.4s ease-out 1; }
@keyframes tsheet-saved { 0%, 55% { background: #e2f4e5; border-color: #2e9a4b; } }
@media (prefers-reduced-motion: reduce) {
  .tsheet-list__rename input.tsheet-list__input--saved { animation-duration: 4s; animation-timing-function: step-end; }
}
.tsheet-designs { margin: .2rem 0 .6rem; }

/* Excedentes: la tabla del cliente tal como la entregó (foto del 2026-10-30),
   para que gerencia la reconozca: barra amarilla arriba y abajo, bordes
   negros, encabezados en negrita, mayúsculas y minúsculas como en la foto.
   Pisa el estilo general de tablas y campos (th en mayúsculas, inputs a todo
   el ancho), que acá cambiaría la tabla que conocen. */
.excess-sheet { border: 2px solid #000; background: #fff; color: #000; margin: 1rem 0; font-family: Arial, Helvetica, sans-serif; }
.excess-sheet__bar { background: #ffff00; font-weight: 700; text-transform: uppercase; text-align: center;
  padding: .5rem .75rem; margin: 0; font-size: 1.05rem; border-bottom: 2px solid #000; }
.excess-sheet__bar:last-child { border-bottom: 0; border-top: 2px solid #000; }
.excess-sheet .table-wrap { padding: 1.25rem 0; }
.excess-sheet table { width: 100%; border-collapse: collapse; background: #fff; }
.excess-sheet table th, .excess-sheet table td { border: 1px solid #000; padding: .45rem .6rem; text-align: center;
  color: #000; background: #fff; font-size: 1rem; text-transform: none; letter-spacing: normal; }
.excess-sheet table thead th { font-weight: 700; white-space: normal; }
.excess-sheet table tbody th { font-weight: 400; }
.excess-sheet input.excess-sheet__input { display: inline-block; width: 3.6rem; min-width: 0; margin: 0;
  text-align: center; font: inherit; color: #000; padding: .15rem .2rem; }
.excess-sheet input.excess-sheet__input--bar { width: 3rem; font-weight: 700; vertical-align: baseline; }
.excess-sheet__threshold { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.excess-sheet__threshold input { width: 7rem; }

/* Orden de trabajo: rótulo y valor en dos columnas. */
.wo-values { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: .3rem 1rem; margin: .4rem 0 1rem; }
.wo-values dt { color: #64748b; }
.wo-values dd { margin: 0; font-weight: 600; }
.wo-values dd p { margin: 0; }
.wo-values--big dd { font-size: 1.15rem; }
/* La línea entre lo definido y lo que se imprime; las dos listas con la misma primera columna. */
.wo-values__rule { border: 0; border-top: 2px solid #cbd5e1; margin: .2rem 0 .9rem; }
.wo-values__rule + .wo-values, .wo-values:has(+ .wo-values__rule) { grid-template-columns: minmax(15rem, max-content) 1fr; }
@media (max-width: 640px) { .wo-values__rule + .wo-values, .wo-values:has(+ .wo-values__rule) { grid-template-columns: 1fr; } }
.wo-article__no-code { font-weight: 400; color: #64748b; }
@media (max-width: 640px) { .wo-values { grid-template-columns: 1fr; } }

/* Producción (ADR-0023): un bloque por etapa; lo real se carga desde la hoja. */
.stage-block h2 { display: flex; align-items: center; gap: .6rem; }
/* Etapa cerrada: todo el recuadro en verde, no solo la etiqueta (2026-11-18). */
.stage-block--done, .prod-inline .stage-block--done { background: #f0faf2; border-color: #8fd0a0; border-left: 4px solid #17632a; }
.stage-block--done .stage-block__planned { background: #e2f4e5; }
.stage-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem .9rem; align-items: start; }
.stage-block__number { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #16324f; color: #fff; font-size: .9rem; }
.stage-block__planned { margin: 0 0 .6rem; padding: .45rem .7rem; background: #f1f5f9; border-radius: .4rem; font-size: .92rem; }
.stage-form h3 { margin: .2rem 0 .5rem; font-size: 1rem; }
.stage-measure__input { display: flex; align-items: center; gap: .4rem; }
.stage-measure__input input { flex: 1; min-width: 0; }
.stage-measure__unit { color: #64748b; font-size: .85rem; min-width: 2.2rem; }
.stage-measure__reference { margin: .2rem 0 0; color: #64748b; font-size: .8rem; }
.stage-measure__odd { margin: .25rem 0 0; padding: .35rem .5rem; background: #fff7ed; border: 1px solid #fdba74; border-radius: .35rem; color: #9a3412; font-size: .82rem; }
/* Con la clase doble: "form input[type=text]" le ganaba a ".stage-measure--odd input" y el resaltado no se veía. */
.stage-measure.stage-measure--odd input,
.stage-measure:has(.stage-measure__odd--flow) input { border-color: #ea580c; background: #fff7ed; }
.badge--odd { background: #ffedd5; color: #9a3412; }
.stage-form__dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, max-content)); gap: .3rem .9rem; align-items: end; margin: .8rem 0 .4rem; }
.stage-form__date { display: flex; gap: .4rem; align-items: center; }
.stage-form__dates-hint { grid-column: 1 / -1; margin: 0; }
.stage-form__operators { border: 0; padding: 0; margin: .6rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.stage-form__operators legend { padding: 0; margin-bottom: .3rem; font-weight: 600; }
.chip-check { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border: 1px solid #cbd5e1; border-radius: 1rem; background: #fff; cursor: pointer; font-size: .9rem; }
.chip-check:has(input:checked) { background: #e8eef7; border-color: #16324f; font-weight: 600; }
.chip-check input { margin: 0; }
.stage-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: .7rem; }
.production-progress { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: #16324f; }
.production-progress progress { width: 9rem; height: .6rem; accent-color: #17632a; }
/* Registrar una factura o una guía en el paso: cada rótulo sobre su casillero. */
.step-record { display: grid; gap: .7rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid #e2e6ec; }
.step-record__table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.step-record__table th { padding: 0 .3rem .25rem 0; text-align: left; font-size: .85rem; font-weight: 600; border: 0; background: none; }
.step-record__table td { padding: 0 .3rem .4rem 0; border: 0; vertical-align: middle; }
.step-record__table input { width: 100%; margin: 0; }
.step-record__remove-cell { width: 2.6rem; padding-right: 0; text-align: right; }
/* En el teléfono no caben tres casilleros por fila: cada fila es una ficha y
   cada casillero lleva su nombre encima (el encabezado de la tabla se oculta). */
@media (max-width: 640px) {
  .step-record__table, .step-record__table tbody { display: block; }
  .step-record__table thead { display: none; }
  .step-record__table tr { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .6rem; padding: .5rem 0; border-bottom: 1px dashed #cbd5e1; }
  .step-record__table td { display: block; padding: 0; }
  .step-record__table td:first-child { grid-column: 1 / -1; }
  .step-record__table td[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; font-weight: 600; margin-bottom: .15rem; }
  .step-record__remove-cell { grid-column: 1 / -1; width: auto; }
}
.odd-confirm__list { margin: .4rem 0 .8rem; padding-left: 1.2rem; display: grid; gap: .3rem; color: #9a3412; font-weight: 600; }
.step-record__actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.step-record__buttons { display: inline-flex; gap: .5rem; align-items: center; margin-left: auto; }
.step-difference { margin: .6rem 0 0; font-size: .92rem; }
.step-difference:not(.notice) { color: #475569; }
.production-concluded { background: #e2f4e5; color: #17632a; }
.operators-new { display: flex; gap: .5rem; align-items: end; margin: .5rem 0 1rem; }

/* Operación: la línea de tiempo de una orden en semáforo (verde listo,
   amarillo completándose, rojo no comenzado, gris cancelada). */
.timeline { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.timeline__step { font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 1rem; white-space: nowrap; position: relative; }
.timeline__step + .timeline__step::before { content: "›"; position: absolute; left: -.3rem; top: .05rem; color: #94a3b8; font-weight: 400; }
.timeline__step a, .timeline__step span { color: inherit; text-decoration: none; }
.timeline__step--done { background: #dcfce7; color: #166534; }
.timeline__step--doing { background: #fef9c3; color: #854d0e; }
.timeline__step--todo { background: #fee2e2; color: #991b1b; }
.timeline__step--off { background: #e5e7eb; color: #6b7280; }
.operations-table__row--off td { opacity: .6; }
/* La lista en una pantalla (2026-11-10): la línea de tiempo compacta, un círculo por paso con su nombre. */
.operations-table__timeline { white-space: nowrap; }
.operations-table__timeline .timeline { display: inline-flex; vertical-align: middle; gap: .35rem; }
/* La lista: un círculo por paso con su nombre corto debajo, unidos por una
   línea; el paso actual va en negrita con un aro (2026-11-11). */
.timeline--stepper { gap: 0; }
.timeline--stepper .timeline__step { flex: 0 0 3.4rem; padding: 0; border-radius: 0; background: none; font-size: .68rem; font-weight: 500; color: #475569; text-align: center; }
.timeline--stepper .timeline__step + .timeline__step::before { content: ""; left: -50%; right: 50%; top: .45rem; height: 2px; margin: 0 .65rem; background: #cbd5e1; }
.timeline--stepper .timeline__link, .timeline--stepper .timeline__step > span { display: flex; flex-direction: column; align-items: center; gap: .15rem; position: relative; }
.timeline--stepper .timeline__dot { width: 1rem; height: 1rem; border-radius: 50%; background: #fca5a5; }
.timeline--stepper .timeline__step--done .timeline__dot { background: #22c55e; }
.timeline--stepper .timeline__step--doing .timeline__dot { background: #eab308; }
.timeline--stepper .timeline__step--off .timeline__dot { background: #cbd5e1; }
.timeline--stepper .timeline__step[aria-current="step"] { font-weight: 700; color: #16324f; }
.timeline--stepper .timeline__step[aria-current="step"] .timeline__dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #16324f; }
/* En el teléfono cada orden es una tarjeta: arriba la orden y la cotización,
   abajo la línea de tiempo a todo el ancho (sin tener que deslizar la tabla). */
@media (max-width: 640px) {
  .operations-table, .operations-table tbody { display: block; }
  .operations-table thead { display: none; }
  .operations-table tr { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; gap: .35rem .7rem; padding: .7rem .3rem; border-bottom: 1px solid #e2e6ec; }
  .operations-table td { display: block; padding: 0; border: 0; }
  .operations-table__timeline { grid-column: 1 / -1; grid-row: 2; }
  .operations-table__timeline .timeline { display: flex; }
  .timeline--stepper .timeline__step { flex: 1 1 0; }
}
.timeline--stepper .timeline__link:hover .timeline__name, .timeline--stepper .timeline__link:focus-visible .timeline__name { text-decoration: underline; }
.timeline__current { display: inline-block; margin-left: .6rem; font-weight: 600; vertical-align: middle; }
.operations-table__sub { display: block; font-size: .78rem; }
.operations-table__open { width: 2rem; text-align: right; }
.operations-table__arrow { font-size: 1.3rem; text-decoration: none; color: #5a6a7c; }
.list-filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 1rem; }
.list-filters input[type=search] { flex: 1 1 14rem; }
/* max-width: el desplegable toma el ancho de su opción más larga (una razón
   social de 60 letras) y sacaba la página del teléfono. */
.list-filters input[type=date], .list-filters select { width: auto; max-width: 100%; }

.step-dialog h2 { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 .8rem; }
.step-actions { border-top: 1px solid #e2e8f0; margin-top: 1rem; padding-top: .8rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
/* En el modal del paso, las acciones de la orden y las del modal van en una sola fila, al final. */
.step-dialog__actions { align-items: center; border-top: 1px solid #e2e8f0; padding-top: .8rem; margin-bottom: 0; }
.step-dialog__actions .step-actions, .sheet-actions .step-actions { display: contents; }
.sheet-actions form { margin: 0; }
.badge--hint { cursor: help; }
/* El registro de los certificados de conformidad emitidos, en la pantalla de producción. */
.certificate-history { margin: .25rem 0 1rem; }
.certificate-history__title { font-size: 1rem; margin: 0 0 .15rem; }
.certificate-history ul { list-style: none; margin: .35rem 0 0; padding: 0; display: grid; gap: .25rem; }
.certificate-history li { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; }
.badge-hint__text { display: none; }
@media (hover: none) { .badge-hint__text { display: block; margin-top: .2rem; overflow-wrap: anywhere; } }
.step-dialog__actions form { margin: 0; }
.step-cancel { display: grid; gap: .4rem; }
.step-cancel textarea { width: 100%; }
.step-cancel .confirm__actions { margin-top: .6rem; }
.btn--danger { background: #b91c1c; }

/* Hoja de una orden (Operación): cabecera, línea de tiempo grande, un bloque
   por paso y la historia. Imprimible: sin acciones ni navegación. */
.operation-header dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.operation-header dt { color: #64748b; }
.operation-header dd { margin: 0; }
/* La línea de tiempo vertical (2026-11-10): un riel a la izquierda con el
   número (o ✓) de cada paso; el actual resaltado; los pendientes en gris. */
.op-steps { list-style: none; margin: 1rem 0; padding: 0; position: relative; }
.op-steps::before { content: ""; position: absolute; left: 1.1rem; top: 1rem; bottom: 1rem; width: 2px; background: #e2e8f0; }
.op-step { position: relative; display: grid; grid-template-columns: 2.25rem 1fr; gap: .6rem; margin-bottom: .8rem; }
.op-step__marker { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #fee2e2; color: #991b1b; border: 2px solid #fff; z-index: 1; }
.op-step--done .op-step__marker { background: #22c55e; color: #fff; }
.op-step--doing .op-step__marker { background: #eab308; color: #fff; }
.op-step--off .op-step__marker { background: #cbd5e1; color: #475569; }
.op-step__body { background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem; padding: .8rem 1rem; min-width: 0; }
.op-step--current .op-step__body { border-color: #eab308; box-shadow: 0 0 0 2px #fef9c3; }
.op-step--todo .op-step__body, .op-step--off .op-step__body { color: #64748b; }
.op-step h3 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0 0 .6rem; font-size: 1rem; }
.op-step__current { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: #854d0e; }
.op-step__date { font-size: .8rem; }
.sheet-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1rem; }
@media print {
  .no-print, .op-step form, .op-step .btn, .step-actions, nav, .backlink, .flash { display: none !important; }
  .op-step, .operation-header { break-inside: avoid; }
}

/* --- Lector de QR de los documentos de planta (ADR-0026) --- */
.scan-link { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.scanner { max-width: 30rem; margin: 1rem auto 0; display: grid; gap: .8rem; }
.scanner__view { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden;
  background: #0f2236; border-radius: .8rem; }
.scanner__view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner__idle { position: relative; margin: 0; padding: 0 18%; color: #d6e3f0; font-size: .95rem; text-align: center; }
.scanner__view--live .scanner__idle { display: none; }
/* La mira: cuatro esquinas blancas sobre la imagen. */
.scanner__frame { --mark: 1.7rem; --stroke: 3px; position: absolute; inset: 12%; pointer-events: none;
  background:
    linear-gradient(#fff, #fff) left top / var(--mark) var(--stroke) no-repeat,
    linear-gradient(#fff, #fff) left top / var(--stroke) var(--mark) no-repeat,
    linear-gradient(#fff, #fff) right top / var(--mark) var(--stroke) no-repeat,
    linear-gradient(#fff, #fff) right top / var(--stroke) var(--mark) no-repeat,
    linear-gradient(#fff, #fff) left bottom / var(--mark) var(--stroke) no-repeat,
    linear-gradient(#fff, #fff) left bottom / var(--stroke) var(--mark) no-repeat,
    linear-gradient(#fff, #fff) right bottom / var(--mark) var(--stroke) no-repeat,
    linear-gradient(#fff, #fff) right bottom / var(--stroke) var(--mark) no-repeat; }
.scanner__status { min-height: 1.4em; margin: 0; color: #16324f; font-weight: 600; text-align: center; }
.scanner .notice { margin: 0; }
.scanner .notice p { margin: 0 0 .4rem; }
.scanner .notice p:last-child { margin: 0; }

/* Las evidencias de la orden (ADR-0033): el bloque en el paso Orden de trabajo y la ficha. */
.evidences { margin: .2rem 0 1rem; padding-bottom: .8rem; border-bottom: 1px dashed #e2e8f0; }
.evidences h4 { margin: 0; font-size: 1rem; }
.evidence-group { margin-top: .7rem; }
.evidence-group__head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: 0 0 .4rem; }
.evidence-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0; }
.evidence-thumb { display: block; width: 4.5rem; height: 4.5rem; border: 1px solid #cbd5e1; border-radius: .4rem; overflow: hidden; background: #f8fafc; }
.evidence-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evidence-add summary { cursor: pointer; color: #16324f; font-weight: 600; font-size: .9rem; width: fit-content; }
.evidence-form { margin-top: .5rem; padding: .7rem; border: 1px solid #e2e8f0; border-radius: .5rem; max-width: 30rem; }
.evidence-form input[type=file] { max-width: 100%; }
.evidence-form__status:empty { display: none; }
.evidence-full { display: block; max-width: 100%; height: auto; margin: 1rem 0; border: 1px solid #cbd5e1; border-radius: .4rem; }

/* Los pagos de la orden: el bloque Pago y el estado en las listas (rojo, amarillo, verde). */
.badge--pay-pending { background: #fbe4e4; color: #922; }
.badge--pay-partial { background: #fdf1dc; color: #8a5a00; }
.badge--pay-paid { background: #e2f4e5; color: #17632a; }
.payments { margin: .2rem 0 1rem; padding-bottom: .8rem; border-bottom: 1px dashed #e2e8f0; }
.payments h4 { margin: 0 0 .3rem; font-size: 1rem; }
.payments__summary { margin: 0 0 .4rem; font-weight: 600; }
/* minmax(0, 1fr): sin eso una fila con un texto largo no se achica y empuja la página en el teléfono. */
.payments__list { list-style: none; margin: .4rem 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.payment { padding: .5rem .7rem; border: 1px solid #e2e8f0; border-radius: .5rem; min-width: 0; overflow-wrap: anywhere; }
.payment__line { margin: 0; }
.payment__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .4rem .8rem; margin-top: .3rem; }
/* El formulario de corregir vive dentro de una fila flexible: sin esto no se achica al ancho del teléfono. */
.payment__actions > details { min-width: 0; max-width: 100%; }
.payment__actions .evidence-form { max-width: 100%; box-sizing: border-box; }
.evidence-form input, .evidence-form select { max-width: 100%; box-sizing: border-box; }

/* El crédito del cliente, en su ficha. */
.credit-orders { margin: .2rem 0 .6rem; padding-left: 1.1rem; }

/* Lo que la orden necesita para ir a producción. */
.requirements { margin: .2rem 0 1rem; padding: .6rem .8rem; border: 1px solid #e2e8f0; border-radius: .5rem; background: #f8fafc; }
.requirements h4 { margin: 0 0 .3rem; font-size: 1rem; }
.requirements__ok { color: #17632a; font-weight: 700; }

/* El recuadro único "Para enviar a producción": una fila por requisito, con su estado a la
   izquierda y su "Agregar" a la derecha; el formulario abierto y las miniaturas ocupan todo el ancho. */
.requirements .evidences, .requirements .payments { margin: 0; padding: 0; border: 0; }
.requirements .evidence-group { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; margin: 0; padding: .55rem 0; border-top: 1px solid #e2e8f0; }
.requirements .evidence-group__head { flex: 1 1 14rem; margin: 0; }
.requirements .evidence-add > summary { list-style: none; padding: .2rem .7rem; border: 1px solid #94a3b8; border-radius: .4rem; background: #fff; }
.requirements .evidence-add > summary::-webkit-details-marker { display: none; }
.requirements .evidence-add[open] { flex-basis: 100%; }
.requirements .evidence-thumbs, .requirements .payments__requirement, .requirements .payments__summary, .requirements .payments__list,
.requirements .payments > .card__meta, .requirements .evidence-group > .card__meta { flex-basis: 100%; margin: 0; }
.requirements .payments__requirement { font-weight: 600; }
.requirements .payments__summary { font-weight: 400; }
.requirements .payments__list { margin: .4rem 0 0; }

/* Una evidencia abierta en un modal: la imagen entera a la vista, sin pasar el alto de la pantalla. */
.evidence-dialog { width: min(56rem, 96vw); max-width: 96vw; }
.evidence-dialog .evidence-full { max-height: 72vh; width: auto; max-width: 100%; margin: .6rem auto; object-fit: contain; }

/* Lo que es solo del computador (imprimir una evidencia): donde hay ratón. En el teléfono o la tableta,
   en el navegador o en la app instalada, no se muestra. */
.only-desktop { display: none; }
@media (hover: hover) and (pointer: fine) { .only-desktop { display: inline-block; } }

/* Imprimir una evidencia (Alejandro, 2026-11-19: "debe imprimir solo la foto"): de su ficha sale solo la
   imagen, con su timbre, a todo el ancho de la hoja y en una página. Ni los datos, ni la barra, ni el pie. */
@media print {
  body:has(.evidence-print) .appbar, body:has(.evidence-print) header, body:has(.evidence-print) .footer,
  body:has(.evidence-print) > dialog,
  body:has(.evidence-print) main > :not(.evidence-full) { display: none !important; }
  body:has(.evidence-print) main { margin: 0; padding: 0; max-width: none; }
  body:has(.evidence-print) .evidence-full { display: block; margin: 0 auto; border: 0; border-radius: 0; width: auto; max-width: 100%; max-height: 96vh; object-fit: contain; }
}

/* La nota de venta (ADR-0036): en su formulario los casilleros de cantidad y precio van angostos, a la
   derecha, y el artículo ocupa el resto con su descripción debajo (se corta en palabras, no se sale). */
.sales-note-form input[type="text"] { width: min(8.5rem, 100%); min-width: 0; text-align: right; }
.sales-note-form td:first-child { white-space: normal; overflow-wrap: break-word; }
/* La columna Diferencia: cuánto falta (se vende más de lo producido) o cuánto sobra (queda en inventario). */
.sales-note-form__diff { white-space: nowrap; color: #64748b; }
.sales-note-form__diff--short { color: #b91c1c; font-weight: 700; }
.sales-note-form__diff--surplus { color: #92400e; font-weight: 700; }
.sales-note-form input[aria-invalid="true"] { border-color: #b91c1c; }
.sales-note-form__actions { display: flex; justify-content: flex-end; }
.sales-note__error { margin: 0 0 .6rem; }
.sales-note__stale ul { margin: .25rem 0 .25rem 1.1rem; }
.sales-note__void { margin-top: .75rem; }
.sales-note__void form { margin-top: .5rem; display: grid; gap: .4rem; max-width: 32rem; justify-items: start; }
.sales-note__void input[type="text"] { width: 100%; }
.sales-note__voided-title { margin-top: 1rem; }
.sales-note__voided li { font-weight: 400; }
/* En el teléfono, y siempre dentro del modal del paso (que es angosto aunque la pantalla sea ancha), cada
   artículo es un bloque: su nombre arriba y, debajo, cada dato con su rótulo a la izquierda. Así no hay
   columnas que se salgan del ancho. */
.step-dialog .sales-note-form, .step-dialog .sales-note-form tbody, .step-dialog .sales-note-form tr, .step-dialog .sales-note-form td { display: block; width: 100%; }
.step-dialog .sales-note-form thead { display: none; }
.step-dialog .sales-note-form tr { padding: .5rem 0; border-bottom: 1px solid #e2e8f0; }
.step-dialog .sales-note-form td { border: 0; padding: .2rem 0; }
.step-dialog .sales-note-form td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.step-dialog .sales-note-form td[data-label]::before { content: attr(data-label); color: #475569; font-size: .85em; text-align: left; flex: 1 1 auto; min-width: 0; }
@media (max-width: 40rem) {
  .sales-note-form, .sales-note-form tbody, .sales-note-form tr, .sales-note-form td { display: block; width: 100%; }
  .sales-note-form thead { display: none; }
  .sales-note-form tr { padding: .5rem 0; border-bottom: 1px solid #e2e8f0; }
  .sales-note-form td { border: 0; padding: .2rem 0; }
  .sales-note-form td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
  .sales-note-form td[data-label]::before { content: attr(data-label); color: #475569; font-size: .85em; text-align: left; flex: 1 1 auto; min-width: 0; }
}

/* El detalle de una confirmación (confirm_dialog_controller, data-confirm-detail): una tabla chica sobre la
   pregunta. La usa la nota de venta para mostrar producido, ingresado y diferencia. */
.confirm__detail { margin: 0 0 .9rem; font-size: .92rem; }
.confirm__detail p { margin: 0 0 .5rem; }
.confirm-table { width: 100%; border-collapse: collapse; margin: 0 0 .5rem; }
.confirm-table th, .confirm-table td { padding: .3rem .4rem; border-bottom: 1px solid #e2e8f0; text-align: left; overflow-wrap: break-word; }
.confirm-table thead th { font-size: .78rem; text-transform: uppercase; color: #475569; white-space: normal; }
.confirm-table .num { text-align: right; }
.confirm-table td:last-child { font-weight: 700; }
.confirm-table__note { color: #475569; font-size: .82rem; }

/* La fecha estimada de entrega en la lista de Operación, a la derecha del paso Entrega, y la de cada paso
   pendiente en la hoja (ADR-0038). Atrasada: en rojo. */
.timeline__eta { display: inline-block; margin-left: .6rem; font-size: .8rem; color: #475569; vertical-align: middle; text-decoration: none; }
a.timeline__eta:hover { text-decoration: underline; }
/* En la lista de Operación, un clic en cualquier parte de la celda de la orden la abre: el enlace del número se
   estira sobre la celda. Las etiquetas con explicación al pasar el cursor quedan por encima, para que se lean. */
.operations-table__main { position: relative; cursor: pointer; }
.operations-table__number::after { content: ""; position: absolute; inset: 0; }
.operations-table__main .badge--hint, .operations-table__main .evidence-missing { position: relative; z-index: 1; }
.timeline__eta--done { color: #17632a; font-weight: 600; }
.timeline__eta--overdue, .op-step__eta--overdue { color: #b91c1c; font-weight: 600; }
.op-step__eta { font-size: .8rem; }
