/* ══════════════════════════════════════
   Números con Nombres Dentro — CSS
   ══════════════════════════════════════ */

/* ── Config panel ── */
.nn-config {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.nn-config-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.nn-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
}
.nn-field label {
    font-size: 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nn-field select,
.nn-field input[type="range"],
.nn-field input[type="color"] {
    height: 40px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
    background: #fff;
}
.nn-field input[type="color"] {
    padding: 4px;
    cursor: pointer;
    width: 60px;
}
.nn-field input[type="range"] {
    padding: 0;
    border: none;
    background: transparent;
    accent-color: #e60d82;
}
.nn-size-value {
    font-weight: 700;
    color: #e60d82;
    font-size: 13px;
}

/* ── Font preview ── */
.nn-font-preview {
    text-align: center;
    padding: 16px;
    margin-bottom: 20px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid #eee;
}
.nn-font-preview span {
    font-size: 42px;
    letter-spacing: 2px;
    transition: font-family 0.2s;
}

/* ── Mockup badge ── */
.nn-mockup-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}
.nn-mockup-talla {
    background: #e60d82;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 6px;
}
.nn-mockup-dims {
    font-size: 14px;
    color: #888;
}

/* ── Visor (row preview) ── */
.nn-viewer {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 80px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.nn-viewer__empty {
    text-align: center;
    color: #666;
    font-size: 13px;
    padding: 12px 0;
}
.nn-viewer__empty svg {
    opacity: 0.4;
    margin-bottom: 4px;
}
.nn-viewer__empty p {
    margin-top: 6px;
    color: #777;
    font-size: 13px;
}
.nn-viewer__content {
    width: 100%;
    position: relative;
}
.nn-viewer__close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #666;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.nn-viewer__close:hover {
    background: #e60d82;
    color: #fff;
    border-color: #e60d82;
}
.nn-viewer__label {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e60d82;
    margin-bottom: 12px;
}
.nn-viewer__pieces {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.nn-viewer__piece-wrap {
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #e8e8e8 0% 50%) 50% / 16px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    transition: box-shadow .15s, transform .15s;
}
.nn-viewer__piece-wrap[data-zoomable="1"]:hover {
    box-shadow: 0 4px 14px rgba(230, 13, 130, 0.18);
    transform: translateY(-1px);
}
.nn-viewer__zoom-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e5e7eb;
    color: #e60d82;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}
.nn-viewer__piece-wrap:hover .nn-viewer__zoom-hint { opacity: 1; }

/* ═══ LUPA MODAL ═══ */
.nn-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nn-zoom-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10,10,14,0.85);
    backdrop-filter: blur(3px);
}
.nn-zoom-modal__inner {
    position: relative;
    width: min(95vw, 1400px);
    height: min(92vh, 900px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.nn-zoom-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    gap: 12px;
}
.nn-zoom-modal__label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nn-zoom-modal__controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nn-zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .12s;
}
.nn-zoom-btn:hover { background: #f1f1f1; }
.nn-zoom-btn--close { background: #e60d82; color: #fff; border-color: #e60d82; }
.nn-zoom-btn--close:hover { background: #b30a66; }
.nn-zoom-modal__scale {
    min-width: 52px;
    text-align: center;
    font-size: 12px;
    color: #666;
    font-variant-numeric: tabular-nums;
}
.nn-zoom-modal__stage {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #e8e8e8 0% 50%) 50% / 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}
.nn-zoom-modal__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    cursor: grab;
    will-change: transform;
}
.nn-zoom-modal__hint {
    padding: 8px 16px;
    font-size: 11px;
    color: #888;
    background: #fafafa;
    border-top: 1px solid #eee;
    text-align: center;
}
.nn-viewer__piece-wrap img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}
.nn-viewer__piece-info {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}
.nn-viewer__piece-type {
    color: #e60d82;
    font-weight: 700;
    margin-right: 8px;
}

/* Active row highlight */
.nn-table tbody tr.nn-row-active {
    background: #fff5f0 !important;
    outline: 2px solid #e60d82;
    outline-offset: -2px;
}
.nn-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

/* ── Table ── */
.nn-table-wrap {
    margin-bottom: 24px;
    overflow-x: auto;
}
.nn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.nn-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    padding: 8px 6px;
    border-bottom: 2px solid #e60d82;
    white-space: nowrap;
}
.nn-table tbody td {
    padding: 6px;
    vertical-align: top;
}
.nn-table tbody tr:hover {
    background: #fafafa;
}
.nn-col-num {
    width: 36px;
    text-align: center;
    font-weight: 700;
    color: #bbb;
}
.nn-col-talla { width: 70px; }
.nn-col-copies { width: 90px; }
.nn-col-del { width: 36px; }

.nn-input {
    width: 100%;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    background: #fafafa;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.nn-input:focus {
    border-color: #e60d82;
    outline: none;
    background: #fff;
}
.nn-input--number {
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    width: 70px;
}
.nn-input--names {
    font-size: 12px;
    min-width: 200px;
    resize: vertical;
}

.nn-talla {
    width: 100%;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 13px;
    background: #fafafa;
}

.nn-copies-control {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}
.nn-copies-control button {
    width: 30px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: #555;
    transition: background 0.15s;
}
.nn-copies-control button:hover {
    background: #eee;
}
.nn-copies-control span {
    width: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}

.nn-del {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}
.nn-del:hover {
    background: #fee;
    color: #e53e3e;
}

/* ── Table toolbar ── */
.nn-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}
.nn-csv-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.nn-csv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
}
.nn-csv-btn:hover {
    border-color: #e60d82;
    color: #e60d82;
}
.nn-csv-dropzone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px dashed #ccc;
    border-radius: 8px;
    background: #fafafa;
    font-size: 13px;
    cursor: pointer;
    color: #888;
    transition: all 0.15s;
}
.nn-csv-dropzone:hover,
.nn-csv-dropzone.drag-over {
    border-color: #e60d82;
    background: #fff5f0;
    color: #e60d82;
}
.nn-csv-dropzone small {
    font-size: 11px;
    opacity: 0.7;
}
.nn-csv-errors {
    background: #fee;
    color: #c53030;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 8px;
}

