/**
 * Dashboard JobRunner - Styles
 */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    padding: 20px;
    padding-bottom: 400px; /* Espace pour le panneau de logs */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

/* Cards de statistiques */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-card.active {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.stat-card.success.active {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.stat-card.error.active {
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.stat-card.processing.active {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.stat-card.pending.active {
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.stat-card.success .stat-value {
    color: #10b981;
}

.stat-card.error .stat-value {
    color: #ef4444;
}

.stat-card.processing .stat-value {
    color: #3b82f6;
}

.stat-card.pending .stat-value {
    color: #f59e0b;
}

/* Contrôles */
.controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.worker-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    user-select: none;
}

.worker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.worker-indicator.running {
    background: #d1fae5;
    color: #065f46;
}

.worker-indicator.running .worker-dot {
    background: #10b981;
    animation: worker-pulse 2s ease-in-out infinite;
}

.worker-indicator.stopped {
    background: #fee2e2;
    color: #991b1b;
}

.worker-indicator.stopped .worker-dot {
    background: #ef4444;
}

@keyframes worker-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    opacity: 0.8;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

/* Table des jobs */
.jobs-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    border-bottom: 2px solid #e5e7eb;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

tr:hover {
    background: #f9fafb;
}

tr.clickable {
    cursor: pointer;
}

tr.clickable:hover {
    background: #f0f9ff;
}

tr.clickable.active {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

/* Lien Logs sur chaque ligne */
.link-logs {
    color: #3b82f6;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.link-logs:hover {
    text-decoration: underline;
    color: #1e40af;
}

tr.clickable.active .link-logs {
    color: #1e40af;
    font-weight: 600;
}

/* Lien de téléchargement du résultat */
.link-download {
    color: #3b82f6;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    margin-right: 12px;
}

.link-download:hover {
    text-decoration: underline;
    color: #1e40af;
}

.link-download.disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

/* Badges de statut */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-cancelled {
    background: #e5e7eb;
    color: #374151;
}

/* Badges de canal de dépôt */
.channel-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.channel-web {
    background: #e0e7ff;
    color: #3730a3;
}

.channel-sftp {
    background: #fae8ff;
    color: #86198f;
}

.channel-dashboard {
    background: #fef3c7;
    color: #92400e;
}

/* Compteur d'erreurs */
.error-count-ok {
    color: #065f46;
    font-size: 12px;
    font-weight: 600;
}

.error-count-bad {
    color: #991b1b;
    font-weight: 700;
    font-size: 12px;
}

/* Barre de progression */
.progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s, background 0.3s;
}

.progress-fill.progress-success {
    background: #10b981;
}

.progress-fill.progress-error {
    background: #ef4444;
}

/* Messages — toast flottant, ne décale pas le contenu */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    padding: 12px 24px;
    border-radius: 8px;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    pointer-events: none;
}

.auto-refresh-control {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.auto-refresh-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.auto-refresh-label input[type="checkbox"] {
    cursor: pointer;
}

.refresh-now-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s;
    padding: 2px 2px 2px 2px;
}

.refresh-now-btn:hover {
    background: #e5e7eb;
}

.refresh-now-btn.spinning svg {
    animation: refresh-spin 0.5s linear;
}

@keyframes refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination-container {
    background: white;
    border-radius: 0 0 8px 8px;
    padding: 12px 10px 12px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: -8px;
}

.pagination-info {
    color: #6b7280;
    font-size: 13px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 13px;
}

.per-page-selector select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.page-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled):not(.active) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.page-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #9ca3af;
    padding: 0 4px;
    font-size: 13px;
}

/* Badge de rétention */
.retention-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.retention-critical {
    background: #fee2e2;
    color: #991b1b;
}

.retention-warning {
    background: #fef3c7;
    color: #92400e;
}

.retention-ok {
    background: #e5e7eb;
    color: #374151;
}

/* Panneau de logs (DevTools style) */
.logs-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 350px;
    background: #1e1e1e;
    border-top: 3px solid #3b82f6;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.logs-panel.open {
    transform: translateY(0);
}

.logs-resize-handle {
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    z-index: 1001;
}

.logs-resize-handle:hover,
body.logs-resizing .logs-resize-handle {
    background: rgba(59, 130, 246, 0.4);
}

body.logs-resizing {
    cursor: ns-resize;
    user-select: none;
}

.logs-header {
    background: #2d2d2d;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #3b3b3b;
}

