/* ==========================================================================
   PEPTIDEX · sistema de diseño del rediseño (oct-2026)
   Dos modos que comparten tipografía, escala y componentes:
   - claro  (.tema-web)   → la web pública: blanco, negro y azul PEPTIDEX
   - cristal (.tema-panel) → panel del cliente, panel CEO y facturador
   Identidad de siempre (decidido con Jihan el 18-oct): blanco, negro, azul
   #1E5EFF y la PX Display; lo que cambia es la composición, no los colores.
   ========================================================================== */

@font-face {
  font-family: "PX Display";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(/assets/fonts/px-display.woff2) format("woff2");
}

:root {
  /* tipografía */
  --f-display: "PX Display", -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  /* Inter para leer y operar: altura de x generosa, cifras tabulares de verdad y
     buen comportamiento a 12-14 px en los paneles. Contraste de época con la
     PX Display geométrica de los titulares (decidido el 18-oct con web-typography). */
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* escala */
  --t-xs: 12px; --t-sm: 13px; --t-md: 15px; --t-lg: 17px;
  --t-h4: 22px; --t-h3: 28px; --t-h2: clamp(36px, 4.6vw, 60px); --t-h1: clamp(48px, 7vw, 96px);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* movimiento: una curva, cuatro duraciones */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --d-1: 120ms; --d-2: 200ms; --d-3: 320ms; --d-4: 560ms;

  /* paleta PEPTIDEX: blanco, negro, azul */
  --canvas: #ffffff;
  --surface-soft: #f5f5f7;
  --surface-card: #f4f5f7;
  --surface-strong: #e9eaef;
  --ink: #0a0a0a;
  --body: #1d1d1f;
  --muted: #6e6e73;
  --hair: #e5e5ea;
  --dark: #000000;
  --dark-2: #111113;
  --on-dark: #ffffff;
  --on-dark-soft: #a1a1a6;

  /* acento: el azul de la X del logo */
  --accent: #1e5eff;
  --accent-press: #1548c9;
  --accent-soft: rgba(30, 94, 255, .14);
  --accent-ink: #ffffff;

  /* estado */
  --ok: #5db872; --warn: #e8a55a; --bad: #d4574e; --info: #7ea6ff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-optical-sizing: auto; font-feature-settings: "cv11", "ss03"; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
.tema-panel { font-size: 14px; line-height: 1.45; }
.tema-panel p, .tema-panel li { text-wrap: pretty; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; font-variant-numeric: tabular-nums; }
a { color: inherit; }
.tnum, .num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: -.01em; }
.display { font-family: var(--f-display); font-weight: 500; letter-spacing: -.03em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }

/* el logo oficial: PX metálico con molécula. Dos versiones del mismo archivo:
   la clara (palabra azul marino) y la oscura (palabra en blanco, azul levantado).
   El contexto decide cuál se ve; nunca se invierte con filtros, que destrozan el metal. */
.logo { display: inline-flex; align-items: center; height: 40px; flex: none; }
.logo img { height: 100%; width: auto; display: block; }
.logo--grande { height: 84px; }
.logo .logo--o { display: none; }
.tema-panel .logo .logo--c, .sobre-oscuro .logo .logo--c { display: none; }
.tema-panel .logo .logo--o, .sobre-oscuro .logo .logo--o { display: block; }

/* ==========================================================================
   MODO CLARO · web pública
   ========================================================================== */
.tema-web { background: var(--canvas); color: var(--body); }
.tema-web h1, .tema-web h2, .tema-web h3 { font-family: var(--f-display); font-weight: 600; color: var(--ink); margin: 0; letter-spacing: -.035em; }
/* titular a dos tonos (Apple): la segunda frase en gris, no en cursiva */
.tema-web h1 em, .tema-web h2 em, .tema-web h3 em { font-style: normal; color: var(--muted); }
.tema-web h1 { font-size: var(--t-h1); line-height: 1.02; }
.tema-web h2 { font-size: var(--t-h2); line-height: 1.04; }
.tema-web h3 { font-size: var(--t-h3); line-height: 1.15; }
.tema-web p { margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: clamp(17px, 1rem + .3vw, 20px); line-height: 1.55; color: var(--body); max-width: 56ch; letter-spacing: -.005em; }

