:root {
  --fondo: #101318;
  --tarjeta: #171b22;
  --tarjeta2: #1e232c;
  --texto: #edf0f4;
  --suave: #a0a9b6;
  --nav-suave: #a0a9b6;
  --acento: #a9bbff;
  --sobre-acento: #101318;
  --acento-fondo: #232b42;
  --ok: #5dd39e;
  --alerta: #f0be62;
  --alerta-fondo: #2a2316;
  --alerta-borde: #5c4a22;
  --peligro: #f58b82;
  --peligro-fondo: #2c1b1a;
  --peligro-borde: #5e302c;
  --borde: #2a303a;
  --borde-suave: #232832;
  --borde-fuerte: #434b58;
  --segmento: #232832;
  --segmento-activo: #edf0f4;
  --sobre-segmento: #101318;
  --barra: #4a5570;
  --radio: 10px;
  --radio-control: 8px;
  --input-fondo: #12161c;
  --tinte: #1e232c;
  --sup: calc(env(safe-area-inset-top) + 16px);
  --lateral: 228px;
  --est-cont: #7cc4e4;
  --est-coti: #c1a9f0;
  --marca-max: #7ea6ff;
  color-scheme: dark;
}

body.claro {
  --fondo: #f4f5f7;
  --tarjeta: #ffffff;
  --tarjeta2: #f4f5f7;
  --texto: #14181f;
  --suave: #5b6472;
  --nav-suave: #3f4754;
  --acento: #1b2a5b;
  --sobre-acento: #ffffff;
  --acento-fondo: #e9ecf4;
  --ok: #0b6e47;
  --alerta: #8a4f00;
  --alerta-fondo: #fdf6ea;
  --alerta-borde: #ebd3a6;
  --peligro: #a3241c;
  --peligro-fondo: #fbeeed;
  --peligro-borde: #eec4c0;
  --borde: #e2e5ea;
  --borde-suave: #eef0f3;
  --borde-fuerte: #c9ced6;
  --segmento: #eef0f3;
  --segmento-activo: #ffffff;
  --sobre-segmento: #14181f;
  --barra: #aeb8d0;
  --input-fondo: #ffffff;
  --tinte: #f4f5f7;
  --est-cont: #2f6f8f;
  --est-coti: #6b4fa0;
  --marca-max: #003ca5;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--fondo);
  color: var(--texto);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--acento-fondo); }

#app { padding: var(--sup) 16px 12px; max-width: 1240px; margin: 0 auto; }

h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 14px; }
p { margin: 0 0 8px; }
a { color: var(--acento); }
a.btn { text-decoration: none; }
small { font-size: 12px; }
.muted { color: var(--suave); font-size: 13px; }
.centro { text-align: center; }
.fila { display: flex; gap: 8px; align-items: center; }
.fila.entre { justify-content: space-between; }
.envolver { flex-wrap: wrap; }
.crece { flex: 1; min-width: 0; }
.mt { margin-top: 12px; }
.mt-xs { margin-top: 4px; }
.mb { margin-bottom: 12px; }
.sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--suave); margin: 0 7px; vertical-align: middle; }
.oculto { display: none !important; }
.txt-ok { color: var(--ok); }
.txt-peligro { color: var(--peligro); }
.txt-mal { color: var(--peligro); }
.txt-alerta { color: var(--alerta); }
.txt-suave { color: var(--suave); }
.solo-pc { display: none !important; }

.card {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 16px;
  margin-bottom: 12px;
}
.card:has(.sugerencias:not(.oculto)) { position: relative; z-index: 60; }

.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.metrica { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px; min-width: 0; }
.metrica .valor { font-size: 20px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.metrica .etiqueta, .etiqueta { color: var(--suave); font-size: 13px; }
.metrica.verde .valor { color: var(--ok); }
.metrica.rojo .valor { color: var(--peligro); }
.metrica.ambar .valor { color: var(--alerta); }
.metrica.compacta { padding: 10px; }
.metrica.compacta .etiqueta { font-size: 12px; }
.metrica.compacta .valor { font-size: 15px; }
.metrica.compacta .muted { font-size: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--acento);
  color: var(--sobre-acento);
  border: 1px solid var(--acento);
  border-radius: var(--radio-control);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s ease, background-color 0.12s ease;
}
.btn:hover { opacity: 0.9; }
.btn:focus-visible, .btn-atras:focus-visible, .bottom-nav button:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.btn.secundario { background: var(--tarjeta); color: var(--texto); border-color: var(--borde-fuerte); }
.btn.secundario:hover { background: var(--tarjeta2); opacity: 1; }
.btn.peligro { background: var(--peligro); border-color: var(--peligro); }
.btn.chico { width: auto; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }

.btn-icono {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--tarjeta);
  color: var(--texto);
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--radio-control);
  font-size: 16px;
  cursor: pointer;
}
.btn-atras {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  background: none;
  border: none;
  border-radius: var(--radio-control);
  color: var(--texto);
  cursor: pointer;
}
.btn-atras:hover { background: var(--tarjeta2); }
.btn-atras .ico { width: 22px; height: 22px; }
.cabecera h1 { margin: 0; min-width: 0; }
.cabecera { flex-wrap: wrap; }
.cabecera > .crece { flex: 1 1 auto; }
.btn-texto { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; background: none; border: none; color: var(--acento); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--input-fondo);
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--radio-control);
  color: var(--texto);
  font-size: 16px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
input::placeholder, textarea::placeholder { color: var(--suave); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acento); outline-offset: -1px; border-color: var(--acento); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--acento); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--suave); margin: 8px 0 4px; }
.campo-grupo { margin-bottom: 10px; }
input.serie-repetida { border-color: var(--peligro) !important; background: var(--peligro-fondo) !important; }

.lista, .lista-simple { display: flex; flex-direction: column; gap: 8px; }
.lista-simple.mt { margin-top: 12px; }
.item-lista {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.item-lista:hover { border-color: var(--borde-fuerte); }
.item-lista:active { background: var(--tarjeta2); }
.item-lista > div { min-width: 0; }
.item-lista .t { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.item-lista .s { color: var(--suave); font-size: 12px; margin-top: 1px; overflow-wrap: anywhere; }
.item-lista .der { flex: none; text-align: right; }
.item-prod { gap: 10px; align-items: center; padding: 8px 10px; }
.item-foto { flex: none; width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: #fff; border: 1px solid var(--borde); }
.item-foto img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.item-datos { flex: 1; min-width: 0; }
.item-prod .t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.25; }
.item-prod .der { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge.bajo { color: var(--alerta); background: var(--alerta-fondo); border-color: var(--alerta-borde); }
.badge.agotado { color: var(--peligro); background: var(--peligro-fondo); border-color: var(--peligro-borde); }
.badge.info { color: var(--acento); background: var(--acento-fondo); }

.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla th, .tabla td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--borde-suave); }
.tabla th { color: var(--suave); font-weight: 600; font-size: 12px; border-bottom-color: var(--borde); }
.tabla td.num, .tabla th.num { text-align: right; }
.tabla tbody tr:hover { background: var(--tinte); }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla-scroll { overflow-x: auto; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: var(--tarjeta);
  border-top: 1px solid var(--borde);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
}
.nav-marca { display: none; }
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  height: 64px;
  padding: 0 2px;
  background: none;
  border: none;
  color: var(--suave);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.bottom-nav button i { width: 22px; height: 22px; }
.bottom-nav button:hover { color: var(--texto); }
.bottom-nav button.activo { color: var(--acento); font-weight: 600; }
.pie-version { text-align: center; padding: 4px 16px calc(80px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--suave); }

.modal, .scan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 18, 0.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal { background: rgba(10, 13, 18, 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: modal-fondo 0.18s ease-out; }
.modal-caja {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1135px;
  max-height: 92vh;
  overflow: hidden;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28);
  animation: modal-sube 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-caja.ancha { max-width: 1362px; max-height: 94vh; }
.modal-caja.ancha .tabla { overflow-x: auto; }
.modal-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 18px 16px 14px 20px;
  border-bottom: 1px solid var(--borde);
}
.modal-header::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--borde-fuerte); }
.modal-header h3 { margin: 0; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.modal-header .btn-icono { flex: none; }
#modal-cuerpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); }
.modal-caja:has(.modal-pie:not(.oculto)) #modal-cuerpo { padding-bottom: 16px; }
.modal-pie {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--borde);
  background: var(--tinte);
}
.modal-pie .btn { margin: 0; }
.modal-pie .btn.peligro { background: var(--tarjeta); color: var(--peligro); border-color: var(--peligro-borde); }
.modal-pie .btn.peligro:hover { background: var(--peligro-fondo); opacity: 1; }
@media (max-width: 1023px) { .modal-pie { flex-direction: row; flex-wrap: wrap; } .modal-pie .btn { flex: 1 1 160px; } }
#modal-cuerpo .card { background: var(--tinte); border-color: var(--borde-suave); padding: 14px; }
#modal-cuerpo .card h3 { font-size: 14px; }
#modal-cuerpo .mapa-previa { max-height: 200px; margin-bottom: 0; }
#modal-cuerpo > .card:last-child, #modal-cuerpo > :last-child { margin-bottom: 0; }
.modal-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.modal-datos > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 9px 12px; margin: 0 -1px -1px 0; border-right: 1px solid var(--borde-suave); border-bottom: 1px solid var(--borde-suave); }
.modal-datos span { color: var(--suave); font-size: 12px; }
.modal-datos b { font-weight: 600; overflow-wrap: anywhere; }
.modal-datos .ancho { grid-column: 1 / -1; }
.modal-totales { margin-top: 14px; padding: 12px 14px; background: var(--tinte); border: 1px solid var(--borde-suave); border-radius: var(--radio); }
.modal-totales .fila.entre + .fila.entre { margin-top: 6px; }
.modal-totales .total { padding-top: 8px; margin-top: 8px !important; border-top: 1px solid var(--borde); font-size: 16px; }
body.modal-abierto { overflow: hidden; }
@keyframes modal-fondo { from { opacity: 0; } }
@keyframes modal-sube { from { transform: translateY(32px); opacity: 0; } }
@keyframes modal-aparece { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal, .modal-caja { animation: none; } }
body.claro .modal { background: rgba(20, 24, 31, 0.42); }
body.claro .modal-caja { box-shadow: 0 -8px 32px rgba(20, 24, 31, 0.16); }

.scan-overlay { flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(10, 13, 18, 0.88); }
.scan-caja { position: relative; width: min(90vw, 420px); aspect-ratio: 4/3; background: #000; border-radius: var(--radio); overflow: hidden; }
.scan-caja video { width: 100%; height: 100%; object-fit: cover; }
.scan-marco { position: absolute; inset: 18% 10%; border: 2px solid #fff; border-radius: 8px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.3); }
.scan-overlay p { color: #fff; }
.scan-overlay .btn { width: auto; }

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  max-width: 420px;
  margin: 0 auto;
  padding: 12px 14px;
  background: var(--texto);
  color: var(--fondo);
  border-radius: var(--radio-control);
  text-align: center;
  font-weight: 500;
  z-index: 200;
}
.toast.ok { background: var(--ok); color: var(--sobre-acento); }
.toast.error { background: var(--peligro); color: var(--sobre-acento); }

.login-caja { max-width: 340px; margin: 9vh auto 0; text-align: center; }
.logo-login { width: 72px; height: 72px; margin-bottom: 8px; }
.marca { letter-spacing: 0.01em; }
.marca span { color: var(--marca-max); }
.login-caja .marca { font-size: 28px; font-weight: 700; margin-bottom: 2px; }
.login-pin { margin: 14px 0 0; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px auto 0; max-width: 300px; }
.teclado button { min-height: 60px; padding: 0; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); color: var(--texto); font: inherit; font-size: 22px; font-weight: 500; cursor: pointer; display: grid; place-items: center; }
.teclado button:active { background: var(--tarjeta2); }
.teclado button.btn { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); font-size: 16px; font-weight: 600; width: auto; }
.pin-puntos { margin: 10px 0; min-height: 2.4rem; display: flex; justify-content: center; align-items: center; }
.pin-puntos span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--suave); margin: 0 6px; }
.pin-puntos span.on { background: var(--texto); border-color: var(--texto); }

.acciones-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.accion { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 6px; text-align: center; cursor: pointer; font-size: 13px; font-weight: 600; }
.accion:hover { border-color: var(--borde-fuerte); }
.accion .ic { display: block; margin-bottom: 6px; }

