/* Ventas varias: grupos y facturación de preventas, notas de crédito (consulta y nueva), corregir
   cobros, comprobantes eliminados, pedidos web y detalle de presupuesto. Hoja global (los .razor.css
   no se cargan); prefijo vx-. Se apoya en presupuestos-lista.css (pl-: cabecera, tarjeta, pestañas,
   buscador, filtros, tabla, estado, menú ⋯), preventas-lista.css (pv-: selección y estados de
   preventa), presupuesto-form.css (pf-: miga, botones y estado de formulario) y comprobantes-lista.css
   (cpb-: secciones y autocompletar de cliente). */

.vx-pagina {
    --vx-azul: #23548f;
    --vx-azul-hover: #1b4375;
    --vx-azul-claro: #eaf1fa;
    --vx-texto: #1f2328;
    --vx-atenuado: #6b7280;
    --vx-borde: #e5e7eb;
    --vx-naranja: #c2410c;
    --vx-verde: #15803d;
    --vx-rojo: #b91c1c;
    /* Variables de las piezas que se reutilizan */
    --pl-azul: #23548f; --pl-azul-hover: #1b4375; --pl-texto: #1f2328; --pl-atenuado: #6b7280; --pl-borde: #e5e7eb; --pl-naranja: #c2410c;
    --pf-azul: #23548f; --pf-azul-hover: #1b4375; --pf-azul-claro: #eaf1fa; --pf-texto: #1f2328; --pf-atenuado: #6b7280; --pf-borde: #e5e7eb; --pf-rojo: #b91c1c; --pf-naranja: #c2410c;
    color: var(--vx-texto);
}
.vx-pagina:focus { outline: none; }

