/**
 * ═══════════════════════════════════════════════════════════════════════════
 * KOLEKTIS PROJECTS — Styles
 * ═══════════════════════════════════════════════════════════════════════════
 */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Couleurs — dark medium neutre */
    --bg:           #1c1c22;
    --bg2:          #212128;
    --surface:      #28282f;
    --surface2:     #303038;
    --surface3:     #3a3a42;
    --border:       #43434d;
    --border2:      #515160;

    --accent:       #6ee7b7;
    --accent2:      #a5b4fc;
    --accent-dim:   rgba(110, 231, 183, 0.18);

    --text:         #ededf0;
    --text2:        #a9a9b8;
    --text-muted:   #76768a;
    
    --success:      #34d399;
    --warning:      #fbbf24;
    --error:        #f87171;
    --info:         #60a5fa;
    
    /* Espacements */
    --space-xs:     4px;
    --space-sm:     8px;
    --space-md:     16px;
    --space-lg:     24px;
    --space-xl:     32px;
    
    /* Rayons */
    --radius-sm:    6px;
    --radius-md:    10px;
    --radius-lg:    16px;
    --radius-full:  9999px;
    
    /* Transitions */
    --transition:   0.15s ease;
    
    /* Tailles */
    --header-h:     56px;
    --sidebar-w:    280px;
    --monitor-w:    320px;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Grille de fond */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

.hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ════════════════════════════════════════════════════════════════════════════ */

.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: var(--bg);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
}

.logo-accent {
    color: var(--accent2);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: var(--space-lg);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.login-note {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-md);
    color: var(--warning);
    font-size: 11px;
}

.login-error {
    padding: var(--space-sm) var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #ef4444;
    font-size: 12px;
    text-align: left;
}

.login-toggle {
    margin-top: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 12px;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════════════════════════════════════════ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    text-align: left;
}

.form-group label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

input, textarea, select {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--transition);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(110, 231, 183, 0.3);
}

.btn-accent {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-accent:hover:not(:disabled) {
    background: rgba(110, 231, 183, 0.25);
}

.btn-outline {
    background: transparent;
    border-color: var(--border2);
    color: var(--text2);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

.btn-full {
    width: 100%;
}

.btn-arrow {
    transition: transform var(--transition);
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* ════════════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ════════════════════════════════════════════════════════════════════════════ */

.app-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Header */
.header {
    height: var(--header-h);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.logo {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-sep {
    width: 1px;
    height: 24px;
    background: var(--border2);
}

/* Credits bar */
.credits-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 11px;
}
.credits-plan {
    color: var(--accent2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.credits-gauge {
    width: 60px;
    height: 6px;
    background: var(--surface3);
    border-radius: 3px;
    overflow: hidden;
}
.credits-gauge-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.credits-gauge-fill.warning {
    background: var(--warning);
}
.credits-gauge-fill.danger {
    background: var(--error);
}
.credits-text {
    color: var(--text2);
    white-space: nowrap;
}

.header-stats {
    display: flex;
    gap: var(--space-lg);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.stat-active { color: var(--accent2); }
.stat-done { color: var(--success); }

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-email {
    font-size: 12px;
    color: var(--text2);
}

.monitor-toggle-btn {
    display: none !important;
}

.header-mobile-menu-btn {
    display: none !important;
}

.header-mobile-dropdown {
    position: absolute;
    top: var(--header-h);
    right: 0;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    z-index: 200;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.header-mobile-dropdown .btn {
    justify-content: flex-start;
    width: 100%;
    text-align: left;
}

.monitor-mobile-close {
    padding: var(--space-sm) var(--space-md);
    text-align: right;
    flex-shrink: 0;
    font-size: 14px;
    align-self: flex-end;
    margin: var(--space-sm) var(--space-sm) 0;
}

.mobile-menu-credits {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: var(--space-xs);
}

/* Main Layout */
.main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ════════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════════════════ */

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.projects-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.project-item {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: var(--space-xs);
}

.project-item:hover {
    background: var(--surface);
}

.project-item.active {
    background: var(--surface2);
    border-left: 2px solid var(--accent);
}

.project-item.processing {
    border-left: 2px solid var(--accent2);
    position: relative;
    overflow: hidden;
}

.project-item.processing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.08), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.project-processing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent2);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    vertical-align: middle;
    margin-left: 4px;
}

.project-item-name {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text);
}

.project-item-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    gap: var(--space-md);
}

.projects-empty {
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
}

.projects-empty-icon {
    font-size: 32px;
    opacity: 0.3;
    margin-bottom: var(--space-sm);
}

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
}


/* ════════════════════════════════════════════════════════════════════════════
   CONTENT
   ════════════════════════════════════════════════════════════════════════════ */

.content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.2;
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: var(--space-sm);
}

.empty-create-btn {
    margin-top: var(--space-lg);
}

/* Folder agent bar */
.folder-agent-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.folder-agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    font-size: 12px;
}

