/* ==========================================================================
   Cuadri — estilos
   Mobile-first: barra inferior en celular, menú lateral en escritorio (≥ 900px).
   --p (color principal) se ajusta por negocio desde JS.
   ========================================================================== */

:root {
  --p: #2563eb;
  --p-oscuro: #1d4ed8;
  --p-suave: rgba(37, 99, 235, .10);
  --p-texto: #ffffff;
  --fondo: #f3f5f9;
  --tarjeta: #ffffff;
  --texto: #0f172a;
  --texto2: #64748b;
  --texto3: #94a3b8;
  --borde: #e2e8f0;
  --borde2: #cbd5e1;
  --verde: #16a34a;
  --verde-suave: #dcfce7;
  --rojo: #dc2626;
  --rojo-suave: #fee2e2;
  --ambar: #d97706;
  --ambar-suave: #fef3c7;
  --azul-suave: #dbeafe;
  --radio: 14px;
  --radio-chico: 9px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
  --sombra-modal: 0 20px 60px rgba(15, 23, 42, .25);
  --lateral: 250px;
  --inferior: 62px;
  --barra: 56px;
  --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
a { color: var(--p); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.ic.chico { width: 16px; height: 16px; }
svg.ic.grande { width: 26px; height: 26px; }
[hidden] { display: none !important; }
.oculto { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.verde { color: var(--verde); }
.rojo { color: var(--rojo); }
.ambar { color: var(--ambar); }
.azul { color: var(--p); }
.gris { color: var(--texto2); }
.chico { font-size: .85rem; }
.mini { font-size: .78rem; }
.negrita { font-weight: 700; }
.centro { text-align: center; }
.derecha { text-align: right; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.mt-chico { margin-top: 8px; }
.sep { height: 1px; background: var(--borde); margin: 14px 0; }

/* -------------------------------------------------------------- carga */
.cargando-pantalla { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--borde); border-top-color: var(--p); border-radius: 50%; animation: girar .8s linear infinite; }
.cargando { display: flex; justify-content: center; padding: 60px 0; }
.cargando::after { content: ""; width: 30px; height: 30px; border: 3px solid var(--borde); border-top-color: var(--p); border-radius: 50%; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--p-suave), var(--fondo) 60%); }
.login-caja { width: 100%; max-width: 380px; background: var(--tarjeta); border-radius: 20px; padding: 32px 28px; box-shadow: var(--sombra-modal); }
.login-logo { width: 72px; height: 72px; border-radius: 20px; background: #fff; box-shadow: 0 2px 10px rgba(16,24,40,.10); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; font-size: 1.6rem; font-weight: 800; }
.login-logo svg, .login-logo img { width: 56px; height: 56px; }
.login h1 { text-align: center; font-size: 1.35rem; }
.login .sub { text-align: center; color: var(--texto2); margin-bottom: 22px; }

/* -------------------------------------------------------------- estructura */
#shell { min-height: 100vh; }
.barra {
  position: sticky; top: 0; z-index: 30; height: var(--barra);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--tarjeta); border-bottom: 1px solid var(--borde);
}
.barra-marca { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.barra-marca img, .marca-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: var(--p); color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.barra-marca b { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-marca small { display: block; color: var(--texto2); font-size: .72rem; line-height: 1.1; }
.btn-icono { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--texto2); }
.btn-icono:hover { background: var(--fondo); color: var(--texto); }

main#contenido { padding: 16px 14px calc(var(--inferior) + 90px); max-width: 1120px; margin: 0 auto; }

.inferior {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(var(--inferior) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--tarjeta); border-top: 1px solid var(--borde);
}
.inferior a, .inferior button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: .68rem; color: var(--texto2); border: 0; background: none; padding: 6px 2px;
}
.inferior a.activo { color: var(--p); font-weight: 600; }
.inferior svg.ic { width: 22px; height: 22px; }

.lateral { display: none; }

@media (min-width: 900px) {
  .barra, .inferior { display: none; }
  .lateral {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--lateral);
    background: var(--tarjeta); border-right: 1px solid var(--borde); padding: 18px 12px; overflow-y: auto;
  }
  .lateral-marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid var(--borde); margin-bottom: 10px; }
  .lateral-marca img, .lateral-marca .marca-logo { width: 42px; height: 42px; border-radius: 12px; }
  .lateral-marca b { display: block; line-height: 1.15; }
  .lateral-marca small { color: var(--texto2); font-size: .74rem; }
  .lateral-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .lateral-nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--texto2); font-weight: 500;
  }
  .lateral-nav a:hover { background: var(--fondo); color: var(--texto); }
  .lateral-nav a.activo { background: var(--p-suave); color: var(--p); font-weight: 600; }
  .lateral-nav .grupo { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texto3); padding: 14px 12px 4px; }
  .lateral-pie { border-top: 1px solid var(--borde); padding-top: 12px; margin-top: 10px; }
  .lateral-pie .usuario { display: flex; align-items: center; gap: 10px; padding: 6px 8px; color: var(--texto2); font-size: .85rem; }
  .lateral-pie .usuario b { color: var(--texto); display: block; }
  main#contenido { margin-left: var(--lateral); max-width: none; padding: 28px 32px 60px; }
  .contenido-int { max-width: 1120px; margin: 0 auto; }
}