.envoltura { width: min(1200px, 100% - 32px); margin-inline: auto; }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--r-sm); border: 1px solid transparent; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background var(--d-2) var(--ease), border-color var(--d-2) var(--ease), transform var(--d-1) var(--ease); white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn--acento { background: var(--accent); color: var(--accent-ink); }
.btn--acento:hover { background: var(--accent-press); }
.btn--tinta { background: var(--ink); color: var(--canvas); }
.btn--tinta:hover { background: #2b2a27; }
.btn--linea { background: transparent; border-color: var(--hair); color: var(--ink); }
.btn--linea:hover { border-color: var(--ink); }
.btn--sobre-oscuro { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: var(--on-dark); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn--sobre-oscuro:hover { background: rgba(255,255,255,.14); }
.flecha { transition: transform var(--d-2) var(--ease); }
.btn:hover .flecha, a:hover > .flecha { transform: translateX(3px); }

/* navegación */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; transition: border-color var(--d-3) var(--ease); }
.nav.con-borde { border-bottom-color: var(--hair); }
.nav__fila { height: 68px; display: flex; align-items: center; gap: var(--s-6); }
.nav__enlaces { display: flex; gap: var(--s-5); margin-inline-start: auto; }
.nav__enlaces a { font-size: 14px; font-weight: 500; color: var(--body); text-decoration: none; padding: 6px 0; position: relative; }
.nav__enlaces a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform var(--d-3) var(--ease); }
.nav__enlaces a:hover { color: var(--ink); }
.nav__enlaces a:hover::after { transform: scaleX(1); }
.nav__acciones { display: flex; align-items: center; gap: var(--s-2); }
.icono-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; position: relative; transition: background var(--d-2) var(--ease); }
.icono-btn:hover { background: var(--surface-card); }
.icono-btn svg { width: 20px; height: 20px; }
.burbuja { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }
@media (max-width: 860px) { .nav__enlaces { display: none; } .nav__acciones { margin-inline-start: auto; } }

/* secciones */
.seccion { padding-block: var(--s-9); }
.seccion__cabecera { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: end; margin-bottom: var(--s-7); }
.seccion__cabecera .lead { justify-self: end; }
@media (max-width: 860px) { .seccion { padding-block: var(--s-8); } .seccion__cabecera { grid-template-columns: 1fr; gap: var(--s-4); } .seccion__cabecera .lead { justify-self: start; } }

/* lámina oscura: la superficie de producto donde viven las piezas WebGL */
.lamina { position: relative; border-radius: var(--r-xl); overflow: hidden; background: #000; color: var(--on-dark); isolation: isolate; }
.lamina > .lienzo { position: absolute; inset: 0; z-index: 0; }
.lamina > .lamina__contenido { position: relative; z-index: 1; }

/* pie */
.pie { background: var(--surface-soft); border-top: 1px solid var(--hair); padding-block: var(--s-8) var(--s-6); font-size: 14px; }
.pie__rejilla { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-6); }
.pie h4 { font-size: var(--t-xs); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-3); }
.pie ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pie a { text-decoration: none; color: var(--body); }
.pie a:hover { color: var(--ink); }
.pie__legal { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: var(--s-5); color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .pie__rejilla { grid-template-columns: 1fr 1fr; } .pie__legal { flex-direction: column; } }

/* ==========================================================================
   MODO CRISTAL · paneles
   ========================================================================== */
.tema-panel {
  --p-bg: #070707;
  --p-text: #f4f2ed;
  --p-soft: #a1a1a6;
  --p-mute: #6e6e73;
  --p-hair: rgba(255, 255, 255, .08);
  --p-hair-2: rgba(255, 255, 255, .14);
  --cristal: rgba(16, 17, 20, .34);
  --cristal-2: rgba(255, 255, 255, .045);
  --cristal-3: rgba(255, 255, 255, .075);
  --brillo: inset 0 1px 0 rgba(255, 255, 255, .07);
  background: var(--p-bg); color: var(--p-text); min-height: 100vh; min-height: 100dvh;
}
.tema-panel h1, .tema-panel h2, .tema-panel h3, .tema-panel h4 { margin: 0; color: var(--p-text); font-weight: 500; letter-spacing: -.01em; }
.tema-panel p { margin: 0; }

/* el fondo vivo: fijo detrás de todo */
.fondo-vivo { position: fixed; inset: 0; z-index: 0; }
.fondo-vivo::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 0%, rgba(7,7,7,.0) 30%, rgba(7,7,7,.55) 100%); pointer-events: none; }

