.notification {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}
.status.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    display: block; /* Rendre visible */
}

.status.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    display: block; /* Rendre visible */
}
.status-completed { background-color: #28a745; color: white; }
.status-processing { background-color: #ffc107; color: black; }
.status-pending { background-color: #6c757d; color: white; }
.status-error { background-color: #dc3545; color: white; }
/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs principales - Palette accueillante et punchy */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --secondary-light: #fbbf24;
    --secondary-dark: #d97706;
    
    /* Couleurs d'accent */
    --accent-pink: #ec4899;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-orange: #f97316;
    
    /* Couleurs neutres */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Couleurs de statut */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-purple) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-orange) 100%);
    --gradient-rainbow: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    --gradient-success: linear-gradient(135deg, var(--success) 0%, var(--accent-cyan) 100%);
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* Typographie */
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Espacements */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;
    --spacing-20: 5rem;
    
    /* Rayons de bordure */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-4);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--gradient-rainbow);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 30%;
    animation-delay: 1s;
}

.shape-5 {
    width: 140px;
    height: 140px;
    top: 10%;
    right: 5%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(20px) rotate(240deg); }
}

.hero .container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-16);
    align-items: center;
}

.hero-content {
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: var(--spacing-6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-6);
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 50%, #dbeafe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.subtitle {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 400;
    opacity: 0.9;
    margin-top: var(--spacing-2);
}

.hero-description {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--spacing-8);
    max-width: 500px;
}

.hero-stats {
    display: flex;
    gap: var(--spacing-8);
    margin-bottom: var(--spacing-10);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--secondary-color);
    display: block;
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.8;
    margin-top: var(--spacing-1);
}

.hero-actions {
    display: flex;
    gap: var(--spacing-4);
    flex-wrap: wrap;
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-6);
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-large {
    padding: var(--spacing-4) var(--spacing-8);
    font-size: var(--font-size-lg);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover .btn-glow {
    left: 100%;
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.extraction-preview {
    display: flex;
    align-items: center;
    gap: var(--spacing-8);
    animation: slideInRight 1s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pdf-mockup {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    width: 200px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pdf-header {
    background: var(--gray-100);
    padding: var(--spacing-3);
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.pdf-controls {
    display: flex;
    gap: var(--spacing-1);
}

.control {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.control.red { background: #ef4444; }
.control.yellow { background: #f59e0b; }
.control.green { background: #10b981; }

.pdf-title {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    font-weight: 500;
}

.pdf-content {
    padding: var(--spacing-4);
}

.pdf-line {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-2);
    animation: shimmer 2s infinite;
}

.pdf-line.long { width: 100%; }
.pdf-line.medium { width: 75%; }
.pdf-line.short { width: 50%; }

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.extraction-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2);
    color: white;
    font-size: var(--font-size-2xl);
    animation: pulse 2s infinite;
}

.ai-badges {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.ai-badge {
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-align: center;
}

.ai-badge.openai {
    background: #10a37f;
    color: white;
}

.ai-badge.claude {
    background: #ff6b35;
    color: white;
}

.ai-badge.manus {
    background: var(--gradient-primary);
    color: white;
}

.data-output {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    width: 250px;
    animation: slideInLeft 1s ease-out 0.5s both;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.output-header {
    background: var(--gradient-success);
    color: white;
    padding: var(--spacing-3);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-weight: 600;
}

.output-fields {
    padding: var(--spacing-4);
}

.field-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-2) 0;
    border-bottom: 1px solid var(--gray-100);
}

.field-item:last-child {
    border-bottom: none;
}

.field-label {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.field-value {
    font-weight: 600;
    color: var(--gray-800);
}

.field-value.confidence {
    color: var(--success);
}

/* Navigation */
.main-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 100;
    transition: all var(--transition-normal);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-4) 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    font-weight: 700;
    font-size: var(--font-size-xl);
    color: var(--primary-color);
}

.nav-logo i {
    font-size: var(--font-size-2xl);
}

.logo-subtitle {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    font-weight: 400;
}

.nav-menu {
    display: flex;
    gap: var(--spacing-2);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-4);
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.nav-btn:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* Main Content */
.main-content {
    background: var(--gray-50);
    min-height: calc(100vh - 80px);
    padding: var(--spacing-8) 0;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-8);
}

.section-header h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-header p {
    color: var(--gray-600);
    margin-top: var(--spacing-2);
}

.section-actions {
    display: flex;
    gap: var(--spacing-3);
}

/* Upload Section */
.upload-container {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-8);
}

.upload-zone {
    position: relative;
    padding: var(--spacing-16);
    text-align: center;
    border: 3px dashed var(--gray-300);
    margin: var(--spacing-6);
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    background-opacity: 0.05;
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.02);
}

.upload-animation {
    margin-bottom: var(--spacing-6);
}

.upload-icon {
    position: relative;
    display: inline-block;
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-4);
}

.upload-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-full);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.upload-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-2);
}

