/* mv-ui.css — componentes comunes de las apps web propias.
 *
 * Necesita mv-tokens.css cargado ANTES:
 *   <link rel="stylesheet" href="mv-ui/css/mv-tokens.css">
 *   <link rel="stylesheet" href="mv-ui/css/mv-ui.css">
 *
 * Todas las clases empiezan por «mv-» para poder convivir con el CSS viejo de cada app
 * mientras se migra. Lo general (body, foco) va dentro de :where() para que pese cero y
 * la app lo pueda pisar sin pelearse.
 *
 * Nombres: bloque «mv-boton», variante «mv-boton--primario», pieza «mv-tarjeta__titulo».
 */

/* ================================================================== letra (Inter, local) */
@font-face {
  font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fuentes/inter-latin-wght-normal.woff2) format('woff2-variations'),
       url(../fuentes/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fuentes/inter-latin-ext-wght-normal.woff2) format('woff2-variations'),
       url(../fuentes/inter-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ================================================================== base */
:where(*, *::before, *::after) { box-sizing: border-box; }
:where(html) { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:where(body) {
  margin: 0;
  background: var(--mv-fondo);
  color: var(--mv-tinta);
  font-family: var(--mv-letra);
  font-size: var(--mv-t-15);
  line-height: 1.5;
  font-feature-settings: 'cv11' 1;   /* la «a» de una sola panza de Inter, más legible */
  -webkit-font-smoothing: antialiased;
}
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(a) { color: var(--acento-texto); text-underline-offset: 2px; }
:where(h1, h2, h3, h4) { line-height: 1.25; margin: 0; text-wrap: balance; }
:where(p) { text-wrap: pretty; }

/* Foco visible siempre que se llegue con teclado o pistola: 2 px + 2 px de hueco */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--mv-foco-ancho) solid var(--mv-oro-foco);
  outline-offset: var(--mv-foco-hueco);
}

/* Cifras siempre con números de ancho fijo (las columnas cuadran) */
.mv-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mv-cifra { font-variant-numeric: tabular-nums; }

/* Solo para lectores de pantalla */
.mv-oculto-visual {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Modo pistola (RF, guantes): todo lo que se toca crece a 56 px y la letra sube */
.mv-pistola { --mv-control: var(--mv-control-pistola); font-size: var(--mv-t-17); }

/* ================================================================== iconos
   <svg class="mv-icono" aria-hidden="true"><use href="mv-ui/iconos/mv-iconos.svg#search"/></svg> */
.mv-icono {
  width: 20px; height: 20px; flex: none; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.mv-icono--16 { width: 16px; height: 16px; }
.mv-icono--24 { width: 24px; height: 24px; }
.mv-icono--32 { width: 32px; height: 32px; stroke-width: 1.75; }

/* ================================================================== disposición */
.mv-contenedor { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--mv-e-4); }
.mv-pila { display: flex; flex-direction: column; gap: var(--mv-e-4); }
.mv-fila { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mv-e-3); }
.mv-rejilla { display: grid; gap: var(--mv-e-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.mv-titulo-pagina { font-size: var(--mv-t-24); font-weight: var(--mv-peso-fuerte); letter-spacing: -.01em; }
.mv-subtitulo { font-size: var(--mv-t-13); font-weight: var(--mv-peso-fuerte); color: var(--mv-texto-2);
  text-transform: uppercase; letter-spacing: .05em; }
.mv-suave { color: var(--mv-texto-2); }
.mv-nota { color: var(--mv-texto-3); font-size: var(--mv-t-13); }

/* ================================================================== botón */
.mv-boton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--mv-e-2);
  min-height: var(--mv-control); padding: 0 var(--mv-e-4);
  border: 1px solid transparent; border-radius: var(--mv-r-2);
  font-size: var(--mv-t-15); font-weight: var(--mv-peso-medio); line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color var(--mv-rapido) var(--mv-curva), border-color var(--mv-rapido) var(--mv-curva),
              transform var(--mv-rapido) var(--mv-curva);
}
.mv-boton:active:not(:disabled, [aria-disabled="true"]) { transform: translateY(1px); }

