* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-width: 222px;
    height: auto;
    display: block;
    margin: 7px 40px 32px;
}

.login-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2em;
}

.login-header p {
    color: #666;
    font-size: 0.9em;
}

.login-form {
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #c33;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.85em;
}

.btn-upload {
    width: 100%;
    margin-top: 15px;
    font-size: 1.1em;
    padding: 15px;
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: white;
    padding: 12px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
}

 .dashboard-header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
 }

.app-title {
    font-size: 1.8em;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #111827;
}

.app-logo {
    height: 44px;
    width: auto;
    display: block;
    padding-right: 12px;
}

.app-subtitle {
    font-size: 0.9em;
    color: #6b7280;
}

.dashboard-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #555;
    font-weight: 500;
}

.btn-ghost {
    background: transparent;
    border-radius: 999px;
    padding-inline: 10px 14px;
    padding-block: 6px;
    box-shadow: none;
}

.btn-ghost:hover {
    background: #e5edff;
    box-shadow: none;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #e5edff;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95em;
}

.profile-avatar-lg {
    width: 40px;
    height: 40px;
    font-size: 1.1em;
}

.profile-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 8px;
}

.profile-name {
    font-size: 0.9em;
    color: #111827;
    font-weight: 600;
}

.profile-role {
    font-size: 0.75em;
    color: #6b7280;
}

.profile-popover {
    position: absolute;
    top: 100%;
    right: 40px;
    margin-top: 8px;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
    min-width: 230px;
    z-index: 20;
}

.profile-popover-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    position: relative;
}

.profile-settings-btn {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    color: #6b7280;
}

.profile-settings-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.profile-username {
    font-size: 0.8em;
    color: #6b7280;
}

.profile-role-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75em;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 500;
    margin-bottom: 6px;
}

.profile-meta {
    font-size: 0.8em;
    color: #6b7280;
    margin: 0;
}

.dashboard-main {
    max-width: 100%;
    margin: 30px 0 40px;
    padding: 0 40px 40px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex: 1;
}

.dashboard-sidebar {
    width: 270px;
    flex-shrink: 0;
}

.sidebar-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-item {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 12px;
    padding: 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    background: #f3f4ff;
}

.sidebar-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.45);
}

.sidebar-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-item.active .sidebar-icon {
    background: rgba(255, 255, 255, 0.24);
}

.sidebar-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.sidebar-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #111827;
    width: 100%;
    text-align: left;
}

.sidebar-subtitle {
    font-size: 0.78em;
    color: #6b7280;
    width: 100%;
    text-align: left;
    margin: 0;
    padding: 0;
}

.sidebar-item.active .sidebar-title,
.sidebar-item.active .sidebar-subtitle {
    color: #ffffff;
}

.sidebar-chevron {
    font-size: 0.9em;
    color: #9ca3af;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-item.active .sidebar-chevron {
    transform: rotate(180deg);
    color: #e5e7eb;
}

.dashboard-content {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
}

.dashboard-footer {
    margin-top: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-align: center;
    color: #ffffff;
    font-size: 0.85em;
}

.dashboard-footer-text {
    opacity: 0.95;
}

/* --- Page de Profil (dans le dashboard) --- */
.profile-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px;
}

.profile-section h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #1f2937;
}

.profile-form {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 30px;
}

.profile-section-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 40px 0;
}

.profile-role-display {
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 4px;
    color: #374151;
    font-size: 0.95em;
    display: inline-block;
    min-width: 150px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 0.9em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* --- Gestion des utilisateurs (admin) --- */
.users-management-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.users-management-section h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #1f2937;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.admin-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-card-header h3 {
    font-size: 1.3em;
    margin-bottom: 8px;
    color: #1f2937;
}

.admin-card-header p {
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 20px;
}

.admin-section-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 40px 0;
}

.token-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 500;
    margin-left: 10px;
}

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

.token-status-used {
    background: #f3f4f6;
    color: #6b7280;
}

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

