/*
 * Lo poco que el CSS de unfold no trae. Todo lo demás de las pantallas usa las
 * clases de unfold (verificado por apps/accounts/tests/test_unfold_css.py).
 *
 * Colores siempre por variable (--color-primary-600, --color-base-200…): unfold
 * las define desde UNFOLD["COLORS"], así que respetan la paleta del proyecto.
 * El modo oscuro es la clase .dark que unfold pone en <html>.
 */

/* Pasos de los intentos de contacto: hechos, el que sigue y los que faltan. */
.mxr-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}
.mxr-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mxr-step + .mxr-step::before {
  content: "";
  position: absolute;
  top: 15px;
  right: calc(100% + 1px);
  width: 26px;
  height: 1px;
  background: var(--color-base-200);
}
.mxr-step-dot {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-base-100);
  color: var(--color-base-500);
}
.mxr-step-when {
  font-size: 11px;
  color: var(--color-base-500);
}
.mxr-step-done .mxr-step-dot {
  background: var(--color-primary-600);
  color: #fff;
}
.mxr-step-current .mxr-step-dot {
  background: var(--color-orange-100);
  color: var(--color-orange-700);
  box-shadow: inset 0 0 0 1px var(--color-orange-700);
}
.mxr-step-current .mxr-step-when {
  color: var(--color-orange-700);
  font-weight: 600;
}
.dark .mxr-step + .mxr-step::before {
  background: var(--color-base-700);
}
.dark .mxr-step-dot {
  background: var(--color-base-800);
  color: var(--color-base-400);
}

/* Lo que hace el sistema y no una persona (junta del 3 nov 2026: a quien nunca ha
   contestado le escribe el sistema cada mes). El intento automático lleva contorno
   y rayo en vez de relleno y número, para distinguirlo de un vistazo; `.mxr-auto`
   es la misma seña en una línea de texto. */
.mxr-step-auto .mxr-step-dot {
  background: transparent;
  color: var(--color-primary-600);
  box-shadow: inset 0 0 0 1.5px var(--color-primary-600);
}
.mxr-step-auto .mxr-step-dot .material-symbols-outlined {
  font-size: 17px;
}
.dark .mxr-step-auto .mxr-step-dot {
  background: transparent;
  color: var(--color-primary-400);
  box-shadow: inset 0 0 0 1.5px var(--color-primary-400);
}
.mxr-auto {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: baseline;
  color: var(--color-primary-600);
}
.mxr-auto .material-symbols-outlined {
  font-size: 14px;
}
.dark .mxr-auto {
  color: var(--color-primary-400);
}
.mxr-timeline > li.mxr-timeline-auto::after {
  background: var(--color-base-50);
  box-shadow: inset 0 0 0 2px var(--color-primary-600);
}
.dark .mxr-timeline > li.mxr-timeline-auto::after {
  background: var(--color-base-900);
  box-shadow: inset 0 0 0 2px var(--color-primary-400);
}
/* Un icono dentro de un renglón de texto. */
.mxr-inline-icon {
  font-size: 16px;
  vertical-align: -3px;
}
/* Un correo dentro de una historia (cómo llegó un RFQ). */
.mxr-timeline > li.mxr-timeline-mail::after {
  border-radius: 2px;
  background: var(--color-base-400);
}
/* En el hilo: quién lo trabaja, el sistema o una persona, y por qué. */
.mxr-autopilot {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--border-radius, 6px);
  border: 1px solid var(--color-base-200);
  background: var(--color-base-50);
}
.mxr-autopilot > .material-symbols-outlined {
  font-size: 20px;
  color: var(--color-base-500);
}
.mxr-autopilot-on {
  border-color: color-mix(in srgb, var(--color-primary-600) 30%, transparent);
  background: color-mix(in srgb, var(--color-primary-600) 6%, transparent);
}
.mxr-autopilot-on > .material-symbols-outlined {
  color: var(--color-primary-600);
}
.dark .mxr-autopilot {
  border-color: var(--color-base-700);
  background: rgb(255 255 255 / 0.03);
}
.dark .mxr-autopilot-on {
  border-color: color-mix(in srgb, var(--color-primary-400) 40%, transparent);
  background: color-mix(in srgb, var(--color-primary-400) 9%, transparent);
}
.dark .mxr-autopilot-on > .material-symbols-outlined {
  color: var(--color-primary-400);
}
/* Un plegado dentro de un renglón (el correo que se mandó): sin el alto de botón. */
.mxr-details-inline > summary {
  min-height: 28px;
  font-weight: 400;
}

/* Renglón que pide atención (intentos agotados). */
.mxr-attention {
  background: color-mix(in srgb, var(--color-orange-100) 45%, transparent);
}
.dark .mxr-attention {
  background: color-mix(in srgb, var(--color-orange-700) 18%, transparent);
}

/* Rejilla de campos: cada campo de unfold ya trae su margen de abajo (mb-4);
   aquí solo falta el espacio entre columnas. */
.mxr-form-grid {
  column-gap: 1rem;
}

/* Tabla con muchas columnas: se desplaza de lado en pantallas angostas en vez de
   apretarse. */
.mxr-table-wide {
  min-width: 960px;
}

/* Camino del registro como proveedor, en vertical. Reusa el círculo de los
   pasos de intentos (.mxr-step-dot). */
.mxr-vsteps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.mxr-vstep {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
}
.mxr-vstep:last-child {
  padding-bottom: 0;
}
.mxr-vstep:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: var(--color-base-200);
}
.mxr-vstep-done:not(:last-child)::after {
  background: var(--color-primary-600);
}
.mxr-vstep-done .mxr-step-dot {
  background: var(--color-primary-600);
  color: #fff;
}
.mxr-vstep-current .mxr-step-dot {
  background: var(--color-orange-100);
  color: var(--color-orange-700);
  box-shadow: inset 0 0 0 1px var(--color-orange-700);
}
.mxr-vstep-current .mxr-vstep-label {
  color: var(--color-orange-700);
  font-weight: 600;
}
.mxr-vstep-todo .mxr-vstep-label {
  color: var(--color-base-500);
}
.dark .mxr-vstep:not(:last-child)::after {
  background: var(--color-base-700);
}

/* Casilla de «entregado» que se marca con un clic (es un botón de formulario,
   no un checkbox: cada clic guarda). */
.mxr-check {
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1px solid var(--color-base-300);
  background: #fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.mxr-check .material-symbols-outlined {
  font-size: 18px;
}
.mxr-check-on {
  background: var(--color-green-700);
  border-color: var(--color-green-700);
}
.mxr-check:focus-visible {
  outline: 2px solid var(--color-primary-600);
  outline-offset: 2px;
}
.dark .mxr-check {
  background: var(--color-base-900);
  border-color: var(--color-base-600);
}
.dark .mxr-check-on {
  background: var(--color-green-700);
  border-color: var(--color-green-700);
}