/* superficies de cristal */
.cristal { background: var(--cristal); border: 1px solid var(--p-hair); border-radius: var(--r-xl); box-shadow: var(--brillo), 0 30px 80px -30px rgba(0,0,0,.7); backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%); }
.cristal-fila { background: var(--cristal-2); border: 1px solid var(--p-hair); border-radius: var(--r-md); box-shadow: var(--brillo); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cristal { background: rgba(16, 17, 20, .94); }
}
@media (prefers-reduced-transparency: reduce) {
  .cristal { background: rgba(16, 17, 20, .96); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* armazón del panel */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 16px; min-height: 100vh; min-height: 100dvh; }
.riel { position: sticky; top: 16px; height: calc(100vh - 32px); height: calc(100dvh - 32px); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; border-radius: 22px; }
.riel__marca { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 10px; }
.riel__marca img { width: 30px; filter: invert(1); }
.riel a, .riel button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--p-soft); border: 0; background: transparent; cursor: pointer; position: relative; transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.riel a:hover, .riel button:hover { background: var(--cristal-3); color: var(--p-text); }
.riel a[aria-current="page"] { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -8px var(--accent); }
.riel svg { width: 20px; height: 20px; }
.riel__fin { margin-top: auto; display: grid; gap: 6px; }
.riel a[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 54px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: #1d1c1a; color: var(--p-text); border: 1px solid var(--p-hair-2); font-size: 12px; padding: 6px 10px; border-radius: 8px; pointer-events: none; z-index: 5; }

.lienzo-panel { display: grid; grid-template-columns: minmax(0, 1fr) 340px; border-radius: 26px; overflow: hidden; min-width: 0; }
.principal { padding: 28px 30px 30px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.lateral { border-left: 1px solid var(--p-hair); padding: 24px 22px; display: flex; flex-direction: column; gap: 20px; background: rgba(255,255,255,.015); }
@media (max-width: 1180px) { .lienzo-panel { grid-template-columns: 1fr; } .lateral { border-left: 0; border-top: 1px solid var(--p-hair); } }
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .riel { position: fixed; z-index: 20; top: auto; bottom: 10px; left: 10px; right: 10px; height: 64px; flex-direction: row; justify-content: space-around; padding: 0 8px; }
  .riel .riel__marca, .riel__fin { display: none; }
  .principal { padding: 20px 16px 96px; }
  .lateral { padding: 20px 16px 96px; }
}

/* cabecera del panel */
.cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cabecera__titulo { display: grid; gap: 6px; }
.saludo { font-family: var(--f-display); font-weight: 500 !important; font-size: 34px; line-height: 1.1; letter-spacing: -.02em !important; }
.sub { color: var(--p-soft); font-size: 14px; }

/* grupo de cifras en píldora (como la referencia) */
.cifras { display: flex; align-items: stretch; border: 1px solid var(--p-hair-2); border-radius: 14px; overflow: hidden; background: var(--cristal-2); box-shadow: var(--brillo); }
.cifras > div { padding: 8px 14px; display: grid; gap: 1px; }
.cifras > div + div { border-left: 1px solid var(--p-hair); }
.cifras span { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--p-mute); }
.cifras b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* pestañas píldora */
.pildoras { display: flex; gap: 6px; flex-wrap: wrap; }
.pildora { height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--p-hair-2); background: var(--cristal-2); color: var(--p-soft); font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--d-2) var(--ease); display: inline-flex; align-items: center; gap: 6px; }
.pildora:hover { color: var(--p-text); border-color: rgba(255,255,255,.24); }
.pildora[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 6px 20px -8px var(--accent); }
.pildora .cuenta { font-size: 11px; opacity: .7; }

/* tarjetas internas */
.tarjeta { border: 1px solid var(--p-hair); border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); box-shadow: var(--brillo); padding: 18px 20px; min-width: 0; }
.tarjeta__cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tarjeta__cab h3 { font-size: 15px; }
.tarjeta__cab small { display: block; color: var(--p-mute); font-size: 12px; margin-top: 2px; }
.enlace-acento { color: var(--accent); font-size: 12.5px; font-weight: 500; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; white-space: nowrap; }
.enlace-acento:hover { text-decoration: underline; text-underline-offset: 3px; }