.mv-boton--primario { background: var(--acento); color: var(--acento-sobre); }
.mv-boton--primario:hover { background: color-mix(in srgb, var(--acento) 88%, #000); }

.mv-boton--secundario { background: var(--mv-superficie); color: var(--mv-tinta); border-color: var(--mv-borde-campo); }
.mv-boton--secundario:hover { background: var(--mv-superficie-2); }

.mv-boton--fantasma { background: transparent; color: var(--acento-texto); }
.mv-boton--fantasma:hover { background: var(--acento-suave); }

.mv-boton--peligro { background: var(--mv-peligro); color: #FFFFFF; }
.mv-boton--peligro:hover { background: color-mix(in srgb, var(--mv-peligro) 85%, #000); }

/* Desactivado: que se LEA (no gris clarito sobre gris), pero que se note que no va */
.mv-boton:disabled, .mv-boton[aria-disabled="true"] {
  background: var(--mv-superficie-2); color: var(--mv-texto-2);
  border-color: transparent; cursor: not-allowed; box-shadow: none;
}
.mv-boton--fantasma:disabled { background: transparent; }

/* Esperando respuesta: <button class="mv-boton mv-boton--primario" aria-busy="true"> */
.mv-boton[aria-busy="true"] { cursor: progress; }
.mv-boton[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: mv-girar .7s linear infinite;
}

.mv-boton--pequeno { min-height: 36px; padding: 0 var(--mv-e-3); font-size: var(--mv-t-13); }
.mv-boton--ancho { width: 100%; }
.mv-boton--icono { width: var(--mv-control); padding: 0; }
.mv-pistola .mv-boton { font-size: var(--mv-t-17); padding-inline: var(--mv-e-5); }

/* ================================================================== campos */
.mv-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mv-campo__etiqueta { font-size: var(--mv-t-13); font-weight: var(--mv-peso-medio); color: var(--mv-tinta); }
.mv-campo__etiqueta .mv-opcional { font-weight: var(--mv-peso-normal); color: var(--mv-texto-3); }
.mv-campo__control {
  width: 100%; min-height: var(--mv-control); padding: 0 var(--mv-e-3);
  background: var(--mv-superficie); color: var(--mv-tinta);
  border: 1px solid var(--mv-borde-campo); border-radius: var(--mv-r-2);
  font-size: var(--mv-t-15);
  transition: border-color var(--mv-rapido) var(--mv-curva);
}
textarea.mv-campo__control { padding: 10px var(--mv-e-3); min-height: 96px; resize: vertical; line-height: 1.5; }
select.mv-campo__control {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.mv-campo__control::placeholder { color: var(--mv-texto-3); opacity: 1; }
.mv-campo__control:hover { border-color: var(--mv-texto-2); }
.mv-campo__control:focus-visible { outline: var(--mv-foco-ancho) solid var(--mv-oro-foco); outline-offset: var(--mv-foco-hueco); border-color: var(--mv-oro-foco); }
.mv-campo__control:disabled { background: var(--mv-superficie-2); color: var(--mv-texto-2); border-style: dashed; cursor: not-allowed; }
.mv-campo__control[readonly] { background: var(--mv-fondo); }
.mv-campo__ayuda { font-size: var(--mv-t-13); color: var(--mv-texto-2); }
.mv-campo__error { display: none; align-items: flex-start; gap: 6px; font-size: var(--mv-t-13); font-weight: var(--mv-peso-medio); color: var(--mv-mal); }
.mv-campo__error .mv-icono { width: 16px; height: 16px; margin-top: 2px; }
.mv-campo--error .mv-campo__control { border-color: var(--mv-mal); box-shadow: inset 0 0 0 1px var(--mv-mal); }
.mv-campo--error .mv-campo__error { display: flex; }

/* Campo con icono delante (buscador) */
.mv-campo__caja { position: relative; display: flex; align-items: center; }
.mv-campo__caja > .mv-icono { position: absolute; left: 12px; color: var(--mv-texto-3); pointer-events: none; }
.mv-campo__caja > .mv-campo__control { padding-left: 40px; }

/* Casilla y opción: el navegador las pinta con el color de acento */
.mv-casilla { display: inline-flex; align-items: center; gap: var(--mv-e-2); min-height: var(--mv-control); cursor: pointer; }
.mv-casilla input { width: 20px; height: 20px; margin: 0; accent-color: var(--acento); }

/* ================================================================== tarjeta */
.mv-tarjeta {
  background: var(--mv-superficie); border: 1px solid var(--mv-borde);
  border-radius: var(--mv-r-3); box-shadow: var(--mv-sombra-1);
  padding: var(--mv-e-5); min-width: 0;
}
.mv-tarjeta__cabecera { display: flex; align-items: center; justify-content: space-between; gap: var(--mv-e-3); margin-bottom: var(--mv-e-4); flex-wrap: wrap; }
.mv-tarjeta__titulo { font-size: var(--mv-t-17); font-weight: var(--mv-peso-fuerte); }
.mv-tarjeta__pie { margin-top: var(--mv-e-4); padding-top: var(--mv-e-4); border-top: 1px solid var(--mv-borde); display: flex; gap: var(--mv-e-2); justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 480px) { .mv-tarjeta { padding: var(--mv-e-4); } }

/* ================================================================== tabla
   <div class="mv-tabla-caja"><table class="mv-tabla">…</table></div>
   - la cabecera se queda fija al bajar dentro de la caja (pon max-height a la caja);
   - columnas de números con class="mv-num" en th y td;
   - con mv-tabla--apilable, en el móvil cada fila pasa a ser una tarjeta: cada td
     necesita data-titulo="Nombre de la columna". */
.mv-tabla-caja {
  overflow: auto; max-width: 100%;
  background: var(--mv-superficie); border: 1px solid var(--mv-borde); border-radius: var(--mv-r-3);
}
.mv-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--mv-t-15); }
.mv-tabla th, .mv-tabla td { padding: 10px var(--mv-e-4); text-align: left; border-bottom: 1px solid var(--mv-borde); vertical-align: middle; }
.mv-tabla thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--mv-superficie); color: var(--mv-texto-2);
  font-size: var(--mv-t-13); font-weight: var(--mv-peso-fuerte); white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--mv-borde-campo);
}
.mv-tabla th.mv-num, .mv-tabla td.mv-num { text-align: right; }
.mv-tabla tbody tr:last-child td { border-bottom: 0; }
.mv-tabla tbody tr:hover td { background: var(--mv-fondo); }
.mv-tabla tbody tr[aria-selected="true"] td { background: var(--acento-suave); }
.mv-tabla tfoot td { font-weight: var(--mv-peso-fuerte); border-top: 1px solid var(--mv-borde-campo); border-bottom: 0; }
.mv-tabla--compacta th, .mv-tabla--compacta td { padding-block: 6px; }

@media (max-width: 640px) {
  .mv-tabla-caja:has(.mv-tabla--apilable) { background: transparent; border: 0; overflow: visible; max-height: none !important; }
  .mv-tabla--apilable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mv-tabla--apilable, .mv-tabla--apilable tbody, .mv-tabla--apilable tfoot { display: block; }
  .mv-tabla--apilable tr {
    display: block; background: var(--mv-superficie); border: 1px solid var(--mv-borde);
    border-radius: var(--mv-r-3); padding: var(--mv-e-2) var(--mv-e-4); margin-bottom: var(--mv-e-3);
  }
  .mv-tabla--apilable td, .mv-tabla--apilable tfoot td {
    display: flex; justify-content: space-between; align-items: center; gap: var(--mv-e-4);
    padding: 8px 0; border: 0; border-bottom: 1px solid var(--mv-borde); text-align: right; min-width: 0;
  }
  .mv-tabla--apilable td:last-child { border-bottom: 0; }
  .mv-tabla--apilable td::before {
    content: attr(data-titulo); flex: none; max-width: 50%; text-align: left;
    font-size: var(--mv-t-13); color: var(--mv-texto-2); font-weight: var(--mv-peso-medio);
  }
  .mv-tabla--apilable td:first-child { font-weight: var(--mv-peso-fuerte); }
  .mv-tabla--apilable tbody tr:hover td { background: none; }
  .mv-tabla--apilable tbody tr[aria-selected="true"] { background: var(--acento-suave); border-color: var(--acento); }
  .mv-tabla--apilable tbody tr[aria-selected="true"] td { background: none; }
  .mv-tabla--apilable td:empty { display: none; }               /* celdas vacías (p. ej. en el total) fuera */
  .mv-tabla--apilable td[data-titulo=""]::before { display: none; }
}

/* ================================================================== chip de estado (semáforo)
   Siempre color + icono + palabra:
   <span class="mv-chip mv-chip--bien"><svg class="mv-icono">…#circle-check</svg>Cargado</span> */
.mv-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px; padding: 2px 10px 2px 8px; border-radius: var(--mv-r-redondo);
  font-size: var(--mv-t-13); font-weight: var(--mv-peso-medio); line-height: 1.3; white-space: nowrap;
  background: var(--mv-superficie-2); color: var(--mv-texto-2);
}
.mv-chip .mv-icono { width: 14px; height: 14px; stroke-width: 2.25; }
.mv-chip--bien  { background: var(--mv-bien-suave);  color: var(--mv-bien); }
.mv-chip--aviso { background: var(--mv-aviso-suave); color: var(--mv-aviso); }
.mv-chip--mal   { background: var(--mv-mal-suave);   color: var(--mv-mal); }
.mv-chip--info  { background: var(--mv-info-suave);  color: var(--mv-info); }
.mv-chip--marca { background: var(--acento-suave);   color: var(--acento-texto); }