/* --- Contrôles des tokens d'invitation --- */
.tokens-controls {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.tokens-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tokens-filters label {
    font-size: 0.9em;
    font-weight: 500;
    color: #374151;
}

.tokens-select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tokens-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tokens-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.tokens-page-info {
    font-size: 0.9em;
    color: #6b7280;
    min-width: 200px;
    text-align: center;
}

.tokens-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Admin Dashboard --- */
.admin-layout {
    background: #f5f7fb;
}

.admin-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.admin-header-left h1 {
    margin: 0;
    color: #1f2933;
    font-size: 1.9em;
}

.admin-subtitle {
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.95em;
}

.admin-header-right {
    gap: 10px;
}

.admin-current-user {
    font-size: 0.9em;
    color: #4b5563;
    background: #e5edff;
    padding: 6px 12px;
    border-radius: 999px;
}

.admin-main {
    max-width: 1100px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: white;
    border-radius: 18px;
    padding: 24px 24px 20px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-card-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: #111827;
}

.admin-card-header p {
    margin-top: 6px;
    margin-bottom: 18px;
    color: #6b7280;
    font-size: 0.9em;
}

.admin-form .form-group {
    margin-bottom: 16px;
}

.admin-form .form-group label {
    font-size: 0.9em;
}

.admin-form input {
    background: #f9fafb;
}

.form-group-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-full {
    width: 100%;
    margin-top: 10px;
}

.users-list {
    margin-top: 8px;
}

.upload-section, .files-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.treated-section {
    border-left: 4px solid #667eea;
}

.treated-helper {
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 15px;
}

.treated-warning {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7ed;
    border-left: 4px solid #f97316;
    color: #9a3412;
    font-size: 0.85em;
}

.treated-item {
    margin-bottom: 12px;
}

.treated-results {
    margin-top: 8px;
    margin-left: 8px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.treated-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.treated-results-title {
    font-weight: 600;
    color: #111827;
}

.treated-results-meta {
    font-size: 0.8em;
    color: #6b7280;
}

.treated-results-grid {
    display: grid;
    gap: 10px;
}

.treated-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px dashed #e5e7eb;
}

.treated-result-item:first-child {
    border-top: none;
}

.treated-result-info {
    flex: 1;
}

.treated-result-label {
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.treated-result-details {
    font-size: 0.8em;
    color: #6b7280;
}

.treated-result-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.treated-results-empty {
    font-size: 0.9em;
    color: #6b7280;
}

.treated-expiration {
    margin-top: 6px;
    margin-left: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    color: #ea7a1a;
}

.treated-expiration-icon {
    font-size: 0.95em;
}

.treated-expiration-expired {
    color: #9ca3af;
}

/* Liens "Télécharger" dans les résultats traités : sans soulignement */
.treated-results a.btn {
    text-decoration: none;
}

.treated-results a.btn:hover {
    text-decoration: none;
}

/* Bouton "Prévisualiser" reste vert avec texte blanc dans les résultats traités */
.treated-results .btn-preview {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    border: none;
}

.treated-results .btn-preview:hover {
    background: linear-gradient(135deg, #218838 0%, #17a589 100%);
    color: #ffffff;
}

/* Style de boutons type "Fichiers traités" (dégradé violet) pour les téléchargements */
.results-section .btn-download-all,
.results-section .btn-download,
.treated-results .btn-download-all,
.treated-results .btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.35);
}

.results-section .btn-download-all:hover,
.results-section .btn-download:hover,
.treated-results .btn-download-all:hover,
.treated-results .btn-secondary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.upload-section h2, .files-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.upload-box {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
}

.upload-box:hover {
    border-color: #764ba2;
    background: #f8f9ff;
}

.upload-box.drag-over {
    border-style: solid;
    border-color: #764ba2;
    background: #eef0ff;
    box-shadow: 0 0 0 2px rgba(118, 75, 162, 0.12);
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: block;
    padding: 40px 20px;
    background: #f8f9ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-label:hover {
    background: #eef0ff;
}

.file-icon {
    display: block;
    margin-bottom: 10px;
}

.file-icon svg {
    width: 3em;
    height: 3em;
    stroke: #667eea;
    fill: none;
}

.file-text {
    color: #667eea;
    font-weight: 500;
    font-size: 1.1em;
}

.file-text-secondary {
    display: block;
    margin-top: 6px;
    font-size: 0.85em;
    color: #6b7280;
}

.file-name {
    margin-top: 15px;
    padding: 0;
    background: transparent;
    border-radius: 8px;
    color: #2c5f7c;
    font-weight: 500;
}

.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.message.success {
    background: #e6ffed;
    color: #166534;
}

.message.error {
    background: #fee2e2;
    color: #b91c1c;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

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

.files-list {
    display: grid;
    gap: 15px;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

/* Processing Section */
.processing-section, .results-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.processing-section h2, .results-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.processing-status {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-text {
    text-align: center;
    color: #555;
    font-weight: 500;
    margin-top: 10px;
}

/* Logs Container */
.logs-container {
    margin-top: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #f8f9fa;
    overflow: hidden;
}

.logs-header {
    background: #667eea;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logs-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.3);
}

.logs-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    word-wrap: break-word;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.info {
    color: #4ec9b0;
}

.log-entry.success {
    color: #4ec9b0;
}

.log-entry.error {
    color: #f48771;
}

.log-entry.warning {
    color: #dcdcaa;
}

.log-entry.progress {
    color: #569cd6;
}

.log-timestamp {
    color: #808080;
    margin-right: 10px;
}

.log-progress-bar {
    margin-top: 5px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.log-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* Preview Section */
.preview-section {
    background: white;
    border-radius: 15px;
    padding: 24px 24px 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.preview-section h2 {
    color: #111827;
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
}

.preview-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 12px;
}

.preview-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.preview-btn {
    background: #e5e7eb;
    border-radius: 0;
    border: none;
    color: #111827;
    font-weight: 500;
    padding: 6px 10px;
    box-shadow: none;
}

.preview-btn:hover {
    background: #d1d5db;
    transform: none;
}

.preview-controls {
    display: none;
}

.preview-info {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    color: #666;
}

.preview-info p {
    margin: 5px 0;
}

.preview-info-wrapper {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    text-align: center;
}

.preview-container {
    width: 100%;
    height: 600px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    position: relative;
}

.preview-footer {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.preview-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* File / User item cards */
.file-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.file-item:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    border-color: #c7d2fe;
}

.file-info {
    flex: 1;
}

.file-info .file-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.file-info .file-details {
    color: #6b7280;
    font-size: 0.8em;
    margin-bottom: 4px;
}

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

.btn-process, .btn-results, .btn-delete {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Modal de confirmation */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 24px 20px;
    max-width: 440px;
    width: 92%;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.5);
    text-align: center;
}

.modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    background: #fef2f2;
    color: #b91c1c;
}

.modal-title {
    margin: 0 0 8px;
    font-size: 1.15em;
    color: #111827;
}

.modal-text {
    margin: 0 0 20px;
    font-size: 0.9em;
    color: #4b5563;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-progress {
    margin-bottom: 18px;
}

.modal-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin-bottom: 8px;
}

.modal-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.modal-progress-label {
    font-size: 0.85em;
    color: #6b7280;
}

/* Modal de chargement de prévisualisation */
.modal-icon-loading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@media (max-width: 480px) {
    .modal-dialog {
        padding: 20px 18px 16px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

/* Results Section */
.results-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.results-header h3 {
    color: #667eea;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.results-actions {
    margin: 15px 0;
}

.btn-download-all {
    font-size: 1em;
    padding: 12px 24px;
}

.results-summary {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 0.9em;
}

.results-grid {
    display: grid;
    gap: 15px;
}

.result-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

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

.btn-preview {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.result-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-info {
    flex: 1;
}

.result-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.result-details {
    color: #666;
    font-size: 0.9em;
}

.btn-download {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-download:hover {
    text-decoration: none;
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .dashboard-main {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
    }

    .dashboard-content {
        width: 100%;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .upload-section, .files-section, .processing-section, .results-section {
        padding: 20px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-actions {
        width: 100%;
        margin-top: 15px;
        justify-content: flex-start;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-download {
        width: 100%;
        margin-top: 10px;
        justify-content: center;
    }
}