/* -------------------------------------------------------------- cabecera de página */
.cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cab h1 { font-size: 1.4rem; }
.cab .sub { color: var(--texto2); font-size: .88rem; margin: 0; }
.cab-acciones { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------- botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--borde2); background: var(--tarjeta);
  font-weight: 600; font-size: .92rem; line-height: 1.2; color: var(--texto); white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--fondo); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-p { background: var(--p); border-color: var(--p); color: var(--p-texto); }
.btn-p:hover { background: var(--p-oscuro); }
.btn-verde { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-verde:hover { background: #15803d; }
.btn-rojo { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.btn-rojo:hover { background: #b91c1c; }
.btn-suave { background: var(--p-suave); border-color: transparent; color: var(--p); }
.btn-suave:hover { background: var(--p-suave); filter: brightness(.96); }
.btn-fantasma { background: transparent; border-color: transparent; color: var(--texto2); }
.btn-fantasma:hover { background: var(--fondo); color: var(--texto); }
.btn-chico { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-chico svg.ic { width: 15px; height: 15px; }
.btn-bloque { width: 100%; }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn-wa:hover { background: #1fb457; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--inferior) + 18px + env(safe-area-inset-bottom)); z-index: 25;
  width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--p); color: var(--p-texto);
  display: grid; place-items: center; box-shadow: 0 10px 24px rgba(15, 23, 42, .25);
}
.fab svg.ic { width: 28px; height: 28px; stroke-width: 2.4; }
@media (min-width: 900px) { .fab { display: none; } }

/* -------------------------------------------------------------- tarjetas */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); }
.tarjeta + .tarjeta { margin-top: 14px; }
.tarjeta-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tarjeta-cab h2, .tarjeta-cab h3 { font-size: 1rem; }
.tarjeta.sin-pad { padding: 0; overflow: hidden; }
.tarjeta.sin-pad .tarjeta-cab { padding: 14px 16px 0; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 899px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid-2.uno-movil { grid-template-columns: 1fr; } }
.grid-principal { display: grid; gap: 14px; }
.grid > *, .grid-principal > * { min-width: 0; }
@media (min-width: 900px) { .grid-principal { grid-template-columns: 1.6fr 1fr; align-items: start; } }

.kpi { padding: 14px 16px; }
.kpi .kpi-t { font-size: .78rem; color: var(--texto2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.kpi .kpi-v { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .kpi-s { font-size: .8rem; color: var(--texto2); margin-top: 2px; }
.kpi .kpi-s .delta { font-weight: 700; }
@media (max-width: 480px) { .kpi .kpi-v { font-size: 1.25rem; } }
.kpi.acento { border-left: 4px solid var(--p); }
.kpi.verde-borde { border-left: 4px solid var(--verde); }
.kpi.rojo-borde { border-left: 4px solid var(--rojo); }
.kpi.ambar-borde { border-left: 4px solid var(--ambar); }

/* -------------------------------------------------------------- listas */
.lista { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--borde);
  cursor: pointer; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; color: inherit;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--fondo); }
.item.sin-click { cursor: default; }
.item.sin-click:hover { background: none; }
.item-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--p-suave); color: var(--p); font-weight: 700; }
.item-ico.verde { background: var(--verde-suave); color: var(--verde); }
.item-ico.rojo { background: var(--rojo-suave); color: var(--rojo); }
.item-ico.ambar { background: var(--ambar-suave); color: var(--ambar); }
.item-ico.gris { background: var(--fondo); color: var(--texto2); }
.item-txt { flex: 1; min-width: 0; }
.item-txt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-txt small { display: block; color: var(--texto2); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-der { text-align: right; flex-shrink: 0; }
.item-der b { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.item-der small { display: block; color: var(--texto2); font-size: .76rem; }
.item.anulada .item-txt, .item.anulada .item-der { opacity: .5; text-decoration: line-through; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.badge-verde { background: var(--verde-suave); color: #15803d; }
.badge-rojo { background: var(--rojo-suave); color: #b91c1c; }
.badge-ambar { background: var(--ambar-suave); color: #b45309; }
.badge-azul { background: var(--azul-suave); color: #1d4ed8; }
.badge-gris { background: var(--fondo); color: var(--texto2); }
.badge-p { background: var(--p-suave); color: var(--p); }
.badge-punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.vacio { text-align: center; padding: 34px 16px; color: var(--texto2); }
.vacio .vacio-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--fondo); display: grid; place-items: center; margin: 0 auto 12px; color: var(--texto3); }
.vacio b { display: block; color: var(--texto); margin-bottom: 4px; }

/* -------------------------------------------------------------- filtros / chips */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filtros .buscar { flex: 1; min-width: 160px; }
.buscar { position: relative; }
.buscar input[type] { padding-left: 38px; }
.buscar svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--texto3); width: 18px; height: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--borde2); background: var(--tarjeta);
  font-size: .84rem; font-weight: 500; color: var(--texto2); white-space: nowrap;
}
.chip:hover { border-color: var(--p); color: var(--p); }
.chip.activo { background: var(--p); border-color: var(--p); color: var(--p-texto); font-weight: 600; }
.chip.chico { padding: 5px 10px; font-size: .78rem; }
.resumen-barra { display: flex; gap: 6px 18px; flex-wrap: wrap; padding: 10px 14px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio-chico); margin-bottom: 14px; font-size: .86rem; color: var(--texto2); }
.resumen-barra b { color: var(--texto); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- formularios */
.campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.campo > label, .etiqueta { font-size: .8rem; font-weight: 600; color: var(--texto2); }
.campo .ayuda { font-size: .76rem; color: var(--texto3); }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], input[type="email"], input[type="tel"], input[type="search"], input[type="color"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--borde2); border-radius: 10px; background: var(--tarjeta); outline: 0; min-height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-suave); }
input[type="color"] { padding: 4px; width: 60px; }
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.fila { display: flex; gap: 10px; align-items: flex-end; }
.fila > * { flex: 1; min-width: 0; }
.fila > .fijo { flex: 0 0 auto; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--p); margin: 0; }
.interruptor { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor .pista { width: 42px; height: 24px; border-radius: 999px; background: var(--borde2); position: relative; transition: background .15s; flex-shrink: 0; }
.interruptor .pista::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.interruptor input:checked + .pista { background: var(--p); }
.interruptor input:checked + .pista::after { left: 21px; }
.dinero { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.dinero-grande { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.total-caja { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; background: var(--p-suave); border-radius: 10px; margin: 6px 0 12px; }
.total-caja span { color: var(--texto2); font-weight: 600; }
.total-caja b { font-size: 1.4rem; color: var(--p); font-variant-numeric: tabular-nums; }
.error-form { background: var(--rojo-suave); color: #991b1b; padding: 10px 12px; border-radius: 8px; font-size: .86rem; margin-bottom: 12px; }
.pestanas { display: flex; gap: 4px; background: var(--fondo); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.pestanas button { flex: 1; padding: 8px; border: 0; border-radius: 8px; background: none; font-weight: 600; color: var(--texto2); font-size: .88rem; }
.pestanas button.activo { background: var(--tarjeta); color: var(--texto); box-shadow: var(--sombra); }

/* selector de productos en nueva venta */
.prod-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.prod-btn { text-align: left; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 10px; background: var(--tarjeta); display: flex; flex-direction: column; gap: 2px; min-height: 58px; }
.prod-btn:hover { border-color: var(--p); background: var(--p-suave); }
.prod-btn b { font-size: .86rem; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-btn small { color: var(--texto2); font-size: .78rem; }
.prod-btn .cant { position: absolute; }
.prod-btn.en-carro { border-color: var(--p); background: var(--p-suave); }
.prod-btn { position: relative; }
.prod-btn .marca { position: absolute; top: 6px; right: 8px; background: var(--p); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; }
.linea { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.linea:last-child { border-bottom: 0; }
.linea .linea-nombre { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linea .linea-nombre small { display: block; color: var(--texto2); font-weight: 400; font-size: .76rem; }
.linea input.cant { width: 52px; text-align: center; padding: 6px 4px; min-height: 36px; }
.linea input.precio { width: 92px; padding: 6px 8px; min-height: 36px; }
.linea .linea-total { width: 80px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--borde2); border-radius: 8px; overflow: hidden; }
.stepper button { width: 32px; height: 36px; border: 0; background: var(--fondo); font-size: 1.1rem; font-weight: 700; color: var(--texto2); }
.stepper button:hover { color: var(--p); }
.stepper input { width: 46px; border: 0; text-align: center; min-height: 36px; padding: 0; border-radius: 0; }

/* -------------------------------------------------------------- tablas */
.tabla-scroll { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th, .tabla td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto2); font-weight: 700; }
.tabla td.num, .tabla th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tfoot td { font-weight: 700; background: var(--fondo); }
.tabla tbody tr:hover td { background: var(--fondo); }

/* -------------------------------------------------------------- modal */
.modal-fondo { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; animation: aparecer .15s; }
.modal { background: var(--tarjeta); width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: var(--sombra-modal); animation: subir .2s; }
.modal-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; }
.modal-cab h2 { font-size: 1.1rem; }
.modal-cuerpo { padding: 4px 18px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-pie { display: flex; gap: 10px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--borde); }
.modal-pie .btn { flex: 1; }
@media (min-width: 640px) {
  .modal-fondo { align-items: center; padding: 20px; }
  .modal { border-radius: 18px; max-width: 520px; max-height: 90vh; }
  .modal.ancho { max-width: 760px; }
  .modal-pie .btn { flex: 0 0 auto; min-width: 120px; }
  .modal-pie { justify-content: flex-end; }
}
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(30px); opacity: 0; } }

/* -------------------------------------------------------------- toasts */
#toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: .9rem; font-weight: 500; box-shadow: var(--sombra-modal); animation: subir .2s; display: flex; gap: 8px; align-items: center; }
.toast.ok { background: #14532d; }
.toast.error { background: #7f1d1d; }

/* -------------------------------------------------------------- gráficos */
.grafico { width: 100%; overflow: hidden; }
.grafico svg { width: 100%; height: auto; display: block; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--texto2); margin-top: 8px; }
.leyenda span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--p)); margin-right: 6px; vertical-align: middle; }
.barra-prog { height: 8px; border-radius: 999px; background: var(--fondo); overflow: hidden; }
.barra-prog i { display: block; height: 100%; background: var(--c, var(--p)); border-radius: 999px; }
.dona-envoltura { display: flex; gap: 16px; align-items: center; }
.dona-envoltura svg { width: 130px; height: 130px; flex-shrink: 0; }
.dona-lista { flex: 1; min-width: 0; font-size: .84rem; }
.dona-lista div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.dona-lista div span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dona-lista b { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- órdenes */
.orden-tarjeta { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--borde); border-radius: 12px; background: var(--tarjeta); cursor: pointer; text-align: left; width: 100%; color: inherit; margin-bottom: 8px; }
.orden-tarjeta:hover { border-color: var(--p); }
.orden-num { font-family: var(--mono); font-size: .78rem; color: var(--texto2); }
.estado-pasos { display: flex; gap: 6px; flex-wrap: wrap; }

/* -------------------------------------------------------------- negocios (superadmin) */
.negocio-tarjeta { display: flex; align-items: center; gap: 14px; }
.negocio-tarjeta .ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; }
.plantilla-btn { text-align: left; padding: 12px; border: 2px solid var(--borde); border-radius: 12px; background: var(--tarjeta); display: flex; gap: 10px; align-items: flex-start; }
.plantilla-btn.activo { border-color: var(--p); background: var(--p-suave); }
.plantilla-btn .pi { font-size: 1.4rem; }
.plantilla-btn b { display: block; font-size: .9rem; }
.plantilla-btn small { color: var(--texto2); font-size: .76rem; line-height: 1.3; }

