/* Gestión de tienda · JAX Technology. Misma visual que el control de la demo de
   TECNO-AR (barra lateral oscura agrupada, tarjetas blancas, acento rojo, estados en
   pastilla), con la tipografía y el logo de JAX. */
:root {
  --bg: #f2f2f0;
  --surface: #fff;
  --surface2: #f8f8f7;
  --ink: #17181a;
  --muted: #5f6368;
  --line: #dedfdf;
  --red: #d4141c;
  --redsoft: #fff0f1;
  --green: #1a7f52;
  --greensoft: #e8f6ef;
  --amber: #925700;
  --ambersoft: #fff5df;
  --blue: #2a63b4;
  --bluesoft: #ecf3ff;
  --purple: #6a4fb0;
  --purplesoft: #f1edfb;
  --shadow: 0 18px 48px rgba(17, 18, 20, 0.07);
  --radius: 18px;
  --sidebar: 264px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- acceso */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #151619; }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 22px; padding: 32px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.login-card img { border-radius: 12px; }
.login-card h1 { margin: 6px 0 0; font-size: 28px; letter-spacing: -0.03em; }
.login-card > p { margin: 0 0 6px; color: var(--muted); }
.clave { display: flex; gap: 8px; }
.clave input { flex: 1; min-width: 0; }

/* ---------- estructura */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #151619; color: #fff;
  display: flex; flex-direction: column; overflow: auto; z-index: 30;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.brand img { border-radius: 10px; }
.brand strong { display: block; font-size: 16px; letter-spacing: -0.01em; }
.brand small { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: rgba(255, 255, 255, 0.62); font-size: 11px; }
.brand small i { width: 8px; height: 8px; border-radius: 50%; background: #34c87a; box-shadow: 0 0 0 4px rgba(52, 200, 122, 0.12); }
.nav-block { padding: 10px 12px 24px; display: grid; gap: 3px; position: relative; }
/* Píldora que se desliza entre módulos (panel.js la mueve con top/bottom: dos bordes, dos tiempos). */
.pildora { position: absolute; left: 12px; right: 12px; border-radius: 11px; background: #fff; pointer-events: none; z-index: 0; }
.nav-block > a, .nav-block > .nav-label { position: relative; z-index: 1; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; font-weight: 800; color: rgba(255, 255, 255, 0.45); padding: 16px 11px 7px; }
.nav-block a {
  min-height: 42px; border-radius: 11px; color: rgba(255, 255, 255, 0.78); display: flex; align-items: center; gap: 11px;
  padding: 0 12px; font-weight: 700; font-size: 13px; text-decoration: none; transition: background 0.18s, color 0.18s;
}
.nav-block a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-block a[aria-current='page'] { color: #141517; }
.nav-block:not(.con-pildora) a[aria-current='page'] { background: #fff; }
.contador { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 11px; display: grid; place-items: center; }
.contador:empty { display: none; }
.contador.alerta { background: var(--red); color: #fff; }
[aria-current='page'] .contador { background: var(--ink); color: #fff; }
.main { margin-left: var(--sidebar); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 70px; background: rgba(242, 242, 240, 0.93); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(17, 18, 20, 0.08); display: flex; align-items: center; gap: 12px; padding: 12px 26px; flex-wrap: wrap;
}
.espacio { flex: 1; }
.live-pill, .usuario-chip {
  min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #31ba72; box-shadow: 0 0 0 4px rgba(49, 186, 114, 0.13); }
.live-pill.error i { background: var(--red); box-shadow: 0 0 0 4px rgba(212, 20, 28, 0.13); }
.usuario-chip b { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.btn.menu-movil { display: none; }
.velo { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 25; }
.contenido { padding: 28px 28px 64px; max-width: 1600px; margin: auto; outline: none; }
.encabezado { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 20px; }
.encabezado h1 { font-size: clamp(28px, 3vw, 42px); letter-spacing: -0.045em; line-height: 1; margin: 0 0 10px; }
.encabezado p { margin: 0; color: var(--muted); max-width: 820px; text-align: justify; hyphens: manual; }

/* ---------- botones y campos */
.btn {
  min-height: 40px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); padding: 0 14px;
  font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(0, 0, 0, 0.07); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; border-radius: 9px; padding: 0 11px; font-size: 12px; }
.btn.icono { width: 42px; padding: 0; }
label { display: grid; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #3d4045; }
input, select, textarea {
  min-height: 42px; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 8px 12px; font-size: 14px;
  font-weight: 500; letter-spacing: 0; text-transform: none; width: 100%;
}
textarea { min-height: 70px; resize: vertical; }
.aviso { margin: 0; color: var(--red); font-weight: 700; }
.aviso-panel { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: var(--greensoft); color: #0f5537; font-weight: 700; }
.aviso-panel.error { background: var(--redsoft); color: #a10f16; }

/* ---------- tarjetas, métricas y flujo */
.tarjeta { background: var(--surface); border: 1px solid rgba(17, 18, 20, 0.06); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; min-width: 0; }
.tarjeta > header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin: -2px 0 14px; }
.tarjeta h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.01em; }
.tarjeta header p { margin: 0; color: var(--muted); font-size: 12px; }
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metrica {
  display: grid; gap: 4px; align-content: start; background: #fff; border: 1px solid rgba(17, 18, 20, 0.06); border-radius: 16px;
  padding: 16px; color: inherit; text-decoration: none; box-shadow: var(--shadow); min-height: 112px;
}
.metrica span { font-size: 10px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: #4c5056; }
.metrica strong { font-size: 32px; letter-spacing: -0.04em; line-height: 1.1; }
.metrica small { color: var(--muted); font-size: 12px; }
a.metrica:hover { border-color: var(--ink); }
.flujo {
  position: relative; overflow: hidden; background: #151619; color: #fff; border-radius: 22px; padding: 26px; margin-bottom: 18px;
}
.flujo::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; right: -90px; top: -110px; border: 54px solid rgba(212, 20, 28, 0.2); }
.eyebrow { margin: 0 0 6px; color: #ff6b71; font-size: 11px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.flujo h2 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.04em; }
.flujo > p { margin: 0 0 18px; color: rgba(255, 255, 255, 0.72); max-width: 760px; text-align: justify; hyphens: manual; position: relative; z-index: 1; }
.pasos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; position: relative; z-index: 1; }
.pasos a { border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px; padding: 12px; color: #fff; text-decoration: none; display: grid; gap: 2px; }
.pasos a:hover { border-color: #fff; }
.pasos b { font-size: 24px; }
.pasos span { font-size: 11px; color: rgba(255, 255, 255, 0.68); }
.columnas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.columnas > .tarjeta { margin-bottom: 0; }
.columnas > .ancho { grid-column: 1 / -1; }

/* ---------- filtros, tablas y paginación */
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.filtros label:first-child { grid-column: span 2; }
.tabla-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #4c5056; background: var(--surface2); padding: 11px 12px; white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.acciones { text-align: right; white-space: nowrap; }
td.acciones .btn + .btn { margin-left: 6px; }
.identidad strong { display: block; }
.identidad small { color: var(--muted); }
code.sku { font-size: 11px; color: var(--muted); }
.vacio { margin: 0; padding: 22px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.paginacion { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--surface2); color: #3d4045; }
.pill.verde { background: var(--greensoft); color: var(--green); }
.pill.ambar { background: var(--ambersoft); color: var(--amber); }
.pill.azul { background: var(--bluesoft); color: var(--blue); }
.pill.morado { background: var(--purplesoft); color: var(--purple); }
.pill.rojo { background: var(--redsoft); color: #a10f16; }
.lista { display: grid; gap: 10px; }
.fila { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.fila > div:first-child { min-width: 0; }
.fila .derecha { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }

/* ---------- precios */
.precio-nuevo { width: 140px; min-height: 36px; text-align: right; }
tr.editado td { background: #fffaf0; }
.lote { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 14px; margin-bottom: 14px; border-radius: 14px; background: var(--bluesoft); }
.lote strong { align-self: center; flex-basis: 100%; }
.lote label { min-width: 150px; }
.guardar-precios {
  position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 14px; padding: 14px;
  background: #151619; color: #fff; border-radius: 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}
.guardar-precios label { color: rgba(255, 255, 255, 0.8); flex: 1; min-width: 220px; }
.guardar-precios span { align-self: center; font-weight: 800; }
.guardar-precios .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, 0.35); }

/* ---------- ventas */
.barras { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 190px; padding-top: 18px; }
.barra { display: grid; justify-items: center; align-content: end; gap: 6px; height: 100%; min-width: 0; }
.barra i { width: 100%; max-width: 26px; background: var(--red); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.barra small { font-size: 10px; color: var(--muted); }
.ventas-total { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.ventas-total b { font-size: 18px; display: block; }

/* ---------- diálogo */
dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 0; border-radius: 20px; padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 11, 12, 0.5); }
dialog > header { position: sticky; top: 0; background: #fff; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
dialog h2 { margin: 0; font-size: 19px; }
dialog .aviso-panel { margin: 16px 22px 0; }
#dialogo-contenido { padding: 18px 22px 24px; display: grid; gap: 18px; }
.bloque h3 { margin: 0 0 10px; font-size: 14px; }
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin: 0; }
.campos dt { font-size: 10px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: #4c5056; }
.campos dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.acciones-detalle { display: flex; flex-wrap: wrap; gap: 8px; }
.formulario { display: grid; gap: 12px; }
.formulario.en-linea { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.linea-tiempo { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.linea-tiempo li { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.linea-tiempo small { color: var(--muted); display: block; }
.linea-tiempo p { margin: 4px 0 0; text-align: justify; hyphens: manual; }
blockquote { margin: 0; padding: 12px 14px; background: var(--surface2); border-radius: 12px; color: #3d4045; text-align: justify; hyphens: manual; }
.check { display: flex; gap: 10px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }
.check input { width: 18px; min-height: 18px; }

/* ---------- pestañas y enlaces */
.pestanas { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; background: #e8e8e5; border-radius: 13px; max-width: 100%; overflow-x: auto; }
.pestanas button { min-height: 38px; border: 0; border-radius: 10px; background: transparent; padding: 0 16px; font-weight: 800; font-size: 13px; color: #4c5056; white-space: nowrap; transition: background 0.18s, color 0.18s; }
.pestanas button:hover { color: var(--ink); }
.pestanas button.activa { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.enlace { border: 0; background: none; padding: 0; font-weight: 800; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.nota { margin: 0; color: var(--muted); font-size: 13px; text-align: justify; hyphens: manual; }
.aviso-ambar { background: var(--ambersoft); color: var(--amber); }
.aviso-ambar .enlace { color: var(--amber); }

/* ---------- inicio: tareas */
.tareas { display: grid; gap: 10px; }
.tarea { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 10px 10px; animation: entra 0.38s both; animation-delay: calc(var(--i) * 60ms); }
.tarea-n { display: grid; place-items: center; height: 44px; border-radius: 12px; background: var(--redsoft); color: var(--red); font-size: 22px; letter-spacing: -0.03em; }
.tarea span { font-weight: 700; }

/* ---------- pedidos: tablero */
.tablero { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.columna { background: #e9e9e6; border-radius: 16px; padding: 12px; min-width: 0; display: grid; gap: 10px; }
.columna > header { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 2px 4px 6px; }
.columna h2 { margin: 0; font-size: 14px; }
.columna header span { background: var(--ink); color: #fff; border-radius: 999px; min-width: 24px; height: 22px; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.columna header small { grid-column: 1 / -1; color: var(--muted); font-weight: 700; }
.columna .vacio { padding: 16px; background: transparent; font-size: 13px; }
.pedido { display: grid; gap: 7px; background: #fff; border-radius: 13px; padding: 12px; box-shadow: 0 2px 10px rgba(17, 18, 20, 0.07); cursor: pointer; transition: transform 0.18s, box-shadow 0.18s; min-width: 0; }
.pedido:hover, .pedido:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(17, 18, 20, 0.12); }
.pedido-cab { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pedido-cab small { color: var(--muted); font-weight: 700; }
.pedido-prod { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.pedido-pie { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 2px; }
.pedido.llega { animation: llega 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes llega { from { transform: translateX(-46px) scale(0.96); opacity: 0; box-shadow: 0 0 0 3px rgba(212, 20, 28, 0.35); } to { transform: none; opacity: 1; } }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.vista { animation: entra 0.28s both; }
/* Al ENTRAR a un módulo (panel.js pone .entrando ~0,9 s) los bloques llegan escalonados y las barras crecen.
   En los refrescos automáticos no se anima nada: así se nota solo lo que de verdad cambió. */
@media (prefers-reduced-motion: no-preference) {
  .vista.entrando > * { animation: entra 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: 0ms; }
  .vista.entrando .barra i { transform-origin: bottom; animation: crece 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 25ms + 120ms); }
  .vista.entrando .fin-pista i { transform-origin: left; animation: creceX 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: 150ms; }
  .vista.entrando .metrica, .vista.entrando .caja-cifra { animation: entra 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .vista.entrando > *:nth-child(2), .vista.entrando .metrica:nth-child(2), .vista.entrando .caja-cifra:nth-child(2) { animation-delay: 60ms; }
  .vista.entrando > *:nth-child(3), .vista.entrando .metrica:nth-child(3), .vista.entrando .caja-cifra:nth-child(3) { animation-delay: 120ms; }
  .vista.entrando > *:nth-child(4), .vista.entrando .metrica:nth-child(4), .vista.entrando .caja-cifra:nth-child(4) { animation-delay: 180ms; }
  .vista.entrando > *:nth-child(5), .vista.entrando .metrica:nth-child(5), .vista.entrando .caja-cifra:nth-child(5) { animation-delay: 240ms; }
  .vista.entrando > *:nth-child(6), .vista.entrando .metrica:nth-child(6), .vista.entrando .caja-cifra:nth-child(6) { animation-delay: 300ms; }
  .vista.entrando > *:nth-child(7), .vista.entrando .metrica:nth-child(7), .vista.entrando .caja-cifra:nth-child(7) { animation-delay: 360ms; }
  .vista.entrando > *:nth-child(8), .vista.entrando .metrica:nth-child(8), .vista.entrando .caja-cifra:nth-child(8) { animation-delay: 420ms; }
}
@keyframes creceX { from { transform: scaleX(0); } to { transform: none; } }
@keyframes crece { from { transform: scaleY(0); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .vista, .vista * { animation: none !important; } }

/* ---------- productos: ficha, cifras */
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.caja-cifra { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 13px; padding: 12px; background: var(--surface2); }
.caja-cifra span { font-size: 10px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: #4c5056; }
.caja-cifra strong { font-size: 20px; letter-spacing: -0.02em; }
.caja-cifra.verde { background: var(--greensoft); border-color: transparent; }
.caja-cifra.verde strong { color: var(--green); }
.caja-cifra.rojo { background: var(--redsoft); border-color: transparent; }
.caja-cifra.rojo strong { color: #a10f16; }
.caja-cifra.ambar { background: var(--ambersoft); border-color: transparent; }
.caja-cifra.morado { background: var(--purplesoft); border-color: transparent; }
.bloque { display: grid; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.bloque:last-child { border-bottom: 0; }

/* ---------- balance */
.fin-barra { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.fin-barra b { font-variant-numeric: tabular-nums; }
.fin-pista { height: 14px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.fin-pista i { display: block; height: 100%; border-radius: 999px; transform-origin: left; animation: crece-ancho 0.7s both; }
@keyframes crece-ancho { from { transform: scaleX(0); } to { transform: none; } }
.fin-pista .azul { background: var(--blue); }
.fin-pista .rojo { background: var(--red); }
.fin-pista .verde { background: var(--green); }
.bal-fila { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); }
.bal-fila:first-of-type { border-top: 0; }
.bal-fila span small { display: block; color: var(--muted); font-size: 12px; }
.bal-fila b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bal-doble { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.bal-doble .bal-fila:nth-child(2) { border-top: 0; }

/* ---------- ficha lateral: el diálogo entra desde la derecha y no tapa la lista entera */
dialog[open] { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(620px, 100vw); border-radius: 22px 0 0 22px; animation: lateral 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
dialog[open]::backdrop { animation: velar 0.3s both; }
/* Ventanas emergentes: cada bloque entra escalonado y los botones llevan las animaciones de botones-vivos.css (23-11-2026). */
@media (prefers-reduced-motion: no-preference) {
  @keyframes dlg-sube { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  dialog[open] #dialogo-contenido > * { animation: dlg-sube 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  dialog[open] #dialogo-contenido > *:nth-child(1) { animation-delay: 0.12s; }
  dialog[open] #dialogo-contenido > *:nth-child(2) { animation-delay: 0.18s; }
  dialog[open] #dialogo-contenido > *:nth-child(3) { animation-delay: 0.24s; }
  dialog[open] #dialogo-contenido > *:nth-child(4) { animation-delay: 0.30s; }
  dialog[open] #dialogo-contenido > *:nth-child(5) { animation-delay: 0.36s; }
  dialog[open] #dialogo-contenido > *:nth-child(n+6) { animation-delay: 0.42s; }
  dialog[open] > header { animation: dlg-sube 0.35s 0.05s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
}
@keyframes lateral { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes velar { from { opacity: 0; } to { opacity: 1; } }
.aviso-panel { animation: entra 0.25s both; }

/* ---------- móvil */
@media (max-width: 1100px) {
  .tablero { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
  .bal-doble { grid-template-columns: 1fr; }
  .bal-doble .bal-fila:nth-child(2) { border-top: 1px solid var(--line); }
  .pasos { grid-template-columns: repeat(3, 1fr); }
  .columnas { grid-template-columns: 1fr; }
  .columnas > .tarjeta { margin-bottom: 0; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.22s; box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3); }
  .sidebar.abierta { transform: none; }
  .main { margin-left: 0; }
  .btn.menu-movil { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .topbar .btn[href] { display: none; }
  .contenido { padding: 20px 16px 56px; }
  .filtros label:first-child { grid-column: auto; }
  .encabezado { flex-direction: column; align-items: stretch; }
}
@media (max-width: 560px) {
  .pasos { grid-template-columns: repeat(2, 1fr); }
  .metricas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metricas > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .metrica strong { font-size: 26px; }
  .usuario-chip span { display: none; }
  .fila { flex-direction: column; align-items: stretch; }
  .fila .derecha { justify-content: space-between; }
  .guardar-precios { bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- ayuda de estados */
.col-ayuda { grid-column: 1 / -1; color: var(--muted); font-weight: 500; font-size: 12px; line-height: 1.35; }
.pill[title] { cursor: help; }
dialog[open].ancho { width: min(1040px, 100vw); }