.logs-title {
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logs-job-info {
    color: #9ca3af;
    font-size: 12px;
    font-family: monospace;
}

.logs-controls {
    display: flex;
    gap: 8px;
}

.log-btn {
    background: transparent;
    border: 1px solid #4b5563;
    color: #e5e7eb;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.log-btn:hover {
    background: #3b3b3b;
    border-color: #6b7280;
}

.log-btn.close {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.log-btn.close:hover {
    background: #dc2626;
}

.logs-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.logs-content::-webkit-scrollbar {
    width: 10px;
}

.logs-content::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.logs-content::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 5px;
}

.logs-content::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.log-entry {
    padding: 4px 8px;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
}

.log-entry:hover {
    background: #2d2d2d;
}

.log-entry__row {
    display: flex;
    gap: 12px;
}

.log-timestamp {
    color: #6b7280;
    min-width: 150px;
}

.log-step {
    color: #9ca3af;
    min-width: 120px;
    font-weight: 600;
}

.log-message {
    color: #e5e7eb;
    flex: 1;
}

.log-entry.info {
    border-left-color: #3b82f6;
}

.log-entry.info .log-step {
    color: #60a5fa;
}

.log-entry.success {
    border-left-color: #10b981;
}

.log-entry.success .log-step {
    color: #34d399;
}

.log-entry.warning {
    border-left-color: #f59e0b;
}

.log-entry.warning .log-step {
    color: #fbbf24;
}

.log-entry.error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.log-entry.error .log-step {
    color: #f87171;
}

.log-details {
    margin: 4px 0 2px 20px;
    padding: 4px 8px;
    background: #262626;
    border-left: 2px solid #5c1c1c;
    border-radius: 2px;
}

pre.log-details {
    white-space: pre-wrap;
    word-break: break-all;
}

.log-details__row {
    display: flex;
    gap: 8px;
    padding: 1px 0;
    line-height: 1.4;
}

.log-details__line {
    color: #6a9955;
    min-width: 40px;
    flex-shrink: 0;
}

.log-details__field {
    color: #9cdcfe;
    min-width: 100px;
    flex-shrink: 0;
}

.log-details__msg {
    color: #f48771;
}

.logs-empty {
    color: #6b7280;
    text-align: center;
    padding: 40px;
    font-style: italic;
}

.logs-loading {
    color: #9ca3af;
    text-align: center;
    padding: 20px;
}

/* Animation de chargement */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #4b5563;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Recherche libre dans le tableau (fichier, organisation, UUID)
   ============================================================ */

.table-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
}

.table-search-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.table-search input[type="text"] {
    border: none;
    background: transparent;
    font-size: 13px;
    color: #111827;
    width: 320px;
    outline: none;
}

.table-search.active {
    border-color: #f59e0b;
    background: #fffbeb;
}

