body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f7f9fc;
    margin: 0;
    padding: 20px;
    color: #333;
    padding-top: 0px;
}


h1,
h2 {
    text-align: center;
    color: #2c3e50;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 30px; /* Hauteur minimale fixe */
}

.logoTiloli {
    height: 40px; /* Réduit de 6vh à 40px fixe */
    max-height: 40px;
    flex-shrink: 0;
}

.header h1 {
    margin: 0;
    text-align: right;
    font-size: 1.4rem; /* Taille de police réduite */
    flex-grow: 1;
    margin-right: 50vh;
}


form.uploadForm,
#validationForm {
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 30px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Seulement en localhost - forcer l'affichage */
html.localhost form.uploadForm,
html.localhost #validationForm {
    display: flex !important;
}

.uploadSection,
.textSection {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #34495e;
    text-align: center;
}

input[type="file"],
.clientSection input[type="number"],
textarea {
    width: 100%;
    max-width: 500px;
    padding: 12px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fdfdfd;
    transition: border-color 0.3s ease;
    display: block;
}

input[type="file"]:hover,
.clientSection input[type="number"]:hover,
textarea:hover {
    border-color: #E63289;
}

.clientSection input[type="text"] {
    width: 25%;
}

#clientCode {
    width: 100%;
    max-width: 500px;
    padding: 12px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fdfdfd;
    transition: border-color 0.3s ease;
    display: block;
}

#clientCode:hover {
    border-color: #E63289;
}

#addressSelect {
    width: 100%;
    padding: 7px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 22px;
    background: #fafbfc;
    text-align: center;
    gap: 10px;
}

.clientSection {
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto 0 auto;
    margin-bottom: 10px;
}


textarea {
    resize: vertical;
}

.sendButton,
#validationForm button[type="submit"] {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 20px auto 0 auto;
    background-color: #E63289;
    color: white;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 20px;
}


.sendButton:hover,
#validationForm button[type="submit"]:hover {
    background-color: #c9186d;
    transform: translateY(-1px);
}


#btnAnnuler {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 20px auto 0 auto;
    background-color: #e63232;
    color: white;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 20px;
}

#btnAnnuler:hover {
    background-color: #c91821;
    transform: translateY(-1px);
}

#btnRetour {
    background-color: #d10977;
    color: rgb(255, 255, 255);
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#btnRetour:hover {
    background-color: #b0075e;
    transform: translateY(-1px);
}

#resultSection {
    max-width: 800px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}


#fields {
    margin-top: 20px;
}


@media (max-width: 600px) {

    form.uploadForm,
    #validationForm,
    #resultSection {
        padding: 20px;
    }

    textarea {
        min-height: 200px;
    }

    .header {
        flex-direction: column;
        align-items: center;
    }

    .logoTiloli {
        position: static;
        margin-bottom: 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }
}

.form-row {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.form-group {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-width: 180px;
    margin-bottom: 0;
}

.form-group label {
    min-width: 120px; /* Assure une largeur minimale pour les labels */
}


.items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
}

.item-card {
    background: #f8f8fb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
    padding: 18px 20px 12px 20px;
    margin-bottom: 12px;
    min-width: 220px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.item-title {
    font-weight: bold;
    color: #E63289;
    margin-bottom: 10px;
    text-align: center;
}

#previewAndResult {
    display: flex;
    gap: 20px;
    align-items: stretch;
    min-height: 0;
    max-height: none;   
    overflow: visible;
    margin-top: 25px;
    height: 90vh;
}

#pdfPreviewContainer {
    flex: 0 0 50%;
    max-width: 60%;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    height: auto; /* Ajout pour permettre l'expansion */
    min-height: 400px; /* Hauteur minimale */
    max-height: none; /* Supprimer la limitation de hauteur */
}



@media (max-width: 900px) {
    #previewAndResult {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    #pdfPreviewContainer {
        max-width: 100%;
        margin-bottom: 24px;
        flex: none;
    }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.items-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
}