.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--ambar-suave); color: #78350f; font-size: .86rem; margin-bottom: 14px; }
.aviso.azul { background: var(--azul-suave); color: #1e3a8a; }
/* El enlace toma el color del recuadro: el rosado del negocio sobre el celeste no se lee bien. */
.aviso a { color: inherit; text-decoration: underline; font-weight: 600; }
.aviso svg { flex-shrink: 0; margin-top: 1px; }
/* Línea de "pagado hasta" en la tarjeta de cada negocio (panel del superadmin). */
.cobro-linea svg.ic { vertical-align: -3px; margin-right: 2px; }

/* -------------------------------------------------------------- impresión */
@media print {
  .barra, .inferior, .lateral, .fab, .filtros, .cab-acciones, .modal-pie { display: none !important; }
  main#contenido { margin: 0; padding: 0; }
  .tarjeta { box-shadow: none; }
}

/* ---- Lectura de boleta con IA (gastos) ---- */
.ia-boleta { margin-bottom: 14px; padding: 12px; border: 1px dashed var(--p); border-radius: 12px; background: var(--p-suave); }
.ia-boleta .btn { cursor: pointer; }
.ia-boleta .btn.deshabilitado { opacity: .6; pointer-events: none; }
.girando { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; border: 2px solid var(--borde2); border-top-color: var(--p); border-radius: 50%; animation: girar .8s linear infinite; }
.btn-enlace { border: 0; background: none; color: var(--p); font-weight: 600; padding: 4px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.linea-b { padding: 8px 0; border-bottom: 1px solid var(--borde); }
[data-lineas-panel] { margin-top: 12px; }
.linea-b-cab { display: flex; align-items: center; gap: 6px; }
.linea-b-cab input.linea-desc { flex: 1; min-width: 0; padding: 6px 8px; min-height: 36px; }
.linea-b-cab .btn-icono { width: 34px; height: 34px; flex: 0 0 auto; }
.linea-b-nums { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .9rem; }
.linea-b-nums input.cant { width: 56px; text-align: center; padding: 6px 4px; min-height: 36px; }
.linea-b-nums input.precio { width: 100px; padding: 6px 8px; min-height: 36px; }
.linea-b-nums .linea-total { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---- Recibos imprimibles (58 mm / 80 mm / carta) ---- */
.vista-recibo { background: #e2e8f0; border-radius: 10px; padding: 10px; overflow: auto; max-height: 42vh; }
.vista-recibo > div { width: 100%; }

.recibo {
  box-sizing: border-box; background: #fff; color: #000; padding: 4mm;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.35;
  font-variant-numeric: tabular-nums; box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.recibo-58 { width: 58mm; font-size: 8.5pt; }
.recibo-80 { width: 80mm; font-size: 9.5pt; }
.recibo-carta { width: 216mm; padding: 12mm; font-size: 11pt; }
/* Color de la tienda para los acentos del documento; en impresora blanco y negro sale gris. */
.recibo-carta { --imp: var(--p, #1f2937); }

.recibo .r-cab { text-align: center; }
.recibo .r-logo img { max-width: 26mm; max-height: 16mm; margin-bottom: 2mm; }
.recibo .r-negocio { font-weight: 700; font-size: 1.25em; line-height: 1.2; }
.recibo .r-sub { font-size: .88em; }
.recibo .r-centro { text-align: center; }
.recibo .r-titulo { font-weight: 700; text-align: center; margin-top: 1mm; letter-spacing: .02em; }
.recibo .r-hr { border-top: 1px dashed #000; margin: 2mm 0; }
.recibo .r-hr-fino { border-top: 1px dotted #666; margin: 1.5mm 0; }

.recibo .r-items { width: 100%; border-collapse: collapse; }
.recibo .r-items td { padding: .8mm 0; vertical-align: top; }
.recibo .r-it-nom { padding-right: 3mm !important; }
.recibo .r-it-det { display: block; font-size: .85em; color: #333; }
.recibo .r-it-tot { text-align: right; white-space: nowrap; font-weight: 600; }

.recibo .r-fila { display: flex; justify-content: space-between; gap: 4mm; padding: .5mm 0; }
.recibo .r-fila > b { white-space: nowrap; text-align: right; min-width: 0; }
.recibo .r-fila > b.r-libre { white-space: normal; overflow-wrap: anywhere; }
.recibo .r-total { font-size: 1.2em; font-weight: 700; border-top: 1px solid #000; margin-top: 1mm; padding-top: 1.5mm; }
.recibo .r-destaca { font-weight: 700; border: 1px solid #000; padding: 1.2mm 2mm; margin-top: 1.5mm; }
.recibo .r-bloque { margin: 2mm 0; }
.recibo .r-bloque b { display: block; font-size: .88em; }
.recibo .r-nota { margin-top: 2mm; font-size: .88em; }
.recibo .r-firma { margin: 8mm 0 2mm; text-align: center; }
.recibo .r-firma span { display: block; border-top: 1px solid #000; width: 60%; margin: 0 auto 1mm; }
.recibo .r-firma small { font-size: .82em; }
.recibo .r-gracias { text-align: center; font-weight: 600; }
.recibo .r-legal { text-align: center; font-size: .78em; margin-top: 1.5mm; }

#impresion { display: none; }
@media print {
  body > *:not(#impresion) { display: none !important; }
  #impresion { display: block !important; }
  html, body { background: #fff !important; margin: 0; padding: 0; }
  #impresion .recibo { width: 100% !important; padding: 0 !important; box-shadow: none !important; }
  #impresion .r-corte { page-break-before: always; }
}

/* ---- Fotos del equipo (órdenes de trabajo) ---- */
.fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.foto { position: relative; width: 78px; height: 78px; border-radius: 10px; overflow: hidden; border: 1px solid var(--borde); background: var(--fondo); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.foto-x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(15, 23, 42, .68); color: #fff; display: grid; place-items: center; cursor: pointer; }
.foto-x:hover { background: var(--rojo); }
.foto-cargando::after { content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border: 3px solid var(--borde); border-top-color: var(--p); border-radius: 50%; animation: girar .8s linear infinite; }
.btn.deshabilitado { opacity: .6; pointer-events: none; }

.visor { position: fixed; inset: 0; z-index: 120; background: rgba(2, 6, 23, .92); display: flex; align-items: center; justify-content: center; animation: aparecer .15s; }
.visor img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 6px; }
.visor-x { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; display: grid; place-items: center; cursor: pointer; }
.visor-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; display: grid; place-items: center; cursor: pointer; }
.visor-nav.izq { left: 10px; }
.visor-nav.der { right: 10px; }
.visor-x:hover, .visor-nav:hover { background: rgba(255, 255, 255, .3); }
.visor-pie { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #fff; font-size: .85rem; }

/* ---- Orden de servicio en hoja carta (la copia que se le entrega al cliente) ---- */
.recibo-carta .h-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10mm; padding-bottom: 4mm; border-bottom: 2.5pt solid var(--imp); }
.recibo-carta .h-marca { display: flex; align-items: center; gap: 5mm; min-width: 0; }
.recibo-carta .h-logo { max-width: 28mm; max-height: 22mm; object-fit: contain; }
.recibo-carta .h-nombre { font-size: 1.7em; font-weight: 800; line-height: 1.1; color: var(--imp); letter-spacing: -.01em; }
.recibo-carta .h-contacto { font-size: .82em; line-height: 1.45; margin-top: 1.5mm; }
.recibo-carta .h-folio { text-align: right; flex: 0 0 auto; }
.recibo-carta .h-folio-t { font-size: .72em; letter-spacing: .13em; font-weight: 700; }
.recibo-carta .h-folio-n { font-size: 1.6em; font-weight: 800; color: var(--imp); line-height: 1.1; }
.recibo-carta .h-folio-f { font-size: .82em; }

.recibo-carta .h-cols { display: flex; gap: 5mm; }
.recibo-carta .h-cols > * { flex: 1; min-width: 0; }
.recibo-carta .h-bloque { margin-top: 3mm; break-inside: avoid; }
.recibo-carta .h-bloque-t { font-size: .68em; font-weight: 700; letter-spacing: .1em; color: var(--imp); border-bottom: .75pt solid #9ca3af; padding-bottom: 1mm; margin-bottom: 1.5mm; }
.recibo-carta .h-bloque-c { font-size: .92em; line-height: 1.45; }
.recibo-carta .h-grande { font-size: 1.15em; font-weight: 700; }
.recibo-carta .h-dato { display: flex; gap: 2mm; font-size: .92em; }
.recibo-carta .h-dato > span { color: #4b5563; }

.recibo-carta .h-fotos { display: flex; gap: 3mm; }
.recibo-carta .h-fotos img { width: 32mm; height: 24mm; object-fit: cover; border: .75pt solid #9ca3af; border-radius: 1.5mm; }

.recibo-carta .h-totales { margin: 4mm 0 0 auto; width: 78mm; break-inside: avoid; }
.recibo-carta .h-totales .r-total { border-top: 1.5pt solid var(--imp); color: var(--imp); }
.recibo-carta .h-condiciones { margin-top: 4mm; padding: 2.5mm 3mm; border: .75pt solid #9ca3af; border-radius: 1.5mm; font-size: .62em; line-height: 1.35; text-align: justify; break-inside: avoid; }
.recibo-carta .h-condiciones p { margin: 0 0 1.2mm; }
.recibo-carta .h-condiciones p:last-child { margin-bottom: 0; }
/* Un texto largo de condiciones en una sola columna empuja las firmas a otra hoja:
   a dos columnas, como en un contrato, cabe todo en la misma página. */
.recibo-carta .h-dos-col { column-count: 2; column-gap: 6mm; column-rule: .5pt solid #d1d5db; }
.recibo-carta .h-dos-col p { break-inside: avoid; }
.recibo-carta .h-firmas { display: flex; gap: 14mm; margin: 8mm 0 3mm; text-align: center; font-size: .8em; break-inside: avoid; }
.recibo-carta .h-firmas > div { flex: 1; }
.recibo-carta .h-firmas span { display: block; border-top: .75pt solid #000; margin-bottom: 1.5mm; }

/* Botones de cámara/galería (se separan porque Android no ofrece la cámara si el campo acepta varias) */
.chips.centrado { justify-content: center; }
[data-foto-btn].deshabilitado { opacity: .6; pointer-events: none; }
.ia-boleta .chips .btn { cursor: pointer; }

/* ---------------------------------------------------------------- pedidos web */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rojo); color: #fff; font-size: .7rem; font-weight: 800; font-style: normal; margin-left: auto; }
.inferior a { position: relative; }
.inferior .nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; }
.pedidos-sec { font-size: 1rem; margin: 14px 0 8px; display: flex; align-items: center; gap: 8px; }
.pedidos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pedido { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; padding: 12px 14px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 8px; }
.pedido-nuevo { border-color: var(--rojo); box-shadow: 0 0 0 3px var(--rojo-suave); animation: pedido-pulso 1.6s ease-in-out 3; }
.pedido-listo { border-color: var(--verde); }
@keyframes pedido-pulso { 50% { box-shadow: 0 0 0 8px var(--rojo-suave); } }
.pedido-cab { display: flex; align-items: center; gap: 10px; }
.pedido-num { font-size: 1.3rem; font-weight: 800; color: var(--p); letter-spacing: -.02em; }
.pedido-quien { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pedido-quien b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pedido-quien small { color: var(--texto2); font-size: .8rem; }
.pedido-items { font-size: 1.05rem; line-height: 1.5; }
.pedido-items b { color: var(--p); }
.pedido-dato { font-size: .88rem; color: var(--texto2); }
.pedido-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--borde); padding-top: 8px; }
.pedido-pie > div:first-child { font-size: 1.05rem; }
.pedido-pie small { color: var(--texto2); font-weight: 500; }
.pedido-pie .chips { justify-content: flex-end; }
code.clave { display: inline-block; flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; background: var(--fondo); border: 1px solid var(--borde); font-size: .82rem; word-break: break-all; cursor: pointer; }
code.clave:hover { border-color: var(--p); }
/* ticket de cocina */
.recibo .r-titulo-grande { font-size: 1.5em; }
.recibo .r-aviso { text-align: center; font-weight: 800; font-size: 1.15em; border: 2px dashed #000; padding: 2px; margin: 2px 0; }
.recibo .r-fila.r-grande { font-size: 1.15em; }
.recibo .r-items-grande td { font-size: 1.15em; padding: 1.5mm 0; }

/* ---------------------------------------------------------------- patrón de desbloqueo */
.patron-caja { display: inline-block; padding: 6px; border-radius: 14px; background: var(--fondo); border: 1px solid var(--borde); }
.patron { display: block; user-select: none; }
.patron circle { fill: var(--tarjeta); stroke: var(--borde2, #cbd5e1); stroke-width: 2; }
.patron circle.on { fill: var(--p); stroke: var(--p); }
.patron line { stroke: var(--p); stroke-width: 6; stroke-linecap: round; opacity: .8; }
.patron text { fill: #fff; font-weight: 700; pointer-events: none; }
.desb-clave { font-family: ui-monospace, Consolas, monospace; font-size: 1.2rem; letter-spacing: .12em; background: var(--fondo); padding: 4px 10px; border-radius: 8px; display: inline-block; }
@media print { .patron, .desb-clave { display: none !important; } }

.pedido-futuro { border-style: dashed; }
.pedido-futuro .pedido-quien small { color: var(--p); font-weight: 600; }

/* ---------------------------------------------------------------- QR de reseñas en los comprobantes */
.recibo .r-resena { display: flex; align-items: center; justify-content: center; gap: 3mm; margin: 2mm 0; text-align: center; }
.recibo .r-resena-txt { font-size: .9em; line-height: 1.25; }
.recibo .r-resena-qr svg { display: block; }
.recibo-58 .r-resena { flex-direction: column; gap: 1mm; }
.recibo-carta .r-resena { justify-content: flex-start; text-align: left; margin: 4mm 0 2mm; }


/* ---- Aviso de sin conexión ---- */
/* Gris a propósito, no rojo: quedarse sin señal no es una falla del sistema ni culpa de
   nadie, y pintarlo de rojo asusta al dueño cada vez que pasa por un lugar con mala señal. */
.barra-red {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: #f1f5f9; color: #334155; font-size: .85rem;
  border-bottom: 1px solid var(--borde);
}
.barra-red .ic { flex: 0 0 auto; vertical-align: -2px; }
.barra-red b { font-weight: 700; }
@media (min-width: 900px) { .barra-red { margin-left: var(--lateral); } }
@media (max-width: 640px) { .barra-red { padding: 7px 12px; font-size: .78rem; } }

/* ---- Demo para clientes ---- */
.login-demo { margin-top: 18px; }
.login-o { display: flex; align-items: center; gap: 10px; color: var(--texto2); font-size: .8rem; margin-bottom: 12px; }
.login-o::before, .login-o::after { content: ""; flex: 1; border-top: 1px solid var(--borde); }

.barra-demo {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--ambar-suave); color: #78350f; font-size: .85rem;
  border-bottom: 1px solid rgba(120, 53, 15, .18);
}
.barra-demo b { font-weight: 700; }
.barra-demo .ic { vertical-align: -2px; }
.barra-demo-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.barra-demo .btn { background: #fff; border-color: rgba(120, 53, 15, .25); color: #78350f; }
.barra-demo .btn-wa { background: #25d366; border-color: #25d366; color: #fff; }
/* Último día: el mismo aviso en rojo, porque recién acá se puede perder algo propio. */
.barra-demo-fin { background: var(--rojo-suave); color: #991b1b; border-bottom-color: rgba(153, 27, 27, .22); }
.barra-demo-fin .btn:not(.btn-wa) { border-color: rgba(153, 27, 27, .28); color: #991b1b; }
@media (min-width: 900px) { .barra-demo { margin-left: var(--lateral); } }
@media (max-width: 640px) { .barra-demo { padding: 7px 12px; font-size: .78rem; } }

/* -------------------------------------------------------------- producción */
/* Se usa al lado del horno, con el celular en una mano: botones grandes y separados. */
.prod-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.prod-tarjeta { display: flex; flex-direction: column; gap: 8px; }
.prod-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prod-cab b { font-size: 1.05rem; }
.prod-botones { display: flex; flex-wrap: wrap; gap: 8px; }
.prod-botones .btn { flex: 1 1 64px; }
.prod-mas { font-size: 1.15rem; font-weight: 800; padding: 14px 10px; }
.prod-merma { align-self: flex-start; color: var(--texto2); background: none; border: 0; padding: 2px 0; text-decoration: underline; }

/* ------------------------------------------------------------- cotizaciones */
/* Líneas del formulario: en el celular se apilan, en el PC van en una fila. */
.coti-linea { display: grid; grid-template-columns: 1fr 70px 110px auto auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.coti-linea-txt { display: grid; gap: 4px; min-width: 0; }
.coti-linea input { width: 100%; }
.coti-detalle { font-size: .85rem; }
.coti-cant, .coti-precio { text-align: right; }
.coti-total { font-weight: 700; white-space: nowrap; text-align: right; }
@media (max-width: 640px) {
  .coti-linea { grid-template-columns: 1fr auto; grid-template-areas: "txt quitar" "cant precio" "total total"; }
  .coti-linea-txt { grid-area: txt; }
  .coti-cant { grid-area: cant; }
  .coti-precio { grid-area: precio; }
  .coti-total { grid-area: total; }
}
.coti-tot { margin-top: 10px; padding: 12px 14px; }
.coti-tot-fila { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.coti-tot-final { border-top: 2px solid var(--p); margin-top: 6px; padding-top: 8px; font-size: 1.15rem; color: var(--p); }

/* Detalle de la cotización en la hoja carta */
.recibo-carta .h-detalle { width: 100%; border-collapse: collapse; margin-top: 4mm; font-size: .9em; }
.recibo-carta .h-detalle th { background: var(--imp); color: #fff; font-size: .72em; letter-spacing: .08em; text-align: left; padding: 1.5mm 2mm; }
.recibo-carta .h-detalle th.num, .recibo-carta .h-detalle td.num { text-align: right; white-space: nowrap; }
.recibo-carta .h-detalle td { padding: 1.8mm 2mm; border-bottom: .5pt solid #d1d5db; line-height: 1.35; vertical-align: top; }
.recibo-carta .h-det-n { width: 7mm; color: #6b7280; }
.recibo-carta .h-det-sub { font-size: .85em; color: #4b5563; margin-top: .6mm; }
.recibo-carta .h-notas { margin-top: 3mm; font-size: .9em; line-height: 1.4; }
.recibo-carta .h-legal { text-align: center; font-size: .75em; margin-top: 3mm; color: #333; }
/* Detalle de la cotización en el modal: se apila bien en el celular. */
.coti-det-fila { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.coti-det-n { color: var(--texto3); font-size: .85rem; min-width: 14px; }
.coti-det-txt { flex: 1; min-width: 0; }
.coti-det-total { font-weight: 700; white-space: nowrap; }
/* Enlaces legales al pie de la pantalla de ingreso (Ley 21.719: deben estar publicados y a la vista). */
.login-legal { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--borde); }
.login-legal a { color: var(--texto2); text-decoration: underline; }

/* --------------------------------------------------- verificación en dos pasos */
.pasos-tfa { margin: 0 0 14px 18px; font-size: .93rem; color: var(--texto2); }
.pasos-tfa li { margin-bottom: 12px; }
.pasos-tfa b { color: var(--texto); }
.qr-tfa { display: grid; place-items: center; margin: 12px 0 8px; }
.qr-tfa img { border: 1px solid var(--borde); border-radius: 10px; padding: 8px; background: #fff; }
.secreto-tfa { text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.02rem; letter-spacing: .08em; background: var(--fondo); border: 1px solid var(--borde); border-radius: 8px; padding: 8px; margin: 6px 0 0; word-break: break-all; }
.respaldo-tfa { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.respaldo-tfa span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; text-align: center; background: var(--fondo); border: 1px solid var(--borde); border-radius: 8px; padding: 9px 4px; letter-spacing: .04em; }
.aviso-tfa { background: #fffbeb; border-left: 3px solid var(--ambar, #d97706); border-radius: 0 8px 8px 0; padding: 9px 12px; font-size: .9rem; color: var(--texto2); }
.fuerza { margin: -4px 0 14px; display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.fuerza-barra { flex: 1; height: 6px; background: var(--borde); border-radius: 99px; overflow: hidden; }
.fuerza-barra i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .2s, background .2s; }
