/* ── Ancho máximo ── */
.areacliente:has(.presupuestoDetalle) {
    padding-left: 16px;
    padding-right: 16px;
}

.presupuestoDetalle {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Grid de campos ── */
.pd .grid {
    display: grid;
    gap: 10px;
}

.pd .grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.pd .grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.pd .grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.pd .grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.pd .grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.pd .span-2 {
    grid-column: span 2;
}

.pd .span-3 {
    grid-column: span 3;
}

.pd .span-4 {
    grid-column: span 4;
}

.pd .span-6 {
    grid-column: span 6;
}

.pd .row-gap {
    margin-top: 12px;
}

/* ── Cabecera ── */
.pd-cab {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 24px;
    background: #fdfcfb;
    border-bottom: 1px solid #e2e8f0;
}

.pd-cab::before {
    content: '';
    display: block;
    width: 4px;
    height: 22px;
    flex-shrink: 0;
    background: #e2001a;
    border-radius: 9999px;
}

.pd-cab-titulo {
    font-size: clamp(18px, 1.4vw + 8px, 26px);
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.pd-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pd-info label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
    cursor: default;
    margin: 0;
}

.pd-info span {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.pd-info-cliente {
    flex: 1;
    min-width: 180px;
}

.pd-cab-distribuidor {
    font-size: 14px;
    color: #475569;
    font-weight: 700;
}

.pd-badge-tipo {
    background: rgba(226, 0, 26, .1);
    color: #e2001a;
    border: 1px solid rgba(226, 0, 26, .3);
    padding: 3px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.pd-cab-acciones {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.pd-btn-util {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #94a3b8;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 120ms, color 120ms, background 120ms;
}

.pd-btn-util i {
    line-height: 1;
    font-size: 14px;
}

.pd-btn-util:hover {
    border-color: #94a3b8;
    color: #475569;
    background: #f8fafc;
}

.pd-btn-util.spinning i {
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Campo editable ── */
.pd .campo {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pd .campo label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: default;
    margin: 0;
}

.pd .campo input[type=text],
.pd .campo input[type=date],
.pd .campo input[type=number],
.pd .campo textarea,
.pd .campo select {
    width: 100%;
    padding: 5px 9px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    min-height: 30px;
    box-sizing: border-box;
    cursor: text;
    transition: border-color 160ms, box-shadow 160ms;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.pd .campo input[type=text]:hover,
.pd .campo input[type=date]:hover,
.pd .campo input[type=number]:hover,
.pd .campo textarea:hover,
.pd .campo select:hover {
    border-color: #94a3b8;
}

.pd .campo input:focus,
.pd .campo textarea:focus,
.pd .campo select:focus {
    outline: none;
    border-color: #e2001a;
    box-shadow: 0 0 0 3px rgba(226, 0, 26, .12);
}

.pd .campo input.hl,
.pd .campo select.hl {
    background: #f8fafc;
    border-color: #94a3b8;
}

.pd .campo textarea {
    resize: vertical;
    min-height: 44px;
    cursor: text;
}

/* ── Checkbox ── */
.pd label.chk-campo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    cursor: pointer;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    padding-top: 18px;
}

.pd label.chk-campo input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: #e2001a;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Valor de solo lectura ── */
.pd .valor {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 9px;
    min-height: 28px;
    color: #0f172a;
    word-break: break-word;
}

.pd .valor.hl {
    background: #f1f5f9;
}

/* ── Fieldset ── */
.pd fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px 12px;
    margin: 0;
}

.pd legend {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    padding: 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Inputs deshabilitados ── */
.pd .campo input:disabled,
.pd .campo textarea:disabled,
.pd .campo select:disabled {
    background: #edf0f5;
    color: #0f172a;
    border-color: #c4cdd9;
    cursor: not-allowed;
    box-shadow: none;
}

.pd fieldset.fs-readonly {
    border: 1.5px dashed #94a3b8;
}

.pd fieldset.fs-readonly legend {
    color: #64748b;
}

/* ── Tabla de líneas ── */
.pd .tabla-datos th,
.pd .tabla-datos td {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    padding: 4px 7px;
    font-size: 11px;
    border-right: 1px solid #94a3b8 !important;
}

.pd .tabla-datos th:last-child,
.pd .tabla-datos td:last-child {
    border-right: none !important;
}

.pd .tabla-datos th {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    border-right-color: rgba(255, 255, 255, 0.3) !important;
}

.pd .tabla-datos td.descripcion {
    white-space: normal;
    max-width: 220px;
}

.badge-esp {
    background: #ef4444;
    color: white;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 700;
}

.badge-agrup {
    background: #94a3b8;
    color: white;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
}

/* ── Totales ── */
.pd-totales-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 16px;
    gap: 10px;
}

.pd-totales-rendimiento {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    padding: 10px 20px;
}

.pd-rendimiento-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #166534;
}

.pd-rendimiento-valor {
    font-size: 18px;
    font-weight: 700;
    color: #16a34a;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.pd-rendimiento-pct {
    font-size: 14px;
    font-weight: 600;
    color: #16a34a;
    background: #dcfce7;
    border-radius: 6px;
    padding: 2px 10px;
}

.pd-totales-horizontal {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pd-totales {
    min-width: 240px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.pd-totales-titulo {
    background: #fdfcfb;
    color: #475569;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid #e2e8f0;
}

.pd-totales table {
    width: 100%;
    border-collapse: collapse;
}

.pd-totales table td {
    padding: 6px 16px;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
}

.pd-totales table td:first-child {
    color: #475569;
}

.pd-totales table td:last-child {
    text-align: right;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
}

.pd-totales tr.total-row td {
    background: rgba(226, 0, 26, .06);
    font-size: 14px;
    font-weight: 700;
    color: #e2001a;
    border-top: 2px solid rgba(226, 0, 26, .25);
    border-bottom: none;
}

/* ── Input con botón de búsqueda ── */
.pd .campo .input-buscar {
    position: relative;
}

.pd .campo .input-buscar input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 20px;
}

.btn-buscar {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 120ms;
    border-radius: 2px;
}

.btn-buscar:hover {
    color: #e2001a;
}

.input-dir-group {
    display: flex;
    gap: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color 160ms, box-shadow 160ms;
}

.input-dir-group:focus-within {
    border-color: #e2001a;
    box-shadow: 0 0 0 3px rgba(226, 0, 26, .12);
}

.input-dir-group .input-buscar {
    flex: 1;
    display: flex;
    position: static;
}

.input-dir-group .input-buscar input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent;
    min-height: 28px;
    padding-right: 9px !important;
}

.input-dir-group .btn-buscar {
    position: static;
    transform: none;
    top: auto;
    right: auto;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-radius: 0;
    align-self: stretch;
    height: auto;
    width: 32px;
    background: #f8fafc;
    flex-shrink: 0;
    font-size: 6px;
}

.input-dir-group .btn-reset-dir {
    border: none;
    border-right: 1px solid #e2e8f0;
    border-radius: 0;
    align-self: stretch;
    height: auto;
    background: #f8fafc;
    width: 28px;
    flex-shrink: 0;
    font-size: 6px;
}

.btn-reset-dir {
    width: 26px;
    flex-shrink: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    transition: background 120ms, color 120ms;
}

.btn-reset-dir i {
    display: block;
    line-height: 1;
    text-align: center;
}

.btn-reset-dir:hover {
    background: #fff1f1;
    color: #e2001a;
}

/* ── Modal buscador ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
    width: min(1200px, 96vw);
    height: 80vh;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
}

.modal-head button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #94a3b8;
    line-height: 1;
}

.modal-head button:hover {
    color: #0f172a;
}

.modal-search {
    padding: 10px 18px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.modal-search input {
    width: 100% !important;
    box-sizing: border-box;
    padding: 9px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.modal-search input:focus {
    outline: none;
    border-color: #e2001a;
    box-shadow: 0 0 0 3px rgba(226, 0, 26, .12);
}

.modal-tabla-wrap {
    overflow: auto;
    flex: 1;
}

.modal-tabla {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
}

.modal-tabla thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 7px 10px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    text-align: left;
}

.modal-tabla tbody tr {
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.modal-tabla tbody tr:hover {
    background: #f8fafc;
}

.modal-tabla tbody td {
    padding: 6px 10px;
    color: #0f172a;
    font-weight: 600;
}

.modal-tabla tbody td.col-cod {
    color: #94a3b8;
}

/* ── Tab panels ── */
.ac-tab-panel {
    display: none;
    padding-top: 16px;
}

.ac-tab-panel.active {
    display: block;
}

/* ── Modal footer ── */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fdfcfb;
}

.modal-btn-cancelar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    line-height: 1;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    cursor: pointer;
    transition: border-color 120ms;
}

.modal-btn-cancelar:hover {
    border-color: #94a3b8;
}

.modal-btn-seleccionar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 20px;
    border: 1.5px solid transparent;
    border-radius: 6px;
    background: #e2001a;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 150ms;
}