.items-table th,
.items-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    background: #fff;
}

.items-table th {
    background: #f7f9fc;
    color: #2c3e50;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

.items-table tr:last-child td {
    border-bottom: none;
}

.items-table tr:hover td {
    background: #f3f6fa;
}

.items-table input[type="text"],
.items-table input[type="number"] {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 15px;
    background: #fdfdfd;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.items-table input[type="text"]:focus,
.items-table input[type="number"]:focus {
    border-color: #E63289;
    outline: none;
    background: #fff;
}


.readonly-input {
    background: #f3f3f3;
    color: #888;
    cursor: not-allowed;
}

#btnAjouterArticle {
    display: block;
    background-color: rgb(10, 179, 80);
    margin: 20px auto 0 auto;
    max-width: 350px;
    margin-bottom: 50px;
}

#clientPanel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.07);
    padding: 40px 32px 32px 32px;
    max-width: 700px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5px;
}

#clientPanel label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #34495e;
    text-align: center;
}

#clientPanel input[type="text"] {
    width: 100%;
    max-width: 250px;
    padding: 12px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 22px;
    background: #fafbfc;
    text-align: center;
}

#btnValiderClient {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 20px auto 0 auto;
    background-color: #E63289;
    color: white;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 20px;
}

#btnValiderClient:hover {
    background: #c9186d;
}

.logout-btn {
    background: #d6312b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px; /* Réduit le padding */
    font-size: 0.9rem; /* Taille de police réduite */
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: #c91821;
}

#logoutBtn {
    display: none;
}


.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0;
    transition: width 0.3s ease;
}

.summary-section {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 1200px;
}