/* ---- Pulido de interfaz ------------------------------------------------- */

/* Números alineados en columnas, en tablas y tarjetas. */
.mxr-table-wide,
.mxr-kpi-value {
  font-variant-numeric: tabular-nums;
}

/* Renglón bajo el cursor: se ve a cuál se le va a dar clic. */
.mxr-table-wide tbody tr {
  transition: background-color 0.12s ease;
}
.mxr-table-wide tbody tr:hover {
  background: var(--color-primary-50);
}
.dark .mxr-table-wide tbody tr:hover {
  background: rgb(255 255 255 / 0.04);
}

/* Resultados que se están recargando (HTMX pone .htmx-request en el indicador):
   se atenúan y no aceptan clics, para que se note que algo pasa. */
.mxr-results {
  transition: opacity 0.15s ease;
}
/* El atenuado espera 250 ms: si la respuesta llega antes, el cambio se ve
   instantáneo y no parpadea. */
.mxr-results.htmx-request {
  opacity: 0.5;
  pointer-events: none;
  transition-delay: 0.25s;
}

/* Filtros en una sola fila en pantallas anchas (unfold no trae las columnas). */
@media (min-width: 1280px) {
  .mxr-filters-8 {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .mxr-filters-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .mxr-span-2 {
    grid-column: span 2 / span 2;
  }
}

/* Estado vacío: qué pasó y qué hacer, no solo «no hay». */
.mxr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 16px;
  text-align: center;
}
.mxr-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-100);
  color: var(--color-primary-600);
}
.mxr-empty-icon .material-symbols-outlined {
  font-size: 26px;
}
.mxr-empty-title {
  font-weight: 600;
  color: var(--color-base-900);
}
.mxr-empty-hint {
  max-width: 420px;
  color: var(--color-base-500);
  font-size: 13px;
}
.dark .mxr-empty-icon {
  background: color-mix(in srgb, var(--color-primary-600) 25%, transparent);
  color: var(--color-primary-300);
}
.dark .mxr-empty-title {
  color: var(--color-base-100);
}

/* Medidor de intentos (n de máximo). */
.mxr-meter {
  width: 72px;
  height: 6px;
  border-radius: 9999px;
  background: var(--color-base-100);
  overflow: hidden;
  margin-top: 6px;
}
.mxr-meter > span {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background: var(--color-primary-600);
}
.mxr-meter-full > span {
  background: var(--color-orange-700);
}
/* Ya contestó: los intentos dejaron de ser cuenta regresiva. */
.mxr-meter-ok > span {
  background: var(--color-green-700);
}
.dark .mxr-meter {
  background: var(--color-base-700);
}

/* Tarjeta de indicador: icono, nombre, cifra y detalle. */
.mxr-kpi {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.mxr-kpi-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-100);
  color: var(--color-primary-600);
}
.mxr-kpi-label {
  font-size: 13px;
  white-space: nowrap;
  font-weight: 500;
  color: var(--color-base-500);
}
.mxr-kpi-value {
  font-size: 24px;
  white-space: nowrap;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-base-900);
}
.mxr-kpi-note {
  font-size: 12px;
  color: var(--color-base-500);
}
.dark .mxr-kpi-icon {
  background: color-mix(in srgb, var(--color-primary-600) 25%, transparent);
  color: var(--color-primary-300);
}
.dark .mxr-kpi-value {
  color: var(--color-base-50);
}

/* Acción principal de un renglón: se lee como botón, no como un enlace más. */
.mxr-row-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-primary-600);
  background: var(--color-primary-50);
  box-shadow: inset 0 0 0 1px var(--color-primary-200);
}
.mxr-row-action:hover {
  background: var(--color-primary-600);
  color: #fff;
}
.dark .mxr-row-action {
  color: var(--color-primary-300);
  background: color-mix(in srgb, var(--color-primary-600) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary-500) 40%, transparent);
}
.dark .mxr-row-action:hover {
  background: var(--color-primary-600);
  color: #fff;
}

/* Encabezado de ficha: nombre y datos de contacto agrupados. */
.mxr-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  color: var(--color-base-500);
}
.mxr-meta .material-symbols-outlined {
  font-size: 16px;
  vertical-align: -3px;
  margin-right: 4px;
}

/* Historial como línea de tiempo. */
.mxr-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mxr-timeline > li {
  position: relative;
  padding: 0 0 18px 22px;
}
.mxr-timeline > li:last-child {
  padding-bottom: 0;
}
.mxr-timeline > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: -2px;
  width: 2px;
  background: var(--color-base-200);
}
.mxr-timeline > li:last-child::before {
  display: none;
}
.mxr-timeline > li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: var(--color-base-300);
}
.mxr-timeline > li.mxr-timeline-event::after {
  background: var(--color-primary-600);
}
.mxr-timeline > li.mxr-timeline-answer::after {
  background: var(--color-green-700);
}
.dark .mxr-timeline > li::before {
  background: var(--color-base-700);
}
.dark .mxr-timeline > li::after {
  background: var(--color-base-600);
}

/* Teclado: el foco siempre se ve. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary-600);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .mxr-table-wide tbody tr,
  .mxr-results {
    transition: none;
  }
}

/* Lista de pendientes de «Hoy»: dato a la izquierda, fecha o acción a la derecha. */
.mxr-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mxr-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-base-200);
}
.mxr-list > li:first-child {
  border-top: 0;
  padding-top: 0;
}
.dark .mxr-list > li {
  border-top-color: var(--color-base-700);
}

/* Navegación con hx-boost: cursor de espera y una barra delgada arriba mientras
   carga la página (htmx pone .htmx-request en #page, el indicador del layout). Hacia
   el admin y dentro de él la página se carga completa: mxr.js pone .mxr-leaving al
   dar clic en el menú, para que se vea lo mismo. */
#page.htmx-request,
#page.mxr-leaving {
  cursor: progress;
}
#page.htmx-request::before,
#page.mxr-leaving::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 60;
  background: var(--color-primary-600);
  transform-origin: left;
  /* Invisible los primeros 250 ms: las navegaciones rápidas no muestran barra. */
  opacity: 0;
  animation: mxr-loading 1.2s ease-out 0.25s forwards;
}
@keyframes mxr-loading {
  from {
    opacity: 1;
    transform: scaleX(0.05);
  }
  to {
    opacity: 1;
    transform: scaleX(0.9);
  }
}
@media (prefers-reduced-motion: reduce) {
  #page.htmx-request::before,
  #page.mxr-leaving::before {
    animation: none;
    transform: scaleX(0.5);
    opacity: 1;
  }
}