/* ================================================================== cabecera de app
   logo + nombre de la app · (navegación) · usuario y salir */
.mv-cabecera {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--mv-e-4);
  min-height: 60px; padding: env(safe-area-inset-top, 0px) var(--mv-e-5) 0;
  background: var(--mv-superficie); border-bottom: 1px solid var(--mv-borde);
}
.mv-cabecera__marca { display: flex; align-items: center; gap: var(--mv-e-3); min-width: 0; text-decoration: none; color: inherit; }
.mv-cabecera__logo { height: 32px; width: auto; display: block; flex: none; }
.mv-cabecera__logo--oscuro { display: none; }
.mv-cabecera__separador { width: 1px; height: 24px; background: var(--mv-borde); flex: none; }
.mv-cabecera__app { font-size: var(--mv-t-17); font-weight: var(--mv-peso-fuerte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.mv-cabecera__nav { display: flex; gap: var(--mv-e-1); margin-left: var(--mv-e-4); }
.mv-cabecera__nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--mv-e-3);
  border-radius: var(--mv-r-2); color: var(--mv-texto-2); text-decoration: none; font-weight: var(--mv-peso-medio);
}
.mv-cabecera__nav a:hover { background: var(--mv-superficie-2); color: var(--mv-tinta); }
.mv-cabecera__nav a[aria-current="page"] { color: var(--mv-tinta); box-shadow: inset 0 -2px 0 var(--acento); border-radius: 0; }
.mv-cabecera__usuario { margin-left: auto; display: flex; align-items: center; gap: var(--mv-e-2); min-width: 0; }
.mv-cabecera__nombre { font-size: var(--mv-t-13); color: var(--mv-texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mv-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--acento-suave); color: var(--acento-texto);
  font-size: var(--mv-t-12); font-weight: var(--mv-peso-fuerte); letter-spacing: .02em;
}
:root[data-theme="dark"] .mv-cabecera__logo--claro { display: none; }
:root[data-theme="dark"] .mv-cabecera__logo--oscuro { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mv-cabecera__logo--claro { display: none; }
  :root:not([data-theme="light"]) .mv-cabecera__logo--oscuro { display: block; }
}
@media (max-width: 760px) {
  .mv-cabecera { padding-inline: var(--mv-e-4); gap: var(--mv-e-2); }
  .mv-cabecera__nav, .mv-cabecera__nombre { display: none; }
}
@media (max-width: 400px) {
  .mv-cabecera__logo { height: 22px; }
  .mv-cabecera__app { font-size: var(--mv-t-15); }
}

