/* =====================================================================
   Angelica Store · Ventas — estilos (mobile-first)
   ===================================================================== */

:root {
  color-scheme: light;
  --bg: #f6f2f5;
  --surface: #ffffff;
  --surface-2: #fbf8fa;
  --ink: #221a26;
  --ink-2: #4b4252;
  --muted: #7b7282;
  --line: #ece5eb;
  --line-2: #dfd6de;

  --brand: #b3245f;
  --brand-ink: #8c1a49;
  --brand-soft: #fbe8f0;
  --brand-softer: #fdf3f7;

  --ok: #1b7a4c;      --ok-soft: #e4f4eb;
  --warn: #9a5b06;    --warn-soft: #fdf0d9;
  --bad: #b42318;     --bad-soft: #fdeceb;
  --info: #2a5ca3;    --info-soft: #e8f0fb;
  --wa: #128c4b;

  --r-lg: 18px;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(34, 26, 38, .05), 0 6px 18px rgba(34, 26, 38, .05);
  --shadow-lg: 0 12px 40px rgba(34, 26, 38, .18);

  --top-h: 56px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Arranque ---------- */
.arranque { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.arranque img { animation: latido 1.2s ease-in-out infinite; }
@keyframes latido { 50% { transform: scale(.92); opacity: .8; } }

/* ---------- Estructura ---------- */
.shell { min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: flex; align-items: center; gap: 8px;
  background: rgba(246, 242, 245, .88);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.con-borde { border-bottom-color: var(--line); }
.topbar h1 { font-size: 18px; font-weight: 750; letter-spacing: -.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .atras { margin-left: -6px; }

.chip-tasa {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 650; color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.chip-tasa b { color: var(--ink); }
.chip-tasa .punto { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.chip-tasa.vieja .punto { background: var(--warn); }
.chip-tasa.sin .punto { background: var(--bad); }

.contenido {
  padding: 8px 14px calc(var(--nav-h) + var(--safe-b) + 28px);
  max-width: 1080px; margin: 0 auto;
}

/* Barra inferior (móvil) */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.navbar a, .navbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.navbar a.activo, .navbar button.activo { color: var(--brand); }
.navbar .ico { width: 24px; height: 24px; }
.navbar .nav-mas-venta span.circulo {
  width: 50px; height: 50px; border-radius: 16px; margin-top: -18px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 18px rgba(179, 36, 95, .35);
}
.navbar .nav-mas-venta .ico { width: 26px; height: 26px; }

/* Barra lateral (escritorio) */
.sidebar { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .navbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh;
    padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; font-size: 16px; }
  .sidebar .marca small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
  .sidebar a, .sidebar button.enlace {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px; border: 0; background: none; width: 100%;
    color: var(--ink-2); text-decoration: none; font-weight: 600; cursor: pointer; text-align: left;
  }
  .sidebar a:hover, .sidebar button.enlace:hover { background: var(--surface-2); }
  .sidebar a.activo { background: var(--brand-soft); color: var(--brand-ink); }
  .sidebar .ico { width: 20px; height: 20px; }
  .sidebar .nueva { margin: 6px 0 12px; justify-content: center; }
  .sidebar .pie { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
  .topbar { padding: 0 28px; }
  .topbar .solo-movil { display: none; }
  .contenido { padding: 12px 28px 48px; }
}

/* ---------- Iconos ---------- */
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 28px; height: 28px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid transparent; background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .06s ease, background-color .15s ease, box-shadow .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primario { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(179, 36, 95, .25); }
.btn.primario:hover { background: var(--brand-ink); }
.btn.suave { background: var(--brand-soft); color: var(--brand-ink); }
.btn.borde { border-color: var(--line-2); background: var(--surface); }
.btn.fantasma { background: transparent; color: var(--ink-2); }
.btn.fantasma:hover { background: rgba(34, 26, 38, .05); }
.btn.peligro { background: var(--bad-soft); color: var(--bad); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.bloque { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.icono { width: 44px; padding: 0; }
.btn.icono.sm { width: 36px; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Tarjetas y secciones ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.seccion { margin-top: 22px; }
.seccion-titulo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.seccion-titulo h2 { font-size: 16px; font-weight: 750; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.seccion-titulo a { font-size: 14px; font-weight: 650; text-decoration: none; }
.contador { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.contador.rojo { background: var(--bad); color: #fff; }

.saludo { padding: 6px 2px 4px; }
.saludo h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.saludo p { color: var(--muted); }

/* ---------- Estadísticas ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.stat .etq { font-size: 12.5px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.stat.destacado { background: linear-gradient(135deg, #b3245f, #7d1a4a); border-color: transparent; color: #fff; }
.stat.destacado .etq, .stat.destacado .sub { color: rgba(255, 255, 255, .8); }
.stat.alerta .val { color: var(--bad); }

.mes-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.mes-nav span { font-size: 13px; font-weight: 700; padding: 0 6px; min-width: 110px; text-align: center; }

/* ---------- Listas ---------- */
.lista { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.fila {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-top: 1px solid var(--line);
  color: inherit; text-decoration: none; background: var(--surface);
}
.fila:first-child { border-top: 0; }
a.fila:active, button.fila:active { background: var(--surface-2); }
button.fila { width: 100%; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; }
button.fila:first-child { border-top: 0; }
.fila .principal { flex: 1; min-width: 0; }
.fila .titulo { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .detalle { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .detalle.multi { white-space: normal; }
.fila .lado { text-align: right; flex: none; }
.fila .lado .monto { font-weight: 750; white-space: nowrap; }
.fila .lado .monto-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fila .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.fila .acciones { display: flex; gap: 6px; flex: none; }
.avatar { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--brand-soft); color: var(--brand-ink); }
.avatar.gris { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.vacio { padding: 26px 18px; text-align: center; color: var(--muted); }
.vacio .ico { width: 34px; height: 34px; margin: 0 auto 8px; color: var(--line-2); }
.vacio strong { display: block; color: var(--ink-2); margin-bottom: 2px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.badge.gris { background: #efebee; color: #6b6370; border-color: transparent; }

/* ---------- Formularios ---------- */
.campo { display: block; margin-top: 14px; }
.campo:first-child { margin-top: 0; }
.campo > span.etq { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.campo > span.etq small { font-weight: 500; color: var(--muted); }
.campo .ayuda { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.campo .ayuda.error { color: var(--bad); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font-size: 16px; /* evita zoom en iOS */
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(179, 36, 95, .15); }
.input.invalido { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.input-grupo { position: relative; display: flex; align-items: stretch; }
.input-grupo .prefijo { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.input-grupo .input.con-prefijo { padding-left: 38px; }
.input-grupo .input.con-prefijo.largo { padding-left: 44px; }
.input-grupo .btn { position: absolute; right: 5px; top: 5px; min-height: 36px; }
.input.grande { font-size: 22px; font-weight: 800; min-height: 54px; }
.buscador { position: relative; }
.buscador .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.buscador .input { padding-left: 40px; }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dos-col > .campo { margin-top: 14px; }

/* Control segmentado */
.segmentos { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: #efe8ee; border-radius: 13px; }
.segmentos button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; font-size: 14px; }
.segmentos button.activo { background: var(--surface); color: var(--brand-ink); box-shadow: 0 1px 3px rgba(34, 26, 38, .12); }

/* Chips de filtro */
.filtros { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; margin: 10px -14px 0; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.filtro { flex: none; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 650; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.filtro.activo { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (min-width: 960px) { .filtros { margin-left: 0; margin-right: 0; padding-left: 2px; } }

/* Stepper de cantidad */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; overflow: hidden; background: var(--surface); }
.stepper button { width: 36px; height: 36px; border: 0; background: var(--surface-2); font-size: 18px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.stepper input { width: 42px; height: 36px; border: 0; text-align: center; font-weight: 750; font-size: 16px; background: transparent; }
.stepper input:focus { outline: none; }

/* Resultados de búsqueda */
.resultados { margin-top: 8px; max-height: 300px; overflow-y: auto; }
.resultados .fila { padding: 10px 12px; }

/* Captura */
.captura { display: flex; align-items: center; gap: 10px; }
.captura-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 1.5px dashed var(--line-2); border-radius: 12px; color: var(--ink-2); font-weight: 650; cursor: pointer; background: var(--surface-2); padding: 0 12px; }
.captura-btn input { display: none; }
.captura-mini { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); flex: none; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--muted); }
.captura-mini img { width: 100%; height: 100%; object-fit: cover; }
.captura-mini button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }

/* Bloque de pago dentro de formularios */
.bloque-pago { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface-2); margin-top: 12px; }
.bloque-pago .cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 750; }
.metodos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.metodos button { min-height: 44px; border: 1.5px solid var(--line-2); border-radius: 11px; background: var(--surface); font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink-2); padding: 0 4px; }
.metodos button.activo { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-ink); }
.equivale { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.equivale b { color: var(--ink); }
.atajos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Totales / resumen */
.resumen-linea { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.resumen-linea span { color: var(--muted); }
.resumen-linea b { font-weight: 750; }
.resumen-linea.total { border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 10px; }
.resumen-linea.total b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }

.progreso { height: 8px; border-radius: 999px; background: #efe8ee; overflow: hidden; }
.progreso > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #d0457f, var(--brand)); transition: width .4s ease; }
.progreso.lleno > div { background: var(--ok); }

.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; font-size: 14px; margin-top: 12px; }
.aviso .ico { margin-top: 1px; }
.aviso.info { background: var(--info-soft); color: #1f4a86; }
.aviso.warn { background: var(--warn-soft); color: #7a4704; }
.aviso.bad { background: var(--bad-soft); color: #8a1c12; }
.aviso.ok { background: var(--ok-soft); color: #145c39; }

/* Barra fija inferior de formularios largos */
.barra-accion {
  position: fixed; left: 0; right: 0; z-index: 35;
  bottom: calc(var(--nav-h) + var(--safe-b));
  padding: 10px 14px; display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(34, 26, 38, .06);
}
.barra-accion .total { flex: 1; min-width: 0; }
.barra-accion .total small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.barra-accion .total b { font-size: 19px; font-weight: 800; white-space: nowrap; }
.con-barra-accion { padding-bottom: 90px; }
@media (min-width: 960px) {
  .barra-accion { left: 240px; bottom: 0; padding: 12px 28px; }
}

/* Pasos de entrega */
.pasos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.paso { border: 1.5px solid var(--line-2); border-radius: 12px; padding: 9px 6px; text-align: center; background: var(--surface); cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.paso small { font-weight: 500; font-size: 11.5px; }
.paso.hecho { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.paso.actual { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-ink); }
.paso:disabled { cursor: default; }

/* Grilla de detalle */
.grid-detalle { display: grid; gap: 14px; }
@media (min-width: 960px) {
  .grid-detalle { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .grid-detalle .col-lateral { position: sticky; top: 72px; }
}
.dato { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dato:first-child { border-top: 0; }
.dato span { color: var(--muted); }
.dato b { font-weight: 650; text-align: right; }

/* ---------- Hojas (modales) ---------- */
.capa { position: fixed; inset: 0; z-index: 80; background: rgba(28, 20, 32, .45); display: flex; align-items: flex-end; justify-content: center; animation: aparece .18s ease; }
@keyframes aparece { from { opacity: 0; } }
.hoja {
  width: 100%; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  animation: sube .22s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: var(--safe-b);
}
@keyframes sube { from { transform: translateY(40px); opacity: .6; } }
.hoja-cab { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.hoja-cab h3 { flex: 1; font-size: 17px; font-weight: 800; }
.hoja-cuerpo { padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.hoja-pie { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.hoja-pie .btn { flex: 1; }
.hoja .asa { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 8px auto 0; }
@media (min-width: 720px) {
  .capa { align-items: center; padding: 24px; }
  .hoja { max-width: 520px; border-radius: 20px; max-height: 88dvh; }
  .hoja.ancha { max-width: 760px; }
  .hoja .asa { display: none; }
}

.menu-mas .fila { padding: 14px 16px; }

/* Visor de captura */
.visor img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #221a26; color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: baja .2s ease; }
.toast.error { background: #8a1c12; }
.toast.ok .ico { color: #7ee2ad; }
@keyframes baja { from { transform: translateY(-12px); opacity: 0; } }

/* ---------- Carga ---------- */
.esqueleto { border-radius: var(--r); background: linear-gradient(90deg, #efe9ee 25%, #f7f3f6 50%, #efe9ee 75%); background-size: 200% 100%; animation: brillo 1.2s linear infinite; }
@keyframes brillo { to { background-position: -200% 0; } }
.cargando-vista { display: grid; gap: 10px; padding-top: 8px; }
.cargando-vista .esqueleto { height: 72px; }
.cargando-vista .esqueleto.alto { height: 150px; }

.error-vista { text-align: center; padding: 40px 16px; color: var(--muted); }
.error-vista strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; background:
  radial-gradient(1200px 500px at 50% -10%, #f5d3e2 0%, transparent 60%), var(--bg); }
.login-caja { width: 100%; max-width: 380px; }
.login-caja .logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.login-caja .logo h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.login-caja .logo p { color: var(--muted); }

/* ---------- Utilidades ---------- */
.fila-flex { display: flex; align-items: center; gap: 8px; }
.entre { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.muted { color: var(--muted); }
.rojo { color: var(--bad); } .verde { color: var(--ok); }
.peque { font-size: 13px; }
.negrita { font-weight: 750; }
.tachado { text-decoration: line-through; }
.centro { text-align: center; }
.solo-escritorio { display: none; }
@media (min-width: 960px) { .solo-escritorio { display: initial; } .solo-movil-bloque { display: none; } }
.cargar-mas { display: flex; justify-content: center; margin-top: 12px; }
.plantilla-vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.plantilla-vars code { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.vista-previa-wa { background: #e7f7dc; border-radius: 12px 12px 12px 4px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; margin-top: 10px; color: #1c2a17; }

/* Fila con enlace principal y botón lateral (p. ej. WhatsApp) */
.fila.compuesta { padding: 0 10px 0 0; }
.fila.compuesta > a.enlace-fila { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0 12px 14px; color: inherit; text-decoration: none; }
.fila.compuesta > a.enlace-fila:active { opacity: .7; }

/* Formulario de venta */
.paso-titulo { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.01em; }
.paso-titulo .n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; }
.item-venta { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 8px 12px 14px; border-top: 1px solid var(--line); }
.item-venta:first-child { border-top: 0; }
.item-venta .nombre { font-weight: 700; }
.item-venta .det { font-size: 13px; color: var(--muted); }
.item-venta .abajo { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 6px; margin-top: 4px; }
.item-venta .abajo b { font-size: 16px; }

@media (max-width: 480px) {
  .fila.compuesta .avatar { display: none; }
}
.btn-entrega { white-space: normal; line-height: 1.15; text-align: left; max-width: 112px; padding: 4px 10px; font-size: 13px; }

/* Evita desbordes horizontales en pantallas angostas */
.grid-detalle > *, .dos-col > *, .stats > * { min-width: 0; }
.segmentos button, .metodos button { min-width: 0; white-space: normal; line-height: 1.15; }
.input { min-width: 0; }
@media (max-width: 340px) {
  .contenido { padding-left: 10px; padding-right: 10px; }
  .card.pad { padding: 12px; }
  .chip-tasa { padding: 5px 8px; font-size: 12px; }
  .barra-accion .btn { padding: 0 12px; }
}