/* Lista larga de casillas (los 17 principales): en columnas, no en una fila de
   17 renglones. El contenedor lo pinta unfold como flex en columna. */
.mxr-checks #id_lines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 16px;
}

/* Portal de principales: en pantallas angostas las tarjetas de KPI se salían por
   la derecha porque un elemento de rejilla no se encoge por debajo de su contenido. */
.mxr-portal-kpis > * {
  min-width: 0;
}

/* En el celular caben dos tarjetas por renglón solo si la etiqueta puede partirse. */
@media (max-width: 480px) {
  .mxr-kpi {
    gap: 10px;
  }
  .mxr-kpi-icon {
    width: 32px;
    height: 32px;
  }
  .mxr-kpi-label {
    white-space: normal;
  }
}

/* Filtros del portal: el botón queda a la altura de los selectores, no de las etiquetas. */
.mxr-period {
  align-items: flex-end;
}

/* El correo mensual se ve como texto plano, con sus saltos de línea. */
.mxr-pre {
  white-space: pre-wrap;
}

/* Logo de Mexirep: es azul oscuro y en modo oscuro se perdería contra el fondo. */
.dark img[src*="mexirep-logo"] {
  filter: brightness(0) invert(1);
}

/* ---- Sistema visual ------------------------------------------------------ */
/* Lienzo gris con tarjetas blancas: la jerarquía la da el fondo, no más bordes.
   Lo de pantallas propias va bajo .mxr-page; el admin solo comparte el lienzo. */
:root {
  /* Entra o sale: arranca rápido. Se mueve en pantalla: acelera y frena. */
  --mxr-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --mxr-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --mxr-ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  /* Resortes con linear(): uno que apenas rebasa (4%) y otro que rebota (16%),
     para lo que se celebra. Salen de la ecuación del resorte, no a ojo. */
  --mxr-spring: linear(
    0, 0.006 1.5%, 0.026 3.2%, 0.064 5.2%, 0.113 7.2%, 0.218 10.8%, 0.571 21.5%, 0.672 25%,
    0.754 28.2%, 0.819 31.2%, 0.878 34.5%, 0.925 37.8%, 0.962 41%, 0.994 44.8%, 1.017 48.8%,
    1.031 53%, 1.038 57.8%, 1.036 66%, 1
  );
  --mxr-spring-pop: linear(
    0, 0.007 1%, 0.035 2.2%, 0.079 3.5%, 0.137 4.8%, 0.282 7.2%, 0.595 12%, 0.72 14%,
    0.845 16.2%, 0.94 18.2%, 1.018 20.2%, 1.078 22.2%, 1.12 24.2%, 1.147 26.2%, 1.163 29.2%,
    1.154 32.5%, 1.128 35.8%, 1.018 46.8%, 0.991 51%, 0.977 55.2%, 0.975 62%, 1.003 83%, 1
  );
}
#main {
  background: var(--color-base-50);
}
.dark #main {
  background: var(--color-base-950);
}
#nav-sidebar {
  background: #fff;
}
.dark #nav-sidebar {
  background: var(--color-base-900);
}
#nav-sidebar-apps h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-base-500);
  margin-bottom: 0;
}
.dark #nav-sidebar-apps h2 {
  color: var(--color-base-400);
}

/* El título ya está en la pantalla: la barra de arriba no lo repite. */
#main:has(.mxr-page) > div:first-child {
  background: transparent;
  border-bottom-color: transparent;
  margin-bottom: 0;
}
#main:has(.mxr-page) > div:first-child > div {
  height: 48px;
}
#main:has(.mxr-page) #header-inner h1,
#main:has(.mxr-page) #header-inner .w-px {
  display: none;
}
.mxr-page {
  padding-bottom: 48px;
}
.mxr-page > div:first-child .text-2xl {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Filtros: una barra sobre el lienzo, con etiquetas que no compiten con los datos. */
.mxr-filters > div {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}
.mxr-filters label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-base-500);
  margin-bottom: 4px;
}
.dark .mxr-filters label {
  color: var(--color-base-400);
}

/* Tarjetas planas y tablas calladas: encabezado discreto, sin franja de color. */
.mxr-page .rounded-default.border {
  box-shadow: none;
}
.mxr-page table thead tr {
  background: transparent;
}
.mxr-page table th {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-base-500);
}
.dark .mxr-page table th {
  color: var(--color-base-400);
}
.mxr-page table td {
  padding-top: 10px;
  padding-bottom: 10px;
}
.mxr-page table th:first-child,
.mxr-page table td:first-child {
  padding-left: 20px;
}
.mxr-page table th:last-child,
.mxr-page table td:last-child {
  padding-right: 20px;
}
/* El nombre del renglón se lee como dato; el azul queda para las acciones. */
.mxr-page table td:first-child a.text-primary-600 {
  color: var(--color-base-900);
}
.dark .mxr-page table td:first-child a.dark\:text-primary-500 {
  color: var(--color-base-50);
}
@media (hover: hover) and (pointer: fine) {
  .mxr-page table td:first-child a.text-primary-600:hover {
    color: var(--color-primary-600);
  }
  .dark .mxr-page table td:first-child a.dark\:text-primary-500:hover {
    color: var(--color-primary-300);
  }
}

/* Indicadores: manda la cifra. El icono va a la esquina para no quitarle ancho
   (18,717,699.37 USD tiene que caber) y la moneda puede bajar de renglón. */
.mxr-page .mxr-kpi {
  position: relative;
}
.mxr-page .mxr-kpi-icon {
  position: absolute;
  top: 0;
  right: 0;
  width: auto;
  height: auto;
  background: transparent;
  color: var(--color-base-400);
}
.mxr-page .mxr-kpi-value {
  white-space: normal;
}

/* Motivo y nota de una parte: solo existen si se marca «No cotizada». */
.mxr-noquote {
  display: none;
}
form:has(select[name="status"] option[value="NO_QUOTE"]:checked) .mxr-noquote {
  display: flex;
}

/* Al presionar, el botón responde. */
@media (prefers-reduced-motion: no-preference) {
  .mxr-page button,
  .mxr-page a.inline-flex.rounded-default,
  .mxr-row-action {
    transition: transform 120ms var(--mxr-ease-out);
  }
  .mxr-page button:not(:disabled):active,
  .mxr-page a.inline-flex.rounded-default:active,
  .mxr-row-action:active {
    transform: scale(0.97);
  }
}

/* Login: «Volver al sitio» regresaba al mismo login. */
.login #page a[href="/"] {
  display: none;
}

