/* MiVenta — pensado primero para el teléfono: botones grandes, una mano, sin zoom al escribir. */

:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --line: #e7e2da;
  --primary: #c2410c;
  --primary-soft: #ffedd5;
  --ok: #15803d;
  --bad: #b91c1c;
  --warn-bg: #fef3c7;
  --warn-ink: #92400e;
  --S: #2563eb;
  --X: #15803d;
  --P: #7c3aed;
  --XC: #a16207;
  --J: #dc2626;
  --efectivo: #15803d;
  --transferencia: #2563eb;
  --credito: #b45309;
  --radius: 14px;
  --tab-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100e;
    --card: #1e1b18;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --line: #35312c;
    --primary: #ea580c;
    --primary-soft: #3b2414;
    --ok: #4ade80;
    --bad: #f87171;
    --warn-bg: #3a2a0a;
    --warn-ink: #fcd34d;
    --S: #3b82f6;
    --X: #22a35a;
    --P: #8b5cf6;
    --XC: #b7791f;
    --J: #ef4444;
    --efectivo: #4ade80;
    --transferencia: #60a5fa;
    --credito: #fbbf24;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 20px);
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
input { font-size: 16px; } /* 16px evita el zoom automático en iPhone */
a { color: var(--primary); }
h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.centro { text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.seccion { margin: 20px 4px 8px; }
.seccion h2, h2.seccion { margin-bottom: 0; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: minmax(80px, auto) 1fr minmax(80px, auto); align-items: center;
  min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 4px 0;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 18px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#top-der { justify-self: end; }
main { padding: 12px 16px; max-width: 640px; margin: 0 auto; }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--primary); }
.tabbar a[hidden] { display: none; }
body[data-pantalla='ajustes'] .tabbar a[data-tab='hoy'] { color: var(--muted); }
.icono { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-vender .pill { display: grid; place-items: center; width: 48px; height: 32px; border-radius: 17px; background: var(--primary); color: #fff; }
.tab-vender .pill svg { stroke-width: 3; }
body[data-form] .tabbar { display: none; }
body[data-form] { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-weight: 650; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.block { display: flex; width: 100%; margin-bottom: 12px; }
.btn.secundario { margin: 12px 0 0; color: var(--primary); border-color: var(--primary); background: transparent; }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.confirmando { background: var(--bad); color: #fff; }
.btn:active, .cal:active, .stepper button:active, .fila:active { transform: scale(.98); }
.btn-link { background: none; border: 0; color: var(--primary); font-weight: 650; padding: 8px 12px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.btn-icon { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: inline-grid; place-items: center; font-size: 26px; color: var(--text); text-decoration: none; cursor: pointer; }
.btn-dashed { width: 100%; min-height: 52px; border: 2px dashed var(--line); border-radius: var(--radius); background: transparent; color: var(--primary); font-weight: 700; margin-bottom: 12px; cursor: pointer; }

/* ---------- Tarjetas y campos ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
input[type='text'], input[type='search'], input[type='tel'], input[type='date'], input:not([type]) {
  width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.campo { margin-top: 16px; }
.campo > label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.input-peso { position: relative; }
.input-peso > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-weight: 600; }
.input-peso input { padding-left: 28px; font-size: 20px; font-weight: 700; }
.fecha-mini { width: auto !important; min-height: 38px !important; font-size: 14px !important; padding: 0 8px !important; }
.buscador { margin-bottom: 12px; }

.stepper { display: grid; grid-template-columns: 60px 1fr 60px; gap: 8px; }
.stepper button { min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 28px; font-weight: 600; cursor: pointer; }
.stepper input { text-align: center; font-size: 24px; font-weight: 800; min-height: 54px; }
.quick { display: flex; gap: 8px; margin-top: 8px; }
.quick button { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font-weight: 650; color: var(--muted); cursor: pointer; }

/* ---------- Calibres ---------- */
.cal-S { --c: var(--S); } .cal-X { --c: var(--X); } .cal-P { --c: var(--P); } .cal-XC { --c: var(--XC); } .cal-J { --c: var(--J); }
.calibres { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cal { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 62px; padding: 4px 2px; border-radius: 12px; border: 2px solid var(--line); background: transparent; cursor: pointer; }
.cal b { font-size: 20px; color: var(--c); line-height: 1.1; }
.cal span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cal.on { background: var(--c); border-color: var(--c); }
.cal.on b, .cal.on span { color: #fff; }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: var(--c); color: #fff; font-weight: 700; font-size: 12px; line-height: 1.5; white-space: nowrap; }

.hint { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hint:empty { display: none; }
.chip-precio { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }

/* ---------- Cliente en la venta ---------- */
.sugerencias { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sug { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; cursor: pointer; }
.sug.nuevo { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.cliente-sel { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cliente-sel > div { display: flex; flex-direction: column; min-width: 0; }
.cliente-sel strong { font-size: 18px; }

/* ---------- Elegir compra al vender ---------- */
.opciones { display: flex; flex-direction: column; gap: 6px; }
.opcion { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 52px; padding: 8px 12px; text-align: left; border-radius: 12px; border: 2px solid var(--line); background: transparent; cursor: pointer; }
.opcion span { font-size: 13px; color: var(--muted); }
.opcion.on { border-color: var(--primary); background: var(--primary-soft); }
.opcion.on strong { color: var(--primary); }
.stock-linea { margin: 12px 0 0; }
.espacio-arriba { margin: 14px 0 0; }

/* ---------- Formulario de compra ---------- */
.lbl { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.k-fila { padding: 12px 0; border-top: 1px solid var(--line); }
.k-fila:not(.activa) .k-grid { opacity: .75; }
.k-fila-t { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.k-fila-t .muted { margin-left: auto; }
.k-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.k-grid .lbl { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.k-calc { margin-top: 6px; }
.k-calc:empty { display: none; }
.stepper.sm { grid-template-columns: 42px 1fr 42px; gap: 4px; }
.stepper.sm button { min-height: 48px; font-size: 22px; }
.stepper.sm input { min-height: 48px; font-size: 20px; padding: 0 4px; }
.sin-margen { margin: 0; }
.espacio { margin-top: 20px; }
.agotadas .fila { opacity: .7; }
dl.mini .negativo dd { color: var(--bad); }

/* ---------- Pago ---------- */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented button { min-height: 54px; border-radius: 12px; border: 2px solid var(--line); background: transparent; font-weight: 650; font-size: 15px; cursor: pointer; }
.segmented button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pago-efectivo { color: var(--efectivo); } .pago-transferencia { color: var(--transferencia); } .pago-credito { color: var(--credito); }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: currentColor; }

/* ---------- Números ---------- */
dl { margin: 0; }
dl.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
dl.mini div { display: flex; flex-direction: column; }
dl.mini dt { font-size: 12px; color: var(--muted); }
dl.mini dd { margin: 0; font-weight: 700; }
dl.mini .destacado dd { color: var(--ok); }
dl.totales div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; }
dl.totales dd { margin: 0; font-weight: 650; text-align: right; }
dl.totales .grande { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 20px; }
dl.totales .grande dd { font-weight: 800; }
dl.totales .ganancia dd { color: var(--ok); font-weight: 800; }
.aviso-txt { color: var(--warn-ink); font-weight: 650; }
.calc-vacio { margin: 12px 0 0; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; min-width: 0; }
.kpi-t { font-size: 12px; color: var(--muted); font-weight: 650; }
.kpi strong { font-size: 21px; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-d { font-size: 12px; color: var(--muted); }
.kpi.pos strong { color: var(--ok); } .kpi.neg strong { color: var(--bad); }

.tabla-cal > div { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.tabla-cal > div:first-child { border-top: 0; }

.aviso { display: block; background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; text-decoration: none; font-size: 14px; }

.datenav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 12px; }
.datenav-fecha { position: relative; text-align: center; font-weight: 700; font-size: 17px; }
.datenav-fecha input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

/* ---------- Listas ---------- */
.lista { display: flex; flex-direction: column; gap: 8px; }
.fila {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  text-align: left; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; cursor: pointer;
}
.fila-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fila-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.fila-monto { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.fila-flecha { color: var(--muted); font-size: 24px; }
.vacio { text-align: center; padding: 28px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.vacio p { margin: 0 0 12px; }
.contacto { display: flex; flex-direction: column; gap: 8px; }
.contacto a { text-decoration: none; font-weight: 650; }

/* ---------- Guardar venta ---------- */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}
.savebar-total { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.savebar-total span { font-size: 12px; color: var(--muted); }
.savebar-total strong { font-size: 22px; white-space: nowrap; }
.savebar .btn { flex: 1.3; min-height: 56px; font-size: 17px; }

/* ---------- Hoja inferior ---------- */
.sheet { margin: auto auto 0; padding: 0; border: 0; width: 100%; max-width: 560px; max-height: 92dvh; border-radius: 20px 20px 0 0; background: var(--card); color: var(--text); }
.sheet::backdrop { background: rgba(0, 0, 0, .45); }
.sheet[open] { animation: subir .2s ease-out; }
@keyframes subir { from { transform: translateY(40px); opacity: .5; } }
.sheet-body { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sheet-titulo { font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 4px; }
.sheet-head p { margin: 0 0 8px; }
.badge { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.det-linea { padding: 12px 0; border-top: 1px solid var(--line); }
.det-linea dl.mini { border-top: 0; padding-top: 0; margin-top: 10px; }
.det-titulo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sheet-acciones { display: flex; gap: 10px; margin-top: 20px; }
.sheet-acciones .btn { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; cursor: pointer; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Ajustes ---------- */
.dos-col label > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.aj-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; }
.aj-fila > span { display: flex; align-items: center; gap: 8px; }
.corto { max-width: 110px; text-align: right; }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dos-col.botones:has(> :nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
.dos-col.botones { margin-top: 12px; }

/* ---------- Cuentas por cobrar ---------- */
.deuda { color: var(--credito); font-weight: 700; }
.pos-txt { color: var(--ok); }
.negativo-txt { color: var(--bad); }
.error-txt { color: var(--bad); font-weight: 650; }
.saldo { display: block; font-size: 26px; margin-top: 2px; }
.cliente-sel .deuda { margin-top: 2px; }
.movs { margin: 12px 0 4px; border-top: 1px solid var(--line); }
.mov { display: grid; grid-template-columns: 48px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.mov-f { color: var(--muted); font-size: 13px; grid-row: span 2; align-self: center; }
.mov-t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mov-m { text-align: right; font-weight: 700; font-size: 14px; }
.mov-s { grid-column: 3; text-align: right; font-size: 12px; }
.kpis.una { grid-template-columns: 1fr; }
.espacio-abajo { margin-bottom: 12px; }
.segmented.dos { grid-template-columns: 1fr 1fr; }
.segmented.tres { grid-template-columns: repeat(3, 1fr); }
.segmented a { display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px; border: 2px solid var(--line); font-weight: 650; text-decoration: none; color: var(--text); }
.segmented a.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.neto-linea { margin-top: 6px; }
.neto-linea:empty { display: none; }

/* ---------- Compras: merma y precios sugeridos ---------- */
.sugeridos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.chip-dato { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.lista-simple { display: flex; flex-direction: column; }
.fila-simple { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fila-simple span:not(.tag) { flex: 1; }
.btn-icon.chico { width: 34px; height: 34px; font-size: 16px; }
.btn-icon.confirmando { background: var(--bad); color: #fff; width: auto; border-radius: 10px; padding: 0 10px; font-size: 13px; }

/* ---------- Reportes ---------- */
.card.sin-pad { padding: 0; overflow: hidden; }
.card .pad, .card h2.pad { padding: 14px 14px 0; margin-bottom: 10px; }
.card p.pad { padding: 8px 14px 14px; margin: 0; }
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabla { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.tabla th, .tabla td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tabla th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; background: var(--card); }
.tabla th.grupo { text-align: center; border-bottom: 0; }
.tabla .txt { text-align: left; }
.tabla td:first-child, .tabla th:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
.tabla tbody tr[data-act] { cursor: pointer; }
.tabla tbody tr[data-act]:active td { background: var(--primary-soft); }
.tabla tfoot td, .tabla .total-fila td { font-weight: 800; background: var(--bg); }
.tabla tfoot td:first-child, .tabla .total-fila td:first-child { background: var(--bg); }
.tabla .titulo-fila td { font-weight: 700; color: var(--primary); background: var(--primary-soft); text-align: left; }
.tabla td.txt { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.marca { display: inline-block; font-size: 10px; font-weight: 800; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; }
dl.totales .sub dt, dl.totales .sub dd { font-size: 14px; color: var(--muted); }
details.avisos { margin: 10px 0; font-size: 13px; }
details.avisos summary { cursor: pointer; color: var(--warn-ink); font-weight: 650; }
details.avisos ul { padding-left: 18px; margin: 8px 0 0; color: var(--muted); max-height: 220px; overflow: auto; }
.chips a.chip { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.chips a.chip.on { color: #fff; }

/* Interruptor */
.switch { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex-shrink: 0; cursor: pointer; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- Clientes repetidos ---------- */
.rep-principal { display: flex; flex-direction: column; margin-bottom: 8px; }
.rep-otro { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 4px 8px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.rep-otro input { width: 22px; height: 22px; accent-color: var(--primary); }
.rep-otro .etiqueta { grid-column: 2 / -1; justify-self: start; }
.etiqueta { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }

/* ---------- Conteo de caja ---------- */
.conteo { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 14px 0; }
.den { display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; gap: 10px; }
.den > span:first-child { font-weight: 700; text-align: right; }
.den input { text-align: center; min-height: 44px !important; }
.den .muted { text-align: right; }
.arqueo { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); text-align: left; cursor: pointer; }
.arqueo > span { display: flex; flex-direction: column; }
.arqueo.ok strong { color: var(--ok); }
.arqueo.sobra strong { color: var(--transferencia); }
.arqueo.falta strong { color: var(--bad); }

/* ---------- Otros productos ---------- */
.tag.tag-prod { --c: #57534e; background: #57534e; }
.fila.inactivo { opacity: .6; }
.btn-dashed.centrado { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.chips.sin-margen { margin-top: 0; }

/* ---------- Cuentas y sincronización ---------- */
.topbar h1 { display: flex; align-items: center; justify-content: center; gap: 8px; }
.topbar h1 #titulo { overflow: hidden; text-overflow: ellipsis; }
.estado-sync { width: 22px; height: 22px; flex-shrink: 0; border: 0; background: transparent; padding: 6px; cursor: pointer; position: relative; }
.estado-sync::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--line); }
.estado-sync.ok::after { background: var(--ok); }
.estado-sync.pendiente::after, .estado-sync.subiendo::after { background: #d97706; }
.estado-sync.subiendo::after { animation: latido 1s infinite; }
.estado-sync.sin-red::after { background: var(--muted); }
.estado-sync.error::after { background: var(--bad); }
@keyframes latido { 50% { opacity: .3; } }
body[data-acceso] .tabbar, body[data-acceso] .estado-sync { display: none; }
body[data-acceso] { padding-bottom: 24px; }
.acceso { max-width: 420px; margin: 16px auto; }
.acceso-logo { display: block; margin: 8px auto 4px; border-radius: 18px; }
.acceso-titulo { text-transform: none; letter-spacing: 0; font-size: 22px; color: var(--text); text-align: center; margin: 8px 0; }
input[type='email'], input[type='password'] { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.clave-temporal { font: 700 26px/1.2 ui-monospace, Consolas, monospace; text-align: center; letter-spacing: .05em; padding: 16px; border-radius: 12px; background: var(--bg); user-select: all; }
.miembro > span { flex: 1; }
body[data-rol='member'] .solo-jefe { display: none !important; }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: #1c1917; color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.toast.error { background: var(--bad); }
body[data-form] .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
