/* Tablas de datos (las de la tienda: cabecera gris clara en mayúsculas de 12 px, filas de 14 px). En pantallas
   angostas la tabla se desplaza dentro de su contenedor, no la página.
   position: relative → los .sr-only absolutos de las celdas quedan recortados por el scroll y no ensanchan la página. */
.table-wrap { position: relative; width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: var(--cell-py) var(--cell-px); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table thead th {
    font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
    color: var(--muted); background: var(--surface-2);
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.table .table__group th {
    padding-top: 14px; font-size: .72rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--av-pri); background: var(--surface);
}
.table--checklist td { min-width: 190px; }
.table__actions { white-space: nowrap; text-align: right; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Tabla cuyo encabezado de fila es un texto largo (descripción de una línea de cotización): salta de línea. */
.table--wrap tbody th { white-space: normal; min-width: 220px; }
.table--wrap .qline__thumb { margin-bottom: 6px; }
.table__actions form { display: inline-block; margin: 0 0 0 6px; }
.table__actions .btn { min-height: var(--btn-sm-h); padding: 5px 10px; font-size: .85rem; }

/* .table--stack: en celular cada fila pasa a ser un bloque con el rótulo de cada dato (data-label), para que
   ninguna columna ni acción quede fuera de la vista. Celdas vacías se omiten. */
@media (max-width: 600px) {
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack th, .table--stack td { display: block; }
    .table--stack thead { display: none; }
    .table--stack tbody tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .table--stack tbody tr:last-child { border-bottom: 0; }
    .table--stack th, .table--stack td, .table--stack tbody th { padding: 2px 0; border: 0; white-space: normal; }
    .table--stack td:empty { display: none; }
    .table--stack .num { text-align: left; }
    .table--stack .thumb-cell { float: right; width: auto; margin-left: 12px; }
    .table--stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
    .table--stack .table__actions { padding-top: 8px; text-align: left; }
    .table--stack .table__actions form { margin: 0; }
}
/* Compacta: la miniatura de una línea va a la izquierda de su descripción (no encima), así la fila no crece. */
.is-compact .table--wrap tbody th .qline__thumb { float: left; width: 72px; height: 42px; margin: 0 10px 2px 0; }
.is-compact .table--wrap tbody th { min-width: 260px; }

/* Auditoría: cambios anterior → nuevo dentro de una celda. */
.audit-changes { list-style: none; margin: 0 0 4px; padding: 0; font-size: .85rem; overflow-wrap: anywhere; }