/* Tabla de captura: se escribe en la celda, como en una hoja de cálculo. */
.mxr-grid {
  border-collapse: collapse;
}
.mxr-page .mxr-grid th {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--color-base-200);
}
.mxr-page .mxr-grid td {
  padding: 0;
  border-top: 1px solid var(--color-base-200);
}
.dark .mxr-page .mxr-grid th,
.dark .mxr-page .mxr-grid td {
  border-color: var(--color-base-800);
}
.mxr-grid input {
  display: block;
  width: 100%;
  min-width: 96px;
  padding: 10px;
  background: transparent;
  border: 0;
  outline: 0;
}
.mxr-grid input:focus {
  box-shadow: inset 0 0 0 2px var(--color-primary-600);
}
.mxr-page .mxr-grid .mxr-grid-n {
  width: 40px;
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
}
.mxr-grid button .material-symbols-outlined {
  font-size: 16px;
  vertical-align: middle;
}

/* Un selector por principal, en dos columnas, sin el margen de cada campo. */
.mxr-priorities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  column-gap: 16px;
}

/* Portal de principales: el mismo lienzo que las pantallas internas. */
.mxr-portal {
  background: var(--color-base-50);
}
.dark .mxr-portal {
  background: var(--color-base-950);
}

/* La tabla de una tarjeta llega hasta el título, sin el margen del cuerpo. */
.mxr-page .-mx-6.-mb-6 {
  margin-top: -24px;
}
/* Salvo que antes de la tabla vaya algo más (el resumen del mes en Reportes). */
.mxr-page .-mx-6.-mb-6.mxr-table-after {
  margin-top: 0;
  border-top: 1px solid var(--color-base-200);
}
.dark .mxr-page .-mx-6.-mb-6.mxr-table-after {
  border-top-color: var(--color-base-800);
}

/* Etiquetas en su propia caja de letras: «Revisar en el RFQ», «P1 Automotive». */
.mxr-page .uppercase {
  text-transform: none;
  font-size: 12px;
}

/* Portal: las etiquetas del periodo, como las de los filtros internos. */
.mxr-period label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-base-500);
}

/* Correos en las fichas */
.mxr-mail-compose {
  margin-bottom: 16px;
}
/* De qué cuenta sale, justo debajo de «Enviar»; «Conectar mi correo» ocupa su lugar. */
.mxr-mail-account {
  margin-top: -8px;
  margin-bottom: 16px;
}
.mxr-mail-account button:hover {
  text-decoration: underline;
}
.mxr-mail-connect {
  margin-bottom: 16px;
}
/* La plantilla va arriba del asunto: se elige primero y luego se ajusta el texto. */
.mxr-mail-template {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-base-200);
}
.dark .mxr-mail-template {
  border-bottom-color: var(--color-base-800);
}
.mxr-mail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.mxr-mail {
  padding: 12px;
  border: 1px solid var(--color-base-200);
  border-radius: 6px;
}
.dark .mxr-mail {
  border-color: var(--color-base-800);
}
.mxr-mail-out {
  background: var(--color-base-50);
}
.dark .mxr-mail-out {
  background: rgb(255 255 255 / 0.02);
}
.mxr-mail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.mxr-mail-body {
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.mxr-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* ---- Movimiento ---------------------------------------------------------- */
/* Todo es CSS y la plataforma: transiciones de vista, @starting-style, resortes
   con linear(), animaciones atadas al scroll y trayectorias con offset-path. Sin
   librerías. Qué se anima y por qué está en docs/PRACTICAS.md §5: lo de todos los
   días casi no se mueve; lo que se celebra o se ve poco puede lucirse.

   `.mxr-arrive` la pone mxr.js en <html> al cargar o al navegar y la quita poco
   después: lo que solo debe animarse al llegar (cifras, anillos, barras) cuelga de
   ella, para que un filtro o un guardado no lo repita. */

/* Entre documentos (login → Hoy, pantallas ↔ admin) el navegador pasa de una página
   a la otra; entre pantallas propias lo hace htmx con `transition:true`. Las dos se
   ven igual: el menú no se mueve y la pantalla nueva aparece encima de la anterior.

   Entre documentos hay una trampa: unfold esconde todo el <html> (x-cloak) hasta que
   arranca Alpine, y la transición fotografiaba esa página vacía (el menú se quedaba
   en blanco un instante). `js/mxr-listo.js` detiene el primer cuadro hasta que la
   página ya está armada (templates/unfold/layouts/skeleton.html). */
@view-transition {
  navigation: auto;
}

.mxr-page-title {
  width: fit-content;
  max-width: 100%;
  text-wrap: balance;
}

/* El menú: la marca del ítem activo es una pieza aparte, para que pueda deslizarse
   de un ítem a otro en vez de saltar. */
#nav-sidebar-apps a.active {
  position: relative;
  isolation: isolate;
  background: transparent;
}
#nav-sidebar-apps a.active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(var(--color-primary-600), var(--color-primary-600)) left center / 3px 50%
      no-repeat,
    color-mix(in srgb, var(--color-primary-600) 9%, transparent);
}
.dark #nav-sidebar-apps a.active::before {
  background:
    linear-gradient(var(--color-primary-400), var(--color-primary-400)) left center / 3px 50%
      no-repeat,
    rgb(255 255 255 / 0.07);
}