.modal-btn-seleccionar i,
.modal-btn-cancelar i {
    font-size: 12px;
    line-height: 1;
}

.modal-btn-seleccionar:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.modal-btn-seleccionar:not(:disabled):hover {
    opacity: 0.88;
}

/* ── Fila seleccionada en modal ── */
.modal-tabla tbody tr.modal-fila-seleccionada td {
    background: rgba(226, 0, 26, .07);
}

/* ── Botones de acción en tab líneas ── */
.pd-tab-acc-extra {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pd-tab-acc-extra label.chk-campo {
    padding-top: 0;
}

.pd-tab-acciones {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.pd-tab-acciones .btn-mobel {
    font-size: 12px;
    padding: 6px 14px;
}

.btn-mobel-outline {
    background: transparent;
    color: #e2001a;
    border: 1.5px solid #e2001a;
    text-decoration: none;
}

.btn-mobel-outline:hover {
    background: #fef2f2;
}

/* ── Cabecera oscura (modalLinea y modalZona) ── */
#modalLinea .modal-box {
    height: 75vh;
    max-height: 75vh;
    border-radius: 16px;
    padding: 0;
}

#modalLinea .modal-box.nl-paso2-activo {
    height: auto;
}

#modalZona .modal-box {
    width: min(480px, 96vw);
    height: auto;
    max-height: 92vh;
    border-radius: 16px;
    padding: 0;
}