/* ================================================================== pantalla de entrada
   Una columna, un logo, un botón «Entrar con Microsoft» y un enlace secundario. */
.mv-entrada {
  min-height: 100dvh; display: grid; place-items: center;
  padding: var(--mv-e-6) var(--mv-e-4); background: var(--mv-fondo);
}
.mv-entrada__caja { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--mv-e-4); }
.mv-entrada__logo { width: 200px; max-width: 70%; height: auto; margin-bottom: var(--mv-e-4); }
.mv-entrada__logo--oscuro { display: none; }
:root[data-theme="dark"] .mv-entrada__logo--claro { display: none; }
:root[data-theme="dark"] .mv-entrada__logo--oscuro { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mv-entrada__logo--claro { display: none; }
  :root:not([data-theme="light"]) .mv-entrada__logo--oscuro { display: block; }
}
.mv-entrada__titulo { font-size: var(--mv-t-24); font-weight: var(--mv-peso-fuerte); letter-spacing: -.01em; }
.mv-entrada__texto { margin: 0; color: var(--mv-texto-2); }
.mv-entrada__acciones { width: 100%; display: flex; flex-direction: column; gap: var(--mv-e-3); margin-top: var(--mv-e-3); }
.mv-entrada__pie { margin-top: var(--mv-e-6); font-size: var(--mv-t-12); color: var(--mv-texto-3); }
/* Botón de Microsoft: blanco con su logo, como pide su guía de marca */
.mv-boton--microsoft { background: var(--mv-superficie); color: var(--mv-tinta); border-color: var(--mv-borde-campo); font-weight: var(--mv-peso-fuerte); }
.mv-boton--microsoft:hover { background: var(--mv-superficie-2); }
.mv-boton--microsoft .mv-logo-ms { width: 18px; height: 18px; flex: none; }