@media (prefers-reduced-motion: no-preference) {
  /* El menú no participa de la foto: se queda quieto mientras cambia la pantalla. */
  #nav-sidebar {
    view-transition-name: mxr-sidebar;
  }
  #nav-sidebar-apps a.active::before {
    view-transition-name: mxr-nav-pill;
  }
  /* Dos nombres iguales cancelan la transición: si el menú marcara dos ítems,
     solo el primero lleva la pieza. */
  #nav-sidebar-apps div:has(a.active) ~ div a.active::before,
  #nav-sidebar-apps li:has(> a.active) ~ li a.active::before {
    view-transition-name: none;
  }
  /* Cuando se llega desde un renglón, su nombre es el mismo objeto que el título
     de la ficha: viaja a su lugar (mxr.js marca el enlace y pone .mxr-hero-nav al
     dar clic). Entre opciones del menú el título no viaja: cambia con la pantalla. */
  .mxr-hero-nav .mxr-page-title {
    view-transition-name: mxr-hero;
  }
  .mxr-hero-source {
    display: inline-block;
    view-transition-name: mxr-hero;
  }
  /* El interruptor de «Hoy»: la opción elegida (con su texto) se desliza a la otra,
     solo cuando el clic fue en el interruptor (.mxr-seg-nav). Si fuera solo el
     fondo blanco, taparía el texto mientras dura; y fuera de ese clic se quedaba
     flotando sobre la pantalla siguiente. */
  .mxr-seg-nav .mxr-seg a[aria-current="true"] {
    view-transition-name: mxr-seg-thumb;
  }

  /* La pantalla anterior no se apaga: la nueva aparece encima. Así lo que es igual
     en las dos (la barra de arriba, el fondo) no cambia ni un pixel y nunca se ve
     el lienzo vacío entre una y otra, que es lo que se leía como un parpadeo. */
  ::view-transition-old(root) {
    animation: none;
    mix-blend-mode: normal;
  }
  ::view-transition-new(root) {
    animation: mxr-vt-in 130ms var(--mxr-ease-out) both;
    mix-blend-mode: normal;
  }
  ::view-transition-old(mxr-sidebar) {
    display: none;
  }
  ::view-transition-new(mxr-sidebar) {
    animation: none;
  }
  ::view-transition-group(mxr-hero),
  ::view-transition-group(mxr-nav-pill),
  ::view-transition-group(mxr-seg-thumb) {
    animation-duration: 280ms;
    animation-timing-function: var(--mxr-ease-drawer);
  }
  /* El texto escala por su alto y se queda pegado a la izquierda: dos nombres
     iguales en tamaños distintos se enciman en vez de estirarse. */
  ::view-transition-old(mxr-hero),
  ::view-transition-new(mxr-hero),
  ::view-transition-old(mxr-seg-thumb),
  ::view-transition-new(mxr-seg-thumb) {
    width: auto;
    height: 100%;
  }
  ::view-transition-old(mxr-hero) {
    animation-duration: 120ms;
  }
  ::view-transition-new(mxr-hero) {
    animation-duration: 220ms;
  }

  /* Cambio de tema: el modo nuevo se abre en círculo desde donde se dio clic. */
  :root.mxr-theme-switch #nav-sidebar,
  :root.mxr-theme-switch #nav-sidebar-apps a.active::before,
  :root.mxr-theme-switch .mxr-seg a[aria-current="true"],
  :root.mxr-theme-switch .mxr-page-title {
    view-transition-name: none;
  }
  :root.mxr-theme-switch::view-transition-old(root) {
    animation: none;
  }
  :root.mxr-theme-switch::view-transition-new(root) {
    animation: mxr-theme-reveal 520ms var(--mxr-ease-in-out) both;
  }
}
@keyframes mxr-vt-in {
  from {
    opacity: 0;
  }
}
@keyframes mxr-theme-reveal {
  from {
    clip-path: circle(0 at var(--mxr-vt-x, 50%) var(--mxr-vt-y, 50%));
  }
  to {
    clip-path: circle(150vmax at var(--mxr-vt-x, 50%) var(--mxr-vt-y, 50%));
  }
}

/* Lienzo: una luz tenue arriba a la izquierda, para que no sea un gris plano. */
#main:has(.mxr-page) {
  background-image: radial-gradient(
    900px 380px at 12% -8%,
    color-mix(in srgb, var(--color-primary-500) 9%, transparent),
    transparent
  );
  background-repeat: no-repeat;
}
.dark #main:has(.mxr-page) {
  background-image: radial-gradient(
    900px 380px at 12% -8%,
    color-mix(in srgb, var(--color-primary-500) 16%, transparent),
    transparent
  );
}

/* Texto: los párrafos no dejan una palabra sola, y el área de notas crece con lo
   que se escribe. */
.mxr-page p,
.mxr-empty-hint {
  text-wrap: pretty;
}
.mxr-page textarea {
  field-sizing: content;
  min-height: 4.75lh;
  max-height: 40vh;
}

/* -- Esperar -- */
/* La barra de arriba, con brillo; sigue invisible los primeros 250 ms. */
#page.htmx-request::before,
#page.mxr-leaving::before {
  background: linear-gradient(
    90deg,
    var(--color-primary-600),
    var(--color-primary-400) 60%,
    #9fe3d3
  );
  box-shadow: 0 0 10px color-mix(in srgb, var(--color-primary-500) 70%, transparent);
}

/* Resultados que tardan: además de atenuarse, les pasa un brillo por encima. */
.mxr-results {
  position: relative;
}
@media (prefers-reduced-motion: no-preference) {
  .mxr-results.htmx-request::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
      100deg,
      transparent 30%,
      color-mix(in srgb, var(--color-primary-500) 14%, transparent) 50%,
      transparent 70%
    );
    opacity: 0;
    animation: mxr-shimmer 1.1s linear 0.25s infinite;
  }
}
@keyframes mxr-shimmer {
  from {
    opacity: 1;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(100%);
  }
}

/* Un formulario que ya se mandó: su botón lo dice y no acepta otro clic. Espera
   150 ms para no parpadear en lo que contesta al instante. */
.mxr-page form.htmx-request button[type="submit"],
.login #login-form.mxr-busy button[type="submit"] {
  pointer-events: none;
  opacity: 0.6;
  cursor: progress;
  transition: opacity 0.12s ease 0.15s;
}