.busqueda-flotante { position: relative; }
.sugerencias {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--tarjeta);
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--radio-control);
  z-index: 30;
}
.sugerencias .sug { padding: 10px 12px; border-bottom: 1px solid var(--borde-suave); cursor: pointer; }
.sugerencias .sug:hover { background: var(--tinte); }
.sugerencias .sug:last-child { border-bottom: none; }
.sugerencias .sug.con-foto { display: flex; align-items: center; gap: 12px; }
.sugerencias .sug.crear { background: var(--acento-fondo); }
.sugerencias .sug.crear .t { color: var(--acento); }
.sugerencias .sug .t { font-weight: 600; font-size: 14px; }
.sugerencias .sug .s { color: var(--suave); font-size: 12px; }
.sug-serie { color: var(--acento); font-weight: 600; }
.sug-foto { flex: none; width: 56px; height: 56px; border-radius: 6px; background: #fff; border: 1px solid var(--borde); display: grid; place-items: center; overflow: hidden; }
.sug-foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sug-datos { flex: 1; min-width: 0; }

.secuencia-serie { font-size: 12px; color: var(--suave); margin-top: 2px; }
.empaque-mixto { display: flex; flex-direction: column; gap: 6px; margin: 0 0 4px 118px; padding-left: 12px; border-left: 1px solid var(--borde-fuerte); font-size: 13px; }
.mixto-fila { display: flex; align-items: center; gap: 6px; }
.mixto-fila label { width: 110px; flex: none; }
.empaque-mixto input { width: 70px; padding: 6px 8px; font-size: 13px; text-align: right; }
.empaque-mixto input.precio { width: 90px; }
.mixto-sub { min-width: 80px; text-align: right; color: var(--suave); }
.empaque-mixto + .nota-empaque { margin: 0 0 10px 132px; }
@media (max-width: 640px) { .empaque-mixto, .empaque-mixto + .nota-empaque { margin-left: 4px; } }
.modo-empaque { flex: none; width: auto; padding: 6px 8px; font-size: 13px; }
.nota-empaque { font-size: 12px; color: var(--suave); margin-top: 2px; }
.codigo-prod { font-size: 12px; font-weight: 500; color: var(--suave); margin-top: 2px; }

.carrito-linea { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--borde-suave); padding: 10px 0; }
.carrito-linea .nom { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.carrito-linea input { width: 72px; padding: 8px; text-align: center; }
.carrito-linea .precio { width: 90px; }
.carrito-linea .series { flex: none; width: 150px; text-align: left; font-size: 13px; }
.carrito-bloque { border-bottom: 1px solid var(--borde-suave); }
.carrito-foto { width: 96px; height: 96px; align-self: flex-start; }
.carrito-bloque .carrito-linea { border-bottom: none; }
.btn-enlace { background: none; border: none; padding: 2px 0; color: var(--acento); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-enlace:hover { text-decoration: underline; }
.btn-enlace + .btn-enlace { margin-left: 14px; }
.kit-elementos { margin: 0 0 10px 118px; padding-left: 12px; border-left: 1px solid var(--borde-fuerte); display: flex; flex-direction: column; gap: 6px; }
.kit-elemento { display: flex; align-items: flex-end; gap: 8px; }
.kit-elemento .kit-nombre { flex: 1; min-width: 0; font-size: 13px; padding-bottom: 7px; }
.kit-elemento input, .kit-elemento select { padding: 6px 8px; font-size: 13px; }
.kit-elemento .series { flex: none; width: 170px; }
.serie-campo { flex: none; width: 170px; display: flex; flex-direction: column; gap: 2px; }
.serie-campo .series { width: 100%; }
.serie-sug { align-self: flex-start; background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--acento); cursor: pointer; text-align: left; }
.serie-sug:hover { text-decoration: underline; }
.kit-elemento .precio { flex: none; width: 90px; text-align: right; }
.kit-elementos:has(.precio) .serie-unidad .serie-campo { margin-right: 98px; }
@media (max-width: 640px) {
  .kit-elementos:has(.precio) .serie-unidad .serie-campo { margin-right: 0; }
  .serie-campo { flex: 1; width: auto; }
  .carrito-linea { flex-wrap: wrap; }
  .carrito-linea .nom { flex: 1 1 100%; }
  .carrito-foto + .nom { flex: 1 1 calc(100% - 88px); }
  .carrito-linea .series { flex: 1; width: auto; }
  .kit-elementos { margin-left: 4px; }
  .carrito-foto { width: 72px; height: 72px; }
  .kit-elemento { flex-wrap: wrap; }
  .kit-elemento .kit-nombre { flex: 1 1 100%; }
  .kit-elemento .series { flex: 1; width: auto; }
}

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--acento);
  color: var(--sobre-acento);
  border: none;
  border-radius: var(--radio-control);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.fab .ico { width: 20px; height: 20px; }
.ico { width: 18px; height: 18px; flex: none; }

.crm-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0; margin-bottom: 12px; }
.crm-hero h1 { font-size: 20px; margin: 2px 0; }
.crm-hero p { color: var(--suave); font-size: 13px; margin: 0; max-width: 44ch; }
.crm-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--suave); }
.crm-eyebrow .ico { width: 15px; height: 15px; }
.crm-nuevo { width: auto; flex: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; margin-bottom: 12px; background: var(--borde-suave); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.kpi { padding: 12px 14px; background: var(--tarjeta); min-width: 0; }
.kpi.tono-verde .kpi-val { color: var(--ok); }
.kpi.tono-rojo .kpi-val { color: var(--peligro); }
.kpi.tono-ambar .kpi-val { color: var(--alerta); }
.kpi-top { display: flex; align-items: center; gap: 6px; }
.kpi-ico { display: inline-grid; place-items: center; color: var(--suave); }
.kpi-ico .ico { width: 15px; height: 15px; }
.kpi-et { font-size: 13px; color: var(--suave); }
.kpi-val { font-size: 20px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.kpi-pie { font-size: 12px; color: var(--suave); margin-top: 2px; }

.est-nuevo, .est-borde-nuevo { --est-color: var(--acento); }
.est-contactado, .est-borde-contactado { --est-color: var(--est-cont); }
.est-interesado, .est-borde-interesado { --est-color: var(--alerta); }
.est-cotizado, .est-borde-cotizado { --est-color: var(--est-coti); }
.est-cliente, .est-borde-cliente { --est-color: var(--ok); }
.est-perdido, .est-borde-perdido { --est-color: var(--peligro); }

.pipeline { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.pipeline::-webkit-scrollbar { display: none; }
.pipe-chip { display: inline-flex; align-items: center; gap: 7px; flex: none; min-height: 40px; padding: 6px 12px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio-control); color: var(--suave); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.pipe-chip:hover { border-color: var(--borde-fuerte); }
.pipe-chip.activo { color: var(--texto); border-color: var(--texto); font-weight: 600; }
.pipe-dot, .kanban-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--est-color, var(--suave)); flex: none; }
.pipe-num { font-size: 12px; color: var(--suave); }
.pipe-chip.activo .pipe-num { color: var(--texto); }
.pipe-chip.limpiar { border-style: dashed; }

.crm-panel { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; margin-bottom: 12px; }
.crm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.buscador { position: relative; flex: 1; min-width: 180px; }
.buscador .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--suave); pointer-events: none; }
.buscador input { padding-left: 40px; }
.vista-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radio-control); background: var(--segmento); }
.vista-toggle button { min-height: 38px; padding: 6px 10px; border: none; border-radius: 6px; background: none; color: var(--suave); cursor: pointer; display: inline-grid; place-items: center; }
.vista-toggle button.activo { background: var(--segmento-activo); color: var(--sobre-segmento); }
.chip-filtro { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-control); background: var(--tarjeta); color: var(--suave); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip-filtro .ico { width: 15px; height: 15px; }
.chip-filtro.activo { color: var(--peligro); background: var(--peligro-fondo); border-color: var(--peligro-borde); }

.cliente-lista { display: flex; flex-direction: column; }
.cliente-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--borde-suave); cursor: pointer; }
.cliente-card:last-child { border-bottom: none; }
.cliente-card:hover { background: var(--tinte); }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; font-weight: 600; color: var(--texto); background: var(--tarjeta2); border: 1px solid var(--borde); }
.cliente-info { min-width: 0; }
.cliente-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cliente-top h3 { margin: 0; font-size: 14px; font-weight: 600; }
.cliente-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--suave); font-size: 12px; margin-top: 2px; }
.cliente-contacto { display: inline-flex; align-items: center; gap: 4px; }
.cliente-contacto .ico, .cliente-prox .ico, .cliente-notas .ico { width: 13px; height: 13px; }
.cliente-prox { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--suave); font-size: 12px; }
.cliente-prox b { color: var(--texto); font-weight: 600; }
.cliente-prox.vencido, .cliente-prox.vencido b { color: var(--peligro); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--suave); background: var(--tinte); border: 1px solid var(--borde); }
.cliente-lado { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.cliente-valor { font-weight: 600; font-size: 14px; color: var(--ok); white-space: nowrap; }
.cliente-notas { display: inline-flex; align-items: center; gap: 3px; color: var(--suave); font-size: 12px; }
.chev { color: var(--suave); width: 16px; height: 16px; }

.estado-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--est-color, var(--suave)) 40%, transparent);
  background: none;
  color: var(--est-color, var(--suave));
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
button.estado-pill { min-height: 36px; padding: 4px 10px; cursor: pointer; color: var(--suave); border-color: var(--borde-fuerte); }
button.estado-pill:hover { border-color: var(--est-color); }
button.estado-pill.activo { color: var(--est-color); border-color: var(--est-color); background: color-mix(in srgb, var(--est-color) 10%, transparent); }

.kanban { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col { flex: 0 0 248px; border-radius: var(--radio); border: 1px solid var(--borde); background: var(--tinte); padding: 8px; }
.kanban-col header { display: flex; align-items: center; gap: 7px; padding: 2px 4px 8px; font-size: 13px; font-weight: 600; }
.kanban-col header b { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--suave); }
.kanban-drop { min-height: 60px; border-radius: var(--radio-control); outline: 2px dashed transparent; outline-offset: 2px; }
.kanban-drop.sobre { outline-color: var(--borde-fuerte); }
.kanban-card { padding: 10px; margin-bottom: 8px; border-radius: var(--radio-control); border: 1px solid var(--borde); background: var(--tarjeta); cursor: grab; }
.kanban-card:hover { border-color: var(--borde-fuerte); }
.kanban-card.arrastrando { opacity: 0.45; }
.kanban-card-top { display: flex; gap: 8px; align-items: center; }
.kanban-card-top div { min-width: 0; }
.kanban-card-top b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-card-top span { display: block; font-size: 12px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-prox { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--suave); font-size: 12px; }
.kanban-prox .ico { width: 12px; height: 12px; }
.kanban-prox b { margin-left: auto; color: var(--texto); }
.kanban-pie { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.kanban-vacio { padding: 14px 6px; text-align: center; color: var(--suave); font-size: 12px; }
.kanban-mover { width: 100%; margin-top: 8px; padding: 4px 6px; font-size: 13px; }

.paginacion { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.paginacion span { color: var(--suave); font-size: 13px; }

.empty { text-align: center; padding: 28px 16px; }
.empty-ico { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: var(--radio); display: grid; place-items: center; color: var(--suave); background: var(--tinte); border: 1px solid var(--borde); }
.empty-ico .ico { width: 24px; height: 24px; }
.empty h3 { margin-bottom: 4px; }
.empty p { color: var(--suave); font-size: 13px; max-width: 36ch; margin: 0 auto 12px; }
.empty.mini { padding: 14px; }

.skeleton { pointer-events: none; }
.sk-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--tinte); }
.sk-lineas { display: flex; flex-direction: column; gap: 7px; }
.sk-lineas span { display: block; height: 10px; border-radius: 4px; background: var(--tinte); }
.sk-lineas span:nth-child(1) { width: 55%; }
.sk-lineas span:nth-child(2) { width: 78%; }
.sk-lineas span:nth-child(3) { width: 40%; }