.summary-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
    margin-bottom: 30px;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.summary-pdf {
    flex: 1;
    min-height: 300px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.summary-data {
    flex: 2;
}

.summary-client-info {
    background-color: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.summary-table th,
.summary-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.summary-table th {
    background-color: #f2f2f2;
}

.total-row {
    background-color: #f5f5f5;
    font-weight: bold;
}

.text-right {
    text-align: right;
}

.summary-actions {
    margin-top: 30px;
    text-align: center;
}

#btnRetourAccueil {
    padding: 12px 24px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#btnRetourAccueil:hover {
    background-color: #45a049;
}

.no-pdf {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    color: #666;
    font-style: italic;
}

@media print {
    .summary-actions {
        display: none;
    }

    .summary-item {
        page-break-inside: avoid;
    }
}

.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.loading-indicator p {
    margin-top: 20px;
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#btnImprimerRecap {
    margin-top: 10px;
    padding: 12px 24px;
    font-size: 16px;
    background-color: #E63289;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#btnImprimerRecap:hover {
    background-color: #c9186d;
}

.missing-data {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    font-weight: bold;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.items-table td {
    position: relative;
    padding-bottom: 25px;
}

.items-table .missing-data {
    position: absolute;
    bottom: 5px;
    left: 5px;
    font-size: 10px;
}

.missing-data-summary {
    color: #e74c3c;
    font-style: italic;
}

#validationForm input[type="text"],
input[type="number"], input[type = "date"], input[type = "email"] {
    width: 100%;
    max-width: 250px;
    padding: 7px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    background: #fafbfc;
    text-align: center;
    gap: 10px;
}



.validation-errors {
    margin-top: 50px;
}

.passButton {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px;
}

.passButton:hover {
    background-color: #5a6268;
}

.skipped-pdf {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.skipped-badge {
    background-color: #6c757d;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.skipped-message {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 15px;
    margin: 15px 0;
    color: #6c757d;
    font-style: italic;
}

.missing-data-summary {
    color: #e74c3c;
    font-style: italic;
}

.text-right {
    text-align: right;
}

.modal-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.success-message,
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slide-in 0.3s ease-out;
}

.success-message {
    background-color: #d4edda;
    border-left: 5px solid #28a745;
    color: #155724;
}

.error-message {
    background-color: #f8d7da;
    border-left: 5px solid #dc3545;
    color: #721c24;
}

.success-icon,
.error-icon {
    font-size: 24px;
    margin-right: 15px;
}

.success-icon {
    color: #28a745;
}

.error-icon {
    color: #dc3545;
}

.fade-out {
    animation: fade-out 0.5s ease-out forwards;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    animation: fade-in 0.3s ease-out;
}

.error-modal {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: scale-in 0.3s ease-out;
}

.error-modal-header {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #721c24;
}

.error-modal-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.error-modal-footer {
    padding: 15px 20px;
    text-align: right;
    border-top: 1px solid #e9ecef;
}

.ok-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.ok-button:hover {
    background-color: #c82333;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.order-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
}

.success-status {
    color: #155724;
    background-color: #d4edda;
    border-left: 3px solid #28a745;
    padding-left: 8px;
}

.error-status {
    color: #721c24;
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
    padding-left: 8px;
}

.pending-status {
    color: #856404;
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
    padding-left: 8px;
}

/* Styles pour la modal de mise à jour */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.update-modal {
    max-width: 800px;
    width: 90%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    background-color: #f5f5f5;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.update-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.update-items-table th,
.update-items-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.update-items-table th {
    background-color: #f5f5f5;
}

.quantity-input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.update-order-section {
    margin-top: 15px;
    text-align: right;
}

.update-quantities-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.update-quantities-btn:hover {
    background-color: #45a049;
}

.cancel-button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.save-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.autocomplete-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f0f7ff;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-no {
    font-weight: bold;
    color: #2c3e50;
}

.customer-name {
    font-weight: bold;
    color: #3498db;
}

.customer-details {
    margin-top: 4px;
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Style pour les termes surlignés */
.autocomplete-item strong {
    color: #e74c3c;
    font-weight: bold;
    background-color: rgba(231, 76, 60, 0.1);
    padding: 0 2px;
    border-radius: 2px;
}

.clear-input {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #999;
}

.transport-row {
    background-color: #f8f9fa;
    font-style: italic;
}

.articles-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.valid-articles,
.invalid-articles {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}

.valid-articles {
    background-color: #f8fff8;
}

.invalid-articles {
    background-color: #fff8f8;
}

.valid-items-table th,
.valid-items-table td {
    background-color: #f0fff0;
}

.invalid-items-table th,
.invalid-items-table td {
    background-color: #fff0f0;
}

.validated-ref {
    color: #2a8d2a;
    font-weight: bold;
}

.error-reason {
    color: #d32f2f;
    font-style: italic;
}

.info-message {
    text-align: center;
    padding: 10px;
    color: #666;
    font-style: italic;
}

.edit-article-modal {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    padding: 0;
    overflow: hidden;
}

.modal-header {
    background-color: #f5f5f5;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #ddd;
    background-color: #f5f5f5;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.modal-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    background: #fafbfc;
}

.action-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.verification-result {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.loading {
    color: #666;
    font-style: italic;
}

.success-result {
    background-color: #e8f5e9;
    border: 1px solid #a5d6a7;
    padding: 10px;
    border-radius: 4px;
}

.error-result {
    background-color: #ffebee;
    border: 1px solid #ef9a9a;
    padding: 10px;
    border-radius: 4px;
}

.cancel-button,
.ok-button {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #ddd;
    background-color: #f44336;
}

.save-button {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
}

.item-description-row {
    background-color: #f9f9f9;
}

.item-description {
    padding: 8px 12px;
    font-weight: bold;
    color: #333;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.total-price {
    font-weight: bold;
    text-align: right;
    padding-right: 15px;
}

.transport-checkbox {
    display: inline-block;
    margin: 10px 0;
    font-weight: bold;
    color: #4CAF50;
}

.transport-row {
    background-color: #f0f8ff;
}

.validated-ref {
    color: #2a8d2a;
    font-weight: bold;
}

.btn-edit-article,
.btn-supprimer-article {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    margin: 0 6px;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
    font-size: 1.5rem;
    outline: none;
}

.btn-edit-article:hover {
    background: #ffe5d0;
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.15);
    transform: translateY(-2px) scale(1.05);
}

.btn-supprimer-article:hover {
    background: #ffe0e0;
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.12);
    transform: translateY(-2px) scale(1.05);
}

.btn-edit-article:active,
.btn-supprimer-article:active {
    transform: scale(0.97);
}

.btn-edit-article svg,
.btn-supprimer-article svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.readonly-input {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #666;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}


#pdfPreview {
    background: #f8f8fb;
    border-radius: 10px;
    flex: 1; /* Ajout pour prendre tout l'espace disponible */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#pdfPreview iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    flex: 1; /* Ajout pour utiliser tout l'espace */
}



#resultSection {
    flex: 2;
    height: auto;
    overflow-y: auto;
    padding-right: 10px;
}

/* Style pour la barre de défilement */
#resultSection::-webkit-scrollbar {
    width: 8px;
}

#resultSection::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#resultSection::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#resultSection::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* Masquer les éléments de test en CSS aussi (au cas où) */
.test-variant-container,
.test-item-container,
#testConnectionBtn,
#connectionStatus {
    display: none !important;
}

