/* Hoja A4 de la orden de producción (1 px = 1 pt). Usa las fuentes OpenSansFx de factura.css. */
.op { position: relative; background: #fff; color: #1a1a1a; overflow: hidden; font-family: 'OpenSansFx', 'Open Sans', Arial, sans-serif;
  -webkit-font-smoothing: antialiased; box-sizing: border-box; padding: 26px 28px 0; display: flex; flex-direction: column; }
.op * { box-sizing: border-box; }
.op-cab { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 2.5px solid #231f20; }
.op-logo { width: 64px; height: 64px; flex: none; margin: -6px 0; }
.op-tit { flex: 1; display: flex; flex-direction: column; }
.op-tit b { font-size: 21px; letter-spacing: .06em; line-height: 1.15; }
.op-tit span { font-size: 9.5px; color: #6d6660; letter-spacing: .04em; margin-top: 2px; }
.op-num { text-align: right; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.op-num span { font-size: 9px; font-weight: 700; letter-spacing: .12em; color: #6d6660; }
.op-num b { font-size: 26px; letter-spacing: .02em; }
.op-num small { font-size: 9px; font-weight: 700; color: #00716d; margin-top: 2px; }
.op-anulada { margin-top: 10px; background: #c0392b; color: #fff; text-align: center; font-weight: 700; font-size: 13px; letter-spacing: .1em; padding: 6px; border-radius: 4px; }

.hoja > .op { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.op-datos { display: grid; grid-template-columns: 1.7fr 1fr 1.15fr 1.1fr; gap: 8px; margin-top: 14px; }
.op-caja { border: 1px solid #d6cfc6; border-radius: 6px; padding: 7px 10px 8px; display: flex; flex-direction: column; min-width: 0; }
.op-caja small { font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6d6660; }
.op-caja b { font-size: 13.5px; line-height: 1.25; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-caja span { font-size: 10px; color: #4a4542; }
.op-cli b { white-space: normal; }
.op-ent { background: #fff3dc; border-color: #f8b033; }
.op-ent b { font-size: 15.5px; overflow: visible; }
.op-ven { font-size: 12px !important; }

.op-cuerpo { display: grid; grid-template-columns: 240px 1fr; gap: 18px; margin-top: 16px; height: 430px; }
.op-foto { border: 1px solid #e6e1da; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; height: 240px; background: #faf8f5; }
.op-foto img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.op-foto span { font-size: 11px; color: #9a928a; }
.op-desc { font-size: 13px; line-height: 1.35; overflow: hidden; height: 430px; min-width: 0; }
.op-prod { font-size: 1.45em; font-weight: 700; line-height: 1.2; margin-bottom: .55em; }
.op-desc dl { margin: 0; }
.op-f { display: grid; grid-template-columns: 7.2em 1fr; gap: .6em; padding: .42em 0; border-bottom: 1px solid #eee9e2; }
.op-f dt { font-size: .74em; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6d6660; padding-top: .2em; }
.op-f dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.op-piezas { margin-top: .8em; }
.op-piezas b { font-size: .74em; letter-spacing: .1em; text-transform: uppercase; color: #6d6660; }
.op-piezas ul { margin: .3em 0 0; padding-left: 1.2em; }
.op-piezas li { padding: .12em 0; overflow-wrap: anywhere; }

.op-etapas { margin-top: auto; }
.op-et-tit { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6d6660; margin-bottom: 6px; }
.op-et-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid #231f20; border-radius: 6px; overflow: hidden; }
.op-et { padding: 7px 8px 6px; display: flex; flex-direction: column; gap: 9px; }
.op-et + .op-et { border-left: 1px solid #231f20; }
.op-et b { font-size: 11px; letter-spacing: .04em; }
.op-et span { font-size: 7.5px; color: #6d6660; border-top: 1px solid #bdb5ab; padding-top: 2px; margin-top: 13px; }
.op-pie { font-size: 8.5px; color: #6d6660; text-align: center; padding: 10px 0 14px; }

/* ===== Producción: tabla tipo Excel de Julián con 3 estados ===== */
:root {
  --est: #c8372d; --est-soft: #fdeceb; --est-ink: #9e2a22;     /* Estructura: rojo */
  --tej: #e2a400; --tej-soft: #fff5d6; --tej-ink: #7a5600;     /* Tejiendo: amarillo */
  --tap: #2c6e9b; --tap-soft: #e3eef7; --tap-ink: #1f5276;     /* Tapicería: azul */
  --lis: #1e8e4e; --lis-soft: #e4f4ea; --lis-ink: #156b3a;     /* Listo para entrega: verde */
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chip.ok { background: var(--lis-soft); color: var(--lis-ink); }
.op-chk { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.op-chk input { width: 18px; height: 18px; accent-color: var(--brand); }
.det-ordenes { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.det-ordenes .btn { justify-content: flex-start; white-space: normal; text-align: left; line-height: 1.3; padding: 8px 14px; }

/* Filtros por etapa */
.op-etapas-f { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 22px; }
.op-fb { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px 0 10px; border-radius: 99px; border: 1px solid var(--line2); background: var(--card);
  font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink); transition: background .15s, border-color .15s, color .15s; }
.op-fb i { width: 10px; height: 10px; border-radius: 50%; background: #b9b0a6; flex: none; }
.op-fb b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.op-fb:hover { border-color: #c7bfb5; }
.fb-estructura i { background: var(--est); }
.fb-tejido i { background: var(--tej); }
.fb-tapiceria i { background: var(--tap); }
.fb-listo i { background: var(--lis); }
.fb-todas i { background: conic-gradient(var(--est) 0 25%, var(--tej) 0 50%, var(--tap) 0 75%, var(--lis) 0); }
.op-fb[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.op-fb[aria-pressed="true"] b { color: #d8d0c7; }

/* Grupos */
.op-grupo + .op-grupo { margin-top: 26px; }
.op-grupo h2 { font-size: 15px; margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }

/* Tabla (PC) */
.op-tabla-w { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.op-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; }
.op-tabla th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--muted); padding: 10px; background: #faf8f5; border-bottom: 1px solid var(--line); }
.op-tabla td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.op-tabla tr:last-child td { border-bottom: 0; }
.op-fila { cursor: pointer; }
.op-fila td { transition: background .15s; }
@media (hover: hover) { .op-fila:hover td { background: #fcfbf9; } }
.op-tabla .op-c-foto { width: 76px; }
.op-tabla th:nth-child(2) { width: 66px; }
.op-tabla th:nth-child(3) { width: 17%; }
.op-tabla th:nth-child(5) { width: 132px; }
.op-tabla th:nth-child(6) { width: 92px; }
.op-tabla th.op-c-est { width: 86px; text-align: center; padding-left: 4px; padding-right: 4px; }
.op-tabla th.op-c-est span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.op-tabla th.op-c-est span { font-size: 12.5px; }
.op-tabla th.op-c-est span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.op-tabla th.th-estructura { color: var(--est-ink); }
.op-tabla th.th-tejido { color: var(--tej-ink); }
.op-tabla th.th-tapiceria { color: var(--tap-ink); }
.op-tabla th.th-listo { color: var(--lis-ink); }
.op-tabla td.op-c-est { text-align: center; padding: 6px 4px; }
.op-c-fecha { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.op-c-cli b, .op-c-desc b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-c-cli small { color: var(--muted); font-size: 12px; }
.op-c-desc a { text-decoration: none; color: inherit; display: block; }
.op-c-desc a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.op-c-desc small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.op-n { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.op-c-ent { white-space: nowrap; }
.op-c-ent b { display: block; font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.op-c-ven { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-fila.et-listo td:first-child { box-shadow: inset 3px 0 0 var(--lis); }
.op-fila.anulada td { opacity: .5; }
.op-mini { width: 56px; height: 56px; border-radius: 10px; background: #f3efe9; overflow: hidden; display: grid; place-items: center; color: #b3aaa0; flex: none; }
.op-mini img { width: 100%; height: 100%; object-fit: cover; }
.op-mini svg { width: 24px; height: 24px; }

/* Botón de estado: pendiente = casilla punteada; marcado = relleno con su color */
.est { --c: #b9b0a6; --s: #fff; --k: var(--muted); display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 6px;
  border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: var(--k); transition: background .15s; -webkit-tap-highlight-color: transparent; }
.est-estructura { --c: var(--est); --s: var(--est-soft); --k: var(--est-ink); }
.est-tejido { --c: var(--tej); --s: var(--tej-soft); --k: var(--tej-ink); }
.est-tapiceria { --c: var(--tap); --s: var(--tap-soft); --k: var(--tap-ink); }
.est-listo { --c: var(--lis); --s: var(--lis-soft); --k: var(--lis-ink); }
.est-caja { width: 30px; height: 30px; border-radius: 9px; border: 2px dashed color-mix(in srgb, var(--c) 55%, #d6cfc6); background: #fff; display: grid; place-items: center; flex: none;
  color: transparent; transition: background .18s cubic-bezier(.2,.8,.2,1), border-color .18s, transform .18s cubic-bezier(.2,.8,.2,1); }
.est-caja svg { width: 18px; height: 18px; transform: scale(.6); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.est-cel { font-size: 11px; font-weight: 700; color: #8f877f; display: none; }
@media (hover: hover) {
  .est:hover { background: var(--s); }
  .est:hover .est-caja { border-style: solid; border-color: var(--c); }
  .est.g:hover { background: var(--s); }
}
.est:active .est-caja { transform: scale(.92); }
.est.si .est-caja { background: var(--c); border: 2px solid var(--c); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--c) 35%, transparent); }
.est.si .est-caja svg { transform: scale(1); }
.est-tejido.si .est-caja { color: #3d2b00; }
.est.si .est-cel { color: var(--k); }
.est:disabled { cursor: not-allowed; opacity: .5; }
.est:focus-visible { outline: 3px solid color-mix(in srgb, var(--c) 45%, transparent); outline-offset: 1px; }

/* Botón grande (detalle de la orden) */
.op-det-est { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.est.g { flex-direction: row; justify-content: flex-start; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: #fff; text-align: left; color: var(--ink); }
.est.g.si { background: var(--s); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.est-txt { display: flex; flex-direction: column; line-height: 1.3; }
.est-txt b { font-size: 14.5px; }
.est-txt small { font-size: 12.5px; color: var(--muted); }
.est.g.si .est-txt small { color: var(--k); }

/* Carga */
.op-esq { display: flex; flex-direction: column; gap: 10px; }
.op-esq span { height: 76px; border-radius: var(--r); background: linear-gradient(90deg, #ece7e0 0, #f6f3ef 40%, #ece7e0 80%) 0 0 / 200% 100%; animation: op-brillo 1.2s linear infinite; }
@keyframes op-brillo { to { background-position: -200% 0; } }

/* Tarjetas (celular y tableta) */
.op-cards { display: none; }
.op-card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.op-card + .op-card { margin-top: 10px; }
.op-card-cab { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 12px 10px; text-decoration: none; color: inherit; }
.op-card .op-mini { width: 64px; height: 64px; }
.op-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.op-txt b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-txt small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-ent-l { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.op-ent-l b { font-size: 12.5px; color: var(--ink); }
.op-card-est { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.op-card-est .est { border-radius: 0; flex-direction: column; justify-content: center; gap: 4px; min-height: 60px; padding: 8px 2px; min-width: 0; }
.op-card-est .est + .est { border-left: 1px solid var(--line); }
.op-card-est .est-caja { width: 26px; height: 26px; border-radius: 8px; }
.op-card-est .est-cel { display: block; font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-card-est .est.si { background: var(--s); }
.op-card.et-listo { box-shadow: var(--sh), inset 0 3px 0 var(--lis); }
.op-card.anulada { opacity: .55; }

@media (max-width: 1279px) {
  .op-tabla-w { display: none; }
  .op-cards { display: block; }
}
@media (min-width: 700px) and (max-width: 1279px) {
  .op-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .op-card + .op-card { margin-top: 0; }
}
@media (max-width: 400px) {
  .op-card-est .est { flex-direction: column; gap: 3px; }
  .op-card-est .est-cel { font-size: 11.5px; }
  .op-fb { padding: 0 10px 0 9px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .op-esq span { animation: none; } .est-caja, .est-caja svg { transition: none; } }

/* ===== Proveedores ===== */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: #ebe6df; border-radius: 12px; margin: 0 0 18px; }
.seg a { min-height: 38px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; transition: background .15s, color .15s; }
.seg a[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(35,31,32,.12); }
@media (hover: hover) { .seg a:not([aria-selected="true"]):hover { color: var(--ink); } }
.btn-ok { background: var(--lis); border-color: var(--lis); color: #fff; }
@media (hover: hover) { .btn-ok:hover { background: var(--lis-ink); border-color: var(--lis-ink); } }
.prov-barra { margin-bottom: 14px; }
.prov .ava { color: var(--brand-ink); background: var(--brand-soft); }
.prov .ava svg { width: 22px; height: 22px; }

/* Resumen: la casilla que suma */
.pd-resumen { margin-bottom: 18px; }
.pd-res-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pd-res-cab h2 { font-size: 17px; }
.pd-res-f { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-res-f select { min-height: 38px; border: 1px solid var(--line2); border-radius: 10px; background: #fff; padding: 0 10px; font-weight: 700; font-size: 13.5px; max-width: 100%; }
.pd-tabla td, .pd-tabla th { padding: 9px 10px; }
.pd-tabla tbody tr:last-child td { border-bottom: 1px solid var(--line2); }
.pd-tabla tfoot td { font-weight: 700; padding: 10px; border-bottom: 0; font-variant-numeric: tabular-nums; }
.pd-tabla td.der { font-variant-numeric: tabular-nums; }
.pd-falta { color: var(--tej-ink); }
.pd-vacio { margin: 4px 0 2px; }

/* Tarjetas de pedido */
.pd-estados { margin-bottom: 14px; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.pd-grid > .vacio { grid-column: 1 / -1; }
.pd-card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border: 1px solid transparent; }
.pd-card.tarde { border-color: #eab8b2; }
.pd-card.recibido { background: #fbfdfb; }
.pd-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pd-cab > div { display: flex; flex-direction: column; min-width: 0; }
.pd-cab b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-lineas { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pd-lineas li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.pd-lineas li span { min-width: 0; overflow-wrap: anywhere; }
.pd-lineas em { font-style: normal; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pd-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pd-total span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pd-total b { font-size: 17px; font-variant-numeric: tabular-nums; }
.pd-fechas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; background: #faf8f5; border-radius: 10px; padding: 8px 10px; }
.pd-fechas dt { font-size: 11px; font-weight: 700; color: var(--muted); }
.pd-fechas dd { margin: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.pd-notas { margin: 0; font-size: 13px; color: var(--muted); }
.pd-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.pd-acc .btn svg { width: 16px; height: 16px; }

/* Formulario */
.pd-form { max-width: 860px; }
.pd-form .tarjeta + .tarjeta { margin-top: 16px; }
.pd-prov-sel { display: flex; gap: 8px; }
.pd-prov-sel select { flex: 1; min-width: 0; }
.pd-linea { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 104px 124px 40px; gap: 10px; align-items: end; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.pd-linea:first-child { padding-top: 0; }
.pd-linea .campo > span { white-space: nowrap; }
.pd-cant input { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pd-quitar { min-height: 44px; }
.pd-suma { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); }
.pd-suma span { font-weight: 700; }
.pd-suma b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pd-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
@media (max-width: 760px) {
  .pd-linea { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pd-linea .pd-quitar { grid-column: 2; justify-self: end; }
  .pd-grid { grid-template-columns: minmax(0, 1fr); }
  .pd-res-f, .pd-res-f select { width: 100%; }
  .pd-pie { flex-direction: column-reverse; align-items: stretch; }
  .pd-pie .btn { width: 100%; }
  .seg { display: flex; }
  .seg a { flex: 1; justify-content: center; }
}
.pd-form .err-form { color: var(--danger); font-size: 14px; font-weight: 700; min-height: 20px; margin: 12px 0 0; }

/* ===== Precios (tejida / armada por fábrica) ===== */
.tj-cab-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.tj-cab-acc .btn svg { width: 17px; height: 17px; }
.pr-selectores { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.pr-selectores .seg { margin: 0; }
.pr-tipos { background: var(--dark); }
.pr-tipos a { color: #b8afa6; }
.pr-tipos a[aria-selected="true"] { background: var(--accent); color: var(--dark); box-shadow: none; }
@media (hover: hover) { .pr-tipos a:not([aria-selected="true"]):hover { color: #fff; } }
.tj-hoja { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 18px 20px 20px; }
.tj-titulo { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 2px solid var(--dark); }
.tj-titulo img { width: 54px; height: 54px; flex: none; }
.tj-titulo b { display: block; font-size: 20px; letter-spacing: .02em; text-transform: uppercase; line-height: 1.2; }
.tj-titulo span { color: var(--muted); font-size: 13px; }
.tj-filtros { margin-bottom: 14px; }
.tj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.tj-mod { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; break-inside: avoid; }
.tj-mod-foto { position: relative; border-radius: 10px; overflow: hidden; background: #f3efe9; aspect-ratio: 4 / 3; display: grid; place-items: center; color: #b3aaa0; align-self: start; }
.tj-mod-foto img { width: 100%; height: 100%; object-fit: cover; }
.tj-mod-foto svg { width: 34px; height: 34px; }
.tj-num { position: absolute; left: 6px; top: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--dark); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.tj-mod-cuerpo { min-width: 0; display: flex; flex-direction: column; }
.tj-mod-cuerpo h3 { font-size: 16px; margin: 2px 0 8px; }
.tj-precios { width: 100%; border-collapse: collapse; font-size: 14px; }
.tj-precios th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 0 6px; border-bottom: 1px solid var(--line2); }
.tj-precios td { padding: 7px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.tj-precios tr:last-child td { border-bottom: 0; }
.tj-precios .der { text-align: right; white-space: nowrap; padding-left: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tj-notas { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.tj-mod-acc { display: flex; gap: 4px; margin-top: auto; padding-top: 10px; }
.tj-mod-acc .btn-ico { width: 34px; }
.tj-pie { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.tj-pie .tarjeta + .tarjeta { margin-top: 0; }
.tj-pie h2 { font-size: 16px; margin-bottom: 10px; }
.tj-subir { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tj-subir label.btn { cursor: pointer; max-width: 100%; }
.tj-subir label.btn span { overflow: hidden; text-overflow: ellipsis; }
.tj-subir input:not([type=file]) { flex: 1; min-width: 160px; min-height: 42px; border: 1px solid var(--line2); border-radius: 10px; padding: 0 12px; font-size: 14px; }
.tj-arch-l { list-style: none; margin: 0; padding: 0; }
.tj-arch-l li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.tj-arch-l li > div { min-width: 0; display: flex; flex-direction: column; }
.tj-arch-l b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tj-arch-l small { color: var(--muted); font-size: 12px; }
.tj-arch-l li > span { display: flex; gap: 4px; flex: none; }
.tj-compartir p { margin: -4px 0 10px; font-size: 13.5px; }
.tj-usuarios { display: grid; gap: 4px; max-height: 320px; overflow: auto; }
.tj-u { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: 10px; cursor: pointer; }
@media (hover: hover) { .tj-u:hover { background: #faf8f5; } }
.tj-u input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.tj-u span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tj-u small { color: var(--muted); font-size: 12px; }

/* Formulario de modelo */
.tj-f-cab { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.tj-f-foto { width: 112px; aspect-ratio: 4 / 3; border-radius: 10px; border: 2px dashed var(--line2); background: #faf8f5; display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--muted); }
.tj-f-foto > span { display: grid; place-items: center; gap: 2px; width: 100%; height: 100%; }
.tj-f-foto img { width: 100%; height: 100%; object-fit: cover; }
.tj-f-foto svg { width: 24px; height: 24px; }
.tj-f-foto small { font-size: 11px; font-weight: 700; }
.tj-f-datos { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.tj-f-datos .campo { width: 100%; }
.tj-f-lcab, .tj-f-l { display: grid; grid-template-columns: minmax(0, 1fr) 150px 40px; gap: 8px; align-items: center; }
.tj-f-lcab { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.tj-f-l { margin-bottom: 8px; }
.tj-f-l > input, .tj-f-l .campo input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; font-size: 16px; background: #fff; }
.tj-f-l .campo input { padding-left: 24px; text-align: right; }
.tj-f-l.err input { border-color: var(--danger); }
.tj-f-l .dinero::before { bottom: 12px; }

/* Botón Más del celular */
.mas-modal { max-width: 420px; }
.mas-tit { font-size: 18px; margin-bottom: 10px; }
.mas-lista { display: grid; gap: 4px; }
.mas-lista a, .mas-lista button { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px; border-radius: 12px; border: 0; background: #faf8f5; color: var(--ink);
  text-decoration: none; font-weight: 700; font-size: 16px; cursor: pointer; text-align: left; }
.mas-lista a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); }
.mas-lista svg { width: 22px; height: 22px; }
#mas-tab[data-act] { color: #fff; }
#mas-tab[data-act] svg { color: var(--accent); }

@media (max-width: 900px) {
  .tj-pie { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .tj-hoja { padding: 14px; }
  .tj-mod { grid-template-columns: minmax(0, 1fr); }
  .tj-mod-foto { aspect-ratio: 16 / 9; }
  .tj-titulo b { font-size: 17px; }
  .tj-f-cab { grid-template-columns: 88px minmax(0, 1fr); }
  .tj-f-foto { width: 88px; }
  .tj-f-lcab, .tj-f-l { grid-template-columns: minmax(0, 1fr) 118px 36px; }
  .tj-cab-acc { width: 100%; }
  .tj-cab-acc .btn { flex: 1; }
}

/* Impresión: solo la lista de precios, limpia */
@media print {
  .side, .tabbar, .cab p, .tj-cab-acc, .pr-selectores, .tj-filtros, .tj-mod-acc, .tj-pie, .toast, .modal { display: none !important; }
  body, .app, .vista { background: #fff !important; margin: 0 !important; padding: 0 !important; display: block !important; }
  .cab { display: none !important; }
  .tj-hoja { box-shadow: none; padding: 0; }
  .tj-grid { display: block; }
  .tj-mod { grid-template-columns: 150px 1fr; margin-bottom: 10px; page-break-inside: avoid; }
}

/* ===== Vendedores → Precios de venta ===== */
.vv-filtros { margin-bottom: 10px; }
.vv-cats { margin: 0 0 8px; }
.vv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; margin-top: 6px; }
.vv-card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; display: flex; flex-direction: column; }
.vv-img { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; background: #f3efe9; cursor: zoom-in; overflow: hidden; color: #b3aaa0; }
.vv-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.vv-img svg { width: 40px; height: 40px; }
@media (hover: hover) { .vv-card:hover .vv-img img { transform: scale(1.04); } }
.vv-txt { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.vv-txt > b { font-size: 15px; line-height: 1.3; }
.vv-txt small { color: var(--muted); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.vv-precio { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.vv-precio strong, .vv-precio b { font-size: 19px; color: var(--brand-ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.vv-precio s { color: #9a928a; font-size: 13px; font-variant-numeric: tabular-nums; }
.vv-acc { display: flex; gap: 6px; padding: 8px 14px 14px; }
.vv-acc .btn { flex: 1; }

/* Ver en grande */
.vv-modal { max-width: 940px; padding: 0 !important; overflow: hidden; }
#vv { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.vv-foto { position: relative; background: #f3efe9; min-height: 320px; display: grid; place-items: center; color: #b3aaa0; }
.vv-foto img { width: 100%; height: 100%; max-height: 78vh; object-fit: contain; display: block; }
.vv-foto svg { width: 56px; height: 56px; }
.vv-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); box-shadow: var(--sh);
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink); }
.vv-ant { left: 10px; } .vv-sig { right: 10px; }
.vv-info { padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vv-info h2 { font-size: 22px; }
.vv-info .vv-precio b { font-size: 26px; }
.vv-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 10px 0 0; font-size: 14px; }
.vv-dl dt { color: var(--muted); font-weight: 700; }
.vv-dl dd { margin: 0; }
.vv-desc { font-size: 14px; color: var(--ink); margin: 8px 0 0; line-height: 1.5; }
.vv-info .vv-acc { padding: 14px 0 0; margin-top: auto; flex-wrap: wrap; }
.vv-info .vv-acc .btn { flex: 0 1 auto; }
.vv-info .vv-acc .btn svg { width: 17px; height: 17px; }

/* Actualizar precios (tabla editable) */
.vv-masivo { margin-top: 6px; }
.vv-masivo > p { margin: 0 0 10px; }
.vv-mt td { padding: 8px 10px; }
.vv-mt td:first-child { width: 58px; }
.vv-mt img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; display: block; }
.vv-mt td b { display: block; }
.vv-mt td small { color: var(--muted); font-size: 12px; }
.vv-mt .campo { display: inline-block; width: 150px; }
.vv-mt .campo input { text-align: right; min-height: 40px; padding: 8px 10px 8px 24px; }
.vv-mt .dinero::before { bottom: 10px; }
.vv-mt tr.cambio td { background: var(--accent-soft); }
.vv-mpie { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 0 2px; background: var(--card); }
.vv-mpie span { color: var(--muted); font-weight: 700; }
.vv-archivos { margin-top: 18px; }

@media (max-width: 760px) {
  .vv-cats { flex-wrap: nowrap; overflow-x: auto; margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut)); padding: 0 var(--gut) 4px; scrollbar-width: none; }
  .vv-cats::-webkit-scrollbar { display: none; }
  .vv-cats .op-fb { flex: none; }
  .vv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .vv-txt { padding: 10px 10px 2px; }
  .vv-txt > b { font-size: 14px; }
  .vv-precio strong { font-size: 16px; }
  .vv-txt small { display: none; }
  .vv-acc { padding: 6px 10px 10px; flex-direction: column; }
  #vv { grid-template-columns: minmax(0, 1fr); }
  .vv-foto { min-height: 220px; }
  .vv-foto img { max-height: 46vh; }
  .vv-info { padding: 16px; }
  .vv-mt .campo { width: 118px; }
  .vv-mt td:first-child { display: none; }
  .vv-mpie { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) { .vv-grid { gap: 8px; } }
.vv-acc:has(.vv-env) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vv-acc:has(.vv-env) [data-ed] { grid-column: 1 / -1; }
.vv-acc .vv-env { gap: 6px; padding: 0 8px; }
.vv-acc .vv-env svg { width: 16px; height: 16px; flex: none; }
.vv-acc > .btn { min-width: 0; }

/* Crédito con Sistecrédito (Vendedores) */
.vv-cred { display: flex; align-items: center; gap: 14px; background: #eef3fc; border: 1px solid #cfdcf3; border-radius: var(--r); padding: 14px 16px; margin: 0 0 16px; }
.vv-cred.sin { background: #f8f6f2; border-color: var(--line2); border-style: dashed; }
.vv-cred-ico { width: 44px; height: 44px; border-radius: 12px; background: #1f4fbf; color: #fff; display: grid; place-items: center; flex: none; }
.vv-cred.sin .vv-cred-ico { background: #d9d2c9; }
.vv-cred-ico svg { width: 24px; height: 24px; }
.vv-cred-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vv-cred-txt b { font-size: 16px; } .vv-cred-txt small { color: var(--muted); font-size: 13.5px; }
.vv-cred-acc { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-cred { background: #1f4fbf; border-color: #1f4fbf; color: #fff; }
.btn-cred:hover { background: #193f99; border-color: #193f99; }
@media (max-width: 760px) {
  .vv-cred { flex-wrap: wrap; padding: 12px; }
  .vv-cred-acc { width: 100%; }
  .vv-cred-acc .btn:not(.btn-sm) { flex: 1; }
}

/* Madera / Aluminio: se despliega al tocar una categoría */
.vv-mat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--sh); transform-origin: top; animation: vv-mat-in .22s ease-out; }
.vv-mat small { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.vv-matb { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line2); background: #fff;
  font-weight: 700; font-size: 14.5px; cursor: pointer; color: var(--ink); transition: background .15s, border-color .15s, color .15s; }
.vv-matb svg { width: 20px; height: 20px; flex: none; }
.vv-matb b { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.vv-matb.m-madera svg { color: #9a5b2a; }
.vv-matb.m-aluminio svg { color: #5b6b7a; }
.vv-matb:hover:not(:disabled) { border-color: #c7bfb5; background: #faf8f5; }
.vv-matb[aria-pressed="true"].m-madera { background: #8a4f22; border-color: #8a4f22; color: #fff; }
.vv-matb[aria-pressed="true"].m-aluminio { background: #4b5a68; border-color: #4b5a68; color: #fff; }
.vv-matb[aria-pressed="true"] svg, .vv-matb[aria-pressed="true"] b { color: #fff; }
.vv-matb:disabled { opacity: .45; cursor: not-allowed; }
@keyframes vv-mat-in { from { opacity: 0; transform: translateY(-6px) scaleY(.92); } }
@media (prefers-reduced-motion: reduce) { .vv-mat { animation: none; } }
@media (max-width: 560px) { .vv-mat { padding: 8px 10px; } .vv-mat small { width: 100%; } .vv-matb { flex: 1; justify-content: center; } }
/* Entrega inmediata (16 nov): chip destacado en Vendedores */
.op-fb.vv-inm { border-color: #e2a400; background: #fff8e6; color: #6b4b00; }
.op-fb.vv-inm[aria-pressed="true"] { background: #e2a400; border-color: #e2a400; color: #2a1d00; }
.op-fb.vv-inm[aria-pressed="true"] b { color: #2a1d00; }

.op-et em { font-style: normal; font-size: 8.5px; font-weight: 700; color: #231f20; min-height: 11px; margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.op-et em + span { margin-top: 0; }
.ctl-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ctl-l li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ctl-l li > div:first-child { display: grid; gap: 2px; min-width: 0; }
.ctl-l small { font-size: 12.5px; color: var(--muted); }
.ctl-acc { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Contadores del menú (18 nov) */
.tabbar #mas-tab { position: relative; }
.mas-lista .nv-num { margin-left: auto; }

/* Reparación por sección en Nueva factura (18 nov) */
.rep-campos { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; margin: 4px 0 0; padding: 12px 14px 14px; border: 1px dashed var(--line, #d9d4cc); border-radius: 12px; min-width: 0; }
.rep-campos legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.rep-campos legend i { font-weight: 400; font-style: normal; opacity: .7; }