.volver { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; margin-bottom: 6px; border: none; background: none; color: var(--suave); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.volver .ico { width: 18px; height: 18px; }
.volver:hover { color: var(--texto); }

.cliente-hero { padding: 16px; margin-bottom: 12px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); }
.cliente-hero-top { display: flex; gap: 14px; align-items: flex-start; }
.cliente-hero h1 { font-size: 20px; margin: 0 0 2px; }
.cliente-hero p { color: var(--suave); font-size: 13px; margin: 0; }
.cliente-metricas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.cliente-metricas div, .detalle-item, .nota-cliente { padding: 10px 12px; border-radius: var(--radio-control); background: var(--tinte); min-width: 0; }
.cliente-metricas span, .detalle-item span, .nota-cliente span { display: block; font-size: 12px; color: var(--suave); }
.cliente-metricas b, .detalle-item b { display: block; font-size: 14px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.quick-actions { display: flex; gap: 8px; margin-top: 12px; }
.qa { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border-radius: var(--radio-control); border: 1px solid var(--borde-fuerte); background: var(--tarjeta); color: var(--texto); text-decoration: none; font-size: 12px; font-weight: 600; }
.qa:hover { background: var(--tinte); }
.estado-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); margin-bottom: 14px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 8px 12px; border: none; border-bottom: 2px solid transparent; background: none; color: var(--suave); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.tab .ico { width: 15px; height: 15px; }
.tab.activo { color: var(--acento); border-bottom-color: var(--acento); font-weight: 600; }
.tab-cuerpo { min-height: 80px; }
.detalle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.detalle-item.vencido { background: var(--peligro-fondo); }
.detalle-item.vencido b { color: var(--peligro); }
.nota-cliente { margin-top: 12px; }
.nota-cliente span { margin-bottom: 4px; }
.nota-cliente p { margin: 0; font-size: 14px; white-space: pre-wrap; }

.registro-rapido { margin-top: 16px; }
.registro-rapido h3 { display: flex; align-items: center; gap: 6px; }
.registro-rapido h3 .ico { width: 16px; height: 16px; color: var(--suave); }
.registro-rapido textarea { margin-bottom: 10px; }
.tipo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tipo-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 10px; border-radius: var(--radio-control); border: 1px solid var(--borde-fuerte); background: var(--tarjeta); color: var(--suave); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.tipo-chip .ico { width: 13px; height: 13px; }
.tipo-chip.activo { color: var(--acento); border-color: var(--acento); background: var(--acento-fondo); font-weight: 600; }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 11px; padding-bottom: 12px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 1px; background: var(--borde); }
.tl-dot { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--tinte); border: 1px solid var(--borde); color: var(--suave); }
.tl-dot .ico { width: 15px; height: 15px; }
.tl-dot.tipo-venta { color: var(--ok); }
.tl-cuerpo { flex: 1; min-width: 0; padding: 9px 12px; border-radius: var(--radio-control); background: var(--tinte); }
.tl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tl-top b { font-size: 13px; font-weight: 600; }
.tl-top span { color: var(--suave); font-size: 12px; white-space: nowrap; }
.tl-cuerpo p { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.tl-user { display: inline-block; margin-top: 4px; color: var(--suave); font-size: 12px; }

.cliente-acciones { display: flex; gap: 10px; margin-top: 4px; }
.cliente-acciones .btn { flex: 1; }
.crm-fab { display: none; }

.linea-simple { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--radio-control); background: var(--tinte); }
.linea-simple > div { min-width: 0; }
.linea-simple b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.linea-simple span { display: block; font-size: 12px; color: var(--suave); }
.linea-simple.vencido { background: var(--peligro-fondo); }
.linea-simple .der { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.linea-simple .der .mini { font-size: 12px; font-weight: 500; color: var(--suave); text-transform: capitalize; }
.cot-item { display: grid; grid-template-columns: 1fr 70px 88px auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.cot-item input { padding: 8px 10px; font-size: 13px; }
.mini-select { padding: 6px 8px; font-size: 13px; }

@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .crm-hero { flex-direction: column; align-items: stretch; }
  .crm-nuevo { width: 100%; }
  .crm-fab { display: inline-flex; }
  .cliente-card { grid-template-columns: auto minmax(0, 1fr); }
  .cliente-lado { flex-direction: row; align-items: center; grid-column: 1 / -1; justify-content: space-between; }
  .chev { display: none; }
  .cliente-metricas { grid-template-columns: repeat(2, 1fr); }
  .cliente-metricas div:last-child { grid-column: 1 / -1; }
  .cliente-hero-top { flex-wrap: wrap; }
  .cliente-hero-top .estado-pill { margin-left: 78px; margin-top: -8px; }
  .detalle-grid { grid-template-columns: 1fr; }
  .cliente-acciones { flex-direction: column; }
  .kanban-col { flex-basis: 78vw; }
  .cot-item { grid-template-columns: 1fr 64px 80px auto; }
  .linea-simple { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .quick-actions { flex-wrap: wrap; }
  .qa { flex: 1 1 40%; }
}

.debe { color: var(--peligro); font-size: 12px; white-space: nowrap; }
.credito-bloque { border-top: 1px solid var(--borde); padding-top: 8px; }
.gasto-categorias { display: flex; flex-wrap: wrap; gap: 6px; }
.gasto-categorias .chip { background: var(--tinte); border-radius: 6px; padding: 3px 10px; font-size: 13px; }
.ganancia-item { font-size: 12px; color: var(--suave); white-space: nowrap; }
.ventas-dias .periodos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ventas-dias .periodos .activo { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.dia-nav { gap: 6px; align-items: center; flex-wrap: wrap; }
.dia-nav input { width: auto; }
.ventas-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.ventas-resumen .valor { font-size: 17px; }
.pct-potencial { font-size: 13px; font-weight: 500; color: var(--suave); white-space: nowrap; }

.mas-menu { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; max-width: 760px; }
.mas-item { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 14px; border-bottom: 1px solid var(--borde-suave); cursor: pointer; }
.mas-item:last-child { border-bottom: none; }
.mas-item:hover { background: var(--tinte); }
.mas-ic { flex: none; display: grid; place-items: center; width: 24px; color: var(--suave); }
.mas-ic i { width: 22px; height: 22px; }
.mas-texto { flex: 1; min-width: 0; }
.mas-texto .t { font-weight: 600; font-size: 14px; }
.mas-texto .s { color: var(--suave); font-size: 12px; margin-top: 1px; }
.mas-flecha { color: var(--suave); font-size: 20px; line-height: 1; }

.sec-tit { display: flex; align-items: center; gap: 8px; margin-bottom: 0; }
.card > .sec-tit { margin-bottom: 10px; }

.barra-app {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(60px + env(safe-area-inset-top));
  margin: calc(-1 * var(--sup)) -16px 12px;
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--tarjeta);
  border-bottom: 1px solid var(--borde);
}
.barra-app img, .nav-marca img { width: 32px; height: 32px; flex: none; }
.barra-app b, .nav-marca b { flex: 1; font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.ini-titulo { align-items: center; gap: 12px; margin-bottom: 16px; }
.ini-titulo h1 { margin: 0; font-size: 22px; }
.ini-fecha { color: var(--suave); font-size: 13px; }
.ini-titulo::first-letter { text-transform: none; }
.ini-fecha::first-letter { text-transform: uppercase; }
.ini-inventario { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
.ini-inventario > div { padding: 14px 16px; min-width: 0; }
.ini-inventario > div + div { border-left: 1px solid var(--borde-suave); }
.ini-inventario .rp-valor { font-size: 20px; }
.ini-stock .alertas-stock { margin-top: 10px; }

.graf-periodos, .rep-pestanas { display: inline-flex; gap: 2px; padding: 3px; background: var(--segmento); border-radius: var(--radio-control); }
.graf-periodos button { min-height: 38px; padding: 4px 12px; background: none; border: none; border-radius: 6px; color: var(--suave); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.graf-periodos button.activo { background: var(--segmento-activo); color: var(--sobre-segmento); font-weight: 600; }
.rep-pestanas { display: flex; }
.rep-pestanas button { flex: 1; }
.resumen-periodo .graf-periodos, .avance .graf-periodos { flex: none; }
.rp-principal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rp-valor { font-size: 26px; font-weight: 600; line-height: 1.2; margin-top: 2px; overflow-wrap: anywhere; }
.rp-ganancia { color: var(--ok); }
.rp-detalle { display: grid; gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--borde-suave); }

.alertas-stock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.alerta-stock { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-align: left; color: var(--texto); background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio-control); font: inherit; cursor: pointer; }
.alerta-stock .n { font-size: 26px; font-weight: 600; line-height: 1.2; }
.alerta-stock b { font-weight: 600; font-size: 14px; }
.alerta-stock small { color: var(--suave); font-size: 12px; line-height: 1.3; }
.alerta-stock.urgente { background: var(--alerta-fondo); border-color: var(--alerta-borde); }
.alerta-stock.urgente .n, .alerta-stock.urgente b { color: var(--alerta); }
.alerta-stock:hover { border-color: var(--borde-fuerte); }
.ver-mas .btn { width: 100%; }

.graf-totales { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 12px; font-size: 13px; align-items: center; }
.graf-punto { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.graf-punto.ventas { background: var(--barra); }
.graf-punto.ganancia { background: var(--acento); }
.graf-punto.promedio { background: none; border-top: 1px dashed var(--suave); height: 0; border-radius: 0; width: 14px; }
.graf { display: flex; gap: 8px; }
.graf-eje { display: flex; flex-direction: column; justify-content: space-between; height: 170px; font-size: 11px; color: var(--suave); text-align: right; white-space: nowrap; }
.graf-eje span { transform: translateY(-50%); }
.graf-eje span:first-child { transform: none; }
.graf-eje span:last-child { transform: translateY(-100%); }
.graf-area { position: relative; flex: 1; min-width: 0; }
.graf-guias { position: absolute; inset: 0 0 auto 0; height: 170px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.graf-guias i { border-top: 1px solid var(--borde-suave); }
.graf-cols { position: relative; display: flex; gap: 3px; align-items: stretch; }
.graf-col { flex: 1; min-width: 0; background: none; border: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.graf-pista { height: 170px; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px; }
.graf-col:hover .graf-pista, .graf-col.sel .graf-pista { background: var(--tinte); }
.graf-barra { position: relative; width: min(100%, 34px); height: var(--h); min-height: 2px; border-radius: 3px 3px 0 0; background: var(--barra); }
.graf-gan { position: absolute; left: 0; right: 0; bottom: 0; background: var(--acento); }
.graf-col.vacio .graf-barra { background: var(--borde); }
.graf-dia { font-size: 11px; color: var(--suave); margin-top: 4px; height: 14px; white-space: nowrap; }
.graf-col.hoy .graf-dia { color: var(--texto); font-weight: 600; }
.graf-val { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 3px; font-style: normal; font-size: 11px; font-weight: 500; color: var(--suave); white-space: nowrap; }
.graf-col.top .graf-val { color: var(--texto); font-weight: 600; }
.graf-detalle { display: grid; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: var(--radio-control); background: var(--tinte); font-size: 13px; }
.graf-txt-gan { color: var(--ok); }
.graf-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 12px 0 10px; border: 1px solid var(--borde-suave); border-radius: var(--radio-control); overflow: hidden; }
.graf-kpi { padding: 10px 12px; border-right: 1px solid var(--borde-suave); min-width: 0; }
.graf-kpi:last-child { border-right: none; }
@media (max-width: 700px) {
  .graf-kpis { grid-template-columns: repeat(2, 1fr); }
  .graf-kpi:nth-child(2n) { border-right: none; }
  .graf-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--borde-suave); }
}
.graf-kpi-tit { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--suave); }
.graf-kpi-val { font-size: 17px; font-weight: 600; margin: 3px 0 2px; white-space: nowrap; }
.graf-kpi-pie { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; color: var(--suave); }
.graf-cambio { font-weight: 600; color: var(--suave); }
.graf-cambio.sube { color: var(--ok); }
.graf-cambio.baja { color: var(--peligro); }
.graf-leyenda { display: flex; gap: 14px; font-size: 12px; color: var(--suave); margin-bottom: 8px; }
.graf-prom { position: absolute; left: 0; right: 0; bottom: calc(18px + 170px * var(--p)); border-top: 1px dashed var(--suave); pointer-events: none; z-index: 2; }
.graf-prom span { position: absolute; right: 0; top: -18px; padding: 0 4px; font-size: 11px; font-weight: 500; color: var(--suave); background: var(--tarjeta); }
.graf-det-fecha { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 600; }
.graf-det-datos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (max-width: 600px) { .graf-det-datos { grid-template-columns: repeat(3, 1fr); } }
.graf-det-datos div { display: flex; flex-direction: column; gap: 2px; }
.graf-det-datos span { font-size: 12px; color: var(--suave); }
.serie-fila { gap: 8px; margin: 4px 0; }
.serie-fecha { width: 64px; flex: none; }
.serie-pista { flex: 1; background: var(--tinte); border-radius: 3px; overflow: hidden; }
.serie-pista div { height: 16px; background: var(--barra); }
.serie-monto { width: 90px; flex: none; text-align: right; }

.compra-grupo { border-top: 1px solid var(--borde-fuerte); }
.compra-grupo td { vertical-align: top; }
.compra-grupo tr + tr td { border-top: 1px dashed var(--borde); }
.compra-grupo:hover td { background: var(--tinte); }
.compra-grupo tr:first-child td { padding-top: 12px; }
.compra-grupo tr:last-child td { padding-bottom: 12px; }
.compra-grupo td.num { white-space: nowrap; }
.compra-grupo td.compra-sku { white-space: nowrap; font-weight: 600; }
.compra-grupo td.compra-nombre { min-width: 180px; }
.compra-grupo td.compra-celda:nth-of-type(n) { min-width: 90px; }
.compra-celda { font-size: 13px; }
.chips-serie { display: flex; flex-wrap: wrap; gap: 4px; min-width: 190px; max-width: 280px; }
.chips-serie span { padding: 1px 6px; font-size: 12px; border-radius: 4px; background: var(--tinte); border: 1px solid var(--borde); white-space: nowrap; }
.aviso-edicion { background: var(--alerta-fondo); border-color: var(--alerta-borde); font-size: 14px; }
.tabla tr.fila-editando td { background: var(--alerta-fondo); }
.tabla td.venta-prod { font-size: 13px; }
.tabla tr:has(+ tr.venta-sub) td:not([rowspan]) { border-bottom: 1px dashed var(--borde); }
.tabla tr.venta-multi td, .tabla tr.venta-sub td { vertical-align: top; }
.tabla td.venta-sku, .tabla tr.venta-ini td.num, .tabla tr.venta-sub td.num { white-space: nowrap; }

.enlace-mapa { color: var(--acento); font-weight: 600; font-size: 13px; text-decoration: none; }
.enlace-mapa:hover { text-decoration: underline; }
#venta-ubicacion-mapa { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
#venta-ubicacion-mapa.oculto { display: none; }
.mapa-previa { width: 100%; max-height: 320px; margin: 8px 0 12px; aspect-ratio: 16 / 10; border-radius: var(--radio); border: 1px solid var(--borde); overflow: hidden; background: var(--tinte); }
.mapa-previa iframe { width: 100%; height: 100%; border: 0; display: block; }
.mapa-aviso { font-size: 12px; margin-top: 6px; }

.er-selector { width: auto; padding: 8px 12px; }
.er-hero { --er: var(--texto); text-align: center; padding: 20px 16px; }
.er-hero.gana { --er: var(--ok); }
.er-hero.pierde { --er: var(--peligro); }
.er-hero-tit { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--suave); }
.er-hero-valor { font-size: 34px; font-weight: 600; line-height: 1.2; color: var(--er); margin: 6px 0 10px; }
.er-hero-pie { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 13px; color: var(--suave); }
.er-tabla { display: flex; flex-direction: column; margin-top: 6px; }
.er-fila { display: grid; grid-template-columns: 22px minmax(0, 1fr) 110px 110px 64px; gap: 8px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--borde-suave); font-size: 14px; }
.er-fila small { display: block; color: var(--suave); font-size: 12px; font-weight: 400; }
.er-cabeza { font-size: 12px; color: var(--suave); font-weight: 600; padding-top: 0; }
.er-signo { font-weight: 600; color: var(--suave); text-align: center; }
.er-monto, .er-previo { text-align: right; white-space: nowrap; }
.er-previo { color: var(--suave); font-size: 13px; }
.er-var { text-align: right; font-size: 12px; }
.er-fila.resta .er-monto { color: var(--peligro); }
.er-fila.suma .er-monto { color: var(--ok); }
.er-fila.sub { font-weight: 600; background: var(--tinte); border-radius: 6px; }
.er-fila.total { font-weight: 600; font-size: 16px; border-bottom: none; border-radius: 6px; margin-top: 6px; background: var(--tinte); }
.er-fila.total.gana { --er: var(--ok); }
.er-fila.total.pierde { --er: var(--peligro); }
.er-fila.total .er-monto { color: var(--er); }
@media (max-width: 600px) {
  .er-fila { grid-template-columns: 18px minmax(0, 1fr) 96px 58px; }
  .er-previo, .er-cabeza span:nth-child(4) { display: none; }
}
.er-gasto { margin-bottom: 12px; font-size: 14px; }
.er-barra { height: 6px; border-radius: 3px; background: var(--tinte); margin-top: 6px; overflow: hidden; }
.er-barra i { display: block; height: 100%; border-radius: inherit; background: var(--barra); }
.er-meses { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.er-mes { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 6px 2px; background: none; border: none; border-radius: var(--radio-control); color: var(--texto); font: inherit; cursor: pointer; }
.er-mes:hover, .er-mes.sel { background: var(--tinte); }
.er-pista { height: 130px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.er-pista i { width: 34%; max-width: 16px; height: var(--h); min-height: 2px; border-radius: 2px 2px 0 0; }
.er-ing { background: var(--barra); }
.er-util { background: var(--acento); }
.er-util.neg { background: var(--peligro); }
.er-mes-val { font-size: 11px; font-weight: 600; white-space: nowrap; }
.er-mes-nom { font-size: 12px; color: var(--suave); text-transform: capitalize; }
.er-mes.sel .er-mes-nom { color: var(--texto); font-weight: 600; }

.usuario-fila { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radio-control); background: var(--tinte); }
.usuario-fila.inactivo { opacity: 0.55; }
.usuario-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 600; color: var(--texto); background: var(--tarjeta); border: 1px solid var(--borde); }
@media (max-width: 600px) { .usuario-fila { flex-wrap: wrap; } }