.autocomplete-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f5f5f5;
}

.item-header {
    display: flex;
    flex-direction: column;
}

.item-no {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.item-description {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.no-results {
    padding: 10px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.blocked-item {
    color: #dc3545 !important;
    font-weight: bold;
    background-color: #f8d7da;
    padding: 2px 4px;
    border-radius: 3px;
}

.error-result {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.success-result {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.validation-info {
    background-color: #e7f7e7;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.readonly-input {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.help-text {
    color: #6c757d;
    font-size: 0.875em;
    margin-top: 5px;
    display: block;
}

.validated-ref {
    font-weight: bold;
    color: #28a745;
}

.warning-result {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .header {
        padding: 8px 15px;
        min-height: 45px;
    }
    
    .logoTiloli {
        height: 35px;
        max-height: 35px;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
css
/* Modal panel plus grand */
.modal-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px; /* Augmenté de 20px à 30px */
    border-radius: 12px; /* Augmenté de 8px à 12px */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 700px; /* Augmenté de 500px à 700px */
    width: 95%; /* Augmenté de 90% à 95% */
    text-align: center;
}

/* Modal spécifique pour l'édition d'article - plus grande */
.edit-article-modal {
    background-color: white;
    border-radius: 12px; /* Augmenté */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 800px; /* Augmenté de 600px à 800px */
    width: 95%; /* Augmenté de 90% à 95% */
    padding: 0;
    overflow: hidden;
}

/* Inputs du modal plus grands */
.modal-input {
    width: 100%;
    padding: 12px 16px; /* Augmenté de 8px 12px à 12px 16px */
    border: 1.5px solid #ccc; /* Border plus épaisse */
    border-radius: 8px;
    font-size: 16px; /* Augmenté de 14px à 16px */
    background: #fafbfc;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: #E63289;
    outline: none;
    background: #fff;
}

/* Form groups dans les modals plus espacés */
.modal-body .form-group {
    margin-bottom: 20px; /* Augmenté de 15px à 20px */
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px; /* Augmenté de 5px à 8px */
    font-weight: bold;
    font-size: 15px; /* Légèrement plus grand */
    color: #34495e;
}

/* Boutons du modal plus grands */
.modal-footer {
    padding: 20px 30px; /* Augmenté */
    display: flex;
    justify-content: flex-end;
    gap: 15px; /* Augmenté de 10px à 15px */
    border-top: 1px solid #ddd;
    background-color: #f5f5f5;
}

.cancel-button,
.save-button,
.action-button {
    padding: 12px 20px; /* Augmenté */
    border-radius: 6px; /* Augmenté */
    cursor: pointer;
    font-size: 15px; /* Augmenté */
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cancel-button {
    background-color: #f44336;
    color: white;
    border: none;
}

.save-button {
    background-color: #4CAF50;
    color: white;
    border: none;
}

.action-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    margin-top: 15px; /* Augmenté de 10px à 15px */
}

.cancel-button:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
}

.save-button:hover,
.action-button:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

/* Header du modal plus grand */
.modal-header {
    background-color: #f5f5f5;
    padding: 20px 30px; /* Augmenté de 15px 20px à 20px 30px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px; /* Augmenté de 18px à 20px */
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px; /* Augmenté de 24px à 28px */
    cursor: pointer;
    color: #666;
    padding: 5px;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

/* Body du modal plus spacieux */
.modal-body {
    padding: 30px; /* Augmenté de 20px à 30px */
    overflow-y: auto;
    max-height: 60vh; /* Ajout d'une hauteur maximale */
}

/* Résultats de vérification plus visibles */
.verification-result {
    margin-top: 20px; /* Augmenté de 15px à 20px */
    padding: 15px; /* Augmenté de 10px à 15px */
    border-radius: 6px; /* Augmenté */
    font-size: 15px; /* Ajout */
}

.success-result {
    background-color: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.error-result {
    background-color: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

.warning-result {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .modal-content,
    .edit-article-modal {
        width: 98%;
        margin: 10px;
        max-width: none;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-input {
        padding: 14px;
        font-size: 16px; /* Important pour éviter le zoom sur iOS */
    }
}

.client-info-row {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.client-info-row .form-group {
    display: flex;
    flex-direction: column;
}

.client-info-row .form-group label {
    margin-bottom: 5px;
    font-weight: bold;
}

.client-info-row .form-group input {
    margin-bottom: 5px;
}

.client-info-row .missing-data {
    font-size: 12px;
    color: #d32f2f;
    margin-top: 2px;
}

/* Version responsive pour les petits écrans */
@media (max-width: 768px) {
    .client-info-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .client-info-row .form-group {
        min-width: auto;
    }
}

.total-ht-row {
    background-color: #f8f9fa;
    border-top: 2px solid #dee2e6;
    font-weight: bold;
}

.total-ht-row td {
    padding: 12px 8px !important;
    border-top: 2px solid #dee2e6 !important;
}

.text-right {
    text-align: right;
}

.already-updated {
    background-color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.already-updated:hover {
    background-color: #6c757d !important;
}

/* Styles pour la preview de texte */
.text-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    height: auto;
    min-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    width: 100%;
    box-sizing: border-box;
}

.text-preview h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 18px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.text-content {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    height: auto;
    overflow-y: visible; /* Changé de auto à visible */
    font-family: 'Courier New', monospace;
    width: 100%;
    box-sizing: border-box;
}

.text-preview-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    height: auto;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

.text-preview-summary h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.text-content-summary {
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 11px;
    line-height: 1.4;
    color: #333;
    height: auto;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    width: 100%;
    box-sizing: border-box;
}

/* Adaptation pour que le conteneur principal s'ajuste */
#previewAndResult.text-mode {
    height: auto;
    min-height: 70vh;
}

/* Style pour l'affichage de la version */
div.version-display {
    position: fixed ;
    bottom: 30px ;
    right: 10px ;
    margin: 0 ;
    margin-left: 10px;
    font-size: 12px;
    color: #666;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    z-index: 1000;
}

/* Version responsive pour mobile */
@media (max-width: 768px) {
    div.version-display {
        bottom: 8px ;
        font-size: 11px;
        padding: 5px 10px;
        max-width: calc(100vw - 40px);
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    div.version-display {
        bottom: 5px ;
        font-size: 10px;
        padding: 4px 8px;
        max-width: calc(100vw - 20px);
    }
}

