﻿.ia-btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .ia-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
    }

.ia-page {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8fafc;
    min-height: calc(100vh - 80px);
}

.ia-header-card {
    padding: 1.5rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.ia-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: white;
}

.ia-subtitle {
    color: rgba(255,255,255,0.7);
}

.ia-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1rem;
    align-items: start;
}

.ia-left,
.ia-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ia-card {
    padding: 1.35rem;
    border-radius: 20px;
    background: white;
    border: 1px solid rgba(15,23,42,0.06);
    box-shadow: 0 10px 30px rgba(15,23,42,0.06), 0 2px 6px rgba(15,23,42,0.04);
    transition: all 0.25s ease;
}

    .ia-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 20px 40px rgba(15,23,42,0.10), 0 4px 12px rgba(15,23,42,0.06);
    }

.ia-card-header {
    gap: 0.2rem;
    margin-bottom: 1rem;
}

    .ia-card-header h5 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        color: #0f172a;
    }

    .ia-card-header span {
        color: #64748b;
        font-size: 0.9rem;
    }

.ia-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
}

.ia-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ia-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

    .ia-field label {
        font-size: 0.92rem;
        font-weight: 600;
        color: #334155;
    }

.ia-textarea {
    min-height: 260px;
    resize: vertical;
    font-family: Consolas, monospace;
    font-size: 0.9rem;
}

.ia-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.ia-preview-item {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 14px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ia-preview-label {
    font-size: small;
    color: #64748b;
}

.ia-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ia-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.ia-kpi {
    border-radius: 16px;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

    .ia-kpi.ok {
        border-color: #bbf7d0;
        background: #f0fdf4;
    }

    .ia-kpi.warning {
        border-color: #fde68a;
        background: #fffbeb;
    }

    .ia-kpi.danger {
        border-color: #fecaca;
        background: #fef2f2;
    }

.ia-kpi-label {
    color: #64748b;
    font-size: 0.85rem;
}

.ia-alert {
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    font-weight: 500;
    white-space: pre-line;
}

    .ia-alert.success {
        background: #ecfdf5;
        color: #166534;
        border: 1px solid #bbf7d0;
    }

    .ia-alert.warning {
        background: #fffbeb;
        color: #92400e;
        border: 1px solid #fde68a;
    }

    .ia-alert.error {
        background: #fef2f2;
        color: #991b1b;
        border: 1px solid #fecaca;
    }

.ia-filter-box {
    min-width: 280px;
}

.ia-table-wrap {
    overflow: auto;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.ia-table {
    margin-bottom: 0;
    background: #fff;
}

    .ia-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #f8fafc;
        color: #334155;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        border-bottom: 1px solid #e5e7eb;
    }

    .ia-table tbody tr td {
        vertical-align: middle;
        transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    }

.ia-row-ok {
    background: #f0fdf4;
    border-left: 4px solid #2c9f39;
}

.ia-row-warning {
    background: #fffbeb;
}

.ia-row-danger {
    background: #fef2f2;
}

.ia-row-flash-ok td {
    animation: iaRowFlashOk 0.8s ease;
}

.ia-row-flash-warning td {
    animation: iaRowFlashWarning 0.8s ease;
}

.ia-row-flash-danger td {
    animation: iaRowFlashDanger 0.8s ease;
}

.ia-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

    .ia-badge.ok {
        background: #dcfce7;
        color: #166534;
    }

    .ia-badge.warning {
        background: #fef3c7;
        color: #92400e;
    }

    .ia-badge.danger {
        background: #fee2e2;
        color: #991b1b;
    }

.ia-loading,
.ia-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
}

.ia-scan-shell {
    position: relative;
    border-radius: 18px;
    padding: 1rem;
    border: 2px solid #dbeafe;
    background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
    transition: all 0.18s ease;
    overflow: hidden;
}

    .ia-scan-shell::before {
        content: "";
        position: absolute;
        inset: 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    .ia-scan-shell.idle {
        border-color: #dbeafe;
        box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.04);
    }

    .ia-scan-shell.ok {
        border-color: #22c55e;
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
        animation: iaPulseGreen 0.55s ease;
    }

        .ia-scan-shell.ok::before {
            opacity: 1;
            background: linear-gradient(90deg, rgba(34, 197, 94, 0.00), rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.00));
            animation: iaScanSweep 0.55s ease;
        }

    .ia-scan-shell.duplicate {
        border-color: #f59e0b;
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
        animation: iaPulseYellow 0.55s ease;
    }

        .ia-scan-shell.duplicate::before {
            opacity: 1;
            background: linear-gradient(90deg, rgba(245, 158, 11, 0.00), rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.00));
            animation: iaScanSweep 0.55s ease;
        }

    .ia-scan-shell.error {
        border-color: #ef4444;
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
        animation: iaShake 0.35s ease;
    }

        .ia-scan-shell.error::before {
            opacity: 1;
            background: linear-gradient(90deg, rgba(239, 68, 68, 0.00), rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0.00));
            animation: iaScanSweep 0.45s ease;
        }