/* ── Preview grid ── */
.nn-preview {
    margin-bottom: 24px;
}
.nn-preview h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}
.nn-preview-hint {
    color: #aaa;
    font-size: 14px;
    text-align: center;
    padding: 24px;
}
.nn-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.nn-row-sep {
    grid-column: 1 / -1;
    height: 1px;
    background: #eee;
    margin: 8px 0;
}
.nn-row-header {
    grid-column: 1 / -1;
    font-weight: 700;
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0;
}
.nn-piece {
    background: #fff;
    border: 1.5px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.nn-piece:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.nn-piece__img {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.nn-piece__img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.nn-piece__info {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
}
.nn-piece__type {
    font-weight: 700;
    color: #e60d82;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nn-piece__dims {
    color: #999;
}

/* ── Pliego ── */
.nn-pliego-section {
    margin-bottom: 24px;
}
.nn-pliego-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.nn-pliego-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.nn-pliego-badge {
    background: #e60d82;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
}
.nn-pliego-stat {
    font-size: 13px;
    color: #888;
}
.nn-pliego-scroll {
    overflow-x: auto;
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
}
.nn-pliego-canvas {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    min-height: 100px;
}
.nn-pliego-canvas .pliego-piece {
    position: absolute;
    border: 1px solid rgba(230, 13, 130,0.2);
    border-radius: 2px;
    background-position: center;
}
.nn-pliego-canvas .pliego-meter-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed #e60d82;
    opacity: 0.4;
}
.nn-pliego-canvas .pliego-meter-label {
    position: absolute;
    right: 4px;
    font-size: 10px;
    color: #e60d82;
    font-weight: 700;
}
.nn-pliego-info-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #555;
}
.nn-pliego-price {
    font-weight: 700;
    color: #e60d82;
    font-size: 16px;
}

/* ── Summary + Actions ── */
.nn-summary {
    text-align: center;
    font-size: 15px;
    color: #555;
    margin-bottom: 16px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .nn-config-row {
        flex-direction: column;
    }
    .nn-field {
        width: 100%;
    }
    .nn-input--names {
        min-width: 0;
    }
    .nn-table {
        font-size: 13px;
    }
    .nn-csv-actions {
        flex-direction: column;
        margin-left: 0;
        width: 100%;
    }
    .nn-csv-dropzone,
    .nn-csv-btn {
        width: 100%;
        justify-content: center;
    }
    .nn-preview-grid {
        grid-template-columns: 1fr;
    }
}