/* -- Llegar -- */
@media (prefers-reduced-motion: no-preference) {
  /* Las secciones de una pantalla de inicio entran una tras otra, solo al entrar al
     sistema (.mxr-welcome, viniendo del login). Al volver por el menú ya están ahí:
     que aparecieran de nuevo cada vez se sentía como si la página se recargara. */
  .mxr-welcome .mxr-stagger > * {
    animation: mxr-rise 420ms var(--mxr-ease-out) both;
  }
  .mxr-welcome .mxr-stagger > :nth-child(2) {
    animation-delay: 50ms;
  }
  .mxr-welcome .mxr-stagger > :nth-child(3) {
    animation-delay: 100ms;
  }
  .mxr-welcome .mxr-stagger > :nth-child(4) {
    animation-delay: 150ms;
  }
  .mxr-welcome .mxr-stagger > :nth-child(5) {
    animation-delay: 200ms;
  }
  .mxr-welcome .mxr-stagger > :nth-child(n + 6) {
    animation-delay: 250ms;
  }

  /* Estado vacío: el icono cae en su lugar. */
  .mxr-arrive .mxr-empty-icon {
    animation: mxr-pop 520ms var(--mxr-spring) both;
  }

  /* Medidores y barras crecen desde cero: es un dato que sube, no un adorno. */
  .mxr-arrive .mxr-meter > span,
  .mxr-arrive .mxr-bar > span {
    transform-origin: left;
    animation: mxr-grow-x 600ms var(--mxr-ease-out) both;
  }
  .mxr-arrive .mxr-split {
    animation: mxr-wipe 700ms var(--mxr-ease-out) 120ms both;
  }
  .mxr-arrive .mxr-ring-value {
    animation: mxr-ring 1000ms var(--mxr-ease-out) 200ms both;
  }

  /* Un aviso que aparece baja a su lugar en vez de brincar. */
  .mxr-flash {
    transition:
      opacity 280ms var(--mxr-ease-out),
      transform 280ms var(--mxr-ease-out);
  }
  @starting-style {
    .mxr-flash {
      opacity: 0;
      transform: translateY(-8px);
    }
  }

  /* Lo que se acaba de guardar se marca un momento: dónde quedó, sin estorbar. */
  .mxr-saved {
    animation: mxr-saved 1500ms ease-out both;
  }
  .mxr-timeline > li.mxr-new {
    animation: mxr-slide-in 420ms var(--mxr-ease-out) both;
  }
  .mxr-timeline > li.mxr-new::after {
    animation: mxr-pop 520ms var(--mxr-spring-pop) both;
  }

  /* El intento recién guardado: su paso cae con resorte y suelta una onda. */
  .mxr-step-new .mxr-step-dot {
    animation: mxr-pop 560ms var(--mxr-spring-pop) both;
  }
  .mxr-step-new .mxr-step-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    box-shadow: 0 0 0 2px var(--color-primary-600);
    animation: mxr-ripple 800ms var(--mxr-ease-out) 120ms both;
  }
  .mxr-step-new::before {
    transform-origin: left;
    animation: mxr-grow-x 320ms var(--mxr-ease-out) both;
  }
  /* El que sigue respira tres veces y se queda quieto. */
  .mxr-arrive .mxr-step-current .mxr-step-dot,
  .mxr-step-new + .mxr-step-current .mxr-step-dot {
    animation: mxr-breathe 1800ms ease-in-out 3;
  }

  /* Una casilla o una palomita recién puestas: la caja rebota y la palomita se
     dibuja de izquierda a derecha. */
  .mxr-just {
    animation: mxr-pop 460ms var(--mxr-spring-pop) both;
  }
  .mxr-just .material-symbols-outlined,
  .material-symbols-outlined.mxr-just {
    animation:
      mxr-pop 460ms var(--mxr-spring-pop) both,
      mxr-wipe 300ms var(--mxr-ease-out) both;
  }
}
@keyframes mxr-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes mxr-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  30% {
    opacity: 1;
  }
}
@keyframes mxr-grow-x {
  from {
    transform: scaleX(0);
  }
}
@keyframes mxr-wipe {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes mxr-ring {
  from {
    stroke-dashoffset: 100;
  }
}
@keyframes mxr-saved {
  from {
    background-color: color-mix(in srgb, var(--color-green-700) 18%, transparent);
  }
}
@keyframes mxr-slide-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}
@keyframes mxr-ripple {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(2.2);
  }
}
@keyframes mxr-breathe {
  50% {
    box-shadow:
      inset 0 0 0 1px var(--color-orange-700),
      0 0 0 5px color-mix(in srgb, var(--color-orange-700) 18%, transparent);
  }
}

/* Pasos: el tramo entre dos intentos hechos se pinta, y el círculo es el ancla de
   su onda. */
.mxr-step-dot {
  position: relative;
}
.mxr-step-done + .mxr-step-done::before,
.mxr-step-done + .mxr-step-current::before {
  background: var(--color-primary-600);
}
.dark .mxr-step-done + .mxr-step-done::before,
.dark .mxr-step-done + .mxr-step-current::before {
  background: var(--color-primary-500);
}

/* -- Datos vivos -- */
/* Anillo de avance: --pct de 0 a 100. El trazo mide 100 (pathLength), así que el
   hueco es lo que falta. */
.mxr-ring-wrap {
  position: relative;
  flex: none;
  width: 58px;
  height: 58px;
}
.mxr-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.mxr-ring circle {
  fill: none;
  stroke-width: 5;
}
.mxr-ring-track {
  stroke: var(--color-base-200);
}
.mxr-ring-value {
  stroke: var(--color-primary-600);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--pct, 0));
}
.mxr-ring-full .mxr-ring-value {
  stroke: var(--color-green-700);
}
.mxr-ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-base-900);
}
.dark .mxr-ring-track {
  stroke: var(--color-base-700);
}
.dark .mxr-ring-value {
  stroke: var(--color-primary-400);
}
.dark .mxr-ring-pct {
  color: var(--color-base-50);
}

/* Barras de «por qué»: el motivo, cuántas, y su tamaño contra el más grande. */
.mxr-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px 32px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.mxr-bars > li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 12px;
  min-width: 0;
}
.mxr-bar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-base-700);
}
.mxr-bar-n {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-base-900);
}
.mxr-bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 9999px;
  background: var(--color-base-100);
  overflow: hidden;
}
.mxr-bar > span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: 9999px;
  background: var(--color-orange-700);
}
.mxr-bar-primary > span {
  background: var(--color-primary-600);
}
.dark .mxr-bar-label {
  color: var(--color-base-300);
}
.dark .mxr-bar-n {
  color: var(--color-base-50);
}
.dark .mxr-bar {
  background: var(--color-base-800);
}

/* Reparto de un total en tramos (cotizadas, no cotizadas, pendientes). Cada tramo
   pide su ancho con flex-grow: los números, no porcentajes calculados a mano. */
.mxr-split {
  display: flex;
  gap: 2px;
  height: 8px;
  margin-top: 10px;
  border-radius: 9999px;
  overflow: hidden;
}
.mxr-split > span {
  flex: var(--n, 0) 1 0;
  min-width: 0;
}
.mxr-split-ok {
  background: var(--color-green-700);
}
.mxr-split-no {
  background: var(--color-orange-700);
}
.mxr-split-wait {
  background: var(--color-base-300);
}
.dark .mxr-split-wait {
  background: var(--color-base-600);
}
.mxr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-base-500);
}
.mxr-legend > span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
  background: var(--color-base-300);
}
.mxr-legend > .mxr-legend-ok::before {
  background: var(--color-green-700);
}
.mxr-legend > .mxr-legend-no::before {
  background: var(--color-orange-700);
}
.dark .mxr-legend {
  color: var(--color-base-400);
}

/* Cifras que cuentan hasta su valor (mxr.js): con dígitos del mismo ancho, para
   que la cifra no baile mientras sube. */
[data-mxr-count] {
  font-variant-numeric: tabular-nums;
}

/* -- Hoy -- */
/* La portada del día: saludo, fecha y los cuatro objetivos sobre el azul de la
   marca. Va oscura en los dos modos, como el encabezado de un reporte. */
.mxr-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px;
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(rgb(255 255 255 / 0.07) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(
      135deg,
      var(--color-primary-700),
      var(--color-primary-900) 65%,
      var(--color-primary-950)
    );
}
.mxr-hero::before,
.mxr-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.mxr-hero::before {
  width: 560px;
  height: 560px;
  left: -140px;
  top: -300px;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--color-primary-400) 60%, transparent),
    transparent
  );
}
.mxr-hero::after {
  width: 480px;
  height: 480px;
  right: -100px;
  bottom: -300px;
  background: radial-gradient(closest-side, rgb(96 204 184 / 0.32), transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .mxr-hero::before {
    animation: mxr-drift 17s ease-in-out infinite alternate;
  }
  .mxr-hero::after {
    animation: mxr-drift 23s ease-in-out infinite alternate-reverse;
  }
}
@keyframes mxr-drift {
  to {
    transform: translate(140px, 50px) scale(1.18);
  }
}
.mxr-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.mxr-hero-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.72);
}
.mxr-hero .mxr-page-title {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}
.mxr-hero-sub {
  margin-top: 4px;
  color: rgb(255 255 255 / 0.8);
}