.upload-content p {
    color: var(--gray-600);
    margin-bottom: var(--spacing-4);
}

.upload-specs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-6);
    margin-bottom: var(--spacing-6);
    flex-wrap: wrap;
}

.upload-specs span {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
    color: var(--success);
}

.btn-upload {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--spacing-4) var(--spacing-8);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.extraction-options {
    padding: var(--spacing-6);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-6);
}

.option-card {
    background: white;
    padding: var(--spacing-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.option-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-4);
}

.option-card label {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-3);
}

.form-select {
    width: 100%;
    padding: var(--spacing-3);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--font-size-base);
    background: white;
    transition: all var(--transition-normal);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Progress Bar */
.upload-progress {
    padding: var(--spacing-6);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

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

.progress-bar {
    position: relative;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-3);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
    position: relative;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer 2s infinite;
}

.progress-text {
    text-align: center;
    font-weight: 500;
    color: var(--gray-700);
}

/* AI Dashboard */
.ai-dashboard {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-8);
    margin-bottom: var(--spacing-8);
}

.ai-dashboard h3 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--spacing-6);
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.ai-dashboard h3 i {
    color: var(--primary-color);
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-6);
}

.ai-status-card {
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    padding: var(--spacing-6);
    border-left: 4px solid;
    transition: all var(--transition-normal);
}

.ai-status-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.ai-status-card.openai {
    border-left-color: #10a37f;
}

.ai-status-card.claude {
    border-left-color: #ff6b35;
}

.ai-status-card.manus {
    border-left-color: var(--primary-color);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-4);
}

.ai-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-xl);
    color: white;
}

.ai-status-card.openai .ai-icon {
    background: #10a37f;
}

.ai-status-card.claude .ai-icon {
    background: #ff6b35;
}

.ai-status-card.manus .ai-icon {
    background: var(--primary-color);
}

.ai-info h4 {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-1);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--gray-400);
}

.status-dot.active {
    background: var(--success);
    animation: pulse 2s infinite;
}

.ai-metrics {
    display: flex;
    gap: var(--spacing-6);
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-800);
}

.metric-label {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: var(--spacing-1);
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-6);
    margin-bottom: var(--spacing-8);
}

.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-6);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.stat-card.primary {
    border-left-color: var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.danger {
    border-left-color: var(--danger);
}

.stat-card .stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-xl);
    color: white;
    margin-bottom: var(--spacing-4);
}

.stat-card.primary .stat-icon {
    background: var(--primary-color);
}

.stat-card.success .stat-icon {
    background: var(--success);
}

.stat-card.warning .stat-icon {
    background: var(--warning);
}

.stat-card.danger .stat-icon {
    background: var(--danger);
}

.stat-content .stat-number {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: var(--spacing-1);
}

.stat-content .stat-label {
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: var(--spacing-3);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.stat-trend.positive {
    color: var(--success);
}

.stat-trend.negative {
    color: var(--danger);
}

.stat-trend.neutral {
    color: var(--gray-500);
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-6);
}

.chart-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-6);
    border-bottom: 1px solid var(--gray-200);
}

.chart-header h4 {
    font-weight: 600;
    color: var(--gray-800);
}

.chart-actions {
    display: flex;
    gap: var(--spacing-2);
}

.btn-sm {
    padding: var(--spacing-2) var(--spacing-3);
    font-size: var(--font-size-sm);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
        text-align: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .extraction-preview {
        flex-direction: column;
        gap: var(--spacing-4);
    }
    
    .nav-content {
        flex-direction: column;
        gap: var(--spacing-4);
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .ai-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
    }
}

/* Animations supplémentaires */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideInUp 0.6s ease-out;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-4);
    right: var(--spacing-4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.toast {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-4);
    border-left: 4px solid;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideInUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-6);
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--gray-400);
    cursor: pointer;
    padding: var(--spacing-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: var(--spacing-6);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-3);
    padding: var(--spacing-6);
    border-top: 1px solid var(--gray-200);
}