/* Áreas de contenido del modal: scrollables cuando el zoom las desborda */
#nl_paso1,
#nl_paso2,
#modalZona .mz-cuerpo {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-dark-head {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-dark-head-titulo {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
}

.modal-dark-head-close {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms;
}

.modal-dark-head-close:hover {
    background: rgba(255, 255, 255, .18);
}

/* ── Paso 1: buscar referencia ── */
.nl-paso1 {
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Espaciadores flexibles: centran cuando hay sitio, colapsan hacia arriba cuando no hay */
.nl-paso1::before,
.nl-paso1::after {
    content: '';
    flex: 1;
}

.nl-paso1-intro {
    text-align: center;
}

.nl-icono-wrap {
    width: 90px;
    height: 90px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    overflow: hidden;
}

.nl-icono-wrap .fas {
    font-size: 48px;
    color: #64748b;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.nl-paso1-texto {
    margin: 0;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.nl-paso1-subtexto {
    margin: 6px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

.nl-search-bar {
    display: flex;
    width: 100%;
    max-width: 520px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.nl-search-bar input {
    flex: 1;
    font-size: 15px;
    border: none;
    padding: 12px 16px;
    outline: none;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #0f172a;
}

.nl-btn-comprobar {
    padding: 0 22px;
    border: none;
    border-left: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    white-space: nowrap;
    transition: background 120ms, color 120ms, border-color 120ms;
}

.nl-btn-comprobar:hover {
    background: #e2001a;
    color: #fff;
    border-left-color: #e2001a;
}

.nl-estado {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    min-height: 18px;
}

/* ── Paso 2: campos del artículo ── */
.nl-paso2-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
}

.nl-col-imagen {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.nl-img-wrap {
    width: 210px;
    height: 210px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

.nl-img-wrap img {
    width: 210px;
    height: 210px;
    object-fit: contain;
}

.nl-img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
}

.nl-img-placeholder .fas {
    font-size: 48px;
}

.nl-img-placeholder span {
    font-size: 11px;
}

.nl-ref-info {
    text-align: center;
}

.nl-ref-codigo {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: .5px;
    word-break: break-all;
}

.nl-encontrado {
    font-size: 11px;
    color: #16a34a;
    font-weight: 600;
    margin-top: 6px;
}

.nl-btn-cambiar {
    font-size: 11px;
    color: #94a3b8;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    padding: 5px 12px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: color 120ms, border-color 120ms;
}

.nl-btn-cambiar:hover {
    color: #e2001a;
    border-color: #e2001a;
}

.nl-col-campos {
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nl-campo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nl-campo label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.nl-campo label.nl-label-verde {
    color: #15803d;
}

.nl-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 110px;
    gap: 14px;
}

.nl-grid-precios {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 14px;
}

.nl-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.nl-input,
.nl-select {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #0f172a;
    outline: none;
    transition: border-color 120ms;
}

.nl-select {
    cursor: pointer;
}

.nl-input:focus,
.nl-select:focus {
    border-color: #94a3b8;
}

#modalLinea input,
#modalLinea select {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Inputs de solo lectura dentro del modal: borde dashed + fondo gris */
#modalLinea input:read-only {
    background: #f1f5f9;
    color: #64748b;
    border: 1.5px dashed #cbd5e1;
    cursor: default;
    box-shadow: none;
    outline: none;
}

#modalLinea input:read-only:focus {
    border-color: #cbd5e1;
    box-shadow: none;
    outline: none;
}

.nl-input-readonly,
.areacliente textarea.nl-input-readonly {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.45;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #edf0f5;
    color: #64748b;
    cursor: default;
    outline: none;
    pointer-events: none;
}

.nl-input-mono {
    color: #64748b;
    background: #f8fafc;
    text-align: right;
}

.nl-pvp-final {
    width: 100%;
    box-sizing: border-box;
    font-size: 15px;
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    text-align: right;
    /* color, background, border, cursor heredados de #modalLinea input:read-only */
}

/* ── Botones compartidos (modal línea y zona) ── */
.nl-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.nl-btn-secundario {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    padding: 9px 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: border-color 120ms;
}

.nl-btn-secundario:hover {
    border-color: #94a3b8;
}

.nl-btn-primario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 9px 24px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    background: #e2001a;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(226, 0, 26, .25);
    transition: opacity 120ms;
}

.nl-btn-primario:hover {
    opacity: .88;
}

/* ── Cuerpo del modal zona ── */
.mz-cuerpo {
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Campo descuento (ancho limitado + solo lectura) ── */
.campo-dto {
    max-width: 120px;
}

.campo-dto input {
    background: #f8fafc !important;
    color: #64748b !important;
    cursor: default !important;
}

/* ── Tabla de líneas: anchos de columna ── */
.tabla-lineas th:nth-child(1) {
    text-align: center;
    width: 160px;
}

.tabla-lineas th:nth-child(2) {
    text-align: center;
    width: 90px;
}

.tabla-lineas th:nth-child(3) {
    text-align: center;
    width: 60px;
}

.tabla-lineas th:nth-child(4) {
    text-align: center;
    width: 140px;
}

.tabla-lineas th:nth-child(5) {
    text-align: center;
    min-width: 260px;
}

.tabla-lineas th:nth-child(6) {
    text-align: center;
    width: 90px;
}

.tabla-lineas th:nth-child(7) {
    text-align: center;
    width: 80px;
}

.tabla-lineas th:nth-child(8) {
    text-align: center;
    width: 80px;
}

.tabla-lineas th:nth-child(9) {
    text-align: center;
    width: 90px;
}

.tabla-lineas th:nth-child(10) {
    text-align: center;
    width: 100px;
}

.tabla-lineas th:nth-child(11) {
    text-align: center;
    width: 90px;
}

.tabla-lineas th:nth-child(12) {
    text-align: center;
    width: 90px;
}

.tabla-lineas th:nth-child(13) {
    width: 36px;
}

/* ── Tabla de líneas: alineación de celdas ── */
.tabla-lineas td {
    text-align: center;
}

.tabla-lineas td.descripcion {
    text-align: left;
}

.tabla-lineas td:last-child {
    padding: 4px;
    white-space: nowrap;
}

/* ── Fila "sin líneas" ── */
.td-sin-lineas {
    text-align: center;
    color: #94a3b8;
    padding: 24px;
    font-style: italic;
    font-size: 13px;
}

/* ── Fila de zona en tabla ── */
.td-zona {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #000;
    padding: 8px 14px;
    text-align: center;
    border-top: 2px solid #e2001a !important;
    border-bottom: 2px solid #e2001a !important;
}

/* ── Imagen en fila de tabla ── */
.img-linea {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 4px;
}

/* ── Botones micro de acción en fila ── */
.btn-accion {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 8px;
    padding: 1px 2px;
}

.btn-accion-edit {
    color: #475569;
}

.btn-accion-sec {
    color: #94a3b8;
}

/* ── Iconos en cabeceras de modal ── */
.modal-dark-head-titulo i {
    margin-right: 10px;
    color: #e2001a;
}

.modal-head span i {
    margin-right: 8px;
    color: #e2001a;
}

/* ── Iconos en elementos del modal línea ── */
.nl-btn-comprobar i {
    margin-right: 6px;
}

.nl-encontrado i {
    margin-right: 3px;
}

.nl-sin-imagen {
    font-size: 11px;
    color: #d97706;
    font-weight: 600;
}

.nl-sin-imagen.nl-sin-imagen-error {
    color: #dc2626;
}

.nl-sin-imagen i {
    margin-right: 3px;
}

.nl-btn-cambiar i {
    margin-right: 4px;
}

.nl-btn-primario span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nl-btn-primario i {
    font-size: 12px;
}

/* ══════════════════════════════════════════
   RESPONSIVE — mobile first (≤ 640px)
   ══════════════════════════════════════════ */
@media (max-width: 640px) {

    /* Modal a pantalla completa */
    .modal-overlay {
        align-items: flex-end;
    }

    .modal-box {
        width: 100vw;
        height: 92dvh;
        max-height: 92dvh;
        border-radius: 16px 16px 0 0;
    }

    #modalLinea .modal-box {
        width: 100vw;
        border-radius: 16px 16px 0 0;
    }

    /* Zona: formulario corto → centrado como diálogo, no bottom sheet */
    #modalZona {
        align-items: center;
    }
    #modalZona .modal-box {
        width: 92vw;
        border-radius: 16px;
        height: auto;
        max-height: 88dvh;
    }

    /* Cabecera oscura más compacta, sin encoger */
    .modal-dark-head {
        padding: 16px 18px;
        flex-shrink: 0;
    }

    /* Paso 1 */
    .nl-paso1 {
        padding: 0 18px;
        gap: 14px;
    }

    .nl-icono-wrap {
        width: 70px;
        height: 70px;
        margin-bottom: 12px;
    }

    .nl-icono-wrap .fas {
        font-size: 36px;
    }

    /* Paso 2: columnas en vertical */
    .nl-paso2-layout {
        grid-template-columns: 1fr;
    }

    /* Columna imagen: horizontal y compacta */
    .nl-col-imagen {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 14px 18px;
        gap: 14px;
        align-items: center;
    }

    .nl-img-wrap {
        width: 96px;
        height: 96px;
        flex-shrink: 0;
    }

    .nl-img-wrap img {
        width: 96px;
        height: 96px;
    }

    .nl-img-placeholder .fas {
        font-size: 28px;
    }

    .nl-ref-info {
        text-align: left;
    }

    .nl-btn-cambiar {
        margin-top: 4px;
    }

    /* Columna de campos */
    .nl-col-campos {
        padding: 16px 18px;
        gap: 14px;
    }

    /* Grids de campos */
    .nl-grid-3 {
        grid-template-columns: repeat(3, 1fr);  /* Op1 | Op2 | UD. en la misma fila */
    }

    .nl-grid-3 .nl-campo { min-width: 0; }  /* evita desbordamiento del grid */

    .nl-grid-precios {
        grid-template-columns: 1fr 1fr;  /* PVP | Incr. / Desc. | PVPFinal — 2×2 */
    }

    .nl-grid-precios .nl-campo { min-width: 0; }

    /* PVP Final en su celda (sin span): layout 2×2 sin huecos */
    .nl-grid-precios .nl-campo:last-child {
        grid-column: span 1;
    }

    .nl-grid-2 .nl-campo { min-width: 0; }

    /* Cuerpo modal zona */
    .mz-cuerpo {
        padding: 18px;
    }

    /* Footer botones: apilados y a ancho completo */
    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-btn-cancelar,
    .modal-btn-seleccionar {
        width: 100%;
        justify-content: center;
    }

    .nl-acciones {
        flex-direction: column-reverse;
        padding-top: 4px;
    }

    .nl-btn-secundario,
    .nl-btn-primario {
        width: 100%;
        justify-content: center;
    }

    /* ── Formulario: grids en columna única ── */
    .pd .grid-2,
    .pd .grid-3,
    .pd .grid-4,
    .pd .grid-5,
    .pd .grid-6 { grid-template-columns: 1fr; }

    .pd .span-2,
    .pd .span-3,
    .pd .span-4,
    .pd .span-6 { grid-column: span 1; }

    /* ── Totales: apilar verticalmente ── */
    .pd-totales-horizontal { flex-direction: column; width: 100%; }
    .pd-totales { min-width: 0; width: 100%; }
    .pd-totales-wrap { align-items: stretch; }
    .pd-totales-rendimiento { justify-content: center; flex-wrap: wrap; }

    /* ── Acciones de la pestaña líneas ── */
    .pd-tab-acciones { flex-wrap: wrap; }
    .pd-tab-acc-extra { margin-left: 0; width: 100%; flex-wrap: wrap; }
    .pd-tab-acc-extra .btn-mobel-outline { flex: 1; justify-content: center; }

    /* ── Pestañas: scroll horizontal si no caben ── */
    .ac-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

    /* ── Lista de presupuestos: tabla scrollable ── */
    .prl-panel { overflow-x: auto; }

    /* ── Panel cuerpo: padding más compacto ── */
    .panel-defecto .panel-cuerpo { padding: 12px 10px; }

    /* ── Botones extra tab líneas: apilar en vertical ── */
    .pd-tab-acc-extra { flex-direction: column; align-items: stretch; }
    .pd-tab-acc-extra .btn-mobel-outline,
    .pd-tab-acc-extra label.chk-campo { width: 100%; justify-content: center; box-sizing: border-box; }

    /* ══ Lista de presupuestos: ocultar columnas prescindibles ══ */
    .prl-tabla thead th:nth-child(3),   /* Su pedido */
    .prl-tabla tbody td:nth-child(3),
    .prl-tabla thead th:nth-child(5),   /* Líneas */
    .prl-tabla tbody td:nth-child(5),
    .prl-tabla thead th:nth-child(6),   /* Total */
    .prl-tabla tbody td:nth-child(6) { display: none; }

    .prl-tabla thead th:nth-child(2) { width: 80px; }
    .prl-tabla tbody td { padding: 12px 8px; }
    .prl-th-estado { width: 80px; }
    .prl-estado { padding: 2px 6px; font-size: 10px; }

    /* ══ Tabla de líneas: diseño de tarjeta en móvil ══ */
    .tabla-lineas { display: block; }
    .tabla-lineas thead { display: none; }
    .tabla-lineas tbody { display: flex; flex-direction: column; gap: 10px; }

    /* Grid: imagen | ref · ud */
    .tabla-lineas tbody tr {
        display: grid;
        grid-template-columns: 92px 1fr 1fr;
        gap: 2px 10px;
        background: #fff;
        border-radius: 12px;
        border: 1px solid #e8edf2;
        box-shadow: 0 1px 4px rgba(15,23,42,.07);
        padding: 10px 12px;
    }

    .tabla-lineas td {
        display: block;
        text-align: left;
        padding: 1px 0;
        font-size: 13px;
    }

    /* Imagen: columna izquierda, centrada verticalmente */
    .tabla-lineas td:nth-child(1) {
        display: flex;
        align-items: center;
        justify-content: center;
        grid-row: 1;
        padding: 0;
        color: #94a3b8;
    }
    .tabla-lineas td:nth-child(1) .img-linea {
        width: 88px;
        height: 88px;
        object-fit: contain;
        border-radius: 8px;
        background: #f1f5f9;
    }

    /* Ref. y UD.: identificadores principales, destacados */
    .tabla-lineas td:nth-child(2),
    .tabla-lineas td:nth-child(3) { font-size: 15px; font-weight: 600; color: #1e293b; }

    /* Descripción: texto secundario, máx. 3 líneas */
    .tabla-lineas td:nth-child(5) {
        grid-column: 1 / -1;
        font-weight: 400;
        color: #64748b;
        font-size: 11.5px;
        padding-top: 5px;
        padding-bottom: 3px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Etiquetas para Ref., UD., PVP final y Total */
    .tabla-lineas td:nth-child(2)::before  { content: "Ref. "; color: #94a3b8; font-size: 10px; font-weight: 400; }
    .tabla-lineas td:nth-child(3)::before  { content: "UD. ";  color: #94a3b8; font-size: 10px; font-weight: 400; }

    /* Precios: ancho completo, uno debajo del otro */
    .tabla-lineas td:nth-child(10) { grid-column: 1 / -1; font-size: 12px; color: #475569; }
    .tabla-lineas td:nth-child(10)::before { content: "PVP final "; color: #94a3b8; font-size: 10px; }
    .tabla-lineas td:nth-child(11) { grid-column: 1 / -1; font-size: 14px; font-weight: 700; color: #0f172a; }
    .tabla-lineas td:nth-child(11)::before { content: "Total "; color: #94a3b8; font-size: 10px; font-weight: 400; }

    /* Botones de acción: compactos con fondo pill */
    .tabla-lineas .btn-accion {
        font-size: 12px;
        padding: 4px 8px;
        min-width: 0;
        min-height: 0;
        background: #f1f5f9;
        border-radius: 6px;
        color: #475569;
    }
    .tabla-lineas .btn-accion-edit { color: #3b82f6; background: #eff6ff; }

    /* Acciones: fila completa al pie de la tarjeta */
    .tabla-lineas td:last-child {
        grid-column: 1 / -1;
        text-align: right;
        padding-top: 7px;
        margin-top: 4px;
        border-top: 1px solid #f1f5f9;
        white-space: nowrap;
        display: flex;
        justify-content: flex-end;
        gap: 6px;
    }

    /* Ocultar celdas no relevantes en tarjeta */
    .tabla-lineas td:nth-child(4),   /* Opción 1/2 */
    .tabla-lineas td:nth-child(6),   /* PVP */
    .tabla-lineas td:nth-child(7),   /* Incremento */
    .tabla-lineas td:nth-child(8),   /* PVP Cliente */
    .tabla-lineas td:nth-child(9),   /* Descuento */
    .tabla-lineas td:nth-child(12),  /* Peso */
    .tabla-lineas td:nth-child(13) { display: none; } /* Volumen */

    /* Fila vacía: celda única centrada */
    .tabla-lineas .td-sin-lineas {
        grid-column: 1 / -1;
        text-align: center;
        padding: 20px 0;
    }

    /* Fila de zona: sección separadora (solo 2 td, no usa el grid de tarjeta) */
    .tabla-lineas tbody tr:has(.td-zona) {
        display: flex;
        align-items: center;
        background: #f1f5f9;
        border-color: #cbd5e1;
        box-shadow: none;
        padding: 8px 14px;
        border-radius: 8px;
        gap: 8px;
    }
    .tabla-lineas .td-zona {
        display: block;
        flex: 1;
        font-weight: 700;
        font-size: 13px;
        color: #334155;
        padding: 0;
        text-align: left;
    }
    /* Botones de la fila zona: sin separador ni márgenes de tarjeta */
    .tabla-lineas tr:has(.td-zona) td:last-child {
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }

    /* Botones de acción en fila: tap targets mínimos 44px */
    .btn-accion { font-size: 14px; padding: 6px 8px; min-width: 30px; min-height: 30px; }
    .td-zona { font-size: 13px; }

    /* tabla-scroll: altura acotada en móvil */
    .tabla-scroll { max-height: 65vh; }

    /* Paso 2: altura definida para que flex:1 en #nl_paso2 funcione (height:auto en el padre
       no da altura definitiva al hijo, por lo que overflow-y:auto nunca se activa). */
    #modalLinea .modal-box.nl-paso2-activo {
        height: 88dvh;
        max-height: 88dvh;
    }

    /* overflow-x:hidden evita el recorte lateral del formulario */
    #nl_paso2 { overflow-x: hidden; }

    /* Paso 2: ocultar solo la nota orientativa; imagen y referencia visibles */
    .nl-col-imagen .img-orientativa-nota { display: none; }

    /* ══ Modal dirección: ocultar Dirección 2 ══ */
    #modalDireccion .modal-tabla thead th:nth-child(4),
    #modalDireccion .modal-tabla tbody td:nth-child(4) { display: none; }

    /* ══ Modal prestatario: solo Código, Nombre y Grupo ══ */
    #modalPrestatario .modal-tabla thead th:nth-child(n+4),
    #modalPrestatario .modal-tabla tbody td:nth-child(n+4) { display: none; }

    /* Filas de modales: tap targets más grandes */
    .modal-tabla tbody td { padding: 10px 8px; }
    .modal-tabla tbody tr { min-height: 44px; }

    /* Buscador de modal: input más grande para touch */
    .modal-search input { padding: 12px 14px; font-size: 15px; }
}

/* Muy estrecho (≤ 420px): ocultar texto de pestañas, dejar solo icono */
@media (max-width: 420px) {
    .ac-tab-btn span { display: none; }
    .ac-tab-btn { padding: 8px 12px; }
}

/* Tablet (641px – 900px): grids de 2 columnas */
@media (max-width: 900px) and (min-width: 641px) {
    .pd .grid-4,
    .pd .grid-5,
    .pd .grid-6 { grid-template-columns: repeat(2, 1fr); }

    .pd .span-3,
    .pd .span-4,
    .pd .span-6 { grid-column: span 2; }

    .pd-totales-horizontal { flex-wrap: wrap; }
    .pd-totales { min-width: 0; flex: 1; }

    /* ── Modal añadir línea en tablet ── */

    /* overflow-y:auto en #nl_paso2 promovería overflow-x a auto por spec;
       overflow-x:hidden lo evita y recorta cualquier desbordamiento lateral */
    #nl_paso2 { overflow-x: hidden; }

    /* Imagen y columna más compactas para dejar espacio a los campos */
    .nl-paso2-layout { grid-template-columns: 190px 1fr; }
    .nl-img-wrap     { width: 155px; height: 155px; }
    .nl-img-wrap img { width: 155px; height: 155px; }
    .nl-col-campos   { padding: 20px 24px; }

    /* min-width:0 en items de grid evita que selects/inputs fuercen la columna más ancha */
    .nl-grid-3 .nl-campo,
    .nl-grid-precios .nl-campo,
    .nl-grid-2 .nl-campo { min-width: 0; }
}

/* Zoom elevado: esconder sección decorativa para que el input siempre sea visible */
@media (max-height: 400px) {
    .nl-paso1-intro {
        display: none;
    }

    .nl-paso1 {
        gap: 12px;
    }
}

.img-orientativa-nota {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 4px 0 0;
    text-align: center;
}


/* ══════════════════════════════════════════
   ESTILOS DE IMPRESIÓN / GUARDAR COMO PDF
   ══════════════════════════════════════════ */
@media print {

    /* Ocultar todo excepto el formulario de presupuesto */
    body>*:not(.presupuestoDetalle),
    nav,
    header,
    footer,
    aside,
    .ac-tabs,
    .pd-cab-acciones,
    .pd-btn-util,
    .btn-buscar-dir,
    .btn-reset-dir,
    .ac-tab-btn,
    .modal-overlay,
    #modalDireccion,
    #modalPrestatario,
    #modalLinea,
    #modalZona {
        display: none !important;
    }

    /* Mostrar todas las pestañas como bloque al imprimir */
    .ac-tab-panel {
        display: block !important;
        page-break-inside: avoid;
    }

    /* Ocultar botones de acción dentro de las líneas */
    .linea-acciones,
    .btn-linea,
    .btn-add-linea,
    .btn-add-zona {
        display: none !important;
    }

    /* Cabecera limpia */
    .pd-cab {
        border-bottom: 2pt solid #e2001a;
        padding-bottom: 8pt;
        margin-bottom: 10pt;
    }

    .pd-cab-titulo {
        font-size: 18pt;
        color: #e2001a;
    }

    .pd-badge-tipo {
        font-size: 9pt;
    }

    /* Inputs: mostrar como texto */
    input,
    select,
    textarea {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        font-size: 9pt !important;
        color: #000 !important;
    }

    /* Campos del formulario */
    .campo label {
        font-size: 6.5pt;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.4pt;
    }

    /* Fieldsets */
    fieldset {
        border: 0.5pt solid #e2e8f0 !important;
    }

    legend {
        font-size: 7pt !important;
    }

    /* Tabla de líneas */
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 8pt;
    }

    th {
        background-color: #e2001a !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 4pt 5pt;
        font-size: 7pt;
    }

    td {
        padding: 3pt 5pt;
        border-bottom: 0.5pt solid #e2e8f0;
        vertical-align: top;
    }

    /* No romper líneas de tabla entre páginas */
    tr {
        page-break-inside: avoid;
    }

    /* Totales: no partir entre páginas */
    .pd-totales,
    .pd-resumen {
        page-break-inside: avoid;
    }

    /* Márgenes de página */
    @page {
        size: A4;
        margin: 15mm 15mm 20mm 15mm;
    }
}

/* ══════════════════════════════════════════
   LISTA DE PRESUPUESTOS  (.presupuestoLista)
   ══════════════════════════════════════════ */
.presupuestoLista {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    padding: 0 16px 32px;
}

/* ── Cabecera ── */
.prl-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 24px;
    background: #fdfcfb;
    border-bottom: 1px solid #e2e8f0;
    margin: 0 -16px 24px;
}

.prl-header::before {
    content: '';
    display: block;
    width: 4px;
    height: 22px;
    flex-shrink: 0;
    background: #e2001a;
    border-radius: 9999px;
}

.prl-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.prl-badge {
    background: rgba(226, 0, 26, .1);
    color: #e2001a;
    border: 1px solid rgba(226, 0, 26, .3);
    padding: 3px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.prl-distribuidor {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prl-btn-nuevo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: #e2001a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(226, 0, 26, .25);
    transition: opacity 130ms;
}

.prl-btn-nuevo:hover {
    opacity: .88;
    color: #fff;
    text-decoration: none;
}

.prl-btn-nuevo i {
    font-size: 12px;
}

/* ── Panel / tabla ── */
.prl-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
}

.prl-tabla {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
}

.prl-tabla thead th {
    background: #f8fafc;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
    text-align: center;
}

.prl-tabla thead th:last-child {
    border-right: none;
}

.prl-th-num    { width: 80px; }
.prl-th-fecha  { width: 110px; }
.prl-th-center { text-align: center !important; width: 70px; }
.prl-th-right  { text-align: right !important; width: 130px; }
.prl-th-acc    { width: 60px; }

.prl-tabla tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 120ms;
}

.prl-tabla tbody tr:not(.prl-empty-row):hover {
    background: #f8fafc;
    cursor: pointer;
}

.prl-tabla tbody td {
    padding: 10px 14px;
    color: #0f172a;
    font-weight: 600;
    vertical-align: middle;
    border-right: 1px solid #f1f5f9;
    text-align: center;
}

.prl-tabla tbody td:last-child {
    border-right: none;
}

.prl-tabla tbody td.prl-td-mono {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    text-align: right;
}

/* ── Empty state ── */
.prl-empty-row td {
    padding: 0 !important;
    border: none !important;
    text-align: center;
}

.prl-empty {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 64px 24px;
    text-align: center;
}

.prl-empty-icon {
    width: 72px;
    height: 72px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.prl-empty-icon i {
    font-size: 30px;
    color: #94a3b8;
}

.prl-empty-titulo {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
}

.prl-empty-subtitulo {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

/* ── Badge de estado ── */
.prl-th-estado { width: 120px; }

.prl-estado {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.prl-estado--borrador {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.prl-estado--enviado {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.prl-estado--aceptado {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
}

.prl-estado--rechazado {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.nl-estado-spinner {
    font-size: 1.25rem;
    color: var(--color-primary, #555);
}

.modal-spinner-celda {
    text-align: center;
    padding: 2rem 0;
}

.modal-spinner-celda i {
    font-size: 1.5rem;
    color: var(--color-primary, #555);
}