.ia-scan-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ia-scan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

    .ia-scan-badge.ok {
        background: #dcfce7;
        color: #166534;
        border-color: #86efac;
    }

    .ia-scan-badge.duplicate {
        background: #fef3c7;
        color: #92400e;
        border-color: #fcd34d;
    }

    .ia-scan-badge.error {
        background: #fee2e2;
        color: #991b1b;
        border-color: #fca5a5;
    }

    .ia-scan-badge.idle {
        background: #eff6ff;
        color: #1d4ed8;
        border-color: #bfdbfe;
    }

.ia-scan-input {
    height: 52px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: 14px;
    border: 2px solid #cbd5e1;
    box-shadow: none !important;
    transition: all 0.18s ease;
}

.ia-scan-shell.ok .ia-scan-input {
    border-color: #22c55e;
    background: #f0fdf4;
}

.ia-scan-shell.duplicate .ia-scan-input {
    border-color: #f59e0b;
    background: #fffbeb;
}

.ia-scan-shell.error .ia-scan-input {
    border-color: #ef4444;
    background: #fef2f2;
}

.ia-scan-helper {
    margin-top: 0.65rem;
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ia-scan-log {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-right: 4px;
    scroll-behavior: smooth;
}

.ia-scan-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    animation: fadeIn 0.2s ease-in-out;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    border: 1px solid transparent;
}

    .ia-scan-item.ok {
        background: #ecfdf5;
        border-color: #bbf7d0;
    }

    .ia-scan-item.duplicate {
        background: #fffbeb;
        border-color: #fde68a;
    }

    .ia-scan-item.error {
        background: #fef2f2;
        border-color: #fecaca;
    }

    .ia-scan-item.latest {
        transform: scale(1.01);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
        animation: iaLatestPop 0.5s ease;
    }

        .ia-scan-item.latest.ok {
            box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
        }

        .ia-scan-item.latest.duplicate {
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
        }

        .ia-scan-item.latest.error {
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
        }

.ia-scan-icon {
    font-size: 1rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: rgba(255,255,255,0.65);
}

.ia-scan-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

    .ia-scan-content strong {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ia-scan-content span {
        font-size: 0.75rem;
        color: #64748b;
    }

.ia-scan-time {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

@@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@@keyframes iaPulseGreen {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.01);
    }

    100% {
        transform: scale(1);
    }
}

@@keyframes iaPulseYellow {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.01);
    }

    100% {
        transform: scale(1);
    }
}

@@keyframes iaShake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
    }
}