/* Scrollbar personnalisé */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
<!-- CSS supplémentaire pour les templates (à ajouter dans styles.css) -->
<style>
/* Template Cards */
.template-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

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

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.template-name {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.template-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.template-type, .template-institution {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.template-type.built-in {
    background: #e6fffa;
    color: #234e52;
}

.template-type.custom {
    background: #fef5e7;
    color: #744210;
}

.template-institution {
    background: #edf2f7;
    color: #4a5568;
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-indicator.active {
    background: #c6f6d5;
    color: #22543d;
}

.status-indicator.inactive {
    background: #fed7d7;
    color: #742a2a;
}

.template-description {
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.5;
}

.template-fields {
    margin-bottom: 15px;
}

.fields-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.field-tag {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.template-dates {
    color: #718096;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.template-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.form-section h4 {
    margin: 0 0 20px 0;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Template Fields */
.fields-container {
    margin-bottom: 15px;
}

.template-field-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.field-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.field-name, .field-type {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.field-required-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #4a5568;
}

.fields-help {
    background: #e6fffa;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid #38b2ac;
}

/* Modal Sizes */
.modal-large .modal-content {
    max-width: 800px;
    width: 90%;
}

.modal-small .modal-content {
    max-width: 400px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #2d3748;
}

/* Template Preview */
.template-preview {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    min-height: 100px;
    color: #4a5568;
}

/* Confirm Dialog */
.confirm-message {
    text-align: center;
    padding: 20px;
}

.confirm-message i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.template-name-confirm {
    font-weight: 600;
    color: #2d3748;
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .field-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .template-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .template-header {
        flex-direction: column;
        gap: 10px;
    }
}
/* 🎨 CSS PUNCHY ET TENDANCE POUR LES BOUTONS */

/* Variables CSS pour une cohérence globale */
:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    --gradient-danger: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-dark: linear-gradient(135deg, #434343 0%, #000000 100%);
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.2);
    
    --border-radius: 12px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset et base pour tous les boutons */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    overflow: hidden;
    backdrop-filter: blur(10px);
    text-transform: capitalize;
    letter-spacing: 0.5px;
    z-index: 1;
}

/* Effet de survol universel avec onde */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Effet de focus moderne */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.25);
}

/* 🔥 BOUTONS PRIMAIRES - Ultra tendance */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0px);
    transition: transform 0.1s;
}

/* 🎯 BOUTONS VISUALISER - Bleu moderne */
.btn-info {
    background: var(--gradient-info);
    color: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-info:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 35px rgba(79, 172, 254, 0.4);
    filter: saturate(1.2);
}

.btn-info i {
    animation: pulse-eye 2s infinite;
}

@keyframes pulse-eye {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 🗑️ BOUTONS SUPPRIMER - Rouge intense */
.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.btn-danger:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 35px rgba(255, 65, 108, 0.5);
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateY(-2px) scale(1.05) rotate(0deg); }
    25% { transform: translateY(-2px) scale(1.05) rotate(-1deg); }
    75% { transform: translateY(-2px) scale(1.05) rotate(1deg); }
}

.btn-danger i {
    transition: var(--transition-bounce);
}

.btn-danger:hover i {
    animation: wobble-delete 0.8s ease-in-out;
}

@keyframes wobble-delete {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* ✅ BOUTONS SUCCÈS - Vert éclatant */
.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-success:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 30px rgba(86, 171, 47, 0.4);
    filter: hue-rotate(10deg);
}

.btn-success i {
    transition: var(--transition-smooth);
}

.btn-success:hover i {
    animation: bounce-success 0.6s ease-in-out;
}

@keyframes bounce-success {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ⚠️ BOUTONS WARNING - Orange vibrant */
.btn-warning {
    background: var(--gradient-warning);
    color: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(250, 112, 154, 0.4);
    filter: brightness(1.15);
}

/* 🔘 BOUTONS SECONDAIRES - Élégant */
.btn-secondary {
    background: var(--gradient-dark);
    color: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #555555 0%, #222222 100%);
}

/* ⭕ BOUTONS OUTLINE - Moderne transparent */
.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: #667eea;
    border: 2px solid #667eea;
    backdrop-filter: blur(20px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

/* 📱 TAILLES DE BOUTONS */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
    gap: 6px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 16px;
    gap: 12px;
}

.btn-xl {
    padding: 20px 40px;
    font-size: 1.2rem;
    border-radius: 20px;
    gap: 14px;
}

/* 🎨 EFFETS SPÉCIAUX POUR LES CARDS DE TÂCHES */
.job-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Effet holographique sur les cards */
.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.8s;
}