/* ================================================================== aviso en página y toast */
.mv-aviso {
  display: flex; align-items: flex-start; gap: var(--mv-e-3);
  padding: var(--mv-e-3) var(--mv-e-4); border-radius: var(--mv-r-2);
  background: var(--mv-info-suave); color: var(--mv-tinta);
  border-left: 3px solid var(--mv-info);
}
.mv-aviso > .mv-icono { color: var(--mv-info); margin-top: 2px; }
.mv-aviso__cuerpo { flex: 1; min-width: 0; }
.mv-aviso__titulo { font-weight: var(--mv-peso-fuerte); }
.mv-aviso__texto { margin: 2px 0 0; color: var(--mv-texto-2); font-size: var(--mv-t-13); }
.mv-aviso--bien  { background: var(--mv-bien-suave);  border-left-color: var(--mv-bien); }
.mv-aviso--bien  > .mv-icono { color: var(--mv-bien); }
.mv-aviso--aviso { background: var(--mv-aviso-suave); border-left-color: var(--mv-aviso); }
.mv-aviso--aviso > .mv-icono { color: var(--mv-aviso); }
.mv-aviso--mal   { background: var(--mv-mal-suave);   border-left-color: var(--mv-mal); }
.mv-aviso--mal   > .mv-icono { color: var(--mv-mal); }
.mv-aviso__cerrar { margin: -6px -8px -6px 0; min-height: 36px; width: 36px; padding: 0; color: var(--mv-texto-2); }