.caja-dia { font-weight: 600; display: inline-block; }
.caja-dia::first-letter, .aud-dia::first-letter { text-transform: uppercase; }
.caja-efectivo { text-align: center; margin: 14px 0 10px; }
.caja-efectivo span { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; color: var(--suave); }
.caja-efectivo b { font-size: 34px; font-weight: 600; }
.caja-resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.caja-resumen div { background: var(--tinte); border-radius: var(--radio-control); padding: 8px; }
.caja-resumen span { display: block; font-size: 12px; color: var(--suave); }
.mas { color: var(--ok); }
.menos { color: var(--peligro); }
.caja-con { padding: 8px 0; border-bottom: 1px solid var(--borde-suave); font-size: 14px; }
.caja-con:last-child { border-bottom: none; }
.caja-arqueo { align-items: center; padding: 8px 0; border-bottom: 1px solid var(--borde-suave); }
.caja-arqueo input { width: 130px; text-align: right; }
.caja-dif-viva { width: 120px; text-align: right; }
.caja-dif { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.caja-dif.ok { color: var(--ok); }
.caja-dif.sobra { color: var(--alerta); background: var(--alerta-fondo); }
.caja-dif.falta { color: var(--peligro); background: var(--peligro-fondo); }
.caja-total-dif { margin-top: 12px; text-align: right; font-weight: 600; }
.caja-hist { padding: 10px; border-radius: var(--radio-control); cursor: pointer; }
.caja-hist:hover { background: var(--tinte); }
@media (max-width: 600px) {
  .caja-arqueo { flex-wrap: wrap; }
  .caja-arqueo input { width: 100%; }
  .caja-dif-viva { width: auto; }
}

.aud-dia { display: block; font-size: 15px; }
.aud-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--borde-suave); }
.aud-item:last-child { border-bottom: none; }
.aud-ic { width: 32px; height: 32px; border-radius: var(--radio-control); display: grid; place-items: center; flex: none; background: var(--tinte); color: var(--suave); }
.aud-det { font-size: 13px; margin-top: 2px; word-break: break-word; }
.aud-user { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--suave); margin-top: 3px; }

.pasos-imp { padding-left: 18px; color: var(--suave); font-size: 13px; margin: 0 0 12px; }
.pasos-imp li { margin-bottom: 6px; }
.imp-error { padding: 10px 12px; font-size: 13px; color: var(--peligro); background: var(--peligro-fondo); border: 1px solid var(--peligro-borde); border-radius: var(--radio-control); }
.imp-error ul { margin: 6px 0 0; padding-left: 18px; }
.etq-fila { padding: 8px 10px; border-radius: var(--radio-control); background: var(--tinte); }

#estado-conexion { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; transform: translateX(-50%); z-index: 60; padding: 6px 12px; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-control); background: var(--tarjeta); color: var(--texto); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
#estado-conexion.pendiente { color: var(--alerta); background: var(--alerta-fondo); border-color: var(--alerta-borde); }
#estado-conexion.error { color: var(--peligro); background: var(--peligro-fondo); border-color: var(--peligro-borde); }
body.con-estado-conexion #app { padding-top: calc(var(--sup) + 32px); }
.sin-red { padding: 28px 18px; }
.sin-red-ic { color: var(--suave); margin-bottom: 8px; }
.sin-red-ic i { width: 32px; height: 32px; }
.aviso-comp { padding: 10px 12px; font-size: 13px; color: var(--peligro); background: var(--peligro-fondo); border: 1px solid var(--peligro-borde); border-radius: var(--radio-control); }
.comp-sunat { padding: 10px 12px; border: 1px solid var(--borde); border-radius: var(--radio-control); }
.comp-sunat p { margin: 6px 0 0; font-size: 12.5px; }
.comp-acciones { gap: 8px; }
.comp-muestra { --cm-amarillo: #fcd643; --cm-verde: #05b15f; --cm-verde-texto: #037a3a; --cm-rojo: #ff3131; --cm-azul: #0049af; --cm-grafito: #2c2c2a; --cm-suave: #5f5e5a; --cm-arena: #f6f5f1; --cm-borde: #e4e2da;
  overflow: hidden; font-size: 12.5px; line-height: 1.4; color: var(--cm-grafito); background: #fff; border: 1px solid var(--borde); border-radius: var(--radio-control); box-shadow: 0 2px 10px rgba(30, 30, 28, 0.08); font-variant-numeric: tabular-nums; }
.cm-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 4px; }
.cm-emisor { display: flex; gap: 12px; min-width: 0; }
.cm-emisor > div { display: grid; gap: 1px; min-width: 0; font-size: 11.5px; color: var(--cm-suave); }
.cm-logo { flex: none; width: 52px; height: 52px; }
.cm-marca { font-size: 24px; font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; color: var(--cm-azul); }
.cm-marca span { color: var(--cm-verde-texto); }
.cm-razon { margin-top: 3px; font-size: 12.5px; color: var(--cm-grafito); }
.cm-num { flex: none; display: grid; width: 210px; overflow: hidden; text-align: center; border: 1.5px solid var(--cm-azul); border-radius: 8px; }
.cm-num > b:first-child { padding: 7px 8px 6px; font-size: 13.5px; }
.cm-tipo { padding: 7px 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.01em; color: #fff; background: var(--cm-azul); }
.cm-codigo { padding: 6px 8px 7px; font-size: 18px; }
.cm-cli { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 20px; margin: 14px 20px 0; padding: 12px 14px; background: var(--cm-arena); border-radius: 8px; }
.cm-cli div { display: grid; grid-template-columns: 128px 1fr; gap: 8px; min-width: 0; }
.cm-cli dt { font-size: 11.5px; color: var(--cm-suave); }
.cm-cli dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.cm-items { width: calc(100% - 40px); margin: 16px 20px 0; border-collapse: collapse; }
.cm-items th { padding: 8px 8px; font-size: 11.5px; font-weight: 700; text-align: left; color: #fff; background: var(--cm-grafito); }
.cm-items td { padding: 8px 8px; vertical-align: top; border-bottom: 1px solid var(--cm-borde); }
.cm-items .num { text-align: right; white-space: nowrap; }
.cm-items .cen { text-align: center; }
.cm-pie { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 16px 20px 0; }
.cm-son { display: grid; gap: 2px; padding-top: 4px; }
.cm-son span { font-size: 11px; color: var(--cm-suave); }
.cm-tot { flex: none; width: 250px; }
.cm-tot div { display: flex; justify-content: space-between; padding: 2px 10px; }
.cm-tot .cm-total { align-items: center; margin-top: 6px; padding: 9px 10px; font-weight: 700; background: var(--cm-amarillo); border-radius: 8px; }
.cm-total b { font-size: 18px; }
.cm-legal { display: flex; align-items: center; gap: 16px; margin: 18px 20px 16px; padding-top: 14px; border-top: 1px solid var(--cm-borde); }
.cm-legal p { margin: 3px 0 0; font-size: 11.5px; color: var(--cm-suave); }
.cm-legal .cm-gracias { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--cm-verde-texto); }
.cm-qr { flex: none; display: grid; place-items: center; width: 74px; height: 74px; font-size: 11px; font-weight: 700; color: var(--cm-suave); border: 1.5px dashed var(--borde-fuerte); border-radius: 6px; }
@media (max-width: 640px) {
  .cm-cab, .cm-pie { flex-direction: column; align-items: stretch; }
  .cm-num, .cm-tot { width: 100%; }
  .cm-cli { grid-template-columns: 1fr; }
  .cm-cli div { grid-template-columns: 116px 1fr; }
  .cm-op { display: none; }
  .cm-items th, .cm-items td { padding: 7px 5px; }
}
.comp-acciones .btn { min-width: 140px; }
.aviso-offline { padding: 10px 12px; margin: 0 0 10px; font-size: 13px; color: var(--alerta); background: var(--alerta-fondo); border: 1px solid var(--alerta-borde); border-radius: var(--radio-control); }
.cola-item { padding: 12px; margin-bottom: 8px; border-radius: var(--radio-control); background: var(--tinte); }
.cola-item.error { background: var(--peligro-fondo); }
.cola-error { color: var(--peligro); font-size: 13px; margin-top: 6px; }

.ia-atajo { width: auto; }
.ia-chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 150px; }
.ia-burbuja { max-width: 86%; padding: 10px 14px; border-radius: var(--radio); font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.ia-burbuja.yo { align-self: flex-end; background: var(--acento); color: var(--sobre-acento); white-space: pre-wrap; }
.ia-burbuja.ella { align-self: flex-start; background: var(--tarjeta); border: 1px solid var(--borde); }
.ia-burbuja.ella.error { background: var(--peligro-fondo); border-color: var(--peligro-borde); color: var(--peligro); }
.ia-burbuja p { margin: 0 0 8px; }
.ia-burbuja p:last-of-type { margin-bottom: 0; }
.ia-burbuja ul { margin: 4px 0 8px; padding-left: 18px; }
.ia-burbuja li { margin-bottom: 4px; }
.ia-burbuja b { font-weight: 600; }
.ia-pie { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--suave); }
.ia-copiar { padding: 3px 10px; background: var(--tarjeta); border: 1px solid var(--borde-fuerte); border-radius: 6px; color: var(--texto); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ia-burbuja.pensando { display: flex; align-items: center; gap: 5px; }
.ia-burbuja.pensando span, .factura-puntos i { width: 7px; height: 7px; border-radius: 50%; background: var(--suave); animation: ia-punto 1.2s infinite ease-in-out; }
.ia-burbuja.pensando span:nth-child(2), .factura-puntos i:nth-child(2) { animation-delay: 0.15s; }
.ia-burbuja.pensando span:nth-child(3), .factura-puntos i:nth-child(3) { animation-delay: 0.3s; }
.ia-burbuja.pensando small { margin-left: 6px; color: var(--suave); }
@keyframes ia-punto { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.ia-bienvenida { text-align: center; padding: 18px 4px; }
.ia-logo { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 10px; color: var(--acento); background: var(--acento-fondo); border-radius: var(--radio); }
.ia-logo i { width: 26px; height: 26px; }
.ia-bienvenida h2 { margin: 6px 0; }
.ia-sugerencias { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 16px; text-align: left; }
.ia-sug { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 12px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio-control); color: var(--texto); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ia-sug:hover { border-color: var(--borde-fuerte); }
.ia-sug span { display: grid; place-items: center; color: var(--suave); }
.ia-gasto { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 132px); text-align: center; font-size: 12px; pointer-events: none; }
.ia-redactar { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 72px); max-width: 720px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; padding: 6px 6px 6px 12px; background: var(--tarjeta); border: 1px solid var(--borde-fuerte); border-radius: var(--radio); z-index: 40; }
.ia-redactar textarea { flex: 1; min-height: 38px; max-height: 140px; padding: 8px 0 !important; border: none !important; background: transparent !important; outline: none !important; resize: none; font: inherit; font-size: 16px; color: var(--texto); }
.ia-enviar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: none; border-radius: var(--radio-control); background: var(--acento); color: var(--sobre-acento); cursor: pointer; }
.ia-vacio { padding: 28px 18px; }