.job-card:hover::before {
    left: 100%;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Actions des jobs avec espacement moderne */
.job-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* 🌟 EFFET NÉON POUR LES BOUTONS ACTIFS */
.btn.active {
    box-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
    animation: neon-pulse 2s infinite alternate;
}

@keyframes neon-pulse {
    from { box-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
    to { box-shadow: 0 0 25px currentColor, 0 0 45px currentColor; }
}

/* 🎭 EFFET GLASS MORPHISM */
.btn-glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* 🌈 ANIMATION DE LOADING POUR LES BOUTONS */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 📱 RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .job-actions {
        justify-content: center;
        gap: 8px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .job-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 🌙 DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
    .job-card {
        background: rgba(45, 55, 72, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
    
    .btn-outline {
        color: #90cdf4;
        border-color: #90cdf4;
    }
    
    .btn-outline:hover {
        background: #90cdf4;
        color: #1a202c;
    }
}

/* 🎪 EFFETS HOVER SPÉCIAUX POUR CERTAINS BOUTONS */
.btn-magical {
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    background-size: 400% 400%;
    animation: magical-gradient 4s ease infinite;
}

@keyframes magical-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-magical:hover {
    animation-duration: 1s;
    transform: scale(1.05) rotate(2deg);
}

/* 💎 EFFET CRISTAL */
.btn-crystal {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.1) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    color: #333;
}

.btn-crystal:hover {
    background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.3) 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 45px rgba(0,0,0,0.2);
}
/* Barre d'outils des templates */
.templates-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.templates-actions-left, .templates-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.templates-search {
    position: relative;
    min-width: 250px;
}

.templates-search input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.templates-search i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Zone de drop pour l'import */
.file-drop-zone {
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.file-drop-zone:hover, .file-drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.drop-zone-content i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.drop-zone-content h5 {
    margin: 10px 0 5px 0;
    color: #374151;
    font-weight: 600;
}

.drop-zone-content p {
    color: #6b7280;
    margin-bottom: 15px;
}

.supported-formats {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Aperçu de l'import */
.import-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.preview-content {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

/* Options d'import/export */
.import-options, .export-options {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.option-group {
    margin-bottom: 15px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.option-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.option-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-top: 5px;
}

/* Liste de sélection des templates */
.templates-selection {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.template-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.template-select-item:hover {
    background: #f8f9fa;
}

.template-select-item:last-child {
    border-bottom: none;
}

.template-select-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.template-select-info {
    flex: 1;
}

.template-select-name {
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
}

.template-select-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Actions sur les templates - Version étendue */
.template-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.template-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Indicateur de templates modifiés */
.template-card.modified {
    border-left: 4px solid #f59e0b;
}

.template-card.modified .template-name::after {
    content: " *";
    color: #f59e0b;
    font-weight: normal;
}

/* Responsive pour les nouvelles fonctionnalités */
@media (max-width: 768px) {
    .templates-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .templates-actions-left, .templates-actions-right {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .templates-search {
        min-width: auto;
        width: 100%;
    }
    
    .template-actions {
        justify-content: center;
    }
}

/* États de chargement */
.template-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.template-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations pour les actions */
.template-card.deleting {
    transform: scale(0.95);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.template-card.deleted {
    transform: scale(0);
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
/* Styles pour les templates en lecture seule */
.template-card.readonly {
    border-left: 4px solid #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(255, 255, 255, 1) 100%);
}

.template-card.readonly .template-name i.fa-lock {
    color: #6366f1;
    margin-left: 8px;
    font-size: 0.8em;
}

.readonly-badge {
    background: #6366f1;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.template-card.readonly:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

/* Styles pour les détails de template */
.template-details {
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    color: #374151;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.detail-item label {
    font-weight: 500;
    color: #6b7280;
    margin-right: 12px;
}

.detail-item span {
    color: #374151;
}

.detail-item code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #1f2937;
}

/* Responsive pour les détails */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Badge de statut amélioré */
.status-badge.active {
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.inactive {
    background: #ef4444;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}
/* Grille & cartes */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.tpl-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .2s ease, transform .05s ease;
}
.tpl-card:hover { box-shadow: 0 6px 22px rgba(0,0,0,.06); transform: translateY(-1px); }
.tpl-card .tpl-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.tpl-title { margin:0; font-size:16px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tpl-desc { margin:0; color:#4b5563; min-height:2lh; }
.tpl-meta { display:flex; gap:8px; color:#6b7280; font-size:12px; }
.tpl-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }

.tpl-chip {
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
}
.tpl-chip.built-in { background:#eef2ff; border-color:#e0e7ff; color:#3730a3; }
.tpl-chip.custom   { background:#ecfeff; border-color:#a5f3fc; color:#0e7490; }

.muted { color:#6b7280; }