/* Los toasts van en <div class="mv-toasts" role="status" aria-live="polite"> */
.mv-toasts {
  position: fixed; z-index: 100; right: var(--mv-e-5); bottom: var(--mv-e-5);
  display: flex; flex-direction: column; gap: var(--mv-e-2); width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.mv-toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--mv-e-3);
  padding: var(--mv-e-3) var(--mv-e-3) var(--mv-e-3) var(--mv-e-4);
  background: var(--mv-tinta); color: var(--mv-fondo);
  border-radius: var(--mv-r-2); box-shadow: var(--mv-sombra-2);
  font-size: var(--mv-t-15);
  animation: mv-entrar var(--mv-normal) var(--mv-curva) both;
}
.mv-toast__texto { flex: 1; min-width: 0; }
.mv-toast .mv-boton { min-height: 32px; color: inherit; padding: 0 var(--mv-e-2); }
.mv-toast .mv-boton:hover { background: rgb(127 127 127 / .2); }
.mv-toast--bien  > .mv-icono { color: #86D19A; }
.mv-toast--mal   > .mv-icono { color: #F4A79F; }
.mv-toast--aviso > .mv-icono { color: #F2B866; }
:root[data-theme="dark"] .mv-toast--bien > .mv-icono { color: #166534; }
:root[data-theme="dark"] .mv-toast--mal > .mv-icono { color: #B3261E; }
:root[data-theme="dark"] .mv-toast--aviso > .mv-icono { color: #B45309; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mv-toast--bien > .mv-icono { color: #166534; }
  :root:not([data-theme="light"]) .mv-toast--mal > .mv-icono { color: #B3261E; }
  :root:not([data-theme="light"]) .mv-toast--aviso > .mv-icono { color: #B45309; }
}
@media (max-width: 480px) { .mv-toasts { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: auto; } }

/* ================================================================== estados: vacío, error, cargando */
.mv-estado {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--mv-e-2);
  padding: var(--mv-e-7) var(--mv-e-4); color: var(--mv-texto-2);
}
.mv-estado__icono {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mv-superficie-2); color: var(--mv-texto-2); margin-bottom: var(--mv-e-2);
}
.mv-estado__titulo { font-size: var(--mv-t-17); font-weight: var(--mv-peso-fuerte); color: var(--mv-tinta); }
.mv-estado__texto { margin: 0; max-width: 42ch; }
.mv-estado .mv-boton { margin-top: var(--mv-e-3); }
.mv-estado--error .mv-estado__icono { background: var(--mv-mal-suave); color: var(--mv-mal); }

/* Esqueleto mientras carga: bloques grises que respiran (quietos si el usuario lo pide) */
.mv-esqueleto {
  display: block; height: 14px; border-radius: var(--mv-r-1);
  background: var(--mv-superficie-2);
  animation: mv-respirar 1.4s ease-in-out infinite;
}
.mv-esqueleto--titulo { height: 22px; width: 40%; }
.mv-esqueleto--cifra { height: 36px; width: 60%; }
.mv-esqueleto--corto { width: 30%; }
.mv-esqueleto--medio { width: 65%; }

/* ================================================================== tarjeta de indicador (KPI) */
.mv-indicador { display: flex; flex-direction: column; gap: var(--mv-e-1); }
.mv-indicador__nombre { font-size: var(--mv-t-13); font-weight: var(--mv-peso-medio); color: var(--mv-texto-2); }
.mv-indicador__cifra {
  font-size: var(--mv-t-32); font-weight: var(--mv-peso-fuerte); line-height: 1.1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--mv-tinta); overflow-wrap: anywhere;
}
.mv-indicador__unidad { font-size: var(--mv-t-17); font-weight: var(--mv-peso-medio); color: var(--mv-texto-2); margin-left: 2px; letter-spacing: 0; }
.mv-indicador__pie { display: flex; align-items: center; justify-content: space-between; gap: var(--mv-e-3); margin-top: var(--mv-e-2); flex-wrap: wrap; }
/* La variación lleva color según si es BUENA o MALA (no según si sube o baja):
   más ventas sube y es bien; más bajas sube y es mal. */
.mv-variacion { display: inline-flex; align-items: center; gap: 4px; font-size: var(--mv-t-13); font-weight: var(--mv-peso-fuerte); font-variant-numeric: tabular-nums; color: var(--mv-texto-2); }
.mv-variacion .mv-icono { width: 16px; height: 16px; }
.mv-variacion--bien { color: var(--mv-bien); }
.mv-variacion--mal { color: var(--mv-mal); }
.mv-variacion__contra { font-weight: var(--mv-peso-normal); color: var(--mv-texto-3); }
.mv-linea { width: 96px; height: 32px; flex: none; color: var(--acento-texto); overflow: visible; }
.mv-linea polyline { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mv-linea circle { fill: currentColor; }

/* ================================================================== animaciones */
@keyframes mv-girar { to { transform: rotate(360deg); } }
@keyframes mv-respirar { 50% { opacity: .5; } }
@keyframes mv-entrar { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .mv-esqueleto, .mv-toast { animation: none; }
  .mv-boton { transition: none; }
}

/* ================================================================== impresión: sin adornos */
@media print {
  .mv-cabecera, .mv-toasts, .mv-boton { display: none !important; }
  .mv-tarjeta, .mv-tabla-caja { box-shadow: none; border-color: #999; }
  .mv-tabla thead th { position: static; }
}