.table-search-clear {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.table-search-clear:hover {
    color: #ef4444;
}

/* ============================================================
   Filtre par plage de dates
   ============================================================ */

.date-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-inputs input[type="date"] {
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 13px;
    background: white;
    color: #374151;
    cursor: pointer;
}

.date-inputs input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.date-sep {
    color: #9ca3af;
    font-size: 13px;
    user-select: none;
}

.date-nav-btn {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #374151;
    font-size: 16px;
    padding: 2px 8px;
    cursor: pointer;
    line-height: 1.4;
    transition: all 0.15s;
    flex-shrink: 0;
}

.date-nav-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.date-shortcuts {
    display: flex;
    gap: 4px;
    border-left: 1px solid #d1d5db;
    padding-left: 8px;
    margin-left: 2px;
}

.date-shortcut {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.date-shortcut:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.date-shortcut.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* ============================================================
   En-tête de page (titre + bouton upload)
   ============================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-header h1 {
    margin-bottom: 0;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-info {
    font-size: 10px;
    color: #828282;
}

.version-hash {
    font-family: monospace;
}

.btn-upload {
    background: #3b82f6;
    color: white;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-upload:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
}

/* ============================================================
   Modal d'upload — onglets ZIP / PDF+CSV
   ============================================================ */

.upload-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.upload-tab {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.upload-tab:hover {
    color: #374151;
    background: #f3f4f6;
}

.upload-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: white;
}

/* Container empilant les deux panneaux dans la même cellule de grille
   → la hauteur de la modale ne change pas lors du changement d'onglet */
.upload-panels-container {
    display: grid;
}
.upload-panels-container > .upload-panel {
    grid-column: 1;
    grid-row: 1;
}

/* Panneau d'un onglet */
.upload-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Masquer un panneau sans le retirer du flux (la hauteur est préservée) */
.upload-panel.panel-hidden {
    visibility: hidden;
    pointer-events: none;
}

/* Panneau PDF+CSV : deux zones côte à côte */
#panelDirect {
    flex-direction: row;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

/* Colonne PDF ou CSV : zone de drop + info fichier empilés */
.direct-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Zone de drop compacte pour PDF et CSV — padding vertical aligné sur la zone ZIP */
.upload-drop-zone-sm {
    padding: 40px 12px;
}

.upload-drop-zone-sm .upload-drop-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.upload-drop-zone-sm .upload-drop-text {
    font-size: 14px;
    margin-bottom: 2px;
}

.upload-drop-zone-sm .upload-drop-sub {
    font-size: 12px;
    margin-top: 2px;
}

/* ============================================================
   Modal d'upload
   ============================================================ */

.upload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.upload-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.upload-modal {
    background: white;
    border-radius: 12px;
    width: 520px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s;
    overflow: hidden;
}

.upload-overlay.open .upload-modal {
    transform: scale(1) translateY(0);
}

.upload-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.upload-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.upload-close-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.2s;
}

.upload-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.upload-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Zone de drag & drop */
.upload-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    user-select: none;
}

.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

.upload-drop-zone.drag-over {
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.upload-drop-zone.has-file {
    border-color: #10b981;
    background: #f0fdf4;
    padding: 20px;
}

.upload-drop-icon {
    font-size: 40px;
    margin-bottom: 12px;
    line-height: 1;
}

.upload-drop-text {
    color: #374151;
    font-size: 15px;
    margin-bottom: 6px;
}

.upload-drop-sub {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 4px;
}

/* Fichier sélectionné */
.upload-file-info {
    display: none;
    align-items: center;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    padding: 12px 16px;
}

.upload-file-info.visible {
    display: flex;
}

.upload-file-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.upload-file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

#uploadFileName,
#pdfFileName,
#csvFileName {
    display: block;
    font-weight: 600;
    color: #065f46;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-file-size {
    color: #6b7280;
    font-size: 12px;
}

.upload-remove-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.upload-remove-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Message d'erreur */
.upload-error {
    display: none;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
}

.upload-error.visible {
    display: block;
}

/* Barre de progression upload */
.upload-progress {
    display: none;
}

.upload-progress.visible {
    display: block;
}

.upload-progress-text {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
    text-align: center;
}

/* Bouton de soumission */
.upload-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.upload-submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   Bande de contrôles worker — homogénéité visuelle
   Hauteur commune : padding 6px 14px + font-size 14px ≈ 32 px
   Hover : opacité 0.8 uniquement, sans transition ni déplacement
   ============================================================ */
/*
.worker-indicator:hover {
    opacity: 0.8;
}
*/
/* Boutons de contrôle du worker */
.btn-worker-start {
    background: #10b981;
    color: white;
    font-size: 14px;
    padding: 6px 14px;
    min-width: 110px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: none;
    white-space: nowrap;
}

.btn-worker-start:hover:not(:disabled) {
    opacity: 0.8;
}

.btn-worker-start:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-worker-stop {
    background: #ef4444;
    color: white;
    font-size: 14px;
    padding: 6px 14px;
    min-width: 110px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: none;
    white-space: nowrap;
}

.btn-worker-stop:hover:not(:disabled) {
    opacity: 0.8;
}

.btn-worker-stop:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Bouton secondaire (neutre) — padding aligné sur les boutons worker */
.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 6px 14px;
    transition: none;
}

.btn-secondary:hover {
    opacity: 0.8;
}

/* ============================================================
   Modale Paramètres
   ============================================================ */

.settings-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-field label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.settings-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-input-row input[type="number"] {
    width: 110px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    color: #111827;
    transition: border-color 0.15s;
}

.settings-input-row input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.settings-unit {
    color: #6b7280;
    font-size: 14px;
}

.settings-hint {
    color: #9ca3af;
    font-size: 12px;
}

.settings-error {
    display: none;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
}

.settings-error.visible {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 400px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
    
    .logs-panel {
        height: 300px;
    }

    .pagination-container {
        flex-direction: column;
        gap: 10px;
    }
}
