.documentupload {
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upload-zone {
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #0088CC;
    background-color: #f8f9fa;
}

.upload-content {
    color: #666;
}

.upload-text {
    margin-top: 15px;
    font-size: 0.9em;
}

.upload-formats {
    color: #999;
    font-size: 0.85em;
}

.hidden-upload {
    display: none;
}

.file-preview {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-file {
    margin-left: auto;
    color: #999;
    border: none;
    background: none;
    cursor: pointer;
}

.remove-file:hover {
    color: #dc3545;
}

.processing-status {
    margin: 15px 0;
}

.progress-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
}

.progress-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #0088CC;
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

.result-summary {
    margin: 15px 0;
    padding: 15px;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    border-radius: 4px;
    color: #3c763d;
}

.scaninfo {
    margin-top: 15px;
    padding-left: 20px;
}

.scaninfo li {
    margin-bottom: 8px;
    position: relative;
}

.scaninfo li:before {
    content: "â€¢";
    position: absolute;
    left: -15px;
    color: #0088CC;
}

.processing-button {
    position: relative;
    pointer-events: none;
}

.processing-button .fas.fa-spinner {
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

.viewer-dialog {
    position: fixed;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    background: #fff;
    z-index: 1050;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    display: none;
}

.viewer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.viewer-header {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewer-content {
    flex: 1;
    position: relative;
}

.viewer-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.viewer-footer {
    padding: 10px 15px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-selector input {
    width: 150px;
}

.file-preview {
    margin: 1em 0;
    padding: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.file-info i {
    font-size: 1.2em;
}

.remove-file {
    margin-left: auto;
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
}

.remove-file:hover {
    color: #bd2130;
}

.stat-box {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #444;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.progress-bar {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 3px;
    margin-top: 10px;
}

.progress-fill {
    background-color: #007bff;
    height: 20px;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* MODIFIED: Updated select2 styles for better dropdown behavior */
.scandoc-modern .select2-container .select2-selection--single {
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    height: 38px !important; /* ADDED: Fixed height */
    line-height: 36px !important; /* ADDED: Proper line height */
}

.scandoc-modern .select2-container .select2-selection__rendered {
    cursor: pointer !important;
    padding-left: 12px !important; /* ADDED: Left padding */
    padding-right: 20px !important; /* ADDED: Right padding for arrow */
    padding-top: 6px !important; /* ADDED: Top padding */
    padding-bottom: 6px !important; /* ADDED: Bottom padding - fixes your issue */
    line-height: 24px !important; /* ADDED: Proper line height for text */
}

/* ADDED: Fix for placeholder styling */
.scandoc-modern .select2-container .select2-selection__placeholder {
    color: #9ca3af !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 24px !important;
}

/* MODIFIED: Removed problematic placeholder rule */
.scandoc-modern .select2-container--default .select2-selection--single:focus {
    border-color: #4299e1 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2) !important; /* ADDED: Focus ring */
}

/* MODIFIED: Better arrow positioning */
.scandoc-modern .select2-container .select2-selection__arrow {
    display: block !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important; /* ADDED: Better centering */
    height: 20px !important; /* ADDED: Fixed height */
    width: 20px !important; /* ADDED: Fixed width */
}

.scandoc-modern .select2-container .select2-selection__arrow b {
    border-color: #4a5568 transparent transparent transparent !important;
    border-style: solid !important;
    border-width: 5px 4px 0 4px !important;
    height: 0 !important;
    left: 50% !important;
    margin-left: -4px !important;
    margin-top: -2px !important;
    position: absolute !important;
    top: 50% !important;
    width: 0 !important;
}

/* ADDED: Dropdown container styles */
.scandoc-modern .select2-dropdown {
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* ADDED: Option styles */
.scandoc-modern .select2-results__option {
    padding: 8px 12px !important;
    line-height: 1.5 !important;
}

.scandoc-modern .select2-results__option--highlighted {
    background-color: #4299e1 !important;
    color: white !important;
}

/* ADDED: Ensure dropdown closes properly */
.scandoc-modern .select2-container--open .select2-dropdown {
    z-index: 9999 !important;
}

/* MODIFIED: Remove problematic ajax loader rules */
.scandoc-modern .select2-container .select2-selection__clear {
    cursor: pointer !important;
    float: right !important;
    font-weight: bold !important;
    margin-right: 10px !important;
}

/* ADDED: Hide loading indicator that might cause issues */
.scandoc-modern .select2-selection__choice__remove,
.scandoc-modern .select2-search__field {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* ADDED: Prevent text selection issues */
.scandoc-modern .select2-container {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.text-success { 
    color: #28a745 !important; 
}

.text-danger { 
    color: #dc3545 !important; 
}

.text-warning { 
    color: #ffc107 !important; 
}

 .scandoc-modern .credits-badge-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.scandoc-modern .credits-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.scandoc-modern .credits-badge:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.scandoc-modern .credits-badge.updated:before {
    left: 100%;
}

.scandoc-modern .credits-badge.low-credits {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse-warning 2s infinite;
}

.scandoc-modern .credits-badge .credits-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

@keyframes pulse-warning {
    0% { box-shadow: 0 4px 15px rgba(255,107,107,0.4); }
    50% { box-shadow: 0 4px 25px rgba(255,107,107,0.8); }
    100% { box-shadow: 0 4px 15px rgba(255,107,107,0.4); }
}

.scandoc-modern .upload-zone {
    border: 2px dashed #4299e1;
    padding: 20px;
    border-radius: 12px;
    background: #f7fafc;
    transition: background-color 0.3s, border-color 0.3s;
    position: relative;
}
.scandoc-modern .upload-zone-active {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border-color: #2b6cb0;
}
.scandoc-modern .upload-text { color: #4a5568; }
.scandoc-modern .file-preview { margin: 15px 0; }
.scandoc-modern .remove-file { margin-left: 10px; }
.scandoc-modern .modal-backdrop {
    background: rgba(0,0,0,0.7);
    z-index: 1050;
}
.scandoc-modern .modal-content { background: #1a202c; }
.scandoc-modern .progress { height: 20px; border-radius: 10px; }
.scandoc-modern .progress-bar { transition: width 0.3s ease-in-out; }
.scandoc-modern .card { transition: box-shadow 0.3s; }
.scandoc-modern .card:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.scandoc-modern .result-summary .alert { margin-top: 20px; border-radius: 8px; }
.scandoc-modern .btn-primary { background: #2b6cb0; border: none; color: white; }
.scandoc-modern .btn-primary:hover { background: #2c5282; }
.scandoc-modern .btn-secondary { background: #718096; color: white; border: none; }
.scandoc-modern .btn-secondary:hover { background: #4a5568; }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.scandoc-modern .fa-spinner-third { animation: spin 1.5s linear infinite; }

.scandoc-modern .select2-container .select2-selection--single {
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}
.scandoc-modern .select2-container .select2-selection__rendered {
    cursor: pointer !important;
}
.scandoc-modern .select2-container .placeholder {
    display: none !important;
}
.scandoc-modern .select2-container--default .select2-selection--single:focus {
    border-color: #4299e1 !important;
    outline: none !important;
}
.scandoc-modern .select2-container .select2-selection__arrow {
    display: block !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%);
    border-color: #4a5568 transparent transparent transparent !important;
}
.scandoc-modern .ajax-loader, .select2-loading {
    display: none !important;
}

/* -------------------------------------------------------
   ACCORDION — Paramètres avancés
------------------------------------------------------- */
.scandoc-accordion {
    margin: 16px 0 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.scandoc-accordion-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: #f7fafc;
    border: none;
    cursor: pointer;
    font-size: 0.92em;
    font-weight: 600;
    color: #4a5568;
    text-align: left;
    transition: background 0.2s;
    border-radius: 0; /* inside .scandoc-accordion which has border-radius */
}

.scandoc-accordion-toggle:hover {
    background: #edf2f7;
    color: #2b6cb0;
}

.scandoc-accordion-toggle.is-open {
    background: #edf2f7;
    color: #2b6cb0;
    border-bottom: 1px solid #e2e8f0;
}

.accordion-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
}

.accordion-chevron {
    font-size: 0.8em;
    transition: transform 0.25s ease;
    color: #a0aec0;
}

/* Badge "●" indiquant des valeurs non-default */
.accordion-dot {
    width: 7px;
    height: 7px;
    background: #4299e1;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 2px;
}

/* Contenu collapsible par max-height */
.scandoc-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 16px;
    background: #fff;
}

/* Padding interne quand ouvert — via padding top/bottom sur le dernier enfant */
.scandoc-accordion-content .scandoc-field:first-child {
    margin-top: 16px;
}

.scandoc-accordion-content .scandoc-field:last-child,
.scandoc-accordion-content .article-type-toggle:last-child {
    margin-bottom: 16px;
}

/* Pill selector — inchangé mais on s'assure de la cohérence */
.article-type-pill-selector {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.pill-option {
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    color: #4a5568;
    font-size: 0.88em;
    cursor: pointer;
    transition: all 0.2s;
}

.pill-option:hover {
    border-color: #4299e1;
    color: #2b6cb0;
}

.pill-option.active {
    background: #2b6cb0;
    border-color: #2b6cb0;
    color: #fff;
}

/* -------------------------------------------------------
   INDEX.PHP — Styles déplacés depuis le bloc <style> inline
   (crédits badge, upload zone, modal, select2 overrides…)
------------------------------------------------------- */

/* Credits badge */
.scandoc-modern .credits-badge-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.scandoc-modern .credits-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.scandoc-modern .credits-badge:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.scandoc-modern .credits-badge.updated:before {
    left: 100%;
}

.scandoc-modern .credits-badge.low-credits {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse-warning 2s infinite;
}

.scandoc-modern .credits-badge .credits-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

@keyframes pulse-warning {
    0%   { box-shadow: 0 4px 15px rgba(255,107,107,0.4); }
    50%  { box-shadow: 0 4px 25px rgba(255,107,107,0.8); }
    100% { box-shadow: 0 4px 15px rgba(255,107,107,0.4); }
}

/* Upload zone */
.scandoc-modern .upload-zone {
    border: 2px dashed #4299e1;
    padding: 20px;
    border-radius: 12px;
    background: #f7fafc;
    transition: background-color 0.3s, border-color 0.3s;
    position: relative;
}
.scandoc-modern .upload-zone-active {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border-color: #2b6cb0;
}
.scandoc-modern .upload-text  { color: #4a5568; }
.scandoc-modern .file-preview { margin: 15px 0; }
.scandoc-modern .remove-file  { margin-left: 10px; }

/* File info */
.scandoc-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}
.scandoc-file-details {
    display: flex;
    align-items: center;
    gap: 10px;
}
.scandoc-filename { font-weight: bold; }
.scandoc-filesize { color: #718096; font-size: 0.9em; }

/* Fields & labels */
.scandoc-field  { margin-bottom: 20px; }
.scandoc-label  {
    display: block;
    font-weight: 600;
    color: #2b6cb0;
    margin-bottom: 8px;
}

/* Info box (sidebar + template info) */
.scandoc-info-box {
    margin-top: 10px;
    padding: 15px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.scandoc-info-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #2b6cb0;
    margin-bottom: 12px;
}
.scandoc-info-content { padding: 0; }
.scandoc-feature-list { list-style: none; padding: 0; margin: 0; }
.scandoc-feature-list li { margin-bottom: 8px; padding: 4px 0; color: #4a5568; }
.scandoc-feature-list i  { color: #718096; margin-right: 8px; width: 16px; text-align: center; }

/* Submit button */
.scandoc-submit-btn   { font-size: 1.1em; padding: 12px 24px; }
.scandoc-submit-btn i { margin-right: 8px; }

/* Error actions */
.scandoc-error-actions           { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
.scandoc-error-actions .button   { text-align: center; }

/* Processing modal */
.scandoc-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
}
.scandoc-modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
}
.scandoc-modal-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #1a202c;
    color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    min-width: 400px;
    max-width: 600px;
    z-index: 10000;
}
.scandoc-modal-title   { text-align: center; margin-bottom: 20px; color: #fff; }
.scandoc-progress      { height: 20px; border-radius: 10px; background: #2d3748; margin-bottom: 15px; overflow: hidden; }
.scandoc-progress-bar  { height: 100%; background: linear-gradient(90deg, #4299e1 0%, #667eea 100%); transition: width 0.3s ease-in-out; border-radius: 10px; }
.scandoc-status-lines  { text-align: center; margin-bottom: 15px; }
.scandoc-error-message { text-align: center; color: #fc8181; margin-top: 15px; }
.scandoc-modern .result-summary .alert { margin-top: 20px; border-radius: 8px; }

/* Spinner */
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.scandoc-modern .fa-spinner-third { animation: spin 1.5s linear infinite; }

/* Select2 overrides */
.scandoc-modern .select2-container .select2-selection--single {
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}
.scandoc-modern .select2-container .select2-selection__rendered { cursor: pointer !important; }
.scandoc-modern .select2-container .placeholder                  { display: none !important; }
.scandoc-modern .select2-container--default .select2-selection--single:focus {
    border-color: #4299e1 !important;
    outline: none !important;
}
.scandoc-modern .select2-container .select2-selection__arrow {
    display: block !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%);
    border-color: #4a5568 transparent transparent transparent !important;
}
.scandoc-modern .ajax-loader, .select2-loading { display: none !important; }
.text-success { color: #28a745 !important; }

/* Validation screen */
.scandoc-validation-screen { margin-top: 20px; }
.vs-header { margin-bottom: 14px; }
.vs-header h4 { margin: 0 0 4px 0; }
.vs-table { width: 100%; }
.vs-td-label { min-width: 200px; }
.vs-td-nums  { width: 80px; text-align: right; }
.vs-td-conf  { width: 60px; text-align: center; }
.vs-td-mem   { width: 40px; text-align: center; }
.vs-invoice-label { font-weight: 500; }
.vs-input-qty, .vs-input-pu, .vs-input-vat { width: 72px; text-align: right; }
.vs-radio-option  { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; }
.vs-radio-option label { cursor: pointer; font-size: 12px; }
.vs-radio-manual  { border-left: 3px solid #4299e1; padding-left: 6px; }
.badge-match      { font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 3px; }
.badge-match-high { background: #d4edda; color: #2a6e2a; }
.badge-match-mid  { background: #fff3cd; color: #856404; }
.badge-match-none { background: #f8d7da; color: #9e2a2a; }
.badge-match-source { font-size: 9px; background: #e8f0fe; color: #2b6cb0;
                      padding: 1px 5px; border-radius: 2px; margin-left: 4px; }
.vs-search-wrap   { position: relative; }
.vs-product-search{ width: 100%; }
.vs-autocomplete-list { position: absolute; z-index: 999; background: #fff;
                         border: 1px solid #ccc; border-radius: 3px; list-style: none;
                         margin: 0; padding: 0; width: 100%; max-height: 180px;
                         overflow-y: auto; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.vs-autocomplete-item { padding: 7px 10px; font-size: 12px; cursor: pointer; }
.vs-autocomplete-item:hover { background: #f0f4ff; color: #2c5282;}
.vs-actions { margin-top: 16px; display: flex; gap: 10px; }

/* Matching modal */
/* Variante wide : remplace max-width 600px pour le modal de validation */
.scandoc-modal-content--wide {
    min-width: min(92vw, 960px);
    max-width: 96vw;
    height: 82vh;               /* hauteur fixe — requis pour que flex child puisse calculer 100% */
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* Corps du modal wide : flex colonne pour header fixe + scroll au milieu + footer fixe */
.scandoc-modal-content--wide .scandoc-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;             /* prend toute la hauteur du parent flex */
    min-height: 0;              /* requis : sans ça, flex ignore overflow sur les enfants */
    overflow: hidden;
    color: #e2e8f0;
}

/* En-tête du validation screen (titre + description) — fixe */
.scandoc-modal-content--wide .vs-header {
    padding: 20px 24px 12px;
    border-bottom: 1px solid #2d3748;
    flex-shrink: 0;
}
.scandoc-modal-content--wide .vs-header h4 {
    color: #fff;
    margin: 0 0 4px;
    font-size: 1.1rem;
}
.scandoc-modal-content--wide .vs-header p {
    margin: 0;
    font-size: 0.85rem;
    color: #a0aec0;
}

/* Zone scrollable du tableau */
.vs-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 60vh; /* limite la hauteur du tableau pour éviter de dépasser l'écran */
    overflow-y: auto;
    overflow-x: auto;
    padding: 0 24px;
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #1a202c;
}
.vs-table-scroll::-webkit-scrollbar        { width: 6px; height: 6px; }
.vs-table-scroll::-webkit-scrollbar-track  { background: #1a202c; }
.vs-table-scroll::-webkit-scrollbar-thumb  { background: #4a5568; border-radius: 3px; }

/* Tableau dans le modal : fond sombre cohérent */
.scandoc-modal-content--wide .vs-table {
    width: 100%;
    min-width: 700px;
    color: #e2e8f0;
    border-collapse: collapse;
}
.scandoc-modal-content--wide .vs-table thead th {
    background: #2d3748;
    color: #a0aec0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 8px 10px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.scandoc-modal-content--wide .vs-table tbody tr {
    border-bottom: 1px solid #2d3748;
}
.scandoc-modal-content--wide .vs-table tbody tr:hover {
    background: rgba(66, 153, 225, 0.07);
}
.scandoc-modal-content--wide .vs-table td {
    padding: 8px 10px;
    vertical-align: top;
    font-size: 0.85rem;
    color: #26282b !important;  /* override Dolibarr oddeven */
}
.scandoc-modal-content--wide .vs-invoice-label {
    color: #26282b !important;
    font-weight: 500;
    line-height: 1.4;
}

/* Inputs numériques dans le tableau */
.scandoc-modal-content--wide .vs-input-qty,
.scandoc-modal-content--wide .vs-input-pu,
.scandoc-modal-content--wide .vs-input-vat {
    width: 72px;
    background: #2d3748;
    border: 1px solid #4a5568;
    color: #e2e8f0;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.82rem;
}

/* Autocomplete dans le modal */
.scandoc-modal-content--wide .vs-product-search {
    width: 100%;
    min-width: 180px;
    background: #2d3748;
    border: 1px solid #4a5568;
    color: #e2e8f0;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.82rem;
}
.scandoc-modal-content--wide .vs-autocomplete-list {
    background: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 4px;
    z-index: 10010;
    color: #e2e8f0;
}

/* Radio options dans le tableau */
.scandoc-modal-content--wide .vs-radio-option {
    margin-bottom: 4px;
}
.scandoc-modal-content--wide .vs-radio-option label {
    /*color: #e2e8f0;*/
    font-size: 0.82rem;
    cursor: pointer;
}

/* Footer actions — fixe en bas */
.scandoc-modal-content--wide .vs-actions {
    padding: 14px 24px;
    border-top: 1px solid #2d3748;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: #1a202c;
}