.vence-grupo .muted { font-size: 12px; margin-top: 4px; }
.deuda-tag { font-size: 12px; margin-top: 3px; color: var(--suave); white-space: nowrap; }
.deuda-tag.pronto { color: var(--alerta); font-weight: 600; }
.deuda-tag.vencida { color: var(--peligro); font-weight: 600; }
.deuda-tag.pagada { color: var(--ok); }
.pagos-prov.urgente { border-color: var(--alerta-borde); }
.pago-prov { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--borde-suave); }
.pago-prov:last-child { border-bottom: none; }
.pago-prov .crece { min-width: 0; }
.pago-vence { font-size: 13px; color: var(--suave); }
.pago-prov.vencida .pago-vence, .pago-prov.hoy .pago-vence { color: var(--peligro); font-weight: 600; }
.pago-prov.manana .pago-vence { color: var(--alerta); font-weight: 600; }

.factura-cargando { text-align: center; padding: 24px 8px; }
.factura-puntos { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.factura-cabecera .campo-grupo { margin-bottom: 8px; }
.factura-igv { gap: 6px; font-size: 13px; cursor: pointer; }
.factura-igv input { width: auto; }
.factura-tabla td { vertical-align: top; }
.factura-tabla input.fl-cant { width: 70px; text-align: right; }
.factura-tabla input.fl-costo { width: 90px; text-align: right; }
.factura-tabla td.fl-prod { min-width: 240px; }
.factura-tabla .fl-sel { width: 100%; margin-bottom: 4px; }
.factura-tabla .fl-buscar { width: 100%; font-size: 13px; padding: 6px 8px; }
.factura-tabla .fl-estado { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 4px; color: var(--suave); }
.factura-tabla tr.fl-exacto td:first-child, .factura-tabla tr.fl-elegido td:first-child { color: var(--ok); }
.factura-tabla tr.fl-parecido td:first-child { color: var(--alerta); }
.factura-tabla tr.fl-falta td:first-child { color: var(--peligro); }
.registro-sis { font-size: 12px; color: var(--suave); margin-top: 2px; }

@media (max-width: 640px) {
  #app > .cabecera { flex-wrap: wrap; }
  .er-selector { max-width: 100%; }
  .item-lista:has(> img) { flex-wrap: wrap; }
  .item-lista:has(> img) > img { max-width: 84px; height: auto !important; max-height: 92px; }
  .item-lista:has(> img) > div:not(.der) { flex: 1 1 calc(100% - 96px) !important; }
  .item-lista:has(> img) > .der { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; }
  .item-lista:has(> img) > .der .mt { margin-top: 0; }
  .pago-prov { flex-wrap: wrap; }
  .pago-prov .crece { flex: 1 1 100%; }
  .pago-prov > b { margin-right: auto; }
  .er-meses { gap: 2px; }
  .er-mes-val { font-size: 10px; }
  :has(> table.tabla) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabla-mov thead { display: none; }
  .tabla-mov, .tabla-mov tbody { display: block; width: 100%; }
  .tabla-mov tr.mov-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 12px; row-gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--borde-suave); }
  .tabla-mov tr.mov-fila:last-child { border-bottom: 0; }
  .tabla-mov td { display: block; padding: 0; border: 0; }
  .mov-prod { grid-column: 1 / 3; grid-row: 1; font-weight: 600; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
  .mov-prod .muted { font-weight: 400; }
  .mov-tipo { grid-column: 3; grid-row: 1; text-align: right; }
  .mov-fecha { grid-column: 1; grid-row: 2; font-size: 12px; color: var(--suave); min-width: 0; }
  .mov-cant { grid-column: 2; grid-row: 2; }
  .mov-stock { grid-column: 3; grid-row: 2; }
  .mov-cant::before, .mov-stock::before { content: attr(data-et); display: block; font-size: 12px; color: var(--suave); font-weight: 400; }
}