/* ── Piezas comunes ── */
.vx-pagina a.pl-btn { text-decoration: none; color: var(--vx-texto); }
.vx-pagina a.pl-btn.pl-btn-primario { color: #fff; }
.vx-pagina a.pl-btn.pl-btn-contorno { color: var(--vx-azul); }
.vx-modal a.pl-btn { text-decoration: none; color: var(--vx-texto); }
.vx-modal a.pl-btn.pl-btn-primario { color: #fff; }
.vx-pagina .pl-btn:disabled, .vx-modal .pl-btn:disabled { opacity: .55; cursor: default; }
.vx-pagina .pl-btn-primario:disabled:hover, .vx-modal .pl-btn-primario:disabled:hover { background: var(--vx-azul); border-color: var(--vx-azul); }
.vx-pagina .pf-miga { margin-bottom: .6rem; }
.vx-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vx-atenuado { color: var(--vx-atenuado); }
.vx-pagina .form-check-input:checked { background-color: var(--vx-azul); border-color: var(--vx-azul); }
.vx-pagina .form-check-input:focus { border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .15); }

/* La tarjeta deja ver las listas desplegables (cliente) de los filtros */
.vx-pagina .pl-tarjeta.vx-abierta { overflow: visible; }
.vx-pagina .pl-tarjeta.vx-abierta > :first-child { border-radius: 14px 14px 0 0; }
.vx-pagina .pl-tarjeta.vx-abierta > :last-child { border-radius: 0 0 14px 14px; }

/* Barra de la tarjeta sin pestañas: texto a la izquierda */
.vx-barra-texto { padding: .9rem 0; color: var(--vx-atenuado); font-size: .92rem; white-space: nowrap; }
.vx-pagina .pl-barra-der .pl-buscar.vx-buscar-ancho { flex-basis: 320px; }

/* Estados con punto (variantes de .pl-estado) */
.pl-estado.vx-estado-verde::before { background: #16a34a; }
.pl-estado.vx-estado-azul::before { background: #2563eb; }
.pl-estado.vx-estado-gris::before { background: #9ca3af; }
.pl-estado.vx-estado-gris { color: var(--vx-atenuado); }
.pl-estado.vx-estado-rojo::before { background: #dc2626; }
.pl-estado.vx-estado-rojo { color: var(--vx-rojo); }
.pl-estado.vx-estado-naranja::before { background: #d97706; }

/* Etiquetas chicas (ARCA, tienda, pago, tipo de comprobante) */
.vx-tag {
    display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .5rem; border-radius: 999px;
    background: #f1f2f4; color: #4b5563; font-size: .75rem; font-weight: 500; white-space: nowrap; vertical-align: middle;
}
.vx-tag-azul { background: var(--vx-azul-claro); color: var(--vx-azul); }
.vx-tag-verde { background: #dcfce7; color: #166534; }
.vx-tag-naranja { background: #ffedd5; color: #9a3412; }
.vx-tag-rojo { background: #fee2e2; color: #991b1b; }

/* Avisos */
.vx-aviso {
    display: flex; align-items: flex-start; gap: .6rem; margin-bottom: 1rem; padding: .7rem .9rem;
    border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; color: #78350f; font-size: .92rem; line-height: 1.45;
}
.vx-aviso > i { margin-top: .1rem; }
.vx-aviso > div { flex: 1; min-width: 0; }
.vx-aviso-info { border-color: #cfe0f3; background: #f3f8fd; color: #1e3a5f; }
.vx-aviso-error { border-color: #fecaca; background: #fef2f2; color: #7f1d1d; }
.vx-aviso-ok { border-color: #bbf7d0; background: #f0fdf4; color: #14532d; }
.vx-aviso .btn-close { font-size: .65rem; margin-top: .2rem; }
.vx-aviso a { color: inherit; font-weight: 600; }

/* Vista tarjetas / lista */
.vx-vista { display: inline-flex; gap: .15rem; padding: .2rem; border-radius: 10px; background: #f1f2f4; flex: none; }
.vx-vista button {
    width: 36px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; background: transparent; color: var(--vx-atenuado);
}
.vx-vista button:hover:not(.activo) { color: var(--vx-texto); }
.vx-vista button.activo { background: #fff; color: var(--vx-texto); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }

/* Fila "Seleccionar todas" cuando no hay nada tildado */
.vx-subbarra {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    padding: .55rem 1.25rem; border-bottom: 1px solid var(--vx-borde); color: var(--vx-atenuado); font-size: .9rem;
}
.vx-check { display: inline-flex; align-items: center; gap: .5rem; margin: 0; color: var(--vx-texto); cursor: pointer; }
.vx-check input { width: 18px; height: 18px; margin: 0; cursor: pointer; }

/* Botones de color */
.vx-btn-peligro { background: var(--vx-rojo) !important; border-color: var(--vx-rojo) !important; color: #fff !important; font-weight: 600; }
.vx-btn-peligro:hover:not(:disabled) { background: #991b1b !important; border-color: #991b1b !important; }
.vx-btn-naranja { background: var(--vx-naranja) !important; border-color: var(--vx-naranja) !important; color: #fff !important; font-weight: 600; }
.vx-btn-naranja:hover:not(:disabled) { background: #9a3412 !important; border-color: #9a3412 !important; }

/* Tabla simple dentro de modales y tarjetas (detalle de preventa, nota, resultado) */
.vx-tabla-scroll { overflow-x: auto; border: 1px solid var(--vx-borde); border-radius: 12px; }
.vx-tabla-simple { width: 100%; border-collapse: collapse; font-size: .9rem; }
.vx-tabla-simple th { padding: .6rem .75rem; background: #fafbfc; border-bottom: 1px solid var(--vx-borde); color: var(--vx-atenuado); font-size: .8rem; font-weight: 500; text-align: left; white-space: nowrap; }
.vx-tabla-simple td { padding: .6rem .75rem; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.vx-tabla-simple tbody tr:last-child td { border-bottom: 0; }
.vx-tabla-simple small { display: block; color: var(--vx-atenuado); font-size: .78rem; }

/* Totales (lista de definición) */
.vx-totales { margin: 0; font-variant-numeric: tabular-nums; }
.vx-totales > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: .2rem 0; font-size: .92rem; }
.vx-totales dt { font-weight: 400; color: #4b5563; }
.vx-totales dd { margin: 0; white-space: nowrap; }
.vx-totales .vx-total { margin-top: .35rem; padding-top: .6rem; border-top: 1px solid var(--vx-borde); }
.vx-totales .vx-total dt { color: var(--vx-texto); font-weight: 600; }
.vx-totales .vx-total dd { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.vx-totales-derecha { display: flex; justify-content: flex-end; margin-top: 1rem; }
.vx-totales-derecha .vx-totales { min-width: 260px; }

/* Datos en grilla (cliente, fecha, vendedor…) */
.vx-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem 1rem; margin-bottom: 1rem; }
.vx-dato { min-width: 0; }
.vx-dato > span { display: block; color: var(--vx-atenuado); font-size: .8rem; }
.vx-dato > strong, .vx-dato > div { display: block; font-weight: 500; overflow-wrap: anywhere; }
.vx-nota-texto { padding: .6rem .8rem; margin-bottom: 1rem; border-radius: 10px; background: #fafbfc; border: 1px solid var(--vx-borde); color: #374151; font-size: .9rem; white-space: pre-line; }

/* ── Modales claros (cabecera blanca, 14px) ── */
.vx-modal {
    --pl-azul: #23548f; --pl-azul-hover: #1b4375; --pl-texto: #1f2328; --pl-atenuado: #6b7280; --pl-borde: #e5e7eb; --pl-naranja: #c2410c;
    --vx-azul: #23548f; --vx-azul-claro: #eaf1fa; --vx-texto: #1f2328; --vx-atenuado: #6b7280; --vx-borde: #e5e7eb; --vx-rojo: #b91c1c; --vx-verde: #15803d; --vx-naranja: #c2410c;
    background-color: rgba(17, 24, 39, .5);
}
.vx-modal .modal-content { border: 0; border-radius: 14px; overflow: hidden; color: var(--vx-texto); }
.vx-modal .modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--vx-borde); background: #fff; align-items: flex-start; }
.vx-modal .modal-title { display: flex; align-items: center; gap: .65rem; font-size: 1.1rem; font-weight: 700; min-width: 0; }
.vx-modal .modal-title small { display: block; font-size: .85rem; font-weight: 400; color: var(--vx-atenuado); }
.vx-modal .modal-body { padding: 1.1rem 1.25rem 1.25rem; }
.vx-modal .modal-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--vx-borde); gap: .5rem; }
.vx-modal .modal-footer > * { margin: 0; }
.vx-modal .form-label { margin-bottom: .3rem; font-size: .85rem; font-weight: 500; color: #374151; }
.vx-modal .form-control, .vx-modal .form-select { border-color: var(--vx-borde); border-radius: 10px; min-height: 44px; }
.vx-modal .form-control:focus, .vx-modal .form-select:focus { border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .15); }
.vx-modal-icono {
    flex: 0 0 38px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: var(--vx-azul-claro); color: var(--vx-azul); font-size: 1.1rem;
}
.vx-modal-icono.peligro { background: #fee2e2; color: var(--vx-rojo); }
.vx-modal-icono.alerta { background: #ffedd5; color: var(--vx-naranja); }
.vx-modal-icono.ok { background: #dcfce7; color: var(--vx-verde); }
.vx-resumen { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid var(--vx-borde); border-radius: 12px; background: #fafbfc; }
.vx-resumen > div:first-child { min-width: 0; }
.vx-resumen strong { display: block; overflow-wrap: anywhere; }
.vx-resumen span { display: block; color: #4b5563; font-size: .9rem; }
.vx-resumen-total { text-align: right; font-weight: 700; font-size: 1.15rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vx-resumen-total small { display: block; font-weight: 400; font-size: .8rem; color: var(--vx-atenuado); }
.vx-lista-puntos { margin: 0; padding-left: 1.1rem; color: #4b5563; font-size: .9rem; }
.vx-lista-puntos li + li { margin-top: .2rem; }
.vx-procesando { padding: 1.5rem 0; text-align: center; }
.vx-procesando p { margin: .75rem 0 0; }
.vx-procesando small { color: var(--vx-atenuado); }
.vx-cifras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.vx-cifra { padding: .7rem .8rem; border: 1px solid var(--vx-borde); border-radius: 12px; text-align: center; }
.vx-cifra strong { display: block; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vx-cifra span { color: var(--vx-atenuado); font-size: .82rem; }
.vx-cifra.ok strong { color: var(--vx-verde); }
.vx-cifra.error strong { color: var(--vx-rojo); }
.vx-ok { color: var(--vx-verde); font-weight: 500; }
.vx-error { color: var(--vx-rojo); }

/* Modales y menús por encima de la barra lateral */
.main-content:has(.vx-pagina):has(.modal.show) { z-index: 10000; }

/* ═════════ Grupos de preventas (/preventas/grupos) ═════════ */
.vx-col-grupo { min-width: 200px; }
.vx-grupos-tabla, .vx-nc-tabla { min-width: 0 !important; }
.vx-grupos-tabla .pl-col-acciones, .vx-nc-tabla .pl-col-acciones { width: 1%; white-space: nowrap; }
.vx-grupos-tabla .vx-col-cant { white-space: nowrap; }
.vx-nc-tabla .vx-col-nota small { white-space: nowrap; }
.vx-grupo { display: flex; align-items: flex-start; gap: .65rem; min-width: 0; }
.vx-grupo-color { flex: 0 0 12px; width: 12px; height: 12px; margin-top: .3rem; border-radius: 4px; background: var(--vx-c, #9ca3af); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.vx-grupo-texto { min-width: 0; }
.vx-grupo-texto strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.vx-grupo-texto small { display: block; color: var(--vx-atenuado); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.vx-col-cant { width: 110px; text-align: right !important; font-variant-numeric: tabular-nums; }
.vx-col-fecha { width: 120px; white-space: nowrap; font-variant-numeric: tabular-nums; color: #374151; }
.vx-color-campo { display: flex; gap: .5rem; align-items: center; }
.vx-color-campo input[type=color] { flex: 0 0 52px; width: 52px; height: 44px; padding: .25rem; border: 1px solid var(--vx-borde); border-radius: 10px; background: #fff; cursor: pointer; }
.vx-colores { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.vx-colores button { width: 28px; height: 28px; border: 2px solid #fff; border-radius: 8px; background: var(--vx-c); box-shadow: 0 0 0 1px var(--vx-borde); cursor: pointer; }
.vx-colores button.activo { box-shadow: 0 0 0 2px var(--vx-azul); }
.vx-estados-grupo { display: flex; gap: .4rem; flex-wrap: wrap; }
.vx-estados-grupo button {
    min-height: 40px; padding: 0 .9rem; border: 1px solid var(--vx-borde); border-radius: 999px; background: #fff; color: #374151; font-size: .9rem;
    display: inline-flex; align-items: center; gap: .4rem;
}
.vx-estados-grupo button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vx-c, #9ca3af); }
.vx-estados-grupo button.activo { border-color: var(--vx-azul); background: var(--vx-azul-claro); color: var(--vx-azul); font-weight: 600; }

/* ═════════ Facturar preventas (/preventas/facturar) ═════════ */
.vx-fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .85rem; padding: 1rem 1.25rem 1.25rem; }
.vx-fp-card {
    position: relative; display: flex; flex-direction: column; gap: .55rem; padding: .9rem 1rem;
    border: 1px solid var(--vx-borde); border-radius: 12px; background: #fff; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.vx-fp-card:hover { border-color: #c9d3df; box-shadow: 0 4px 14px rgba(16, 24, 40, .07); }
.vx-fp-card.seleccionada { border-color: var(--vx-azul); background: #f6f9fd; box-shadow: 0 0 0 1px var(--vx-azul) inset; }
.vx-fp-cab { display: flex; align-items: flex-start; gap: .6rem; }
.vx-fp-cab .form-check-input { flex: none; width: 18px; height: 18px; margin: .15rem 0 0; cursor: pointer; }
.vx-fp-titulo { flex: 1; min-width: 0; }
.vx-fp-titulo strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-fp-titulo small { display: block; color: var(--vx-atenuado); font-size: .8rem; font-variant-numeric: tabular-nums; }
.vx-fp-linea { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: #4b5563; font-size: .85rem; min-width: 0; }
.vx-fp-linea > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-fp-pie { display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .55rem; border-top: 1px solid #f0f1f3; }
.vx-fp-estados { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem; font-size: .85rem; }
.vx-fp-total { font-size: 1.25rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.vx-fp-acciones { display: flex; gap: .4rem; }
.vx-fp-acciones .pl-btn { flex: 1; }
.vx-col-items { width: 70px; text-align: center !important; font-variant-numeric: tabular-nums; }
.vx-numero-btn { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }

/* ═════════ Notas de crédito: consulta (/notascredito/consulta) ═════════ */
.vx-nc-tabla .vx-col-venta { width: 120px; white-space: nowrap; }
.vx-nc-tabla .vx-col-venta a { color: var(--vx-azul); text-decoration: none; font-variant-numeric: tabular-nums; }
.vx-nc-tabla .vx-col-venta a:hover { text-decoration: underline; }
.vx-nc-tabla .vx-col-cliente { max-width: 220px; }
.vx-nc-tabla .vx-col-cliente span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-nc-tabla .vx-col-imp { width: 120px; }
.vx-fila-anulada td { color: var(--vx-atenuado); }
.vx-fila-anulada .pl-col-total { text-decoration: line-through; font-weight: 500; }

/* ═════════ Nueva nota de crédito (/notascredito/nueva) ═════════ */
.vx-form { max-width: 1240px; margin: 0 auto; padding: .25rem .25rem 2rem; }
.vx-nc-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.vx-nc-cab h1 { margin: 0 0 .25rem; font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
.vx-nc-sub { margin: 0; color: var(--vx-atenuado); font-size: .95rem; }
.vx-nc-sub b { color: #374151; font-weight: 600; }
.vx-nc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.25rem; align-items: start; }
.vx-tarjeta { background: #fff; border: 1px solid var(--vx-borde); border-radius: 14px; }
.vx-tarjeta-cab { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--vx-borde); }
.vx-tarjeta-cab h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.vx-tarjeta-cab p { margin: .1rem 0 0; color: var(--vx-atenuado); font-size: .85rem; }
.vx-tarjeta-cuerpo { padding: 1rem 1.25rem 1.25rem; }

.vx-nc-tabla-art { width: 100%; border-collapse: collapse; font-size: .93rem; }
.vx-nc-tabla-art th { padding: .7rem .6rem; background: #f7f8fa; border-bottom: 1px solid var(--vx-borde); color: var(--vx-atenuado); font-size: .82rem; font-weight: 500; text-align: left; white-space: nowrap; }
.vx-nc-tabla-art td { padding: .75rem .6rem; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.vx-nc-tabla-art th:first-child, .vx-nc-tabla-art td:first-child { padding-left: 1.25rem; }
.vx-nc-tabla-art th:last-child, .vx-nc-tabla-art td:last-child { padding-right: 1.25rem; }
.vx-nc-tabla-art tr.sel td { background: #f6f9fd; }
.vx-nc-tabla-art tr.sin td { color: #9ca3af; }
.vx-nc-col-check { width: 44px; }
.vx-nc-col-check input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.vx-nc-col-cod { width: 90px; color: var(--vx-atenuado); font-size: .85rem; }
.vx-nc-col-cant { width: 150px; text-align: center !important; }
.vx-nc-col-precio { width: 120px; }
.vx-nc-col-total { width: 130px; font-weight: 600; }
.vx-nc-art { font-weight: 500; overflow-wrap: anywhere; }
.vx-nc-art small { display: block; margin-top: .1rem; color: var(--vx-atenuado); font-weight: 400; font-size: .8rem; }
.vx-nc-art small.devuelto { color: #b45309; }
.vx-paso { display: inline-flex; align-items: center; gap: .3rem; }
.vx-paso button {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--vx-borde); border-radius: 8px; background: #fff; color: var(--vx-texto); font-size: 1rem; line-height: 1;
}
.vx-paso button:hover:not(:disabled) { background: #f3f4f6; }
.vx-paso button:disabled { opacity: .4; }
.vx-paso input {
    width: 54px; height: 34px; padding: 0 .2rem; border: 1px solid var(--vx-borde); border-radius: 8px; background: #fff;
    font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.vx-paso input:focus { outline: none; border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .15); }
.vx-paso input:disabled { background: #f9fafb; color: #9ca3af; }
.vx-paso input::-webkit-outer-spin-button, .vx-paso input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.vx-nc-motivo { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--vx-borde); }
.vx-nc-motivo-titulo { display: block; margin-bottom: .6rem; color: #374151; font-size: .92rem; font-weight: 500; }
.vx-nc-motivo-titulo span { color: var(--vx-atenuado); font-weight: 400; }
.vx-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .65rem; }
.vx-chip { min-height: 36px; padding: 0 .85rem; border: 1px solid var(--vx-borde); border-radius: 999px; background: #fff; color: #374151; font-size: .88rem; }
.vx-chip:hover { border-color: #c4c9d0; }
.vx-chip.activo { border-color: var(--vx-azul); background: var(--vx-azul-claro); color: var(--vx-azul); font-weight: 600; }
.vx-nc-motivo textarea { width: 100%; min-height: 64px; padding: .55rem .75rem; border: 1px solid var(--vx-borde); border-radius: 10px; font-size: .93rem; resize: vertical; }
.vx-nc-motivo textarea:focus { outline: none; border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .12); }
.vx-ayuda { display: block; margin-top: .35rem; color: var(--vx-atenuado); font-size: .8rem; }

.vx-nc-lateral { position: sticky; top: 1rem; padding: 1rem 1.1rem 1.15rem; }
.vx-nc-lateral h2 { margin: 0 0 .75rem; font-size: 1rem; font-weight: 600; color: #374151; }
.vx-nc-lateral .vx-totales .vx-total dd { font-size: 1.85rem; }
.vx-nc-h3 { margin: 1.15rem 0 .55rem; color: #374151; font-size: .9rem; font-weight: 600; }
.vx-opcion {
    display: flex; align-items: flex-start; gap: .65rem; margin-bottom: .5rem; padding: .7rem .8rem;
    border: 1px solid var(--vx-borde); border-radius: 12px; background: #fff; cursor: pointer;
}
.vx-opcion.activa { border-color: var(--vx-azul); background: #f6f9fd; box-shadow: 0 0 0 1px var(--vx-azul) inset; }
.vx-opcion.deshabilitada { opacity: .55; cursor: not-allowed; }
.vx-opcion input { margin-top: .2rem; flex: none; accent-color: var(--vx-azul); }
.vx-opcion b { display: block; font-weight: 600; font-size: .92rem; }
.vx-opcion small { display: block; color: var(--vx-atenuado); font-size: .8rem; line-height: 1.35; }
.vx-opcion-det { padding: .1rem 0 .6rem; }
.vx-opcion-det .form-select { height: 40px; border-color: var(--vx-borde); border-radius: 10px; }
.vx-opcion-det input[type=text] { width: 100%; height: 40px; margin-top: .5rem; padding: 0 .75rem; border: 1px solid var(--vx-borde); border-radius: 10px; font-size: .9rem; }
.vx-opcion-det input[type=text]:focus { outline: none; border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .12); }
.vx-btn-grande { width: 100%; height: 52px; margin-top: 1rem; border-radius: 12px; font-size: 1.05rem; }
.vx-cancelar { display: block; width: 100%; margin-top: .6rem; padding: .35rem; border: 0; background: none; color: #4b5563; font-size: .9rem; text-align: center; }
.vx-cancelar:hover { color: var(--vx-texto); text-decoration: underline; }
.vx-kbd {
    display: inline-block; margin-left: .3rem; padding: .05rem .4rem; border: 1px solid var(--vx-borde); border-radius: 5px;
    background: #f3f4f6; color: var(--vx-atenuado); font-size: .7rem; font-weight: 600; font-family: inherit; line-height: 1.4; box-shadow: none;
}

/* Buscar la venta */
.vx-nc-buscar { max-width: 600px; margin: 2rem auto; padding: 1.75rem 1.5rem; text-align: center; }
.vx-nc-buscar-icono { width: 52px; height: 52px; margin: 0 auto .85rem; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--vx-azul-claro); color: var(--vx-azul); font-size: 1.5rem; }
.vx-nc-buscar h1 { margin: 0 0 .35rem; font-size: 1.5rem; font-weight: 700; }
.vx-nc-buscar p { margin: 0 auto 1.25rem; max-width: 460px; color: var(--vx-atenuado); font-size: .95rem; }
.vx-nc-buscar-fila { display: flex; gap: .5rem; }
.vx-nc-buscar-campo { flex: 1; display: flex; align-items: center; gap: .5rem; min-width: 0; height: 52px; padding: 0 .9rem; border: 1px solid var(--vx-borde); border-radius: 12px; background: #fff; }
.vx-nc-buscar-campo span { color: var(--vx-atenuado); font-size: .95rem; white-space: nowrap; }
.vx-nc-buscar-campo input { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; font-size: 1.05rem; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.vx-nc-buscar-campo input::-webkit-outer-spin-button, .vx-nc-buscar-campo input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.vx-nc-buscar-campo input:focus { outline: none; }
.vx-nc-buscar-campo:focus-within { border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .15); }
.vx-nc-buscar-fila .pl-btn { height: 52px; border-radius: 12px; }
.vx-nc-buscar-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }

/* Modal "Nota de crédito generada" */
.vx-hecho { text-align: center; }
.vx-hecho-icono { width: 52px; height: 52px; margin: 0 auto .6rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #dcfce7; color: var(--vx-verde); font-size: 1.5rem; }
.vx-hecho-icono.alerta { background: #ffedd5; color: var(--vx-naranja); }
.vx-hecho-numero { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.vx-hecho-linea { margin-top: .35rem; color: #374151; font-size: .92rem; }
.vx-hecho .vx-aviso { margin: .75rem 0 0; text-align: left; }

/* ═════════ Corregir cobros (/ventas/corregir-cobros) ═════════ */
.vx-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.vx-cc-filtros { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--vx-borde); }
.vx-cc-filtros .pl-filtro { flex: 0 0 170px; }
.vx-cc-filtros .vx-barra-texto { margin-left: auto; padding: 0 0 .7rem; }
.vx-cc-contenedor { max-height: 62vh; overflow: auto; }
.vx-cc-tabla { min-width: 860px; }
.vx-cc-tabla td.vx-num { white-space: nowrap; }
.vx-cc-tabla thead th { position: sticky; top: 0; z-index: 2; background: #fff; }
.vx-cc-tabla tr.seleccionada td { background: #f6f9fd; }
.vx-cc-tabla .vx-col-entregas { min-width: 220px; }
.vx-cc-tabla td.vx-col-entregas small.vx-bloqueo { display: flex; gap: .35rem; color: #92400e; font-size: .82rem; }
.vx-entrega { display: block; margin: 0 0 .5rem; color: #4b5563; font-size: .8rem; }
.vx-entrega:last-child { margin-bottom: 0; }
.vx-entrega input { display: block; width: 100%; max-width: 180px; height: 36px; margin-top: .2rem; padding: 0 .6rem; border: 1px solid var(--vx-borde); border-radius: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.vx-entrega input:focus { outline: none; border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .12); }
.vx-entrega input:disabled { background: #f9fafb; color: #9ca3af; }
.vx-deuda { font-weight: 600; }
.vx-pie-acciones { display: flex; align-items: center; gap: .4rem; }
.vx-revision { margin-top: 1rem; border: 1px solid #fdba74; border-radius: 14px; background: #fff; overflow: hidden; }
.vx-revision-cab { display: flex; align-items: center; gap: .65rem; padding: 1rem 1.25rem; border-bottom: 1px solid #fed7aa; background: #fff7ed; }
.vx-revision-cab h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: #7c2d12; }
.vx-revision-cuerpo { padding: 1rem 1.25rem 1.25rem; }
.vx-revision-cuerpo > p { color: #374151; font-size: .92rem; }
.vx-revision-lista { margin: 0 0 1rem; padding: 0; list-style: none; border: 1px solid var(--vx-borde); border-radius: 12px; }
.vx-revision-lista li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .85rem; border-bottom: 1px solid #f0f1f3; font-size: .9rem; }
.vx-revision-lista li:last-child { border-bottom: 0; }
.vx-revision-lista li strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.vx-revision-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; padding: .7rem .85rem; border-radius: 12px; background: #fff7ed; color: #7c2d12; }
.vx-revision-total strong { font-size: 1.25rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vx-revision-motivo { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.vx-revision-motivo span { color: #374151; font-size: .85rem; font-weight: 500; }
.vx-revision-motivo input { height: 44px; padding: 0 .8rem; border: 1px solid var(--vx-borde); border-radius: 10px; }
.vx-revision-motivo input:focus { outline: none; border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .15); }
.vx-revision-acciones { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ═════════ Comprobantes eliminados (/comprobantes/eliminados) ═════════ */
.vx-el-tabla .vx-col-eliminado { width: 150px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vx-el-tabla .vx-col-comp { white-space: nowrap; }
.vx-el-tabla .vx-col-comp .vx-tag { margin-right: .35rem; text-transform: capitalize; }
.vx-el-tabla .vx-col-cliente { max-width: 240px; }
.vx-el-tabla .vx-col-motivo { min-width: 160px; max-width: 260px; color: #374151; font-size: .88rem; }
.vx-el-tabla .vx-col-revirtio { min-width: 170px; }
.vx-revertido { display: flex; flex-wrap: wrap; gap: .3rem; }
.vx-el-tabla .vx-col-toggle { width: 56px; text-align: right !important; }
.vx-icono-btn {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--vx-borde); border-radius: 8px; background: #fff; color: #4b5563;
}
.vx-icono-btn:hover { background: #f3f4f6; color: var(--vx-texto); }
.vx-icono-btn.activo { border-color: var(--vx-azul); background: var(--vx-azul-claro); color: var(--vx-azul); }
.vx-el-detalle td { background: #fafbfc; }
.vx-el-detalle-titulo { margin-bottom: .5rem; color: #374151; font-size: .85rem; font-weight: 600; }
.vx-json {
    max-height: 420px; margin: 0; padding: .85rem 1rem; overflow: auto; border: 1px solid var(--vx-borde); border-radius: 10px;
    background: #fff; color: #374151; font-size: .8rem; white-space: pre-wrap; word-break: break-word;
}

/* ═════════ Pedidos web (/ecommerce/pedidos) ═════════ */
.vx-pedidos { display: flex; flex-direction: column; }
.vx-pedido { padding: 1rem 1.25rem; border-bottom: 1px solid #f0f1f3; }
.vx-pedido:hover { background: #fcfcfd; }
.vx-pedido.cancelado { background: #fafafa; }
.vx-pedido.cancelado .vx-pedido-cliente, .vx-pedido.cancelado .vx-pedido-total { color: var(--vx-atenuado); }
.vx-pedido-fila {
    display: grid; grid-template-columns: 170px minmax(0, 1fr) 200px 130px auto; gap: .5rem 1.25rem; align-items: start;
}
.vx-pedido-id strong { display: block; color: var(--vx-texto); font-weight: 700; font-variant-numeric: tabular-nums; }
.vx-pedido-id small { display: block; white-space: nowrap; color: var(--vx-atenuado); font-size: .8rem; font-variant-numeric: tabular-nums; }
.vx-pedido-cliente { min-width: 0; }
.vx-pedido-cliente strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.vx-pedido-contacto { display: flex; flex-wrap: wrap; gap: .1rem .75rem; color: var(--vx-atenuado); font-size: .82rem; }
.vx-pedido-contacto span { overflow-wrap: anywhere; }
.vx-pedido-envio { display: flex; align-items: flex-start; gap: .35rem; margin-top: .3rem; color: #374151; font-size: .84rem; overflow-wrap: anywhere; }
.vx-pedido-envio a { color: var(--vx-azul); }
.vx-pedido-estados { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; font-size: .88rem; }
.vx-pedido-estados .vx-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.vx-pedido-total { text-align: right; font-weight: 700; font-size: 1.05rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vx-pedido-total small { display: block; color: var(--vx-atenuado); font-size: .78rem; font-weight: 400; }
.vx-pedido-acciones { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.vx-pedido-alerta { display: flex; gap: .4rem; align-items: flex-start; margin-top: .6rem; padding: .5rem .75rem; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: .85rem; }
.vx-pedido-items { margin-top: .5rem; }
.vx-pedido-items summary { display: inline-flex; align-items: center; gap: .3rem; color: var(--vx-azul); font-size: .85rem; cursor: pointer; list-style: none; }
.vx-pedido-items summary::-webkit-details-marker { display: none; }
.vx-pedido-items summary::before { content: "\F285"; font-family: "bootstrap-icons"; font-size: .7rem; transition: transform .15s; }
.vx-pedido-items[open] summary::before { transform: rotate(90deg); }
.vx-pedido-items .vx-tabla-scroll { margin-top: .5rem; max-width: 720px; }
.vx-pedido-obs { margin-top: .4rem; color: var(--vx-atenuado); font-size: .85rem; }

/* ═════════ Detalle de presupuesto (/presupuestos/{id}) ═════════ */
.vx-pd-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.vx-pd-cab h1 { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: 0 0 .25rem; font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
.vx-pd-sub { margin: 0; color: var(--vx-atenuado); font-size: .95rem; }
.vx-pd-sub .pl-enviado, .vx-pd-sub .pl-sin-enviar, .vx-pd-sub .pl-archivado { white-space: nowrap; }
.vx-pd-acciones { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.vx-pd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.25rem; align-items: start; }
.vx-pd-lateral { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.vx-pd-lateral .vx-tarjeta-cuerpo { padding: 1rem 1.1rem 1.1rem; }
.vx-pagina .vx-pd-titulo-lateral { margin: 0 0 .7rem; color: #374151; font-size: .9rem; font-weight: 600; }
.vx-pd-cliente { display: flex; align-items: flex-start; gap: .75rem; }
.vx-pd-cliente .pf-avatar { flex-basis: 40px; width: 40px; height: 40px; font-size: .85rem; }
.vx-pd-cliente-texto { min-width: 0; line-height: 1.35; }
.vx-pd-cliente-texto strong { display: block; overflow-wrap: anywhere; }
.vx-pd-cliente-texto small { display: block; color: #4b5563; font-size: .83rem; overflow-wrap: anywhere; }
.vx-pd-filas { margin: 0; }
.vx-pd-filas > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .3rem 0; font-size: .9rem; }
.vx-pd-filas > div + div { border-top: 1px solid #f3f4f6; }
.vx-pd-filas dt { font-weight: 400; color: var(--vx-atenuado); white-space: nowrap; }
.vx-pd-filas dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.vx-pd-filas a { color: var(--vx-azul); text-decoration: none; }
.vx-pd-filas a:hover { text-decoration: underline; }
.vx-pd-estado { display: flex; gap: .5rem; }
.vx-pd-estado select, .vx-pd-pdf select {
    flex: 1; min-width: 0; height: 44px; padding: 0 .7rem; border: 1px solid var(--vx-borde); border-radius: 10px; background-color: #fff; color: var(--vx-texto);
}
.vx-pd-estado select:focus, .vx-pd-pdf select:focus { outline: none; border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .15); }
.vx-pd-pdf { display: flex; gap: .5rem; align-items: center; }
.vx-pd-pdf select { flex: 0 0 82px; }
.vx-pd-pdf .pf-btn { flex: 1; }
.vx-pd-doc { display: flex; flex-direction: column; gap: .65rem; }
.vx-pd-doc .pf-btn { width: 100%; }
.vx-pd-doc .pf-check { white-space: normal; }

.vx-pd-tabla { width: 100%; border-collapse: collapse; font-size: .93rem; }
.vx-pd-tabla th { padding: .7rem .6rem; border-bottom: 1px solid var(--vx-borde); color: var(--vx-atenuado); font-size: .82rem; font-weight: 500; text-align: right; white-space: nowrap; }
.vx-pd-tabla th:first-child { text-align: left; }
.vx-pd-tabla td { padding: .75rem .6rem; border-bottom: 1px solid #f0f1f3; vertical-align: top; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vx-pd-tabla th:first-child, .vx-pd-tabla td:first-child { padding-left: 1.25rem; }
.vx-pd-tabla th:last-child, .vx-pd-tabla td:last-child { padding-right: 1.25rem; }
.vx-pd-tabla td.vx-pd-art { text-align: left; white-space: normal; }
.vx-pd-art strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.vx-pd-art small { display: block; margin-top: .1rem; color: var(--vx-atenuado); font-size: .8rem; }
.vx-pd-codigo { display: inline-block; margin-right: .4rem; padding: 0 .4rem; border-radius: 6px; background: #f1f2f4; color: #4b5563; font-size: .75rem; font-weight: 600; vertical-align: 1px; }
.vx-pd-codigo:empty { display: none; }
.vx-pd-tabla .vx-pd-total { font-weight: 600; }
.vx-pd-pie { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; padding: 1.1rem 1.25rem 1.25rem; border-top: 1px solid var(--vx-borde); background: #fafbfc; border-radius: 0 0 14px 14px; }
.vx-pd-pie .vx-totales { min-width: 280px; }
.vx-pd-obs { max-width: 480px; }
.vx-pd-obs span { display: block; margin-bottom: .2rem; color: var(--vx-atenuado); font-size: .82rem; }
.vx-pd-obs p { margin: 0; color: #374151; font-size: .9rem; white-space: pre-line; }
.vx-pd-dolar { margin-top: .6rem; color: var(--vx-atenuado); font-size: .82rem; }

/* Tablas de los formularios que se adaptan al ancho de su tarjeta (no de la ventana): con la barra
   lateral abierta la columna izquierda queda angosta aunque la pantalla sea grande. */
.vx-nc-articulos, .vx-pd-detalle { container-type: inline-size; }
.vx-nc-solo-compacto, .vx-pd-solo-compacto { display: none; }

@container (max-width: 720px) {
    .vx-nc-solo-compacto { display: inline; }
    .vx-nc-tabla-art thead { display: none; }
    .vx-nc-tabla-art, .vx-nc-tabla-art tbody { display: block; }
    .vx-nc-tabla-art tr {
        display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "check art art" "check cant total";
        gap: .5rem .75rem; padding: .85rem 1.25rem; border-bottom: 1px solid #f0f1f3;
    }
    .vx-nc-tabla-art tr.sel { background: #f6f9fd; }
    .vx-nc-tabla-art td { display: block; padding: 0 !important; border: 0; background: none !important; width: auto; }
    .vx-nc-tabla-art td.vx-nc-col-check { grid-area: check; padding-top: .1rem !important; }
    .vx-nc-tabla-art td.vx-nc-art { grid-area: art; }
    .vx-nc-tabla-art td.vx-nc-col-cant { grid-area: cant; text-align: left !important; }
    .vx-nc-tabla-art td.vx-nc-col-total { grid-area: total; align-self: center; }
    .vx-nc-tabla-art td.vx-nc-col-cod, .vx-nc-tabla-art td.vx-nc-col-precio { display: none; }

    .vx-pd-tabla th.vx-pd-neto, .vx-pd-tabla td.vx-pd-neto { display: none; }
}

@container (max-width: 560px) {
    .vx-pd-solo-compacto { display: inline; }
    .vx-pd-solo-ancho { display: none; }
    .vx-pd-tabla thead { display: none; }
    .vx-pd-tabla, .vx-pd-tabla tbody { display: block; }
    .vx-pd-tabla tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "art art" "cant total"; gap: .35rem .75rem; padding: .85rem 1rem; border-bottom: 1px solid #f0f1f3; }
    .vx-pd-tabla td { display: block; padding: 0 !important; border: 0; }
    .vx-pd-tabla td.vx-pd-art { grid-area: art; }
    .vx-pd-tabla td.vx-pd-cant { grid-area: cant; text-align: left; color: #4b5563; font-size: .88rem; }
    .vx-pd-tabla td.vx-pd-total { grid-area: total; }
    .vx-pd-tabla td.vx-pd-final, .vx-pd-tabla td.vx-pd-iva { display: none; }
}

/* ═════════ Pantallas medianas ═════════ */
/* Notebooks (con la barra lateral): neto e IVA de las notas y la fecha de alta de los grupos no van */
@media (min-width: 768px) and (max-width: 1399.98px) {
    .vx-nc-tabla .vx-col-imp, .vx-grupos-tabla .vx-col-fecha, .vx-txt-ancho { display: none; }
}

@media (max-width: 1199.98px) {
    .vx-pedido-fila { grid-template-columns: 140px minmax(0, 1fr) 180px 120px; }
    .vx-pedido-acciones { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 991.98px) {
    .vx-nc-layout, .vx-pd-layout { grid-template-columns: minmax(0, 1fr); }
    .vx-nc-lateral, .vx-pd-lateral { position: static; }
}

/* ═════════ Celular ═════════ */
@media (max-width: 767.98px) {
    .vx-pagina .pv-cab-acciones .pl-btn, .vx-pagina .pv-cab-acciones a.pl-btn { flex: 1 1 auto; }
    .vx-barra-texto { padding: .6rem 1rem 0; }
    .vx-pagina .pl-barra-der .pl-buscar.vx-buscar-ancho { flex-basis: auto; }
    .vx-vista { display: none; }
    .vx-subbarra { padding: .55rem 1rem; }
    .vx-fp-grid { grid-template-columns: minmax(0, 1fr); padding: .85rem 1rem 1rem; }
    .vx-cifras { gap: .4rem; }
    .vx-cifra strong { font-size: 1.05rem; }
    .vx-datos { grid-template-columns: 1fr 1fr; }
    .vx-totales-derecha .vx-totales { min-width: 0; width: 100%; }
    .vx-modal .modal-footer { flex-wrap: wrap; }
    .vx-modal .modal-footer > .pl-btn { flex: 1 1 auto; }

    /* Tablas que pasan a tarjetas con etiqueta (data-label) */
    .vx-tabla-tarjetas { min-width: 0 !important; }
    .vx-tabla-tarjetas thead { display: none; }
    .vx-tabla-tarjetas, .vx-tabla-tarjetas tbody { display: block; }
    .vx-tabla-tarjetas tbody tr { display: block; padding: .8rem 1rem; border-bottom: 1px solid #f0f1f3; }
    .vx-tabla-tarjetas td {
        display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
        padding: .2rem 0 !important; border: 0 !important; width: auto !important; max-width: none !important; min-width: 0 !important; text-align: right;
    }
    .vx-tabla-tarjetas td[data-label]::before { content: attr(data-label); flex: none; color: var(--vx-atenuado); font-size: .8rem; text-align: left; }
    .vx-tabla-tarjetas td > * { min-width: 0; }
    .vx-tabla-tarjetas td.vx-celda-titulo { display: block; text-align: left; padding-bottom: .35rem !important; }
    .vx-tabla-tarjetas td.vx-celda-bloque { display: block; text-align: left; }
    .vx-tabla-tarjetas td.vx-celda-bloque[data-label]::before { display: block; margin-bottom: .25rem; }
    .vx-tabla-tarjetas td:empty { display: none; }

    /* Grupos: tarjeta por grupo */
    .vx-grupos-tabla tr {
        display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "grupo total" "estado cant" "acciones acciones";
        gap: .3rem .75rem;
    }
    .vx-grupos-tabla td { display: block !important; }
    .vx-grupos-tabla td::before { display: none; }
    .vx-grupos-tabla td.vx-col-grupo { grid-area: grupo; text-align: left; }
    .vx-grupos-tabla td.pl-col-total { grid-area: total; }
    .vx-grupos-tabla td.pl-col-estado { grid-area: estado; text-align: left; }
    .vx-grupos-tabla td.vx-col-cant { grid-area: cant; color: var(--vx-atenuado); font-size: .85rem; }
    .vx-grupos-tabla td.vx-col-fecha { display: none !important; }
    .vx-grupos-tabla td.pl-col-acciones { grid-area: acciones; margin-top: .3rem; }
    .vx-grupos-tabla .pl-acciones { justify-content: flex-start; }
    .vx-grupo-texto small { max-width: none; white-space: normal; }

    /* Facturar en lista: reusa las tarjetas de preventas-lista.css; los ítems no van */
    .pv-tabla td.vx-col-items { display: none; }

    /* Notas de crédito */
    .vx-nc-tabla tr {
        display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nota total" "cliente estado" "venta venta" "acciones acciones";
        gap: .2rem .75rem;
    }
    .vx-nc-tabla td { display: block !important; text-align: left; }
    .vx-nc-tabla td::before { display: none; }
    .vx-nc-tabla td.vx-col-nota { grid-area: nota; }
    .vx-nc-tabla td.vx-col-nota small { display: inline; margin-left: .35rem; white-space: normal; }
    .vx-nc-tabla td.pl-col-total { grid-area: total; text-align: right; }
    .vx-nc-tabla td.vx-col-cliente { grid-area: cliente; }
    .vx-nc-tabla td.pl-col-estado { grid-area: estado; text-align: right; font-size: .85rem; }
    .vx-nc-tabla td.vx-col-venta { grid-area: venta; font-size: .85rem; }
    .vx-nc-tabla td.vx-col-imp { display: none !important; }
    .vx-nc-tabla td.pl-col-acciones { grid-area: acciones; margin-top: .3rem; }
    .vx-nc-tabla .pl-acciones { justify-content: flex-start; }

    /* Nueva nota de crédito */
    .vx-nc-cab h1 { font-size: 1.45rem; }
    .vx-nc-cab > .pl-btn { width: 100%; }
    .vx-tarjeta-cab, .vx-tarjeta-cuerpo, .vx-nc-motivo { padding-left: 1rem; padding-right: 1rem; }
    .vx-tarjeta-cab .pl-btn { width: 100%; }
    .vx-nc-buscar { margin: 1rem auto; padding: 1.25rem 1rem; }
    .vx-nc-buscar-fila { flex-direction: column; }
    .vx-nc-buscar-fila .pl-btn { width: 100%; }

    /* Corregir cobros */
    .vx-cc-filtros { padding: .85rem 1rem; }
    .vx-cc-filtros .pl-filtro { flex: 1 1 140px; }
    .vx-cc-filtros > .pl-btn { flex: 1 1 100%; }
    .vx-cc-filtros .vx-barra-texto { margin-left: 0; padding: 0; }
    .vx-cc-contenedor { max-height: none; }
    .vx-cc-tabla tr.seleccionada { background: #f6f9fd; }
    .vx-cc-tabla tr.seleccionada td { background: none; }
    .vx-cc-tabla td.vx-col-check { justify-content: flex-start; }
    .vx-entrega input { max-width: none; }
    .vx-pagina .pl-pie { flex-direction: column; align-items: stretch; gap: .6rem; }
    .vx-pie-acciones { width: 100%; }
    .vx-pedido-items th:first-child, .vx-pedido-items td:first-child { display: none; }
    .vx-pie-acciones .pl-btn { flex: 1; }
    .vx-revision-cab, .vx-revision-cuerpo { padding-left: 1rem; padding-right: 1rem; }
    .vx-revision-acciones .pl-btn { flex: 1 1 100%; height: auto; min-height: 44px; padding-top: .5rem; padding-bottom: .5rem; white-space: normal; }

    /* Eliminados */
    .vx-el-tabla tr.vx-el-detalle { padding-top: 0; }
    .vx-el-tabla td.vx-col-toggle { justify-content: flex-end; }

    /* Pedidos web */
    .vx-pedido { padding: .9rem 1rem; }
    .vx-pedido-fila { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id total" "cliente cliente" "estados estados" "acciones acciones"; gap: .45rem .75rem; }
    .vx-pedido-id { grid-area: id; }
    .vx-pedido-total { grid-area: total; }
    .vx-pedido-cliente { grid-area: cliente; }
    .vx-pedido-estados { grid-area: estados; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .vx-pedido-acciones { grid-area: acciones; grid-column: auto; justify-content: flex-start; }

    /* Detalle de presupuesto */
    .vx-pd-cab h1 { font-size: 1.45rem; }
    .vx-pd-acciones { width: 100%; }
    .vx-pd-acciones .pf-btn { flex: 1 1 auto; }
    .vx-pd-pie { flex-direction: column; gap: 1rem; padding: 1rem; }
    .vx-pd-pie .vx-totales { min-width: 0; width: 100%; }
}

/* ═════════ Notas de débito ═════════ */
/* Consulta: aviso de que ARCA no autorizó la nota */
.vx-nd-arca { display: block; margin-top: .15rem; color: #b45309; font-size: .78rem; font-weight: 500; }

/* Alta: importes con IVA / sin IVA */
.vx-nd-modo { display: inline-flex; padding: 3px; border: 1px solid var(--vx-borde); border-radius: 10px; background: #f7f8fa; }
.vx-nd-modo button { min-height: 32px; padding: 0 .75rem; border: 0; border-radius: 8px; background: none; color: #4b5563; font-size: .85rem; }
.vx-nd-modo button.activo { background: #fff; color: var(--vx-azul); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }

.vx-nd-rapidos { padding: .9rem 1.25rem 0; }
.vx-nd-rapidos > span { display: block; margin-bottom: .5rem; color: var(--vx-atenuado); font-size: .82rem; }
.vx-nd-rapidos .vx-chips { margin-bottom: 0; }

/* Alta: un renglón por concepto */
.vx-nd-conceptos { display: grid; gap: .55rem; padding: 1rem 1.25rem 1.25rem; }
.vx-nd-fila { display: grid; grid-template-columns: minmax(0, 1fr) 112px 150px 118px 40px; gap: .5rem; align-items: center; }
.vx-nd-conceptos.sin-iva .vx-nd-fila { grid-template-columns: minmax(0, 1fr) 150px 118px 40px; }
.vx-nd-titulos { color: var(--vx-atenuado); font-size: .8rem; font-weight: 500; }
.vx-nd-titulos .vx-num { text-align: right; }
.vx-nd-fila input, .vx-nd-fila select {
    width: 100%; height: 42px; padding: 0 .7rem; border: 1px solid var(--vx-borde); border-radius: 10px; background: #fff; font-size: .93rem;
}
.vx-nd-fila input:focus, .vx-nd-fila select:focus { outline: none; border-color: var(--vx-azul); box-shadow: 0 0 0 3px rgba(35, 84, 143, .12); }
.vx-nd-importe { position: relative; }
.vx-nd-importe > span { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--vx-atenuado); pointer-events: none; }
.vx-nd-importe input { padding-left: 1.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.vx-nd-importe input::-webkit-outer-spin-button, .vx-nd-importe input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.vx-nd-importe input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.vx-nd-total { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vx-nd-quitar { width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: #9ca3af; }
.vx-nd-quitar:hover:not(:disabled) { background: #fef2f2; color: #b91c1c; }
.vx-nd-quitar:disabled { opacity: .35; }
.vx-nd-agregar { justify-self: start; margin-top: .25rem; }

/* Alta: qué pasa al generarla */
.vx-nd-efectos { display: grid; gap: .55rem; margin: 0 0 1.1rem; padding: 0; list-style: none; }
.vx-nd-efectos li { display: flex; gap: .55rem; color: #4b5563; font-size: .86rem; line-height: 1.4; }
.vx-nd-efectos li i { flex: none; margin-top: .1rem; color: var(--vx-azul); }
.vx-nd-efectos b { color: #1f2937; font-weight: 600; }

@container (max-width: 640px) {
    .vx-nd-titulos { display: none; }
    .vx-nd-fila, .vx-nd-conceptos.sin-iva .vx-nd-fila {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
        grid-template-areas: "desc desc desc" "iva importe quitar" "total total total";
        padding-bottom: .7rem; border-bottom: 1px solid #f0f1f3;
    }
    .vx-nd-conceptos.sin-iva .vx-nd-fila { grid-template-areas: "desc desc desc" "importe importe quitar" "total total total"; }
    .vx-nd-desc { grid-area: desc; }
    .vx-nd-iva { grid-area: iva; }
    .vx-nd-importe { grid-area: importe; }
    .vx-nd-total { grid-area: total; color: #374151; font-size: .88rem; }
    .vx-nd-total::before { content: "Total del concepto: "; color: var(--vx-atenuado); font-weight: 400; }
    .vx-nd-quitar { grid-area: quitar; }
}