.folder-agent-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.folder-agent-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.folder-agent-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.folder-agent-label {
    color: var(--text-muted);
    font-size: 12px;
}

.folder-agent-path {
    font-size: 11px;
    font-family: 'DM Mono', monospace;
    background: var(--bg);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--text2);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-agent-status {
    font-size: 11px;
    color: var(--accent);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    visibility: hidden;
}

.agent-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 26, 0.75);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.agent-overlay.visible {
    pointer-events: all;
    visibility: visible;
}

.agent-overlay.visible::before {
    opacity: 1;
}

.agent-overlay-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    color: var(--text);
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, opacity 0.4s ease 0.05s;
}

.agent-overlay.visible .agent-overlay-content {
    transform: translateY(0);
    opacity: 1;
}

.agent-overlay.closing::before {
    opacity: 0;
}

.agent-overlay.closing .agent-overlay-content {
    transform: translateY(-10px);
    opacity: 0;
}

.agent-overlay-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(129, 140, 248, 0.2);
    border-top-color: var(--accent2);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.agent-overlay-text {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 600;
}

.agent-overlay-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.agent-alert {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text2);
    animation: fileSlideIn 0.35s ease both;
}

.agent-alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.agent-alert-text {
    flex: 1;
}

.agent-alert-close {
    opacity: 0.5;
    font-size: 16px;
}

.agent-already-running {
    padding: var(--space-md);
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: var(--radius-md);
    color: #34d399;
    font-size: 13px;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Project Detail */
.project-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    position: relative;
}