@media (min-width: 1024px) {
  .solo-cel { display: none !important; }
  .solo-pc { display: flex !important; }
  input, select, textarea { font-size: 14px; }
  .btn { font-size: 14px; }
  body:has(#nav:not(.oculto)) #app, body:has(#nav:not(.oculto)) .pie-version { margin-left: var(--lateral); }
  body:has(#nav:not(.oculto)) #app { padding: 24px 28px 12px; max-width: min(1240px, calc(100vw - var(--lateral))); margin-right: auto; }
  body:has(#nav:not(.oculto)) .pie-version { padding: 4px 28px 20px; }
  h1 { font-size: 22px; }

  .bottom-nav {
    top: 0;
    right: auto;
    width: var(--lateral);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px 16px;
    border-top: none;
    border-right: 1px solid var(--borde);
    overflow-y: auto;
  }
  .nav-marca { display: flex; align-items: center; gap: 10px; flex: none; height: 68px; padding: 0 4px; }
  .bottom-nav button {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    flex: none;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border-radius: var(--radio-control);
    color: var(--nav-suave);
    font-size: 14px;
    font-weight: 500;
  }
  .bottom-nav button:hover { background: var(--tinte); }
  .bottom-nav button.activo { background: var(--acento-fondo); color: var(--acento); }
  .bottom-nav button i { width: 20px; height: 20px; }
  .bottom-nav button[data-nav="inicio"] { order: 1; }
  .bottom-nav button[data-nav="vender"] { order: 2; }
  .bottom-nav button[data-nav="comprar"] { order: 3; }
  .bottom-nav button[data-nav="inventario"] { order: 4; }
  .bottom-nav button[data-nav="crm"] { order: 5; }
  .bottom-nav button[data-nav="reportes"] { order: 6; }
  .bottom-nav button[data-nav="mas"] { order: 7; }

  .modal { align-items: center; padding: 24px; }
  .modal-caja { max-width: 680px; max-height: 88vh; border: 1px solid var(--borde); border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); animation-name: modal-aparece; }
  body.claro .modal-caja { box-shadow: 0 24px 64px rgba(20, 24, 31, 0.18); }
  .modal-caja.ancha { max-width: min(1240px, 94vw); }
  .modal-caja.ancha:has(.reg-filtros) { max-width: min(1364px, 98vw); }
  .modal-header { padding: 16px 16px 14px 24px; }
  .modal-header::before { display: none; }
  .modal-header h3 { font-size: 18px; }
  #modal-cuerpo { padding: 20px 24px 24px; }
  .modal-pie { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; padding: 14px 24px; }
  .modal-pie .btn { width: auto; min-width: 140px; }
  .modal-datos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toast { bottom: 24px; }
  .fab { bottom: 24px; right: 28px; }
  .ia-gasto { left: var(--lateral); bottom: 86px; }
  .ia-redactar { left: calc(var(--lateral) + 28px); right: 28px; bottom: 24px; }
  .ia-chat { padding-bottom: 130px; }
  #estado-conexion { left: calc(50% + var(--lateral) / 2); }

  .ini-rejilla { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .ini-rejilla > * { margin-bottom: 0; min-width: 0; }
  .ini-ventas { grid-column: span 7; align-self: stretch; }
  .ini-inventario { grid-column: span 5; align-self: stretch; }
  .ini-inventario > div { display: flex; flex-direction: column; justify-content: center; }
  .ini-avance { grid-column: span 7; }
  .ini-lado { grid-column: span 5; display: grid; gap: 12px; }
  .ini-lado > * { margin-bottom: 0; }
  .ini-reponer { grid-column: span 12; }
  .ini-reponer .lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ini-pie { grid-column: span 12; }
  .ini-pie .btn { width: auto; }
}
@media (max-width: 1023px) {
  .ini-lado { display: contents; }
  .ini-rejilla { display: flex; flex-direction: column; }
  .ini-ventas { order: 1; }
  .ini-pagos { order: 2; }
  .ini-inventario { order: 3; }
  .ini-stock { order: 4; }
  .ini-reponer { order: 5; }
  .ini-avance { order: 6; }
  .ini-pie { order: 7; }
}

i[class^="i-"] { display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: -4px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.i-inicio { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 11l8-7 8 7%22/%3E%3Cpath d=%22M6 10v10h12V10%22/%3E%3C/svg%3E"); }
.i-crm { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223.5%22/%3E%3Cpath d=%22M3 20c0-3.5 2.7-6 6-6s6 2.5 6 6%22/%3E%3Cpath d=%22M16 5a3.5 3.5 0 010 6.5M18 14.5c1.9.8 3 2.9 3 5.5%22/%3E%3C/svg%3E"); }
.i-vender { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M3 5h3l2.5 11h10L21 8H7%22/%3E%3Ccircle cx=%2210%22 cy=%2220%22 r=%221%22/%3E%3Ccircle cx=%2217%22 cy=%2220%22 r=%221%22/%3E%3C/svg%3E"); }
.i-comprar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 3l8 4.5v9L12 21l-8-4.5v-9z%22/%3E%3Cpath d=%22M4 7.5l8 4.5 8-4.5M12 12v9%22/%3E%3C/svg%3E"); }
.i-etiqueta { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 12V4h8l8 8-8 8z%22/%3E%3Ccircle cx=%228.5%22 cy=%228.5%22 r=%221%22/%3E%3C/svg%3E"); }
.i-reportes { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M5 20V10M12 20V4M19 20v-7%22/%3E%3C/svg%3E"); }
.i-menu { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 6h16M4 12h16M4 18h16%22/%3E%3C/svg%3E"); }
.i-asistente { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9z%22/%3E%3Cpath d=%22M19 16v4M17 18h4%22/%3E%3C/svg%3E"); }
.i-camara { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 8h3l2-3h6l2 3h3v11H4z%22/%3E%3Ccircle cx=%2212%22 cy=%2213%22 r=%223.5%22/%3E%3C/svg%3E"); }
.i-buscar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%2211%22 cy=%2211%22 r=%227%22/%3E%3Cpath d=%22M20 20l-4-4%22/%3E%3C/svg%3E"); }
.i-nota { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M14 3H6v18h12V7z%22/%3E%3Cpath d=%22M14 3v4h4M9 12h6M9 16h6%22/%3E%3C/svg%3E"); }
.i-lista { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M9 6h11M9 12h11M9 18h11M4 6h1M4 12h1M4 18h1%22/%3E%3C/svg%3E"); }
.i-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M5 12.5l4.5 4.5L19 7%22/%3E%3C/svg%3E"); }
.i-alerta { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 4l9 16H3z%22/%3E%3Cpath d=%22M12 10v4M12 17v.5%22/%3E%3C/svg%3E"); }
.i-config { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3Cpath d=%22M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1%22/%3E%3C/svg%3E"); }
.i-efectivo { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x=%223%22 y=%226%22 width=%2218%22 height=%2212%22 rx=%221.5%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%222.5%22/%3E%3Cpath d=%22M6.5 12h.5M17 12h.5%22/%3E%3C/svg%3E"); }
.i-calendario { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x=%224%22 y=%225%22 width=%2216%22 height=%2216%22 rx=%221.5%22/%3E%3Cpath d=%22M4 10h16M8 3v4M16 3v4%22/%3E%3C/svg%3E"); }
.i-bajar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 4v12M7 11l5 5 5-5M5 20h14%22/%3E%3C/svg%3E"); }
.i-subir { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 20V8M7 13l5-5 5 5M5 4h14%22/%3E%3C/svg%3E"); }
.i-mas { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 5v14M5 12h14%22/%3E%3C/svg%3E"); }
.i-sinred { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 4l16 16M8.5 16a5 5 0 017 0M5 12.5a10 10 0 014-2.5M19 12.5a10 10 0 00-5-2.8M12 19.5v.5%22/%3E%3C/svg%3E"); }
.i-tarjeta { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x=%223%22 y=%226%22 width=%2218%22 height=%2213%22 rx=%221.5%22/%3E%3Cpath d=%22M3 10.5h18M7 15h3%22/%3E%3C/svg%3E"); }
.i-gasto { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M5 3h14v18l-3-2-2 2-2-2-2 2-2-2-3 2z%22/%3E%3Cpath d=%22M9 8h6M9 12h6%22/%3E%3C/svg%3E"); }
.i-recibo { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M6 3h12v18l-3-1.5-3 1.5-3-1.5L6 21z%22/%3E%3Cpath d=%22M9 8h6M9 12h6M9 16h3%22/%3E%3C/svg%3E"); }
.i-trofeo { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M8 4h8v6a4 4 0 01-8 0z%22/%3E%3Cpath d=%22M8 6H4v2a3 3 0 003 3M16 6h4v2a3 3 0 01-3 3M12 14v4M8 20h8%22/%3E%3C/svg%3E"); }
.i-ubicacion { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 21s7-6.2 7-11.5A7 7 0 005 9.5C5 14.8 12 21 12 21z%22/%3E%3Ccircle cx=%2212%22 cy=%229.5%22 r=%222.5%22/%3E%3C/svg%3E"); }
.i-abierto { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x=%225%22 y=%2211%22 width=%2214%22 height=%2210%22 rx=%221.5%22/%3E%3Cpath d=%22M8 11V7a4 4 0 017.5-2%22/%3E%3C/svg%3E"); }
.i-cerrado { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x=%225%22 y=%2211%22 width=%2214%22 height=%2210%22 rx=%221.5%22/%3E%3Cpath d=%22M8 11V7a4 4 0 018 0v4%22/%3E%3C/svg%3E"); }
.i-mover { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 9h14l-4-4M20 15H6l4 4%22/%3E%3C/svg%3E"); }
.i-reloj { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%228.5%22/%3E%3Cpath d=%22M12 7v5l3.5 2%22/%3E%3C/svg%3E"); }
.i-sube { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 17l6-6 4 4 6-7%22/%3E%3Cpath d=%22M15 8h5v5%22/%3E%3C/svg%3E"); }
.i-baja { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 7l6 6 4-4 6 7%22/%3E%3Cpath d=%22M15 16h5v-5%22/%3E%3C/svg%3E"); }
.i-editar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 20h4L19 9l-4-4L4 16z%22/%3E%3Cpath d=%22M13 7l4 4%22/%3E%3C/svg%3E"); }
.i-telefono { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x=%227%22 y=%223%22 width=%2210%22 height=%2218%22 rx=%222%22/%3E%3Cpath d=%22M11 18h2%22/%3E%3C/svg%3E"); }
.i-camion { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M3 6h11v10H3zM14 10h4l3 3v3h-7z%22/%3E%3Ccircle cx=%227.5%22 cy=%2218%22 r=%221.8%22/%3E%3Ccircle cx=%2217.5%22 cy=%2218%22 r=%221.8%22/%3E%3C/svg%3E"); }
.i-sol { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%224%22/%3E%3Cpath d=%22M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6L7 7M17 17l1.4 1.4M18.4 5.6L17 7M7 17l-1.4 1.4%22/%3E%3C/svg%3E"); }
.i-luna { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M20 14.5A8.5 8.5 0 019.5 4a8.5 8.5 0 1010.5 10.5z%22/%3E%3C/svg%3E"); }
.i-nube { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M7 19a4.5 4.5 0 01-.6-9A6 6 0 0118 9.5a4.8 4.8 0 01-.5 9.5z%22/%3E%3C/svg%3E"); }
.i-guardar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M5 4h11l3 3v13H5z%22/%3E%3Cpath d=%22M8 4v5h7V4M8 20v-6h8v6%22/%3E%3C/svg%3E"); }
.i-llave { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%228%22 cy=%2215%22 r=%224%22/%3E%3Cpath d=%22M11 12l8-8M16 7l3 3%22/%3E%3C/svg%3E"); }
.i-imprimir { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M7 8V3h10v5M7 17H4V8h16v9h-3%22/%3E%3Cpath d=%22M7 14h10v7H7z%22/%3E%3C/svg%3E"); }
.i-mensaje { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 5h16v12H9l-5 4z%22/%3E%3C/svg%3E"); }
.i-usuario { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%2212%22 cy=%228%22 r=%224%22/%3E%3Cpath d=%22M4 21c0-4 3.6-7 8-7s8 3 8 7%22/%3E%3C/svg%3E"); }
.i-papelera { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M4 7h16M9 7V4h6v3M6 7l1 14h10l1-14M10 11v6M14 11v6%22/%3E%3C/svg%3E"); }
.i-pc { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x=%223%22 y=%224%22 width=%2218%22 height=%2212%22 rx=%221.5%22/%3E%3Cpath d=%22M8 20h8M12 16v4%22/%3E%3C/svg%3E"); }
.i-archivo { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M14 3H6v18h12V7z%22/%3E%3Cpath d=%22M14 3v4h4%22/%3E%3C/svg%3E"); }
.i-prohibido { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%228.5%22/%3E%3Cpath d=%22M6 6l12 12%22/%3E%3C/svg%3E"); }
.i-gasolina { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M5 21V5a1 1 0 011-1h7a1 1 0 011 1v16M3 21h13M8 8h3%22/%3E%3Cpath d=%22M14 11h2a1.5 1.5 0 011.5 1.5V17a1.5 1.5 0 003 0V9l-3-3%22/%3E%3C/svg%3E"); }
.i-salir { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M14 4H5v16h9M10 12h10M16 8l4 4-4 4%22/%3E%3C/svg%3E"); }
.i-borrar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M9 5h11v14H9l-6-7z%22/%3E%3Cpath d=%22M12.5 9.5l5 5M17.5 9.5l-5 5%22/%3E%3C/svg%3E"); }
.i-cerrar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M6 6l12 12M18 6L6 18%22/%3E%3C/svg%3E"); }

.reg-filtros { position: sticky; top: -16px; z-index: 2; background: var(--tarjeta); margin-top: -16px; padding: 16px 0 10px; border-bottom: 1px solid var(--borde-suave); }
.reg-lista { display: flex; flex-direction: column; gap: 10px; }
.reg-card { border: 1px solid var(--borde); border-radius: var(--radio); background: var(--tarjeta); overflow: hidden; transition: border-color .15s; }
.reg-card:hover { border-color: var(--borde-fuerte); }
.reg-card.anulada { opacity: .6; }
.reg-card.anulada .reg-total { text-decoration: line-through; }
.reg-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--tinte); border-bottom: 1px solid var(--borde-suave); }
.reg-id { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.reg-n { font-size: 12px; color: var(--suave); font-variant-numeric: tabular-nums; }
.reg-folio { font-size: 15px; letter-spacing: .2px; }
.reg-total { font-size: 18px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.reg-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; padding: 10px 14px 4px; }
.reg-dato { display: flex; flex-direction: column; min-width: 0; }
.reg-dato > span { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--suave); }
.reg-dato > b { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.reg-dato small { display: block; color: var(--suave); font-size: 12px; font-weight: 400; }
.reg-nota { margin: 4px 14px 0; font-size: 13px; color: var(--suave); font-style: italic; }
.reg-items { list-style: none; margin: 8px 14px; padding: 0; border: 1px solid var(--borde-suave); border-radius: var(--radio-control); }
.reg-items li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 10px; }
.reg-items li + li { border-top: 1px solid var(--borde-suave); }
.reg-prod { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.reg-sku { font-size: 12px; font-weight: 600; color: var(--acento); background: var(--acento-fondo); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.reg-nombre { font-size: 14px; overflow-wrap: anywhere; }
.reg-prod .chips-serie { flex-basis: 100%; min-width: 0; max-width: none; }
.reg-cant { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 14px; }
.reg-cant small { font-size: 12px; }
.reg-pie { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 14px 12px; }
.reg-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--suave); }
.reg-extra b { color: var(--texto); }
.reg-extra .registro-sis { margin: 0; }
.reg-deuda { display: inline-flex; align-items: center; gap: 8px; }
.reg-deuda .deuda-tag { margin: 0; }
.reg-deuda .btn { margin: 0; }
.reg-acc .reg-borrar { color: var(--peligro); border-color: var(--peligro-borde); }
.reg-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
@media (max-width: 600px) {
  .reg-filtros { position: static; margin-top: 0; padding-top: 0; border-bottom: 0; }
  .reg-cab, .reg-meta, .reg-pie { padding-left: 12px; padding-right: 12px; }
  .reg-items { margin: 8px 12px; }
  .reg-meta { grid-template-columns: 1fr 1fr; }
  .reg-acc { width: 100%; margin-left: 0; }
  .reg-acc .btn { flex: 1; }
}
.card.buscador-fijo, .card.buscador-fijo:has(.sugerencias:not(.oculto)) { position: sticky; z-index: 60; }
.buscador-fijo { position: sticky; top: calc(env(safe-area-inset-top) + 8px); z-index: 30; transition: box-shadow .15s, border-color .15s; }
.buscador-fijo.pegado { border-color: var(--borde-fuerte); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28); }
.buscador-fijo .sec-tit { margin-bottom: 8px; }
.buscador-ayuda { margin: -4px 4px 14px; font-size: 13px; }
.buscador-ayuda .btn { width: auto; }

:root {
  --fondo: #0b0e13;
  --tarjeta: #12161d;
  --tarjeta2: #191e27;
  --tinte: #171b23;
  --input-fondo: #0e1218;
  --borde: #242a34;
  --borde-suave: #1c212a;
  --borde-fuerte: #353d4a;
  --radio: 14px;
  --radio-control: 10px;
  --sombra-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sombra-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --sombra-md: 0 4px 12px -2px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --sombra-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  --brillo: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --anillo: 0 0 0 3px color-mix(in srgb, var(--acento) 28%, transparent);
  --lateral-fondo: #0e1117;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.claro {
  --fondo: #f5f6f8;
  --tarjeta: #ffffff;
  --tarjeta2: #f6f7f9;
  --tinte: #f7f8fa;
  --texto: #0f1623;
  --borde: #e4e7ec;
  --borde-suave: #eef0f3;
  --borde-fuerte: #d0d5dd;
  --acento: #1a2b63;
  --acento-fondo: #eceff8;
  --sombra-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --sombra-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.07);
  --sombra-md: 0 6px 16px -4px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
  --sombra-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.18);
  --brillo: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --anillo: 0 0 0 4px color-mix(in srgb, var(--acento) 14%, transparent);
  --lateral-fondo: #fbfbfc;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "tnum";
  letter-spacing: -0.006em;
  line-height: 1.45;
}
h1, h2, h3, h4 { letter-spacing: -0.018em; font-weight: 650; }
h1 { letter-spacing: -0.025em; font-weight: 700; }
.sec-tit, .card > h3 { letter-spacing: -0.012em; font-weight: 650; }
.muted, .etiqueta { letter-spacing: 0; }

.card, .metrica, .item-lista, .reg-card {
  box-shadow: var(--sombra-sm);
  border-color: var(--borde);
}
.card { padding: 18px; margin-bottom: 14px; }
.item-lista { transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s var(--ease); }
.item-lista:hover { box-shadow: var(--sombra-md); border-color: var(--borde-fuerte); }
.item-lista:active { transform: scale(0.995); }
#modal-cuerpo .card, #modal-cuerpo .metrica { box-shadow: none; }

.metrica .valor, .rp-valor { letter-spacing: -0.025em; font-weight: 700; }
.metrica .etiqueta { font-weight: 500; }
.rp-valor { font-size: 28px; }

.btn {
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: var(--sombra-xs), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s var(--ease), color 0.15s ease;
}
.btn:hover { opacity: 1; background: color-mix(in srgb, var(--acento) 88%, var(--texto)); border-color: color-mix(in srgb, var(--acento) 88%, var(--texto)); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); box-shadow: none; }
.btn:focus-visible, .btn-icono:focus-visible, .btn-atras:focus-visible, .bottom-nav button:focus-visible, .chip-filtro:focus-visible { outline: none; box-shadow: var(--anillo); }
.btn.secundario { box-shadow: var(--sombra-xs), var(--brillo); border-color: var(--borde-fuerte); }
.btn.secundario:hover { background: var(--tarjeta2); border-color: color-mix(in srgb, var(--borde-fuerte) 70%, var(--texto)); }
.btn.peligro:hover { background: color-mix(in srgb, var(--peligro) 88%, #000); border-color: color-mix(in srgb, var(--peligro) 88%, #000); }
.btn-icono { box-shadow: var(--sombra-xs), var(--brillo); transition: background-color 0.15s ease, border-color 0.15s ease; }
.btn-icono:hover { background: var(--tarjeta2); }

input, select, textarea {
  box-shadow: var(--sombra-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
input:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) { border-color: color-mix(in srgb, var(--borde-fuerte) 70%, var(--texto)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: var(--sombra-xs), var(--anillo); }
input[type="checkbox"], input[type="radio"] { box-shadow: none; }
label { color: color-mix(in srgb, var(--texto) 72%, var(--suave)); font-weight: 550; }

.badge { border-radius: 999px; padding: 2px 9px; font-weight: 600; letter-spacing: 0; }

.tabla th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--tinte); }
.tabla th:first-child { border-top-left-radius: 8px; }
.tabla th:last-child { border-top-right-radius: 8px; }
.tabla tbody tr { transition: background-color 0.12s ease; }

.vista-toggle, .graf-periodos, .rep-pestanas { box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06); }
.vista-toggle button.activo, .graf-periodos .activo, .rep-pestanas .activo { box-shadow: var(--sombra-sm); }

.toast { border-radius: 12px; box-shadow: var(--sombra-lg); padding: 13px 16px; }

.modal { -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%); }
.modal-caja { box-shadow: var(--sombra-lg); }
.modal-header h3 { letter-spacing: -0.02em; font-weight: 700; }

.bottom-nav {
  background: color-mix(in srgb, var(--tarjeta) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.bottom-nav button { transition: color 0.15s ease; }
.bottom-nav button i { transition: transform 0.2s var(--ease); }
.bottom-nav button.activo i { transform: translateY(-1px); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--borde-fuerte) 80%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--suave); }
::-webkit-scrollbar-track { background: transparent; }

@media (min-width: 1024px) {
  .bottom-nav { background: var(--lateral-fondo); -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0 14px 16px; }
  .nav-marca { height: 72px; margin: 0 -14px 10px; padding: 0 18px; border-bottom: 1px solid var(--borde-suave); }
  .bottom-nav button { position: relative; height: 40px; color: var(--nav-suave); transition: background-color 0.15s ease, color 0.15s ease; }
  .bottom-nav button:hover { background: var(--tarjeta2); color: var(--texto); }
  .bottom-nav button.activo { background: var(--tarjeta); color: var(--acento); font-weight: 650; box-shadow: var(--sombra-sm); outline: 1px solid var(--borde); }
  .bottom-nav button.activo::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acento); }
  body:has(#nav:not(.oculto)) #app { padding: 28px 32px 12px; }
  h1, .ini-titulo h1 { font-size: 24px; }
  .card { padding: 20px; }
  .modal-caja { box-shadow: var(--sombra-lg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .item-lista, .bottom-nav button i, input, select, textarea { transition: none; }
  .btn:active:not(:disabled), .item-lista:active { transform: none; }
}

:root {
  --ambar: #ef9f27;
  --sobre-ambar: #412402;
  --c-azul: #85b7eb;
  --c-azul-f: rgba(55, 138, 221, 0.18);
  --c-verde: #97c459;
  --c-verde-f: rgba(99, 153, 34, 0.2);
  --c-verde-l: #97c459;
  --c-ambar: #fac775;
  --c-ambar-f: rgba(239, 159, 39, 0.18);
  --c-rojo: #f09595;
  --c-rojo-f: rgba(226, 75, 74, 0.18);
}
body.claro {
  --fondo: #fafaf8;
  --tarjeta: #ffffff;
  --tarjeta2: #f6f5f1;
  --tinte: #f6f5f1;
  --input-fondo: #ffffff;
  --texto: #1f1f1d;
  --suave: #5f5e5a;
  --nav-suave: #5f5e5a;
  --acento: #2c2c2a;
  --sobre-acento: #ffffff;
  --acento-fondo: #f1efe8;
  --borde: #e4e2da;
  --borde-suave: #f1efe8;
  --borde-fuerte: #d3d1c7;
  --segmento: #f1efe8;
  --segmento-activo: #ffffff;
  --sobre-segmento: #1f1f1d;
  --barra: #d3d1c7;
  --marca-max: #ba7517;
  --lateral-fondo: #f6f5f1;
  --ok: #3b6d11;
  --alerta: #854f0b;
  --alerta-fondo: #faeeda;
  --alerta-borde: #f3d7a6;
  --peligro: #a32d2d;
  --peligro-fondo: #fcebeb;
  --peligro-borde: #f2c4c4;
  --c-azul: #185fa5;
  --c-azul-f: #e6f1fb;
  --c-verde: #3b6d11;
  --c-verde-f: #eaf3de;
  --c-verde-l: #639922;
  --c-ambar: #854f0b;
  --c-ambar-f: #faeeda;
  --c-rojo: #a32d2d;
  --c-rojo-f: #fcebeb;
  --sombra-xs: 0 1px 2px rgba(44, 44, 42, 0.05);
  --sombra-sm: 0 1px 2px rgba(44, 44, 42, 0.04), 0 1px 3px rgba(44, 44, 42, 0.06);
  --sombra-md: 0 8px 20px -6px rgba(44, 44, 42, 0.12), 0 2px 4px -2px rgba(44, 44, 42, 0.06);
  --anillo: 0 0 0 4px rgba(239, 159, 39, 0.24);
}

.btn.btn-ambar { background: var(--ambar); border-color: var(--ambar); color: var(--sobre-ambar); }
.btn.btn-ambar:hover { background: color-mix(in srgb, var(--ambar) 88%, #000); border-color: color-mix(in srgb, var(--ambar) 88%, #000); }

.ini-titulo .crece { min-width: 0; }
.ini-titulo h1 { margin: 0; }
.ini-titulo .ini-fecha { margin-top: 2px; }
.ini-titulo .ini-fecha::first-letter, .ini-saludo span::first-letter { text-transform: uppercase; }
.ini-saludo { display: flex; flex-direction: column; margin: 2px 2px 12px; }
.ini-saludo b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.ini-saludo span { color: var(--suave); font-size: 13px; }

.ini-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ini-kpi { min-width: 0; padding: 16px 18px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra-sm); }
.ini-kpi[data-accion] { cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.2s ease; }
.ini-kpi[data-accion]:hover { border-color: var(--borde-fuerte); box-shadow: var(--sombra-md); }
.ini-kpi[data-accion]:focus-visible { outline: none; box-shadow: var(--anillo); }
.ini-kpi-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ini-kpi-ic { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--k-f); color: var(--k); }
.ini-chispa { width: 76px; height: 28px; color: var(--k-l, var(--k)); overflow: visible; }
.ini-chispa polyline { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ini-kpi-val { margin: 12px 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ini-kpi-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; color: var(--suave); font-size: 13px; }
.ini-pill { padding: 2px 9px; border-radius: 999px; background: var(--tinte); color: var(--suave); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ini-pill.ok { background: var(--c-verde-f); color: var(--c-verde); }
.ini-pill.alerta { background: var(--c-ambar-f); color: var(--c-ambar); }
.ini-pill.peligro { background: var(--c-rojo-f); color: var(--c-rojo); }
.kp-ventas { --k: var(--c-azul); --k-f: var(--c-azul-f); }
.kp-gan { --k: var(--c-verde); --k-f: var(--c-verde-f); --k-l: var(--c-verde-l); }
.kp-pagar { --k: var(--c-ambar); --k-f: var(--c-ambar-f); }
.kp-reponer { --k: var(--c-rojo); --k-f: var(--c-rojo-f); }

.top-fila { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--borde-suave); }
.top-fila:last-child { border-bottom: none; }
.top-fila .crece { min-width: 0; }
.top-n { display: flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--tinte); color: var(--suave); font-size: 12px; font-weight: 700; }
.top-n.uno { background: var(--c-azul-f); color: var(--c-azul); }
.top-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-pista { height: 5px; margin-top: 6px; border-radius: 3px; background: var(--borde-suave); overflow: hidden; }
.top-pista i { display: block; height: 100%; border-radius: 3px; background: var(--c-azul); }
.top-fila:nth-child(n+2) .top-pista i { background: color-mix(in srgb, var(--c-azul) 55%, transparent); }

.graf-gan { background: var(--c-verde-l); }
.graf-punto.ganancia { background: var(--c-verde-l); }
.graf-col.hoy .graf-barra { background: var(--acento); }

.nav-sec, .nav-n { display: none; }

@media (max-width: 1023px) {
  .ini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ini-kpi { padding: 13px 14px; }
  .ini-kpi-ic { width: 32px; height: 32px; }
  .ini-chispa { width: 56px; height: 24px; }
  .ini-kpi-val { margin-top: 10px; font-size: 20px; }
  .ini-kpi-pie { font-size: 12px; }
  .ini-top { order: 5; }
}

@media (min-width: 1024px) {
  .bottom-nav .nav-marca { order: 0; }
  .bottom-nav .nav-sec-principal { order: 1; }
  .bottom-nav [data-nav="inicio"] { order: 2; }
  .bottom-nav [data-nav="vender"] { order: 3; }
  .bottom-nav [data-nav="comprar"] { order: 4; }
  .bottom-nav [data-nav="inventario"] { order: 5; }
  .bottom-nav .nav-sec-gestion { order: 6; }
  .bottom-nav [data-nav="crm"] { order: 7; }
  .bottom-nav [data-nav="reportes"] { order: 8; }
  .bottom-nav [data-nav="mas"] { order: 9; }
  .nav-sec { display: block; padding: 14px 12px 6px; color: var(--suave); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
  .nav-sec-principal { padding-top: 4px; }
  .nav-n:not([hidden]) { display: inline-block; min-width: 22px; margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--c-rojo-f); color: var(--c-rojo); font-size: 11px; font-weight: 700; text-align: center; }
  .bottom-nav button.activo { color: var(--texto); }
  .bottom-nav button.activo::before { background: var(--ambar); }
  .bottom-nav button.activo i { color: var(--marca-max); }
}
.i-devolver { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M9 14L4 9l5-5%22/%3E%3Cpath d=%22M4 9h10.5a5.5 5.5 0 0 1 0 11H11%22/%3E%3C/svg%3E"); }
.dev-cant { width: 76px; text-align: right; }
.dev-series { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.dev-serie { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; min-height: 32px; cursor: pointer; }
.dev-registro { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--borde); }
#dev-resumen:empty { display: none; }
:root { --borde-campo: #68707f; }
body.claro { --borde-campo: #8f8d85; }
input, select, textarea { border-color: var(--borde-campo); }
.ia-redactar { border-color: var(--borde-campo); }
.modal-caja:focus { outline: none; }
[role="button"][data-accion]:focus-visible, [role="button"][data-nav]:focus-visible { outline: 2px solid var(--acento); outline-offset: -2px; box-shadow: var(--anillo); }
tr[role="button"] { cursor: pointer; }

.venta-mas { margin-top: 6px; border-top: 1px solid var(--borde-suave); }
.venta-mas summary { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; }
.venta-mas summary::-webkit-details-marker { display: none; }
.venta-mas summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 3px 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
.venta-mas[open] summary::before { transform: rotate(45deg); margin-bottom: 6px; }
.venta-mas summary span { white-space: nowrap; }
.venta-mas summary small { flex: 1; min-width: 0; color: var(--suave); font-weight: 400; font-size: 12px; line-height: 1.35; }
.venta-mas[open] summary { margin-bottom: 6px; }
.venta-total { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--borde); font-weight: 600; }
.venta-total b { font-size: 24px; letter-spacing: -0.01em; }
.venta-resumen .fila.entre b, .venta-barra-total b, .carrito-sub b { font-variant-numeric: tabular-nums; }
.carrito-campo { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--suave); }
.carrito-sub { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 78px; font-size: 11px; font-weight: 600; color: var(--suave); }
.carrito-sub b { padding: 9px 0; font-size: 14px; color: var(--texto); }
.sug.sin-stock { opacity: .55; }
.sug.sin-stock:hover, .sug.sin-stock:focus-visible { opacity: .85; }
.item-foto:empty, .sug-foto:empty { display: grid; place-items: center; background: var(--tinte, #f3f2ee); }
.item-foto:empty::after, .sug-foto:empty::after { content: ""; width: 42%; height: 42%; background: var(--suave); opacity: .45; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 3l8 4.5v9L12 21l-8-4.5v-9z%22/%3E%3Cpath d=%22M4 7.5l8 4.5 8-4.5M12 12v9%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%22M12 3l8 4.5v9L12 21l-8-4.5v-9z%22/%3E%3Cpath d=%22M4 7.5l8 4.5 8-4.5M12 12v9%22/%3E%3C/svg%3E") center / contain no-repeat; }
.venta-barra { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 45; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--tarjeta); border-top: 1px solid var(--borde); box-shadow: 0 -6px 18px rgba(20, 24, 31, 0.08); }
.venta-barra-total { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.venta-barra-total span { font-size: 12px; color: var(--suave); }
.venta-barra-total b { font-size: 20px; }
.venta-barra .btn { width: auto; flex: none; min-height: 48px; padding-inline: 22px; }
body:has(.venta-barra:not(.oculto)) #app { padding-bottom: 96px; }
@media (max-width: 1023px) {
  .bottom-nav button { position: relative; }
  .bottom-nav button.activo::after { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--ambar); }
  body.claro .bottom-nav button.activo { color: var(--texto); }
}
@media (min-width: 1024px) {
  .venta-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 340px); gap: 20px; align-items: start; }
  .venta-resumen { position: sticky; top: 24px; }
  .venta-barra { display: none !important; }
  body:has(.venta-barra:not(.oculto)) #app { padding-bottom: 12px; }
}
.venta-principal { container-type: inline-size; min-width: 0; }
@container (max-width: 640px) {
  .carrito-linea { flex-wrap: wrap; }
  .carrito-linea .nom { flex: 1 1 100%; }
  .carrito-foto + .nom { flex: 1 1 calc(100% - 88px); }
  .carrito-foto { width: 72px; height: 72px; }
}
.ini-pill.accion { background: var(--ambar); color: var(--sobre-ambar); font-weight: 600; }
.sug-aviso { padding: 9px 12px; font-size: 13px; line-height: 1.45; color: var(--suave); background: var(--tinte); border-bottom: 1px solid var(--borde-suave); }
#inv-aviso .sug-aviso { margin-bottom: 10px; border: 1px solid var(--borde-suave); border-radius: 10px; }
.enlace-sug { display: inline; width: auto; min-height: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--texto); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.vend-lista { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.vend-fila { display: flex; align-items: center; gap: 8px; }
.vend-fila .crece { flex: 1; min-width: 0; }
.vend-fila .vend-desc { width: 150px; flex: none; }
.vend-quitar { min-height: 44px; min-width: 44px; flex: none; }
.vend-cab { margin-top: 8px; font-size: 13px; font-weight: 550; color: var(--suave); }
.vend-cab .vend-quitar { min-height: 0; }
.bottom-nav [data-nav="inicio"] { --sec: #4f9be6; --sec-f: rgba(55, 138, 221, 0.18); }
.bottom-nav [data-nav="vender"] { --sec: #a3d977; --sec-f: rgba(124, 179, 66, 0.22); }
.bottom-nav [data-nav="comprar"] { --sec: #fdba74; --sec-f: rgba(251, 146, 60, 0.22); }
.bottom-nav [data-nav="inventario"] { --sec: #9a92ec; --sec-f: rgba(127, 119, 221, 0.2); }
.bottom-nav [data-nav="crm"], .bottom-nav [data-nav="cotizaciones"] { --sec: #e27aa0; --sec-f: rgba(212, 83, 126, 0.2); }
.bottom-nav [data-nav="reportes"] { --sec: #3fbf95; --sec-f: rgba(29, 158, 117, 0.2); }
.bottom-nav [data-nav="mas"] { --sec: #a8a7a0; --sec-f: rgba(136, 135, 128, 0.2); }
body.claro .bottom-nav [data-nav="inicio"] { --sec: #185fa5; --sec-f: #e6f1fb; }
body.claro .bottom-nav [data-nav="vender"] { --sec: #4a8f1c; --sec-f: #ecf7e0; }
body.claro .bottom-nav [data-nav="comprar"] { --sec: #c95a0a; --sec-f: #fff1e3; }
body.claro .bottom-nav [data-nav="inventario"] { --sec: #534ab7; --sec-f: #eeedfe; }
body.claro .bottom-nav [data-nav="crm"], body.claro .bottom-nav [data-nav="cotizaciones"] { --sec: #993556; --sec-f: #fbeaf0; }
body.claro .bottom-nav [data-nav="reportes"] { --sec: #0f6e56; --sec-f: #e1f5ee; }
body.claro .bottom-nav [data-nav="mas"] { --sec: #5f5e5a; --sec-f: #eceae3; }
.nav-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--sec-f); color: var(--sec); transition: background-color 0.15s ease, color 0.15s ease; }
.bottom-nav button .nav-ic i { width: 18px; height: 18px; color: inherit; }
.bottom-nav button.activo .nav-ic { background: var(--sec); color: #fff; }
.bottom-nav button.activo .nav-ic i { color: inherit; transform: none; }
.bottom-nav button.activo::before, .bottom-nav button.activo::after { background: var(--sec); }
@media (max-width: 1023px) {
  .nav-ic { width: 28px; height: 28px; border-radius: 8px; }
  .bottom-nav button .nav-ic i { width: 17px; height: 17px; }
}
@media (min-width: 1024px) {
  .bottom-nav button { gap: 10px; padding: 0 8px; }
  .bottom-nav button.activo { background: var(--sec-f); color: var(--texto); }
  .bottom-nav button[data-nav="gastos"] { order: 5; }
  .bottom-nav .nav-sec-gestion { order: 6; }
  .bottom-nav button[data-nav="caja"] { order: 7; }
  .bottom-nav button[data-nav="crm"] { order: 8; }
  .bottom-nav button[data-nav="reportes"] { order: 9; }
  .bottom-nav button[data-nav="mas"] { order: 10; }
  .bottom-nav button[data-nav="cotizaciones"] { order: 5; }
}
.solo-pc.oculto { display: none !important; }
[data-sec="inicio"] { --sec: #85b7eb; --sec-f: rgba(55, 138, 221, 0.2); }
body.claro [data-sec="inicio"], body.claro[data-sec="inicio"] { --sec: #185fa5; --sec-f: #e6f1fb; }
[data-sec="vender"] { --sec: #a3d977; --sec-f: rgba(124, 179, 66, 0.22); }
body.claro [data-sec="vender"], body.claro[data-sec="vender"] { --sec: #4a8f1c; --sec-f: #ecf7e0; }
[data-sec="comprar"] { --sec: #fdba74; --sec-f: rgba(251, 146, 60, 0.22); }
body.claro [data-sec="comprar"], body.claro[data-sec="comprar"] { --sec: #c95a0a; --sec-f: #fff1e3; }
[data-sec="items"] { --sec: #afa9ec; --sec-f: rgba(127, 119, 221, 0.22); }
body.claro [data-sec="items"], body.claro[data-sec="items"] { --sec: #534ab7; --sec-f: #eeedfe; }
[data-sec="crm"] { --sec: #ed93b1; --sec-f: rgba(212, 83, 126, 0.22); }
body.claro [data-sec="crm"], body.claro[data-sec="crm"] { --sec: #993556; --sec-f: #fbeaf0; }
[data-sec="reportes"] { --sec: #5dcaa5; --sec-f: rgba(29, 158, 117, 0.22); }
body.claro [data-sec="reportes"], body.claro[data-sec="reportes"] { --sec: #0f6e56; --sec-f: #e1f5ee; }
[data-sec="gastos"] { --sec: #f0997b; --sec-f: rgba(216, 90, 48, 0.22); }
body.claro [data-sec="gastos"], body.claro[data-sec="gastos"] { --sec: #993c1d; --sec-f: #faece7; }
[data-sec="mas"] { --sec: #c9c7be; --sec-f: rgba(136, 135, 128, 0.24); }
body.claro [data-sec="mas"], body.claro[data-sec="mas"] { --sec: #444441; --sec-f: #f1efe8; }
body[data-sec] { --acento: var(--sec); --acento-fondo: var(--sec-f); --sobre-acento: #101318; }
body.claro[data-sec] { --sobre-acento: #ffffff; }
#app > .cabecera h1::before { content: ""; display: inline-block; width: 6px; height: 0.9em; margin-right: 10px; border-radius: 3px; background: var(--acento); vertical-align: -0.06em; }
.mas-ic[data-sec] { width: 38px; height: 38px; border-radius: 10px; background: var(--sec-f); color: var(--sec); }
.mas-ic[data-sec] i { width: 20px; height: 20px; }
.ini-kpi { background: var(--k-f); border-color: color-mix(in srgb, var(--k) 22%, transparent); box-shadow: none; }
.ini-kpi .ini-kpi-ic { background: var(--k); color: var(--tarjeta); }
.ini-kpi .ini-kpi-val { color: var(--k); }
.ini-kpi .ini-kpi-pie { color: color-mix(in srgb, var(--k) 70%, var(--suave)); }
.kp-ventas { --k: var(--c-azul); --k-f: var(--c-azul-f); }
#app .card { border-top: 3px solid color-mix(in srgb, var(--acento) 55%, var(--borde)); }
#app .card.ini-kpi { border-top-width: 1px; }
.sec-tit::before, #app .card > h3:not(.sec-tit)::before { content: ""; display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 3px; background: var(--acento); }
#app .card > h3:not(.sec-tit)::before { margin-right: 8px; vertical-align: 0.12em; }
.badge.ok { background: var(--c-verde-f); color: var(--c-verde); border-color: transparent; }
.badge.bajo { background: var(--c-ambar-f); color: var(--c-ambar); border-color: transparent; }
.badge.agotado { background: var(--c-rojo-f); color: var(--c-rojo); border-color: transparent; }
.top-n.uno { background: var(--acento); color: var(--sobre-acento); }
.top-pista i { background: var(--acento); }
.top-fila:nth-child(n+2) .top-pista i { background: color-mix(in srgb, var(--acento) 55%, transparent); }
.mas-item:hover { background: color-mix(in srgb, var(--sec-f, var(--tinte)) 60%, transparent); }
.bottom-nav [data-nav="gastos"] { --sec: #f0997b; --sec-f: rgba(216, 90, 48, 0.22); }
body.claro .bottom-nav [data-nav="gastos"] { --sec: #993c1d; --sec-f: #faece7; }
.bottom-nav [data-nav="caja"] { --sec: #a3d977; --sec-f: rgba(124, 179, 66, 0.22); }
body.claro .bottom-nav [data-nav="caja"] { --sec: #4a8f1c; --sec-f: #ecf7e0; }
.carrito-gan { margin-top: 4px; font-size: 11px; }