/* Lo mío o todo el equipo: dos opciones, la elegida con fondo blanco. */
.mxr-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.12);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
}
.mxr-seg a {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
  color: rgb(255 255 255 / 0.85);
}
.mxr-seg a .material-symbols-outlined {
  font-size: 18px;
}
.mxr-seg a[aria-current="true"] {
  color: var(--color-primary-800);
}
.mxr-seg a[aria-current="true"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
}
.mxr-seg a:focus-visible {
  outline-color: #fff;
}

/* Los objetivos: la cifra de lo pendiente y el anillo de cuánto va cubierto. */
.mxr-goals {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}
@media (min-width: 1100px) {
  .mxr-goals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.mxr-goal {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border-radius: 12px;
  color: #fff;
  background: rgb(255 255 255 / 0.08);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.13);
  transition:
    background-color 160ms ease,
    transform 120ms var(--mxr-ease-out);
}
.mxr-goal:active {
  transform: scale(0.98);
}
.mxr-goal:focus-visible {
  outline-color: #fff;
}
@media (hover: hover) and (pointer: fine) {
  .mxr-goal:hover {
    background: rgb(255 255 255 / 0.13);
  }
}
.mxr-goal-label {
  font-size: 13px;
  font-weight: 500;
  color: rgb(255 255 255 / 0.9);
}
.mxr-goal-n {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.mxr-goal-note {
  font-size: 12px;
  color: rgb(255 255 255 / 0.7);
}
.mxr-goal-late {
  font-weight: 600;
  color: #ffd2a8;
}
.mxr-goal .mxr-ring-track {
  stroke: rgb(255 255 255 / 0.18);
}
.mxr-goal .mxr-ring-value {
  stroke: #fff;
}
.mxr-goal .mxr-ring-full .mxr-ring-value {
  stroke: #9fe3d3;
}
.mxr-goal .mxr-ring-pct {
  color: #fff;
}
.mxr-goal-cap {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  text-align: center;
  color: rgb(255 255 255 / 0.7);
}
@media (max-width: 480px) {
  .mxr-hero {
    padding: 20px 16px;
  }
  .mxr-hero .mxr-page-title {
    font-size: 24px;
  }
  .mxr-goal {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Luz que sigue al cursor sobre una tarjeta (mxr.js pone --mx y --my). */
.mxr-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    rgb(255 255 255 / 0.16),
    transparent 65%
  );
}
@media (hover: hover) and (pointer: fine) {
  .mxr-glow:hover::after {
    opacity: 1;
  }
}

/* La palomita de «Sin respuesta» de un clic. */
.mxr-done-check {
  color: var(--color-green-700);
}
.dark .mxr-done-check {
  color: #7fd29a;
}

/* -- Celebrar -- */
/* Confeti: cada papel sale con su rumbo (mxr.js lo sortea). Tres propiedades,
   tres curvas: avanza de lado, sube y cae, y gira. */
.mxr-confetti {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  pointer-events: none;
}
.mxr-confetti i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 8px;
  height: 12px;
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
  animation:
    mxr-confetti-x var(--d) cubic-bezier(0.1, 0.6, 0.3, 1) both,
    mxr-confetti-y var(--d) linear both,
    mxr-confetti-spin var(--d) linear both;
}
@keyframes mxr-confetti-x {
  to {
    translate: var(--dx) 0;
  }
}
@keyframes mxr-confetti-y {
  0% {
    opacity: 1;
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.4, 1);
  }
  38% {
    opacity: 1;
    transform: translateY(var(--up));
    animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(var(--down));
  }
}
@keyframes mxr-confetti-spin {
  to {
    rotate: var(--rot);
  }
}

/* -- Abrir y cerrar -- */
/* Lo que casi nunca se usa va plegado, y al abrirse crece hasta su alto real
   (interpolate-size); donde el navegador no lo sabe animar, abre de golpe. */