.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.project-title {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.project-desc {
    color: var(--text-muted);
    font-size: 12px;
}

.project-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* Files Section */
.files-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.files-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.files-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.file-checkbox-all {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

.files-count {
    font-size: 11px;
    color: var(--text-muted);
}

.files-dropzone {
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: background var(--transition);
}

.files-dropzone:hover {
    background: var(--surface2);
}

.files-dropzone.dragover {
    background: var(--accent-dim);
    border: 2px dashed var(--accent);
}

.dropzone-icon {
    font-size: 40px;
    opacity: 0.5;
    margin-bottom: var(--space-md);
}

.dropzone-content p {
    color: var(--text2);
    margin-bottom: var(--space-sm);
}

.dropzone-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.files-list {
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), opacity 0.4s ease, transform 0.4s ease;
}

/* Animations d'entrée */
.file-item.slide-in,
.project-item.slide-in {
    animation: fileSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fileSlideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fichier en cours de traitement */
.file-item.processing {
    position: relative;
    background: rgba(129, 140, 248, 0.04);
}

.file-item.processing::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    background: var(--accent2);
    animation: processingBar 2s ease-in-out infinite;
}

@keyframes processingBar {
    0%   { width: 0%; left: 0; }
    50%  { width: 40%; left: 30%; }
    100% { width: 0%; left: 100%; }
}

/* Fichier traité — flash vert puis fade out */
.file-item.done {
    animation: fileDone 0.6s ease both;
}

@keyframes fileDone {
    0%   { background: rgba(16, 185, 129, 0.15); opacity: 1; }
    60%  { background: rgba(16, 185, 129, 0.08); opacity: 1; }
    100% { background: transparent; opacity: 0.4; }
}

/* Fichier en erreur */
.file-item.failed {
    animation: fileFailed 0.4s ease both;
    background: rgba(239, 68, 68, 0.06);
}

@keyframes fileFailed {
    0%, 25%, 50% { transform: translateX(-2px); }
    12%, 37% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: var(--surface2);
}

.file-item.active {
    background: var(--surface3);
    border-left: 2px solid var(--accent);
}

.file-item.active .file-name {
    color: var(--accent);
}

.file-item.active .file-preview-btn {
    opacity: 1;
    color: var(--accent);
}

.file-icon {
    font-size: 20px;
    opacity: 0.6;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-toolbar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.files-search {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition);
}

.files-search:focus {
    border-color: var(--accent);
}

.files-search::placeholder {
    color: var(--text-muted);
}

.files-sort {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 11px;
    font-family: inherit;
    color: var(--text2);
    cursor: pointer;
    outline: none;
}

.file-meta {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.file-size {
    font-size: 11px;
    color: var(--text-muted);
}

.file-pages {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
}

.file-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* History Section */
.history-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.history-section h3 {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.history-empty {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: var(--space-lg);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg2);
    border-radius: var(--radius-md);
    font-size: 12px;
}

.history-item-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.history-item-status.done { background: var(--success); }
.history-item-status.failed { background: var(--error); }
.history-item-status.processing { background: var(--accent2); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

/* Dossier local — liste fichiers intégrée dans la barre agent */
.folder-files-count {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 10px;
}

.folder-files-list {
    max-height: 220px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
}

.folder-file-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-lg);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.folder-file-item:last-child { border-bottom: none; }

.folder-file-icon {
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.folder-file-name {
    flex: 1;
    min-width: 0;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-file-meta {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.folder-file-item.processed .folder-file-name {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.5;
}

.history-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.history-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.history-badge.done { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.history-badge.failed { background: rgba(248, 113, 113, 0.15); color: var(--error); }
.history-badge.processing { background: rgba(129, 140, 248, 0.15); color: var(--accent2); }

.history-item-files {
    font-size: 11px;
    color: var(--text2);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    display: flex;
    gap: var(--space-md);
    margin-top: 2px;
}

.history-item-date,
.history-item-meta span {
    color: var(--text-muted);
    font-size: 11px;
}

.history-item-errors {
    color: var(--error) !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   PROCESSED FILES SECTION
   ════════════════════════════════════════════════════════════════════════════ */

.processed-section {
    margin-top: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.processed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.processed-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.processed-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.processed-count {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    background: var(--surface3);
    color: var(--text2);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.processed-list {
    max-height: 350px;
    overflow-y: auto;
}

/* ════════════════════════════════════════════════════════════════════════════
   PENDING FILES SECTION (fichiers en attente côté serveur)
   ════════════════════════════════════════════════════════════════════════════ */

.pending-section {
    margin-top: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.pending-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: rgba(129, 140, 248, 0.05);
}

.pending-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pending-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent2);
}

.pending-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pending-count {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent2);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.pending-list {
    max-height: 200px;
    overflow-y: auto;
}

.pending-status {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.pending-status.waiting {
    background: rgba(118, 118, 138, 0.15);
    color: var(--text-muted);
}

.pending-status.processing {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent2);
    animation: pulse 1.5s infinite;
}

.pending-status.done {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.pending-status.failed {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.pending-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-lg);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.pending-item:last-child { border-bottom: none; }

.pending-icon { font-size: 14px; flex-shrink: 0; }

.pending-info { flex: 1; min-width: 0; }

.pending-name {
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pending-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
}

/* Groupe (1 job = 1 groupe) */
.processed-group {
    border-bottom: 1px solid var(--border);
}

.processed-group:last-child {
    border-bottom: none;
}

.processed-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--surface2);
}

.processed-group-info {
    flex: 1;
    min-width: 0;
}

.processed-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.processed-group-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.processed-group-errors {
    color: var(--error);
}

/* Fichier dans un groupe */
.processed-group-files {
    padding: 0;
}

.processed-file {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-lg) var(--space-xs) calc(var(--space-lg) + 12px);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.processed-file:last-child {
    border-bottom: none;
}

.processed-file:hover {
    background: var(--surface2);
}

.processed-file-icon {
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.processed-file-icon.done {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.processed-file-icon.failed {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.processed-file-name {
    flex: 1;
    min-width: 0;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.processed-file-detail {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
    flex-shrink: 0;
}

.processed-file-error {
    font-size: 10px;
    color: var(--error);
    flex-shrink: 0;
}

.processed-file-results {
    flex-shrink: 0;
    font-size: 10px;
    padding: 2px 8px;
}

/* ════════════════════════════════════════════════════════════════════════════
   MONITOR PANEL
   ════════════════════════════════════════════════════════════════════════════ */

.monitor-panel {
    width: var(--monitor-w);
    background: var(--bg2);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.monitor-panel.expanded {
    position: fixed;
    right: 0;
    top: var(--header-h);
    bottom: 0;
    width: 500px;
    z-index: 100;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}

.monitor-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.monitor-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.monitor-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.btn-icon:hover {
    background: var(--surface);
    color: var(--text);
}

.monitor-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

.monitor-dot.off {
    background: var(--error);
    box-shadow: 0 0 8px var(--error);
}

.monitor-dot.reconnecting {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: pulse 1s infinite;
}

.monitor-badge {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
}

/* Monitor Tabs */
.monitor-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-sm);
}

.monitor-tab {
    flex: 1;
    padding: var(--space-sm) var(--space-sm);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all var(--transition);
}

.monitor-tab:hover {
    color: var(--text2);
}

.monitor-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-count {
    background: var(--border2);
    color: var(--text2);
    padding: 1px 5px;
    border-radius: var(--radius-full);
    font-size: 9px;
}

.monitor-tab.active .tab-count {
    background: var(--accent-dim);
    color: var(--accent);
}

.tab-count.warn {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

/* Monitor Content */
.monitor-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Jobs List */
.jobs-list {
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

.jobs-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.jobs-empty span {
    font-size: 24px;
    opacity: 0.3;
}

/* Job Card */
.job-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    position: relative;
    overflow: hidden;
}

.job-card.processing {
    border-left: 2px solid var(--accent2);
}

.job-card.processing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.05), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.job-card.done { border-left: 2px solid var(--success); opacity: 0.7; }
.job-card.failed { border-left: 2px solid var(--error); }

.job-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.job-name {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 12px;
}

.job-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.job-badge.processing { background: rgba(129, 140, 248, 0.15); color: var(--accent2); }
.job-badge.done { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.job-badge.failed { background: rgba(248, 113, 113, 0.15); color: var(--error); }

.job-file {
    font-size: 10px;
    color: var(--text2);
    margin-bottom: var(--space-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-progress {
    margin-bottom: var(--space-sm);
}

.progress-bar {
    height: 3px;
    background: var(--border2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent2), var(--accent));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.job-card.done .progress-fill { background: var(--success); }
.job-card.failed .progress-fill { background: var(--error); }

.job-ocr {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(129, 140, 248, 0.08);
    border-radius: var(--radius-sm);
}

.ocr-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent2);
    animation: pulse 1s infinite;
}

.job-warning {
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: var(--radius-sm);
    font-size: 10px;
    color: var(--warning);
}

.job-errors {
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.15);
    border-radius: var(--radius-sm);
    font-size: 10px;
    color: var(--error);
    max-height: 40px;
    overflow-y: auto;
}

.job-meta {
    display: flex;
    gap: var(--space-md);
    font-size: 10px;
    color: var(--text-muted);
}

.job-meta span {
    color: var(--text2);
}

/* Logs */
.monitor-logs {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.log-count {
    background: var(--border2);
    color: var(--text2);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 9px;
}

.logs-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-entry {
    display: flex;
    gap: var(--space-sm);
    padding: 5px var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 11px;
    border-left: 2px solid transparent;
    transition: background 0.2s;
}

/* Animation pour les nouveaux logs */
.log-entry.log-new {
    animation: logSlideIn 0.4s ease both;
    background: rgba(129, 140, 248, 0.08);
}

@keyframes logSlideIn {
    from { opacity: 0; transform: translateY(-10px); max-height: 0; padding: 0 var(--space-sm); }
    to { opacity: 1; transform: translateY(0); max-height: 60px; padding: 5px var(--space-sm); }
}

.log-entry:hover {
    background: var(--surface);
}

.log-time {
    color: var(--text-muted);
    font-size: 9px;
    flex-shrink: 0;
    min-width: 50px;
}

.log-msg {
    color: var(--text2);
    flex: 1;
    word-break: break-word;
    line-height: 1.4;
}

/* Couleurs par type avec bordure gauche */
.log-entry.error { border-left-color: var(--error); }
.log-entry.error .log-msg { color: var(--error); }

.log-entry.warn { border-left-color: var(--warning); }
.log-entry.warn .log-msg { color: var(--warning); }

.log-entry.success { border-left-color: var(--success); }
.log-entry.success .log-msg { color: var(--success); }

.log-entry.info { border-left-color: var(--accent2); }
.log-entry.info .log-msg { color: var(--text2); }

/* Indicateur live en haut des logs */
.logs-live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px var(--space-md);
    background: rgba(129, 140, 248, 0.08);
    border-bottom: 1px solid rgba(129, 140, 248, 0.2);
    font-size: 11px;
    color: var(--accent2);
}

.logs-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent2);
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}

.logs-live-text {
    flex: 1;
}

/* Review Section */
.review-toolbar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.error-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: var(--space-sm);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.error-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.error-stat:hover {
    background: var(--surface2);
}

.error-stat.active {
    background: var(--surface2);
}

.error-stat-icon {
    font-size: 14px;
    margin-bottom: 2px;
}

.error-stat-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.error-stat-label {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.error-stat[data-type="file-not-found"] .error-stat-icon { color: var(--warning); }
.error-stat[data-type="recitation"] .error-stat-icon { color: var(--accent2); }
.error-stat[data-type="timeout"] .error-stat-icon { color: var(--error); }
.error-stat[data-type="service-down"] .error-stat-icon { color: var(--error); }

.review-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.review-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.review-empty span {
    font-size: 24px;
    opacity: 0.5;
    color: var(--success);
}

.review-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xs);
}

.review-item-thread {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 11px;
    color: var(--text);
}

.review-item-count {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
    border-radius: var(--radius-full);
}

.review-item-file {
    font-size: 10px;
    color: var(--text2);
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-item-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.page-chip {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.page-chip.file-not-found {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.page-chip.recitation {
    background: rgba(129, 140, 248, 0.12);
    color: var(--accent2);
    border: 1px solid rgba(129, 140, 248, 0.2);
}

.page-chip.timeout,
.page-chip.service-down {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.page-chip.other {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text2);
    border: 1px solid var(--border2);
}

/* Logs Toolbar */
.logs-toolbar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.logs-filter {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text2);
    font-family: inherit;
    font-size: 10px;
    padding: 4px 8px;
    outline: none;
    cursor: pointer;
}

.logs-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Monitor Footer (System Stats) */
.monitor-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--surface);
}

.sys-stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 10px;
}

.sys-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 28px;
}

.sys-bar {
    width: 50px;
    height: 4px;
    background: var(--border2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.sys-fill {
    height: 100%;
    background: var(--success);
    border-radius: var(--radius-full);
    transition: width 0.3s, background 0.3s;
}

.sys-fill.warn { background: var(--warning); }
.sys-fill.error { background: var(--error); }

.sys-value {
    color: var(--text2);
    min-width: 40px;
}

.sys-status {
    font-size: 8px;
}

.sys-status.connected { color: var(--success); }
.sys-status.disconnected { color: var(--error); }
.sys-status.reconnecting { color: var(--warning); animation: pulse 1s infinite; }

/* ════════════════════════════════════════════════════════════════════════════
   MODALS
   ════════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalOverlayIn 0.2s ease;
}

.modal-overlay.closing {
    animation: modalOverlayOut 0.2s ease forwards;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.closing .modal {
    animation: modalOut 0.2s ease forwards;
}

@keyframes modalOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalOverlayOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.95) translateY(10px); }
}

.modal {
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-family: 'Syne', sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--surface2);
    color: var(--text);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* Onboarding Modal */
.onboarding-modal {
    max-width: 480px;
    text-align: center;
}
.onboarding-icon {
    font-size: 40px;
    margin-bottom: var(--space-md);
    opacity: 0.7;
}
.onboarding-title {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}
.onboarding-desc {
    color: var(--text2);
    font-size: 12.5px;
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}
.onboarding-modal .watcher-steps {
    text-align: left;
}
.onboarding-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--surface2);
    border-radius: var(--radius-md);
    color: var(--text2);
    font-size: 12px;
}

/* Results Modal */
.results-stats {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg2);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.results-stat {
    text-align: center;
}

.results-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.results-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.results-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: var(--space-md);
}

.results-tab {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.results-tab:hover {
    color: var(--text2);
}

.results-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.results-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    max-height: 400px;
    overflow: auto;
}

.results-panel pre {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text2);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ════════════════════════════════════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 500;
    display: flex;
    flex-direction: column-reverse;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: toastIn 0.3s ease;
    max-width: 420px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-info { border-left: 3px solid var(--info); }

.toast-out { opacity: 0; transform: translateX(20px); transition: all 0.3s ease; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }

.toast-msg {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast-action {
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-sm);
    padding: 2px 10px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition);
}

.toast-action:hover { background: rgba(110, 231, 183, 0.25); }

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.toast-close:hover { color: var(--text); }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

/* Tablette large / petit écran desktop */
@media (max-width: 1200px) {
    :root {
        --monitor-w: 260px;
        --sidebar-w: 240px;
    }

    .preview-panel.open {
        width: 320px;
        min-width: 320px;
    }

    .header-stats .stat-label {
        display: none;
    }

    .credits-bar span:not(.credits-count) {
        display: none;
    }
}

/* Tablette */
@media (max-width: 900px) {
    :root {
        --header-h: 48px;
    }

    html, body {
        overflow: auto;
        height: auto;
    }

    /* Layout scrollable sur tablette/mobile */
    .app-screen {
        position: relative;
        min-height: 100vh;
        overflow: visible;
    }

    .main-layout {
        flex-direction: column;
        overflow: visible;
        min-height: 0;
    }

    /* Sidebar en bandeau horizontal */
    .sidebar {
        width: 100%;
        max-height: 140px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }

    .projects-list {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: var(--space-sm);
        flex-wrap: nowrap;
        padding: var(--space-xs) var(--space-sm);
    }

    .project-item {
        min-width: 160px;
        flex-shrink: 0;
    }

    .sidebar-footer {
        display: none;
    }

    /* Monitor caché par défaut sur tablette, visible via toggle */
    .monitor-panel {
        display: none;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        flex-shrink: 0;
    }

    .monitor-panel.mobile-visible {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 200;
        box-shadow: none;
    }

    /* Preview en overlay */
    .preview-panel.open {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 90vw;
        min-width: 0;
        z-index: 200;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    }

    .content {
        flex: none;
        overflow: visible;
        padding: var(--space-md);
        min-height: calc(100vh - var(--header-h) - 140px);
    }

    /* Bouton toggle monitor visible */
    .monitor-toggle-btn {
        display: inline-flex !important;
    }

    /* Header simplifié */
    .header-stats {
        display: none;
    }

    .header-sep {
        display: none;
    }

    .header-left .logo span:not(.logo-dot) {
        font-size: 13px;
    }

    /* Résultats et jobs */
    .job-group-header {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .job-stats {
        flex-wrap: wrap;
    }

    /* Folder bar */
    .folder-agent-bar {
        padding: var(--space-sm) var(--space-md);
    }

    .folder-bar-header {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .folder-bar-actions .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    :root {
        --header-h: 44px;
        --space-lg: 16px;
        --space-xl: 20px;
    }

    .header {
        padding: var(--space-xs) var(--space-md);
    }

    /* Cacher les éléments desktop, montrer le hamburger */
    .header-desktop {
        display: none !important;
    }

    .header-mobile-menu-btn {
        display: inline-flex !important;
        font-size: 18px;
    }

    .logo span {
        font-size: 12px;
    }

    /* Sidebar en bandeau plus compact */
    .sidebar {
        max-height: 140px;
    }

    .sidebar-header {
        padding: var(--space-xs) var(--space-md);
    }

    .sidebar-header h2 {
        font-size: 12px;
    }

    .project-item {
        min-width: 130px;
        padding: var(--space-sm);
    }

    .project-item-top .project-name {
        font-size: 12px;
    }

    .project-meta {
        font-size: 10px;
    }

    /* Content zone */
    .project-header {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }

    .project-title {
        font-size: 16px;
    }

    .project-actions {
        flex-direction: column;
        gap: var(--space-sm);
        width: 100%;
    }

    .project-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Folder bar compact */
    .folder-bar-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .folder-path {
        font-size: 10px;
        word-break: break-all;
    }

    .folder-bar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .folder-files-list {
        max-height: 200px;
    }

    /* Jobs */
    .job-group-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .job-stats {
        width: 100%;
        flex-wrap: wrap;
    }

    .job-file-item {
        flex-wrap: wrap;
    }

    .job-file-stats {
        width: 100%;
        justify-content: flex-start;
    }

    /* Preview overlay plein écran sur mobile */
    .preview-panel.open {
        width: 100vw;
        left: 0;
    }

    /* Files toolbar */
    .files-toolbar {
        flex-direction: column;
    }

    /* Toast */
    .toast-container {
        left: var(--space-sm);
        right: var(--space-sm);
        bottom: var(--space-sm);
    }

    .toast {
        max-width: 100%;
        font-size: 12px;
    }

    /* Modals */
    .modal-backdrop .modal {
        width: 95vw;
        margin: var(--space-sm);
        max-height: 90vh;
    }

    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Monitor caché par défaut, plein écran via toggle */
    .monitor-panel {
        overflow-y: auto;
    }

    /* Agent alert */
    .agent-alert {
        flex-direction: column;
        text-align: center;
    }

    /* Login */
    .login-card {
        margin: var(--space-md);
        padding: var(--space-lg);
    }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* ════════════════════════════════════════════════════════════════════════════
   PROJECT ITEM — TOP ROW (nom + bouton supprimer)
   ════════════════════════════════════════════════════════════════════════════ */

.project-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.project-delete-btn {
    opacity: 0;
    color: var(--text-muted);
    font-size: 16px;
    transition: opacity var(--transition), color var(--transition);
}

.project-item:hover .project-delete-btn {
    opacity: 1;
}

.project-delete-btn:hover {
    color: var(--error) !important;
    background: rgba(248, 113, 113, 0.15) !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   PROJECT EDIT BUTTON
   ════════════════════════════════════════════════════════════════════════════ */

.project-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.project-edit-btn {
    opacity: 0;
    color: var(--text-muted);
    font-size: 14px;
    transition: opacity var(--transition), color var(--transition);
}

.project-title-row:hover .project-edit-btn {
    opacity: 1;
}

.project-edit-btn:hover {
    color: var(--accent) !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   JOB RESULTS BUTTON
   ════════════════════════════════════════════════════════════════════════════ */

.job-results-btn {
    margin-top: var(--space-sm);
    width: 100%;
    text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   QUEUE (file d'attente dans le monitoring)
   ════════════════════════════════════════════════════════════════════════════ */

.queue-list {
    margin-top: var(--space-sm);
}

.queue-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: 5px 0;
    font-size: 12px;
}

.queue-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.queue-pct {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--accent2);
    font-weight: 600;
    flex-shrink: 0;
}

.queue-sub-detail {
    font-size: 10px;
    color: var(--error);
    opacity: 0.8;
}

.queue-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

.queue-icon.done { color: var(--success); }
.queue-icon.failed { color: var(--error); }
.queue-icon.active { color: var(--accent2); animation: pulse 1s infinite; }
.queue-icon.pending { color: var(--text-muted); opacity: 0.4; }

.queue-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text2);
}

.queue-item.done .queue-name { color: var(--text-muted); }
.queue-item.active .queue-name { color: var(--text); font-weight: 500; }
.queue-item.pending .queue-name { opacity: 0.4; }

.queue-detail {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    text-align: right;
    min-width: 60px;
}

.queue-item.active .queue-detail { color: var(--accent2); }
.queue-item.failed .queue-detail { color: var(--error); }

.queue-progress {
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    margin: 1px 0 2px 24px;
    overflow: hidden;
}

.queue-progress-fill {
    height: 100%;
    background: var(--accent2);
    border-radius: 1px;
    transition: width 0.5s ease;
}

.queue-progress-fill.done {
    background: var(--success);
}

.queue-progress-fill.failed {
    background: var(--error);
}

/* Progression globale du job */
.job-global-progress {
    margin: var(--space-sm) 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.job-global-progress .queue-progress {
    height: 4px;
    margin: 0;
    border-radius: 2px;
}

.job-global-summary {
    display: flex;
    justify-content: space-between;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════════════════
   RESULTS STATS
   ════════════════════════════════════════════════════════════════════════════ */

.results-stats {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
}

.results-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.results-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.results-stat-value {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.results-stat-value.success { color: var(--success); }
.results-stat-value.error { color: var(--error); }

/* ════════════════════════════════════════════════════════════════════════════
   RESULT ERROR ITEMS
   ════════════════════════════════════════════════════════════════════════════ */

.result-error-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.result-error-page {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--error);
    min-width: 40px;
}

.result-error-file {
    color: var(--text2);
    min-width: 120px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-error-msg {
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.structured-summary {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-sm);
}

.structured-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: 8px;
    background: var(--bg-tertiary);
    margin-bottom: var(--space-sm);
    transition: background var(--transition);
}

.structured-card:hover {
    background: var(--bg-hover);
}

.structured-card-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(110, 231, 183, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.structured-card-body {
    flex: 1;
    min-width: 0;
}

.structured-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.structured-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.structured-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.structured-chip {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
}

.structured-card-parties {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.structured-party {
    font-size: 11px;
    color: var(--accent);
    background: rgba(110, 231, 183, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════════════════════
   WATCHER MODAL
   ════════════════════════════════════════════════════════════════════════════ */

.watcher-desc {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.watcher-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.watcher-step {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.watcher-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.watcher-step strong {
    font-size: 13px;
    color: var(--text);
}

.watcher-link {
    color: var(--accent);
    font-size: 12px;
}

.watcher-hint {
    font-size: 11px;
    color: var(--text-muted);
}

/* Watcher status dans le header projet */
.watcher-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 11px;
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    background: var(--surface);
    width: 100%;
    margin-top: var(--space-xs);
}

.watcher-status.active {
    background: rgba(52, 211, 153, 0.1);
    color: var(--text2);
}

.watcher-status.inactive {
    background: rgba(248, 113, 113, 0.1);
    color: var(--text-muted);
}

.watcher-status strong {
    color: var(--text);
}

.watcher-status code {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--accent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watcher-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.watcher-dot.active {
    background: var(--success);
    animation: pulse 1.5s infinite;
}

.watcher-dot.inactive {
    background: var(--error);
}

.watcher-note {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--surface2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.watcher-note strong {
    color: var(--text2);
}

.watcher-note code {
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--accent);
}

.watcher-cmd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    white-space: pre-wrap;
    word-break: break-all;
    margin: var(--space-sm) 0;
    max-height: 80px;
    overflow: auto;
}

.structured-doc-meta-old {
    display: none;
}

/* ════════════════════════════════════════════════════════════════════════════
   LOADERS / SPINNERS
   ════════════════════════════════════════════════════════════════════════════ */

.app-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    background: var(--bg);
    z-index: 999;
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    font-size: 13px;
    color: var(--text-muted);
}

.content-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

/* ════════════════════════════════════════════════════════════════════════════
   PDF PREVIEW PANEL (intégré dans le layout, à gauche du monitoring)
   ════════════════════════════════════════════════════════════════════════════ */

.preview-panel {
    width: 0;
    min-width: 0;
    background: var(--bg2);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-panel.open {
    width: 420px;
    min-width: 420px;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.preview-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.preview-title-wrap {
    overflow: hidden;
    min-width: 0;
}

.preview-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
}

.preview-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg);
    padding: var(--space-md);
}

.preview-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: var(--space-md);
    color: var(--text-muted);
    padding: var(--space-xl);
    text-align: center;
}

.preview-fallback-icon {
    font-size: 48px;
    opacity: 0.5;
}

.preview-fallback-text {
    font-size: 13px;
    line-height: 1.5;
}

.preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    background: var(--bg2);
    color: var(--text-muted);
    font-size: 13px;
    z-index: 1;
}

.preview-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Bouton aperçu sur chaque fichier */
.file-preview-btn {
    opacity: 0;
    color: var(--text-muted);
    font-size: 14px;
    transition: opacity var(--transition), color var(--transition);
    flex-shrink: 0;
}

.file-item:hover .file-preview-btn {
    opacity: 1;
}

.file-preview-btn:hover {
    color: var(--accent) !important;
}

.file-delete-btn {
    opacity: 0;
    color: var(--text-muted);
    font-size: 12px;
    transition: opacity var(--transition), color var(--transition);
    flex-shrink: 0;
}

.file-item:hover .file-delete-btn {
    opacity: 1;
}

.file-delete-btn:hover {
    color: #f87171 !important;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.job-cancel-btn {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.job-card.cancelled .job-badge {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.job-source {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

/* Rendre le nom du fichier cliquable */
.file-info {
    cursor: pointer;
    min-width: 0;
    flex: 1;
}

.file-info:hover .file-name {
    color: var(--accent);
}