#integration-view .integration-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
    gap: 20px;
    align-items: start;
}

#integration-view > div.integration-grid > div.import-card {
    min-width: 340px;
}

#integration-view .integration-grid > div:nth-child(1) {
    grid-column: 1;
}

#integration-view .integration-grid > div:nth-child(2) {
    grid-column: 2;
}

#integration-view .import-zone-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    justify-items: start;
}

@media (max-width: 1280px) {
    #integration-view .import-zone-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-items: stretch;
    }

    #integration-view .import-zone-grid .import-card.compact-card {
        width: 100%;
    }
}

@media (max-width: 1100px) {
    #integration-view .integration-grid {
        grid-template-columns: 1fr;
    }

    #integration-view .integration-grid > div:nth-child(2) {
        grid-column: 1;
    }
}

.import-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: center;
}


.import-card.compact-card {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    text-align: left;
    width: fit-content;
    align-self: start;
    justify-self: start;
}

.import-card.compact-card h4,
.import-card.compact-card .desc {
    margin: 0;
}

.import-card.compact-card h4 {
    font-size: 0.95rem;
    line-height: 1.1;
    white-space: nowrap;
}

.import-card.compact-card .desc {
    font-size: 0.8rem;
    line-height: 1.2;
    max-width: 220px;
    word-break: break-word;
}

.import-card.compact-card .drop-zone.compact {
    width: 220px;
    min-width: 220px;
}

.dispatch-manual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.dispatch-manual-grid > div {
    min-width: 0;
}

#modal-dispatch-manual textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 820px) {
    .dispatch-manual-grid {
        grid-template-columns: 1fr;
    }
}

#integration-view .import-zone-grid .import-card.compact-card {
    width: 240px;
}

#integration-view .import-zone-grid .import-card.compact-card .drop-zone.compact {
    width: 100%;
    min-width: 0;
    height: 20px;
    box-sizing: border-box;
    opacity: 0.6;
    background: #f8f9fa;
    border-style: dashed;
}

.drop-zone {
    border: 2px dashed #007bff;
    background: #f1f8ff;
    padding: 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone.compact {
    padding: 14px;
    border-radius: 6px;
    gap: 6px;
    font-weight: 400;
}
.drop-zone.compact .ops-supp-label {
    font-weight: 400;
}

.drop-zone.compact .icon {
    font-size: 1rem;
    line-height: 1;
    margin-bottom: 4px;
    display: inline-block;
    transform: scale(1);
    transform-origin: center;
}

.drop-zone.compact .icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.drop-zone.compact p {
    font-size: 0.85rem;
    margin: 0;
}

.drop-zone:hover {
    background: #e1f0ff;
}

.drop-zone .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.drop-zone input {
    display: none;
}

/* Zone Preview */
.preview-box {
    margin-top: 15px;
    text-align: left;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.table-mini-wrapper {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.table-mini-wrapper table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.table-mini-wrapper th {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    padding: 5px;
}

.table-mini-wrapper td {
    padding: 5px;
    border-bottom: 1px solid #eee;
}

.actions-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.editable-cell:focus,
.ops-supp-edit:focus {
    outline: 1px dashed #94a3b8;
    background: #f8fafc;
}

.row-delete-btn {
    border: none;
    background: transparent;
    color: #dc3545;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
}

.row-delete-btn:hover {
    color: #b02a37;
}

.btn-success { background: #28a745; color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
.btn-secondary { background: #6c757d; color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
.ajustements-table {
    table-layout: fixed;
}

.ajustements-table td:first-child {
    text-align: left;
}

.ajustements-table td:nth-child(2) {
    text-align: right;
}

.solde-veille-edit-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.solde-veille-amount-inline {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}


.ajustements-label-with-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ajustements-table .unit-cell {
    width: 48px;
    white-space: nowrap;
    text-align: right;
    padding-left: 6px;
    padding-right: 6px;
}



.ajustements-table input[type="text"] {
    width: 150px !important;
    max-width: 100%;
    margin-left: auto;
    display: block;
}


.ajustements-save-btn {
    padding: 4px 6px;
    font-size: 0.8em;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


@media (max-width: 1100px) {
    .ajustements-table input[type="text"] {
        width: 150px !important;
    }

    .ajustements-save-btn {
        padding: 0;
        width: 26px;
        height: 26px;
        font-size: 0.7em;
    }

    .solde-veille-edit-row {
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 6px;
    }

    .solde-veille-edit-row input[type="date"] {
        width: 110px;
    }

    .solde-veille-edit-row #solde-veille-montant {
        width: 80px;
    }

}

@media (max-width: 1400px) {
    .solde-veille-edit-row {
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 6px;
    }

    .solde-veille-edit-row input[type="date"] {
        width: 110px;
    }

    .solde-veille-edit-row #solde-veille-montant {
        width: 80px;
    }

}

/* Modale d'erreur Dispatch - Orange/Rouge */
#modal-dispatch-error {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#modal-dispatch-error > div {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#btn-close-dispatch-error {
    font-size: 0.95em !important;
    letter-spacing: 0.3px;
}

#btn-close-dispatch-error:hover {
    background: #b91c1c !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

#btn-close-dispatch-error:active {
    transform: scale(0.98);
}

#dispatch-error-message {
    font-weight: 500;
}