/* filas de lista (documentos, pedidos) */
.lista { display: grid; gap: 8px; }
.fila { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto 36px; align-items: center; gap: 14px; padding: 10px 12px; transition: background var(--d-2) var(--ease), border-color var(--d-2) var(--ease), transform var(--d-2) var(--ease); }
.fila:hover { background: var(--cristal-3); border-color: var(--p-hair-2); }
.fila__icono { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: var(--p-text); }
.fila__icono svg { width: 18px; height: 18px; }
.fila__texto { min-width: 0; }
.fila__texto b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila__texto small { display: block; font-size: 11.5px; color: var(--p-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila__monto { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.fila__accion { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--p-hair-2); background: transparent; color: var(--p-soft); display: grid; place-items: center; cursor: pointer; }
.fila__accion:hover { color: var(--p-text); background: var(--cristal-3); }
.fila__accion svg { width: 15px; height: 15px; }
@media (max-width: 620px) { .fila { grid-template-columns: 38px minmax(0, 1fr) auto; } .fila .estado, .fila__accion { display: none; } }

/* estados */
.estado { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.estado--ok { color: #7fd393; background: rgba(93, 184, 114, .14); }
.estado--warn { color: #f0b877; background: rgba(232, 165, 90, .14); }
.estado--bad { color: #f08a80; background: rgba(212, 87, 78, .15); }
.estado--info { color: #a9c3ff; background: rgba(126, 166, 255, .14); }
.estado--neutro { color: var(--p-soft); background: rgba(255,255,255,.07); }

/* acciones circulares (como la referencia) */
.acciones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.accion { display: grid; justify-items: center; gap: 7px; font-size: 11px; color: var(--p-soft); background: none; border: 0; cursor: pointer; text-decoration: none; }
.accion span:first-child { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; border: 1px solid var(--p-hair-2); background: var(--cristal-2); color: var(--p-text); box-shadow: var(--brillo); transition: all var(--d-2) var(--ease); }
.accion:hover span:first-child { background: var(--accent); border-color: transparent; transform: translateY(-2px); }
.accion svg { width: 18px; height: 18px; }

/* avatar */
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--accent), #0b1a4a); box-shadow: 0 0 0 3px rgba(255,255,255,.06), 0 0 0 4px var(--p-hair-2); }
.avatar--chico { width: 32px; height: 32px; font-size: 12px; box-shadow: none; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; display: grid; gap: 6px; }
.kpi__nombre { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--p-mute); display: flex; align-items: center; justify-content: space-between; }
.kpi__valor { font-family: var(--f-display); font-weight: 500; font-size: 32px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__delta { font-size: 12px; color: var(--p-soft); display: flex; align-items: center; gap: 6px; }
.kpi__delta b { color: #7fd393; font-weight: 600; }
.kpi__delta b.baja { color: #f08a80; }
.kpi svg.chispa { width: 100%; height: 34px; overflow: visible; }
@media (max-width: 980px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* campos */
.campo { position: relative; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--p-hair-2); padding: 12px 2px; transition: border-color var(--d-2) var(--ease); }
.campo:focus-within { border-bottom-color: var(--p-text); }
.campo svg { width: 18px; height: 18px; color: var(--p-soft); flex: none; }
.campo input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 15px; color: var(--p-text); }
.campo input::placeholder { color: var(--p-mute); }
.btn-pildora { height: 48px; width: 100%; border-radius: var(--r-pill); border: 1px solid var(--p-hair-2); background: rgba(255,255,255,.08); color: var(--p-text); font-weight: 600; font-size: 15px; cursor: pointer; box-shadow: var(--brillo); transition: all var(--d-2) var(--ease); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-pildora:hover { background: rgba(255,255,255,.14); }
.btn-pildora:active { transform: scale(.98); }
.btn-pildora--acento { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px var(--accent); }
.btn-pildora--acento:hover { background: var(--accent-press); }

/* barra de progreso del envío */
.ruta { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; margin-top: 6px; }
.ruta::before { content: ""; position: absolute; top: 11px; left: 12.5%; right: 12.5%; height: 2px; background: var(--p-hair-2); }
.ruta::after { content: ""; position: absolute; top: 11px; left: 12.5%; width: calc(75% * var(--avance, .5)); height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.ruta__paso { display: grid; justify-items: center; gap: 8px; position: relative; z-index: 1; font-size: 11.5px; color: var(--p-mute); text-align: center; }
.ruta__paso i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--p-hair-2); background: #111; display: grid; place-items: center; }
.ruta__paso.hecho { color: var(--p-soft); }
.ruta__paso.hecho i { background: var(--accent); border-color: var(--accent); }
.ruta__paso.hecho i::after { content: ""; width: 8px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.ruta__paso.ahora { color: var(--p-text); }
.ruta__paso.ahora i { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* utilidades del panel */
.rejilla-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 980px) { .rejilla-2 { grid-template-columns: 1fr; } }
.separador { height: 1px; background: var(--p-hair); border: 0; margin: 0; }
.etiqueta { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--p-mute); }
.mini-lista { display: grid; gap: 10px; }
.mini { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--p-hair); background: var(--cristal-2); }
.mini b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini small { display: block; font-size: 11px; color: var(--p-mute); }
.mini .fila__monto { font-size: 12.5px; }

/* interruptores de demo (acento / fondo) — solo prototipo */
.demo { position: fixed; z-index: 90; right: 14px; bottom: 14px; display: flex; gap: 6px; padding: 6px; border-radius: 14px; background: rgba(20,20,20,.72); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-family: var(--f-sans); font-size: 12px; color: #eee; }
.demo button { height: 30px; padding: 0 10px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.demo button:hover { background: rgba(255,255,255,.1); }
.demo i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
@media (max-width: 720px) { .demo { bottom: 84px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ==========================================================================
   PIEZAS DE LA APP REAL (repo)
   ========================================================================== */
.control-fondo { position: fixed; z-index: 30; right: 18px; bottom: 18px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(16,17,20,.6); color: #cfcfd4; font-size: 11.5px; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.control-fondo:hover { color: #fff; }
@media (max-width: 720px) { .control-fondo { bottom: 84px; } }
#px-aviso { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 12px; background: #111113; color: #fff; font-size: 13.5px; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 20px 40px -20px rgba(0,0,0,.6); transition: opacity var(--d-3) var(--ease), transform var(--d-3) var(--ease); }
#px-aviso.visible { opacity: 1; transform: translate(-50%, 0); }
#px-aviso[data-tipo="error"] { border-color: rgba(212,87,78,.5); }
.vacio { padding: 14px 4px; font-size: 13px; color: var(--p-mute, var(--muted)); }
.esqueleto { position: relative; overflow: hidden; border-radius: 10px; background: rgba(127,127,127,.12); min-height: 14px; }
.esqueleto::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); animation: brillo 1.4s infinite; }
@keyframes brillo { to { transform: translateX(100%); } }
[hidden] { display: none !important; }

/* ==========================================================================
   PANEL DE ADMINISTRACIÓN · barra lateral con nombres (todo el día de trabajo)
   ========================================================================== */
.app--admin { grid-template-columns: 236px minmax(0, 1fr); }
.barra-lat { position: sticky; top: 16px; height: calc(100vh - 32px); height: calc(100dvh - 32px); border-radius: 22px; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; scrollbar-width: thin; }
.barra-lat .logo { margin: 4px 8px 16px; height: 58px; width: auto; align-self: flex-start; flex: none; }
.barra-lat .grupo { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--p-mute); padding: 14px 12px 6px; margin: 0; }
.barra-lat a { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px; border-radius: 12px; color: var(--p-soft); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease); flex: none; }
.barra-lat a svg { width: 18px; height: 18px; flex: none; }
.barra-lat a:hover { background: var(--cristal-3); color: var(--p-text); }
.barra-lat a[aria-current="page"] { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -10px var(--accent); }
.barra-lat a .n { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--p-soft); }
.barra-lat a[aria-current="page"] .n { background: rgba(255,255,255,.22); color: #fff; }
.barra-lat .fin { margin-top: auto; padding-top: 12px; display: grid; gap: 2px; }
@media (max-width: 1000px) {
  .app--admin { grid-template-columns: 72px minmax(0, 1fr); }
  .barra-lat { padding: 14px 8px; align-items: center; }
  .barra-lat .logo, .barra-lat .grupo, .barra-lat a span, .barra-lat a .n { display: none; }
  .barra-lat a { width: 44px; justify-content: center; padding: 0; }
}
@media (max-width: 720px) {
  .app--admin { grid-template-columns: 1fr; }
  .barra-lat { position: fixed; z-index: 20; top: auto; bottom: 10px; left: 10px; right: 10px; height: 64px; flex-direction: row; justify-content: space-around; padding: 0 6px; overflow: hidden; }
  .barra-lat .fin, .barra-lat a.solo-ancho { display: none; }
}
/* el facturador completo embebido: el papel flota sobre el cristal */
.marco-hojas { position: relative; border-radius: 26px; overflow: hidden; min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); }
.marco-hojas iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: light; }
.marco-hojas__carga { position: absolute; inset: 0; display: grid; place-items: center; color: var(--p-soft); font-size: 13px; pointer-events: none; transition: opacity var(--d-3) var(--ease); }
@media (max-width: 720px) { .marco-hojas { min-height: calc(100dvh - 96px); } }
