:root {
  --navy: #14254a;
  --navy-2: #1d3466;
  --navy-soft: #e8edf7;
  --bg: #f4f6fa;
  --card: #ffffff;
  --surface-2: #fafbfd;
  --hover: #f8f9fc;
  --fav-bg: #fffbea;
  --pedido-bg: #e3edf7;
  --pedido: #2f5d8a;
  --sombra: rgba(15, 23, 42, .18);
  --ink: #18202e;
  --muted: #667085;
  --line: #dde2ec;
  --ok: #1a7f4b;
  --ok-bg: #e6f4ec;
  --warn: #9a6200;
  --warn-bg: #fff4dc;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- barra superior */
header { display: flex; align-items: center; gap: 18px; background: var(--navy); color: #fff; padding: 0 18px; height: 54px; position: sticky; top: 0; z-index: 5; }
header .marca { font-weight: 700; letter-spacing: .06em; font-size: 15px; white-space: nowrap; }
header nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
header nav button { background: none; border: 0; color: #c9d4ec; padding: 8px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
header nav button:hover { background: var(--navy-2); color: #fff; }
header nav button.activo { background: #fff; color: var(--navy); font-weight: 600; }
.chips { display: flex; gap: 6px; align-items: center; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--navy-2); color: #dfe7f7; white-space: nowrap; cursor: default; }
.chip.ok { background: #1e6b46; color: #fff; }
.chip.warn { background: #b07500; color: #fff; cursor: pointer; }
.chip.bad { background: #a8291f; color: #fff; }

main { padding: 18px; max-width: 1500px; margin: 0 auto; }
.vista { display: none; }
.vista.activa { display: block; }

/* ---------- genéricos */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 14px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fila { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.fila > * { min-width: 0; }
.crece { flex: 1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8fa6d8; outline-offset: -1px; border-color: #8fa6d8; }
input[type=number] { text-align: right; }
input.grande { font-size: 18px; padding: 12px 14px; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--navy-soft); }
.btn.primario { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primario:hover { background: var(--navy-2); }
.btn.peligro { color: var(--bad); }
.btn.chico { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); }
.oculto { display: none !important; }
body:not(.es-admin) [data-admin] { display: none !important; }
.menu-usuario { position: fixed; top: 50px; right: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); z-index: 30; min-width: 220px; overflow: hidden; }
.menu-usuario div { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.menu-usuario button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: var(--card); cursor: pointer; }
.menu-usuario button:hover { background: var(--navy-soft); }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.neutro { background: var(--navy-soft); color: var(--navy); }
.aviso { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); margin: 10px 0; }
.aviso.bad { background: var(--bad-bg); color: var(--bad); }
.aviso.ok { background: var(--ok-bg); color: var(--ok); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); position: sticky; top: 0; z-index: 2; }
tbody tr:hover { background: var(--hover); }
.tabla-scroll { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.tabla-scroll table th { border-top: 0; }
td .btn + .btn { margin-left: 4px; }

/* ---------- vender */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.resultados { margin-top: 10px; max-height: calc(100vh - 170px); overflow: auto; }
.prod-item { display: grid; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.prod-item:hover, .prod-item.sel { background: var(--navy-soft); }
.prod-item .nombre { font-weight: 600; }
.prod-item .det { font-size: 12px; color: var(--muted); }
.prod-item .precio { font-weight: 700; font-variant-numeric: tabular-nums; }
.carrito { position: sticky; top: 72px; }
.atajos-desc { display: flex; gap: 4px; margin-top: 5px; }
.atajos-desc button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 5px 0; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.atajos-desc button:hover { background: var(--navy-soft); }
.atajos-desc button.activo { background: var(--navy); color: #fff; border-color: var(--navy); }
.atajos-desc button[data-suma="0"], .atajos-desc button[data-pct="0"] { flex: 0 0 30px; color: var(--muted); }
.sel-emisor { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 10px; background: var(--navy-soft); border-radius: 8px; flex-wrap: wrap; }
.sel-emisor .muted { font-size: 12px; font-weight: 600; }
.sel-emisor .segmento button small { display: block; font-size: 10px; font-weight: 500; opacity: .75; }
.mono-cuit { margin-bottom: 14px; }
.mono-cuit .cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.inicio-titulo { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 2px 8px; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.tarjeta { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 9px; cursor: pointer; background: var(--card);
  display: flex; flex-direction: column; gap: 6px; min-height: 104px; transition: border-color .1s, background .1s; }
.tarjeta:hover { border-color: #8fa6d8; background: var(--navy-soft); }
.tarjeta.fav { border-color: #e7c35a; background: var(--fav-bg); }
.tarjeta .nombre { font-weight: 600; font-size: 13px; line-height: 1.25; padding-right: 22px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tarjeta .pie { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tarjeta .precio { font-weight: 800; font-variant-numeric: tabular-nums; }
.estrella { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: #c3c9d6; padding: 2px; }
.estrella.on { color: #e0a800; }
.estrella:hover { color: #e0a800; }
.tarjeta .estrella { position: absolute; top: 6px; right: 6px; }
.prod-item { grid-template-columns: auto 1fr auto auto; }
.ver-mas { display: block; margin: 12px auto 4px; }
.carrito .items { max-height: 34vh; overflow: auto; margin: 0 -16px; }
.cart-row { display: grid; grid-template-columns: 1fr 64px 92px 28px; gap: 6px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.cart-row .desc { font-size: 14px; font-weight: 600; line-height: 1.2; }
.cart-row .sub { font-size: 12px; color: var(--muted); }
.cart-row input { padding: 5px 6px; }
.cart-row .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; }
.cart-row .x:hover { color: var(--bad); }
.total-grande { display: flex; justify-content: space-between; align-items: baseline; font-size: 30px; font-weight: 800; color: var(--navy); margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.total-grande small { font-size: 14px; color: var(--muted); font-weight: 600; }
.vacio { padding: 26px; text-align: center; color: var(--muted); }
.medios { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.medio { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.segmento { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmento button { border: 0; background: var(--card); padding: 7px 12px; cursor: pointer; font-weight: 600; }
.segmento button.activo { background: var(--navy); color: #fff; }
details summary { cursor: pointer; font-size: 13px; color: var(--navy); font-weight: 600; margin: 8px 0; }
.acciones-venta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.acciones-venta .btn { padding: 12px; font-size: 16px; }
.atajo { font-size: 11px; opacity: .7; font-weight: 500; margin-left: 4px; }

/* ---------- modal */
.modal-fondo { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 20; overflow: auto; }
.modal { background: var(--card); border-radius: 12px; width: min(720px, 100%); padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.angosto { width: min(460px, 100%); }
.modal-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-cab h2 { margin: 0; }
.cerrar { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.ticket-prev { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.ticket-papel { background: #fffdf7; border: 1px dashed #c9c2ad; padding: 14px 12px; font-family: var(--mono); font-size: 12px; line-height: 1.35; white-space: pre; overflow-x: auto; max-width: 100%; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.qr-box img, .qr-box canvas { width: 150px; height: 150px; }
.resultado-venta { text-align: center; margin-bottom: 14px; }
.resultado-venta .vuelto { font-size: 26px; font-weight: 800; color: var(--ok); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; }
.form-grid .ancho { grid-column: 1 / -1; }

/* ---------- reportes */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .t { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.destacado { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpi.destacado .t, .kpi.destacado .s { color: #c9d4ec; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.barra { height: 10px; background: var(--navy-soft); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.barra > div { height: 100%; background: var(--navy); border-radius: 99px; }
.barra.warn > div { background: #d18b00; }
.barra.bad > div { background: var(--bad); }
.mini-barras { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-top: 10px; }
.mini-barras div { flex: 1; background: var(--navy); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.mini-barras div:hover { background: #3b5ba5; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 40; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

@media (max-width: 1000px) {
  .pos { grid-template-columns: 1fr; }
  .carrito { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
}
/* El modo oscuro se elige a mano (botón ☾ arriba) y se recuerda en cada navegador. */

/* ---------- dashboard */
.grafico { position: relative; }
.svg-grafico { width: 100%; height: auto; display: block; overflow: visible; }
.svg-grafico .guia { stroke: var(--line); stroke-width: 1; }
.svg-grafico .eje { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.svg-grafico .linea { fill: none; stroke: var(--navy); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.svg-grafico .area { fill: var(--navy); opacity: .08; }
.svg-grafico .cruz { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.svg-grafico .punto { fill: var(--navy); stroke: var(--card); stroke-width: 2; }
.svg-grafico .barra { fill: var(--navy); opacity: .85; transition: opacity .1s; }
.svg-grafico .barra.activa { opacity: 1; fill: #2d4a8a; }
.svg-grafico .hit { cursor: default; }
.dash-tip { position: fixed; z-index: 50; display: none; pointer-events: none; background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.5; box-shadow: 0 8px 24px rgba(15,23,42,.15); font-variant-numeric: tabular-nums; }
.barra-celda { position: relative; height: 22px; display: flex; align-items: center; }
.barra-celda > div { position: absolute; left: 0; top: 3px; bottom: 3px; background: var(--navy-soft); border-radius: 0 4px 4px 0; }
.barra-celda > span { position: relative; padding-left: 6px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }

.scroll-x { overflow-x: auto; }
.scroll-x table { min-width: 460px; }
.grid-ancha { grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); }
@media (max-width: 1000px) { .grid-ancha { grid-template-columns: 1fr; } }
.kpi .v { font-size: clamp(17px, 1.55vw, 22px); white-space: nowrap; }
.kpi { min-width: 0; overflow: hidden; }
#rot-pedido { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* las tarjetas dentro de grillas no pueden ensancharse más que su columna */
.grid-2 > .card, .grid-2 > div { min-width: 0; }
.tabla-usuarios { min-width: 0 !important; }
.tabla-usuarios td:last-child { white-space: normal; text-align: right; }
.tabla-usuarios td:last-child .btn { margin: 2px 0 2px 4px; }
.tabla-usuarios select { max-width: 150px; }

/* Pedidos */
.chip.pedido { background: #2f5d8a; color: #fff; cursor: pointer; }
.pill.pedido { background: var(--pedido-bg); color: var(--pedido); }
table.entradas tr[data-v] { cursor: pointer; }
table.entradas tr[data-v]:hover td { background: var(--hover, rgba(0,0,0,.03)); }
table.entradas tr.activa td { background: var(--warn-bg); font-weight: 600; }
.acciones-venta { grid-template-columns: 1fr 2fr; }
.acciones-venta #btn-retirar { grid-column: 1 / -1; font-size: 15px; padding: 10px; }
.grid-2 > .card { margin-top: 0; }
a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
@keyframes falta { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: 0 0 0 3px var(--bad); } }
.medios.falta { animation: falta 0.9s ease 2; border-radius: 8px; }
.total-grande .unidades { display: block; font-size: 15px; font-weight: 700; color: var(--navy); letter-spacing: 0; text-transform: none; margin-top: 2px; }
.total-monto { display: flex; flex-direction: column; align-items: flex-end; }
.total-desc { font-size: 15px; font-weight: 700; color: var(--ok); }
.total-desc:empty { display: none; }

/* Panel de venta compacto: en pantallas de escritorio entra siempre entero (los botones de cobrar quedan a la vista);
   si hay muchos productos, solo la lista del carrito hace scroll. */
@media (min-width: 1001px) {
  .carrito { display: flex; flex-direction: column; max-height: calc(100vh - 84px); padding: 12px 14px; }
  .carrito > * { flex-shrink: 0; }
  .carrito .items { flex: 1 1 auto; min-height: 70px; max-height: none; margin: 0 -14px; }
  .carrito .sel-emisor { margin-top: 8px; padding: 5px 8px; gap: 8px; }
  .carrito .sel-emisor .segmento button { padding: 4px 10px; }
  .carrito #carrito { margin-top: 8px !important; }
  .carrito input, .carrito select { padding: 6px 8px; }
  .carrito label { font-size: 12px; }
  .carrito .atajos-desc { margin-top: 4px; }
  .carrito .atajos-desc button { padding: 4px 0; }
  .carrito .total-grande { font-size: 26px; margin: 8px 0 4px; }
  .carrito .total-grande .unidades { font-size: 13px; }
  .carrito h3 { margin: 6px 0 4px !important; }
  .carrito .medios { gap: 5px; }
  .carrito #pago-estado { margin-top: 4px !important; font-size: 12px !important; }
  .carrito .acciones-venta { margin-top: 8px; gap: 6px; }
  .carrito .acciones-venta .btn { padding: 9px; }
  .carrito .acciones-venta #btn-retirar { padding: 7px; font-size: 14px; }
}
@media (min-width: 1001px) {
  .carrito > .fila:first-child { flex-wrap: nowrap; gap: 6px; }
  .carrito > .fila:first-child .segmento button { padding: 6px 10px; }
  .carrito #canal { flex: 1 1 auto; max-width: 150px; }
}
/* Pantallas bajas (notebook): un poco más compacto todavía */
@media (min-width: 1001px) and (max-height: 760px) {
  .carrito .total-grande { font-size: 22px; margin: 4px 0 2px; }
  .carrito .medio input { padding: 4px 8px; }
  .carrito .acciones-venta .btn { padding: 7px; font-size: 15px; }
  .carrito .acciones-venta #btn-retirar { padding: 5px; font-size: 13px; }
  .carrito .items { min-height: 56px; }
}
@media (min-width: 1001px) and (max-height: 760px) {
  .carrito .sel-emisor .segmento button small { display: none; }   /* el CUIT se ve al pasar el mouse */
  .carrito .sel-emisor { margin-top: 6px; padding: 4px 8px; }
  .carrito .items { min-height: 48px; }
}
@media (min-width: 1001px) and (max-height: 650px) {
  .carrito h3 { display: none; }
  .carrito .atajos-desc button { padding: 2px 0; }
}
@media (min-width: 1001px) {
  .carrito .sel-emisor { flex-wrap: nowrap; }
  .carrito .sel-emisor .muted { white-space: nowrap; }
  .carrito .sel-emisor .segmento { flex: 1; min-width: 0; display: flex; }
  .carrito .sel-emisor .segmento button { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.oblig { color: var(--bad); font-weight: 700; }
.opc { color: var(--muted); font-weight: 400; font-size: 11px; }
input.campo-falta { border-color: var(--bad); outline: 2px solid var(--bad-bg); }

/* ---------- modo oscuro */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #4f7bd9;          /* fondo de botones principales y texto destacado */
  --navy-2: #22324f;
  --navy-soft: #1c2a44;
  --bg: #0e1420;
  --card: #161e2d;
  --surface-2: #1b2435;
  --hover: #1d2738;
  --ink: #e4e9f2;
  --muted: #95a1b6;
  --line: #2b364a;
  --ok: #4cc38a;
  --ok-bg: #12301f;
  --warn: #f0b44c;
  --warn-bg: #33270d;
  --bad: #f2776b;
  --bad-bg: #3a1714;
  --fav-bg: #2c2610;
  --pedido-bg: #1b2d44;
  --pedido: #8fb6e6;
  --sombra: rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] header { background: #0a1018; border-bottom: 1px solid var(--line); }
:root[data-theme="dark"] header nav button { color: #a9b6cc; }
:root[data-theme="dark"] header nav button.activo { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .chip { background: #1f2b41; }
:root[data-theme="dark"] .tarjeta:hover { border-color: var(--navy); }
:root[data-theme="dark"] .modal-fondo { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .toast { background: #2a3550; }
:root[data-theme="dark"] .kpi.destacado { background: #1f3a75; border-color: #1f3a75; }
:root[data-theme="dark"] .svg-grafico .area { opacity: .18; }
:root[data-theme="dark"] a { color: #8fb3f0; }
:root[data-theme="dark"] input:focus, :root[data-theme="dark"] select:focus { outline-color: var(--navy); border-color: var(--navy); }
:root[data-theme="dark"] .ticket-papel { color: #18202e; }   /* el ticket se sigue viendo como papel */
.btn-tema { border: 0; cursor: pointer; font-size: 15px; line-height: 1; padding: 4px 9px; }

/* ---------- celular */
.ir-carrito { display: none; }
@media (max-width: 700px) {
  html, body { overflow-x: hidden; }
  header { flex-wrap: wrap; height: auto; padding: 8px 10px 0; gap: 6px 8px; }
  header .marca { font-size: 13px; }
  header .chips { margin-left: auto; overflow-x: auto; flex-wrap: nowrap; max-width: calc(100% - 140px); scrollbar-width: none; }
  header .chips::-webkit-scrollbar { display: none; }
  header #chip-arca { display: none; }
  header nav { order: 3; flex: 1 1 100%; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  header nav::-webkit-scrollbar { display: none; }
  header nav button { padding: 7px 11px; font-size: 14px; }
  .menu-usuario { top: 92px; }
  main { padding: 10px; }
  .card { padding: 12px; }
  .solo-pc { display: none; }
  input, select, textarea { font-size: 16px; }   /* evita que el iPhone haga zoom al tocar un campo */

  /* formularios y filtros: cada campo ocupa el ancho */
  .fila > label, .fila > input, .fila > select { flex: 1 1 100%; width: auto !important; max-width: 100%; }
  .fila > label input:not([type=checkbox]):not([type=radio]), .fila > label select { width: 100% !important; }
  .fila > label:has(> input[type=checkbox]) { flex: 0 1 auto; }
  body:not([data-vista="vender"]) .ir-carrito { display: none; }
  .fila > .segmento { max-width: 100%; }
  .segmento { max-width: 100%; overflow-x: auto; }
  .segmento button { white-space: nowrap; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid input:not([type=checkbox]):not([type=radio]), .form-grid select { width: 100%; }
  .pos, .grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .grid-2 > *, .pos > * { min-width: 0; }
  table.entradas td:nth-child(2) { display: none; }   /* cantidad de ventas: no entra en el celular */
  table.entradas td:nth-child(3) { width: auto !important; }
  table.entradas { font-size: 13px; }
  table.entradas td { padding: 6px 4px; }
  .card:has(> #r-medios), .card:has(> #r-fiscales) { overflow: hidden; }
  .modal-fondo { padding: 10px 8px; }
  .modal { padding: 14px; }

  /* vender */
  .tarjetas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tarjeta { min-height: 78px; padding: 8px; }
  .tarjeta .nombre { font-size: 13px; }
  .tarjeta .precio { font-size: 14px; }
  .carrito .items { max-height: none; }
  .ir-carrito { display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 15; align-items: center; gap: 8px;
    border: 0; border-radius: 12px; padding: 13px 16px; background: var(--navy); color: #fff; font-size: 15px; box-shadow: 0 8px 24px var(--sombra); }
  .ir-carrito span { margin-left: auto; font-weight: 700; }
  .ir-carrito.oculto, .ir-carrito.tapado { display: none; }
  #v-vender { padding-bottom: 70px; }
  .total-grande { font-size: 26px; }

  /* tablas: en el celular se ocultan las columnas menos importantes */
  #v-comprobantes th:nth-child(3), #v-comprobantes td:nth-child(3),
  #v-comprobantes th:nth-child(7), #v-comprobantes td:nth-child(7) { display: none; }
  #v-productos th:nth-child(3), #v-productos td:nth-child(3), #v-productos th:nth-child(4), #v-productos td:nth-child(4),
  #v-productos th:nth-child(6), #v-productos td:nth-child(6), #v-productos th:nth-child(8), #v-productos td:nth-child(8),
  #v-productos th:nth-child(9), #v-productos td:nth-child(9),
  #v-productos th:nth-child(10), #v-productos td:nth-child(10) { display: none; }   /* tocar la fila abre el editor */
  td, th { padding-left: 6px; padding-right: 6px; }
  td .btn.chico { margin: 2px 0; }
  .tabla-scroll { max-height: none; }
  .kpi .v { font-size: 18px; }
}

table.ordenable thead th { cursor: pointer; user-select: none; }
table.ordenable thead th:hover { color: var(--ink); }
table.ordenable th.orden-desc::after { content: " ▼"; font-size: 9px; }
table.ordenable th.orden-asc::after { content: " ▲"; font-size: 9px; }

.medio-deuda a { color: var(--bad) !important; }
.medio-deuda input { border-style: dashed; }
/* quitar un producto del carrito: en rojo para que se vea */
.carrito .items button.x { color: var(--bad); font-weight: 700; }
.carrito .items button.x:hover { background: var(--bad-bg); color: var(--bad); }

/* Cobro con Clover en la confirmación de venta */
.clover-opcion { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; font-size: 14px; flex-direction: row; }
.clover-opcion .muted { font-size: 12px; }
#m-clover { margin-top: 6px; }