@@keyframes iaScanSweep {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@@keyframes iaLatestPop {
    0% {
        transform: scale(0.98);
        opacity: 0.75;
    }

    50% {
        transform: scale(1.015);
        opacity: 1;
    }

    100% {
        transform: scale(1.01);
        opacity: 1;
    }
}

@@keyframes iaRowFlashOk {
    0% {
        background-color: rgba(34, 197, 94, 0.28);
    }

    100% {
        background-color: transparent;
    }
}

@@keyframes iaRowFlashWarning {
    0% {
        background-color: rgba(245, 158, 11, 0.28);
    }

    100% {
        background-color: transparent;
    }
}

@@keyframes iaRowFlashDanger {
    0% {
        background-color: rgba(239, 68, 68, 0.24);
    }

    100% {
        background-color: transparent;
    }
}

@@media (max-width: 1100px) {
    .ia-grid {
        grid-template-columns: 1fr;
    }

    .ia-filter-box {
        min-width: unset;
        width: 100%;
    }

    .ia-card-header-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.ia-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(6px);
}

.ia-modal {
    width: 95%;
    max-width: 1600px;
    max-height: 90vh;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    animation: iaModalIn 0.25s ease;
}

.ia-modal-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.ia-modal-body {
    padding: 1rem;
    overflow: auto;
    flex: 1;
}

.ia-scroll-x {
    overflow-x: auto;
}

.ia-days-container {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.ia-day-column {
    min-width: 260px;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.ia-day-header {
    position: sticky;
    top: 0;
    background: #0f172a;
    color: white;
    padding: 0.6rem;
    font-weight: 700;
    text-align: center;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.ia-day-table {
    display: flex;
    flex-direction: column;
}

.ia-day-row {
    display: grid;
    grid-template-columns: 1fr 1fr 60px;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

    .ia-day-row:nth-child(even) {
        background: #f8fafc;
    }

.ia-day-head {
    font-weight: 700;
    background: #e2e8f0;
    position: sticky;
    top: 40px;
    z-index: 1;
}

.ia-days-container {
    display: flex;
    gap: 1rem;
}

.ia-day-column {
    min-width: 260px;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
}

.ia-day-header {
    position: sticky;
    top: 0;
    background: #0f172a;
    color: white;
    padding: 0.6rem;
    font-weight: 700;
    text-align: center;
}

.ia-day-row {
    display: grid;
    grid-template-columns: 1fr 1fr 60px;
    padding: 0.45rem;
    border-bottom: 1px solid #f1f5f9;
}

.ia-day-head {
    background: #e2e8f0;
    font-weight: 700;
}

.ia-scroll-x {
    overflow-x: auto;
}

.ia-kpi {
    border-radius: 18px;
    padding: 1.2rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid rgba(15,23,42,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
    transition: all 0.2s ease;
}

    .ia-kpi strong {
        font-size: 1.4rem;
    }

.ia-modal-backdrop {
    backdrop-filter: blur(6px);
    background: rgba(15,23,42,0.6);
}

.ia-modal {
    width: 95%;
    max-width: 1600px;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    animation: iaModalIn 0.25s ease;
}

@@keyframes iaModalIn {
    from {
        transform: scale(0.96) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.ia-modal-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
    font-size: 1.1rem;
}

.ia-day-column {
    min-width: 280px;
    max-height: 75vh;
    overflow-y: auto;
    border-radius: 18px;
    background: white;
    border: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 10px 25px rgba(15,23,42,0.08);
    transition: all 0.2s ease;
}

    .ia-day-column:hover {
        transform: translateY(-2px);
    }

.ia-day-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 0.75rem;
    font-weight: 700;
    text-align: center;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    letter-spacing: 0.05em;
}

.ia-day-row {
    display: grid;
    grid-template-columns: 1fr 1fr 60px;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

    .ia-day-row:hover {
        background: #eff6ff;
        transform: scale(1.01);
    }

.ia-product-row {
    display: grid;
    grid-template-columns: 70px 1fr 70px;
    align-items: center;
    gap: 0.5rem;
}

.ia-cell-position {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.85rem;
}

/* PRODUCTO */
.ia-product-cell {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.ia-product-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ia-product-img img {
        width: 90%;
        object-fit: contain;
    }

/* INFO */
.ia-product-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.ia-product-code {
    font-weight: 700;
    font-size: 0.85rem;
    color: #0f172a;
}

.ia-product-name {
    font-size: 0.7rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* CANTIDAD */
.ia-cell-qty {
    text-align: right;
    font-weight: 800;
    font-size: 0.9rem;
    color: #1d4ed8;
}

.ia-product-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* IMG */
.ia-product-main-img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ia-product-main-img img {
        width: 90%;
        object-fit: contain;
    }

/* INFO */
.ia-product-main-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.ia-product-main-code {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
}

.ia-product-main-name {
    font-size: x-small;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ia-table tbody tr:hover {
    background: #eff6ff;
    transform: scale(1.002);
}

.ia-product-main {
    padding: 0.3rem 0.5rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

    .ia-product-main:hover {
        background: #f8fafc;
    }

/* ================= MODAL TRANSFER ================= */

.ia-transfer-modal {
    max-width: 600px;
    border-radius: 22px;
}

/* HEADER */
.ia-transfer-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
}

    .ia-transfer-header h5 {
        margin: 0;
        font-weight: 700;
    }

    .ia-transfer-header span {
        font-size: 0.8rem;
        opacity: 0.7;
    }

/* BOTÓN CERRAR */
.ia-close-btn {
    border: none;
    background: transparent;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

/* CARDS */
.ia-transfer-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.ia-transfer-card {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
}

    .ia-transfer-card.demo {
        background: #fef2f2;
        border-color: #fecaca;
    }

    .ia-transfer-card span {
        font-size: 0.75rem;
        color: #64748b;
    }

    .ia-transfer-card strong {
        display: block;
        font-size: 1rem;
        margin-top: 0.2rem;
    }

/* FLECHA */
.ia-transfer-arrow {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}

/* WARNING */
.ia-transfer-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #92400e;
}

/* ACTIONS */
.ia-transfer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

/* BOTONES */
.ia-btn-secondary {
    background: #e2e8f0;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-weight: 600;
}

.ia-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .ia-btn-danger:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
    }

.ia-btn-transfer {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .ia-btn-transfer:hover {
        background: #2563eb;
        color: white;
    }

.ia-transfer-textarea {
    min-height: 140px;
    font-family: Consolas, monospace;
    font-size: 0.85rem;
}

.ia-transfer-preview {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
}

.ia-serial-item {
    font-family: Consolas;
    font-size: 0.8rem;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
}

    .ia-serial-item.ok {
        background: #dcfce7;
        color: #166534;
    }

    .ia-serial-item.error {
        background: #fee2e2;
        color: #991b1b;
    }

    .ia-serial-item.warning {
        background: #fef3c7;
        color: #92400e;
    }

/* ================= POSITIONING + RACK ================= */
.ia-destination-toggle {
    gap: 1rem;
    flex-wrap: wrap;
}

.ia-radio-card {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: linear-gradient(180deg,#fff,#f8fafc);
    font-weight: 700;
}

    .ia-radio-card input {
        margin: 0;
    }

.ia-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: #334155;
}

.ia-position-shell {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(180deg,#fff,#f8fafc);
}

    .ia-position-shell select {
        width: 100%;
        border-radius: 14px;
        border: 1px solid var(--ia-border-strong);
        padding: 0.8rem 0.9rem;
    }

.ia-rack-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 1rem;
}

.rack-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rack-grid {
    display: grid;
    grid-template-columns: repeat(10,minmax(0,1fr));
    gap: 10px;
}

.rack-position-panel {
    background: linear-gradient(180deg,#fff,#f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1rem;
}

.rack-position-list {
    max-height: 430px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.rack-position-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    cursor: grab;
}

    .rack-position-item:active {
        cursor: grabbing;
    }

    .rack-position-item strong {
        font-family: Consolas, monospace;
        font-size: .86rem;
    }

    .rack-position-item span {
        font-size: .75rem;
        color: #64748b;
    }

    .rack-position-item input {
        margin: 0;
    }

#drag-animation-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
}

.serial-fly {
    position: fixed;
    background: #2563eb;
    color: white;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
    transition: all .5s cubic-bezier(.22,.61,.36,1);
    opacity: .95;
}

@@keyframes iaRackPulse {
    from {
        transform: scale(1.05);
    }

    to {
        transform: scale(1.1);
    }
}

@@media (max-width: 1100px) {
    .ia-rack-layout {
        grid-template-columns: 1fr;
    }

    .rack-grid {
        grid-template-columns: repeat(5,minmax(0,1fr));
    }
}

.serial-fly {
    position: fixed;
    pointer-events: none;
    animation: flyPulse 0.5s ease;
}

@@keyframes flyPulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0.7);
    }
}

.rack-cell {
    position: relative;
    height: 76px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    transition: all .18s ease;
    user-select: none;
}

    .rack-cell small {
        font-size: 0.72rem;
        font-weight: 800;
        opacity: .9;
    }

    .rack-cell.empty {
        background: #e2e8f0;
        color: #334155;
    }

    .rack-cell.occupied {
        background: #22c55e;
        color: white;
        border-color: #16a34a;
    }

    .rack-cell.selected {
        background: #004df738;
        color: white;
        border-color: #1d4ed8;
        box-shadow: 0 0 0 4px rgba(37,99,235,.18);
    }

    .rack-cell.drag-source {
        background: #1d4ed8 !important;
        color: white;
        box-shadow: 0 0 0 4px rgba(37,99,235,.25);
    }

    .rack-cell.drag-over {
        .rack-cell background: #22c55e !important;
        color: white;
        border: 2px dashed #16a34a;
        animation: iaRackPulse .6s infinite alternate;
    }

        .rack-cell.drag-over::after {
            content: "⬇";
            position: absolute;
            top: 6px;
            right: 8px;
            font-size: 1rem;
        }

@@keyframes iaRackPulse {
    from {
        transform: scale(1.05);
    }

    to {
        transform: scale(1.1);
    }
}

.rack-cell.drag-over {
    transform: scale(1.12);
    box-shadow: 0 0 20px rgba(34,197,94,.6);
}

.rack-cell.drag-source {
    transform: scale(1.05);
    opacity: 0.8;
}

.rack-cell.drag-source {
    transform: scale(1.05);
    opacity: 0.8;
}

/* ================= HEATMAP ================= */

.rack-cell.empty {
    background: #e2e8f0;
    color: #334155;
}

.rack-cell.mid {
    background: #facc15;
    color: #713f12;
}

.rack-cell.full {
    background: #ef4444;
    color: white;
}

/* EFECTO VISUAL */
.rack-cell.full {
    box-shadow: inset 0 0 12px rgba(0,0,0,0.2);
}

.rack-cell.mid {
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

/* ================= KPIs RACK ================= */

.ia-kpis-rack {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ia-kpi-rack {
    padding: 0.8rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

    .ia-kpi-rack strong {
        font-size: 1.2rem;
    }

    .ia-kpi-rack.ok {
        background: #ecfdf5;
        color: #166534;
    }

    .ia-kpi-rack.warning {
        background: #fffbeb;
        color: #92400e;
    }

    .ia-kpi-rack.danger {
        background: #fef2f2;
        color: #991b1b;
    }

.rack-toolbar-subtitle {
    font-size: .8rem;
    color: white;
}

.rack-cell-code {
    font-size: .78rem;
    font-weight: 800;
    text-align: center;
}

.rack-cell-qty {
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

    .rack-cell-qty span {
        font-size: .65rem;
        font-weight: 700;
        opacity: .85;
    }

.rack-cell-products {
    margin-top: .35rem;
    display: flex;
    gap: .25rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.rack-cell-product {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255,255,255,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .rack-cell-product img {
        width: 90%;
        height: 90%;
        object-fit: contain;
    }

    .rack-cell-product small {
        position: absolute;
        right: 1px;
        bottom: 0;
        font-size: .52rem;
        font-weight: 800;
        background: rgba(15,23,42,.75);
        color: white;
        border-radius: 999px;
        padding: 0 .2rem;
        line-height: 1.1;
    }

.rack-cell-more {
    font-size: .68rem;
    font-weight: 800;
    background: rgba(255,255,255,.85);
    color: #0f172a;
    border-radius: 999px;
    padding: .1rem .35rem;
}

.rack-cell-empty-label {
    margin-top: .25rem;
    font-size: .68rem;
    font-weight: 700;
    opacity: .85;
}

.rack-product-summary-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    max-height: 430px;
    overflow: auto;
}

.rack-product-summary-item {
    display: grid;
    grid-template-columns: 56px 1fr 64px;
    gap: .75rem;
    align-items: center;
    padding: .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.rack-product-summary-image {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .rack-product-summary-image img {
        width: 90%;
        height: 90%;
        object-fit: contain;
    }

.rack-product-summary-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .12rem;
}

.rack-product-summary-code {
    font-size: .88rem;
    font-weight: 800;
    color: #0f172a;
}

.rack-product-summary-name {
    font-size: .74rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rack-product-summary-qty {
    justify-self: end;
    min-width: 52px;
    text-align: center;
    padding: .45rem .7rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 800;
}

.ia-position-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rack-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    border-radius: 18px;
    padding: 1rem 1.2rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.rack-toolbar-subtitle {
    font-size: .9rem;
    opacity: .82;
    margin-top: .2rem;
    color: white;
}

.rack-toolbar-kpis {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rack-mini-kpi {
    min-width: 88px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    padding: .65rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

    .rack-mini-kpi span {
        font-size: .72rem;
        opacity: .8;
    }

    .rack-mini-kpi strong {
        font-size: 1rem;
        line-height: 1;
    }

    .rack-mini-kpi.success {
        box-shadow: inset 0 0 0 1px rgba(34,197,94,.28);
    }

    .rack-mini-kpi.warning {
        box-shadow: inset 0 0 0 1px rgba(245,158,11,.28);
    }

    .rack-mini-kpi.danger {
        box-shadow: inset 0 0 0 1px rgba(239,68,68,.28);
    }

.rack-group {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.rack-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: .85rem 1rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.rack-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.rack-group-meta {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    color: #64748b;
    font-size: .85rem;
}

.rack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.rack-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    min-height: 180px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 0.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    cursor: pointer;
    overflow: hidden;
}

    .rack-cell::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 4px;
        background: #cbd5e1;
    }

    .rack-cell:hover {
        transform: translateY(-3px);
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
    }

    .rack-cell.empty::before {
        background: linear-gradient(90deg, #94a3b8, #cbd5e1);
    }

    .rack-cell.low::before {
        background: linear-gradient(90deg, #22c55e, #86efac);
    }

    .rack-cell.mid::before {
        background: linear-gradient(90deg, #f59e0b, #fcd34d);
    }

    .rack-cell.full::before {
        background: linear-gradient(90deg, #ef4444, #f87171);
    }

    .rack-cell.selected {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), 0 16px 34px rgba(15, 23, 42, 0.12);
    }

    .rack-cell.drag-source {
        opacity: .72;
        transform: scale(.985);
    }

    .rack-cell.drag-over {
        border-color: #0ea5e9;
        box-shadow: 0 0 0 4px rgba(14,165,233,.18), 0 16px 34px rgba(14,165,233,.10);
    }

.rack-cell-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .6rem;
}

.rack-cell-code {
    font-size: .95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    word-break: break-word;
}

.rack-cell-badge {
    font-size: .72rem;
    font-weight: 700;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: .28rem .55rem;
    white-space: nowrap;
}

.rack-cell-middle {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.rack-cell-qty {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    color: #0f172a;
}

    .rack-cell-qty strong {
        font-size: 1.5rem;
        line-height: 1;
    }

    .rack-cell-qty span {
        color: #64748b;
        font-size: .85rem;
    }

.rack-cell-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.rack-cell-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width .25s ease;
}

.rack-cell-products {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: auto;
}

.rack-cell-product {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: .45rem .55rem;
}

    .rack-cell-product img {
        width: 34px;
        height: 34px;
        object-fit: contain;
        border-radius: 8px;
        background: #fff;
        border: 1px solid #e5e7eb;
        padding: 2px;
        flex-shrink: 0;
    }

.rack-cell-product-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .rack-cell-product-meta .code {
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rack-cell-product-meta .qty {
        color: #64748b;
    }

.rack-cell-more {
    font-size: .8rem;
    color: #475569;
    background: #eef2ff;
    border: 1px dashed #c7d2fe;
    border-radius: 12px;
    padding: .5rem .65rem;
    text-align: center;
    font-weight: 600;
}

.rack-cell-empty-label {
    margin-top: auto;
    display: inline-flex;
    align-self: flex-start;
    font-size: .82rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 999px;
    padding: .45rem .7rem;
}

.ia-empty {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    color: #64748b;
}

@media (max-width: 992px) {
    .rack-toolbar {
        flex-direction: column;
    }

    .rack-toolbar-kpis {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .rack-grid {
        grid-template-columns: 1fr;
    }

    .rack-cell {
        min-height: 165px;
    }
}

.pps-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.pps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.pps-title-wrap {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.pps-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.pps-subtitle {
    color: #64748b;
    font-size: .88rem;
}

.pps-refresh-btn {
    border: 0;
    border-radius: 12px;
    padding: .7rem 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

    .pps-refresh-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
    }

    .pps-refresh-btn:disabled {
        opacity: .7;
        cursor: not-allowed;
    }

.pps-loading {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .9rem;
    color: #475569;
}

.pps-loading-spinner {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    animation: pps-spin 1s linear infinite;
}

@keyframes pps-spin {
    to {
        transform: rotate(360deg);
    }
}

.pps-loading-text {
    font-weight: 600;
}

.pps-empty,
.pps-empty-position {
    min-height: 200px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    text-align: center;
    padding: 1.5rem;
}

.pps-empty-icon,
.pps-empty-position-icon {
    font-size: 2rem;
}

.pps-empty-title,
.pps-empty-position-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.pps-empty-text,
.pps-empty-position-text {
    max-width: 500px;
    color: #64748b;
    line-height: 1.45;
}

.pps-position-hero {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem;
    border-radius: 20px;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, #0f172a, #1e3a8a, #2563eb);
    color: #ffffff;
    box-shadow: 0 16px 35px rgba(37, 99, 235, 0.18);
}

.pps-position-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .4rem;
}

.pps-position-badge {
    width: fit-content;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.18);
    padding: .32rem .68rem;
    font-size: .75rem;
    font-weight: 700;
}

.pps-position-code {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: .03em;
}

.pps-position-meta {
    display: flex;
    gap: .9rem;
    flex-wrap: wrap;
    font-size: .9rem;
    opacity: .92;
}

.pps-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: .75rem;
    min-width: 320px;
}

.pps-kpi {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 16px;
    padding: .8rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

    .pps-kpi span {
        font-size: .75rem;
        opacity: .86;
    }

    .pps-kpi strong {
        font-size: 1.1rem;
        line-height: 1.1;
    }

.pps-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pps-search {
    width: min(100%, 360px);
    min-width: 240px;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    padding: .8rem .95rem;
    outline: none;
    background: #f8fafc;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

    .pps-search:focus {
        background: #ffffff;
        border-color: #93c5fd;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    }

.pps-total-label {
    color: #64748b;
    font-size: .9rem;
}

.pps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.pps-card {
    display: flex;
    gap: .85rem;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: .85rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    .pps-card:hover {
        transform: translateY(-2px);
        border-color: #cbd5e1;
        box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
    }

.pps-card-image-wrap {
    width: 72px;
    min-width: 72px;
    height: 72px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.pps-card-image {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.pps-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.pps-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}

.pps-item-code {
    font-size: .93rem;
    font-weight: 800;
    color: #0f172a;
    word-break: break-word;
}

.pps-qty-badge {
    white-space: nowrap;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: .32rem .58rem;
    font-size: .75rem;
    font-weight: 800;
}

.pps-item-name {
    color: #475569;
    line-height: 1.4;
    font-size: x-small;
    min-height: 40px;
}

.pps-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: .75rem;
}

.pps-card-stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

    .pps-card-stat span {
        font-size: .74rem;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .pps-card-stat strong {
        font-size: 1rem;
        color: #0f172a;
    }

@media (max-width: 992px) {
    .pps-position-hero {
        flex-direction: column;
    }

    .pps-kpis {
        min-width: 100%;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {
    .pps-header {
        flex-direction: column;
        align-items: stretch;
    }

    .pps-refresh-btn {
        width: 100%;
    }

    .pps-kpis {
        grid-template-columns: 1fr;
    }

    .pps-grid {
        grid-template-columns: 1fr;
    }

    .pps-card {
        flex-direction: column;
    }

    .pps-card-image-wrap {
        width: 100%;
        height: 120px;
    }

    .pps-card-image {
        width: 80px;
        height: 80px;
    }
}

.ia-tabs {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.ia-tabs-header {
    display: flex;
    gap: .5rem;
}

    .ia-tabs-header button {
        border: none;
        padding: .6rem 1rem;
        border-radius: 12px;
        font-weight: 700;
        background: #f1f5f9;
        color: #334155;
        cursor: pointer;
        transition: all .2s ease;
    }

        .ia-tabs-header button.active {
            background: linear-gradient(135deg, #2563eb, #1e3a8a);
            color: #fff;
            box-shadow: 0 6px 20px rgba(37,99,235,.3);
        }

.ia-tabs-body {
    display: flex;
    flex-direction: column;
}

.ia-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.ia-modal {
    width: min(1100px, 95%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 25px 60px rgba(0,0,0,.25);
}

.ia-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

    .ia-modal-header button {
        border: none;
        background: transparent;
        font-size: 1.2rem;
        cursor: pointer;
    }

.ok {
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
}

.missing {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
}

.over {
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}

.ia-product-main.pro {
    align-items: center;
}

.ia-product-main-img.big {
    width: 64px;
    height: 64px;
}

.ia-product-mini-stats {
    display: flex;
    gap: .6rem;
    font-size: .7rem;
    color: #64748b;
}

.ia-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

    .ia-metric span {
        font-size: .65rem;
        color: #94a3b8;
        text-transform: uppercase;
    }

    .ia-metric strong {
        font-size: 1.05rem;
        font-weight: 800;
    }

    .ia-metric.container strong {
        color: #f59e0b;
    }

    .ia-metric.positioned strong {
        color: #22c55e;
    }

.ia-diff {
    font-size: 1.2rem;
    font-weight: 900;
    text-align: center;
    border-radius: 10px;
    padding: .35rem .5rem;
    min-width: 70px;
}

    .ia-diff.ok {
        background: #dcfce7;
        color: #166534;
        width:50px
    }

    .ia-diff.missing {
        background: #fee2e2;
        color: #991b1b;
        width: 50px
    }

    .ia-diff.over {
        background: #fef3c7;
        color: #92400e;
        width: 50px
    }

.ia-table tbody tr:hover {
    background: #eff6ff;
    transform: scale(1.01);
    box-shadow: 0 10px 20px rgba(37,99,235,.08);
}

.ia-audit-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.ia-audit-kpi {
    border-radius: 16px;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    transition: all .2s ease;
}

    .ia-audit-kpi strong {
        font-size: 1.3rem;
    }

    .ia-audit-kpi.ok {
        background: #ecfdf5;
        color: #166534;
    }

    .ia-audit-kpi.warning {
        background: #fffbeb;
        color: #92400e;
    }

    .ia-audit-kpi.danger {
        background: #fef2f2;
        color: #991b1b;
    }

    .ia-audit-kpi.info {
        background: #eff6ff;
        color: #1d4ed8;
    }

.ia-row-warning {
    border-left: 4px solid #f59e0b;
}

.ia-row-danger {
    border-left: 4px solid #ef4444;
}

.rack-box-info {
    font-size: .75rem;
    font-weight: 700;
    margin-top: 4px;
    display: flex;
    gap: .4rem;
}

    .rack-box-info .loose {
        color: #f59e0b;
    }

    .rack-box-info span text {
        color: #f59e0b;
        font-weight: 700;
    }

.ia-qty-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ia-box-info {
    font-size: .75rem;
    font-weight: 700;
    color: #475569;
}

    .ia-box-info text {
        color: #f59e0b;
        font-weight: 800;
    }

.rack-search {
    min-width: 260px;
}

    .rack-search input {
        border-radius: 12px;
        padding: 0.6rem 0.8rem;
    }
.rack-cell-body {
    display: flex;
    flex-direction: column;
    height: calc(100% - 28px);
    width:100%;
}

.rack-products-scroll {
    overflow-y: auto;
    max-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.rack-product-item {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px;
    border-radius: 8px;
    background: #f8fafc;
}

    .rack-product-item img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }

.rack-product-info {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    line-height: 1.1;
}

    .rack-product-info .code {
        font-weight: 700;
        color: #1e293b;
    }

    .rack-product-info .qty {
        color: #475569;
    }

    .rack-product-info .boxes {
        font-weight: 700;
        color: #334155;
    }

        .rack-product-info .boxes text {
            color: #f59e0b;
        }

/* Scroll bonito */
.rack-products-scroll::-webkit-scrollbar {
    width: 6px;
}

.rack-products-scroll::-webkit-scrollbar-thumb {
    background: #cbd5f5;
    border-radius: 10px;
}

.pps-box-info {
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #334155;
    display: flex;
    gap: 6px;
    align-items: center;
}

    .pps-box-info .loose {
        color: #f59e0b;
        font-weight: 900;
    }

.pps-box-missing {
    margin-top: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ef4444;
}