/* ============================================================
   jobs.css — Page de suivi des jobs d'import
   ============================================================ */

.jobs-page {
    padding: 30px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- Header ---- */
.jobs-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.jobs-header h1 {
    font-size: 1.6rem;
    color: #005068;
    margin: 0;
}

.jobs-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
    flex: 1;
}

.btn-refresh {
    background: #005068;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background 0.2s;
}
.btn-refresh:hover { background: #007a9a; }

/* ---- Loading / empty / error ---- */
.jobs-loading, .jobs-empty, .jobs-error {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 1.1rem;
}
.jobs-loading i, .jobs-empty i, .jobs-error i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 14px;
    color: #bbb;
}
.jobs-empty p { margin: 0 0 18px; }

.btn-goto-import {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #005068;
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.btn-goto-import:hover { background: #007a9a; }

/* ---- Table ---- */
.jobs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,80,104,0.09);
}

.jobs-table thead tr {
    background: #005068;
    color: #fff;
}

.jobs-table thead th {
    padding: 11px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.jobs-table tbody tr {
    border-bottom: 1px solid #e8f2f5;
    transition: background 0.15s;
}
.jobs-table tbody tr:hover { background: #f0f8fb; }

.jobs-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.job-file {
    font-weight: 600;
    color: #005068;
    white-space: nowrap;
}
.job-file i { color: #217346; margin-right: 5px; }

td.num { text-align: center; font-weight: 600; }
td.date { color: #888; font-size: 0.82rem; white-space: nowrap; }
td.has-errors { color: #e53935; }

/* ---- Badges ---- */
.job-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-pending  { background: #fff8e1; color: #f57f17; }
.badge-running  { background: #e3f2fd; color: #1565c0; }
.badge-done     { background: #e8f5e9; color: #2e7d32; }
.badge-error    { background: #fdecea; color: #c62828; }
.badge-undone   { background: #fff3e0; color: #e65100; }

/* ---- Mode ---- */
.job-mode {
    background: #e8f2f5;
    color: #005068;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ---- Barre de progression ---- */
.job-progress-wrap {
    position: relative;
    background: #e0eef2;
    border-radius: 6px;
    height: 18px;
    min-width: 100px;
    overflow: hidden;
}

.job-progress-bar {
    height: 100%;
    background: #1565c0;
    border-radius: 6px;
    transition: width 0.4s ease;
}
.job-progress-bar.bar-done  { background: #2e7d32; }
.job-progress-bar.bar-error { background: #c62828; }

.job-progress-label {
    position: absolute;
    right: 6px;
    top: 0;
    line-height: 18px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
}

/* ---- Erreurs détaillées ---- */
.job-errors-row td {
    background: #fff8f8;
    padding: 6px 20px 10px;
}

.job-errors-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
    color: #c62828;
}
.job-errors-list li {
    padding: 2px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* ---- Bouton suppression ---- */
.btn-delete-job {
    background: none;
    border: 1px solid #e0e0e0;
    color: #999;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.btn-delete-job:hover {
    background: #fdecea;
    border-color: #e53935;
    color: #e53935;
}

/* ---- Bouton undo import ---- */
.btn-undo-job {
    background: none;
    border: 1px solid #e53935;
    color: #e53935;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    margin-left: 4px;
}
.btn-undo-job:hover {
    background: #fdecea;
    border-color: #b71c1c;
    color: #b71c1c;
}