.mxr-details {
  interpolate-size: allow-keywords;
}
.mxr-details > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  color: var(--color-base-700);
}
.mxr-details > summary::-webkit-details-marker {
  display: none;
}
.mxr-details > summary .material-symbols-outlined {
  font-size: 18px;
  transition: transform 200ms var(--mxr-ease-out);
}
.mxr-details[open] > summary .material-symbols-outlined {
  transform: rotate(90deg);
}
.dark .mxr-details > summary {
  color: var(--color-base-200);
}
@media (prefers-reduced-motion: no-preference) {
  .mxr-details::details-content {
    block-size: 0;
    overflow-y: clip;
    opacity: 0;
    transition:
      block-size 260ms var(--mxr-ease-drawer),
      opacity 200ms ease,
      content-visibility 260ms allow-discrete;
  }
  .mxr-details[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
}

/* -- Con el scroll -- */
/* En una pantalla larga, cada tarjeta entra cuando el scroll llega a ella. La
   animación va atada a la posición, no al tiempo: si se sube, se deshace. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .mxr-reveal > * {
      animation: mxr-reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}
@keyframes mxr-reveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}

/* -- Entrar -- */
/* El login: a la derecha, la historia del negocio. Fabricantes de un lado,
   industria mexicana del otro, y lo que fluye entre ellos pasa por Mexirep. */
.mxr-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 56px;
  color: #fff;
  background:
    radial-gradient(rgb(255 255 255 / 0.06) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(
      160deg,
      var(--color-primary-700),
      var(--color-primary-900) 60%,
      var(--color-primary-950)
    );
}
@media (min-width: 1280px) {
  .mxr-scene {
    display: flex;
  }
}
.mxr-scene::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 720px;
  height: 720px;
  left: -200px;
  top: -320px;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--color-primary-400) 55%, transparent),
    transparent
  );
}
.mxr-scene-art {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
}
.mxr-scene-line {
  fill: none;
  stroke: rgb(255 255 255 / 0.24);
  stroke-width: 1.2;
  stroke-dasharray: 1;
}
.mxr-scene-node {
  fill: #fff;
}
.mxr-scene-halo {
  fill: rgb(255 255 255 / 0.14);
}
.mxr-scene-hub {
  fill: #fff;
}
.mxr-scene-pulse,
.mxr-scene-gear {
  fill: none;
  stroke: rgb(255 255 255 / 0.5);
  transform-box: fill-box;
  transform-origin: center;
}
.mxr-scene-gear {
  stroke-width: 1.5;
  stroke-dasharray: 3 9;
}
.mxr-scene-dot {
  fill: #9fe3d3;
  filter: drop-shadow(0 0 5px rgb(159 227 211 / 0.9));
  opacity: 0;
}
.mxr-scene-label {
  fill: rgb(255 255 255 / 0.9);
  font-size: 15px;
  font-weight: 500;
}
.mxr-scene-cap {
  fill: rgb(255 255 255 / 0.55);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.mxr-scene-logo {
  height: 28px;
  width: fit-content;
  filter: brightness(0) invert(1);
}
.mxr-scene-title {
  max-width: 15em;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}
.mxr-scene-sub {
  max-width: 34em;
  margin-top: 12px;
  font-size: 15px;
  color: rgb(255 255 255 / 0.78);
}
@media (prefers-reduced-motion: no-preference) {
  .mxr-scene::before {
    animation: mxr-drift 19s ease-in-out infinite alternate;
  }
  .mxr-scene-line {
    stroke-dashoffset: 1;
    animation: mxr-draw 1300ms var(--mxr-ease-out) calc(var(--i, 0) * 70ms + 200ms) forwards;
  }
  .mxr-scene-node,
  .mxr-scene-halo,
  .mxr-scene-label {
    animation: mxr-fade 600ms ease calc(var(--i, 0) * 70ms + 100ms) both;
  }
  .mxr-scene-pulse {
    animation: mxr-pulse 3s var(--mxr-ease-out) infinite;
  }
  .mxr-scene-pulse + .mxr-scene-pulse {
    animation-delay: 1.5s;
  }
  .mxr-scene-gear {
    animation: mxr-turn 50s linear infinite;
  }
  /* Cada punto recorre su trayecto (offset-path); el retraso negativo los
     reparte a lo largo del camino desde el primer cuadro. */
  .mxr-scene-dot {
    offset-rotate: 0deg;
    animation: mxr-flow var(--t, 3.6s) linear var(--delay, 0s) infinite;
  }
  .mxr-scene-copy > * {
    animation: mxr-rise 700ms var(--mxr-ease-out) both;
  }
  .mxr-scene-copy > :nth-child(2) {
    animation-delay: 120ms;
  }
  /* Y del lado del formulario, cada cosa entra en su turno. */
  .login #page .w-full > * {
    animation: mxr-rise 520ms var(--mxr-ease-out) both;
  }
  .login #page .w-full > :nth-child(2) {
    animation-delay: 80ms;
  }
  .login #page .w-full > :nth-child(n + 3) {
    animation-delay: 140ms;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mxr-scene-dot {
    display: none;
  }
}
@keyframes mxr-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes mxr-fade {
  from {
    opacity: 0;
  }
}
@keyframes mxr-pulse {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(2.6);
  }
}
@keyframes mxr-turn {
  to {
    transform: rotate(360deg);
  }
}
@keyframes mxr-flow {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  12%,
  88% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

/* Quien pidió menos movimiento no ve nada de lo anterior moverse: las
   transiciones de vista cambian de golpe y lo demás ya nace en su lugar. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none;
  }
}

/* -- Cotización -- */
/* El estatus de la cotización: las cuatro opciones a la vista, la actual marcada.
   Un clic la mueve; hacia atrás también, porque se captura a mano y se corrige. */
.mxr-pipe {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--color-base-100);
}
.mxr-pipe button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-base-600);
  cursor: pointer;
}
.mxr-pipe button[aria-pressed="true"] {
  color: var(--color-primary-700);
  background: #fff;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.14),
    inset 0 0 0 1px var(--color-base-200);
}
@media (hover: hover) and (pointer: fine) {
  .mxr-pipe button[aria-pressed="false"]:hover {
    color: var(--color-base-900);
  }
}
@media (pointer: coarse) {
  .mxr-pipe button {
    min-height: 44px;
  }
}
.dark .mxr-pipe {
  background: var(--color-base-800);
}
.dark .mxr-pipe button {
  color: var(--color-base-300);
}
.dark .mxr-pipe button[aria-pressed="true"] {
  color: #fff;
  background: var(--color-base-700);
  box-shadow: inset 0 0 0 1px var(--color-base-600);
}
.dark .mxr-pipe button[aria-pressed="false"]:hover {
  color: #fff;
}

/* El valor cotizado de una parte: solo existe si la parte está cotizada o ganada. */
.mxr-valued {
  display: none;
}
form:has(select[name="status"] option[value="QUOTED"]:checked) .mxr-valued,
form:has(select[name="status"] option[value="AWARDED"]:checked) .mxr-valued {
  display: flex;
}
.mxr-money {
  width: 150px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Un ancla a media pantalla no queda pegada al borde de arriba. */
.mxr-anchor {
  scroll-margin-top: 16px;
}

/* En el celular, la acción de un renglón baja debajo del dato en vez de encimarse. */
@media (max-width: 480px) {
  .mxr-list > li {
    flex-wrap: wrap;
  }
}

/* ---- Crédito ------------------------------------------------------------- */
/* Al pie de cada página: «Developed by» y el logotipo de Elicore, con liga a su
   sitio (templates/mxr/_elicore.html). El azul es el de su marca, no de la paleta
   del proyecto: por eso no sale de una variable de unfold. */
.mxr-elicore {
  --mxr-elicore-azul: #0061e2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-base-500);
  transition: color 150ms ease;
}
.mxr-elicore-logo {
  height: 18px;
  width: auto;
  flex: none;
  color: var(--color-base-800);
  transition: color 150ms ease;
}
.mxr-elicore-azul {
  fill: var(--mxr-elicore-azul);
}
.mxr-elicore-linea {
  stroke: var(--mxr-elicore-azul);
}
.mxr-elicore:hover {
  color: var(--color-base-700);
}
.mxr-elicore:hover .mxr-elicore-logo {
  color: var(--color-base-950);
}
.dark .mxr-elicore {
  --mxr-elicore-azul: #3ca4ff;
  color: var(--color-base-400);
}
.dark .mxr-elicore-logo {
  color: var(--color-base-200);
}
.dark .mxr-elicore:hover {
  color: var(--color-base-300);
}
.dark .mxr-elicore:hover .mxr-elicore-logo {
  color: #fff;
}
/* El pie del layout: bajo el contenido, alineado con él. */
.mxr-foot {
  display: flex;
  justify-content: center;
  padding: 8px 16px 24px;
}
/* En el portal de principales el contenido no llena la pantalla: el pie baja al fondo. */
.mxr-portal > .mxr-foot {
  margin-top: auto;
  padding-top: 24px;
}
/* En el login va bajo el formulario. */
.mxr-foot-login {
  display: flex;
  margin-top: 40px;
}
