/**
 * AcadIA-M - Admin Styles
 * Interface d'administration - Theme unifie et moderne
 * Version 3.0 - Style Tech futuriste aligne sur la page publique
 */

/* ============================================
   PALETTE DE COULEURS - MODE CLAIR
   ============================================ */
:root {
    /* Couleurs de marque */
    --red-ets: #E2231A;
    --red-dark: #B71C1C;
    --red-light: #EF5350;
    --blue-ai: #1B4F72;
    --blue-accent: #2980B9;
    --blue-light: #3498DB;

    /* Couleurs Brevets - Bleu/Cyan */
    --blue-brevet: #0EA5E9;
    --blue-brevet-dark: #0284C7;
    --blue-brevet-light: #38BDF8;
    --blue-brevet-pale: #E0F2FE;

    /* Couleurs Subventions - Rouge/Orange */
    --orange-subvention: #F97316;
    --orange-subvention-dark: #EA580C;
    --orange-subvention-light: #FB923C;

    /* NEW: Tech/Neon Colors - Aligne avec page publique */
    --neon-blue: #00d4ff;
    --neon-purple: #b24bf3;
    --neon-green: #00ff88;
    --gradient-tech: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: linear-gradient(135deg, #0c1445 0%, #1B4F72 50%, #0a2540 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);

    /* Couleurs semantiques */
    --success: #10B981;
    --success-light: #34D399;
    --success-dark: #059669;
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --warning-dark: #D97706;
    --error: #EF4444;
    --error-light: #F87171;
    --error-dark: #DC2626;
    --info: #3B82F6;
    --info-light: #60A5FA;
    --info-dark: #2563EB;

    /* Neutres - Mode clair */
    --white: #FFFFFF;
    --grey-50: #F8FAFC;
    --grey-100: #F1F5F9;
    --grey-200: var(--border-color);
    --grey-300: #CBD5E1;
    --grey-400: #94A3B8;
    --grey-500: #64748B;
    --grey-600: #475569;
    --grey-700: #334155;
    --grey-800: #1E293B;
    --grey-900: #0F172A;
    --black: #020617;

    /* Variables de theme - Mode clair */
    --bg-primary: #F1F5F9;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: var(--border-color);
    --bg-elevated: #FFFFFF;
    --bg-overlay: rgba(15, 23, 42, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.8);

    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --border-dark: #CBD5E1;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --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(14, 165, 233, 0.3);
    --shadow-neon: 0 0 30px rgba(0, 212, 255, 0.3);

    --card-bg: #FFFFFF;
    --input-bg: #FFFFFF;
    --input-border: var(--border-color);
    --input-focus: #3B82F6;
    --sidebar-bg: #FFFFFF;

    --header-gradient-start: #0c1445;
    --header-gradient-end: #1B4F72;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;
}

/* ============================================
   PALETTE DE COULEURS - MODE SOMBRE
   ============================================ */
[data-theme="dark"] {
    /* Backgrounds sombres */
    --bg-primary: #0B1121;
    --bg-secondary: #131C31;
    --bg-tertiary: #1A2744;
    --bg-elevated: #1E2D4A;
    --bg-overlay: rgba(0, 0, 0, 0.75);
    --bg-glass: rgba(19, 28, 49, 0.9);

    /* Textes clairs */
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    --text-inverse: #0F172A;

    /* Bordures sombres */
    --border-color: #2A3F5F;
    --border-light: #1E2D4A;
    --border-dark: #3B5278;

    /* Ombres renforcees */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.25);

    /* Cards et inputs sombres */
    --card-bg: #131C31;
    --input-bg: #1A2744;
    --input-border: #2A3F5F;
    --input-focus: #3B82F6;
    --sidebar-bg: #0B1121;

    /* Header sombre */
    --header-gradient-start: #0B1121;
    --header-gradient-end: #1A2744;

    /* Couleurs semantiques ajustees pour le mode sombre */
    --success: #22C55E;
    --success-light: #4ADE80;
    --success-dark: #16A34A;
    --warning: #FBBF24;
    --warning-light: #FCD34D;
    --warning-dark: #F59E0B;
    --error: #F87171;
    --error-light: #FCA5A5;
    --error-dark: #EF4444;
    --info: #60A5FA;
    --info-light: #93C5FD;
    --info-dark: #3B82F6;

    /* Ajustement des couleurs de marque pour le mode sombre */
    --red-ets: #F87171;
    --red-dark: #EF4444;
    --blue-brevet: #38BDF8;
    --blue-brevet-dark: #0EA5E9;
    --orange-subvention: #FB923C;
    --orange-subvention-dark: #F97316;

    /* Variables de compatibilite */
    --grey-light: #1A2744;
    --grey: #64748B;
    --grey-dark: #94A3B8;
    --dark: #F1F5F9;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* === HEADER === */
.admin-header {
    background: var(--gradient-hero);
    transition: background 0.3s ease;
    color: var(--text-inverse);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: hidden;
}

/* Animated grid background */
.admin-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

/* Subtle glow effect */
.admin-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(0,212,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(178,75,243,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
    flex-shrink: 1;
    min-width: 0;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.back-link:hover {
    color: var(--text-inverse);
    background: rgba(255,255,255,0.15);
    transform: translateX(-3px);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(178,75,243,0.2));
    border-radius: var(--radius-lg);
    padding: 4px;
    box-shadow: 0 0 20px rgba(0,212,255,0.2);
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, var(--neon-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-section .subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    color: rgba(255,255,255,0.8);
}

.header-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* User info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    margin-right: 0.5rem;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s;
}

.user-info:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.user-info svg {
    opacity: 0.9;
    color: var(--neon-blue);
}

#user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.user-role {
    font-size: 0.75rem;
    opacity: 0.7;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255,255,255,0.2);
    margin-left: 0.5rem;
}

.user-info .btn-sm {
    padding: 0.35rem;
    background: rgba(255,255,255,0.2);
    margin-left: 0.25rem;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red-ets), var(--red-dark));
    color: var(--text-inverse);
    box-shadow: 0 4px 15px rgba(226, 35, 26, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(226, 35, 26, 0.4);
}

.btn-primary:disabled,
.btn-loading {
    background: var(--grey-400);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.btn-loading:hover {
    background: var(--grey-400);
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--text-inverse);
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--error);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: var(--error-dark);
}

.btn-link {
    background: none;
    color: var(--blue-ai);
    padding: 0.5rem;
    font-size: 0.85rem;
}

.btn-link:hover {
    background: var(--grey-light);
}

.btn-auto-tags {
    background: var(--blue-ai);
    color: var(--text-inverse);
    white-space: nowrap;
}

/* === MAIN LAYOUT === */
.admin-main {
    display: flex;
    height: calc(100vh - 80px);
    overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width, 280px);
    min-width: 200px;
    max-width: 450px;
    background: var(--sidebar-bg);
    border-right: none;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    flex-shrink: 0;
}

/* === SIDEBAR RESIZER === */
.sidebar-resizer {
    width: 6px;
    background: var(--border-color);
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.2s ease;
    z-index: 10;
}

.sidebar-resizer:hover,
.sidebar-resizer.active {
    background: var(--primary-color, #3b82f6);
}

.sidebar-resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: var(--text-muted);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-resizer:hover::before,
.sidebar-resizer.active::before {
    opacity: 1;
    background: white;
}

/* Empêcher la sélection de texte pendant le redimensionnement */
body.resizing-sidebar {
    cursor: col-resize !important;
    user-select: none !important;
}

body.resizing-sidebar * {
    cursor: col-resize !important;
}

.sidebar-section h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section h3::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.nav-item:hover {
    background: var(--grey-100);
    color: var(--blue-ai);
    transform: translateX(4px);
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(178,75,243,0.05));
    color: var(--blue-ai);
    font-weight: 600;
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.3s;
}

.nav-item:hover svg,
.nav-item.active svg {
    opacity: 1;
    color: var(--neon-blue);
}

/* Badge de menaces pour Activité */
.threat-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    animation: pulse-threat 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes pulse-threat {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 3px 10px rgba(239, 68, 68, 0.7); }
}

.nav-item {
    position: relative;
}

/* Tags utilisateurs dans tableau IPs suspectes */
.user-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--info) 0%, var(--info-dark, #2563EB) 100%);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    margin: 2px;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.users-cell {
    max-width: 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* Style special pour bouton Subventions - accent rouge subtil */
.nav-item-subventions {
    background: rgba(226, 35, 26, 0.08);
    border-left: 3px solid var(--red-ets);
    color: var(--text-primary);
}

.nav-item-subventions::before {
    background: linear-gradient(135deg, var(--red-ets), var(--red-dark));
}

.nav-item-subventions:hover {
    background: rgba(226, 35, 26, 0.15);
    color: var(--red-dark);
}

.nav-item-subventions.active {
    background: rgba(226, 35, 26, 0.12);
    color: var(--red-dark);
    font-weight: 600;
}

.nav-item-subventions svg {
    color: var(--red-ets);
}

/* Style special pour bouton Brevets - accent bleu subtil */
.nav-item-brevets {
    background: rgba(14, 165, 233, 0.08);
    border-left: 3px solid var(--blue-brevet);
    color: var(--text-primary);
}

.nav-item-brevets::before {
    background: linear-gradient(135deg, var(--blue-brevet), var(--blue-brevet-dark));
}

.nav-item-brevets:hover {
    background: rgba(14, 165, 233, 0.15);
    color: var(--blue-brevet-dark);
}

.nav-item-brevets.active {
    background: rgba(14, 165, 233, 0.12);
    color: var(--blue-brevet-dark);
    font-weight: 600;
}

.nav-item-brevets svg {
    color: var(--blue-brevet);
}

/* Style special pour bouton Publications - accent cyan subtil */
.nav-item-publications {
    background: rgba(6, 182, 212, 0.08);
    border-left: 3px solid #06b6d4;
    color: var(--text-primary);
}

.nav-item-publications::before {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.nav-item-publications:hover {
    background: rgba(6, 182, 212, 0.15);
    color: #0891b2;
}

.nav-item-publications.active {
    background: rgba(6, 182, 212, 0.12);
    color: #0891b2;
    font-weight: 600;
}

.nav-item-publications svg {
    color: #06b6d4;
}

/* Style special pour bouton Integrite Textuelle - accent rouge-orange */
.nav-item-integrity {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #EF4444;
    color: var(--text-primary);
}

.nav-item-integrity::before {
    background: linear-gradient(135deg, #EF4444, #F97316);
}

.nav-item-integrity:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
}

.nav-item-integrity.active {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
    font-weight: 600;
}

.nav-item-integrity svg {
    color: #EF4444;
}

/* Separateur dans la navigation */
.nav-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 0.75rem 0.5rem;
}

/* Style special pour bouton Mode sombre - Violet/Indigo */
.nav-item-theme {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: var(--text-inverse) !important;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    font-weight: 500;
    margin-top: 0.25rem;
}

.nav-item-theme:hover {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    color: var(--text-inverse) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.nav-item-theme svg {
    color: var(--text-inverse) !important;
    stroke: currentColor !important;
}

.nav-item-theme span {
    color: var(--text-inverse) !important;
}

/* Style special pour Reprise session - Teal/Cyan */
#nav-workstate-toggle {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
    margin-bottom: 0.5rem;
}

#nav-workstate-toggle:hover {
    background: linear-gradient(135deg, #14b8a6 0%, #2dd4bf 100%);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

#nav-workstate-toggle.workstate-disabled {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
    opacity: 0.8;
}

#nav-workstate-toggle.workstate-disabled:hover {
    background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%);
    box-shadow: 0 4px 12px rgba(156, 163, 175, 0.4);
}

/* ============================================
   BANDEAUX TITRES ADMIN (Light/Dark adaptatif)
   Design moderne, responsive et unifié
   ============================================ */

.admin-header-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--bg-secondary);
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.25s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Ligne d'accent colorée en haut - utilise la couleur de l'icône */
.admin-header-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.15;
}

.admin-header-banner h2 {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.admin-header-banner h2::before {
    display: none !important;
}

.admin-header-banner .header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.admin-header-banner:hover .header-icon {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-header-banner .header-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
    transition: stroke 0.25s ease;
}

.admin-header-banner .view-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-header-banner .btn-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.admin-header-banner .btn-header:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.admin-header-banner .btn-header svg {
    width: 16px;
    height: 16px;
}

/* Variantes de couleur pour les icônes - Mode clair */
.admin-header-banner.banner-keys .header-icon svg { stroke: #d97706; }
.admin-header-banner.banner-ai .header-icon svg { stroke: #7c3aed; }
.admin-header-banner.banner-activity .header-icon svg { stroke: #059669; }
.admin-header-banner.banner-professors .header-icon svg { stroke: #2563eb; }
.admin-header-banner.banner-new .header-icon svg { stroke: #16a34a; }
.admin-header-banner.banner-domains .header-icon svg { stroke: #9333ea; }
.admin-header-banner.banner-users .header-icon svg { stroke: #dc2626; }
.admin-header-banner.banner-matching .header-icon svg { stroke: #0891b2; }
.admin-header-banner.banner-projects .header-icon svg { stroke: #ea580c; }
.admin-header-banner.banner-doublons .header-icon svg { stroke: #8b5cf6; }
.admin-header-banner.banner-dsap .header-icon svg { stroke: #4f46e5; }
.admin-header-banner.banner-patents .header-icon svg { stroke: #0284c7; }
.admin-header-banner.banner-grants .header-icon svg { stroke: #65a30d; }
.admin-header-banner.banner-publications .header-icon svg { stroke: #0d9488; }
.admin-header-banner.banner-review-paper .header-icon svg { stroke: #8B5CF6; }
.admin-header-banner.banner-integrite .header-icon svg { stroke: #dc2626; }

/* Mode sombre - Bandeau unifié */
[data-theme="dark"] .admin-header-banner {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .admin-header-banner::before {
    opacity: 0.25;
}

[data-theme="dark"] .admin-header-banner h2 {
    color: var(--text-primary);
}

[data-theme="dark"] .admin-header-banner .header-icon {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .admin-header-banner:hover .header-icon {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .admin-header-banner .btn-header {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .admin-header-banner .btn-header:hover {
    background: var(--bg-elevated);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

/* Variantes de couleur - Mode sombre */
[data-theme="dark"] .admin-header-banner.banner-keys .header-icon svg { stroke: #fbbf24; }
[data-theme="dark"] .admin-header-banner.banner-ai .header-icon svg { stroke: #a78bfa; }
[data-theme="dark"] .admin-header-banner.banner-activity .header-icon svg { stroke: #34d399; }
[data-theme="dark"] .admin-header-banner.banner-professors .header-icon svg { stroke: #60a5fa; }
[data-theme="dark"] .admin-header-banner.banner-new .header-icon svg { stroke: #4ade80; }
[data-theme="dark"] .admin-header-banner.banner-domains .header-icon svg { stroke: #c084fc; }
[data-theme="dark"] .admin-header-banner.banner-users .header-icon svg { stroke: #f87171; }
[data-theme="dark"] .admin-header-banner.banner-matching .header-icon svg { stroke: #22d3ee; }
[data-theme="dark"] .admin-header-banner.banner-projects .header-icon svg { stroke: #fb923c; }
[data-theme="dark"] .admin-header-banner.banner-dsap .header-icon svg { stroke: #818cf8; }
[data-theme="dark"] .admin-header-banner.banner-patents .header-icon svg { stroke: #38bdf8; }
[data-theme="dark"] .admin-header-banner.banner-grants .header-icon svg { stroke: #a3e635; }
[data-theme="dark"] .admin-header-banner.banner-publications .header-icon svg { stroke: #2dd4bf; }
[data-theme="dark"] .admin-header-banner.banner-review-paper .header-icon svg { stroke: #A78BFA; }
[data-theme="dark"] .admin-header-banner.banner-integrite .header-icon svg { stroke: #f87171; }

/* ============================================
   SPLASH SCREENS - DESIGN MODERNE ET ADAPTATIF
   ============================================ */

/* Overlay commun pour tous les splash screens */
.subventions-splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.subventions-splash-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Box principale du splash - adaptative au theme */
.subventions-splash-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(14, 165, 233, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.subventions-splash-overlay.active .subventions-splash-box {
    transform: scale(1) translateY(0);
}

/* Icone du splash */
.splash-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-ets) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 24px rgba(183, 28, 28, 0.35);
}

.splash-icon svg {
    width: 36px;
    height: 36px;
    color: var(--text-inverse);
}

/* Titre et sous-titre */
.splash-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--red-ets);
    margin-bottom: 0.5rem;
}

.splash-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Groupe d'input */
.splash-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.splash-input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    padding-right: 3rem;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    text-align: center;
    letter-spacing: 3px;
    font-weight: 600;
}

.splash-input-group input::placeholder {
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 400;
}

.splash-input-group input:focus {
    outline: none;
    border-color: var(--red-ets);
    box-shadow: 0 0 0 4px rgba(226, 35, 26, 0.15);
    background: var(--bg-elevated);
}

.splash-input-group input.error {
    border-color: var(--error);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

/* Toggle password visibility */
.splash-toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.splash-toggle-password:hover {
    color: var(--red-ets);
}

/* Message d'erreur */
.splash-error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: -1rem;
    margin-bottom: 1rem;
    display: none;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.splash-error-msg.visible {
    display: block;
}

/* Bouton de soumission */
.splash-btn-submit {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-ets) 100%);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
}

.splash-btn-submit:hover {
    background: linear-gradient(135deg, var(--red-ets) 0%, var(--red-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(183, 28, 28, 0.4);
}

.splash-btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
}

/* Bouton annuler */
.splash-btn-cancel {
    background: none;
    border: none;
    color: var(--text-muted);
    margin-top: 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
    padding: 0.5rem 1rem;
}

.splash-btn-cancel:hover {
    color: var(--text-primary);
}

/* Badge de securite */
.splash-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(226, 35, 26, 0.1);
    color: var(--red-ets);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(226, 35, 26, 0.2);
}

/* Option demande par email */
.splash-email-option {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.splash-email-option p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.splash-email-btn {
    background: transparent;
    border: 2px solid var(--red-ets);
    color: var(--red-ets);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.splash-email-btn:hover {
    background: var(--red-ets);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(226, 35, 26, 0.3);
}

/* === SPLASH SCREEN BREVETS - Theme Bleu/Cyan === */
#brevets-splash .splash-icon {
    background: linear-gradient(135deg, var(--blue-brevet-dark) 0%, var(--blue-brevet) 100%);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

#brevets-splash .splash-title {
    color: var(--blue-brevet-dark);
}

#brevets-splash .splash-input-group input:focus {
    border-color: var(--blue-brevet);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

#brevets-splash .splash-toggle-password:hover {
    color: var(--blue-brevet);
}

#brevets-splash .splash-btn-submit {
    background: linear-gradient(135deg, var(--blue-brevet-dark) 0%, var(--blue-brevet) 100%);
}

#brevets-splash .splash-btn-submit:hover {
    background: linear-gradient(135deg, var(--blue-brevet) 0%, var(--blue-brevet-light) 100%);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}

#brevets-splash .splash-lock-badge {
    background: rgba(14, 165, 233, 0.1);
    color: var(--blue-brevet-dark);
}

#brevets-splash .splash-email-btn {
    border-color: var(--blue-brevet);
    color: var(--blue-brevet);
}

#brevets-splash .splash-email-btn:hover {
    background: var(--blue-brevet);
    color: var(--text-inverse);
}

/* === TIMEOUT WARNING === */
.timeout-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: var(--text-inverse);
    padding: 0;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.timeout-warning.visible {
    transform: translateY(0);
}

.timeout-warning-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timeout-warning-content svg {
    flex-shrink: 0;
}

.timeout-warning-text {
    flex: 1;
}

.timeout-warning-text strong {
    display: block;
    font-size: 1rem;
}

.timeout-warning-text span {
    font-size: 0.85rem;
    opacity: 0.9;
}

.timeout-warning .btn {
    background: var(--bg-secondary);
    color: var(--warning-dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.timeout-warning .btn:hover {
    background: var(--bg-elevated);
    transform: scale(1.05);
}

/* === BOUTON DECONNEXION SUBVENTIONS === */
/* ============================================
   BOUTONS DE DECONNEXION MODULES
   ============================================ */

/* Bouton Quitter Subventions */
.btn-deconnexion-subventions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-ets) 100%);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.btn-deconnexion-subventions svg {
    width: 18px;
    height: 18px;
}

.btn-deconnexion-subventions:hover {
    background: linear-gradient(135deg, var(--red-ets) 0%, var(--red-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(183, 28, 28, 0.4);
}

.btn-deconnexion-subventions:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
}

/* Bouton Quitter Brevets */
.btn-deconnexion-brevets {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--blue-brevet-dark) 0%, var(--blue-brevet) 100%);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.btn-deconnexion-brevets svg {
    width: 18px;
    height: 18px;
}

.btn-deconnexion-brevets:hover {
    background: linear-gradient(135deg, var(--blue-brevet) 0%, var(--blue-brevet-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.btn-deconnexion-brevets:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* Mode sombre - boutons deconnexion */
[data-theme="dark"] .btn-deconnexion-subventions {
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.25), 0 0 0 1px rgba(248, 113, 113, 0.1);
}

[data-theme="dark"] .btn-deconnexion-subventions:hover {
    box-shadow: 0 8px 24px rgba(248, 113, 113, 0.35), 0 0 0 1px rgba(248, 113, 113, 0.2);
}

[data-theme="dark"] .btn-deconnexion-brevets {
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25), 0 0 0 1px rgba(56, 189, 248, 0.1);
}

[data-theme="dark"] .btn-deconnexion-brevets:hover {
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35), 0 0 0 1px rgba(56, 189, 248, 0.2);
}

/* === SECTION CONFIGURATION SYSTEME === */
#config-systeme {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-top: 0;
    border-top: none;
}

#config-systeme h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--green-ia);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--green-ia);
}

#config-systeme h3 svg {
    stroke: var(--green-ia);
}

.config-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--grey-light);
}

.config-section h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--blue-ai);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.config-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.config-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.config-card-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--dark);
}

.config-card-header svg {
    color: var(--red-ets);
}

.config-desc {
    font-size: 0.85rem;
    color: var(--grey-dark);
    margin-bottom: 1rem;
}

.config-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.config-input-row input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid var(--grey-light);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

.config-input-row input[type="number"]:focus {
    outline: none;
    border-color: var(--red-ets);
}

.config-input-row span {
    color: var(--grey-dark);
    font-size: 0.9rem;
}

.config-current {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--grey);
}

.config-code-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--grey-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.config-code-display code {
    flex: 1;
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: var(--dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    background: var(--grey-light);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-ai);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--grey);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* === CONTENT AREA === */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

/* Content-area background gradient */
.content-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

[data-theme="dark"] .content-area::before {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, transparent 100%);
}

/* === VUE - STRUCTURE PRINCIPALE === */
.view {
    display: none;
    visibility: hidden;
    opacity: 0;
    background: var(--bg-primary);
    z-index: 1;
}

.view.active {
    display: flex;
    flex-direction: column;
    visibility: visible;
    opacity: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    animation: viewFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* === VIEW HEADER - HARMONISE === */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin: 0;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.view-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.view-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

/* Suppression de la barre avant pour les headers avec bandeau */
.view-header h2::before {
    display: none;
}

/* Barre décorative uniquement pour les headers sans bandeau */
.view-header:not(.admin-header-banner) h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 2px;
    flex-shrink: 0;
}

/* Version info */
.version-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.version-badge {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: var(--text-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.version-date,
.version-user {
    color: var(--grey);
}

.version-user::before {
    content: "par ";
}

.count-badge {
    background: var(--blue-ai);
    color: var(--text-inverse);
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 500;
}

.view-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.view-actions select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Indicateur dernière mise à jour */
.last-update-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface-bg);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* Animation rotation pour bouton refresh */
.btn .refresh-icon {
    transition: transform 0.3s ease;
}

.btn.spinning .refresh-icon {
    animation: spin-refresh 1s linear infinite;
}

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

/* === PROFESSORS GRID === */
.professors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.professor-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    cursor: pointer;
    border-left: 4px solid transparent;
    position: relative;
}

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

/* Statuts de validation - couleurs de bordure */
.professor-card.card-none {
    border-left-color: var(--grey);
}

.professor-card.card-generated {
    border-left-color: var(--error);
    background: linear-gradient(to right, rgba(231, 76, 60, 0.08), var(--card-bg) 50%);
}

.professor-card.card-admin_validated {
    border-left-color: var(--warning);
    background: linear-gradient(to right, rgba(243, 156, 18, 0.08), var(--card-bg) 50%);
}

.professor-card.card-fully_validated {
    border-left-color: var(--success);
    background: linear-gradient(to right, rgba(39, 174, 96, 0.08), var(--card-bg) 50%);
}

.card-file {
    display: block;
    font-size: 0.7rem;
    color: var(--grey);
    margin: 0.25rem 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-stats {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.stat-badge {
    font-size: 0.7rem;
    background: var(--grey-light);
    color: var(--grey-dark);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--blue-ai), var(--blue-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 1.2rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--grey-light);
    color: var(--grey-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.card-action:hover {
    background: var(--blue-ai);
    color: var(--text-inverse);
}

.card-action.delete:hover {
    background: var(--error);
}

.card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-dept {
    font-size: 0.85rem;
    color: var(--grey);
    margin-bottom: 1rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-tag {
    background: var(--grey-light);
    color: var(--grey-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--grey);
}

.empty-state svg {
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* === FORM STYLES === */

/* Container du formulaire professeur - scrollable */
.professor-form {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0 24px 24px 24px;
}

/* Onglets du formulaire - fixés en haut */
.form-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 0 24px 0 24px;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--grey-dark);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--grey-light);
}

.tab-btn.active {
    background: var(--blue-ai);
    color: var(--text-inverse);
}

.tab-content {
    display: none;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-top: 1rem;
}

.tab-content.active {
    display: block;
}

/* Espacement entre les onglets et le premier contenu dans le formulaire professeur */
.professor-form .tab-content:first-of-type {
    margin-top: 1.5rem;
}

.section-intro {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-intro h3 {
    color: var(--blue-ai);
    margin-bottom: 0.5rem;
}

.section-intro p {
    color: var(--grey);
    font-size: 0.9rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s, background-color 0.3s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue-accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Tags input */
.tags-input {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 100px;
    background: var(--input-bg);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--blue-ai);
    color: var(--text-inverse);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
}

.tag-remove {
    cursor: pointer;
    opacity: 0.7;
}

.tag-remove:hover {
    opacity: 1;
}

.tags-input input {
    border: none;
    outline: none;
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.tags-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tags-input-row input {
    flex: 1;
}

/* Subsections */
.subsection {
    margin-bottom: 2rem;
}

.subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.subsection-header h4 {
    color: var(--dark);
    font-size: 1rem;
}

.subsection-title {
    color: var(--blue-ai);
    font-size: 1rem;
    margin: 2rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item-card {
    background: var(--grey-light);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
}

.item-card .item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-card input,
.item-card textarea {
    background: var(--bg-secondary);
}

/* Labels dans les item-cards */
.item-card .field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--grey-dark);
    margin-top: 0.5rem;
    margin-bottom: -0.25rem;
}

/* EasyMDE dans les item-cards (editeurs dynamiques) */
.item-card .EasyMDEContainer {
    margin-bottom: 0;
}

.item-card .EasyMDEContainer .CodeMirror {
    min-height: 80px;
    font-size: 0.9rem;
}

.item-card .EasyMDEContainer .editor-toolbar {
    padding: 3px 5px;
}

.item-card .EasyMDEContainer .editor-toolbar button {
    padding: 3px 5px;
    font-size: 0.75rem;
}

.item-remove {
    color: var(--error);
    cursor: pointer;
    padding: 0.5rem;
}

/* === PARTENAIRES SECTION ENHANCED === */
#tab-partenaires .subsection {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

#tab-partenaires .subsection:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#tab-partenaires .subsection-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

#tab-partenaires .subsection-header h4 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Icônes colorées par type de partenaire */
#tab-partenaires .subsection-header h4::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* Partenaires académiques - Bleu */
#tab-partenaires .subsection:nth-child(1) .subsection-header h4::before {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm6.82 6L12 12.72 5.18 9 12 5.28 18.82 9zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73v3.72z'/%3E%3C/svg%3E") center/18px no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm6.82 6L12 12.72 5.18 9 12 5.28 18.82 9zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73v3.72z'/%3E%3C/svg%3E") center/18px no-repeat;
}

/* Organismes publics - Vert */
#tab-partenaires .subsection:nth-child(2) .subsection-header h4::before {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z'/%3E%3C/svg%3E") center/18px no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z'/%3E%3C/svg%3E") center/18px no-repeat;
}

/* Partenaires industriels - Orange */
#tab-partenaires .subsection:nth-child(3) .subsection-header h4::before {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19.5 9.5c-1.03 0-1.9.62-2.29 1.5h-2.92c-.39-.88-1.26-1.5-2.29-1.5s-1.9.62-2.29 1.5H6.79c-.39-.88-1.26-1.5-2.29-1.5C3.12 9.5 2 10.62 2 12s1.12 2.5 2.5 2.5c1.03 0 1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5s1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5z'/%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v3h2V5h14v3h2V5c0-1.1-.9-2-2-2zM5 21h14c1.1 0 2-.9 2-2v-3h-2v3H5v-3H3v3c0 1.1.9 2 2 2z'/%3E%3C/svg%3E") center/18px no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19.5 9.5c-1.03 0-1.9.62-2.29 1.5h-2.92c-.39-.88-1.26-1.5-2.29-1.5s-1.9.62-2.29 1.5H6.79c-.39-.88-1.26-1.5-2.29-1.5C3.12 9.5 2 10.62 2 12s1.12 2.5 2.5 2.5c1.03 0 1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5s1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5z'/%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v3h2V5h14v3h2V5c0-1.1-.9-2-2-2zM5 21h14c1.1 0 2-.9 2-2v-3h-2v3H5v-3H3v3c0 1.1.9 2 2 2z'/%3E%3C/svg%3E") center/18px no-repeat;
}

/* Sources de financement - Violet */
#tab-partenaires .subsection:nth-child(4) .subsection-header h4::before {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E") center/18px no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E") center/18px no-repeat;
}

/* Bouton Ajouter amélioré */
#tab-partenaires .subsection-header .btn {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.25);
}

#tab-partenaires .subsection-header .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.35);
}

/* Item-card dans Partenaires */
#tab-partenaires .item-card {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

#tab-partenaires .item-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#tab-partenaires .item-card .item-content {
    padding: 0;
}

/* Textarea amélioré (avant EasyMDE) */
#tab-partenaires .item-card textarea {
    border: none;
    border-radius: 0;
    padding: 1rem;
    min-height: 100px;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    background: var(--card-bg);
    color: var(--text-primary);
}

#tab-partenaires .item-card textarea:focus {
    outline: none;
    background: var(--bg-secondary);
    box-shadow: inset 0 0 0 2px var(--primary-light);
}

#tab-partenaires .item-card textarea::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Bouton supprimer dans Partenaires */
#tab-partenaires .item-card .item-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: all 0.2s ease;
}

#tab-partenaires .item-card:hover .item-remove {
    opacity: 1;
}

#tab-partenaires .item-card .item-remove:hover {
    background: var(--error);
    color: white;
}

#tab-partenaires .item-card {
    position: relative;
}

/* EasyMDE dans Partenaires */
#tab-partenaires .EasyMDEContainer {
    border: none;
}

#tab-partenaires .EasyMDEContainer .CodeMirror {
    border: none;
    border-radius: 0 0 10px 10px;
    background: var(--card-bg);
}

#tab-partenaires .EasyMDEContainer .editor-toolbar {
    background: var(--bg-tertiary);
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 10px 10px 0 0;
    padding: 6px 10px;
}

#tab-partenaires .EasyMDEContainer .editor-toolbar button {
    color: var(--text-secondary);
    border-radius: 4px;
}

#tab-partenaires .EasyMDEContainer .editor-toolbar button:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

#tab-partenaires .EasyMDEContainer .editor-toolbar button.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* Message vide */
#tab-partenaires .items-list:empty::before {
    content: 'Cliquez sur "+ Ajouter" pour ajouter un partenaire';
    display: block;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 2px dashed var(--border-color);
}

/* Dark mode ajustements */
[data-theme="dark"] #tab-partenaires .subsection {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] #tab-partenaires .subsection:hover {
    border-color: var(--blue-accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #tab-partenaires .item-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] #tab-partenaires .item-card:hover {
    border-color: var(--blue-accent);
}

[data-theme="dark"] #tab-partenaires .EasyMDEContainer .editor-toolbar {
    background: var(--bg-secondary);
}

[data-theme="dark"] #tab-partenaires .EasyMDEContainer .CodeMirror {
    background: var(--card-bg);
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.domaine-form {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--grey-light);
    border-radius: 12px;
}

/* === VUE DOMAINES === */
#view-domaines.active {
    overflow-y: auto;
}

/* === DOMAINES LIST === */
.domaines-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    padding-bottom: 3rem;
}

.domaine-item {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.domaine-item span {
    font-weight: 500;
}

.domaine-actions {
    display: flex;
    gap: 0.5rem;
}

.domaine-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.domaine-actions .btn svg {
    flex-shrink: 0;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
    color: var(--text-primary);
    transition: background-color 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--grey-light);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-dark);
}

.modal-close:hover {
    background: var(--error);
    color: var(--text-inverse);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

/* Modal sizes */
.modal-content.modal-small {
    max-width: 400px;
}

.modal-content.modal-medium {
    max-width: 650px;
}

.modal-content.modal-large {
    max-width: 900px;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-tertiary);
}

/* Modal Overlay (alternative pattern) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay .modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: modalSlideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.modal-overlay .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-overlay .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--grey-light);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-dark);
    transition: all 0.2s ease;
}

.modal-overlay .modal-close:hover {
    background: var(--error);
    color: white;
}

.modal-overlay .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-overlay .modal-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-overlay .modal-body .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-overlay .modal-body .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-overlay .modal-body .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.modal-overlay .modal-body textarea.form-control {
    min-height: 200px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.modal-overlay .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.modal-overlay .modal-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-overlay .modal-footer .btn-secondary {
    background: var(--grey-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.modal-overlay .modal-footer .btn-secondary:hover {
    background: var(--grey-medium);
}

.modal-overlay .modal-footer .btn-primary {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6) !important;
    border: none !important;
    color: white !important;
}

.modal-overlay .modal-footer .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.modal-overlay .modal-footer .btn-primary svg {
    stroke: white !important;
}

/* Placeholder Modal Styles */
.placeholder-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.placeholder-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.placeholder-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.placeholder-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
}

.placeholder-topic {
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.placeholder-results {
    margin-left: 26px;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 8px;
    font-size: 0.9rem;
}

.found-references {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reference-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reference-option:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.reference-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    cursor: pointer;
}

.reference-option .reference-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.reference-option .reference-info strong {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.3;
}

.reference-option .ref-authors {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.reference-option .ref-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.25rem;
}

.reference-option .ref-citations {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 500;
}

.reference-option .ref-source {
    color: var(--text-muted);
    font-size: 0.7rem;
    background: var(--bg-tertiary);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.reference-option .ref-abstract {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.reference-option .ref-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
}

.reference-option .ref-link:hover {
    text-decoration: underline;
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.spin {
    animation: spin 1s linear infinite;
}

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

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--blue-accent);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-tertiary);
    transition: all 0.2s;
}

.upload-zone.dragover {
    background: var(--bg-elevated);
    border-color: var(--blue-ai);
}

.upload-zone p {
    margin: 1rem 0 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-zone span {
    color: var(--grey);
    font-size: 0.9rem;
}

.upload-zone label {
    margin-top: 1rem;
    display: inline-block;
}

.upload-progress {
    text-align: center;
    padding: 2rem;
}

.progress-bar {
    height: 8px;
    background: var(--grey-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--blue-ai);
    width: 0%;
    transition: width 0.3s;
}

.upload-preview {
    padding: 1rem 0;
}

.upload-preview h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.preview-content {
    background: var(--grey-light);
    padding: 1rem;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.preview-content strong {
    color: var(--blue-ai);
}

.preview-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.preview-actions .btn-secondary {
    background: var(--grey-light);
    color: var(--grey-dark);
    border: none;
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--grey-800);
    color: var(--text-inverse);
    padding: 1rem 2rem;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1001;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); }

/* === MODAL ACTIONS === */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* === HISTORIQUE LISTE === */
.historique-liste {
    max-height: 400px;
    overflow-y: auto;
}

.historique-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.historique-item:hover {
    background: var(--grey-light);
}

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

.historique-info {
    flex: 1;
}

.historique-version {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.historique-version strong {
    color: var(--blue-ai);
}

.historique-meta {
    font-size: 0.8rem;
    color: var(--grey);
}

.historique-comment {
    font-size: 0.85rem;
    color: var(--grey-dark);
    margin-top: 0.25rem;
    font-style: italic;
}

.historique-actions {
    display: flex;
    gap: 0.5rem;
}

.historique-empty {
    text-align: center;
    padding: 2rem;
    color: var(--grey);
}

/* Card version badge */
.card-version {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--grey);
    margin-top: 0.5rem;
}

.card-version .version-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
}

/* === USER ROLE BADGE === */
.user-role {
    background: rgba(255,255,255,0.25);
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* === USER INFO DARK MODE === */
[data-theme="dark"] .user-info {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .user-info #user-name {
    color: #e2e8f0;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .user-info svg {
    color: #a78bfa;
    opacity: 1;
}

[data-theme="dark"] .user-role {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #ffffff;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .user-role.role-super_admin {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .user-role.role-admin {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .user-info .btn-sm {
    background: rgba(139, 92, 246, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #e2e8f0;
}

[data-theme="dark"] .user-info .btn-sm:hover {
    background: rgba(139, 92, 246, 0.6);
    transform: scale(1.05);
}

/* === USERS SECTION CONTAINER === */
.users-section-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.users-section-container h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--blue-ai);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--blue-ai);
}

.users-section-container h3 svg {
    stroke: var(--blue-ai);
}

/* === USERS LIST === */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar styling for users list */
.users-list::-webkit-scrollbar {
    width: 8px;
}

.users-list::-webkit-scrollbar-track {
    background: var(--grey-light);
    border-radius: 4px;
}

.users-list::-webkit-scrollbar-thumb {
    background: var(--blue-ai);
    border-radius: 4px;
}

.users-list::-webkit-scrollbar-thumb:hover {
    background: var(--blue-dark);
}

.user-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.user-card:hover {
    box-shadow: var(--shadow-md);
}

.user-card.inactive {
    opacity: 0.6;
    background: var(--grey-light);
}

.user-card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--blue-ai), var(--blue-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 1rem;
}

.user-avatar.admin {
    background: linear-gradient(135deg, var(--red-ets), var(--red-dark));
}

.user-avatar.superadmin {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
}

.user-details h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-details p {
    font-size: 0.85rem;
    color: var(--grey);
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.role-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.viewer {
    background: var(--grey-light);
    color: var(--grey-dark);
}

.role-badge.editor {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.role-badge.admin {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.role-badge.superadmin {
    background: rgba(139, 92, 246, 0.15);
    color: #8B5CF6;
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.user-card-actions {
    display: flex;
    gap: 0.5rem;
}

.user-last-login {
    font-size: 0.75rem;
    color: var(--grey);
    font-style: italic;
}

/* Bouton cadena - voir mot de passe (superadmin) */
.view-password-btn {
    color: var(--gold, #F59E0B) !important;
}
.view-password-btn:hover {
    background: var(--gold, #F59E0B) !important;
    color: var(--text-inverse, #fff) !important;
}

/* Tooltip mot de passe */
.password-tooltip {
    position: absolute;
    bottom: 100%;
    right: -10px;
    margin-bottom: 8px;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
    animation: fadeInTooltip 0.2s ease;
}
@keyframes fadeInTooltip {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.password-tooltip-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.password-tooltip-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.password-tooltip-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--warning-dark, #D97706);
    background: rgba(245,158,11,0.12);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(245,158,11,0.25);
}
.password-tooltip-copy {
    font-size: 0.7rem;
    padding: 4px 10px;
    border: 1px solid var(--info, #3B82F6);
    border-radius: 6px;
    background: transparent;
    color: var(--info, #3B82F6);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.password-tooltip-copy:hover {
    background: var(--info, #3B82F6);
    color: #fff;
}
.password-tooltip-error {
    font-size: 0.8rem;
    color: var(--error, #EF4444);
    font-style: italic;
}

/* Reset inline dans le tooltip */
.password-tooltip-reset {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 280px;
}
.password-tooltip-reset-title {
    font-size: 0.75rem;
    color: var(--warning-dark, #D97706);
    font-weight: 600;
}
.password-tooltip-reset-form {
    display: flex;
    gap: 6px;
    align-items: center;
}
.password-tooltip-reset-input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: monospace;
    background: var(--input-bg);
    color: var(--text-primary);
    letter-spacing: 0.3px;
}
.password-tooltip-reset-input:focus {
    outline: none;
    border-color: var(--info, #3B82F6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.password-tooltip-reset-btn {
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    background: var(--info, #3B82F6);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.password-tooltip-reset-btn:hover {
    background: var(--info-dark, #2563EB);
}
.password-tooltip-reset-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.password-tooltip-reset-hint {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
}

/* === MATCHING PROJETS === */
.matching-container {
    display: grid;
    gap: 2rem;
}

.matching-form-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.upload-choice-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.choice-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-tab:hover {
    border-color: var(--blue-accent);
    color: var(--blue-ai);
}

.choice-tab.active {
    background: var(--blue-ai);
    border-color: var(--blue-ai);
    color: var(--text-inverse);
}

.input-mode {
    display: none;
}

.input-mode.active {
    display: block;
}

.upload-zone-projet {
    border: 2px dashed var(--blue-accent);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: var(--bg-tertiary);
    transition: all 0.2s;
}

.upload-zone-projet.dragover {
    background: var(--bg-elevated);
    border-color: var(--blue-ai);
}

.upload-zone-projet p {
    margin: 0.75rem 0 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.upload-zone-projet span {
    color: var(--grey);
    font-size: 0.85rem;
}

.fichier-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    margin-top: 1rem;
}

.fichier-info span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--blue-ai);
    font-weight: 500;
}

.btn-remove-file {
    background: none;
    border: none;
    padding: 0.25rem;
    color: var(--grey-dark);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-remove-file:hover {
    background: var(--error);
    color: var(--text-inverse);
}

/* === PROJET AUTONOME - UPLOAD FICHIER === */
.projet-upload-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.projet-upload-tabs .choice-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.projet-upload-tabs .choice-tab:hover {
    border-color: var(--blue-accent);
    color: var(--text-primary);
}

.projet-upload-tabs .choice-tab.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--blue-ai);
    color: var(--blue-ai);
}

.input-mode-projet {
    display: none;
}

.input-mode-projet.active {
    display: block;
}

.upload-zone-projet-auto {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 2px dashed var(--blue-accent);
    border-radius: 12px;
    background: var(--bg-tertiary);
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone-projet-auto:hover {
    background: var(--bg-elevated);
    border-color: var(--blue-ai);
}

.upload-zone-projet-auto.dragover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--blue-ai);
    border-style: solid;
}

.upload-zone-projet-auto p {
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.upload-zone-projet-auto .upload-formats {
    color: var(--grey);
    font-size: 0.8rem;
}

.fichier-size {
    color: var(--grey) !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
}

.analyse-ia-zone {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.analyse-ia-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.analyse-ia-options label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.analyse-ia-options select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.85rem;
}

.analyse-ia-zone .btn-ai {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.analyse-ia-zone .btn-ai:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.analyse-progress-zone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    color: var(--blue-ai);
}

.analyse-progress-zone .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--blue-ai);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Dark mode pour projet autonome upload */
[data-theme="dark"] .projet-upload-tabs .choice-tab {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .projet-upload-tabs .choice-tab:hover {
    border-color: var(--blue-ai);
    color: var(--text-primary);
}

[data-theme="dark"] .projet-upload-tabs .choice-tab.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--blue-ai);
    color: var(--blue-ai);
}

[data-theme="dark"] .upload-zone-projet-auto {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .upload-zone-projet-auto:hover,
[data-theme="dark"] .upload-zone-projet-auto.dragover {
    background: var(--bg-tertiary);
    border-color: var(--blue-ai);
}

[data-theme="dark"] .analyse-ia-zone {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .analyse-ia-options select {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .analyse-progress-zone {
    background: rgba(59, 130, 246, 0.1);
}

.api-key-group {
    margin-top: 1rem;
}

.api-key-wrapper {
    display: flex;
    gap: 0.5rem;
}

.api-key-wrapper input {
    flex: 1;
}

.btn-toggle-visibility {
    padding: 0.75rem;
    background: var(--grey-light);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--grey-dark);
    transition: all 0.2s;
}

.btn-toggle-visibility:hover {
    background: var(--blue-ai);
    border-color: var(--blue-ai);
    color: var(--text-inverse);
}

.api-hint {
    font-size: 0.75rem;
    color: var(--grey);
    margin-top: 0.25rem;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* === EDITEUR RICHE === */
.rich-editor-container {
    width: 100%;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--grey-dark);
    font-size: 0.85rem;
    transition: all 0.15s;
}

.toolbar-btn:hover {
    background: var(--blue-ai);
    color: var(--text-inverse);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

.toolbar-info {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--grey);
    font-style: italic;
}

.rich-editor {
    width: 100%;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
    outline: none;
    box-sizing: border-box;
}

.rich-editor:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
    white-space: pre-wrap;
}

.rich-editor:focus {
    background: var(--bg-elevated);
}

/* Styles pour le contenu de l'editeur */
.rich-editor h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--red-ets);
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--red-ets);
}

.rich-editor h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--blue-ai);
    margin: 0.75rem 0 0.5rem;
}

.rich-editor h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0.5rem 0 0.25rem;
}

.rich-editor ul, .rich-editor ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.rich-editor li {
    margin-bottom: 0.25rem;
}

.rich-editor blockquote {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--blue-ai);
    background: var(--bg-tertiary);
    font-style: italic;
    color: var(--text-secondary);
}

.rich-editor code {
    background: var(--grey-800);
    color: var(--grey-200);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85em;
}

.rich-editor pre {
    background: var(--grey-800);
    color: var(--grey-200);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.rich-editor pre code {
    background: none;
    padding: 0;
}

.rich-editor strong {
    font-weight: 600;
    color: var(--text-primary);
}

.rich-editor em {
    font-style: italic;
}

.rich-editor a {
    color: var(--blue-ai);
    text-decoration: underline;
}

/* Matching Results */
.matching-results-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h3 {
    color: var(--blue-ai);
    font-size: 1.25rem;
}

.results-actions {
    display: flex;
    gap: 0.75rem;
}

.analyse-progress {
    padding: 2rem;
    text-align: center;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-section {
    padding: 1.5rem;
    background: var(--grey-light);
    border-radius: 12px;
}

.result-section h4 {
    color: var(--red-ets);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--red-ets);
}

/* Projet resume */
#projet-resume {
    font-size: 0.95rem;
    line-height: 1.6;
}

#projet-resume .objectif {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

#projet-resume .axes-titre {
    font-weight: 600;
    color: var(--blue-ai);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

#projet-resume ul {
    padding-left: 1.5rem;
}

#projet-resume li {
    margin-bottom: 0.5rem;
    color: var(--grey-dark);
}

/* Expertises resultats */
.expertise-groupe {
    margin-bottom: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
}

.expertise-groupe:last-child {
    margin-bottom: 0;
}

.expertise-titre {
    font-size: 1rem;
    color: var(--red-ets);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.professeur-match {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border-color);
}

.professeur-match:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.professeur-nom {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.professeur-role {
    font-size: 0.85rem;
    color: var(--blue-ai);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.professeur-justification {
    font-size: 0.9rem;
    color: var(--grey-dark);
    line-height: 1.7;
    text-align: left;
    padding: 0.5rem 0;
}

.professeur-justification strong {
    color: var(--primary-color);
    font-weight: 600;
    display: inline;
}

.professeur-justification p {
    margin: 0.3rem 0;
}

.professeur-justification ul,
.professeur-justification ol {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.professeur-justification li {
    margin: 0.25rem 0;
}

/* Selecteur mode d'affichage */
.affichage-mode-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.affichage-mode-selector label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.affichage-mode-selector select {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.affichage-mode-selector select:focus {
    outline: none;
    border-color: var(--blue-ai);
}

/* Groupement par universite */
.universite-groupe {
    margin-bottom: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.universite-groupe:last-child {
    margin-bottom: 0;
}

.universite-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--blue-ai);
}

.universite-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.universite-info svg {
    color: var(--blue-ai);
}

.universite-titre {
    font-size: 1.1rem;
    color: var(--blue-ai);
    margin: 0;
    font-weight: 600;
}

.universite-count {
    background: var(--blue-ai);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.professeurs-universite-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.professeurs-universite-list .professeur-match {
    background: rgba(27, 79, 114, 0.03);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0;
    border-bottom: none;
}

.professeurs-universite-list .professeur-match:hover {
    background: rgba(27, 79, 114, 0.06);
}

.professeur-expertise-tag {
    background: var(--neon-purple);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Dark mode styles */
[data-theme="dark"] .universite-groupe {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .universite-header {
    border-bottom-color: var(--blue-accent);
}

[data-theme="dark"] .universite-titre {
    color: var(--blue-accent);
}

[data-theme="dark"] .universite-count {
    background: var(--blue-accent);
}

[data-theme="dark"] .professeurs-universite-list .professeur-match {
    background: rgba(41, 128, 185, 0.1);
}

[data-theme="dark"] .professeurs-universite-list .professeur-match:hover {
    background: rgba(41, 128, 185, 0.15);
}

[data-theme="dark"] .affichage-mode-selector select {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Deep Recherche Multi-Sources */
.mentia-buttons-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-deep-search {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-deep-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-deep-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.deep-search-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 6px;
    border-left: 3px solid #8b5cf6;
}

.deep-search-info svg {
    color: #8b5cf6;
    flex-shrink: 0;
}

/* Resultats de la deep recherche */
.deep-search-results {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03) 0%, rgba(59, 130, 246, 0.03) 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.08);
}

.deep-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.12);
}

.deep-search-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.source-count {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    letter-spacing: 0.02em;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   SOURCES CARDS - Design moderne et futuriste
   ============================================ */

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.source-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Effet glassmorphism avec glow */
.source-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--source-color, #8b5cf6), var(--source-color-light, #a78bfa));
    opacity: 1;
    border-radius: 20px 20px 0 0;
}

/* Effet de lueur au survol */
.source-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(circle at 50% 0%, var(--source-color, #8b5cf6), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.source-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 30px rgba(var(--source-color-rgb, 139, 92, 246), 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.source-card:hover::after {
    opacity: 0.08;
}

/* Couleurs par source avec variables RGB pour glow */
.source-card.semantic-scholar {
    --source-color: #1857b6;
    --source-color-light: #3b7dd8;
    --source-color-rgb: 24, 87, 182;
}
.source-card.orcid {
    --source-color: #a6ce39;
    --source-color-light: #c4e85f;
    --source-color-rgb: 166, 206, 57;
}
.source-card.openalex {
    --source-color: #c41e3a;
    --source-color-light: #e8435c;
    --source-color-rgb: 196, 30, 58;
}
.source-card.crossref {
    --source-color: #f26522;
    --source-color-light: #ff8a4c;
    --source-color-rgb: 242, 101, 34;
}
.source-card.google-scholar {
    --source-color: #4285f4;
    --source-color-light: #6ba3ff;
    --source-color-rgb: 66, 133, 244;
}
.source-card.dblp {
    --source-color: #004f9f;
    --source-color-light: #1a6fc7;
    --source-color-rgb: 0, 79, 159;
}

.source-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.source-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: white;
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    transition: transform 0.3s ease;
}

.source-card:hover .source-icon {
    transform: scale(1.1) rotate(-5deg);
}

.source-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 60%);
}

.source-icon.semantic-scholar { background: linear-gradient(135deg, #1857b6 0%, #0d3f8c 100%); }
.source-icon.dblp { background: linear-gradient(135deg, #004f9f 0%, #003366 100%); }
.source-icon.orcid { background: linear-gradient(135deg, #a6ce39 0%, #8ab62f 100%); }
.source-icon.openalex { background: linear-gradient(135deg, #c41e3a 0%, #9a1830 100%); }
.source-icon.crossref { background: linear-gradient(135deg, #f26522 0%, #d4531a 100%); }
.source-icon.google-scholar { background: linear-gradient(135deg, #4285f4 0%, #2b6ed9 100%); }

.source-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.source-card-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.source-card-content .stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s ease;
}

.source-card-content .stat:hover {
    background: rgba(0, 0, 0, 0.02);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 8px;
}

.source-card-content .stat:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.source-card-content .stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.source-card-content .stat-value {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Highlight pour les valeurs importantes avec animation */
.source-card-content .stat-value.highlight {
    color: var(--source-color, #8b5cf6);
    position: relative;
}

.source-card-content .stat-value.highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--source-color, #8b5cf6), transparent);
    border-radius: 2px;
    opacity: 0.5;
}

/* Texte descriptif dans les cartes */
.source-card-content .stat-text {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Tags de domaines dans les cartes */
.source-card-content .domains-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.source-card-content .domains-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.source-card-content .domain-tag {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--source-color, var(--text-primary));
    padding: 0.25rem 0;
    border-left: 2px solid var(--source-color, #8b5cf6);
    padding-left: 0.5rem;
}

/* Lien disponible */
.source-card-content .link-available {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--source-color, #4285f4);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.source-card-content .link-available:hover {
    opacity: 0.8;
}

.deep-search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(139, 92, 246, 0.12);
}

/* Resume de la fiche - Section stylisee */
.deep-search-summary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.deep-search-summary h6 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deep-search-summary h6::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    border-radius: 2px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.summary-stat {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.summary-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12);
}

.summary-stat:hover::before {
    transform: scaleX(1);
}

.summary-stat .stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.summary-stat .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Variantes de couleurs pour les stats */
.summary-stat:nth-child(1) .stat-value {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-stat:nth-child(2) .stat-value {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-stat:nth-child(3) .stat-value {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-stat:nth-child(4) .stat-value {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading state for deep search */
.deep-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.deep-search-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.deep-search-loading p {
    margin-top: 1rem;
    color: #8b5cf6;
    font-weight: 500;
}

.deep-search-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.progress-source {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.progress-source.loading::before {
    content: '';
    width: 8px;
    height: 8px;
    border: 2px solid #8b5cf6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.progress-source.done::before {
    content: '✓';
    color: #10b981;
}

.progress-source.error::before {
    content: '✗';
    color: #ef4444;
}

/* Dark mode - Deep Search */
[data-theme="dark"] .source-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .source-card:hover {
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(var(--source-color-rgb, 139, 92, 246), 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .source-card-content .stat {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .source-card-content .stat:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .source-name {
    color: var(--text-primary);
}

[data-theme="dark"] .source-card-content .stat-value {
    color: var(--text-primary);
}

[data-theme="dark"] .deep-search-results {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-color: rgba(139, 92, 246, 0.25);
}

[data-theme="dark"] .deep-search-info {
    background: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .deep-search-summary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .summary-stat {
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .summary-stat:hover {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

/* ============================================
   MODES D'AFFICHAGE LISTE PROFESSEURS
   ============================================ */

/* Selecteur de mode d'affichage */
.view-mode-selector {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.view-mode-btn {
    padding: 0.5rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-mode-btn:hover {
    background: rgba(27, 79, 114, 0.1);
    color: var(--blue-ai);
}

.view-mode-btn.active {
    background: var(--blue-ai);
    color: white;
}

/* Toggle groupement */
.group-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.group-toggle:hover {
    background: rgba(27, 79, 114, 0.1);
}

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

.group-toggle-label {
    white-space: nowrap;
}

/* Container des professeurs */
.professors-container {
    position: relative;
}

/* Mode Cards (defaut) */
.professors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

/* Mode Condense */
.professors-grid.mode-condensed {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.professors-grid.mode-condensed .professor-card {
    padding: 0.75rem;
}

.professors-grid.mode-condensed .professor-card .card-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.professors-grid.mode-condensed .professor-card .card-title {
    font-size: 0.9rem;
}

.professors-grid.mode-condensed .professor-card .card-subtitle {
    font-size: 0.75rem;
}

.professors-grid.mode-condensed .professor-card .card-stats,
.professors-grid.mode-condensed .professor-card .card-expertises {
    display: none;
}

.professors-grid.mode-condensed .professor-card .card-actions {
    opacity: 0;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.professors-grid.mode-condensed .professor-card:hover .card-actions {
    opacity: 1;
}

/* Mode Liste */
.professors-grid.mode-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.professors-grid.mode-list .professor-card {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    position: relative;
}

/* En mode liste: cacher les badges absolus et reorganiser */
.professors-grid.mode-list .professor-card .validation-badge,
.professors-grid.mode-list .professor-card .card-news-badge {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    flex-shrink: 0;
}

.professors-grid.mode-list .professor-card .card-name {
    min-width: 150px;
    width: 150px;
    flex-shrink: 0;
    text-align: left;
}

.professors-grid.mode-list .professor-card .card-dept {
    min-width: 60px;
    width: 60px;
    flex-shrink: 0;
    text-align: left;
}

.professors-grid.mode-list .professor-card .card-version {
    min-width: 180px;
    flex-shrink: 0;
}

.professors-grid.mode-list .professor-card .card-tags {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.professors-grid.mode-list .professor-card:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.professors-grid.mode-list .professor-card:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom: none;
}

.professors-grid.mode-list .professor-card .card-header {
    flex-direction: row;
    align-items: center;
    gap: 0;
    flex: 0;
    order: -1;
}

.professors-grid.mode-list .professor-card .card-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
}

.professors-grid.mode-list .professor-card .card-info {
    flex: 1;
}

.professors-grid.mode-list .professor-card .card-title {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.professors-grid.mode-list .professor-card .card-subtitle {
    font-size: 0.75rem;
}

.professors-grid.mode-list .professor-card .card-stats,
.professors-grid.mode-list .professor-card .card-expertises {
    display: none;
}

.professors-grid.mode-list .professor-card .card-actions {
    display: none;
}

.professors-grid.mode-list .professor-card .list-menu-btn {
    display: flex;
}

/* Bouton menu contextuel (visible en mode liste) */
.list-menu-btn {
    display: none;
    padding: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.list-menu-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Menu contextuel */
.context-menu {
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    min-width: 200px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.context-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.context-menu-item:hover {
    background: rgba(27, 79, 114, 0.08);
}

.context-menu-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.context-menu-item.danger {
    color: var(--error);
}

.context-menu-item.danger svg {
    color: var(--error);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Groupement par universite */
.universite-group {
    margin-bottom: 2rem;
}

.universite-group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--blue-ai) 0%, #2980B9 100%);
    border-radius: 12px 12px 0 0;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.universite-group-header:hover {
    background: linear-gradient(135deg, #1B4F72 0%, #2471A3 100%);
}

.universite-group-header .univ-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.universite-group-header .univ-icon svg {
    width: 24px;
    height: 24px;
}

.universite-group-header .univ-info {
    flex: 1;
}

.universite-group-header .univ-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.universite-group-header .univ-count {
    font-size: 0.85rem;
    opacity: 0.9;
}

.universite-group-header .univ-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.universite-group-header.collapsed .univ-toggle {
    transform: rotate(-90deg);
}

.universite-group-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 1rem;
}

.universite-group-content.collapsed {
    display: none;
}

.universite-group-content .professors-grid {
    padding: 0;
}

/* Stats mini pour mode condense */
.card-mini-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.card-mini-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Bouton de tri alphabétique */
.sort-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-toggle-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sort-toggle-btn.active {
    background: var(--blue-ai);
    color: white;
    border-color: var(--blue-ai);
}

/* Dark mode */
[data-theme="dark"] .view-mode-selector {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .view-mode-btn.active {
    background: var(--blue-accent);
}

[data-theme="dark"] .group-toggle {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .sort-toggle-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .sort-toggle-btn.active {
    background: var(--blue-accent);
    border-color: var(--blue-accent);
}

[data-theme="dark"] .context-menu {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .universite-group-header {
    background: linear-gradient(135deg, #1a3a5c 0%, #2471A3 100%);
}

[data-theme="dark"] .universite-group-content {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Max professeurs slider */
.max-profs-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.max-profs-wrapper input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    appearance: none;
    cursor: pointer;
}

.max-profs-wrapper input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--blue-ai);
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.max-profs-wrapper input[type="number"] {
    width: 70px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.max-profs-hint {
    font-size: 0.85rem;
    color: var(--grey);
}

/* API Billing Links */
.api-billing-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.billing-label {
    font-size: 0.75rem;
    color: var(--grey);
}

.billing-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.billing-link.anthropic {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-dark);
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.billing-link.anthropic:hover {
    background: var(--warning-dark);
    color: var(--text-inverse);
}

.billing-link.openai {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-dark);
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.billing-link.openai:hover {
    background: var(--success-dark);
    color: var(--text-inverse);
}

.billing-link.gemini {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-ai);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.billing-link.gemini:hover {
    background: var(--blue-ai);
    color: var(--text-inverse);
}

/* Stats Matching Grid */
.stats-matching-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.stat-card.full-width {
    grid-column: 1 / -1;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-card.stat-primary .stat-icon {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(178, 75, 243, 0.1));
    color: var(--neon-blue);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}
.stat-card.stat-info .stat-icon {
    background: linear-gradient(135deg, rgba(178, 75, 243, 0.15), rgba(139, 92, 246, 0.1));
    color: var(--neon-purple);
    box-shadow: 0 4px 15px rgba(178, 75, 243, 0.2);
}
.stat-card.stat-warning .stat-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
    color: var(--warning);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}
.stat-card.stat-success .stat-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(16, 185, 129, 0.1));
    color: var(--neon-green);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
}
.stat-card.stat-secondary .stat-icon {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.stat-card .stat-content {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--blue-ai), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Justification Section */
.justification-section {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
}

.justif-section {
    margin-bottom: 1.5rem;
}

.justif-section h5 {
    font-size: 0.95rem;
    color: var(--blue-ai);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.justif-section p {
    font-size: 0.9rem;
    color: var(--grey-dark);
    line-height: 1.6;
}

.justif-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.justif-column {
    padding: 1rem;
    border-radius: 8px;
}

.justif-column.points-forts {
    background: rgba(5, 150, 105, 0.15);
}

.justif-column.points-forts h5 {
    color: var(--success-dark);
}

.justif-column.risques {
    background: rgba(239, 68, 68, 0.15);
}

.justif-column.risques h5 {
    color: var(--error);
}

.justif-column h5 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.justif-column ul {
    padding-left: 1.25rem;
    margin: 0;
}

.justif-column li {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.justif-section.recommandations {
    background: #DBEAFE;
    padding: 1rem;
    border-radius: 8px;
}

.justif-section.recommandations h5 {
    color: var(--blue-ai);
}

.justif-section.recommandations p {
    color: var(--dark);
}

/* === DARK MODE - Justification Section === */
[data-theme="dark"] .justif-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .justif-section h4,
[data-theme="dark"] .justif-section h5 {
    color: var(--text-primary);
}

[data-theme="dark"] .justif-section p,
[data-theme="dark"] .justif-section span {
    color: var(--text-secondary);
}

[data-theme="dark"] .justif-column {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .justif-column h5 {
    color: var(--text-primary);
}

[data-theme="dark"] .justif-column li {
    color: var(--text-secondary);
}

[data-theme="dark"] .justif-column.points-forts {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .justif-column.points-forts h5 {
    color: #4ade80;
}

[data-theme="dark"] .justif-column.risques {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .justif-column.risques h5 {
    color: #f87171;
}

[data-theme="dark"] .justif-section.recommandations {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .justif-section.recommandations h5 {
    color: #60a5fa;
}

[data-theme="dark"] .justif-section.recommandations p {
    color: var(--text-secondary);
}

[data-theme="dark"] .justif-section.recommandations li {
    color: var(--text-secondary);
}

/* Expertise header avec importance */
.expertise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.expertise-importance {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.importance-critique { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.importance-haute { background: rgba(217, 119, 6, 0.15); color: var(--warning-dark); }
.importance-moyenne { background: rgba(59, 130, 246, 0.15); color: var(--blue-ai); }

.expertise-description {
    font-size: 0.85rem;
    color: var(--grey-dark);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-style: italic;
}

/* Professeur header avec score */
.professeur-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.score-adequation {
    font-size: 0.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--blue-ai), var(--info));
    color: var(--text-inverse);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.professeur-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.professeur-dept {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.professeur-role {
    font-size: 0.8rem;
    color: var(--blue-ai);
    font-style: italic;
}

/* === PROJETS HISTORIQUE === */
.projets-liste {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.projet-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.projet-item:hover {
    box-shadow: var(--shadow-md);
}

/* Styles pour les champs de formulaire dans projets/applications/partenaires */
.projet-item input[type="text"],
.projet-item textarea,
.projet-item select,
.application-item input[type="text"],
.application-item textarea,
.application-item select,
.partenaire-item input[type="text"],
.partenaire-item textarea,
.partenaire-item select,
#projets-liste input[type="text"],
#projets-liste textarea,
#projets-liste select,
#developpements-liste input[type="text"],
#developpements-liste textarea,
#developpements-liste select,
#applications-liste input[type="text"],
#applications-liste textarea,
#applications-liste select,
.partenaires-liste input[type="text"],
.partenaires-liste textarea,
.partenaires-liste select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--input-bg, #fff);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0.75rem;
}

.projet-item input[type="text"]:focus,
.projet-item textarea:focus,
.projet-item select:focus,
.application-item input[type="text"]:focus,
.application-item textarea:focus,
.application-item select:focus,
.partenaire-item input[type="text"]:focus,
.partenaire-item textarea:focus,
.partenaire-item select:focus,
#projets-liste input[type="text"]:focus,
#projets-liste textarea:focus,
#projets-liste select:focus,
#developpements-liste input[type="text"]:focus,
#developpements-liste textarea:focus,
#developpements-liste select:focus,
#applications-liste input[type="text"]:focus,
#applications-liste textarea:focus,
#applications-liste select:focus,
.partenaires-liste input[type="text"]:focus,
.partenaires-liste textarea:focus,
.partenaires-liste select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.projet-item textarea,
.application-item textarea,
.partenaire-item textarea,
#projets-liste textarea,
#developpements-liste textarea,
#applications-liste textarea,
.partenaires-liste textarea {
    min-height: 80px;
    resize: vertical;
}

.projet-item select,
.application-item select,
.partenaire-item select,
#projets-liste select,
#developpements-liste select,
#applications-liste select,
.partenaires-liste select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Dark mode pour les champs de formulaire */
[data-theme="dark"] .projet-item input[type="text"],
[data-theme="dark"] .projet-item textarea,
[data-theme="dark"] .projet-item select,
[data-theme="dark"] .application-item input[type="text"],
[data-theme="dark"] .application-item textarea,
[data-theme="dark"] .application-item select,
[data-theme="dark"] .partenaire-item input[type="text"],
[data-theme="dark"] .partenaire-item textarea,
[data-theme="dark"] .partenaire-item select,
[data-theme="dark"] #projets-liste input[type="text"],
[data-theme="dark"] #projets-liste textarea,
[data-theme="dark"] #projets-liste select,
[data-theme="dark"] #developpements-liste input[type="text"],
[data-theme="dark"] #developpements-liste textarea,
[data-theme="dark"] #developpements-liste select,
[data-theme="dark"] #applications-liste input[type="text"],
[data-theme="dark"] #applications-liste textarea,
[data-theme="dark"] #applications-liste select,
[data-theme="dark"] .partenaires-liste input[type="text"],
[data-theme="dark"] .partenaires-liste textarea,
[data-theme="dark"] .partenaires-liste select {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .projet-item select,
[data-theme="dark"] .application-item select,
[data-theme="dark"] .partenaire-item select,
[data-theme="dark"] #projets-liste select,
[data-theme="dark"] #developpements-liste select,
[data-theme="dark"] #applications-liste select,
[data-theme="dark"] .partenaires-liste select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

.projet-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.projet-titre {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.projet-date {
    font-size: 0.75rem;
    color: var(--grey);
}

.projet-description {
    font-size: 0.85rem;
    color: var(--grey-dark);
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.projet-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.projet-stat {
    font-size: 0.75rem;
    color: var(--grey);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.projet-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.projet-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.projets-empty {
    text-align: center;
    padding: 3rem;
    color: var(--grey);
}

/* === VUE MES PROJETS === */
.mes-projets-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
    flex: 1;
    min-height: 0;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.projets-liste-panel {
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.projets-count {
    background: var(--blue-ai);
    color: var(--text-inverse);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.projets-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.projets-search svg {
    color: var(--grey);
    flex-shrink: 0;
}

.projets-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
}

.projets-liste-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}

.projets-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--grey);
}

.projets-empty-state p {
    font-weight: 500;
    margin: 1rem 0 0.5rem;
    color: var(--grey-dark);
}

.projets-empty-state span {
    font-size: 0.85rem;
}

.projet-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.projet-card:hover {
    border-color: var(--blue-ai);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.projet-card.active {
    border-color: var(--blue-ai);
    background: var(--bg-tertiary);
}

.projet-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.projet-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
    margin-right: 0.5rem;
}

.projet-card-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.projet-card-cahier {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.projet-card-cahier.has-cahier {
    color: var(--success);
}

.projet-card-cahier.no-cahier {
    color: var(--text-muted);
    opacity: 0.6;
}

.projet-card-agent {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-ai);
}

.projet-card-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.projet-card:hover .projet-card-delete {
    opacity: 1;
}

.projet-card-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.projet-card-delete:active {
    transform: scale(0.9);
}

[data-theme="dark"] .projet-card-delete:hover {
    background: rgba(239, 68, 68, 0.25);
}

.projet-card-date {
    font-size: 0.75rem;
    color: var(--grey);
    margin-bottom: 0.5rem;
}

.projet-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--grey-dark);
}

.projet-card-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Panneau detail */
.projet-detail-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card-bg);
}

.projet-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--grey);
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
}

.projet-detail-empty h3 {
    margin: 1.5rem 0 0.5rem;
    color: var(--grey-dark);
}

.projet-detail-empty p {
    font-size: 0.9rem;
}

.projet-detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.projet-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.projet-detail-title h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.projet-detail-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.meta-agent {
    color: var(--blue-ai);
    font-weight: 500;
}

.meta-date {
    color: var(--grey);
}

.projet-detail-actions {
    display: flex;
    gap: 0.75rem;
}

/* Bouton Re-matcher/Matcher - style bien visible */
#btn-matcher-projet {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#btn-matcher-projet:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

#btn-matcher-projet:active {
    transform: translateY(0);
}

#btn-matcher-projet svg {
    stroke: #ffffff;
}

.projet-detail-tabs {
    display: flex;
    gap: 0;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.projet-detail-tabs .tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--grey-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.projet-detail-tabs .tab-btn:hover {
    color: var(--blue-ai);
}

.projet-detail-tabs .tab-btn.active {
    color: var(--blue-ai);
    border-bottom-color: var(--blue-ai);
}

.projet-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    padding: 2rem;
}

.projet-tab-content.active {
    display: block;
}

.projet-stats-mini {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-mini {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-mini-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-ai);
}

.stat-mini-label {
    font-size: 0.75rem;
    color: var(--grey);
    margin-top: 0.25rem;
}

.projet-resume-content {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
}

.projet-resume-content .objectif {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.projet-resume-content .axes-titre {
    font-weight: 600;
    color: var(--blue-ai);
    margin-bottom: 0.75rem;
}

.projet-resume-content ul {
    padding-left: 1.5rem;
}

.projet-resume-content li {
    margin-bottom: 0.5rem;
    color: var(--grey-dark);
}

/* Edition form */
.edition-form {
    max-width: 800px;
}

.edition-form .form-group {
    margin-bottom: 1.5rem;
}

.edition-form label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.edition-form input[type="text"],
.edition-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.edition-form input[type="text"]:focus,
.edition-form textarea:focus {
    border-color: var(--blue-ai);
    outline: none;
}

.rich-editor-mini {
    min-height: 120px;
    padding: 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
}

.rich-editor-mini:focus {
    border-color: var(--blue-ai);
}

.rich-editor-mini:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

.axes-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.axe-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.axe-item input {
    flex: 1;
}

.axe-item .btn-remove {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--grey);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.axe-item .btn-remove:hover {
    background: var(--error);
    color: var(--text-inverse);
}

.edition-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

/* === RESPONSIVE === */
@media (min-width: 769px) and (max-width: 1024px) {
    .form-grid,
    .partners-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: none;
        width: calc(50% - 0.25rem);
    }

    .professors-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* === PERMISSIONS ROLES === */

/* Lecteur: masquer les boutons d'edition/suppression sur les cartes */
body.role-lecteur .card-action.delete,
body.role-lecteur .card-actions .card-action:nth-child(3),
body.role-lecteur .card-actions .card-action:nth-child(4) {
    display: none !important;
}

/* Lecteur: masquer le bouton d'edition (seulement le crayon) */
body.role-lecteur .card-action[title="Editer"],
body.role-lecteur .card-action[title="Supprimer"] {
    display: none !important;
}

/* Style pour les champs en lecture seule */
.readonly {
    background-color: var(--bg-tertiary) !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Badge de role */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.lecteur {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.role-badge.editeur {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.role-badge.superadmin {
    background: rgba(194, 24, 91, 0.15);
    color: #C2185B;
}

/* === MODAL CONFIGURATION SYSTEME === */
#modal-config-system .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.config-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.config-section:last-child {
    margin-bottom: 0;
}

/* --- PROTEUS Section Distinctive Style --- */
.config-section.proteus-section {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.04) 0%, rgba(91, 33, 182, 0.08) 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-left: 4px solid #7C3AED;
    position: relative;
    overflow: hidden;
}

.config-section.proteus-section::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.config-section.proteus-section h4 {
    color: #7C3AED;
    border-bottom: 2px solid rgba(124, 58, 237, 0.3);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.config-section.proteus-section h4 svg {
    stroke: #7C3AED;
}

.proteus-section .proteus-controls-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.proteus-section .btn-proteus-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.9rem;
    border: 1.5px solid #7C3AED;
    border-radius: 8px;
    background: transparent;
    color: #7C3AED;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.proteus-section .btn-proteus-check:hover {
    background: rgba(124, 58, 237, 0.08);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

.proteus-section .btn-proteus-check:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.proteus-section .btn-proteus-check svg {
    stroke: #7C3AED;
}

.proteus-section .proteus-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.proteus-section .proteus-status.connected {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.proteus-section .proteus-status.connected::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    animation: proteus-pulse 2s ease-in-out infinite;
}

.proteus-section .proteus-status.disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.proteus-section .proteus-status.disconnected::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #EF4444;
}

.proteus-section .proteus-status.checking {
    background: rgba(124, 58, 237, 0.1);
    color: #7C3AED;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.proteus-section .proteus-status.error {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

@keyframes proteus-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Dark mode adjustments */
[data-theme="dark"] .config-section.proteus-section {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(91, 33, 182, 0.12) 100%);
    border-color: rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .config-section.proteus-section h4 {
    color: #A78BFA;
    border-bottom-color: rgba(167, 139, 250, 0.3);
}

[data-theme="dark"] .config-section.proteus-section h4 svg {
    stroke: #A78BFA;
}

[data-theme="dark"] .proteus-section .btn-proteus-check {
    border-color: #A78BFA;
    color: #A78BFA;
}

[data-theme="dark"] .proteus-section .btn-proteus-check svg {
    stroke: #A78BFA;
}

.config-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue-ai);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--blue-ai);
}

.config-section h4 svg {
    stroke: var(--blue-ai);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.config-section .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Indicateur de coût/temps des modes IA */
.ia-mode-cost-indicator {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    border: 1px solid #d0d8f0;
}

.ia-mode-cost-items {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ia-mode-cost-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.ia-mode-dot {
    font-weight: 600;
}

.ia-mode-dot-green {
    color: #22c55e;
}

.ia-mode-dot-orange {
    color: #f59e0b;
}

.ia-mode-dot-red {
    color: #ef4444;
}

.ia-mode-dot-purple {
    color: #8b5cf6;
}

/* Universites matching checkboxes */
.universites-matching-container {
    background: rgba(27, 79, 114, 0.05);
    border: 1px solid rgba(27, 79, 114, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.universites-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.universite-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.universite-checkbox:hover {
    border-color: var(--primary-color);
    background: rgba(27, 79, 114, 0.05);
}

.universite-checkbox.defaut {
    border-color: var(--primary-color);
    background: rgba(27, 79, 114, 0.1);
}

.universite-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

.universite-checkbox input[type="checkbox"]:checked + .universite-label {
    color: var(--primary-color);
    font-weight: 500;
}

.universite-label {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.universite-nom {
    font-size: 0.85rem;
}

.universite-ville {
    font-size: 0.7rem;
    color: #64748b;
}

.universites-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(27, 79, 114, 0.1);
}

.no-universites {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.no-universites a {
    color: var(--primary-color);
}

/* Modal universites matching */
.universites-checkboxes-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(27, 79, 114, 0.03);
    border: 1px solid rgba(27, 79, 114, 0.1);
    border-radius: 8px;
}

.universites-selection-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.universites-selection-header .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.matching-options-modal {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(27, 79, 114, 0.1);
}

.matching-options-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

[data-theme="dark"] .universites-checkboxes-modal {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
}

/* Mode de recherche description */
#matching-mode-description {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(27, 79, 114, 0.05);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

/* Dark mode */
[data-theme="dark"] .universites-matching-container {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .universite-checkbox {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .universite-checkbox:hover {
    background: rgba(27, 79, 114, 0.2);
}

[data-theme="dark"] .universite-ville {
    color: #94a3b8;
}

[data-theme="dark"] #matching-mode-description {
    background: rgba(30, 41, 59, 0.5);
}

/* Mode sombre pour indicateur de coût IA */
[data-theme="dark"] .ia-mode-cost-indicator {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(51, 65, 85, 0.6) 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .ia-mode-cost-item {
    color: var(--text-secondary);
}

[data-theme="dark"] .ia-mode-cost-item strong {
    color: var(--text-primary);
}

/* Badges API */
.api-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-badge.anthropic {
    background: linear-gradient(135deg, #d4a574, #c19660);
    color: var(--text-inverse);
}

.api-badge.openai {
    background: linear-gradient(135deg, #10a37f, #0d8a6a);
    color: var(--text-inverse);
}

.api-badge.google {
    background: linear-gradient(135deg, #4285f4, #3367d6);
    color: var(--text-inverse);
}

/* Input avec toggle password */
.input-with-toggle {
    display: flex;
    position: relative;
}

.input-with-toggle input {
    flex: 1;
    padding-right: 40px;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--grey);
    transition: color 0.2s;
}

.btn-toggle-password:hover {
    color: var(--blue-ai);
}

/* Info grid */
.config-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.config-info-grid div {
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 0.9rem;
}

.config-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.connected {
    background: rgba(5, 150, 105, 0.15);
    color: var(--success-dark);
}

.status-badge.disconnected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Checkbox label */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 400 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Modal footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 0 0 12px 12px;
}

.modal-footer .btn svg {
    margin-right: 0.5rem;
}

/* === LANGUAGE SELECTOR === */
.language-selector {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.language-selector select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-inverse);
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.language-selector select:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.language-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.language-selector select option {
    background: var(--grey-800);
    color: var(--text-inverse);
    padding: 0.5rem;
}

/* === MENTIA SECTION - Generation automatique === */
.mentia-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-primary));
    border: 2px dashed var(--blue-ai);
    border-radius: 12px;
}

.mentia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.mentia-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--blue-ai);
    font-size: 1.1rem;
    margin: 0;
}

.mentia-badge {
    background: linear-gradient(135deg, var(--blue-ai), var(--blue-accent));
    color: var(--text-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mentia-description {
    color: var(--grey-dark);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.mentia-controls {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.mentia-row {
    display: flex;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

.mentia-universite,
.mentia-agent {
    flex: 1;
    min-width: 180px;
}

.mentia-universite label,
.mentia-agent label {
    display: block;
    font-size: 0.85rem;
    color: var(--grey-dark);
    margin-bottom: 0.25rem;
}

.mentia-universite select,
.mentia-agent select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-ai {
    background: linear-gradient(135deg, #B71C1C 0%, #E2231A 100%);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(226, 35, 26, 0.35);
}

.btn-ai:hover {
    background: linear-gradient(135deg, #7f0000 0%, #B71C1C 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(226, 35, 26, 0.45);
}

.btn-ai:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
    color: #ffffff !important;
}

.btn-ai svg {
    stroke: #ffffff;
}

/* MentiA section - Force les couleurs visibles */
.mentia-section .btn-ai,
.mentia-section .btn-ai:disabled {
    background: linear-gradient(135deg, #B71C1C 0%, #E2231A 100%) !important;
    color: #ffffff !important;
    border: 2px solid #B71C1C;
    box-shadow: 0 4px 15px rgba(226, 35, 26, 0.35);
}

.mentia-section .btn-ai:hover:not(:disabled) {
    background: linear-gradient(135deg, #7f0000 0%, #B71C1C 100%) !important;
}

.mentia-section .btn-ai:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    border-color: #9ca3af;
    opacity: 0.9;
}

/* Boutons AI dans Subventions - Rouge ETS */
#view-subventions .btn-ai,
.subventions-container .btn-ai,
.subvention-detail-panel .btn-ai {
    background: linear-gradient(135deg, #B71C1C 0%, #E2231A 100%);
    box-shadow: 0 4px 15px rgba(226, 35, 26, 0.35);
}

#view-subventions .btn-ai:hover,
.subventions-container .btn-ai:hover,
.subvention-detail-panel .btn-ai:hover {
    background: linear-gradient(135deg, #7f0000 0%, #B71C1C 100%);
    box-shadow: 0 6px 20px rgba(226, 35, 26, 0.45);
}

/* Modal recherche professeurs (Subventions) - Rouge ETS */
#modal-universites-matching .btn-ai {
    background: linear-gradient(135deg, #B71C1C 0%, #E2231A 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(226, 35, 26, 0.35);
    border: none;
}

#modal-universites-matching .btn-ai:hover {
    background: linear-gradient(135deg, #7f0000 0%, #B71C1C 100%) !important;
    box-shadow: 0 6px 20px rgba(226, 35, 26, 0.45);
}

/* Boutons AI dans Brevets - Bleu */
#view-brevets .btn-ai,
.brevets-container .btn-ai,
.brevets-detail-panel .btn-ai {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

#view-brevets .btn-ai:hover,
.brevets-container .btn-ai:hover,
.brevets-detail-panel .btn-ai:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* Boutons AI dans Publications - Cyan */
#view-publications .btn-ai,
.publications-container .btn-ai {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.35);
}

#view-publications .btn-ai:hover,
.publications-container .btn-ai:hover {
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 100%);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.45);
}

/* Validation Status Badges */
.validation-status {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.validation-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.validation-badge.status-none {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.validation-badge.status-generated {
    background: var(--error);
    color: var(--text-inverse);
}

.validation-badge.status-admin-validated {
    background: var(--warning);
    color: var(--text-inverse);
}

.validation-badge.status-fully-validated {
    background: var(--success);
    color: var(--text-inverse);
}

.validation-date {
    color: var(--grey-dark);
    font-size: 0.85rem;
}

/* === MENTIA MODAL === */
.mentia-modal-content {
    max-width: 750px;
}

.mentia-modal-header {
    background: linear-gradient(135deg, var(--blue-ai), var(--blue-accent));
    color: var(--text-inverse);
}

.mentia-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Info bar professeur et agent */
.mentia-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-primary));
    border-radius: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    overflow: visible;
}

.mentia-prof-info,
.mentia-agent-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.mentia-prof-info {
    flex-shrink: 1;
    overflow: hidden;
}

.mentia-prof-info .info-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mentia-agent-info {
    flex-shrink: 0;
}

.info-label {
    font-size: 0.85rem;
    color: var(--grey-dark);
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.agent-badge.claude {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: var(--text-inverse);
}

.agent-badge.gpt {
    background: linear-gradient(135deg, #10a37f, #19c37d);
    color: var(--text-inverse);
}

.agent-badge.gemini {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: var(--text-inverse);
}

.agent-badge.deep {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: var(--text-inverse);
}

/* Badge agent dans la barre info MentiA - priorité haute pour éviter conflits */
.mentia-info-bar .agent-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: none;
    flex-shrink: 0;
}

/* Barre de progression globale */
.mentia-progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mentia-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.mentia-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-ai), var(--blue-accent), var(--success));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-percent {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--blue-ai);
    min-width: 45px;
    text-align: right;
}

.mentia-progress {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.mentia-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border-left: 4px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.mentia-step.active {
    border-left-color: var(--blue-accent);
    background: rgba(41, 128, 185, 0.1);
    box-shadow: 0 2px 10px rgba(41, 128, 185, 0.15);
}

.mentia-step.completed {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.mentia-step.error {
    border-left-color: var(--error);
    background: #fde8e8;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mentia-step.active .step-number {
    background: var(--blue-accent);
    color: var(--text-inverse);
}

.mentia-step.completed .step-number {
    background: var(--success);
    color: var(--text-inverse);
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.mentia-step.active .step-icon {
    background: var(--blue-accent);
    color: var(--text-inverse);
    animation: pulseGlow 1.5s infinite;
}

.mentia-step.completed .step-icon {
    background: var(--success);
    color: var(--text-inverse);
}

.mentia-step.error .step-icon {
    background: var(--error);
    color: var(--text-inverse);
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(41, 128, 185, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(41, 128, 185, 0);
    }
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-title {
    display: block;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.step-status {
    display: block;
    font-size: 0.8rem;
    color: var(--grey);
    margin-top: 0.15rem;
}

.step-detail {
    display: block;
    font-size: 0.75rem;
    color: var(--grey);
    font-style: italic;
    margin-top: 0.25rem;
}

.mentia-step.active .step-status {
    color: var(--blue-accent);
    font-weight: 500;
}

.mentia-step.completed .step-status {
    color: var(--success);
}

.mentia-step.error .step-status {
    color: var(--error);
}

/* Checkmark */
.step-check {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    color: var(--success);
}

.mentia-step.completed .step-check {
    opacity: 1;
    transform: scale(1);
}

/* Sous-etapes 4a et 4b */
.step-substeps {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.substep {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.substep:first-child {
    padding-top: 0;
}

.substep:last-child {
    padding-bottom: 0;
}

.substep-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.substep-label {
    flex: 1;
    font-weight: 500;
}

.substep-status {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.substep.active {
    color: var(--primary);
}

.substep.active .substep-icon {
    opacity: 1;
    animation: pulse 1.5s infinite;
}

.substep.active .substep-status {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.substep.completed {
    color: var(--success);
}

.substep.completed .substep-icon {
    opacity: 1;
}

.substep.completed .substep-status {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* Manual data section */
.mentia-manual-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #fff8e6;
    border-radius: 10px;
    border: 1px solid #f0d78c;
}

.mentia-manual-header h4 {
    color: #b8860b;
    margin-bottom: 0.5rem;
}

.mentia-urls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.mentia-url-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mentia-url-item a {
    color: var(--blue-accent);
    font-weight: 500;
    text-decoration: none;
}

.mentia-url-item a:hover {
    text-decoration: underline;
}

.mentia-url-item small {
    color: var(--grey);
    font-size: 0.8rem;
}

.mentia-manual-actions {
    margin-top: 1rem;
    text-align: center;
}

/* Success/Error messages */
.mentia-success, .mentia-error {
    text-align: center;
    padding: 2rem;
}

.mentia-success h4 {
    color: var(--success);
    margin: 1rem 0 0.5rem;
}

.mentia-error h4 {
    color: var(--error);
    margin: 1rem 0 0.5rem;
}

/* Modal footer */
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* === VALIDATION MODAL === */
.validation-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.validation-option {
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.validation-option h4 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.validation-option p {
    color: var(--grey-dark);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.btn-warning {
    background: var(--warning);
    color: var(--text-inverse);
}

.btn-warning:hover {
    background: #d68910;
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-success:hover {
    background: #0d9668;
}

/* === CARD VALIDATION BADGES === */
.professor-card .card-validation {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.professor-card .card-validation .validation-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* === CHATBOT WIDGET MentiA === */
.chatbot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-ets), #B71C1C);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(226, 35, 26, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(226, 35, 26, 0.5);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--blue-ai);
    color: var(--text-inverse);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
}

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

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-height: 550px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.open {
    display: flex;
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--blue-ai), #2980B9);
    color: var(--text-inverse);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chatbot-avatar .mentia-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.chatbot-status {
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
}

.chatbot-close {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255,255,255,0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-tertiary);
    max-height: 320px;
    min-height: 200px;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeInChat 0.3s ease;
}

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

.chat-message .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-ai);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--red-ets);
    order: 2;
}

.user-message {
    flex-direction: row-reverse;
}

.chat-message .message-content {
    background: var(--card-bg);
    padding: 0.75rem 1rem;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 80%;
    box-shadow: var(--shadow-sm);
}

.user-message .message-content {
    background: var(--red-ets);
    color: var(--text-inverse);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 4px;
}

.chat-message .message-content p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-message .message-content p:last-child {
    margin-bottom: 0;
}

.chat-message .message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
}

.chat-message .message-content li {
    margin-bottom: 0.25rem;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94A3B8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-5px); opacity: 1; }
}

.chatbot-input-area {
    padding: 1rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.chatbot-input-area .quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.chatbot-input-area .quick-btn {
    background: var(--bg-tertiary);
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.chatbot-input-area .quick-btn:hover {
    background: var(--blue-ai);
    color: var(--text-inverse);
}

.chatbot-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.chatbot-input-wrapper input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.chatbot-input-wrapper input:focus {
    border-color: var(--blue-ai);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: var(--red-ets);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    transition: all 0.2s;
}

.chatbot-send:hover {
    background: #B71C1C;
    transform: scale(1.05);
}

/* Responsive chatbot */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }

    .chatbot-window {
        width: calc(100vw - 2rem);
        max-height: 70vh;
        bottom: 70px;
        right: 0;
    }

    .chatbot-toggle {
        width: 55px;
        height: 55px;
    }
}

/* ============================================ */
/* CAHIER DES CHARGES - STYLES                  */
/* ============================================ */

/* Etats du cahier des charges */
.cahier-empty-state,
.cahier-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    min-height: 300px;
}

.cahier-empty-state svg {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.cahier-empty-state h3,
.cahier-loading-state h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.cahier-empty-state p,
.cahier-loading-state p {
    color: var(--grey-dark);
    max-width: 400px;
    margin-bottom: 1.5rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Loading state */
.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--blue-ai);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

/* Container des selecteurs IA pour cahier des charges */
.cahier-ia-selectors {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    width: 100%;
    max-width: 500px;
}

/* Selecteur de mode de generation */
.cahier-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.cahier-mode-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--blue-ai);
    font-size: 0.9rem;
}

.cahier-mode-selector select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
}

.cahier-mode-selector select:focus {
    outline: none;
    border-color: var(--blue-ai);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.cahier-mode-selector .mode-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
    font-style: italic;
    line-height: 1.4;
}

/* Selecteur d'agent IA pour cahier des charges */
.cahier-agent-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: opacity 0.3s, max-height 0.3s;
}

.cahier-agent-selector.hidden {
    opacity: 0.5;
    pointer-events: none;
}

.cahier-agent-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--blue-ai);
    font-size: 0.9rem;
}

.cahier-agent-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 180px;
}

.cahier-agent-selector select:focus {
    outline: none;
    border-color: var(--blue-ai);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Dark mode pour les selecteurs cahier */
[data-theme="dark"] .cahier-ia-selectors {
    background: transparent;
}

[data-theme="dark"] .cahier-mode-selector {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border-color: rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .cahier-mode-selector label {
    color: #a5b4fc;
}

[data-theme="dark"] .cahier-mode-selector select {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .cahier-mode-selector .mode-description {
    color: var(--text-secondary);
}

[data-theme="dark"] .cahier-agent-selector {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .cahier-agent-selector label {
    color: #a5b4fc;
}

[data-theme="dark"] .cahier-agent-selector select {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Onglets Source Cahier (Generer / Importer) */
.cahier-source-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0 1rem;
    padding: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
}

.cahier-source-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.cahier-source-tab:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.cahier-source-tab.active {
    background: var(--blue-ai);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.cahier-source-tab svg {
    width: 18px;
    height: 18px;
}

/* Zone de contenu cahier */
.cahier-zone-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

/* Bouton Analyser le projet - style bleu vif */
.cahier-zone-content .btn-ai {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%) !important;
    color: #ffffff !important;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.cahier-zone-content .btn-ai:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* Zone upload cahier */
.cahier-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    margin: 1rem 0;
    width: 100%;
    max-width: 450px;
    min-height: 180px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.3s;
}

.cahier-upload-zone:hover {
    border-color: var(--blue-ai);
    background: rgba(99, 102, 241, 0.05);
}

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

.cahier-upload-zone svg {
    color: var(--blue-ai);
    opacity: 0.7;
}

.cahier-upload-zone p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.cahier-upload-zone span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cahier-upload-zone .file-types {
    font-size: 0.75rem;
    color: var(--blue-ai);
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-top: 0.5rem;
}

/* Info fichier selectionne */
.cahier-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin: 1rem 0;
    width: 100%;
    max-width: 450px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 10px;
}

.cahier-file-info .file-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 8px;
    color: var(--success);
}

.cahier-file-info .file-info-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cahier-file-info .file-name {
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.cahier-file-info .file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cahier-file-info .btn-remove-file {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    color: var(--error);
    cursor: pointer;
    transition: all 0.2s;
}

.cahier-file-info .btn-remove-file:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Options import */
.cahier-import-options {
    width: 100%;
    max-width: 450px;
    margin: 1rem 0;
}

.cahier-import-options .checkbox-option {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.cahier-import-options .checkbox-option:hover {
    background: rgba(99, 102, 241, 0.12);
}

.cahier-import-options .checkbox-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--blue-ai);
    cursor: pointer;
}

.cahier-import-options .option-label {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
}

.cahier-import-options .option-desc {
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: 28px;
    margin-top: -0.25rem;
}

/* Dark mode pour cahier source tabs et upload */
[data-theme="dark"] .cahier-source-tabs {
    background: var(--bg-secondary);
}

[data-theme="dark"] .cahier-source-tab {
    color: var(--text-secondary);
}

[data-theme="dark"] .cahier-source-tab:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .cahier-source-tab.active {
    background: var(--blue-ai);
    color: white;
}

[data-theme="dark"] .cahier-upload-zone {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .cahier-upload-zone:hover {
    border-color: var(--blue-ai);
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .cahier-upload-zone.dragover {
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .cahier-file-info {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.25);
}

[data-theme="dark"] .cahier-file-info .file-info-icon {
    background: rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .cahier-import-options .checkbox-option {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .cahier-import-options .checkbox-option:hover {
    background: rgba(99, 102, 241, 0.15);
}

/* Liste des professeurs associes au cahier */
.cahier-professeurs-container {
    width: 100%;
    margin: 1.5rem 0;
    text-align: left;
}

.cahier-professeurs-container h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--blue-ai);
    margin-bottom: 0.75rem;
}

.cahier-professeurs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.cahier-prof-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.cahier-prof-item:hover {
    border-color: var(--blue-ai);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cahier-prof-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-ai), var(--blue-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 0.9rem;
}

.cahier-prof-info {
    flex: 1;
}

.cahier-prof-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.cahier-prof-dept {
    font-size: 0.8rem;
    color: var(--grey-dark);
}

.cahier-prof-score {
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, var(--success), #059669);
    color: var(--text-inverse);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cahier-prof-expertises {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.cahier-prof-exp-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--blue-ai);
    border-radius: 4px;
}

/* Cahier genere */
.cahier-generated-state {
    padding: 1rem 0;
}

.cahier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cahier-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.meta-badge.meta-ai {
    background: linear-gradient(135deg, var(--blue-ai), #4f46e5);
    color: var(--text-inverse);
    padding: 0.35rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.cahier-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cahier-actions .btn {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cahier-actions .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.cahier-actions .btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.cahier-actions .btn-outline {
    background: var(--card-bg);
    color: var(--blue-ai);
    border: 2px solid var(--blue-ai);
}

.cahier-actions .btn-outline:hover {
    background: var(--blue-ai);
    color: var(--text-inverse);
}

/* Sections du cahier */
.cahier-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.cahier-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.cahier-section h4 svg {
    color: var(--blue-ai);
}

#cahier-resume-text {
    line-height: 1.7;
    color: var(--grey-dark);
}

/* Accordion des etapes */
.etapes-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.etape-accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.etape-accordion-item:hover {
    border-color: var(--blue-ai);
}

.etape-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: background 0.2s;
}

.etape-header:hover {
    background: var(--bg-primary);
}

.etape-numero {
    width: 32px;
    height: 32px;
    background: var(--blue-ai);
    color: var(--text-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.etape-titre {
    flex: 1;
    font-weight: 600;
    color: var(--dark);
}

.etape-chevron {
    transition: transform 0.3s;
    color: var(--grey);
}

.etape-accordion-item.open .etape-chevron {
    transform: rotate(180deg);
}

.etape-content {
    display: none;
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.etape-accordion-item.open .etape-content {
    display: block;
}

.etape-description {
    color: var(--grey-dark);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.etape-subsection {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.etape-subsection h5 {
    color: var(--dark);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.etape-subsection ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.etape-subsection ul li {
    padding: 0.35rem 0;
    padding-left: 1.25rem;
    position: relative;
    color: var(--grey-dark);
}

.etape-subsection ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 6px;
    height: 6px;
    background: var(--blue-ai);
    border-radius: 50%;
}

/* Methodes grid */
.methodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.methode-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.methode-card.methode-recommandee {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.methode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.methode-nom {
    font-weight: 600;
    color: var(--dark);
}

.badge-recommandee {
    background: var(--success);
    color: var(--text-inverse);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.methode-description {
    font-size: 0.9rem;
    color: var(--grey-dark);
    margin-bottom: 0.75rem;
}

.methode-pros,
.methode-cons {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.methode-pros ul li {
    color: var(--success);
}

.methode-cons ul li {
    color: #dc2626;
}

.risques-section ul li {
    color: #dc2626;
}

.risque-item::before {
    background: #dc2626 !important;
}

/* Plan de recherche */
.plan-recherche-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.plan-subsection h5 {
    color: var(--dark);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.questions-list li,
.hypotheses-list li {
    padding: 0.5rem 0;
    display: flex;
    gap: 0.5rem;
}

.question-numero,
.hypothese-numero {
    font-weight: 600;
    color: var(--blue-ai);
    min-width: 30px;
}

/* Contributions grid */
.contributions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.contribution-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.contribution-domaine {
    font-weight: 600;
    color: var(--blue-ai);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.contribution-details strong {
    display: block;
    font-size: 0.85rem;
    color: var(--dark);
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
}

.contribution-details ul {
    margin: 0;
    padding-left: 1rem;
}

.expertises-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.expertises-tags .tag {
    background: rgba(99, 102, 241, 0.15);
    color: var(--blue-ai);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.impact-section p {
    background: rgba(16, 185, 129, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--success);
    color: var(--text-secondary);
}

/* Echeancier timeline */
.timeline-visual {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 2rem;
}

.timeline-visual::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(to bottom, var(--blue-ai), #a5b4fc);
}

.timeline-phase {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    position: relative;
}

.phase-marker {
    width: 32px;
    height: 32px;
    background: var(--blue-ai);
    color: var(--text-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-left: -1rem;
}

.phase-content {
    flex: 1;
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.phase-nom {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.phase-duree {
    color: var(--blue-ai);
    font-size: 0.9rem;
    font-weight: 500;
}

.phase-description {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 4px;
    border-left: 3px solid var(--blue-ai);
}

.phase-activites {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.phase-activites strong {
    color: var(--dark);
    display: block;
    margin-bottom: 0.25rem;
}

.phase-activites ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.phase-activites li {
    margin-bottom: 0.25rem;
}

.phase-livrables {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.phase-livrables strong {
    color: var(--success);
}

.phase-etapes {
    font-size: 0.85rem;
    color: var(--grey);
    margin-top: 0.25rem;
}

.echeancier-debut {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    color: var(--success);
    border-left: 4px solid var(--success);
}

.duree-totale {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    text-align: center;
    color: var(--text-primary);
}

/* Budget table */
.budget-table {
    width: 100%;
    border-collapse: collapse;
}

.budget-table th,
.budget-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.budget-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.budget-table td.estimation {
    font-weight: 600;
    color: var(--blue-ai);
}

.budget-table tfoot td {
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}

/* Recommandations */
.recommandations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommandations-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.recommandations-list li svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.no-data {
    color: var(--grey);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Responsive cahier */
@media (max-width: 768px) {
    .cahier-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .cahier-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .cahier-actions .btn {
        flex: 0 1 auto;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .methodes-grid,
    .contributions-grid {
        grid-template-columns: 1fr;
    }

    .timeline-visual {
        padding-left: 1.5rem;
    }
}

/* ============================================ */
/* RECHERCHE PROFESSEURS - INLINE              */
/* ============================================ */

.search-box-inline {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
    transition: all 0.2s;
    min-width: 280px;
}

.search-box-inline:focus-within {
    border-color: var(--blue-ai);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box-inline svg {
    color: var(--grey);
    flex-shrink: 0;
}

.search-box-inline input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 0.9rem;
    min-width: 150px;
    color: var(--text-primary);
}

.search-box-inline input::placeholder {
    color: var(--grey);
}

.search-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey);
    transition: all 0.2s;
}

.search-clear:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ============================================ */
/* MENTIA - ANIMATION SUCCES AMELIOREE         */
/* ============================================ */

.mentia-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.success-animation {
    animation: successPop 0.5s ease-out;
    margin-bottom: 1rem;
}

.success-animation svg {
    filter: drop-shadow(0 4px 12px rgba(39, 174, 96, 0.3));
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.mentia-success h4 {
    color: var(--success);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.mentia-success p {
    color: var(--grey-dark);
    margin-bottom: 1.5rem;
}

.mentia-success .btn-lg {
    animation: pulse 2s infinite;
}

/* Amelioration des etapes MentiA */
.mentia-step.active .step-icon {
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

.mentia-step.completed .step-icon::after {
    content: '';
    position: absolute;
    font-size: 1rem;
    color: var(--text-inverse);
}

/* Responsive search */
@media (max-width: 768px) {
    .search-box-inline {
        min-width: 200px;
        width: 100%;
    }

    .view-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ============================================
   EDITEURS MARKDOWN (EasyMDE)
   ============================================ */

.EasyMDEContainer {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.EasyMDEContainer .CodeMirror {
    border: 1px solid var(--grey);
    border-radius: 0 0 8px 8px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.9rem;
    min-height: 120px;
}

.EasyMDEContainer .CodeMirror-focused {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

.EasyMDEContainer .editor-toolbar {
    background: var(--grey-light);
    border: 1px solid var(--grey);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 5px;
}

.EasyMDEContainer .editor-toolbar button {
    color: var(--grey-dark);
    border: none;
    background: transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.EasyMDEContainer .editor-toolbar button:hover {
    background: var(--blue-accent);
    color: var(--text-inverse);
}

.EasyMDEContainer .editor-toolbar button.active {
    background: var(--blue-ai);
    color: var(--text-inverse);
}

.EasyMDEContainer .editor-toolbar i.separator {
    border-left-color: var(--grey);
}

/* Mode apercu */
.EasyMDEContainer .editor-preview {
    background: var(--grey-light);
    padding: 1rem;
}

.EasyMDEContainer .editor-preview h1,
.EasyMDEContainer .editor-preview h2,
.EasyMDEContainer .editor-preview h3 {
    color: var(--blue-ai);
    margin-top: 1rem;
}

.EasyMDEContainer .editor-preview ul,
.EasyMDEContainer .editor-preview ol {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.EasyMDEContainer .editor-preview code {
    background: rgba(0,0,0,0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Mode cote a cote */
.EasyMDEContainer .CodeMirror-sided,
.EasyMDEContainer .editor-preview-side {
    border: 1px solid var(--grey);
}

/* Responsive */
@media (max-width: 768px) {
    .EasyMDEContainer .editor-toolbar button {
        padding: 4px 6px;
        font-size: 0.8rem;
    }
}

/* ============================================
   INDICATEUR DE TRADUCTION
   ============================================ */

.translation-loader {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--blue-ai), var(--blue-accent));
    color: var(--text-inverse);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.translation-loader .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--text-inverse);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* Overlay de traduction pour Subventions */
.translation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 48px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
}

.translation-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-primary);
    border-top-color: var(--blue-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.translation-loading span {
    font-size: 1rem;
    font-weight: 500;
}

/* ============================================
   STRATEGIE DE FINANCEMENT
   ============================================ */

.strategie-financement-section {
    margin-top: 2rem;
    border-top: 2px solid var(--blue-accent);
    padding-top: 1.5rem;
}

.strategie-financement-section > h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    color: var(--blue-ai);
    margin-bottom: 1rem;
}

/* Etats de la strategie */
.strategie-empty,
.strategie-loading,
.strategie-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    background: var(--grey-light);
    border-radius: 12px;
}

.strategie-empty svg,
.strategie-error svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.strategie-empty p,
.strategie-error p {
    color: var(--grey-dark);
    margin-bottom: 1rem;
}

.strategie-loading {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
}

.strategie-loading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--blue-light);
    border-top-color: var(--blue-ai);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.strategie-loading .loading-detail {
    font-size: 0.85rem;
    color: var(--grey);
}

.strategie-error .error-detail {
    font-size: 0.85rem;
    color: var(--error);
}

/* Strategie generee */
.strategie-generated {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.strategie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--grey-light);
}

.strategie-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.strategie-meta .meta-agent {
    background: var(--blue-ai);
    color: var(--text-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.strategie-meta .meta-date {
    font-size: 0.85rem;
    color: var(--grey);
}

.strategie-actions {
    display: flex;
    gap: 0.5rem;
}

.strategie-actions .btn {
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--grey-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategie-actions .btn:hover {
    background: var(--blue-ai);
    color: white;
    border-color: var(--blue-ai);
}

.strategie-actions .btn svg {
    width: 18px;
    height: 18px;
}

/* Resume strategique */
.strategie-resume {
    background: rgba(16, 185, 129, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--success);
}

.strategie-resume h4 {
    color: var(--success);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strategie-resume p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Blocs de strategie */
.strategie-block {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.strategie-block h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--blue-ai);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.strategie-block h4 svg {
    color: var(--blue-accent);
}

/* Montage financier */
.montage-total {
    font-size: 1.25rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.montage-total strong {
    color: var(--success);
}

.repartition-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.repartition-item {
    position: relative;
}

.repartition-bar {
    height: 24px;
    background: linear-gradient(90deg, var(--blue-accent), var(--blue-light));
    border-radius: 4px;
    min-width: 20px;
}

.repartition-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.repartition-label .source {
    font-weight: 500;
}

.repartition-label .montant {
    color: var(--grey-dark);
}

.montage-commentaire {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--grey-dark);
    font-style: italic;
}

/* Phases de financement */
.phases-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.phase-item {
    border: 1px solid var(--grey-light);
    border-radius: 8px;
    overflow: hidden;
}

.phase-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--grey-light);
    cursor: pointer;
    transition: background 0.2s;
}

.phase-header:hover {
    background: var(--bg-tertiary);
}

.phase-numero {
    background: var(--blue-ai);
    color: var(--text-inverse);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.phase-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.phase-nom {
    font-weight: 600;
    color: var(--dark);
}

.phase-duree {
    font-size: 0.85rem;
    color: var(--grey);
}

.phase-chevron {
    transition: transform 0.2s;
}

.phase-item.open .phase-chevron {
    transform: rotate(180deg);
}

/* Phase content pour accordeons (avec .phase-item) */
.phase-item > .phase-content {
    display: none;
    padding: 1rem;
    background: var(--card-bg);
}

.phase-item.open > .phase-content {
    display: block;
}

/* Phase content pour timeline echeancier (avec .timeline-phase) - toujours visible */
.timeline-phase .phase-content {
    display: block !important;
}

.phase-objectif {
    margin-bottom: 1rem;
    color: var(--grey-dark);
}

/* Programmes */
.programmes-liste {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.programme-card {
    background: var(--grey-light);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--blue-accent);
}

.programme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.programme-nom {
    font-weight: 600;
    color: var(--blue-ai);
}

.programme-chances {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.chances-elevees {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.chances-moyennes {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.chances-faibles {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.programme-organisme {
    font-size: 0.85rem;
    color: var(--grey);
    margin-bottom: 0.5rem;
}

.programme-montant {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.programme-montant strong {
    color: var(--success);
}

.programme-justification {
    font-size: 0.9rem;
    color: var(--grey-dark);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.programme-date {
    font-size: 0.85rem;
    color: var(--blue-accent);
    font-weight: 500;
}

.programme-exigences,
.programme-actions {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.programme-exigences ul,
.programme-actions ol {
    margin: 0.5rem 0 0 1.5rem;
}

.programme-exigences li,
.programme-actions li {
    margin-bottom: 0.25rem;
}

/* Partenariats */
.partenariats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.partenariat-card {
    background: var(--grey-light);
    padding: 1rem;
    border-radius: 8px;
    border-top: 3px solid var(--grey);
}

.partenariat-industriel {
    border-top-color: var(--blue-accent);
}

.partenariat-academique {
    border-top-color: var(--success);
}

.partenariat-public {
    border-top-color: var(--warning);
}

.partenariat-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--grey);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.partenariat-nom {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0.5rem 0;
}

.partenariat-role,
.partenariat-contribution,
.partenariat-benefices,
.partenariat-approche {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--grey-dark);
}

/* Calendrier */
.calendrier-table {
    overflow-x: auto;
}

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

.calendrier-table th,
.calendrier-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--grey-light);
}

.calendrier-table th {
    background: var(--grey-light);
    font-weight: 600;
    color: var(--dark);
}

.calendrier-table .date-limite {
    font-weight: 600;
    color: var(--blue-ai);
}

.badge-priorite {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priorite-haute .badge-priorite {
    background: #fee2e2;
    color: #991b1b;
}

.priorite-moyenne .badge-priorite {
    background: #fef3c7;
    color: #92400e;
}

.priorite-basse .badge-priorite {
    background: #d1fae5;
    color: #065f46;
}

/* Credits d'impot */
.credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.credit-card {
    padding: 1rem;
    border-radius: 8px;
}

.credit-federal {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
}

.credit-provincial {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
}

.credit-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.credit-taux {
    font-size: 0.85rem;
    color: var(--grey-dark);
}

.credit-montant {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.credit-montant strong {
    color: var(--success);
}

.credit-depenses,
.credit-avantages {
    font-size: 0.85rem;
    color: var(--grey-dark);
    margin-top: 0.5rem;
}

/* Risques */
.risques-liste {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.risque-item {
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--grey);
}

.impact-eleve {
    background: #fef2f2;
    border-left-color: var(--error);
}

.impact-moyen {
    background: #fffbeb;
    border-left-color: var(--warning);
}

.impact-faible {
    background: #f0fdf4;
    border-left-color: var(--success);
}

.risque-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.risque-description {
    flex: 1;
    font-weight: 500;
    color: var(--dark);
}

.risque-impact {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(0,0,0,0.1);
}

.risque-mitigation {
    font-size: 0.9rem;
    color: var(--grey-dark);
}

/* Recommandations strategiques */
.recommandations-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommandation-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--grey-light);
    border-radius: 8px;
}

.recommandation-priorite {
    background: var(--blue-ai);
    color: var(--text-inverse);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    height: fit-content;
}

.recommandation-content {
    flex: 1;
}

.recommandation-action {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.recommandation-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--grey-dark);
    margin-bottom: 0.5rem;
}

.recommandation-resultat {
    font-size: 0.9rem;
    color: var(--grey-dark);
}

/* Indicateurs */
.indicateurs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.indicateur-card {
    background: var(--grey-light);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.indicateur-nom {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.indicateur-cible {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.indicateur-cible strong {
    color: var(--blue-ai);
}

.indicateur-methode {
    font-size: 0.85rem;
    color: var(--grey);
}

/* Responsive strategie */
@media (max-width: 768px) {
    .strategie-block {
        padding: 1rem;
    }

    .partenariats-grid,
    .credits-grid,
    .indicateurs-grid {
        grid-template-columns: 1fr;
    }

    .recommandation-item {
        flex-direction: column;
    }

    .recommandation-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    .calendrier-table {
        font-size: 0.85rem;
    }
}

/* =============================================
   GESTION DES UNIVERSITES
   ============================================= */

.universite-select-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.universite-select-wrapper select {
    flex: 1;
}

.universite-select-wrapper .btn-icon {
    padding: 0.5rem;
    min-width: auto;
    border-radius: 6px;
}

.universites-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.universites-liste {
    overflow-x: auto;
}

.universites-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.universites-table th,
.universites-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.universites-table th {
    background: var(--grey-light);
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

.universites-table tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

.universites-table tr.inactif {
    opacity: 0.5;
    background: #f5f5f5;
}

.universites-table tr.defaut {
    background: rgba(37, 99, 235, 0.1);
}

.universites-table tr.defaut td:first-child strong {
    color: var(--blue-primary);
}

.universites-table small {
    color: var(--grey);
}

.universites-table .actions {
    display: flex;
    gap: 0.5rem;
}

.universites-table .btn-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
}

.universites-table input[type="radio"],
.universites-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.loading-text {
    text-align: center;
    padding: 2rem;
    color: var(--grey);
}

.loading-text i {
    margin-right: 0.5rem;
}

/* Formulaire universite */
#modal-universites-form .form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#modal-universites-form .form-row .form-group {
    flex: 1;
}

#modal-universites-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

#modal-universites-form .checkbox-label input {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    #modal-universites-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .universites-table {
        font-size: 0.8rem;
    }

    .universites-table th,
    .universites-table td {
        padding: 0.5rem;
    }
}

/* =============================================
   EDITEUR NOTES MARKDOWN
   ============================================= */

.notes-editor-container {
    margin-top: 1rem;
}

/* Quill editor pour Notes du professeur */
.notes-editor-container .ql-toolbar.ql-snow {
    border-radius: 8px 8px 0 0;
    background: var(--grey-light, #f8f9fa);
    border-color: var(--border, #dee2e6);
}

.notes-editor-container .ql-container.ql-snow {
    border-radius: 0 0 8px 8px;
    border-color: var(--border, #dee2e6);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 12pt;
}

.notes-editor-container .ql-editor {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
    color: var(--dark, #1e293b);
}

.notes-editor-container .ql-editor.ql-blank::before {
    color: var(--grey, #94a3b8);
    font-style: italic;
}

.notes-editor-container .ql-editor h1 {
    color: var(--blue-ai, #3b82f6);
    font-size: 18pt;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.notes-editor-container .ql-editor h2 {
    color: var(--dark, #1e293b);
    font-size: 16pt;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.notes-editor-container .ql-editor h3 {
    color: var(--grey-dark, #475569);
    font-size: 14pt;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.notes-editor-container .ql-editor a {
    color: var(--blue-primary, #2563eb);
    text-decoration: underline;
}

.notes-editor-container .ql-editor blockquote {
    border-left: 4px solid var(--blue-primary, #2563eb);
    margin: 0.5rem 0;
    padding-left: 1rem;
    color: var(--grey-dark, #475569);
}

.notes-editor-container .ql-editor code,
.notes-editor-container .ql-editor pre {
    background: #282c34;
    color: #abb2bf;
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
}

.notes-editor-container .ql-editor pre {
    padding: 1rem;
    margin: 0.5rem 0;
}

.notes-editor-container .ql-editor ul,
.notes-editor-container .ql-editor ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* Dark mode pour Quill notes */
[data-theme="dark"] .notes-editor-container .ql-toolbar.ql-snow {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .notes-editor-container .ql-toolbar .ql-stroke {
    stroke: #94a3b8;
}

[data-theme="dark"] .notes-editor-container .ql-toolbar .ql-fill {
    fill: #94a3b8;
}

[data-theme="dark"] .notes-editor-container .ql-toolbar .ql-picker-label {
    color: #94a3b8;
}

[data-theme="dark"] .notes-editor-container .ql-toolbar button:hover .ql-stroke,
[data-theme="dark"] .notes-editor-container .ql-toolbar button.ql-active .ql-stroke {
    stroke: #60a5fa;
}

[data-theme="dark"] .notes-editor-container .ql-toolbar button:hover .ql-fill,
[data-theme="dark"] .notes-editor-container .ql-toolbar button.ql-active .ql-fill {
    fill: #60a5fa;
}

[data-theme="dark"] .notes-editor-container .ql-container.ql-snow {
    border-color: #334155;
}

[data-theme="dark"] .notes-editor-container .ql-editor {
    color: #e2e8f0;
    background: #0f172a;
}

[data-theme="dark"] .notes-editor-container .ql-editor h1 {
    color: #60a5fa;
}

[data-theme="dark"] .notes-editor-container .ql-editor h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .notes-editor-container .ql-editor h3 {
    color: #94a3b8;
}

[data-theme="dark"] .notes-editor-container .ql-editor a {
    color: #60a5fa;
}

/* Notes rendues dans la vue document */
.doc-notes-content {
    font-size: 11pt;
    line-height: 1.6;
    color: inherit;
}

.doc-notes-content h1,
.doc-notes-content h2,
.doc-notes-content h3 {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.doc-notes-content a {
    color: var(--blue-primary, #2563eb);
    text-decoration: underline;
}

.doc-notes-content ul,
.doc-notes-content ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.doc-notes-content blockquote {
    border-left: 4px solid var(--blue-primary, #2563eb);
    padding-left: 1rem;
    margin: 0.5rem 0;
    color: var(--grey-dark, #475569);
}

/* ============================================
   SECTION SUBVENTIONS - Grant Applications
   ============================================ */

/* Vue subventions */
#view-subventions {
    width: 100%;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
    position: relative;
    z-index: 1;
}

/* Container principal Subventions */
.subventions-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0.75rem;
    height: calc(100vh - 140px);
    max-width: 100%;
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
}

/* Panneau gauche - Liste des subventions (style moderne) */
.subventions-liste-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.subventions-liste-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.subventions-liste-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subventions-liste-header h3 svg {
    width: 20px;
    height: 20px;
    color: var(--blue-primary);
}

.subventions-filtres {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.subventions-filtres select {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.subventions-filtres select:hover {
    border-color: var(--blue-ai);
}

.subventions-filtres select:focus {
    outline: none;
    border-color: var(--blue-ai);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.subventions-liste-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Item de subvention - style Mes Projets */
.subvention-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
}

.subvention-item:hover {
    border-color: var(--blue-ai);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.subvention-item.active {
    border-color: var(--blue-ai);
    background: var(--bg-tertiary);
}

.subvention-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.subvention-item-titre {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
    line-height: 1.3;
    flex: 1;
    margin-right: 0.5rem;
}

.subvention-item-programme {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.subvention-item-programme.mitacs {
    background: rgba(21, 101, 192, 0.15);
    color: var(--info);
}

.subvention-item-programme.crsng {
    background: rgba(230, 81, 0, 0.15);
    color: var(--warning);
}

.subvention-item-programme.frqnt {
    background: rgba(123, 31, 162, 0.15);
    color: #9C27B0;
}

.subvention-item-programme.autre {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.subvention-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--grey);
}

.subvention-item-profs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.subvention-item-profs svg {
    width: 14px;
    height: 14px;
}

/* Badges de statut */
.subvention-statut {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.subvention-statut.brouillon {
    background: #ECEFF1;
    color: #546E7A;
}

.subvention-statut.en_cours {
    background: #FFF8E1;
    color: #F57F17;
}

.subvention-statut.a_valider {
    background: #E3F2FD;
    color: #1565C0;
}

.subvention-statut.validee {
    background: #E8F5E9;
    color: #2E7D32;
}

.subvention-statut.envoyee_decanat {
    background: #EDE7F6;
    color: #5E35B1;
}

.subvention-statut.soumise {
    background: #E0F7FA;
    color: #00838F;
}

.subvention-statut.acceptee {
    background: #C8E6C9;
    color: #1B5E20;
}

.subvention-statut.refusee {
    background: #FFEBEE;
    color: #C62828;
}

.subvention-statut.archivee {
    background: #F5F5F5;
    color: #757575;
}

/* Bouton nouvelle subvention */
.subventions-liste-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.btn-nouvelle-subvention {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--blue-primary), #2980b9);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nouvelle-subvention:hover {
    background: linear-gradient(135deg, #2980b9, var(--blue-primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-nouvelle-subvention svg {
    width: 18px;
    height: 18px;
}

/* Panneau droit - Détail de la subvention (style Publications) */
.subvention-detail-panel {
    background: var(--bg-primary, #fff);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.subvention-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--grey);
    text-align: center;
    padding: 2rem;
}

.subvention-detail-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.subvention-detail-empty h4 {
    font-size: 1.2rem;
    color: var(--dark);
    margin: 0 0 0.5rem 0;
}

.subvention-detail-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* Panneau de chargement avec spinner */
.subvention-detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--grey);
    text-align: center;
    padding: 2rem;
}

.subvention-detail-loading h3 {
    font-size: 1.1rem;
    color: var(--blue-ai, #1B4F72);
    margin: 1.5rem 0 0.5rem 0;
}

.subvention-detail-loading p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--grey);
}

.subvention-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid var(--blue-ai, #1B4F72);
    border-radius: 50%;
    animation: subventionSpinnerRotate 1s linear infinite;
}

@keyframes subventionSpinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header du détail */
.subvention-detail-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subvention-detail-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.subvention-detail-title h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--dark);
}

.subvention-detail-actions {
    display: flex;
    gap: 0.75rem;
}

.subvention-detail-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.subvention-detail-actions .btn svg {
    width: 16px;
    height: 16px;
}

.subvention-detail-actions .btn-save {
    background: var(--success);
    color: var(--text-inverse);
    border: none;
}

.subvention-detail-actions .btn-save:hover {
    background: #27ae60;
}

.subvention-detail-actions .btn-delete {
    background: var(--card-bg);
    color: var(--error);
    border: 1px solid var(--error);
}

.subvention-detail-actions .btn-delete:hover {
    background: var(--error);
    color: var(--text-inverse);
}

.subvention-detail-actions .btn-generate {
    background: linear-gradient(135deg, var(--blue-ai), #2980b9);
    color: var(--text-inverse);
    border: none;
}

.subvention-detail-actions .btn-generate:hover {
    background: linear-gradient(135deg, #2980b9, var(--blue-ai));
}

/* Onglets de la subvention */
.subvention-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.subv-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--grey);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.subv-tab:hover {
    color: var(--blue-primary);
    background: rgba(52, 152, 219, 0.05);
}

.subv-tab.active {
    color: var(--blue-primary);
    border-bottom-color: var(--blue-primary);
    background: var(--card-bg);
}

/* Contenu des onglets */
.subvention-detail-content {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
}

.subv-tab-pane {
    display: none;
}

.subv-tab-pane.active {
    display: block;
}

/* Formulaire subvention */
.subv-form-section {
    margin-bottom: 2rem;
}

.subv-form-section:last-child {
    margin-bottom: 0;
}

.subv-form-section h4 {
    font-size: 1rem;
    color: var(--dark);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subv-form-section h4 svg {
    width: 18px;
    height: 18px;
    color: var(--blue-primary);
}

.subv-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.subv-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.subv-form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--grey-dark);
}

.subv-form-group input,
.subv-form-group select,
.subv-form-group textarea {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.subv-form-group input:focus,
.subv-form-group select:focus,
.subv-form-group textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.subv-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Professeurs sélectionnés */
.subv-profs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    min-height: 50px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.subv-prof-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--blue-primary);
    color: var(--text-inverse);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.subv-prof-tag .remove-prof {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.subv-prof-tag .remove-prof:hover {
    background: rgba(255, 255, 255, 0.4);
}

.btn-add-prof {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    background: var(--card-bg);
    border: 1px dashed var(--blue-primary);
    color: var(--blue-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-prof:hover {
    background: var(--blue-primary);
    color: var(--text-inverse);
}

/* Liste des stagiaires */
.stagiaires-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stagiaire-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
    position: relative;
}

.stagiaire-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stagiaire-item-header h5 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--dark);
}

.stagiaire-item .btn-remove-stagiaire {
    padding: 0.3rem;
    background: none;
    border: none;
    color: var(--grey);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.stagiaire-item .btn-remove-stagiaire:hover {
    background: var(--error);
    color: var(--text-inverse);
}

.stagiaire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.btn-add-stagiaire {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: none;
    color: var(--grey);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-stagiaire:hover {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
    background: rgba(52, 152, 219, 0.05);
}

/* Sous-objectifs et tâches */
.sous-objectifs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sous-objectif-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.sous-objectif-header {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sous-objectif-header input {
    flex: 1;
}

.sous-objectif-header .btn-remove {
    padding: 0.4rem;
    background: none;
    border: none;
    color: var(--grey);
    cursor: pointer;
    border-radius: 4px;
}

.sous-objectif-header .btn-remove:hover {
    background: var(--error);
    color: var(--text-inverse);
}

.taches-list {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.tache-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tache-item input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.btn-add-tache {
    padding: 0.4rem 0.75rem;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 4px;
    color: var(--grey);
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.btn-add-tache:hover {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

.btn-add-sous-objectif {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: none;
    color: var(--grey);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-sous-objectif:hover {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

/* Bouton génération IA par section */
.section-header-with-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-generate-section {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--blue-ai), #9b59b6);
    color: var(--text-inverse);
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-generate-section:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.3);
}

.btn-generate-section svg {
    width: 14px;
    height: 14px;
}

.btn-generate-section.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Sélection de statut */
.statut-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.statut-select-wrapper select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

/* Modal sélection professeurs */
.prof-selection-modal .modal-body {
    max-height: 400px;
    overflow-y: auto;
}

.prof-modal-search {
    margin-bottom: 1rem;
}

.prof-modal-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* ============================================
   MODAL SELECTION PROFESSEURS - Style moderne
   ============================================ */

.search-box-modal {
    margin-bottom: 1rem;
}

.search-box-modal input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 0.875rem center no-repeat;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.search-box-modal input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.professeurs-grid-modal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.875rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.25rem;
}

.prof-modal-item {
    position: relative;
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.prof-modal-item:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.prof-modal-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.prof-modal-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.prof-modal-item.selected .prof-modal-avatar {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.prof-modal-info {
    flex: 1;
    min-width: 0;
}

.prof-modal-nom {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prof-modal-dept {
    font-size: 0.8rem;
    color: #6b7280;
    display: block;
    margin-top: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prof-modal-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: var(--card-bg);
}

.prof-modal-item.selected .prof-modal-check {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-inverse);
}

.prof-modal-check svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    stroke: var(--text-inverse);
}

.prof-modal-item.selected .prof-modal-check svg {
    opacity: 1;
    transform: scale(1);
}

/* Header du modal avec style */
#modal-select-professeurs .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-inverse);
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

#modal-select-professeurs .modal-header h3 {
    color: var(--text-inverse);
    margin: 0;
}

#modal-select-professeurs .modal-close {
    color: var(--text-inverse);
    opacity: 0.8;
}

#modal-select-professeurs .modal-close:hover {
    opacity: 1;
}

#modal-select-professeurs .modal-body {
    padding: 1.5rem;
    background: var(--bg-tertiary);
}

#modal-select-professeurs .modal-footer {
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

#modal-select-professeurs .modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

#modal-select-professeurs .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Ancien styles (deprecie mais garde pour compatibilite) */
.prof-modal-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.prof-modal-item-info {
    flex: 1;
}

.prof-modal-item-name {
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

.prof-modal-item-univ {
    font-size: 0.8rem;
    color: var(--grey);
}

/* Modal nouvelle subvention */
.nouvelle-subvention-modal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.nouvelle-subvention-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
    flex: 1;
}

.nouvelle-subvention-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.nouvelle-subvention-modal .form-group {
    margin-bottom: 1.25rem;
}

.nouvelle-subvention-modal .form-group label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.nouvelle-subvention-modal .form-group input,
.nouvelle-subvention-modal .form-group select,
.nouvelle-subvention-modal .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.nouvelle-subvention-modal .form-group input:focus,
.nouvelle-subvention-modal .form-group select:focus,
.nouvelle-subvention-modal .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 77, 153, 0.1);
}

.nouvelle-subvention-modal .form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.nouvelle-subvention-modal .form-help {
    display: block;
    font-size: 0.8rem;
    color: var(--grey);
    margin-top: 0.4rem;
}

.nouvelle-subvention-modal .form-row {
    display: flex;
    gap: 0.75rem;
}

.nouvelle-subvention-modal .text-danger {
    color: var(--error);
}

/* Champs MITACS conditionnels */
.nouvelle-subvention-modal .mitacs-fields {
    background: #f0f7ff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #cce0ff;
}

/* Editeur EasyMDE dans le modal nouvelle subvention */
.nouvelle-subvention-modal .EasyMDEContainer {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.nouvelle-subvention-modal .EasyMDEContainer .CodeMirror {
    border: none;
    border-radius: 0;
    min-height: 120px;
    font-size: 0.95rem;
    padding: 0.5rem;
}

.nouvelle-subvention-modal .EasyMDEContainer .editor-toolbar {
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    padding: 5px;
}

.nouvelle-subvention-modal .EasyMDEContainer .editor-toolbar button {
    color: var(--grey-dark);
}

.nouvelle-subvention-modal .EasyMDEContainer .editor-toolbar button:hover {
    background: var(--bg-tertiary);
}

.nouvelle-subvention-modal .EasyMDEContainer .editor-toolbar button.active {
    background: var(--primary);
    color: var(--text-inverse);
}

/* Preview mode styling */
.nouvelle-subvention-modal .EasyMDEContainer .editor-preview {
    background: var(--bg-tertiary);
    padding: 1rem;
}

.nouvelle-subvention-modal .EasyMDEContainer .editor-preview h1,
.nouvelle-subvention-modal .EasyMDEContainer .editor-preview h2,
.nouvelle-subvention-modal .EasyMDEContainer .editor-preview h3 {
    color: var(--dark);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.nouvelle-subvention-modal .EasyMDEContainer .editor-preview ul,
.nouvelle-subvention-modal .EasyMDEContainer .editor-preview ol {
    padding-left: 1.5rem;
}

.nouvelle-subvention-modal .EasyMDEContainer .editor-preview p {
    margin-bottom: 0.75rem;
}

/* ============================================
   MODAL NOUVEAU PROJET AUTONOME
   ============================================ */

#modal-nouveau-projet .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#modal-nouveau-projet .modal-header h3 svg {
    color: var(--primary);
}

#modal-nouveau-projet .modal-intro {
    background: linear-gradient(135deg, #e0f2fe 0%, #e8f5e9 100%);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-size: 0.9rem;
    line-height: 1.5;
    border-left: 4px solid var(--primary);
}

#modal-nouveau-projet .form-group {
    margin-bottom: 1.25rem;
}

#modal-nouveau-projet .form-group label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

#modal-nouveau-projet .form-group input,
#modal-nouveau-projet .form-group select,
#modal-nouveau-projet .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

#modal-nouveau-projet .form-group input:focus,
#modal-nouveau-projet .form-group select:focus,
#modal-nouveau-projet .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 77, 153, 0.1);
}

#modal-nouveau-projet .form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

#modal-nouveau-projet .form-help {
    display: block;
    font-size: 0.8rem;
    color: var(--grey);
    margin-top: 0.4rem;
}

#modal-nouveau-projet .text-danger {
    color: var(--error);
}

#modal-nouveau-projet .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

#modal-nouveau-projet .modal-footer .btn-primary svg {
    margin-right: 0.5rem;
}

/* Panel header avec bouton */
.panel-header .btn {
    margin-left: auto;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.panel-header .btn svg {
    width: 14px;
    height: 14px;
}

/* Dark mode pour modal nouveau projet */
[data-theme="dark"] #modal-nouveau-projet .modal-intro {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(51, 65, 85, 0.6) 100%);
    border-left-color: var(--blue-ai);
    color: var(--text-primary);
}

[data-theme="dark"] #modal-nouveau-projet .form-group label {
    color: var(--text-primary);
}

/* ============================================
   ONGLET PROFESSEURS - MATCHING A POSTERIORI
   ============================================ */

/* Badge dans l'onglet */
.tab-professeurs-badge {
    background: var(--blue-ai);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    margin-right: 0.35rem;
}

/* Etat vide */
.professeurs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.professeurs-empty-state svg {
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.professeurs-empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.professeurs-empty-state p {
    color: var(--grey);
    margin-bottom: 1.5rem;
    max-width: 400px;
}

.professeurs-empty-state .btn-ai {
    background: linear-gradient(135deg, #B71C1C 0%, #E2231A 100%) !important;
    color: #ffffff !important;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(226, 35, 26, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.professeurs-empty-state .btn-ai:hover {
    background: linear-gradient(135deg, #7f0000 0%, #B71C1C 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(226, 35, 26, 0.45);
}

.professeurs-empty-state .btn-ai svg {
    stroke: #ffffff !important;
}

/* Options de matching */
.matching-options {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 400px;
}

.matching-options .form-group {
    margin-bottom: 1rem;
}

.matching-options .form-group:last-child {
    margin-bottom: 0;
}

.matching-options label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.max-profs-wrapper-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.max-profs-wrapper-mini input[type="range"] {
    flex: 1;
    height: 6px;
    accent-color: var(--primary);
}

.max-profs-wrapper-mini input[type="number"] {
    width: 60px;
    padding: 0.4rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.matching-options select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Etat de chargement */
.professeurs-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.professeurs-loading-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 1rem 0 0.5rem;
}

.professeurs-loading-state p {
    color: var(--grey);
    margin-bottom: 1.5rem;
}

/* Resultats du matching */
.professeurs-results-state {
    padding: 1rem 0;
}

.professeurs-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.professeurs-results-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.professeurs-results-meta .meta-badge {
    background: var(--blue-ai);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.professeurs-results-meta .meta-date,
.professeurs-results-meta .meta-count {
    font-size: 0.85rem;
    color: var(--grey);
}

/* Liste des professeurs */
.professeurs-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
}

/* Carte professeur */
.professeur-match-card {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.professeur-match-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--blue-ai) 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.professeur-match-content {
    flex: 1;
    padding: 0.875rem 1rem;
}

.professeur-match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.professeur-match-name strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.professeur-match-univ {
    display: block;
    font-size: 0.8rem;
    color: var(--grey);
    margin-top: 0.15rem;
}

.professeur-match-score {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.professeur-match-expertises {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.professeur-match-expertises .expertise-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.professeur-match-justification {
    font-size: 0.85rem;
    color: var(--grey-dark);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.professeur-match-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.professeur-match-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
}

/* Dark mode */
[data-theme="dark"] .matching-options {
    background: rgba(30, 41, 59, 0.6);
}

[data-theme="dark"] .matching-options label {
    color: var(--text-primary);
}

[data-theme="dark"] .professeur-match-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .professeur-match-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .professeur-match-expertises .expertise-tag {
    background: rgba(59, 130, 246, 0.2);
    color: var(--blue-ai);
}

/* Score colors */
.professeur-match-score.score-excellent {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.professeur-match-score.score-bon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.professeur-match-score.score-moyen {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Score wrapper */
.professeur-match-score-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

/* Agent badges */
.professeur-agents-badges {
    display: flex;
    gap: 0.25rem;
}

.agent-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.agent-badge.agent-claude {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.agent-badge.agent-openai {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.agent-badge.agent-gemini {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Labels */
.expertises-label,
.justification-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue-ai);
    display: block;
    margin-bottom: 0.25rem;
}

.professeur-match-justification p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.expertise-more {
    font-size: 0.75rem;
    color: var(--grey);
    font-style: italic;
}

/* Expertise groupe dans l'onglet Expertises */
.expertise-groupe {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.expertise-groupe .expertise-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.expertise-groupe .expertise-titre {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.expertise-groupe .expertise-importance {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.expertise-importance.importance-critique {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.expertise-importance.importance-haute {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.expertise-importance.importance-moyenne {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.expertise-count {
    font-size: 0.75rem;
    color: var(--grey);
}

.expertise-professeurs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.expertise-professeurs .professeur-match {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid var(--blue-ai);
}

.expertise-professeurs .professeur-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.expertise-professeurs .professeur-nom {
    font-weight: 600;
    color: var(--text-primary);
}

.expertise-professeurs .score-adequation {
    background: var(--blue-ai);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.expertise-professeurs .professeur-meta {
    font-size: 0.8rem;
    color: var(--grey);
    margin-bottom: 0.25rem;
}

.expertise-professeurs .professeur-justification {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    font-style: italic;
}

/* Dark mode for new elements */
[data-theme="dark"] .expertise-groupe {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .expertise-professeurs .professeur-match {
    background: rgba(30, 41, 59, 0.5);
}

/* ============================================
   CARTES PROFESSEURS EXTENSIBLES
   ============================================ */

/* Header cliquable */
.professeur-match-header.clickable {
    cursor: pointer;
    user-select: none;
}

.professeur-match-header.clickable:hover {
    background: rgba(27, 79, 114, 0.05);
    margin: -0.5rem -0.5rem 0.5rem -0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
}

/* Bouton expand */
.btn-expand {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--grey);
    transition: transform 0.3s ease, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-expand:hover {
    color: var(--blue-ai);
}

.professeur-match-card.expanded .btn-expand {
    transform: rotate(180deg);
}

.professeur-match-card.expanded .btn-expand svg {
    color: var(--blue-ai);
}

/* Preview (toujours visible) */
.professeur-match-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
}

.professeur-match-expertises-preview {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.expertise-tag-mini {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Détails (masqués par défaut) */
.professeur-match-details {
    display: none;
    padding-top: 0.75rem;
    animation: slideDown 0.3s ease;
}

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

.professeur-match-card.expanded .professeur-match-details {
    display: block;
}

.professeur-match-card.expanded .professeur-match-preview {
    border-bottom: none;
    padding-bottom: 0;
}

/* Labels dans les détails */
.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue-ai);
    display: block;
    margin-bottom: 0.35rem;
}

/* Expertises complètes */
.professeur-match-expertises-full {
    margin-bottom: 0.75rem;
}

.expertise-tags-full {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.expertise-tags-full .expertise-tag {
    background: linear-gradient(135deg, var(--blue-ai) 0%, var(--blue-accent) 100%);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Justification dans les détails */
.professeur-match-details .professeur-match-justification {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid var(--blue-ai);
    margin-bottom: 0.75rem;
}

.professeur-match-details .professeur-match-justification p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Actions */
.professeur-match-details .professeur-match-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Score wrapper ajusté */
.professeur-match-score-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dark mode pour cartes extensibles */
[data-theme="dark"] .professeur-match-header.clickable:hover {
    background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .professeur-match-preview {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .expertise-tag-mini {
    background: rgba(59, 130, 246, 0.2);
    color: var(--blue-light);
}

[data-theme="dark"] .professeur-match-details .professeur-match-justification {
    background: rgba(30, 41, 59, 0.5);
}

/* Éditeur markdown dans subventions */
.subvention-editor-container {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.subvention-editor-container .EasyMDEContainer {
    border: none;
}

.subvention-editor-container .EasyMDEContainer .CodeMirror {
    border: none;
    border-radius: 0;
    min-height: 200px;
}

.subvention-editor-container .editor-toolbar {
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Message vide liste */
.subventions-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--grey);
}

.subventions-empty svg {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.subventions-empty h4 {
    margin: 0 0 0.5rem 0;
    color: var(--dark);
    font-size: 1rem;
}

.subventions-empty p {
    margin: 0;
    font-size: 0.85rem;
}

/* ============================================
   PROFESSEURS - Bulles de selection cliquables
   ============================================ */

.professeurs-selection-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-height: 60px;
}

.prof-bulle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.prof-bulle:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.prof-bulle.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-inverse);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.prof-bulle.selected:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.prof-bulle-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    font-size: 0.7rem;
    font-weight: 600;
    color: inherit;
}

.prof-bulle.selected .prof-bulle-avatar {
    background: rgba(255, 255, 255, 0.2);
}

.prof-bulle-nom {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.prof-bulle-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.prof-bulle.selected .prof-bulle-check {
    opacity: 1;
    transform: scale(1);
    background: rgba(255, 255, 255, 0.25);
}

.prof-bulle-check svg {
    stroke: currentColor;
}

/* Bouton de suppression pour les bulles selectionnees */
.prof-bulle-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 0.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prof-bulle-remove:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* Container pour les tags professeurs dans le formulaire d'edition */
.professeurs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.professeurs-selection {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Message quand pas de professeurs */
.professeurs-selection-modal .text-muted,
.professeurs-tags .text-muted {
    color: #6b7280;
    font-size: 0.85rem;
    font-style: italic;
    padding: 0.5rem;
    width: 100%;
    text-align: center;
}

/* ============================================
   AVANTAGES - Cartes de selection stylisees
   ============================================ */

.avantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.avantage-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.75rem;
    background: var(--card-bg);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.avantage-card:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.15);
}

.avantage-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.avantage-card:has(input:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.avantage-card:has(input:checked) .avantage-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-inverse);
    transform: scale(1.05);
}

.avantage-card:has(input:checked) .avantage-label {
    color: #4c1d95;
    font-weight: 700;
}

.avantage-card:has(input:checked) .avantage-check {
    opacity: 1;
    transform: scale(1);
}

.avantage-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.avantage-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 12px;
    color: #6b7280;
    transition: all 0.25s ease;
}

.avantage-icon svg {
    width: 24px;
    height: 24px;
}

.avantage-card:hover .avantage-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #c7d2fe 100%);
    color: #4f46e5;
}

.avantage-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.avantage-desc {
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1.3;
}

.avantage-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: var(--text-inverse);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.avantage-check svg {
    width: 14px;
    height: 14px;
}

/* Animation pulse sur selection */
@keyframes avantage-pulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

.avantage-card:has(input:checked) .avantage-check {
    animation: avantage-pulse 0.4s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .avantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .avantage-card {
        flex-direction: row;
        text-align: left;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .avantage-content {
        flex-direction: row;
        align-items: center;
        flex: 1;
    }

    .avantage-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .avantage-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Responsive subventions */
@media (max-width: 900px) {
    .subventions-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .subventions-liste-panel {
        max-height: 350px;
    }

    .subvention-detail-panel {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .subvention-tabs {
        padding: 0 1rem;
    }

    .subv-tab {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .subvention-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .subvention-detail-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .subv-form-row {
        grid-template-columns: 1fr;
    }

    .stagiaire-grid {
        grid-template-columns: 1fr;
    }

    .prof-modal-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SUBVENTIONS - Sections Projets et Suggestions
   ============================================ */

/* Section projets - prend toute la hauteur disponible */
.subv-section-projets {
    border-bottom: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* Zone de recherche projets */
.subv-projets-search {
    position: relative;
    padding: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.subv-projets-search input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 10px;
    font-size: 0.82rem;
    background: #ffffff;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.subv-projets-search input:focus {
    outline: none;
    border-color: var(--red-ets, #E2231A);
    box-shadow: 0 0 0 4px rgba(226, 35, 26, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.subv-projets-search input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.subv-projets-search .search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.subv-projets-search input:focus + .search-icon,
.subv-projets-search:focus-within .search-icon {
    color: var(--red-ets, #E2231A);
}

.subv-section-projets .subv-projets-liste {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
}

/* Header de section - style coloré rouge ETS */
.subv-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #B71C1C 0%, #E2231A 100%);
    border-radius: 0;
    position: relative;
    flex-shrink: 0;
}

/* Premier header arrondi en haut */
.subv-section-projets > .subv-section-header {
    border-radius: 11px 11px 0 0;
}

.subv-section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.subv-section-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.subv-section-header h3 svg {
    color: rgba(255, 255, 255, 0.9);
    stroke: rgba(255, 255, 255, 0.9);
}

/* Bouton dans le header de section */
.subv-section-header .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.subv-section-header .btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.subv-section-header .btn svg {
    color: #ffffff;
    stroke: #ffffff;
}

/* Item projet - style coloré rouge ETS */
.subv-projet-item {
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(226, 35, 26, 0.15);
    background: linear-gradient(135deg, #fff8f7 0%, #fff5f4 100%);
}

.subv-projet-item:hover {
    border-color: rgba(226, 35, 26, 0.4);
    background: linear-gradient(135deg, #fff0ef 0%, #ffebea 100%);
    box-shadow: 0 4px 12px rgba(226, 35, 26, 0.15);
    transform: translateY(-2px);
}

.subv-projet-item.active {
    border-color: #E2231A;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    box-shadow: 0 4px 16px rgba(226, 35, 26, 0.2);
}

.subv-projet-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subv-projet-titre {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 0.5rem;
}

.subv-projet-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-count {
    font-size: 0.68rem;
    background: linear-gradient(135deg, var(--red-dark, #B71C1C), var(--red-ets, #E2231A));
    color: #ffffff;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(226, 35, 26, 0.25);
    min-width: 18px;
    text-align: center;
}

.badge-suggestion-mini {
    font-size: 0.62rem;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #ffffff;
    padding: 0.18rem 0.4rem;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.25);
}

.subv-projets-empty {
    text-align: center;
    padding: 1rem;
    color: var(--grey);
    font-size: 0.85rem;
}

/* Section demandes */
.subv-section-demandes {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    min-height: 0;
}

/* Liste demandes subventions */
.subv-demandes-liste {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: linear-gradient(180deg, #fffbf7 0%, #fff7f0 100%);
    min-height: 0;
}

/* Suggestions IA */
.subv-suggestions {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-bottom: 1px solid #ddd6fe;
    padding: 0.5rem;
}

.subv-suggestions-header {
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
}

.badge-suggestion {
    font-size: 0.7rem;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: var(--text-inverse);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-suggestion::before {
    content: "✨";
    font-size: 0.8rem;
}

.subv-suggestions-liste {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.subv-suggestion-item {
    padding: 0.6rem 0.75rem;
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.subv-suggestion-item:hover {
    border-color: var(--blue-primary);
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.15);
}

.subv-suggestion-item.has-demande {
    opacity: 0.7;
    background: #f0f0f0;
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.suggestion-type {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark);
}

.suggestion-chances {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: 500;
}

.suggestion-chances.badge-elevees,
.suggestion-chances.badge-élevées {
    background: #d4edda;
    color: #155724;
}

.suggestion-chances.badge-moyennes {
    background: #fff3cd;
    color: #856404;
}

.suggestion-chances.badge-faibles {
    background: #f8d7da;
    color: #721c24;
}

.suggestion-montant {
    font-size: 0.75rem;
    color: var(--grey);
}

.suggestion-action {
    font-size: 0.75rem;
    color: var(--blue-primary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.suggestion-existante {
    font-size: 0.75rem;
    color: var(--grey);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Agent IA Selector */
.agent-ia-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(155, 89, 182, 0.1);
    border-radius: 6px;
    margin-right: 0.5rem;
}

.agent-ia-selector label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--grey-dark);
    white-space: nowrap;
}

.agent-ia-selector select {
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--card-bg);
    cursor: pointer;
}

.agent-ia-selector select:focus {
    outline: none;
    border-color: var(--blue-ai);
}

/* Badge projet */
.badge-projet {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: rgba(52, 152, 219, 0.1);
    color: var(--blue-primary);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-projet svg {
    width: 12px;
    height: 12px;
}

/* Bouton xs */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Form help text */
.form-help {
    color: var(--grey);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Scrollable liste */
.subventions-liste-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* ============================================
   SUBVENTIONS - Styles améliorés sidebar
   ============================================ */

/* Header amélioré Demandes de Subventions - style coloré rouge ETS */
.subv-section-demandes > .subv-section-header {
    background: linear-gradient(135deg, #B71C1C 0%, #E2231A 100%);
    border-radius: 0;
    padding: 0.875rem 1rem;
    border-bottom: none;
    position: relative;
    flex-shrink: 0;
}

.subv-section-demandes > .subv-section-header h3 {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.subv-section-demandes > .subv-section-header h3 svg {
    color: rgba(255, 255, 255, 0.9);
    stroke: rgba(255, 255, 255, 0.9);
}

/* Bouton + style coloré */
.subv-section-demandes > .subv-section-header .btn-xs {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.subv-section-demandes > .subv-section-header .btn-xs:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.subv-section-demandes > .subv-section-header .btn-xs svg {
    stroke: #ffffff;
    stroke-width: 2;
}

.subventions-filtres select:hover {
    border-color: #667eea;
    background: #fafbff;
}

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

/* État vide amélioré */
.subventions-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fc 0%, #f0f4f8 100%);
    border-radius: 12px;
    margin: 0.75rem;
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
}

.subventions-empty-state:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f5f7ff 0%, #ede9fe 100%);
}

.subventions-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    stroke: #9ca3af;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.subventions-empty-state:hover svg {
    stroke: #667eea;
    opacity: 1;
    transform: scale(1.1);
}

.subventions-empty-state p {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.subventions-empty-state span {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Item de subvention dans le sidebar */
.subvention-list-item {
    padding: 0.75rem;
    margin: 0.25rem 0;
    background: var(--card-bg);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.subvention-list-item:hover {
    background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 100%);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.subvention-list-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.subvention-list-item.active * {
    color: var(--text-inverse) !important;
}

.subvention-list-item .item-titre {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.subvention-list-item .item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.subvention-list-item .badge-mini {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.subvention-list-item .badge-statut-mini {
    background: #e0f2fe;
    color: #0369a1;
}

.subvention-list-item .badge-programme-mini {
    background: #f3e8ff;
    color: #7c3aed;
}

.subvention-list-item.active .badge-mini {
    background: rgba(255, 255, 255, 0.25);
    color: var(--text-inverse);
}

/* ============================================
   SUBVENTIONS ITEMS - Nouveau design avec icones
   ============================================ */

/* Container principal de l'item */
.subvention-item {
    padding: 0.875rem;
    margin: 0.5rem 0.25rem;
    background: var(--card-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.subvention-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #9ca3af;
    transition: all 0.25s ease;
}

/* Couleurs de bordure par statut */
.subvention-item.statut-brouillon::before { background: #9ca3af; }
.subvention-item.statut-en_cours::before { background: #f59e0b; }
.subvention-item.statut-a_valider::before { background: #3b82f6; }
.subvention-item.statut-validee::before { background: #10b981; }
.subvention-item.statut-envoyee_decanat::before { background: #8b5cf6; }
.subvention-item.statut-soumise::before { background: #06b6d4; }
.subvention-item.statut-acceptee::before { background: #22c55e; }
.subvention-item.statut-refusee::before { background: #ef4444; }

.subvention-item:hover {
    border-color: #667eea;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.subvention-item:hover::before {
    width: 5px;
}

.subvention-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.subvention-item.active::before {
    width: 5px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

/* Layout principal avec icone */
.subv-item-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

/* Bouton de suppression dans la liste */
.subv-item-delete {
    opacity: 0;
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s ease;
    margin-left: auto;
}

.subv-item-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.subvention-item:hover .subv-item-delete {
    opacity: 1;
}

/* Icone d'etat */
.subv-item-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.subv-item-icon svg {
    width: 18px;
    height: 18px;
}

/* Couleurs d'icones par statut */
.subv-item-icon.statut-brouillon {
    background: #f3f4f6;
    color: #6b7280;
}
.subv-item-icon.statut-en_cours {
    background: #fef3c7;
    color: #d97706;
}
.subv-item-icon.statut-a_valider {
    background: #dbeafe;
    color: #2563eb;
}
.subv-item-icon.statut-validee {
    background: #d1fae5;
    color: #059669;
}
.subv-item-icon.statut-envoyee_decanat {
    background: #ede9fe;
    color: #7c3aed;
}
.subv-item-icon.statut-soumise {
    background: #cffafe;
    color: #0891b2;
}
.subv-item-icon.statut-acceptee {
    background: #dcfce7;
    color: #16a34a;
}
.subv-item-icon.statut-refusee {
    background: #fee2e2;
    color: #dc2626;
}

/* Contenu principal */
.subv-item-content {
    flex: 1;
    min-width: 0;
}

.subv-item-content .subv-item-titre {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta informations */
.subv-item-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.subv-item-programme {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}

.subv-item-programme.mitacs {
    background: #dbeafe;
    color: #1d4ed8;
}
.subv-item-programme.crsng {
    background: #ffedd5;
    color: #c2410c;
}
.subv-item-programme.frqnt {
    background: #f3e8ff;
    color: #7e22ce;
}
.subv-item-programme.autre {
    background: #f3f4f6;
    color: #4b5563;
}

.subv-item-date {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.subv-item-date svg {
    opacity: 0.7;
}

/* Badge de statut */
.subv-item-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    align-self: flex-start;
}

.subv-item-badge.statut-brouillon {
    background: #f3f4f6;
    color: #4b5563;
}
.subv-item-badge.statut-en_cours {
    background: #fef3c7;
    color: #b45309;
}
.subv-item-badge.statut-a_valider {
    background: #dbeafe;
    color: #1d4ed8;
}
.subv-item-badge.statut-validee {
    background: #d1fae5;
    color: #047857;
}
.subv-item-badge.statut-envoyee_decanat {
    background: #ede9fe;
    color: #6d28d9;
}
.subv-item-badge.statut-soumise {
    background: #cffafe;
    color: #0e7490;
}
.subv-item-badge.statut-acceptee {
    background: #dcfce7;
    color: #15803d;
}
.subv-item-badge.statut-refusee {
    background: #fee2e2;
    color: #b91c1c;
}

/* Barre de progression */
.subv-item-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid #f3f4f6;
}

.subv-progress-track {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.subv-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Couleurs de progression par statut */
.subv-progress-fill.statut-brouillon { background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%); }
.subv-progress-fill.statut-en_cours { background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%); }
.subv-progress-fill.statut-a_valider { background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%); }
.subv-progress-fill.statut-validee { background: linear-gradient(90deg, #34d399 0%, #10b981 100%); }
.subv-progress-fill.statut-envoyee_decanat { background: linear-gradient(90deg, #a78bfa 0%, #8b5cf6 100%); }
.subv-progress-fill.statut-soumise { background: linear-gradient(90deg, #22d3ee 0%, #06b6d4 100%); }
.subv-progress-fill.statut-acceptee { background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%); }
.subv-progress-fill.statut-refusee { background: linear-gradient(90deg, #f87171 0%, #ef4444 100%); }

.subv-progress-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 32px;
    text-align: right;
}

/* Animation au survol */
.subvention-item:hover .subv-item-icon {
    transform: scale(1.08);
}

.subvention-item:hover .subv-progress-fill {
    filter: brightness(1.1);
}

/* Item actif - styles speciaux */
.subvention-item.active .subv-item-titre {
    color: #1e3a5f;
}

.subvention-item.active .subv-item-badge {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Suggestions IA améliorées */
.subv-suggestions {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-bottom: 1px solid #e9d5ff;
    padding: 0.75rem;
}

.subv-suggestions-header {
    padding: 0.25rem 0.5rem 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed #d8b4fe;
}

.badge-suggestion {
    font-size: 0.75rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: var(--text-inverse);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.badge-suggestion::before {
    content: "✨";
    font-size: 0.85rem;
}

.subv-suggestion-item {
    padding: 0.65rem 0.75rem;
    background: var(--card-bg);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9d5ff;
    margin-bottom: 0.35rem;
}

.subv-suggestion-item:hover {
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
}

/* ============================================
   ICONES ETAT PROJETS (cahier/financement)
   ============================================ */

.projet-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.35rem;
}

.icon-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Cahier des charges genere */
.icon-cahier {
    background: linear-gradient(135deg, #10b981, #059669);
    color: var(--text-inverse);
}

.icon-cahier svg {
    stroke: var(--text-inverse);
}

/* Cahier des charges non genere */
.icon-cahier-empty {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Plan de financement genere */
.icon-financement {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: var(--text-inverse);
}

.icon-financement svg {
    stroke: var(--text-inverse);
}

/* Plan de financement non genere */
.icon-financement-empty {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Hover sur les icones */
.subv-projet-item:hover .icon-cahier-empty,
.subv-projet-item:hover .icon-financement-empty {
    background: #e5e7eb;
}

/* Projet actif */
.subv-projet-item.active .icon-cahier-empty,
.subv-projet-item.active .icon-financement-empty {
    background: rgba(255, 255, 255, 0.2);
}

.subv-projet-item.active .icon-cahier-empty svg,
.subv-projet-item.active .icon-financement-empty svg {
    stroke: rgba(255, 255, 255, 0.5);
}

/* ============================================
   CHAMPS MITACS SPECIFIQUES
   ============================================ */

.mitacs-fields {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.mitacs-fields label {
    color: #92400e;
    font-weight: 600;
}

.mitacs-fields .text-danger {
    color: #dc2626;
}

.mitacs-fields input,
.mitacs-fields select {
    border-color: #fbbf24;
}

.mitacs-fields input:focus,
.mitacs-fields select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.mitacs-fields .form-help {
    color: #92400e;
    font-size: 0.75rem;
}

/* ============================================
   FORMULAIRE SUBVENTION - Styles ameliores
   ============================================ */

/* Header principal de la subvention */
.subvention-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 50%, #3182ce 100%);
    padding: 1.5rem 2rem;
    color: var(--text-inverse);
    position: relative;
    /* overflow: hidden retire pour permettre au dropdown de s'afficher */
}

.subvention-header::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.subvention-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 150px;
    height: 100%;
    background: radial-gradient(circle at bottom left, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.subvention-header-info {
    position: relative;
    z-index: 1;
}

.subvention-header-info h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subvention-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* Badges dans le header */
.badge-projet {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-inverse);
    font-weight: 500;
}

.badge-projet svg {
    opacity: 0.9;
}

.badge-programme {
    padding: 0.4rem 0.85rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-inverse);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-statut {
    padding: 0.4rem 0.85rem;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-inverse);
    border: 1px solid rgba(255,255,255,0.3);
}

.badge-statut.brouillon { background: rgba(107, 114, 128, 0.8); }
.badge-statut.en_cours { background: rgba(59, 130, 246, 0.8); }
.badge-statut.a_valider { background: rgba(245, 158, 11, 0.8); }
.badge-statut.validee { background: rgba(16, 185, 129, 0.8); }
.badge-statut.soumise { background: rgba(139, 92, 246, 0.8); }
.badge-statut.acceptee { background: rgba(16, 185, 129, 0.9); }
.badge-statut.refusee { background: rgba(239, 68, 68, 0.8); }

.progression-badge {
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Actions du header */
.subvention-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.25rem;
    position: relative;
    z-index: 1;
}

/* Selecteur Agent IA ameliore */
.subvention-header-actions .agent-ia-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.subvention-header-actions .agent-ia-selector label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}

.subvention-header-actions .agent-ia-selector select {
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.9);
    color: #1e3a5f;
    font-weight: 500;
    cursor: pointer;
}

/* Boutons dans le header */
.subvention-header-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.subvention-header-actions .btn svg {
    width: 16px;
    height: 16px;
}

.subvention-header-actions .btn-secondary {
    background: rgba(255,255,255,0.15);
    color: var(--text-inverse);
    border: 1px solid rgba(255,255,255,0.3);
}

.subvention-header-actions .btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

.subvention-header-actions .btn-primary {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.subvention-header-actions .btn-primary:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

/* Dropdown Actions */
.subvention-header-actions .dropdown {
    position: relative;
    z-index: 100;
}

.subvention-header-actions .dropdown-toggle {
    background: rgba(255,255,255,0.1);
    color: var(--text-inverse);
    border: 1px solid rgba(255,255,255,0.2);
}

.subvention-header-actions .dropdown-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.subvention-header-actions .dropdown-menu {
    position: fixed;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    min-width: 200px;
    z-index: 10000;
    display: none;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.subvention-header-actions .dropdown-menu.show {
    display: block;
}

.subvention-header-actions .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
    white-space: nowrap;
}

.subvention-header-actions .dropdown-menu a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.subvention-header-actions .dropdown-menu a:hover {
    background: #f3f4f6;
    color: #1e3a5f;
}

.subvention-header-actions .dropdown-menu a.text-danger {
    color: #dc2626;
}

.subvention-header-actions .dropdown-menu a.text-danger:hover {
    background: #fef2f2;
}

.subvention-header-actions .dropdown-menu hr {
    margin: 0.25rem 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* Onglets ameliores */
.subvention-tabs {
    display: flex;
    gap: 0;
    padding: 0;
    background: linear-gradient(to bottom, #f1f5f9, #ffffff);
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.subvention-tabs::-webkit-scrollbar {
    height: 6px;
}

.subvention-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.subvention-tabs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.subvention-tabs::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.subv-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.subv-tab svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.subv-tab:hover svg {
    opacity: 1;
}

.subv-tab.active svg {
    opacity: 1;
    color: #3182ce;
}

.subv-tab:hover {
    color: #1e3a5f;
    background: rgba(30, 58, 95, 0.05);
}

.subv-tab.active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
    background: var(--card-bg);
}

.subv-tab.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e3a5f, #3182ce);
}

/* Contenu des onglets */
.subvention-panes,
.subvention-tab-content {
    padding: 2rem;
    background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
    min-height: 400px;
}

.subv-tab-pane {
    display: none;
    animation: fadeInTab 0.3s ease;
}

.subv-tab-pane.active {
    display: block;
}

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

.subv-tab-pane h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subv-tab-pane h3::before {
    content: "";
    width: 4px;
    height: 1.5rem;
    background: linear-gradient(135deg, #1e3a5f, #3182ce);
    border-radius: 2px;
}

/* Sections du formulaire */
.subv-form-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.subv-form-section h3,
.subv-form-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subv-form-section h3::before,
.subv-form-section h4::before {
    content: "";
    width: 4px;
    height: 1.2em;
    background: linear-gradient(135deg, #1e3a5f, #3182ce);
    border-radius: 2px;
}

/* Labels et inputs ameliores */
.subv-form-section label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.subv-form-section input[type="text"],
.subv-form-section input[type="email"],
.subv-form-section input[type="number"],
.subv-form-section select,
.subv-form-section textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: #fafbfc;
}

.subv-form-section input:focus,
.subv-form-section select:focus,
.subv-form-section textarea:focus {
    outline: none;
    border-color: #3182ce;
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.subv-form-section textarea {
    min-height: 120px;
    resize: vertical;
}

/* Grille de formulaire */
.subv-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.subv-form-group {
    margin-bottom: 1rem;
}

/* Section Organisation partenaire stylisee */
.partenaire-fields {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.partenaire-fields input {
    padding: 0.65rem 0.85rem;
}

@media (max-width: 900px) {
    .partenaire-fields {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .partenaire-fields {
        grid-template-columns: 1fr;
    }

    .subvention-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .subvention-header-actions .btn {
        justify-content: center;
    }
}

/* ============================================
   SUBVENTION - Formulaires dans les panneaux
   ============================================ */

/* Styles specifiques pour les champs dans subv-tab-pane */
.subv-tab-pane .form-group {
    margin-bottom: 1.25rem;
}

.subv-tab-pane .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.subv-tab-pane input[type="text"],
.subv-tab-pane input[type="email"],
.subv-tab-pane input[type="number"],
.subv-tab-pane select,
.subv-tab-pane textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: var(--card-bg);
}

.subv-tab-pane input:focus,
.subv-tab-pane select:focus,
.subv-tab-pane textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.1);
}

.subv-tab-pane input::placeholder,
.subv-tab-pane textarea::placeholder {
    color: #9ca3af;
}

.subv-tab-pane textarea {
    min-height: 120px;
    resize: vertical;
}

/* Form row avec grille */
.subv-tab-pane .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Section header avec bouton - Style moderne */
.subv-tab-pane .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    color: var(--text-inverse);
}

.subv-tab-pane .section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subv-tab-pane .section-header h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
}

.subv-tab-pane .section-header .btn-ai {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--text-inverse);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subv-tab-pane .section-header .btn-ai:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.subv-tab-pane .section-header .btn-ai svg {
    stroke: var(--text-inverse);
}

/* Section help text */
.subv-tab-pane .section-help {
    margin: 0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-left: 2px solid #e5e7eb;
    border-right: 2px solid #e5e7eb;
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

/* Editor container */
.subv-tab-pane .editor-container {
    background: var(--card-bg);
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.subv-tab-pane .editor-container textarea,
.subv-tab-pane .editor-container .rich-editor {
    width: 100%;
    min-height: 200px;
    padding: 1rem 1.25rem;
    border: none;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1e293b;
    resize: vertical;
    box-sizing: border-box;
}

.subv-tab-pane .editor-container textarea:focus,
.subv-tab-pane .editor-container .rich-editor:focus {
    outline: none;
    background: #fefefe;
}

.subv-tab-pane .editor-container textarea::placeholder {
    color: #94a3b8;
}

/* Style pour EasyMDE dans les onglets subvention */
.subv-tab-pane .editor-container .EasyMDEContainer {
    border: none;
}

.subv-tab-pane .editor-container .EasyMDEContainer .CodeMirror {
    border: none;
    border-radius: 0 0 10px 10px;
    min-height: 180px;
    padding: 0.5rem;
}

.subv-tab-pane .editor-container .editor-toolbar {
    border: none;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    padding: 0.5rem;
}

.subv-tab-pane .editor-container .editor-toolbar button {
    color: #64748b;
}

.subv-tab-pane .editor-container .editor-toolbar button:hover {
    background: #e5e7eb;
}

/* Sub-section header (pour sous-objectifs, etc.) */
.subv-tab-pane .section-header.sub-header,
.subv-tab-pane .section-header[style*="margin-top"] {
    background: #f1f5f9;
    border-radius: 10px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.subv-tab-pane .section-header.sub-header h4,
.subv-tab-pane .section-header[style*="margin-top"] h4 {
    color: #334155;
    font-size: 1rem;
    margin: 0;
}

.subv-tab-pane .section-header.sub-header h4::before,
.subv-tab-pane .section-header[style*="margin-top"] h4::before {
    content: '';
    width: 3px;
    height: 16px;
    background: #667eea;
    border-radius: 2px;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Titres h4 dans les onglets */
.subv-tab-pane h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin: 1.25rem 0 0.75rem 0;
    padding-left: 0.75rem;
    border-left: 3px solid #667eea;
}

.subv-tab-pane h4:first-child {
    margin-top: 0;
}

/* Textarea directement dans un tab-pane (sans editor-container) */
.subv-tab-pane > textarea,
.subv-tab-pane textarea.rich-editor:not(.editor-container textarea) {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1e293b;
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.subv-tab-pane > textarea:focus,
.subv-tab-pane textarea.rich-editor:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Wrapper de section complet (header + help + editor) */
.subv-section-wrapper {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.subv-section-wrapper .section-header {
    margin-bottom: 0;
    border-radius: 0;
}

.subv-section-wrapper .section-help {
    border-radius: 0;
}

.subv-section-wrapper .editor-container {
    border-left: none;
    border-right: none;
    border-radius: 0 0 12px 12px;
}

/* Partenaire form grid */
.subv-tab-pane .partenaire-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 900px) {
    .subv-tab-pane .partenaire-form {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .subv-tab-pane .partenaire-form {
        grid-template-columns: 1fr;
    }
}

/* Professeurs selection */
.subv-tab-pane .professeurs-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

.subv-tab-pane .professeurs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subv-tab-pane .professeur-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border: 1px solid #7dd3fc;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #0369a1;
    font-weight: 500;
}

.subv-tab-pane .professeur-tag .remove-tag {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.subv-tab-pane .professeur-tag .remove-tag:hover {
    opacity: 1;
}

/* Stagiaires liste - Style moderne */
.subv-tab-pane .stagiaires-liste {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.subv-tab-pane .stagiaire-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.subv-tab-pane .stagiaire-card:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Header de la carte stagiaire */
.stagiaire-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-inverse);
}

.stagiaire-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stagiaire-avatar svg {
    stroke: var(--text-inverse);
}

.stagiaire-numero {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.stagiaire-btn-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.stagiaire-btn-remove svg {
    stroke: var(--text-inverse);
}

.stagiaire-btn-remove:hover {
    background: #ef4444;
}

/* Body de la carte stagiaire */
.stagiaire-card-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem;
}

.stagiaire-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stagiaire-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stagiaire-field input,
.stagiaire-field select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #1e293b;
    background: var(--card-bg);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

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

.stagiaire-field input::placeholder {
    color: #94a3b8;
}

.stagiaire-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

@media (max-width: 768px) {
    .stagiaire-card-body {
        grid-template-columns: 1fr;
    }
}

/* Boutons dans les panneaux */
.subv-tab-pane .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.subv-tab-pane .btn-secondary {
    background: linear-gradient(135deg, #f1f5f9, var(--border-color));
    color: #475569;
    border: 1px solid #cbd5e1;
}

.subv-tab-pane .btn-secondary:hover {
    background: linear-gradient(135deg, var(--border-color), #cbd5e1);
    transform: translateY(-1px);
}

.subv-tab-pane .btn-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.subv-tab-pane .btn-danger:hover {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.subv-tab-pane .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* Textarea avec generation IA */
.subv-tab-pane .textarea-with-actions {
    position: relative;
}

.subv-tab-pane .textarea-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}

.subv-tab-pane .btn-generate {
    background: linear-gradient(135deg, #1e3a5f, #2c5282);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

.subv-tab-pane .btn-generate:hover {
    background: linear-gradient(135deg, #2c5282, #3182ce);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
}

/* Indicateur de caracteres */
.subv-tab-pane .char-counter {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
    margin-top: 0.25rem;
}

.subv-tab-pane .char-counter.warning {
    color: #f59e0b;
}

.subv-tab-pane .char-counter.danger {
    color: #dc2626;
}

/* ============================================
   OVERLAY GENERATION IA - Splash Screen
   ============================================ */

.generation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 79, 114, 0.97);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.generation-modal {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 550px;
    width: 90%;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4),
                0 0 80px rgba(41, 128, 185, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 2px solid var(--blue-accent, #2980B9);
    animation: slideUpModal 0.4s ease;
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.generation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.generation-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--blue-ai, #1B4F72) 0%, var(--blue-accent, #2980B9) 50%, var(--blue-light, #3498DB) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 50px rgba(27, 79, 114, 0.5);
    animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); box-shadow: 0 15px 50px rgba(27, 79, 114, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 20px 60px rgba(41, 128, 185, 0.6); }
}

.generation-icon svg {
    stroke: var(--text-inverse);
    animation: rotateIcon 4s linear infinite;
}

@keyframes rotateIcon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.generation-header h2 {
    color: var(--blue-ai, #1B4F72);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.generation-subtitle {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

/* Progress Bar */
.generation-progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.generation-progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(27, 79, 114, 0.15);
    border-radius: 5px;
    overflow: hidden;
}

.generation-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-ai, #1B4F72), var(--blue-accent, #2980B9), var(--blue-light, #3498DB));
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
}

.generation-progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.generation-progress-percent {
    color: var(--blue-ai, #1B4F72);
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
}

/* Steps */
.generation-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gen-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: rgba(27, 79, 114, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(27, 79, 114, 0.1);
    transition: all 0.3s ease;
}

.gen-step.active {
    background: rgba(41, 128, 185, 0.15);
    border-color: rgba(41, 128, 185, 0.3);
}

.gen-step.completed {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.gen-step.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.gen-step-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(27, 79, 114, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gen-step-icon svg {
    stroke: #64748b;
    transition: all 0.3s;
}

.gen-step.active .gen-step-icon {
    background: linear-gradient(135deg, var(--blue-ai, #1B4F72), var(--blue-accent, #2980B9));
}

.gen-step.active .gen-step-icon svg {
    stroke: var(--text-inverse);
    animation: pulseStep 1s infinite ease-in-out;
}

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

.gen-step.completed .gen-step-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gen-step.completed .gen-step-icon svg {
    stroke: var(--text-inverse);
}

.gen-step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gen-step-title {
    color: var(--dark, #1e293b);
    font-size: 0.9rem;
    font-weight: 600;
}

.gen-step-status {
    color: #64748b;
    font-size: 0.75rem;
}

.gen-step.active .gen-step-status {
    color: var(--blue-accent, #2980B9);
}

.gen-step.completed .gen-step-status {
    color: #10b981;
}

.gen-step.error .gen-step-status {
    color: #ef4444;
}

.gen-step-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.gen-step-check svg {
    stroke: #10b981;
}

.gen-step.completed .gen-step-check {
    opacity: 1;
    transform: scale(1);
    background: rgba(16, 185, 129, 0.2);
}

/* Agent Badge */
.generation-agent {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(27, 79, 114, 0.15);
}

.agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(27, 79, 114, 0.08);
    border-radius: 20px;
    color: #64748b;
    font-size: 0.85rem;
}

.agent-badge svg {
    stroke: var(--blue-accent, #2980B9);
}

.agent-badge strong {
    color: var(--blue-ai, #1B4F72);
}

/* Cancel Button */
.btn-cancel-generation {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.875rem;
    background: rgba(27, 79, 114, 0.08);
    border: 1px solid rgba(27, 79, 114, 0.2);
    color: #64748b;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-generation:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ===================================
   EASYMDE MARKDOWN EDITOR STYLES
   =================================== */

/* Style de l'editeur dans les subventions */
.subv-tab-pane .EasyMDEContainer {
    border-radius: 8px;
    overflow: hidden;
}

.subv-tab-pane .EasyMDEContainer .CodeMirror {
    border: 1px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fafbfc;
}

.subv-tab-pane .EasyMDEContainer .CodeMirror-focused {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Toolbar */
.subv-tab-pane .EasyMDEContainer .editor-toolbar {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 0.5rem;
}

.subv-tab-pane .EasyMDEContainer .editor-toolbar button {
    color: #64748b;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.subv-tab-pane .EasyMDEContainer .editor-toolbar button:hover {
    background: var(--border-color);
    color: #667eea;
}

.subv-tab-pane .EasyMDEContainer .editor-toolbar button.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--text-inverse);
}

/* Apercu (Preview) - Style du Markdown rendu */
.subv-tab-pane .EasyMDEContainer .editor-preview,
.subv-tab-pane .EasyMDEContainer .editor-preview-side {
    background: var(--card-bg);
    padding: 1.5rem;
    font-family: inherit;
    line-height: 1.7;
    color: #334155;
}

.subv-tab-pane .EasyMDEContainer .editor-preview h2,
.subv-tab-pane .EasyMDEContainer .editor-preview-side h2 {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e7ff;
}

.subv-tab-pane .EasyMDEContainer .editor-preview h2:first-child,
.subv-tab-pane .EasyMDEContainer .editor-preview-side h2:first-child {
    margin-top: 0;
}

.subv-tab-pane .EasyMDEContainer .editor-preview p,
.subv-tab-pane .EasyMDEContainer .editor-preview-side p {
    margin-bottom: 1rem;
    color: #475569;
}

.subv-tab-pane .EasyMDEContainer .editor-preview ol,
.subv-tab-pane .EasyMDEContainer .editor-preview-side ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.subv-tab-pane .EasyMDEContainer .editor-preview ol li,
.subv-tab-pane .EasyMDEContainer .editor-preview-side ol li {
    padding: 0.5rem 0;
    color: #475569;
    border-bottom: 1px dashed #e5e7eb;
}

.subv-tab-pane .EasyMDEContainer .editor-preview ol li:last-child,
.subv-tab-pane .EasyMDEContainer .editor-preview-side ol li:last-child {
    border-bottom: none;
}

.subv-tab-pane .EasyMDEContainer .editor-preview ul,
.subv-tab-pane .EasyMDEContainer .editor-preview-side ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.subv-tab-pane .EasyMDEContainer .editor-preview ul li,
.subv-tab-pane .EasyMDEContainer .editor-preview-side ul li {
    padding: 0.4rem 0;
    color: #475569;
}

.subv-tab-pane .EasyMDEContainer .editor-preview strong,
.subv-tab-pane .EasyMDEContainer .editor-preview-side strong {
    color: #1e293b;
    font-weight: 600;
}

/* Mode side-by-side */
.subv-tab-pane .EasyMDEContainer .editor-preview-active-side {
    border-left: 2px solid #e0e7ff;
}

/* Active preview */
.subv-tab-pane .EasyMDEContainer .editor-preview-active {
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
}

/* ===================================
   MODAL GENERATION IA - SPLASH SCREEN
   Utilise les couleurs du theme AcadIA
   =================================== */

/* Overlay sombre avec teinte bleue */
.ia-generation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 79, 114, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.ia-generation-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal central - fond blanc/gris clair */
.ia-generation-modal {
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 24px;
    padding: 2.5rem;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3), 0 0 60px rgba(41, 128, 185, 0.3);
    border: 2px solid var(--blue-accent);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header avec icone */
.ia-generation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ia-generation-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--blue-ai) 0%, var(--blue-accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(41, 128, 185, 0.4);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(41, 128, 185, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 50px rgba(41, 128, 185, 0.6);
    }
}

.ia-generation-icon svg {
    stroke: var(--text-inverse);
    animation: rotateIcon 4s linear infinite;
}

@keyframes rotateIcon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ia-generation-header h2 {
    color: var(--blue-ai);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.ia-generation-subtitle {
    color: var(--grey-dark);
    font-size: 1rem;
    margin: 0;
}

/* Barre de progression */
.ia-generation-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.ia-progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(27, 79, 114, 0.1);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(27, 79, 114, 0.2);
}

.ia-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue-ai), var(--blue-accent), var(--blue-light));
    background-size: 200% 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
    animation: shimmerProgress 2s infinite linear;
}

@keyframes shimmerProgress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ia-progress-text {
    color: var(--blue-ai);
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
}

/* Etapes de generation */
.ia-generation-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ia-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: rgba(27, 79, 114, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(27, 79, 114, 0.1);
    transition: all 0.3s ease;
}

.ia-step.active {
    background: rgba(41, 128, 185, 0.1);
    border-color: var(--blue-accent);
}

.ia-step.completed {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.ia-step-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(27, 79, 114, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ia-step-icon svg {
    stroke: var(--grey);
    transition: stroke 0.3s ease;
}

.ia-step.active .ia-step-icon {
    background: linear-gradient(135deg, var(--blue-ai), var(--blue-accent));
    animation: pulse 1s infinite;
}

.ia-step.active .ia-step-icon svg {
    stroke: var(--text-inverse);
}

.ia-step.completed .ia-step-icon {
    background: linear-gradient(135deg, var(--success), #059669);
}

.ia-step.completed .ia-step-icon svg {
    stroke: var(--text-inverse);
}

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

.ia-step span {
    flex: 1;
    color: var(--grey-dark);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.ia-step.active span {
    color: var(--dark);
    font-weight: 500;
}

.ia-step.completed span {
    color: var(--success);
}

.ia-step-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ia-step.active .ia-step-status::after {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--blue-accent);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.ia-step.completed .ia-step-status::after {
    content: "✓";
    color: var(--success);
    font-weight: bold;
    font-size: 14px;
}

/* Agent badge */
.ia-generation-agent {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(27, 79, 114, 0.05);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(27, 79, 114, 0.1);
}

.ia-generation-agent svg {
    stroke: var(--blue-accent);
}

.ia-generation-agent span {
    color: var(--grey-dark);
    font-size: 0.85rem;
}

.ia-generation-agent strong {
    color: var(--blue-ai);
}

/* Bouton annuler */
.btn-cancel-ia {
    display: block;
    width: 100%;
    padding: 0.875rem;
    background: rgba(27, 79, 114, 0.05);
    border: 1px solid rgba(27, 79, 114, 0.2);
    color: var(--grey-dark);
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-ia:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* Bouton IA desactive pendant generation */
.btn-ai.generating {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.btn-ai.generating::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ===================================
   SPLASH SCREEN MATCHING PROFESSEURS
   Couleurs AcadIA (bleu fonce theme)
   =================================== */

/* Overlay sombre avec teinte bleu AcadIA */
.matching-splash-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 79, 114, 0.97);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: matchingFadeIn 0.3s ease;
}

.matching-splash-overlay.active {
    display: flex;
}

@keyframes matchingFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal central - fond blanc elegant */
.matching-splash-modal {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    padding: 2.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4),
                0 0 80px rgba(41, 128, 185, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 2px solid var(--blue-accent);
    animation: matchingSlideUp 0.4s ease;
}

@keyframes matchingSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header avec icone */
.matching-splash-header {
    text-align: center;
    margin-bottom: 2rem;
}

.matching-splash-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--blue-ai) 0%, var(--blue-accent) 50%, var(--blue-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 50px rgba(27, 79, 114, 0.5);
    animation: matchingPulseGlow 2s infinite ease-in-out;
}

@keyframes matchingPulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 15px 50px rgba(27, 79, 114, 0.5);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 20px 60px rgba(41, 128, 185, 0.7);
    }
}

.matching-splash-icon svg {
    stroke: var(--text-inverse);
    animation: matchingSearchPulse 1.5s ease-in-out infinite;
}

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

.matching-splash-header h2 {
    color: var(--blue-ai);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.matching-splash-subtitle {
    color: var(--grey-dark);
    font-size: 1rem;
    margin: 0;
}

/* Barre de progression */
.matching-splash-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.matching-progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(27, 79, 114, 0.1);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(27, 79, 114, 0.2);
}

.matching-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue-ai), var(--blue-accent), var(--blue-light));
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    animation: matchingShimmer 2s infinite linear;
}

@keyframes matchingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.matching-progress-text {
    color: var(--blue-ai);
    font-size: 1.2rem;
    font-weight: 700;
    min-width: 55px;
    text-align: right;
}

/* Etapes */
.matching-splash-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.matching-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: rgba(27, 79, 114, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(27, 79, 114, 0.1);
    transition: all 0.3s ease;
}

.matching-step.active {
    background: rgba(41, 128, 185, 0.12);
    border-color: var(--blue-accent);
}

.matching-step.completed {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.matching-step-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(27, 79, 114, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.matching-step-icon svg {
    stroke: var(--grey);
    transition: stroke 0.3s ease;
}

.matching-step.active .matching-step-icon {
    background: linear-gradient(135deg, var(--blue-ai), var(--blue-accent));
    animation: matchingStepPulse 1s infinite;
}

.matching-step.active .matching-step-icon svg {
    stroke: var(--text-inverse);
}

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

.matching-step.completed .matching-step-icon {
    background: linear-gradient(135deg, var(--success), #059669);
}

.matching-step.completed .matching-step-icon svg {
    stroke: var(--text-inverse);
}

.matching-step span {
    flex: 1;
    color: var(--grey-dark);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.matching-step.active span {
    color: var(--dark);
    font-weight: 600;
}

.matching-step.completed span {
    color: var(--success);
}

.matching-step-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matching-step.active .matching-step-status::after {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--blue-accent);
    border-radius: 50%;
    animation: matchingBlink 1s infinite;
}

@keyframes matchingBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.matching-step.completed .matching-step-status::after {
    content: "✓";
    color: var(--success);
    font-weight: bold;
    font-size: 16px;
}

/* Agent badge */
.matching-splash-agent {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(27, 79, 114, 0.05);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(27, 79, 114, 0.1);
}

.matching-splash-agent svg {
    stroke: var(--blue-accent);
}

.matching-splash-agent span {
    color: var(--grey-dark);
    font-size: 0.85rem;
}

.matching-splash-agent strong {
    color: var(--blue-ai);
}

/* Bouton annuler */
.btn-cancel-matching {
    display: block;
    width: 100%;
    padding: 0.875rem;
    background: rgba(27, 79, 114, 0.05);
    border: 1px solid rgba(27, 79, 114, 0.2);
    color: var(--grey-dark);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-matching:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* === MODE SOMBRE POUR SPLASH SCREENS === */
[data-theme="dark"] .matching-splash-modal,
[data-theme="dark"] .veille-modal {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .matching-splash-header h2 {
    color: var(--text-primary);
}

[data-theme="dark"] .matching-splash-subtitle {
    color: var(--text-secondary);
}

[data-theme="dark"] .matching-progress-bar {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .matching-progress-text {
    color: var(--blue-accent);
}

[data-theme="dark"] .matching-step {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .matching-step.active {
    background: rgba(41, 128, 185, 0.2);
    border-color: var(--blue-accent);
}

[data-theme="dark"] .matching-step.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
}

[data-theme="dark"] .matching-step span {
    color: var(--text-secondary);
}

[data-theme="dark"] .matching-step.active span {
    color: var(--text-primary);
}

[data-theme="dark"] .matching-step.completed span {
    color: var(--success);
}

[data-theme="dark"] .matching-step-icon {
    background: var(--bg-elevated);
}

[data-theme="dark"] .matching-step-icon svg {
    stroke: var(--text-muted);
}

[data-theme="dark"] .matching-splash-agent {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .matching-splash-agent span {
    color: var(--text-secondary);
}

[data-theme="dark"] .matching-splash-agent strong {
    color: var(--blue-accent);
}

[data-theme="dark"] .btn-cancel-matching {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-cancel-matching:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error);
    color: var(--error);
}

/* Mode sombre pour TRIAD labels */
[data-theme="dark"] .hemisync-tour-label {
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-left-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .brevet-hemisync-steps .hemisync-tour-label:nth-of-type(1) {
    border-left-color: #60a5fa;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.2) 0%, transparent 100%);
}

[data-theme="dark"] .brevet-hemisync-steps .hemisync-tour-label:nth-of-type(2) {
    border-left-color: #34d399;
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.2) 0%, transparent 100%);
}

[data-theme="dark"] .brevet-hemisync-steps .hemisync-tour-label:nth-of-type(3) {
    border-left-color: #a78bfa;
    background: linear-gradient(90deg, rgba(167, 139, 250, 0.2) 0%, transparent 100%);
}

[data-theme="dark"] .brevet-hemisync-steps .hemisync-tour-label:nth-of-type(4) {
    border-left-color: #fbbf24;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.25) 0%, transparent 100%);
}

[data-theme="dark"] .brevet-hemisync-steps::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* ===================================
   SPLASH SCREEN CAHIER DES CHARGES
   (reutilise les styles matching-splash)
   =================================== */
.cahier-splash-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 79, 114, 0.97);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: matchingFadeIn 0.3s ease;
}

.cahier-splash-overlay.active {
    display: flex;
}

/* ===================================
   SPLASH SCREEN STRATEGIE FINANCEMENT
   (reutilise les styles matching-splash)
   =================================== */
.strategie-splash-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 79, 114, 0.97);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: matchingFadeIn 0.3s ease;
}

.strategie-splash-overlay.active {
    display: flex;
}

/* ===================================
   BREVET SPLASH SCREEN - Agents Collaboratifs
   =================================== */

.brevet-splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(14, 165, 233, 0.95);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: matchingFadeIn 0.3s ease;
}

.brevet-splash-overlay.active {
    display: flex;
}

.brevet-splash-modal {
    max-width: 520px;
}

.brevet-icon {
    background: linear-gradient(135deg, var(--blue-brevet-dark) 0%, var(--blue-brevet) 100%) !important;
}

.brevet-progress-fill {
    background: linear-gradient(90deg, var(--blue-brevet-dark) 0%, var(--blue-brevet) 50%, var(--blue-brevet-light) 100%) !important;
}

/* Panel des agents IA collaboratifs */
.brevet-agents-panel {
    margin: 1rem 0;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.brevet-agents-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.brevet-agents-title svg {
    stroke: rgba(255, 255, 255, 0.8);
}

.brevet-agents-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.brevet-agent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.brevet-agent[data-status="active"] {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.brevet-agent[data-status="completed"] {
    background: rgba(52, 211, 153, 0.3);
    border-color: rgba(52, 211, 153, 0.5);
}

.brevet-agent .agent-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.brevet-agent .agent-icon.claude {
    background: linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
}

.brevet-agent .agent-icon.gpt {
    background: linear-gradient(135deg, #10a37f 0%, #1a7f64 100%);
}

.brevet-agent .agent-icon.gemini {
    background: linear-gradient(135deg, #4285f4 0%, #ea4335 50%, #fbbc04 100%);
}

.brevet-agent .agent-icon svg {
    stroke: var(--text-inverse);
    width: 18px;
    height: 18px;
}

.brevet-agent[data-status="active"] .agent-icon {
    animation: pulseAgent 1.5s infinite;
}

@keyframes pulseAgent {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 10px 3px rgba(255,255,255,0.2); }
}

.brevet-agent .agent-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-inverse);
}

.brevet-agent .agent-status {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.15rem 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.brevet-agent[data-status="active"] .agent-status {
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.3);
}

.brevet-agent[data-status="completed"] .agent-status {
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.3);
}

.brevet-agent .agent-task {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    min-height: 1.2em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===================================
   TRIAD - Labels et Structure des Tours
   =================================== */

.brevet-hemisync-steps {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.brevet-hemisync-steps::-webkit-scrollbar {
    width: 6px;
}

.brevet-hemisync-steps::-webkit-scrollbar-track {
    background: transparent;
}

.brevet-hemisync-steps::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.hemisync-tour-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0 0.4rem 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
    border-left: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 0 6px 6px 0;
}

.hemisync-tour-label:first-child {
    margin-top: 0;
}

/* Tour 1 - Bleu analyses */
.brevet-hemisync-steps .hemisync-tour-label:nth-of-type(1) {
    border-left-color: #60a5fa;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.25) 0%, transparent 100%);
}

/* Tour 2 - Vert croisement */
.brevet-hemisync-steps .hemisync-tour-label:nth-of-type(2) {
    border-left-color: #34d399;
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.25) 0%, transparent 100%);
}

/* Tour 3 - Violet directeurs */
.brevet-hemisync-steps .hemisync-tour-label:nth-of-type(3) {
    border-left-color: #a78bfa;
    background: linear-gradient(90deg, rgba(167, 139, 250, 0.25) 0%, transparent 100%);
}

/* Meta-Synthese - Or */
.brevet-hemisync-steps .hemisync-tour-label:nth-of-type(4) {
    border-left-color: #fbbf24;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.3) 0%, transparent 100%);
}

/* Steps TRIAD compacts */
.brevet-hemisync-steps .matching-step {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
}

.brevet-hemisync-steps .matching-step-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
}

.brevet-hemisync-steps .matching-step-icon svg {
    width: 14px;
    height: 14px;
}

/* Panel des sources de brevets */
.brevet-sources-panel {
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.brevet-sources-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.brevet-sources-title svg {
    stroke: rgba(255, 255, 255, 0.6);
}

.brevet-sources-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.source-tag {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.source-tag[data-status="searching"] {
    background: rgba(245, 158, 11, 0.3);
    color: #fef3c7;
    animation: sourceSearch 1s infinite;
}

@keyframes sourceSearch {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.source-tag[data-status="found"] {
    background: rgba(16, 185, 129, 0.4);
    color: #d1fae5;
}

.source-tag[data-status="none"] {
    background: rgba(100, 116, 139, 0.3);
    color: rgba(255, 255, 255, 0.4);
}

/* ===================================
   AGENT IA STATUS INDICATORS
   =================================== */

/* Conteneur du selecteur avec indicateurs */
.agent-ia-selector-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.agent-ia-selector-container select {
    width: 100%;
}

/* Indicateurs de statut des agents */
.agent-status-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.agent-status:hover {
    background: rgba(100, 116, 139, 0.15);
}

.agent-status.selected {
    border-color: var(--blue-ai);
    background: rgba(27, 79, 114, 0.1);
}

/* Point indicateur de statut */
.agent-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    transition: all 0.3s ease;
}

/* Statuts */
.agent-status.checking .agent-dot {
    background: #f59e0b;
    animation: pulseCheck 1s infinite;
}

@keyframes pulseCheck {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.agent-status.available .agent-dot {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.agent-status.unavailable .agent-dot {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.agent-status.unknown .agent-dot {
    background: #94a3b8;
}

/* Labels */
.agent-label {
    color: var(--grey-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.agent-status.available .agent-label {
    color: #059669;
}

.agent-status.unavailable .agent-label {
    color: #dc2626;
    text-decoration: line-through;
}

.agent-status.selected .agent-label {
    color: var(--blue-ai);
    font-weight: 600;
}

/* Agent non disponible dans le select */
.agent-ia-selector-container select option.unavailable {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

/* Bouton tester les quotas */
.btn-check-quotas {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    background: rgba(27, 79, 114, 0.1);
    border: 1px solid rgba(27, 79, 114, 0.2);
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--blue-ai);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.btn-check-quotas:hover {
    background: rgba(27, 79, 114, 0.15);
    border-color: var(--blue-ai);
}

.btn-check-quotas.checking {
    opacity: 0.7;
    pointer-events: none;
}

.btn-check-quotas.checking svg {
    animation: spin 1s linear infinite;
}

/* Label avec bouton */
label:has(.btn-check-quotas) {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Message de statut */
.agent-status-message {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.agent-status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.agent-status-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.agent-status-message.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ===================================
   QUILL WYSIWYG EDITOR STYLES
   =================================== */

/* Conteneur editeur Quill */
.quill-editor {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    min-height: 150px;
}

.quill-editor .ql-toolbar {
    background: #f8fafc;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
}

.quill-editor .ql-container {
    border: none;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.95rem;
    min-height: 120px;
}

.quill-editor .ql-editor {
    padding: 1rem;
    line-height: 1.6;
    min-height: 120px;
}

.quill-editor .ql-editor p {
    margin-bottom: 0.75rem;
}

.quill-editor .ql-editor h1,
.quill-editor .ql-editor h2,
.quill-editor .ql-editor h3 {
    color: var(--blue-ai);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.quill-editor .ql-editor ul,
.quill-editor .ql-editor ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.quill-editor .ql-editor strong {
    font-weight: 600;
}

/* Quill dans modal nouvelle subvention */
.nouvelle-subvention-modal .quill-editor {
    min-height: 180px;
}

.nouvelle-subvention-modal .quill-editor .ql-editor {
    min-height: 140px;
}

/* Style des boutons toolbar Quill */
.quill-editor .ql-toolbar button:hover,
.quill-editor .ql-toolbar .ql-picker-label:hover {
    color: var(--blue-accent);
}

.quill-editor .ql-toolbar button.ql-active,
.quill-editor .ql-toolbar .ql-picker-label.ql-active {
    color: var(--blue-ai);
}

/* Placeholder */
.quill-editor .ql-editor.ql-blank::before {
    color: #94a3b8;
    font-style: normal;
}

/* Variantes de taille Quill */
.quill-editor.quill-small {
    min-height: 100px;
}

.quill-editor.quill-small .ql-container,
.quill-editor.quill-small .ql-editor {
    min-height: 60px;
}

.quill-editor.quill-large {
    min-height: 300px;
}

.quill-editor.quill-large .ql-container,
.quill-editor.quill-large .ql-editor {
    min-height: 260px;
}

/* Quill dans section subventions */
.subv-tab-pane .quill-editor {
    margin-bottom: 1rem;
}

.subv-tab-pane .quill-editor .ql-toolbar {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px 8px 0 0;
}

.subv-tab-pane .quill-editor .ql-container {
    border-radius: 0 0 8px 8px;
}

/* ============================================= */
/* STYLES CRSNG DECOUVERTE                       */
/* ============================================= */

/* Section bilingue resume */
.crsng-bilingual-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .crsng-bilingual-section {
        grid-template-columns: 1fr;
    }
}

.crsng-lang-block {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.crsng-lang-block h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    color: var(--dark);
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    background: var(--blue-ai);
    color: var(--text-inverse);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 3px;
}

.char-counter {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--grey);
    font-weight: normal;
}

.char-counter.warning {
    color: var(--warning);
}

.char-counter.error {
    color: var(--danger);
}

/* Grid supplements CRSNG */
.crsng-supplements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.checkbox-card {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-card:hover {
    border-color: var(--blue-ai);
    background: #f0f7ff;
}

.checkbox-card input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--blue-ai);
}

.checkbox-card .checkbox-label {
    font-size: 0.85rem;
    color: var(--dark);
}

.checkbox-card:has(input:checked) {
    background: #e8f4fd;
    border-color: var(--blue-ai);
}

/* Table budget CRSNG */
.crsng-budget-table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

.crsng-budget-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.crsng-budget-table th,
.crsng-budget-table td {
    padding: 0.6rem 0.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

.crsng-budget-table th {
    background: var(--blue-ai);
    color: var(--text-inverse);
    font-weight: 600;
    white-space: nowrap;
}

.crsng-budget-table th:first-child {
    text-align: left;
    min-width: 200px;
}

.crsng-budget-table td:first-child {
    text-align: left;
    background: #f8fafc;
}

.budget-category-header td {
    background: #e8f4fd !important;
    text-align: left !important;
    padding: 0.5rem 0.75rem;
}

.budget-input {
    width: 90px;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: right;
    font-size: 0.85rem;
}

.budget-input:focus {
    outline: none;
    border-color: var(--blue-ai);
    box-shadow: 0 0 0 2px rgba(27, 79, 114, 0.1);
}

.budget-total {
    font-weight: 600;
    background: #f0f7ff !important;
    color: var(--blue-ai);
}

.budget-grand-total {
    background: linear-gradient(135deg, #1B4F72, #2874A6) !important;
}

.budget-grand-total td {
    color: var(--text-inverse) !important;
    font-weight: 600 !important;
    background: transparent !important;
}

/* Resume budget */
.crsng-budget-summary {
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 1rem;
}

.budget-summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.budget-label {
    font-size: 0.9rem;
    color: var(--grey);
}

.budget-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.budget-value.budget-highlight {
    color: var(--blue-ai);
    font-size: 1.3rem;
}

/* Section publications CRSNG */
.crsng-publications-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.crsng-publications-filters .form-group {
    flex: 1;
    max-width: 250px;
}

.crsng-publications-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc, #e8f4fd);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.pub-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
}

.pub-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-ai);
}

.pub-stat .stat-label {
    font-size: 0.75rem;
    color: var(--grey);
    text-transform: uppercase;
}

.crsng-publications-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
}

.publications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--grey);
    text-align: center;
}

.publications-empty svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.publication-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.publication-item:hover {
    background: #f8fafc;
}

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

.publication-item input[type="checkbox"] {
    margin-top: 0.25rem;
    accent-color: var(--blue-ai);
}

.publication-info {
    flex: 1;
}

.publication-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.publication-meta {
    font-size: 0.8rem;
    color: var(--grey);
}

.publication-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #e8f4fd;
    color: var(--blue-ai);
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.publication-year {
    font-weight: 600;
    color: var(--dark);
}

/* Badge programme CRSNG */
.badge-crsng {
    background: linear-gradient(135deg, #6B46C1, #805AD5) !important;
}

.subvention-item.crsng {
    border-left: 3px solid #6B46C1;
}

.subvention-item.crsng:hover {
    border-left-color: #805AD5;
}

/* Form row pour CRSNG */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Compteur de caracteres inline */
h4 .char-counter {
    font-size: 0.75rem;
    color: var(--grey);
    font-weight: normal;
    margin-left: 0.5rem;
}

/* ========================================== */
/* CRSNG Projet de Recherche - Nouveaux Styles */
/* ========================================== */

/* Titre du projet CRSNG */
.crsng-titre-input {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 1rem;
}

/* Info caracteres */
.char-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.char-help {
    color: var(--grey);
    font-style: italic;
}

/* Section Figures */
.crsng-figures-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.figures-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.figures-upload-zone:hover {
    border-color: var(--blue-ai);
    background: #f0f7ff;
}

.figures-upload-zone svg {
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

.figures-upload-zone p {
    margin: 0;
    color: var(--grey);
    font-size: 0.9rem;
}

.figures-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.figure-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.figure-preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.figure-preview-item .figure-label {
    display: block;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    background: #f8fafc;
}

.figure-preview-item .remove-figure {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: var(--text-inverse);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Section Objectifs CRSNG */
.crsng-objectifs-liste {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.crsng-objectif-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.objectif-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.objectif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #6B46C1, #805AD5);
    color: var(--text-inverse);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
}

.objectif-titre {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
}

.objectif-titre:focus {
    border-color: var(--blue-ai);
    outline: none;
}

.objectif-pourcentage {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.pct-label {
    color: var(--grey);
    font-size: 0.9rem;
}

.objectifs-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #e8f4fd;
    border-radius: 6px;
    margin-top: 1rem;
    font-weight: 600;
}

.objectifs-total.error {
    background: #fef2f2;
    color: var(--danger);
}

/* Section Methodologie CRSNG */
.crsng-methodologie-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.methodo-objectif-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.methodo-objectif-titre {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--dark);
}

.taches-liste {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tache-item {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.tache-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tache-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    background: #e8f4fd;
    color: var(--blue-ai);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.tache-titre {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
}

.tache-titre:focus {
    border-color: var(--blue-ai);
    outline: none;
}

.btn-xs {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Quill small editor */
.quill-editor.quill-small {
    min-height: 80px;
}

.quill-editor.quill-small .ql-editor {
    min-height: 60px;
}

/* Quill large editor */
.quill-editor.quill-large {
    min-height: 250px;
}

.quill-editor.quill-large .ql-editor {
    min-height: 220px;
}

/* ============================================ */
/* FORMULAIRE NOUVELLE DEMANDE - Type de financement */
/* ============================================ */

/* Groupe mis en evidence (type de financement) */
.form-group-highlight {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid var(--blue-ai);
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group-highlight::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: linear-gradient(90deg, var(--blue-ai), var(--blue-accent));
    border-radius: 0 0 4px 4px;
}

.label-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue-ai);
    margin-bottom: 0.75rem;
}

.label-primary svg {
    color: var(--blue-accent);
}

.select-primary {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-primary:hover {
    border-color: var(--blue-accent);
}

.select-primary:focus {
    outline: none;
    border-color: var(--blue-ai);
    box-shadow: 0 0 0 3px rgba(27, 79, 114, 0.15);
}

.select-primary optgroup {
    font-weight: 600;
    color: var(--dark);
    padding: 0.5rem 0;
}

.select-primary option {
    padding: 0.5rem;
}

/* Champs specifiques MITACS */
.mitacs-fields {
    animation: slideDown 0.3s ease;
}

/* Champs specifiques CRSNG */
.crsng-fields {
    animation: slideDown 0.3s ease;
}

#crsng-projet-group input {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid #fbbf24;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

#crsng-projet-group input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

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

/* ============================================ */
/* ORIENTATIONS CRSNG - Multi-Agents IA */
/* ============================================ */

/* Zone Orientations dans le modal de creation */
#orientations-crsng-fields,
.orientations-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 1.25rem;
    border-radius: 10px;
    margin-top: 1rem;
    border: 1px solid #bae6fd;
}

#orientations-crsng-fields h4,
.orientations-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--blue-ai);
    font-size: 1rem;
    font-weight: 600;
}

.orientations-help,
.orientations-section .form-help {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Axes de recherche */
.orientation-axe-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.orientation-axe-row input {
    flex: 1;
}

.axe-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--blue-ai);
    color: var(--text-inverse);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.btn-icon.btn-remove-axe {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.axes-container {
    margin-bottom: 0.75rem;
}

/* Onglet Orientations CRSNG */
#subv-pane-crsng-orientations .orientations-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--blue-ai);
    margin-bottom: 0.5rem;
}

.section-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.orientations-form-pane {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

/* Section Generation Multi-Agents */
.generation-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #fcd34d;
}

.generation-header-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.generation-header-box h4 {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #92400e;
    margin: 0;
}

.mode-critique-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #fbbf24;
    color: #78350f;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.generation-description {
    color: #78350f;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.generation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.generation-doc1,
.generation-doc2 {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.generation-doc1 h5,
.generation-doc2 h5 {
    margin: 0 0 0.5rem 0;
    color: var(--dark);
    font-size: 1rem;
}

.doc-description {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-large svg {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Progress bar */
.progress-generation {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 6px;
}

.progress-bar-container {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-ai), var(--blue-accent));
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: progress-stripe 1s linear infinite;
    background-size: 20px 20px;
}

@keyframes progress-stripe {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-text {
    font-size: 0.8rem;
    color: #64748b;
}

/* Statut de generation */
.generation-status {
    margin-top: 1.5rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.status-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.status-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.85rem;
}

.status-section.completed {
    background: #dcfce7;
    color: #166534;
}

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

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

.status-icon {
    font-size: 1rem;
}

/* Boutons section actions */
.section-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-regenerate {
    background: #f59e0b;
    color: var(--text-inverse);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-regenerate:hover {
    background: #d97706;
}

.btn-regenerate svg {
    width: 14px;
    height: 14px;
}

/* Quill editor small pour orientations */
.quill-editor-small {
    min-height: 100px;
    background: var(--card-bg);
    border-radius: 6px;
}

.quill-editor-small .ql-editor {
    min-height: 80px;
}

/* Responsive */
@media (max-width: 768px) {
    .generation-controls {
        grid-template-columns: 1fr;
    }

    .status-sections {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .status-sections {
        grid-template-columns: 1fr;
    }

    .section-actions {
        flex-direction: column;
    }
}

/* ===============================================
   BOUTON GENERATION IA AVEC DROPDOWN
   =============================================== */

/* Container dropdown generation */
.dropdown-generate {
    position: relative;
    display: inline-block;
}

/* Bouton principal generation IA */
.btn-generate-ia {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-generate-ia:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.btn-generate-ia:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.btn-generate-ia .dropdown-arrow {
    transition: transform 0.2s ease;
    margin-left: 0.25rem;
}

.dropdown-generate.show .btn-generate-ia .dropdown-arrow {
    transform: rotate(180deg);
}

/* Menu dropdown generation */
.dropdown-menu-generate {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-generate.show .dropdown-menu-generate {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Items du dropdown */
.dropdown-item-generate {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: #374151;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

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

.dropdown-item-generate:hover {
    background: #f8fafc;
}

.dropdown-item-generate.featured {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
}

.dropdown-item-generate.featured:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fef08a 100%);
}

/* Icone dans item */
.dropdown-item-generate .dropdown-item-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
}

.dropdown-item-generate.featured .dropdown-item-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Contenu item */
.dropdown-item-generate .dropdown-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dropdown-item-generate .dropdown-item-content strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e3a5f;
}

.dropdown-item-generate .dropdown-item-content small {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Badge recommande */
.badge-recommended {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--text-inverse);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
    width: fit-content;
}

/* ===============================================
   CHAMPS OBLIGATOIRES - MISE EN EVIDENCE
   =============================================== */

/* Indicateur champ obligatoire */
.required-indicator,
.required,
.text-danger {
    color: #dc2626 !important;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Champ obligatoire non rempli - contour rouge FORCE */
input.field-required-empty,
input.field-required-empty:focus,
input.field-required-empty:hover,
input.field-required-empty:active,
textarea.field-required-empty,
textarea.field-required-empty:focus,
textarea.field-required-empty:hover,
select.field-required-empty,
select.field-required-empty:focus {
    border: 2px solid #dc2626 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
    outline: none !important;
}

/* Editeur Quill obligatoire non rempli */
.quill-required-empty .ql-container,
.quill-required-empty .ql-container:focus-within {
    border: 2px solid #dc2626 !important;
    background-color: #fef2f2 !important;
}

.quill-required-empty .ql-toolbar,
.quill-required-empty .ql-toolbar:focus-within {
    border: 2px solid #dc2626 !important;
    border-bottom: 1px solid #dc2626 !important;
}

/* Champ rempli - retour a la normale */
input.field-required-filled,
textarea.field-required-filled,
select.field-required-filled {
    border-color: #d1d5db !important;
    background-color: var(--card-bg) !important;
    box-shadow: none !important;
}

.quill-required-filled .ql-container {
    border-color: #d1d5db !important;
    background-color: var(--card-bg) !important;
}

/* ===============================================
   CHECKLIST POPUP - Aide generation IA
   =============================================== */

/* Container wrapper pour bouton + checklist */
.checklist-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    flex-shrink: 0;
}

/* Position absolue en haut à droite du header */
.checklist-wrapper.checklist-header-position {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    margin-left: 0;
    z-index: 100;
}

/* Bouton aide checklist (?) */
.btn-checklist-help {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.5);
    vertical-align: middle;
    z-index: 10;
}

.btn-checklist-help svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-inverse);
    stroke-width: 2.5;
}

.btn-checklist-help:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

/* Popup checklist */
.checklist-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    overflow: hidden;
    animation: slideInChecklist 0.25s ease;
}

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

.checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-inverse);
}

.checklist-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.btn-close-checklist {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-inverse);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.checklist-content {
    padding: 12px 16px;
    max-height: 350px;
    overflow-y: auto;
    background: #fafafa;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.checklist-item:last-child {
    margin-bottom: 0;
}

.checklist-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.checklist-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checklist-icon.pending {
    background: #fef3c7;
    border: 2px solid #f59e0b;
}

.checklist-icon.pending svg {
    stroke: #d97706;
}

.checklist-icon.completed {
    background: #d1fae5;
    border: 2px solid #10b981;
}

.checklist-icon.completed svg {
    stroke: #059669;
}

.checklist-icon svg {
    width: 14px;
    height: 14px;
}

.checklist-label {
    flex: 1;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    font-weight: 500;
}

.checklist-item.completed .checklist-label {
    color: #059669;
    text-decoration: line-through;
    text-decoration-color: #a7f3d0;
}

.checklist-item.pending .checklist-label {
    color: #92400e;
}

.checklist-footer {
    padding: 12px 16px;
    background: var(--card-bg);
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.checklist-footer span {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.checklist-footer .all-complete {
    color: #059669;
}

/* Dropdown generate position relative */
.dropdown-generate {
    position: relative;
    display: inline-block;
}

/* Champ obligatoire non rempli */
.field-required-empty {
    position: relative;
}

.field-required-empty input,
.field-required-empty textarea,
.field-required-empty select,
.field-required-empty .ql-container {
    border-color: #fca5a5 !important;
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%) !important;
}

.field-required-empty .ql-toolbar {
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

/* Animation pulse pour attirer l'attention */
.field-required-empty.highlight-pulse input,
.field-required-empty.highlight-pulse textarea,
.field-required-empty.highlight-pulse select,
.field-required-empty.highlight-pulse .ql-container {
    animation: pulse-required 1.5s ease-in-out infinite;
}

@keyframes pulse-required {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
    }
}

/* Label du champ obligatoire */
.field-required-empty label {
    color: #dc2626 !important;
    font-weight: 600;
}

/* Champ obligatoire valide (rempli) */
.field-required-valid input,
.field-required-valid textarea,
.field-required-valid select,
.field-required-valid .ql-container {
    border-color: #86efac !important;
}

.field-required-valid label {
    color: #16a34a !important;
}

/* Message d'aide sous le champ */
.field-help-required {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: #fef2f2;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #b91c1c;
}

.field-help-required svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Section des champs obligatoires */
.required-fields-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.required-fields-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    color: #92400e;
    font-size: 0.95rem;
}

.required-fields-section p {
    margin: 0;
    color: #78350f;
    font-size: 0.85rem;
}

/* Compteur de progression */
.validation-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 8px;
}

.validation-progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.validation-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.validation-progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 60px;
    text-align: right;
}

/* Toast notification pour validation */
.toast-validation-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%) !important;
    color: #92400e !important;
    border: 1px solid #f59e0b !important;
}

.toast-validation-warning .toast-icon {
    color: #f59e0b !important;
}

/* ============================================================ */
/* BADGES PROGRAMMES DE SUBVENTIONS                             */
/* ============================================================ */

/* Badge par defaut */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* CRSNG - Bleu federal */
.badge-crsng {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: var(--text-inverse);
}

/* FRQ - Bleu Quebec */
.badge-frq {
    background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%);
    color: var(--text-inverse);
}

/* MITACS - Vert */
.badge-mitacs {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: var(--text-inverse);
}

/* CRSH - Violet sciences humaines */
.badge-crsh {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    color: var(--text-inverse);
}

/* IRSC - Rouge sante */
.badge-irsc {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    color: var(--text-inverse);
}

/* Genome Canada - Orange */
.badge-genome {
    background: linear-gradient(135deg, #c2410c 0%, #f97316 100%);
    color: var(--text-inverse);
}

/* Badge par defaut */
.badge-default {
    background: linear-gradient(135deg, #4b5563 0%, #9ca3af 100%);
    color: var(--text-inverse);
}

/* Preview des infos programme */
.programme-info-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.programme-info-preview strong {
    flex: 1;
    font-size: 0.9rem;
    color: #1e40af;
}

.programme-info-preview small {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Box d'infos detaillees du programme */
.programme-info-box {
    background: var(--card-bg);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.programme-info-box strong {
    display: block;
    font-size: 1rem;
    color: var(--blue-ai);
    margin-bottom: 0.5rem;
}

.programme-info-box p {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.programme-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.programme-details span {
    display: flex;
    gap: 0.25rem;
}

/* Suggestions de programmes */
.suggestions-programmes {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #facc15;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.suggestions-programmes h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: #854d0e;
}

.suggestions-programmes ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #f0f9ff;
    transform: translateX(4px);
}

.suggestion-item small {
    color: #6b7280;
    font-size: 0.8rem;
}

/* Optgroup styles dans les selects */
select optgroup {
    font-weight: 600;
    font-style: normal;
    background: #f3f4f6;
    color: var(--blue-ai);
}

select option {
    font-weight: 400;
    padding: 0.5rem;
}

/* ================================================
   MODULE BREVETS - STYLES PREMIUM
   ================================================ */

/* Vue brevets - aligné sur Publications */
#view-brevets {
    width: 100%;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
    position: relative;
    z-index: 1;
}

/* Container principal - style Mes Projets */
.brevets-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0.75rem;
    height: calc(100vh - 140px);
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
    border-radius: 0;
    overflow: hidden;
}

/* Panneau gauche - style coloré bleu */
.brevets-liste-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.brevet-section-projets,
.brevet-section-demandes {
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: none;
}

.brevet-section-projets {
    flex: 0 0 auto;
    max-height: 45%;
}

.brevet-section-demandes {
    flex: 1;
    min-height: 0;
    border-bottom: none;
}

/* Header de section Brevets - style coloré bleu */
.brevet-section-header {
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    border-radius: 0;
    position: relative;
    flex-shrink: 0;
}

/* Premier header arrondi en haut */
.brevet-section-projets > .brevet-section-header {
    border-radius: 11px 11px 0 0;
}

.brevet-section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.brevet-section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.brevet-section-header h3 svg {
    color: rgba(255, 255, 255, 0.9);
    stroke: rgba(255, 255, 255, 0.9);
}

/* Bouton dans le header de section Brevets */
.brevet-section-header .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.brevet-section-header .btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.brevet-section-header .btn svg {
    color: #ffffff;
    stroke: #ffffff;
}

/* Recherche projets - style Mes Projets */
.brevet-projets-search {
    position: relative;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.brevet-projets-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: none;
    border-radius: 0;
    font-size: 0.9rem;
    background: none;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.brevet-projets-search input::placeholder {
    color: var(--grey);
}

.brevet-projets-search input:focus {
    outline: none;
}

.brevet-projets-search .search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey);
    stroke: var(--grey);
    pointer-events: none;
}

/* Liste projets brevets */
.brevet-projets-liste {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: linear-gradient(180deg, #f8faff 0%, #f0f6ff 100%);
    min-height: 0;
}

/* Liste demandes brevets */
.brevet-demandes-liste {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: linear-gradient(180deg, #f8faff 0%, #f0f6ff 100%);
    min-height: 0;
}

/* Item projet brevet - style coloré bleu */
.brevet-projet-item {
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.15);
    background: linear-gradient(135deg, #f8faff 0%, #f0f6ff 100%);
}

.brevet-projet-item:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #eff6ff 0%, #e6f0ff 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.brevet-projet-item.selected {
    border-color: #3B82F6;
    background: linear-gradient(135deg, #e6f0ff 0%, #dbeafe 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.brevet-projet-item .projet-titre {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--dark);
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brevet-projet-item .projet-meta {
    font-size: 0.65rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Indicateurs projet brevet */
.projet-indicators {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.25rem 0;
    flex-wrap: wrap;
}

.projet-etat {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.6rem;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-weight: 500;
}

.projet-etat svg {
    flex-shrink: 0;
}

.projet-etat.etat-nouveau {
    background: #f3f4f6;
    color: #6b7280;
}

.projet-etat.etat-etude {
    background: #dbeafe;
    color: #1e40af;
}

.projet-etat.etat-anteriorite {
    background: #fef3c7;
    color: #92400e;
}

.projet-etat.etat-redaction {
    background: #d1fae5;
    color: #065f46;
}

.projet-etat.etat-revision {
    background: #e0e7ff;
    color: #3730a3;
}

.projet-etat.etat-depose {
    background: #cffafe;
    color: #0e7490;
}

.projet-etat.etat-refuse {
    background: #fee2e2;
    color: #b91c1c;
}

/* Badge TRL */
.projet-trl {
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
}

.projet-trl.trl-1, .projet-trl.trl-2 {
    background: #f3f4f6;
    color: #6b7280;
}

.projet-trl.trl-3, .projet-trl.trl-4 {
    background: #fef3c7;
    color: #92400e;
}

.projet-trl.trl-5, .projet-trl.trl-6 {
    background: #fef9c3;
    color: #854d0e;
}

.projet-trl.trl-7, .projet-trl.trl-8 {
    background: #dcfce7;
    color: #166534;
}

.projet-trl.trl-9 {
    background: #d1fae5;
    color: #047857;
}

/* Barre de realisation */
.projet-realisation {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.realisation-bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.realisation-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.realisation-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 28px;
    text-align: right;
}

/* Filtres brevets */
.brevets-filtres {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.08);
    background: rgba(255, 255, 255, 0.8);
}

.brevets-filtres select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #374151;
    cursor: pointer;
    transition: all 0.25s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.brevets-filtres select:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.brevets-filtres select:focus {
    outline: none;
    border-color: var(--blue-brevet);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: var(--card-bg);
}

/* Liste brevets */
.brevets-liste {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(249, 250, 251, 0.5);
}

.brevet-item {
    padding: 0.65rem 0.7rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.brevet-item:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border-color: rgba(59, 130, 246, 0.15);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    transform: translateX(2px);
}

.brevet-item.selected {
    background: var(--blue-brevet-pale);
}

.brevet-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.brevet-item-titre {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brevet-item-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-icon-delete {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.4;
}

.btn-icon-delete:hover {
    background: #fee2e2;
    opacity: 1;
}

.btn-icon-delete:hover svg {
    stroke: #dc2626;
}

.brevet-item:hover .btn-icon-delete {
    opacity: 0.7;
}

.brevet-item-badge {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
}

.brevet-item-badge.etude { background: #dbeafe; color: #1e40af; }
.brevet-item-badge.anteriorite { background: #fef3c7; color: #92400e; }
.brevet-item-badge.redaction { background: #d1fae5; color: #065f46; }
.brevet-item-badge.revision { background: #e0e7ff; color: #3730a3; }
.brevet-item-badge.depose { background: #cffafe; color: #0e7490; }
.brevet-item-badge.accorde { background: #d1fae5; color: #047857; }
.brevet-item-badge.refuse { background: #fee2e2; color: #b91c1c; }

.brevet-item-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Empty state */
.brevets-liste .empty-state,
.brevet-detail-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.brevets-liste .empty-state {
    background: linear-gradient(180deg, rgba(249, 250, 251, 0.8) 0%, rgba(243, 244, 246, 0.5) 100%);
    border-radius: 10px;
    margin: 0.5rem;
    min-height: 150px;
}

.brevets-liste .empty-state svg,
.brevet-detail-empty svg {
    stroke: var(--blue-brevet);
    opacity: 0.35;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.15));
}

.brevets-liste .empty-state p {
    margin: 0.4rem 0 1rem;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.brevets-liste .empty-state .btn {
    background: linear-gradient(135deg, var(--blue-brevet) 0%, var(--blue-brevet-dark) 100%);
    color: var(--text-inverse);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.brevets-liste .empty-state .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* Etat d'erreur projets */
.brevet-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.8) 0%, rgba(254, 226, 226, 0.5) 100%);
    border-radius: 10px;
    margin: 0.5rem;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.brevet-error-state svg {
    stroke: #ef4444;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.brevet-error-state p {
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.brevet-error-state .btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--text-inverse);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.brevet-error-state .btn-retry:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.brevet-error-state .btn-retry svg {
    stroke: var(--text-inverse);
    opacity: 1;
    margin: 0;
}

/* Etat vide projets brevets */
.brevet-empty-projets {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(249, 250, 251, 0.8) 0%, rgba(243, 244, 246, 0.5) 100%);
    border-radius: 10px;
    margin: 0.5rem;
}

.brevet-empty-projets svg {
    stroke: var(--blue-brevet);
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

.brevet-empty-projets p {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

/* Panneau droit - Detail (style Publications) */
.brevets-detail-panel {
    background: var(--bg-primary, #fff);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.brevet-detail-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #fafafa;
}

.brevet-detail-empty .empty-icon svg {
    width: 48px;
    height: 48px;
    stroke: var(--blue-brevet);
    opacity: 0.5;
}

.brevet-detail-empty h3 {
    margin: 0.5rem 0 0.2rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-brevet-dark);
}

.brevet-detail-empty p {
    color: #6b7280;
    max-width: 300px;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Workflow preview */
.brevet-workflow-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    margin-top: 0.75rem;
    padding: 0.4rem 0.6rem;
    background: #f0fdf4;
    border-radius: 6px;
}

.brevet-workflow-preview .workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.brevet-workflow-preview .step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue-brevet);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
}

.brevet-workflow-preview .workflow-step:hover .step-number {
    transform: scale(1.1);
}

.brevet-workflow-preview .step-label {
    font-size: 0.6rem;
    color: var(--blue-brevet-dark);
    text-align: center;
    white-space: nowrap;
    font-weight: 600;
}

.brevet-workflow-preview .workflow-arrow {
    color: var(--blue-brevet-dark);
    font-size: 1rem;
    opacity: 0.6;
}

/* Detail brevet actif */
.brevet-detail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--blue-brevet) #f1f5f9;
}

.brevet-detail-content::-webkit-scrollbar {
    width: 12px;
}

.brevet-detail-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.brevet-detail-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--blue-brevet) 0%, var(--blue-brevet-dark) 100%);
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

.brevet-detail-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--blue-brevet-dark) 0%, #1e40af 100%);
}

.brevet-detail-header {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.brevet-projet-info h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 0.35rem;
}

.brevet-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: var(--blue-brevet-pale);
    color: var(--blue-brevet-dark);
}

.brevet-actions {
    display: flex;
    gap: 0.4rem;
}

/* Workflow Steps - Layout Horizontal Compact */
.brevet-workflow-steps {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    background: var(--card-bg);
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    flex-shrink: 0;
}

.brevet-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 130px;
    max-width: 180px;
    padding: 0.5rem 0.4rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #f9fafb;
    border: 2px solid transparent;
    position: relative;
}

.brevet-step:hover:not(.disabled) {
    background: var(--blue-brevet-pale);
    border-color: var(--blue-brevet-light);
}

.brevet-step:last-child {
    margin-bottom: 0;
}

/* Connecteur horizontal entre les étapes */
.brevet-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 3px;
    background: #e5e7eb;
    z-index: 1;
}

.brevet-step.completed:not(:last-child)::after {
    background: var(--blue-brevet);
}

.brevet-step.disabled {
    opacity: 0.5;
}

.brevet-step.disabled .step-content h4 {
    color: #9ca3af;
}

.brevet-step.completed {
    background: var(--blue-brevet-pale);
    border-color: var(--blue-brevet);
}

.brevet-step.completed .step-num {
    background: var(--blue-brevet);
    color: var(--text-inverse);
}

.brevet-step.completed .step-line {
    background: var(--blue-brevet);
}

.brevet-step.active {
    background: var(--blue-brevet-pale);
    border-color: var(--blue-brevet);
}

.brevet-step.active .step-num {
    background: var(--blue-brevet);
    color: var(--text-inverse);
    animation: pulse-step 1.5s infinite;
}

@keyframes pulse-step {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0); }
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.step-line {
    display: none; /* Caché en mode horizontal */
}

.step-content {
    flex: 1;
    text-align: center;
    width: 100%;
}

.step-content h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.step-desc {
    font-size: 0.65rem;
    color: #6b7280;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.step-actions {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.step-actions .btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
}

.step-result {
    margin-top: 0.3rem;
    padding: 0.3rem 0.4rem;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid var(--blue-brevet);
    font-size: 0.7rem;
    text-align: left;
}

.step-result.positive {
    background: var(--blue-brevet-pale);
    border-color: var(--blue-brevet);
}

.step-result.neutral {
    background: #fef3c7;
    border-color: #f59e0b;
}

.step-result.negative {
    background: #fee2e2;
    border-color: #ef4444;
}

/* Bouton brevet */
.btn-brevet {
    background: var(--blue-brevet);
    color: var(--text-inverse);
    border: none;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-brevet:hover {
    background: var(--blue-brevet-dark);
}

.btn-brevet:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #9ca3af;
}

.btn-brevet svg {
    stroke: currentColor;
    width: 14px;
    height: 14px;
}

.btn-brevet-outline {
    background: transparent;
    color: var(--blue-brevet-dark);
    border: 1px solid var(--blue-brevet);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.btn-brevet-outline:hover {
    background: var(--blue-brevet-pale);
}

.btn-brevet-outline:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #9ca3af;
    color: #9ca3af;
}

/* Zone de contenu brevet */
.brevet-content-area {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    background: var(--card-bg);
    min-height: 300px;
}

/* Resultats detailles de l'etude de brevetabilite */
.etude-brevetabilite-results {
    background: #fff;
}

.etude-brevetabilite-results h3,
.etude-brevetabilite-results h4,
.etude-brevetabilite-results h5 {
    color: var(--text-primary);
}

.etude-section-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.etude-section-list {
    background: transparent;
}

/* Dark mode support for etude results */
[data-theme="dark"] .etude-brevetabilite-results {
    background: var(--card-bg);
}

[data-theme="dark"] .etude-section-card > div:last-child {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .etude-section-card p,
[data-theme="dark"] .etude-section-card li,
[data-theme="dark"] .etude-section-list span {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .etude-resume {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .etude-resume p {
    color: var(--text-secondary) !important;
}

/* Zone fixe du score */
.brevet-score-fixed {
    background: var(--card-bg);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Resultats etude brevetabilite */
.etude-result {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.etude-result.positive {
    background: #d1fae5;
    border: none;
}

.etude-result.neutral {
    background: #fef3c7;
    border: none;
}

.etude-result.negative {
    background: #fee2e2;
    border: none;
}

.etude-verdict {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.verdict-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.etude-result.positive .verdict-icon {
    background: var(--blue-brevet);
    color: var(--text-inverse);
}

.etude-result.neutral .verdict-icon {
    background: #f59e0b;
    color: var(--text-inverse);
}

.etude-result.negative .verdict-icon {
    background: #ef4444;
    color: var(--text-inverse);
}

.verdict-text h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.verdict-text p {
    margin: 0;
    color: #6b7280;
}

.etude-details {
    margin-top: 1rem;
}

.etude-section {
    margin-bottom: 1rem;
}

.etude-section h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 0.5rem;
}

.etude-section ul {
    margin: 0;
    padding-left: 1.25rem;
}

.etude-section li {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

/* Agents IA pour brevets */
.brevet-agents-status {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.brevet-agent {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid #e5e7eb;
}

.brevet-agent.active {
    border-color: var(--blue-brevet);
    background: var(--blue-brevet-pale);
}

.brevet-agent.completed {
    border-color: var(--blue-brevet);
}

.brevet-agent-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.brevet-agent-status {
    font-size: 0.7rem;
    color: #6b7280;
}

/* Draft brevet */
.brevet-draft-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Times New Roman', serif;
    max-height: 500px;
    overflow-y: auto;
}

.brevet-draft-preview h1 {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.brevet-draft-preview h2 {
    font-size: 1rem;
    font-weight: bold;
    margin: 1.5rem 0 0.75rem;
    text-transform: uppercase;
}

.brevet-draft-preview p {
    text-align: justify;
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

/* Figures brevet */
.brevet-figures {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.brevet-figure {
    background: var(--card-bg);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
}

.brevet-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.brevet-figure-caption {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* === ZONE D'EDITION DRAFT FINAL === */
.brevet-draft-editor-zone {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: calc(100vh - 350px);
}

.draft-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, var(--blue-brevet-pale), #fff);
    border-radius: 12px 12px 0 0;
}

.draft-editor-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--blue-brevet-dark);
    font-size: 1rem;
}

.draft-editor-title svg {
    width: 20px;
    height: 20px;
    color: var(--blue-brevet);
}

/* Toolbar de mise en forme */
.draft-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-wrap: wrap;
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 0.15rem;
    padding-right: 0.5rem;
    border-right: 1px solid #e5e7eb;
    margin-right: 0.5rem;
}

.toolbar-group:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s ease;
}

.toolbar-btn:hover {
    background: var(--blue-brevet-pale);
    color: var(--blue-brevet-dark);
}

.toolbar-btn.active {
    background: var(--blue-brevet);
    color: var(--text-inverse);
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
}

.toolbar-select {
    height: 32px;
    padding: 0 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--dark);
}

.toolbar-select:hover {
    border-color: var(--blue-brevet);
}

/* Zone d'édition de texte */
.draft-editor-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.draft-editor-textarea {
    width: 100%;
    min-height: 300px;
    border: none;
    resize: none;
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--dark);
    outline: none;
    background: transparent;
}

.draft-editor-textarea:focus {
    outline: none;
}

/* Éditeur riche (contenteditable) */
.draft-rich-editor {
    width: 100%;
    min-height: 300px;
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--dark);
    outline: none;
    border: none;
    background: transparent;
}

.draft-rich-editor:focus {
    outline: none;
}

.draft-rich-editor h1 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 1rem;
    text-transform: uppercase;
    color: var(--blue-brevet-dark);
}

.draft-rich-editor h2 {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 1.5rem 0 0.75rem;
    color: var(--dark);
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.draft-rich-editor h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: #4b5563;
}

.draft-rich-editor p {
    text-align: justify;
    margin-bottom: 0.75rem;
}

.draft-rich-editor ul, .draft-rich-editor ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.draft-rich-editor li {
    margin-bottom: 0.25rem;
}

.draft-rich-editor strong {
    font-weight: 700;
}

.draft-rich-editor em {
    font-style: italic;
}

.draft-rich-editor u {
    text-decoration: underline;
}

/* Footer avec actions */
.draft-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.draft-word-count {
    font-size: 0.75rem;
    color: #6b7280;
}

.draft-actions {
    display: flex;
    gap: 0.5rem;
}

/* Placeholder pour l'éditeur vide */
.draft-rich-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    font-style: italic;
    pointer-events: none;
}

/* === SPLITTER BREVET === */
.brevet-split-container {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 800px;
    overflow: visible;
}

.brevet-split-top {
    min-height: auto;
    max-height: none;
    overflow: visible;
    background: var(--card-bg);
    transition: none;
    flex-shrink: 0;
}

.brevet-split-top.resizing {
    transition: none;
    user-select: none;
}

.brevet-splitter {
    height: 10px;
    background: linear-gradient(to bottom, #f1f5f9, #e5e7eb);
    cursor: ns-resize;
    display: none; /* Cache par defaut, affiche quand draft visible */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.15s ease;
}

.brevet-splitter:hover {
    background: linear-gradient(to bottom, var(--blue-brevet-pale), #e0f2fe);
}

.brevet-splitter:active {
    background: var(--blue-brevet-pale);
}

.splitter-handle {
    color: #9ca3af;
    transition: color 0.15s ease;
}

.brevet-splitter:hover .splitter-handle {
    color: var(--blue-brevet);
}

.brevet-split-bottom {
    flex: 0 0 auto;
    min-height: 500px;
    height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Ajustement de la zone d'edition dans le splitter */
.brevet-split-bottom .brevet-draft-editor-zone {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Zone de contenu scrollable */
.brevet-split-bottom .draft-editor-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    min-height: 0;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--blue-brevet) #f1f5f9;
}

/* Style scrollbar pour webkit (Chrome, Safari, Edge) */
.brevet-split-bottom .draft-editor-content::-webkit-scrollbar {
    width: 10px;
}

.brevet-split-bottom .draft-editor-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

.brevet-split-bottom .draft-editor-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--blue-brevet) 0%, var(--blue-brevet-dark) 100%);
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

.brevet-split-bottom .draft-editor-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--blue-brevet-dark) 0%, #1e40af 100%);
}

.brevet-split-bottom .draft-editor-header {
    border-radius: 0;
}

.brevet-split-bottom .draft-editor-footer {
    border-radius: 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .brevets-container {
        grid-template-columns: 260px 1fr;
    }
}

@media (max-width: 900px) {
    .brevets-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .brevets-liste-panel {
        max-height: 350px;
    }

    .brevets-detail-panel {
        min-height: 500px;
    }
}

/* ============================================ */
/* MODE SOMBRE - STYLES GLOBAUX COMPLETS        */
/* ============================================ */

/* === REGLE GLOBALE: Tous les fonds blancs === */
[data-theme="dark"] .config-card,
[data-theme="dark"] .professor-card,
[data-theme="dark"] .tab-content,
[data-theme="dark"] .tabs,
[data-theme="dark"] .matching-results,
[data-theme="dark"] .upload-section,
[data-theme="dark"] .editor-container,
[data-theme="dark"] .expertise-groupe,
[data-theme="dark"] .projet-item,
[data-theme="dark"] .user-row,
[data-theme="dark"] .choice-tab,
[data-theme="dark"] .item-card,
[data-theme="dark"] .view-header,
[data-theme="dark"] .fiche-form,
[data-theme="dark"] .upload-choice,
[data-theme="dark"] .editor-wrapper,
[data-theme="dark"] .projets-liste,
[data-theme="dark"] .resultats-container,
[data-theme="dark"] .matching-controls,
[data-theme="dark"] .filter-section,
[data-theme="dark"] .search-filters,
[data-theme="dark"] .pagination,
[data-theme="dark"] .form-section,
[data-theme="dark"] .detail-section,
[data-theme="dark"] .info-card,
[data-theme="dark"] .stat-box,
[data-theme="dark"] .action-card,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .dropdown-content,
[data-theme="dark"] .tooltip-content,
[data-theme="dark"] .popover,
[data-theme="dark"] .notification-panel,
[data-theme="dark"] .history-item,
[data-theme="dark"] .log-entry,
[data-theme="dark"] .user-info-card,
[data-theme="dark"] .settings-panel,
[data-theme="dark"] .preview-panel,
[data-theme="dark"] .result-card,
[data-theme="dark"] .match-card,
[data-theme="dark"] .prof-result,
[data-theme="dark"] .veille-card,
[data-theme="dark"] .veille-item,
[data-theme="dark"] .alert-box,
[data-theme="dark"] .warning-box,
[data-theme="dark"] .success-box,
[data-theme="dark"] .cahier-preview,
[data-theme="dark"] .analyse-result,
[data-theme="dark"] .strategie-section,
[data-theme="dark"] .financement-card,
[data-theme="dark"] .organisme-card,
[data-theme="dark"] .programme-detail,
[data-theme="dark"] .formulaire-section,
[data-theme="dark"] .chat-container,
[data-theme="dark"] .chat-messages,
[data-theme="dark"] .chat-input-container,
[data-theme="dark"] .message-bubble,
[data-theme="dark"] .autocomplete-dropdown,
[data-theme="dark"] .suggestion-item,
[data-theme="dark"] .tag-input-container,
[data-theme="dark"] .tags-container,
[data-theme="dark"] .file-preview,
[data-theme="dark"] .document-viewer,
[data-theme="dark"] .pdf-container,
[data-theme="dark"] .image-preview,
[data-theme="dark"] .export-options,
[data-theme="dark"] .import-section,
[data-theme="dark"] .batch-actions,
[data-theme="dark"] .selection-info,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .loading-overlay,
[data-theme="dark"] .progress-container,
[data-theme="dark"] .step-indicator,
[data-theme="dark"] .wizard-step,
[data-theme="dark"] .confirmation-dialog,
[data-theme="dark"] .delete-confirm,
[data-theme="dark"] .edit-form,
[data-theme="dark"] .create-form,
[data-theme="dark"] .search-results,
[data-theme="dark"] .filter-panel,
[data-theme="dark"] .sort-options,
[data-theme="dark"] .view-options,
[data-theme="dark"] .list-header,
[data-theme="dark"] .grid-header,
[data-theme="dark"] .table-container,
[data-theme="dark"] .data-row,
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-footer,
[data-theme="dark"] .section-content,
[data-theme="dark"] .panel-body,
[data-theme="dark"] .accordion-content,
[data-theme="dark"] .collapse-content,
[data-theme="dark"] .tab-panel,
[data-theme="dark"] .menu-item,
[data-theme="dark"] .list-item,
[data-theme="dark"] .grid-item,
[data-theme="dark"] .tile {
    background: var(--card-bg) !important;
    color: var(--text-primary);
}

/* === Bordures en mode sombre === */
[data-theme="dark"] .config-card,
[data-theme="dark"] .professor-card,
[data-theme="dark"] .tabs,
[data-theme="dark"] .tab-content,
[data-theme="dark"] .matching-results,
[data-theme="dark"] .upload-section,
[data-theme="dark"] .expertise-groupe,
[data-theme="dark"] .projet-item,
[data-theme="dark"] .item-card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .form-section,
[data-theme="dark"] .info-card,
[data-theme="dark"] .result-card {
    border-color: var(--border-color) !important;
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* === Textes principaux === */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .config-card-header h2,
[data-theme="dark"] .config-label,
[data-theme="dark"] .professor-name,
[data-theme="dark"] .section-title,
[data-theme="dark"] .form-label,
[data-theme="dark"] .results-header h2,
[data-theme="dark"] .expertise-groupe h3,
[data-theme="dark"] .projet-item h3,
[data-theme="dark"] .projet-titre,
[data-theme="dark"] .view-title,
[data-theme="dark"] .panel-title,
[data-theme="dark"] .card-title {
    color: var(--text-primary) !important;
}

/* === Textes secondaires === */
[data-theme="dark"] .config-description,
[data-theme="dark"] .professor-email,
[data-theme="dark"] .professor-departement,
[data-theme="dark"] .config-current,
[data-theme="dark"] .field-label,
[data-theme="dark"] .item-card .field-label,
[data-theme="dark"] .projet-meta,
[data-theme="dark"] .help-text,
[data-theme="dark"] .hint,
[data-theme="dark"] .subtitle,
[data-theme="dark"] .description,
[data-theme="dark"] .meta-info,
[data-theme="dark"] label,
[data-theme="dark"] .label {
    color: var(--text-secondary) !important;
}

/* === Tous les inputs, selects, textareas === */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-control,
[data-theme="dark"] .input-field,
[data-theme="dark"] .text-input,
[data-theme="dark"] .search-input,
[data-theme="dark"] .filter-input,
[data-theme="dark"] [contenteditable="true"] {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted) !important;
}

/* === Focus states === */
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--blue-accent) !important;
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.2) !important;
}

/* === Badges et tags === */
[data-theme="dark"] .expertise-tag,
[data-theme="dark"] .tag,
[data-theme="dark"] .badge,
[data-theme="dark"] .chip,
[data-theme="dark"] .label-tag {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

/* === Boutons secondaires/outline === */
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-ghost,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-cancel,
[data-theme="dark"] .btn-light {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .btn-ghost:hover,
[data-theme="dark"] .btn-secondary:hover {
    background: var(--border-color) !important;
}

/* === Panels et sections === */
[data-theme="dark"] .projets-panel,
[data-theme="dark"] .resultats-panel,
[data-theme="dark"] .brevets-liste-panel,
[data-theme="dark"] .brevets-detail-panel,
[data-theme="dark"] .side-panel,
[data-theme="dark"] .main-panel,
[data-theme="dark"] .detail-panel,
[data-theme="dark"] .info-panel,
[data-theme="dark"] .control-panel {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === Scrollbars === */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--grey-dark);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--grey);
}

/* === Zones d'upload === */
[data-theme="dark"] .upload-zone,
[data-theme="dark"] .dropzone,
[data-theme="dark"] .file-drop-area {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

/* === Tables et listes === */
[data-theme="dark"] .users-list,
[data-theme="dark"] .config-section,
[data-theme="dark"] table,
[data-theme="dark"] thead,
[data-theme="dark"] tbody,
[data-theme="dark"] tr,
[data-theme="dark"] th,
[data-theme="dark"] td {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] tr:hover,
[data-theme="dark"] .data-row:hover {
    background: var(--bg-tertiary) !important;
}

/* === Brevets === */
[data-theme="dark"] .brevet-detail-content,
[data-theme="dark"] .brevet-split-top,
[data-theme="dark"] .brevet-split-bottom,
[data-theme="dark"] .brevet-header,
[data-theme="dark"] .brevet-body,
[data-theme="dark"] .brevet-footer {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-section,
[data-theme="dark"] .brevet-anteriorite-item,
[data-theme="dark"] .brevet-draft-section,
[data-theme="dark"] .brevet-etape,
[data-theme="dark"] .brevet-result {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* === Subventions === */
[data-theme="dark"] .subvention-card,
[data-theme="dark"] .programme-card,
[data-theme="dark"] .formulaire-card,
[data-theme="dark"] .subvention-detail,
[data-theme="dark"] .subvention-form,
[data-theme="dark"] .subvention-header,
[data-theme="dark"] .subvention-body,
[data-theme="dark"] .organisme-section,
[data-theme="dark"] .criteres-section,
[data-theme="dark"] .budget-section {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === Modales === */
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-footer {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .modal-header h2,
[data-theme="dark"] .modal-title {
    color: var(--text-primary) !important;
}

/* === Selection/highlight === */
[data-theme="dark"] .professor-card:hover,
[data-theme="dark"] .projet-card:hover,
[data-theme="dark"] .projet-item:hover,
[data-theme="dark"] .item-card:hover,
[data-theme="dark"] .list-item:hover,
[data-theme="dark"] .menu-item:hover,
[data-theme="dark"] .suggestion-item:hover,
[data-theme="dark"] .autocomplete-item:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .active,
[data-theme="dark"] .selected,
[data-theme="dark"] .projet-card.active,
[data-theme="dark"] .professor-card.active {
    background: var(--bg-tertiary) !important;
    border-color: var(--blue-accent) !important;
}

/* === Editeurs de texte === */
[data-theme="dark"] .editor-toolbar,
[data-theme="dark"] .ql-toolbar,
[data-theme="dark"] .mde-toolbar,
[data-theme="dark"] .EasyMDEContainer .editor-toolbar {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .editor-toolbar button,
[data-theme="dark"] .ql-toolbar button,
[data-theme="dark"] .editor-toolbar .toolbar-btn {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .editor-content,
[data-theme="dark"] .ql-editor,
[data-theme="dark"] .ql-container,
[data-theme="dark"] .CodeMirror,
[data-theme="dark"] .cm-s-easymde,
[data-theme="dark"] .EasyMDEContainer .CodeMirror {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .CodeMirror-cursor {
    border-color: var(--text-primary) !important;
}

[data-theme="dark"] .CodeMirror-selected,
[data-theme="dark"] .CodeMirror-line::selection {
    background: var(--bg-tertiary) !important;
}

/* === Toast notifications === */
[data-theme="dark"] .toast {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

/* === Alertes avec couleurs specifiques (garder lisibles) === */
[data-theme="dark"] .alert-warning,
[data-theme="dark"] .warning-box {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .alert-success,
[data-theme="dark"] .success-box {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger,
[data-theme="dark"] .error-box {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .alert-info,
[data-theme="dark"] .info-box {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
}

/* === Navigation et sidebar === */
.sidebar-section h3 {
    color: var(--text-muted);
}

[data-theme="dark"] .sidebar-section h3 {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .sidebar-nav {
    background: transparent !important;
}

/* === Theme toggle button === */
#nav-theme-toggle {
    cursor: pointer;
}

#nav-theme-toggle:hover {
    background: var(--bg-tertiary);
}

/* === Liens en mode sombre === */
[data-theme="dark"] a {
    color: var(--blue-accent);
}

[data-theme="dark"] a:hover {
    color: var(--blue-light);
}

/* === Code et pre === */
[data-theme="dark"] code,
[data-theme="dark"] pre,
[data-theme="dark"] .code-block {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === Separateurs === */
[data-theme="dark"] hr,
[data-theme="dark"] .divider,
[data-theme="dark"] .separator {
    border-color: var(--border-color) !important;
    background: var(--border-color) !important;
}

/* === Icones SVG === */
[data-theme="dark"] svg {
    color: inherit;
}

[data-theme="dark"] .icon-muted {
    color: var(--text-muted) !important;
}

/* === Specifique aux couleurs de fond jaune/orange === */
[data-theme="dark"] .highlight-yellow,
[data-theme="dark"] .note-warning {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: rgba(251, 191, 36, 0.2) !important;
}

/* === Formulaires avec fond colore === */
[data-theme="dark"] .form-highlight,
[data-theme="dark"] .input-group {
    background: var(--bg-secondary) !important;
}

/* === Tooltips === */
[data-theme="dark"] .tooltip,
[data-theme="dark"] .tooltip-inner,
[data-theme="dark"] [data-tooltip]::after {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === Loading et spinners === */
[data-theme="dark"] .loading-spinner,
[data-theme="dark"] .spinner {
    border-color: var(--border-color) !important;
    border-top-color: var(--blue-accent) !important;
}

/* === Progress bars === */
[data-theme="dark"] .progress,
[data-theme="dark"] .progress-bar-container {
    background: var(--bg-tertiary) !important;
}

/* === Quill editor specifique === */
[data-theme="dark"] .ql-snow .ql-stroke {
    stroke: var(--text-primary) !important;
}

[data-theme="dark"] .ql-snow .ql-fill {
    fill: var(--text-primary) !important;
}

[data-theme="dark"] .ql-snow .ql-picker {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .ql-snow .ql-picker-options {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === Overrides pour elements specifiques AcadIA === */
[data-theme="dark"] .projet-card-title,
[data-theme="dark"] .brevet-titre,
[data-theme="dark"] .subvention-titre,
[data-theme="dark"] .professor-card-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .projet-card-meta,
[data-theme="dark"] .brevet-meta,
[data-theme="dark"] .subvention-meta {
    color: var(--text-secondary) !important;
}

/* === FORMULAIRES MATCHING ET SECTIONS SPECIFIQUES === */
[data-theme="dark"] .matching-form-section,
[data-theme="dark"] .matching-container,
[data-theme="dark"] .matching-results-section,
[data-theme="dark"] .form-card,
[data-theme="dark"] .section-intro,
[data-theme="dark"] .upload-choice,
[data-theme="dark"] .input-mode,
[data-theme="dark"] .rich-editor-wrapper,
[data-theme="dark"] .quill-editor,
[data-theme="dark"] .quill-container {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .section-intro {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .section-intro h3,
[data-theme="dark"] .matching-form-section h3 {
    color: var(--blue-accent) !important;
}

[data-theme="dark"] .section-intro p {
    color: var(--text-secondary) !important;
}

/* Zones d'upload */
[data-theme="dark"] .upload-zone,
[data-theme="dark"] .upload-zone-projet,
[data-theme="dark"] .dropzone-area {
    background: var(--bg-tertiary) !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .upload-zone.dragover,
[data-theme="dark"] .upload-zone-projet.dragover {
    background: rgba(41, 128, 185, 0.15) !important;
}

[data-theme="dark"] .upload-zone p,
[data-theme="dark"] .upload-zone-projet p {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .upload-zone span,
[data-theme="dark"] .upload-zone-projet span {
    color: var(--text-secondary) !important;
}

/* Onglets de choix (Fichier/Texte libre) */
[data-theme="dark"] .choice-tab {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .choice-tab:hover {
    border-color: var(--blue-accent) !important;
    color: var(--blue-accent) !important;
}

[data-theme="dark"] .choice-tab.active {
    background: var(--blue-ai) !important;
    border-color: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

/* Rich text editors */
[data-theme="dark"] .rich-editor,
[data-theme="dark"] [contenteditable="true"] {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .rich-editor::before,
[data-theme="dark"] [contenteditable="true"]::before,
[data-theme="dark"] [data-placeholder]::before {
    color: var(--text-muted) !important;
}

/* Labels de formulaire */
[data-theme="dark"] .form-group label,
[data-theme="dark"] .form-label,
[data-theme="dark"] .field-label {
    color: var(--text-secondary) !important;
}

/* Slider/Range inputs */
[data-theme="dark"] input[type="range"] {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] input[type="number"] {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* Sections de configuration */
[data-theme="dark"] .config-card,
[data-theme="dark"] .config-section,
[data-theme="dark"] .config-item,
[data-theme="dark"] .config-row {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .config-card-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Sections de vues */
[data-theme="dark"] .view,
[data-theme="dark"] .view-content,
[data-theme="dark"] .view-body {
    background: var(--bg-primary) !important;
}

/* Section historique projets */
[data-theme="dark"] .history-panel,
[data-theme="dark"] .history-section,
[data-theme="dark"] .history-list,
[data-theme="dark"] .history-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Resultats de matching */
[data-theme="dark"] .results-section,
[data-theme="dark"] .results-container,
[data-theme="dark"] .results-header,
[data-theme="dark"] .results-body,
[data-theme="dark"] .prof-result-card,
[data-theme="dark"] .match-result,
[data-theme="dark"] .expertise-section {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Cartes de professeurs dans les resultats */
[data-theme="dark"] .prof-card,
[data-theme="dark"] .professor-result,
[data-theme="dark"] .match-professor {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .prof-card:hover,
[data-theme="dark"] .professor-result:hover {
    background: var(--bg-tertiary) !important;
}

/* Fiches professeurs - vue liste */
[data-theme="dark"] .professor-list-item,
[data-theme="dark"] .fiche-preview,
[data-theme="dark"] .fiche-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Bouton et actions */
[data-theme="dark"] .action-buttons,
[data-theme="dark"] .form-actions {
    background: var(--bg-secondary) !important;
}

/* Aide et descriptions */
[data-theme="dark"] .section-help,
[data-theme="dark"] .help-text,
[data-theme="dark"] .description-text {
    color: var(--text-muted) !important;
}

/* Agent selector */
[data-theme="dark"] .agent-selector,
[data-theme="dark"] .agent-option,
[data-theme="dark"] .agent-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .agent-option.selected,
[data-theme="dark"] .agent-card.selected {
    border-color: var(--blue-accent) !important;
    background: var(--bg-tertiary) !important;
}

/* Users management */
[data-theme="dark"] .users-container,
[data-theme="dark"] .user-card,
[data-theme="dark"] .user-item,
[data-theme="dark"] .user-details {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Veille professeurs */
[data-theme="dark"] .veille-container,
[data-theme="dark"] .veille-section,
[data-theme="dark"] .veille-results,
[data-theme="dark"] .veille-prof-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Messages et notifications */
[data-theme="dark"] .message,
[data-theme="dark"] .notification,
[data-theme="dark"] .info-message {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Empty states */
[data-theme="dark"] .empty-state,
[data-theme="dark"] .no-results,
[data-theme="dark"] .placeholder-message {
    color: var(--text-muted) !important;
}

/* ============================================ */
/* MODE SOMBRE - VUES SPECIFIQUES MANQUANTES   */
/* ============================================ */

/* === GESTION DES DOMAINES === */
[data-theme="dark"] .domaine-item,
[data-theme="dark"] .domaine-card,
[data-theme="dark"] .domaines-liste {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 2px 8px var(--shadow-color) !important;
}

[data-theme="dark"] .domaine-item span {
    color: var(--text-primary) !important;
}

/* === VUE MES PROJETS === */
[data-theme="dark"] .mes-projets-container {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .projets-liste-panel,
[data-theme="dark"] .projets-detail-panel,
[data-theme="dark"] .projet-detail-panel,
[data-theme="dark"] .projet-detail-content,
[data-theme="dark"] .projet-detail-empty {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .projet-detail-empty h3,
[data-theme="dark"] .projet-detail-empty svg {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .projet-detail-empty p {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .projet-detail-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .projet-detail-title h2 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .projet-detail-meta span {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .projet-detail-tabs {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .projet-detail-tab {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .projet-detail-tab.active {
    color: var(--text-primary) !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .projet-detail-body {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .projet-item,
[data-theme="dark"] .projet-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .projet-item:hover,
[data-theme="dark"] .projet-card:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .projet-item.selected,
[data-theme="dark"] .projet-card.selected {
    background: var(--bg-tertiary) !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .projets-liste-scroll {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .projets-search {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .projets-search input {
    background: transparent !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .projets-search input::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .projets-search svg {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .projets-empty-state {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .projets-empty-state p {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .projets-empty-state span {
    color: var(--text-secondary) !important;
}

/* ============================================================ */
/* === NOUVEAU MODULE BREVETS V2 - Layout 3 zones           === */
/* ============================================================ */

/* Container principal 2 colonnes */
.brevets-main-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    height: calc(100vh - 140px);
    background: var(--bg-tertiary, #f1f5f9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Colonne gauche - Liste projets */
.brevets-projets-panel {
    background: var(--card-bg, #ffffff);
    border-right: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brevets-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-bottom: 1px solid var(--border-color);
}

.brevets-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.brevets-panel-header h3 svg {
    color: rgba(255,255,255,0.9);
}

.brevets-projets-count {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
}

.brevets-projets-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary, #f8fafc);
}

.brevets-projets-search svg {
    color: var(--grey);
    flex-shrink: 0;
}

.brevets-projets-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
}

.brevets-projets-liste {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.brevets-projets-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--grey);
}

.brevets-projets-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.brevets-projets-empty p {
    font-weight: 500;
    margin: 0 0 0.25rem;
    color: var(--grey-dark);
}

.brevets-projets-empty span {
    font-size: 0.8rem;
}

/* Card de projet dans la liste */
.brevets-projet-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.brevets-projet-card:hover {
    border-color: var(--blue-ai);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.brevets-projet-card.active {
    border-color: var(--blue-ai);
    background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(59,130,246,0.03) 100%);
}

.brevets-projet-card .projet-titre {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.brevets-projet-card .projet-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--grey);
}

.brevets-projet-card .projet-badge {
    background: var(--blue-ai);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Item de projet dans la liste (V2) */
.brevets-projet-item {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.brevets-projet-item:hover {
    border-color: var(--blue-ai, #3b82f6);
    background: linear-gradient(135deg, rgba(59,130,246,0.04) 0%, transparent 100%);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(59,130,246,0.12);
}

.brevets-projet-item.selected {
    border-color: var(--blue-ai, #3b82f6);
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(59,130,246,0.04) 100%);
    border-left: 3px solid var(--blue-ai, #3b82f6);
}

.brevets-projet-item .projet-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.brevets-projet-item .projet-titre {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary, #1e293b);
    line-height: 1.4;
    flex: 1;
}

.brevets-projet-item .projet-status {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.brevets-projet-item .projet-domaine {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--grey, #64748b);
}

.brevets-projet-item.has-draft {
    border-left: 3px solid var(--success, #10b981);
}

.brevets-projet-item.has-anteriorite {
    border-left: 3px solid var(--warning, #f59e0b);
}

.brevets-projet-item.has-etude {
    border-left: 3px solid var(--blue-ai, #3b82f6);
}

/* Colonne droite - 3 zones verticales */
.brevets-content-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-tertiary, #f1f5f9);
    padding: 0.75rem;
    gap: 0.75rem;
}

/* Zone generique */
.brevets-zone {
    background: var(--card-bg, #ffffff);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Zone 1: Etudes en cours */
.brevets-zone-etudes {
    flex: 0 0 auto;
    min-height: 100px;
}

.brevets-zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border-bottom: 1px solid var(--border-color);
}

.brevets-zone-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.brevets-zone-header h4 svg {
    color: rgba(255,255,255,0.9);
}

.brevets-etudes-liste {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    overflow-x: auto;
    min-height: 80px;
}

.brevets-etude-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--grey);
    font-size: 0.85rem;
}

/* Card d'etude */
.brevets-etude-card {
    flex: 0 0 200px;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.brevets-etude-card:hover {
    border-color: var(--blue-ai);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.brevets-etude-card.active {
    border-color: var(--blue-ai);
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(59,130,246,0.05) 100%);
}

.brevets-etude-card .etude-titre {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brevets-etude-card .etude-progress {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.brevets-etude-card .etude-progress .step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
}

.brevets-etude-card .etude-progress .step-dot.done {
    background: var(--success, #10b981);
}

.brevets-etude-card .etude-progress .step-dot.active {
    background: var(--blue-ai);
}

.brevets-etude-card .etude-date {
    font-size: 0.7rem;
    color: var(--grey);
}

/* Card d'etude dans la zone (V2) */
.etude-card {
    flex: 0 0 220px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.etude-card:hover {
    border-color: var(--blue-ai, #3b82f6);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(59,130,246,0.15);
}

.etude-card.selected {
    border-color: var(--blue-ai, #3b82f6);
    background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(59,130,246,0.02) 100%);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.etude-card .etude-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.etude-card .etude-titre {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary, #1e293b);
    line-height: 1.3;
    flex: 1;
}

.etude-card .etude-score {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    min-width: 32px;
    text-align: center;
}

.etude-card .etude-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.etude-card .etude-etape {
    font-size: 0.7rem;
    font-weight: 600;
}

.etude-card .etude-date {
    font-size: 0.65rem;
    color: var(--grey, #64748b);
}

.etude-card .etude-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.etude-card .etude-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--grey, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.etude-card:hover .etude-delete-btn {
    opacity: 1;
}

.etude-card .etude-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error, #ef4444);
}

.etude-card .etude-delete-btn:active {
    transform: scale(0.95);
}

/* Zone 2: Workflow (4 etapes) */
.brevets-zone-workflow {
    flex: 0 0 auto;
}

.brevets-workflow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary, #f8fafc);
    border-bottom: 1px solid var(--border-color);
}

.workflow-projet-titre {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.brevets-workflow-steps {
    display: flex;
    padding: 1rem;
    gap: 0.5rem;
}

.workflow-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.workflow-step:hover:not(.disabled) {
    border-color: var(--blue-ai);
    background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, transparent 100%);
}

.workflow-step.disabled {
    opacity: 0.5;
    background: var(--bg-tertiary);
}

.workflow-step.completed {
    border-color: var(--success, #10b981);
    background: linear-gradient(135deg, rgba(16,185,129,0.08) 0%, transparent 100%);
}

.workflow-step.completed .step-icon {
    color: var(--success, #10b981);
}

.workflow-step.active {
    border-color: var(--blue-ai);
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(59,130,246,0.02) 100%);
}

.workflow-step .step-icon {
    flex-shrink: 0;
    color: var(--grey);
}

.workflow-step .step-info {
    flex: 1;
    min-width: 0;
}

.workflow-step .step-title {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.workflow-step .step-status {
    display: block;
    font-size: 0.7rem;
    color: var(--grey);
}

.workflow-step.completed .step-status {
    color: var(--success, #10b981);
}

.workflow-step .btn-step {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-ai);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.workflow-step .btn-step:hover:not(:disabled) {
    background: var(--blue-ai-dark, #1d4ed8);
    transform: scale(1.05);
}

.workflow-step .btn-step:disabled {
    background: var(--grey-light, #cbd5e1);
    cursor: not-allowed;
}

/* Zone 3: Contenu detaille (onglets) */
.brevets-zone-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.brevets-detail-tabs {
    display: flex;
    padding: 0.5rem 0.75rem;
    gap: 0.25rem;
    background: var(--bg-tertiary, #f8fafc);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.brevets-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--grey-dark);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.brevets-tab:hover {
    background: var(--card-bg);
    color: var(--text-primary);
}

.brevets-tab.active {
    background: var(--card-bg);
    color: var(--blue-ai);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.brevets-tab svg {
    flex-shrink: 0;
}

/* Contenu des onglets */
.brevets-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.brevets-tab-content.active {
    display: flex;
    flex-direction: column;
}

.tab-content-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--grey);
    flex: 1;
}

.tab-content-empty svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.tab-content-empty h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.tab-content-empty p {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 0 1.5rem;
}

.tab-content-result {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Draft toolbar et editeur */
.draft-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.draft-lang-selector select {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    cursor: pointer;
}

.draft-actions {
    display: flex;
    gap: 0.5rem;
}

.draft-content {
    flex: 1;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    min-height: 200px;
    overflow-y: auto;
    line-height: 1.6;
}

.draft-content:focus {
    outline: none;
    border-color: var(--blue-ai);
}

/* Export options */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.export-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-card:hover {
    border-color: var(--blue-ai);
    background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, transparent 100%);
    transform: translateY(-2px);
}

.export-card svg {
    margin-bottom: 0.75rem;
    color: var(--grey);
}

.export-card:hover svg {
    color: var(--blue-ai);
}

.export-card span {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* ================================================
   OVERLAY DE GENERATION - DESIGN MODERNE
   ================================================ */
.brevets-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
    overflow: hidden;
}

/* Backdrop avec gradient anime */
.brevets-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(30, 41, 59, 0.92) 50%,
        rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(8px);
}

/* Orbes flottantes animees */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float-orb 8s ease-in-out infinite;
}

.orb-1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #06b6d4, #10b981);
    bottom: 20%;
    right: 15%;
    animation-delay: -3s;
}

.orb-3 {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    top: 50%;
    right: 30%;
    animation-delay: -5s;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.1); }
    50% { transform: translate(-10px, 20px) scale(0.9); }
    75% { transform: translate(-20px, -10px) scale(1.05); }
}

/* Contenu principal */
.brevets-overlay-content {
    position: relative;
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 250, 252, 0.95) 100%);
    border-radius: 24px;
    padding: 3rem 3.5rem;
    text-align: center;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.25),
        0 10px 30px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Glow ring autour du spinner */
.overlay-glow-ring {
    position: relative;
    margin: 0 auto 1.5rem;
    width: 90px;
    height: 90px;
}

.overlay-glow-ring::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: conic-gradient(from 0deg, #8b5cf6, #06b6d4, #10b981, #8b5cf6);
    border-radius: 50%;
    animation: rotate-glow 3s linear infinite;
    opacity: 0.3;
    filter: blur(12px);
}

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

/* Spinner SVG moderne */
.brevets-overlay-spinner {
    position: relative;
    width: 90px;
    height: 90px;
}

.brevets-overlay-spinner svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.brevets-overlay-spinner .spinner-track {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 6;
}

.brevets-overlay-spinner .spinner-progress {
    fill: none;
    stroke: url(#spinner-gradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 66;
    animation: spinner-dash 1.5s ease-in-out infinite;
}

@keyframes spinner-dash {
    0% { stroke-dashoffset: 264; transform: rotate(0deg); }
    50% { stroke-dashoffset: 66; }
    100% { stroke-dashoffset: 264; transform: rotate(360deg); }
}

/* Icone au centre du spinner */
.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    color: #8b5cf6;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* Titre */
.brevets-overlay-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

/* Sous-titre status */
.brevets-overlay-content p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 1.75rem;
    font-weight: 500;
}

/* Barre de progression stylisee */
.brevets-overlay-progress {
    height: 8px;
    background: linear-gradient(90deg, #e2e8f0, #f1f5f9);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.brevets-progress-bar {
    height: 100%;
    background: linear-gradient(90deg,
        #8b5cf6 0%,
        #06b6d4 50%,
        #10b981 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Effet shimmer sur la barre */
.progress-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to { left: 100%; }
}

/* Section agents */
.brevets-overlay-agents {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* Container logo avec glow */
.hemisync-badge-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.hemisync-badge-glow {
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: badge-glow-pulse 2s ease-in-out infinite;
}

@keyframes badge-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Logo Deep Hemisync+ */
.brevets-overlay-agents .hemisync-logo {
    position: relative;
    width: 70px;
    height: 70px;
    filter: drop-shadow(0 4px 15px rgba(139, 92, 246, 0.35));
    animation: logo-float 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Badge Hemisync large - SIMPLE ET VISIBLE */
.hemisync-badge-large {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 0.9rem 2.5rem;
    letter-spacing: 2px;
    border-radius: 50px;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
    text-transform: uppercase;
    white-space: nowrap;
    text-align: center;
}

.hemisync-badge-large .plus {
    color: #fde047;
    font-weight: 800;
    font-size: 1.4rem;
    margin-left: 4px;
}

/* Sous-titre agents */
.agents-subtitle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.agent-dot {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-radius: 50%;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.agent-dot:last-child {
    animation-delay: 0.75s;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Agent badges standards */
.brevets-overlay-agents .agent-badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--grey-dark);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.brevets-overlay-agents .agent-badge.active {
    background: linear-gradient(135deg, var(--blue-ai) 0%, #06b6d4 100%);
    color: white;
    border-color: transparent;
}

/* Resultat etude de brevetabilite */
.brevetabilite-result-content {
    padding: 0;
}

.brevetabilite-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(6,182,212,0.05) 100%);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.brevetabilite-verdict {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.verdict-badge {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
}

.verdict-badge.favorable {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.verdict-badge.prudent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.verdict-badge.defavorable {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.score-global {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.score-global span {
    font-size: 0.9rem;
    color: var(--grey);
    font-weight: 400;
}

.brevetabilite-resume {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.brevetabilite-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.brevetabilite-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
}

.brevetabilite-section h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.brevetabilite-section .section-score {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--blue-ai);
    color: white;
    border-radius: 4px;
    margin-left: auto;
}

.brevetabilite-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.brevetabilite-section ul {
    margin: 0;
    padding-left: 1.25rem;
}

.brevetabilite-section li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* Section view position relative for overlay */
#view-brevets {
    position: relative;
}

/* Responsive */
@media (max-width: 1024px) {
    .brevets-main-container {
        grid-template-columns: 250px 1fr;
    }

    .brevets-workflow-steps {
        flex-wrap: wrap;
    }

    .workflow-step {
        flex: 1 1 calc(50% - 0.25rem);
    }
}

@media (max-width: 768px) {
    .brevets-main-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .brevets-projets-panel {
        max-height: 300px;
    }

    .brevets-workflow-steps {
        flex-direction: column;
    }

    .workflow-step {
        flex: 1 1 auto;
    }
}

/* === MODULE BREVETS === */
[data-theme="dark"] .brevet-projets-search {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-projets-search input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-projets-search input::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .brevet-projets-liste {
    background: var(--bg-secondary) !important;
    background-image: none !important;
}

[data-theme="dark"] .brevet-projet-item {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .brevet-projet-item:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
    border-left-color: var(--blue-brevet) !important;
    transform: none !important;
}

[data-theme="dark"] .brevet-projet-item.selected {
    background: rgba(14, 165, 233, 0.2) !important;
    background-image: none !important;
    border-left-color: var(--blue-brevet) !important;
}

[data-theme="dark"] .brevet-projet-item .projet-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-projet-item .projet-meta {
    color: var(--text-secondary) !important;
}

/* Badges dans les items de projet */
[data-theme="dark"] .brevet-projet-item .badge,
[data-theme="dark"] .brevet-projet-item .projet-badge {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .brevet-demandes-panel,
[data-theme="dark"] .brevet-liste-panel {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-demande-item {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-demande-item:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
}

[data-theme="dark"] .brevet-detail-empty,
[data-theme="dark"] .brevet-empty-state {
    background: var(--card-bg) !important;
    background-image: none !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .brevet-workflow-steps {
    background: var(--bg-tertiary) !important;
}

/* === MODULE SUBVENTIONS === */
[data-theme="dark"] .subventions-container,
[data-theme="dark"] .subventions-sidebar,
[data-theme="dark"] .subventions-main,
[data-theme="dark"] .subventions-content {
    background: var(--bg-primary) !important;
}

[data-theme="dark"] .subv-section-projets,
[data-theme="dark"] .subv-section-demandes {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-section-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-projets-liste,
[data-theme="dark"] .subv-demandes-liste {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .subv-projet-item,
[data-theme="dark"] .subvention-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-projet-item:hover,
[data-theme="dark"] .subvention-item:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .subv-projet-item.selected,
[data-theme="dark"] .subvention-item.active {
    background: rgba(52, 152, 219, 0.15) !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .subvention-item-titre,
[data-theme="dark"] .subv-projet-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subvention-item-info,
[data-theme="dark"] .subv-projet-meta {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subvention-detail-panel,
[data-theme="dark"] .subvention-detail-content,
[data-theme="dark"] .subvention-form-container {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subvention-empty-state {
    background: var(--card-bg) !important;
    color: var(--text-muted) !important;
}

/* Badges de programme - garder couleurs mais adapter */
[data-theme="dark"] .subvention-item-programme.mitacs {
    background: rgba(21, 101, 192, 0.2) !important;
    color: #64B5F6 !important;
}

[data-theme="dark"] .subvention-item-programme.crsng {
    background: rgba(230, 81, 0, 0.2) !important;
    color: #FFB74D !important;
}

[data-theme="dark"] .subvention-item-programme.frqnt {
    background: rgba(123, 31, 162, 0.2) !important;
    color: #CE93D8 !important;
}

[data-theme="dark"] .subvention-item-programme.autre {
    background: rgba(84, 110, 122, 0.2) !important;
    color: #90A4AE !important;
}

/* Progress bars en subventions */
[data-theme="dark"] .subvention-progress-bar {
    background: var(--bg-tertiary) !important;
}

/* === SELECTS ET FILTRES === */
[data-theme="dark"] .filter-select,
[data-theme="dark"] .status-filter,
[data-theme="dark"] .type-filter {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] select option {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* === PANELS LATERAUX === */
[data-theme="dark"] .side-panel-left,
[data-theme="dark"] .side-panel-right,
[data-theme="dark"] .left-panel,
[data-theme="dark"] .right-panel {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === ZONES VIDES ET PLACEHOLDERS === */
[data-theme="dark"] .detail-empty-state,
[data-theme="dark"] .no-selection,
[data-theme="dark"] .select-item-message {
    background: var(--card-bg) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .detail-empty-state svg,
[data-theme="dark"] .empty-state svg {
    color: var(--text-muted) !important;
    opacity: 0.5;
}

/* === BADGES ET STATUTS === */
[data-theme="dark"] .status-badge,
[data-theme="dark"] .badge-status {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .badge-nouveau,
[data-theme="dark"] .badge-en-cours {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .badge-complete,
[data-theme="dark"] .badge-valide {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}

/* === FORMULAIRE NOUVELLE FICHE === */
[data-theme="dark"] .fiche-form-container,
[data-theme="dark"] .fiche-form-wrapper,
[data-theme="dark"] .form-container {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .tabs-container,
[data-theme="dark"] .tab-buttons {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .tab-btn {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .tab-btn:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .tab-btn.active {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

/* === ZONES DE TEXTE ENRICHI === */
[data-theme="dark"] .notes-textarea,
[data-theme="dark"] .description-textarea {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === RECHERCHE INLINE === */
[data-theme="dark"] .search-container,
[data-theme="dark"] .search-wrapper {
    background: var(--input-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .search-container input,
[data-theme="dark"] .search-wrapper input {
    background: transparent !important;
    color: var(--text-primary) !important;
}

/* === BOUTONS D'ACTION DANS LES CARTES === */
[data-theme="dark"] .card-actions,
[data-theme="dark"] .item-actions {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .action-btn,
[data-theme="dark"] .icon-btn {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .action-btn:hover,
[data-theme="dark"] .icon-btn:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* === INDICATEURS TRL === */
[data-theme="dark"] .trl-badge,
[data-theme="dark"] .trl-indicator {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

/* === WORKFLOW STEPS === */
[data-theme="dark"] .workflow-step,
[data-theme="dark"] .step-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .workflow-step.active,
[data-theme="dark"] .step-item.active {
    color: var(--blue-accent) !important;
}

/* === HEADERS DE SECTIONS === */
[data-theme="dark"] .section-header,
[data-theme="dark"] .panel-header,
[data-theme="dark"] .list-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .section-header h2,
[data-theme="dark"] .section-header h3,
[data-theme="dark"] .panel-header h2 {
    color: var(--text-primary) !important;
}

/* === COMPTEURS ET BADGES NUMERIQUES === */
[data-theme="dark"] .count-badge,
[data-theme="dark"] .number-badge {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

/* ============================================ */
/* MODE SOMBRE - MODULE SUBVENTIONS COMPLET    */
/* ============================================ */

/* === PANNEAU LISTE SUBVENTIONS === */
[data-theme="dark"] .subventions-liste-panel {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-liste-scroll {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .subventions-filtres {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-filtres select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-empty-state {
    background: var(--card-bg) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .subventions-empty-state svg {
    stroke: var(--text-muted) !important;
}

/* === ONGLETS SUBVENTIONS === */
[data-theme="dark"] .subvention-tabs {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border-color: transparent !important;
}

[data-theme="dark"] .subv-tab:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-tab.active {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
    border-color: var(--blue-ai) !important;
}

/* === HEADER SUBVENTION === */
[data-theme="dark"] .subvention-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--card-bg) 100%) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subvention-header::before,
[data-theme="dark"] .subvention-header::after {
    opacity: 0.3 !important;
}

[data-theme="dark"] .subvention-header-info h2 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subvention-meta span {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .badge-projet {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .badge-programme {
    background: rgba(52, 152, 219, 0.2) !important;
    color: #5DADE2 !important;
}

[data-theme="dark"] .badge-statut {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .progression-badge {
    background: var(--bg-tertiary) !important;
    color: var(--green-success) !important;
}

/* === AGENT IA SELECTOR === */
[data-theme="dark"] .agent-ia-selector {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .agent-ia-selector label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .agent-ia-selector select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === CONTENU DES ONGLETS === */
[data-theme="dark"] .tab-content,
[data-theme="dark"] .subv-tab-content,
[data-theme="dark"] .subvention-tab-pane {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .form-subv-section {
    background: var(--card-bg) !important;
}

/* === FORM CARDS DANS SUBVENTIONS === */
[data-theme="dark"] .form-subv-section .form-card,
[data-theme="dark"] .subvention-form .form-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-subv-section h3,
[data-theme="dark"] .form-subv-section h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .section-description,
[data-theme="dark"] .form-help {
    color: var(--text-muted) !important;
}

/* === SUGGESTIONS IA === */
[data-theme="dark"] .subv-suggestions {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-suggestions-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .badge-suggestion {
    background: rgba(168, 85, 247, 0.2) !important;
    color: #A78BFA !important;
}

[data-theme="dark"] .subv-suggestions-liste {
    background: var(--bg-secondary) !important;
}

/* === DROPDOWN GENERATION IA === */
[data-theme="dark"] .dropdown-menu-generate {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .dropdown-item-generate {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item-generate:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .dropdown-item-generate.featured {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .dropdown-item-generate .dropdown-item-icon {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .dropdown-item-generate .dropdown-item-content strong {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item-generate .dropdown-item-content small {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .badge-recommended {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
}

/* === CHECKLIST AIDE === */
[data-theme="dark"] .checklist-popup {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .checklist-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .checklist-header h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .checklist-content {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .checklist-footer {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .btn-checklist-help {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-checklist-help:hover {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

/* ============================================
   SPLASH SCREENS - MODE SOMBRE COMPLET
   ============================================ */
[data-theme="dark"] .subventions-splash-overlay {
    background: var(--bg-overlay) !important;
}

[data-theme="dark"] .subventions-splash-box {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-xl), 0 0 80px rgba(14, 165, 233, 0.15) !important;
}

[data-theme="dark"] .splash-title {
    color: var(--red-ets) !important;
}

[data-theme="dark"] #brevets-splash .splash-title {
    color: var(--blue-brevet) !important;
}

[data-theme="dark"] .splash-subtitle {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .splash-input-group input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}

[data-theme="dark"] .splash-input-group input:focus {
    background: var(--bg-elevated) !important;
    border-color: var(--red-ets) !important;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.2) !important;
}

[data-theme="dark"] #brevets-splash .splash-input-group input:focus {
    border-color: var(--blue-brevet) !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2) !important;
}

[data-theme="dark"] .splash-input-group input::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .splash-error-msg {
    background: rgba(248, 113, 113, 0.15) !important;
    color: var(--error) !important;
}

[data-theme="dark"] .splash-toggle-password {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .splash-toggle-password:hover {
    color: var(--red-ets) !important;
}

[data-theme="dark"] #brevets-splash .splash-toggle-password:hover {
    color: var(--blue-brevet) !important;
}

[data-theme="dark"] .splash-lock-badge {
    background: rgba(248, 113, 113, 0.15) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    color: var(--red-ets) !important;
}

[data-theme="dark"] #brevets-splash .splash-lock-badge {
    background: rgba(56, 189, 248, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    color: var(--blue-brevet) !important;
}

[data-theme="dark"] .splash-email-option {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .splash-email-option p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .splash-email-btn {
    border-color: var(--red-ets) !important;
    color: var(--red-ets) !important;
    background: transparent !important;
}

[data-theme="dark"] .splash-email-btn:hover {
    background: var(--red-ets) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] #brevets-splash .splash-email-btn {
    border-color: var(--blue-brevet) !important;
    color: var(--blue-brevet) !important;
}

[data-theme="dark"] #brevets-splash .splash-email-btn:hover {
    background: var(--blue-brevet) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .splash-btn-cancel {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .splash-btn-cancel:hover {
    color: var(--text-primary) !important;
}

/* === DETAIL PANEL EMPTY STATE === */
[data-theme="dark"] .subvention-detail-empty {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .subvention-detail-empty h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subvention-detail-empty p {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .subvention-detail-empty svg {
    stroke: var(--text-muted) !important;
}

/* === LOADING STATE === */
[data-theme="dark"] .subvention-detail-loading {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .subvention-detail-loading h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subvention-detail-loading p {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .subvention-loading-spinner {
    border-color: var(--border-color) !important;
    border-top-color: var(--blue-ai) !important;
}

/* === PROGRAMMES SPECIFIQUES === */
[data-theme="dark"] .programme-mitacs,
[data-theme="dark"] .mitacs-section {
    border-left-color: #1565C0 !important;
}

[data-theme="dark"] .programme-crsng,
[data-theme="dark"] .crsng-section {
    border-left-color: #E65100 !important;
}

[data-theme="dark"] .programme-frq,
[data-theme="dark"] .frq-section {
    border-left-color: #7B1FA2 !important;
}

[data-theme="dark"] .programme-crsh,
[data-theme="dark"] .crsh-section {
    border-left-color: #00838F !important;
}

[data-theme="dark"] .programme-irsc,
[data-theme="dark"] .irsc-section {
    border-left-color: #C62828 !important;
}

[data-theme="dark"] .programme-genome,
[data-theme="dark"] .genome-section {
    border-left-color: #2E7D32 !important;
}

/* === ICONES DE PROGRAMMES === */
[data-theme="dark"] .icon-mitacs,
[data-theme="dark"] .icon-crsng,
[data-theme="dark"] .icon-frq,
[data-theme="dark"] .icon-crsh,
[data-theme="dark"] .icon-irsc,
[data-theme="dark"] .icon-genome {
    filter: brightness(1.2);
}

/* === CHAR COUNTER === */
[data-theme="dark"] .char-info,
[data-theme="dark"] .char-counter {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .char-limit {
    color: var(--text-secondary) !important;
}

/* === STATUTS DE DEMANDE === */
[data-theme="dark"] .badge-statut.brouillon {
    background: rgba(107, 114, 128, 0.2) !important;
    color: #9CA3AF !important;
}

[data-theme="dark"] .badge-statut.en_cours {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
}

[data-theme="dark"] .badge-statut.a_valider {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
}

[data-theme="dark"] .badge-statut.validee {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
}

[data-theme="dark"] .badge-statut.envoyee_decanat {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #A78BFA !important;
}

[data-theme="dark"] .badge-statut.soumise {
    background: rgba(6, 182, 212, 0.2) !important;
    color: #22D3EE !important;
}

[data-theme="dark"] .badge-statut.acceptee {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ADE80 !important;
}

[data-theme="dark"] .badge-statut.refusee {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #F87171 !important;
}

/* ============================================ */
/* MODE SOMBRE - MODULE BREVETS COMPLET        */
/* ============================================ */

/* === PANNEAU PRINCIPAL BREVETS === */
[data-theme="dark"] .view-brevets,
[data-theme="dark"] #view-brevets {
    background: var(--bg-primary) !important;
}

[data-theme="dark"] .brevets-container {
    background: transparent !important;
    gap: 0.3rem !important;
    padding: 0.15rem !important;
}

/* === SECTION PROJETS (panneau haut gauche) === */
[data-theme="dark"] .brevet-section-projets,
[data-theme="dark"] .brevet-section-demandes {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .brevet-section-projets:hover,
[data-theme="dark"] .brevet-section-demandes:hover {
    box-shadow: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-section-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-section-header h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-demandes-liste {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .brevet-demande-card {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-demande-card:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .brevet-demande-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-demande-meta {
    color: var(--text-secondary) !important;
}

/* === FILTRE TOUS STATUTS === */
[data-theme="dark"] .brevet-filtres,
[data-theme="dark"] .brevet-section-demandes select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === PANNEAU DETAIL VIDE (droite) === */
[data-theme="dark"] .brevet-detail-panel {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-detail-empty {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .brevet-detail-empty h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-detail-empty p {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .brevet-detail-empty svg {
    stroke: var(--text-muted) !important;
}

/* === WORKFLOW PREVIEW (dans panneau vide) === */
[data-theme="dark"] .brevet-workflow-preview {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-workflow-preview .workflow-step {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .brevet-workflow-preview .step-number {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .brevet-workflow-preview .step-label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-workflow-preview .workflow-arrow {
    color: var(--text-muted) !important;
}

/* === WORKFLOW STEPS (dans panneau detail) === */
[data-theme="dark"] .brevet-workflow-steps {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-step {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-step:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .brevet-step.active {
    background: rgba(14, 165, 233, 0.15) !important;
    border-color: var(--blue-brevet) !important;
}

[data-theme="dark"] .brevet-step.completed {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: var(--green-success) !important;
}

[data-theme="dark"] .brevet-step.disabled {
    opacity: 0.5;
}

[data-theme="dark"] .brevet-step .step-indicator {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-step.active .step-indicator {
    background: var(--blue-brevet) !important;
    border-color: var(--blue-brevet) !important;
}

[data-theme="dark"] .brevet-step .step-num {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .brevet-step.active .step-num {
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .brevet-step .step-info h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-step .step-info p {
    color: var(--text-secondary) !important;
}

/* === HEADER BREVET DETAIL === */
[data-theme="dark"] .brevet-detail-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-projet-info h2 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-badge {
    background: rgba(14, 165, 233, 0.2) !important;
    color: #38BDF8 !important;
}

[data-theme="dark"] .brevet-badge.redaction {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
}

[data-theme="dark"] .brevet-badge.termine {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
}

/* === ACTIONS BREVET === */
[data-theme="dark"] .brevet-actions .btn {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-actions .btn:hover {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

/* === SPLIT CONTAINER === */
[data-theme="dark"] .brevet-split-container {
    background: var(--bg-primary) !important;
}

[data-theme="dark"] .brevet-splitter {
    background: var(--border-color) !important;
}

[data-theme="dark"] .brevet-splitter:hover {
    background: var(--blue-ai) !important;
}

/* === ZONE CONTENU BREVET === */
[data-theme="dark"] .brevet-content-area {
    background: var(--card-bg) !important;
}

/* === ZONE DRAFT EDITOR === */
[data-theme="dark"] .brevet-draft-editor-zone {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === SOURCES PANEL === */
[data-theme="dark"] .brevet-sources-panel {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-sources-title {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-sources-grid {
    background: var(--bg-secondary) !important;
}

/* === SPLASH SCREEN BREVETS === */
[data-theme="dark"] .brevet-splash-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
}

[data-theme="dark"] .brevet-splash-box {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === RESULTATS ANTERIORITE === */
[data-theme="dark"] .anteriorite-results,
[data-theme="dark"] .anteriorite-liste {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .anteriorite-item,
[data-theme="dark"] .brevet-anteriorite-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .anteriorite-item:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .anteriorite-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .anteriorite-meta {
    color: var(--text-secondary) !important;
}

/* === RISQUE BADGES === */
[data-theme="dark"] .risque-bloquant {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #F87171 !important;
}

[data-theme="dark"] .risque-eleve {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
}

[data-theme="dark"] .risque-modere {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
}

[data-theme="dark"] .risque-faible {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
}

/* === FORMULAIRE ETUDE BREVETABILITE === */
[data-theme="dark"] .etude-brevetabilite-form {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .etude-brevetabilite-form .form-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .etude-brevetabilite-form h3,
[data-theme="dark"] .etude-brevetabilite-form h4 {
    color: var(--text-primary) !important;
}

/* === SCORE DE BREVETABILITE === */
[data-theme="dark"] .score-brevetabilite {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .score-value {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .score-label {
    color: var(--text-secondary) !important;
}

/* ============================================ */
/* MODE SOMBRE - BADGES PROGRAMMES SUBVENTIONS */
/* ============================================ */

/* === BADGES DANS LISTE SUBVENTIONS (subv-item-programme) === */
[data-theme="dark"] .subv-item-programme {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
}

[data-theme="dark"] .subv-item-programme.mitacs {
    background: rgba(29, 78, 216, 0.3) !important;
    background-image: none !important;
    color: #93C5FD !important;
    border: 1px solid rgba(29, 78, 216, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.crsng {
    background: rgba(194, 65, 12, 0.3) !important;
    background-image: none !important;
    color: #FDBA74 !important;
    border: 1px solid rgba(194, 65, 12, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.frqnt,
[data-theme="dark"] .subv-item-programme.frq {
    background: rgba(126, 34, 206, 0.3) !important;
    background-image: none !important;
    color: #D8B4FE !important;
    border: 1px solid rgba(126, 34, 206, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.crsh {
    background: rgba(6, 182, 212, 0.3) !important;
    background-image: none !important;
    color: #67E8F9 !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.irsc {
    background: rgba(220, 38, 38, 0.3) !important;
    background-image: none !important;
    color: #FCA5A5 !important;
    border: 1px solid rgba(220, 38, 38, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.genome {
    background: rgba(22, 163, 74, 0.3) !important;
    background-image: none !important;
    color: #86EFAC !important;
    border: 1px solid rgba(22, 163, 74, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.autre {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
    color: var(--text-secondary) !important;
}

/* === STATUT EN COURS (badge orange) === */
[data-theme="dark"] .badge-en-cours,
[data-theme="dark"] .subv-item-statut.en-cours,
[data-theme="dark"] .status-en-cours {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
}

/* === DATE === */
[data-theme="dark"] .subv-item-date {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .subv-item-date svg {
    color: var(--text-muted) !important;
}

/* === PROGRESS BAR === */
[data-theme="dark"] .subv-item-progress {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .subv-item-progress-bar {
    background: linear-gradient(90deg, #F59E0B, #D97706) !important;
}

[data-theme="dark"] .subv-item-progress-text {
    color: var(--text-secondary) !important;
}

/* ============================================ */
/* MODE SOMBRE - MODULE SUBVENTIONS COMPLET    */
/* Style cohérent avec le module Brevets       */
/* ============================================ */

/* === CONTAINER PRINCIPAL SUBVENTIONS === */
[data-theme="dark"] #view-subventions {
    background: var(--bg-primary) !important;
}

[data-theme="dark"] .subventions-container {
    background: transparent !important;
}

[data-theme="dark"] .subvention-detail-panel {
    min-width: 0 !important;
    flex: 1 !important;
}

[data-theme="dark"] .subvention-detail-content {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* === PANNEAU GAUCHE COMPLET === */
[data-theme="dark"] .subventions-liste-panel {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

/* === SECTION PROJETS === */
[data-theme="dark"] .subv-section-projets {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .subv-section-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-section-header h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-section-header h3 svg {
    stroke: var(--text-secondary) !important;
}

/* === RECHERCHE PROJETS === */
[data-theme="dark"] .subv-projets-search {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-projets-search input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-projets-search input::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .subv-projets-search .search-icon {
    stroke: var(--text-muted) !important;
}

/* === LISTE DES PROJETS === */
[data-theme="dark"] .subv-projets-liste {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .subv-projet-item {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-projet-item:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .subv-projet-item.selected,
[data-theme="dark"] .subv-projet-item.active {
    background: rgba(52, 152, 219, 0.15) !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .subv-projet-item .projet-nom,
[data-theme="dark"] .subv-projet-item span {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-projet-item .projet-actions button {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-projet-item .projet-actions button:hover {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

/* === SECTION DEMANDES DE SUBVENTIONS === */
[data-theme="dark"] .subv-section-demandes {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

/* === SUGGESTIONS IA === */
[data-theme="dark"] .subv-suggestions {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-suggestions-header {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .badge-suggestion {
    background: rgba(147, 51, 234, 0.2) !important;
    color: #C4B5FD !important;
}

[data-theme="dark"] .subv-suggestion-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-suggestion-item:hover {
    background: var(--bg-tertiary) !important;
}

/* === FILTRES === */
[data-theme="dark"] .subventions-filtres {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-filtres select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L2 4h8z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
}

/* === LISTE DEMANDES SCROLL === */
[data-theme="dark"] .subventions-liste-scroll {
    background: var(--card-bg) !important;
}

/* === ÉTAT VIDE === */
[data-theme="dark"] .subventions-empty-state {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .subventions-empty-state svg {
    stroke: var(--text-muted) !important;
}

[data-theme="dark"] .subventions-empty-state p {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subventions-empty-state span {
    color: var(--text-muted) !important;
}

/* === CARTE DEMANDE SUBVENTION (.subvention-item) === */
[data-theme="dark"] .subvention-item {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .subvention-item:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .subvention-item.active {
    background: rgba(52, 152, 219, 0.15) !important;
    border-color: var(--blue-ai) !important;
}

/* === CONTENU CARTE DEMANDE === */
[data-theme="dark"] .subv-item-main {
    background: transparent !important;
}

[data-theme="dark"] .subv-item-icon {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .subv-item-icon svg {
    stroke: var(--blue-ai) !important;
}

[data-theme="dark"] .subv-item-icon.statut-en_cours svg {
    stroke: #FBBF24 !important;
}

[data-theme="dark"] .subv-item-icon.statut-a_valider svg {
    stroke: #60A5FA !important;
}

[data-theme="dark"] .subv-item-icon.statut-acceptee svg {
    stroke: #34D399 !important;
}

[data-theme="dark"] .subv-item-content {
    background: transparent !important;
}

[data-theme="dark"] .subv-item-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-item-meta {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subv-item-date {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subv-item-date svg {
    stroke: var(--text-muted) !important;
}

/* === BADGES PROGRAMME (MITACS, CRSNG, etc.) === */
[data-theme="dark"] .subv-item-programme {
    background-image: none !important;
}

[data-theme="dark"] .subv-item-programme.mitacs {
    background: rgba(29, 78, 216, 0.3) !important;
    color: #93C5FD !important;
    border: 1px solid rgba(29, 78, 216, 0.5) !important;
}

[data-theme="dark"] .subv-item-programme.crsng {
    background: rgba(234, 88, 12, 0.3) !important;
    color: #FDBA74 !important;
    border: 1px solid rgba(234, 88, 12, 0.5) !important;
}

[data-theme="dark"] .subv-item-programme.frqnt,
[data-theme="dark"] .subv-item-programme.frq {
    background: rgba(147, 51, 234, 0.3) !important;
    color: #C4B5FD !important;
    border: 1px solid rgba(147, 51, 234, 0.5) !important;
}

[data-theme="dark"] .subv-item-programme.autre {
    background: rgba(100, 116, 139, 0.3) !important;
    color: #94A3B8 !important;
    border: 1px solid rgba(100, 116, 139, 0.5) !important;
}

/* === BADGES STATUT === */
[data-theme="dark"] .subv-item-badge {
    background-image: none !important;
}

[data-theme="dark"] .subv-item-badge.statut-brouillon {
    background: rgba(100, 116, 139, 0.2) !important;
    color: #94A3B8 !important;
    border: 1px solid rgba(100, 116, 139, 0.4) !important;
}

[data-theme="dark"] .subv-item-badge.statut-en_cours {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .subv-item-badge.statut-a_valider {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .subv-item-badge.statut-validee {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

[data-theme="dark"] .subv-item-badge.statut-soumise {
    background: rgba(147, 51, 234, 0.2) !important;
    color: #C4B5FD !important;
    border: 1px solid rgba(147, 51, 234, 0.4) !important;
}

[data-theme="dark"] .subv-item-badge.statut-acceptee {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

[data-theme="dark"] .subv-item-badge.statut-refusee {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #F87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

/* === BOUTON SUPPRIMER === */
[data-theme="dark"] .subv-item-delete {
    background: transparent !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .subv-item-delete:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #F87171 !important;
}

/* === BARRE DE PROGRESSION === */
[data-theme="dark"] .subv-item-progress {
    background: transparent !important;
}

[data-theme="dark"] .subv-progress-track {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .subv-progress-fill {
    background: linear-gradient(90deg, var(--red-ets) 0%, var(--green-success) 100%) !important;
}

[data-theme="dark"] .subv-progress-fill.statut-en_cours {
    background: linear-gradient(90deg, #F59E0B 0%, #FBBF24 100%) !important;
}

[data-theme="dark"] .subv-progress-fill.statut-a_valider {
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%) !important;
}

[data-theme="dark"] .subv-progress-fill.statut-acceptee {
    background: linear-gradient(90deg, #10B981 0%, #34D399 100%) !important;
}

[data-theme="dark"] .subv-progress-text {
    color: var(--text-secondary) !important;
}

/* === PANNEAU DETAIL DROIT === */
[data-theme="dark"] .subvention-detail-panel {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .subvention-detail-empty {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .subvention-detail-empty svg {
    stroke: var(--text-muted) !important;
}

[data-theme="dark"] .subvention-detail-empty h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subvention-detail-empty p {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .subvention-detail-content {
    background: var(--card-bg) !important;
}

/* === HEADER DETAIL === */
[data-theme="dark"] .subvention-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subvention-header-info h2 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subvention-meta {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .badge-projet {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .badge-programme {
    background: rgba(29, 78, 216, 0.2) !important;
    color: #93C5FD !important;
}

[data-theme="dark"] .badge-statut {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .progression-badge {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* === AGENT IA SELECTOR === */
[data-theme="dark"] .agent-ia-selector {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .agent-ia-selector select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === ONGLETS === */
[data-theme="dark"] .subvention-tabs {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subvention-tab {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subvention-tab:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subvention-tab.active {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--blue-ai) !important;
}

/* === CONTENU ONGLET === */
[data-theme="dark"] .subvention-tab-content {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .tab-pane {
    background: var(--card-bg) !important;
}

/* === INFORMATIONS GÉNÉRALES === */
[data-theme="dark"] .subv-info-section,
[data-theme="dark"] .form-section-subv {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-info-section h3,
[data-theme="dark"] .form-section-subv h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-info-section label,
[data-theme="dark"] .form-section-subv label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subv-info-section input,
[data-theme="dark"] .subv-info-section select,
[data-theme="dark"] .subv-info-section textarea,
[data-theme="dark"] .form-section-subv input,
[data-theme="dark"] .form-section-subv select,
[data-theme="dark"] .form-section-subv textarea {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === HEADER DE SUBVENTION DETAIL === */
[data-theme="dark"] .subvention-detail-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subvention-detail-title h3 {
    color: var(--text-primary) !important;
}

/* === FORMULAIRES (FORM-SUBV-SECTION, FORM-CARD) === */
[data-theme="dark"] .form-subv-section {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .form-subv-section h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .form-subv-section .section-description {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .form-card {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .form-card h4 {
    color: var(--text-primary) !important;
}

/* === FORM GROUPS ET INPUTS === */
[data-theme="dark"] .form-group label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--blue-ai) !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2) !important;
}

/* === SUBV FORM SECTION SPECIFIQUE === */
[data-theme="dark"] .subv-form-section {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-form-section h4 {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-form-row {
    background: transparent !important;
}

[data-theme="dark"] .subv-form-group label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subv-form-group input,
[data-theme="dark"] .subv-form-group select,
[data-theme="dark"] .subv-form-group textarea {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === LISTE PROFESSEURS/STAGIAIRES === */
[data-theme="dark"] .subv-profs-list {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

/* === SOUS-OBJECTIFS ET TACHES (Mode sombre) === */
[data-theme="dark"] .sous-objectifs-list {
    background: transparent !important;
}

[data-theme="dark"] .sous-objectif-item {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .sous-objectif-header input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .sous-objectif-header .btn-remove {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .sous-objectif-header .btn-remove:hover {
    background: var(--error) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .taches-list {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .tache-item {
    background: transparent !important;
}

[data-theme="dark"] .tache-item input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-add-tache {
    background: transparent !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .btn-add-tache:hover {
    border-color: var(--blue-ai) !important;
    color: var(--blue-ai) !important;
}

[data-theme="dark"] .btn-add-sous-objectif {
    background: transparent !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .btn-add-sous-objectif:hover {
    border-color: var(--blue-ai) !important;
    color: var(--blue-ai) !important;
}

/* === SECTION HEADERS === */
[data-theme="dark"] .section-header-with-btn {
    background: transparent !important;
}

[data-theme="dark"] .section-header-with-btn h4 {
    color: var(--text-primary) !important;
}

/* === LABELS TACHES === */
[data-theme="dark"] .taches-label,
[data-theme="dark"] .sous-objectif-label {
    color: var(--text-secondary) !important;
}

/* === CRSNG OBJECTIFS ET TACHES (Mode sombre) === */
[data-theme="dark"] .crsng-objectif-item {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .objectif-header {
    background: transparent !important;
}

[data-theme="dark"] .objectif-header input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .tache-badge {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .tache-header {
    background: transparent !important;
}

[data-theme="dark"] .tache-header input,
[data-theme="dark"] .tache-titre {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .taches-liste {
    background: transparent !important;
}

[data-theme="dark"] .methodo-objectif-section {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .methodo-objectif-section h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sous-objectif-taches {
    background: transparent !important;
}

[data-theme="dark"] .sous-objectif-taches strong {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .sous-objectif-numero {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .sous-objectif-titre {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-prof-tag {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .btn-add-prof {
    background: var(--bg-secondary) !important;
    border-color: var(--blue-ai) !important;
    color: var(--blue-ai) !important;
}

[data-theme="dark"] .btn-add-prof:hover {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .stagiaires-list {
    background: transparent !important;
}

[data-theme="dark"] .stagiaire-item {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* === QUILL EDITORS === */
[data-theme="dark"] .quill-editor,
[data-theme="dark"] .ql-container {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .ql-editor {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .ql-toolbar {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .ql-toolbar button,
[data-theme="dark"] .ql-toolbar .ql-picker {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .ql-toolbar button:hover,
[data-theme="dark"] .ql-toolbar .ql-picker:hover {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .ql-toolbar button svg,
[data-theme="dark"] .ql-toolbar .ql-stroke {
    stroke: var(--text-secondary) !important;
}

[data-theme="dark"] .ql-toolbar .ql-fill {
    fill: var(--text-secondary) !important;
}

/* === CHAR COUNTER === */
[data-theme="dark"] .char-info,
[data-theme="dark"] .char-counter,
[data-theme="dark"] .char-limit {
    color: var(--text-muted) !important;
}

/* === TAB PANES SUBVENTIONS === */
[data-theme="dark"] .subv-tab-pane {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .subv-tab-pane.active {
    background: var(--card-bg) !important;
}

/* === ITEMS PROJETS/SUBVENTIONS === */
[data-theme="dark"] .subvention-item {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .subvention-item:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .subvention-item.active {
    background: rgba(52, 152, 219, 0.15) !important;
    background-image: none !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .subvention-item-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subvention-item-info {
    color: var(--text-secondary) !important;
}

/* === PROJETS PANEL === */
[data-theme="dark"] .subv-section-projets {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-projet-item {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-projet-item:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
}

[data-theme="dark"] .subv-projet-item.selected {
    background: rgba(52, 152, 219, 0.15) !important;
    background-image: none !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .subv-projet-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-projet-meta {
    color: var(--text-secondary) !important;
}

/* === SECTIONS DEMANDES === */
[data-theme="dark"] .subv-section-demandes {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-demande-item {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-demande-item:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
}

[data-theme="dark"] .subv-demande-item.selected {
    background: rgba(52, 152, 219, 0.15) !important;
    background-image: none !important;
    border-color: var(--blue-ai) !important;
}

/* === BADGES PROGRAMMES COMPLET === */
[data-theme="dark"] .subv-item-programme {
    background-image: none !important;
}

[data-theme="dark"] .subv-item-programme.mitacs {
    background: rgba(29, 78, 216, 0.3) !important;
    background-image: none !important;
    color: #93C5FD !important;
    border: 1px solid rgba(29, 78, 216, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.crsng {
    background: rgba(234, 88, 12, 0.3) !important;
    background-image: none !important;
    color: #FDBA74 !important;
    border: 1px solid rgba(234, 88, 12, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.frqnt,
[data-theme="dark"] .subv-item-programme.frq {
    background: rgba(147, 51, 234, 0.3) !important;
    background-image: none !important;
    color: #C4B5FD !important;
    border: 1px solid rgba(147, 51, 234, 0.4) !important;
}

[data-theme="dark"] .subv-item-programme.autre {
    background: rgba(100, 116, 139, 0.3) !important;
    background-image: none !important;
    color: #94A3B8 !important;
    border: 1px solid rgba(100, 116, 139, 0.4) !important;
}

/* === FILTRES SELECTS === */
[data-theme="dark"] .subventions-filtres {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .subventions-filtres select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* ============================================ */
/* MODE SOMBRE - SUBVENTIONS STYLE COMPLET     */
/* Style identique au module Brevets           */
/* ============================================ */

/* === CONTAINER SUBVENTIONS === */
[data-theme="dark"] .view-subventions,
[data-theme="dark"] #view-subventions {
    background: var(--bg-primary) !important;
}

/* === SECTION PROJETS (panneau gauche haut) === */
[data-theme="dark"] .subventions-section-projets,
[data-theme="dark"] .subv-projets-section {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .subventions-section-projets:hover,
[data-theme="dark"] .subv-projets-section:hover {
    box-shadow: none !important;
    border-color: var(--border-color) !important;
}

/* === HEADER PROJETS === */
[data-theme="dark"] .subventions-projets-header,
[data-theme="dark"] .subv-projets-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-projets-header h3,
[data-theme="dark"] .subv-projets-header h3 {
    color: var(--text-primary) !important;
}

/* === RECHERCHE PROJETS === */
[data-theme="dark"] .subventions-projets-search,
[data-theme="dark"] .subv-search {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-projets-search input,
[data-theme="dark"] .subv-search input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-projets-search input::placeholder,
[data-theme="dark"] .subv-search input::placeholder {
    color: var(--text-muted) !important;
}

/* === LISTE DES PROJETS === */
[data-theme="dark"] .subventions-projets-liste,
[data-theme="dark"] .subv-projets-liste {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .subventions-projet-item,
[data-theme="dark"] .subv-projet-card {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .subventions-projet-item:hover,
[data-theme="dark"] .subv-projet-card:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .subventions-projet-item.selected,
[data-theme="dark"] .subv-projet-card.selected {
    background: rgba(52, 152, 219, 0.15) !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .subventions-projet-item .projet-titre,
[data-theme="dark"] .subv-projet-card .projet-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subventions-projet-item .projet-meta,
[data-theme="dark"] .subv-projet-card .projet-meta {
    color: var(--text-secondary) !important;
}

/* === ICONES ACTIONS PROJETS === */
[data-theme="dark"] .subventions-projet-item .projet-actions button,
[data-theme="dark"] .subv-projet-card .projet-actions button {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-projet-item .projet-actions button:hover,
[data-theme="dark"] .subv-projet-card .projet-actions button:hover {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

/* === SECTION DEMANDES DE SUBVENTIONS === */
[data-theme="dark"] .subventions-section-demandes,
[data-theme="dark"] .subv-demandes-section {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .subventions-demandes-header,
[data-theme="dark"] .subv-demandes-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-demandes-header h3,
[data-theme="dark"] .subv-demandes-header h3 {
    color: var(--text-primary) !important;
}

/* === BOUTON + NOUVELLE DEMANDE === */
[data-theme="dark"] .subventions-demandes-header .btn-add,
[data-theme="dark"] .subv-demandes-header .btn-add {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

/* === SECTION WRAPPERS SUBVENTIONS (fond blanc → sombre) === */
[data-theme="dark"] .subv-section-wrapper {
    background: var(--card-bg) !important;
    box-shadow: none !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .subv-section-wrapper .section-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-section-wrapper .section-header h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-section-wrapper .section-help {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-section-wrapper .editor-container {
    background: var(--input-bg) !important;
    border-color: var(--border-color) !important;
}

/* === EDITOR CONTAINERS SUBVENTIONS === */
[data-theme="dark"] .subv-tab-pane .editor-container {
    background: var(--input-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .editor-container textarea {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .editor-container textarea::placeholder {
    color: var(--text-muted) !important;
}

/* === SECTION HEADERS SUBVENTIONS === */
[data-theme="dark"] .subv-tab-pane .section-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .section-header h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-tab-pane .section-header p {
    color: var(--text-secondary) !important;
}

/* === RICH EDITOR ET TEXTAREAS === */
[data-theme="dark"] .subv-tab-pane textarea.rich-editor {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .rich-editor::placeholder {
    color: var(--text-muted) !important;
}

/* === QUILL EDITORS DANS SUBVENTIONS === */
[data-theme="dark"] .subv-tab-pane .quill-editor {
    background: var(--input-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .quill-editor .ql-toolbar {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .quill-editor .ql-container {
    background: var(--input-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .quill-editor .ql-editor {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
}

/* === STAGIAIRES LISTE === */
[data-theme="dark"] .stagiaires-liste,
[data-theme="dark"] #subv-stagiaires-liste {
    background: transparent !important;
}

[data-theme="dark"] .stagiaire-card,
[data-theme="dark"] .stagiaire-item {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .stagiaire-card input,
[data-theme="dark"] .stagiaire-card select,
[data-theme="dark"] .stagiaire-item input,
[data-theme="dark"] .stagiaire-item select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .stagiaire-card label,
[data-theme="dark"] .stagiaire-item label {
    color: var(--text-secondary) !important;
}

/* === REFERENCES ET METHODOLOGIE === */
[data-theme="dark"] .references-section,
[data-theme="dark"] .methodologie-section {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === PARTENAIRE FORM === */
[data-theme="dark"] .partenaire-form {
    background: transparent !important;
}

[data-theme="dark"] .partenaire-form input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .partenaire-form label {
    color: var(--text-secondary) !important;
}

/* === SOMMAIRE ET CONTEXTE === */
[data-theme="dark"] .sommaire-section,
[data-theme="dark"] .contexte-section {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === OBJECTIFS GENERAL === */
[data-theme="dark"] .objectifs-section {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === EASY MDE EDITORS DANS SUBVENTIONS === */
[data-theme="dark"] .subv-tab-pane .EasyMDEContainer {
    background: var(--input-bg) !important;
}

[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .editor-toolbar {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .editor-toolbar button {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .editor-toolbar button:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .CodeMirror {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .CodeMirror .CodeMirror-cursor {
    border-color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .editor-preview {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .editor-preview h1,
[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .editor-preview h2,
[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .editor-preview h3 {
    color: var(--blue-ai) !important;
}

[data-theme="dark"] .subv-tab-pane .EasyMDEContainer .editor-preview p {
    color: var(--text-primary) !important;
}

/* === FORMULAIRE GÉNÉRAL SUBVENTIONS === */
[data-theme="dark"] .subv-form-group {
    background: transparent !important;
}

[data-theme="dark"] .subv-form-group label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .subv-form-group input,
[data-theme="dark"] .subv-form-group select,
[data-theme="dark"] .subv-form-group textarea {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .subventions-demandes-header .btn-add:hover,
[data-theme="dark"] .subv-demandes-header .btn-add:hover {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

/* === FILTRES DEMANDES === */
[data-theme="dark"] .subventions-demandes-filtres,
[data-theme="dark"] .subv-demandes-filtres {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .subventions-demandes-filtres select,
[data-theme="dark"] .subv-demandes-filtres select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L2 4h8z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
}

/* === LISTE DES DEMANDES === */
[data-theme="dark"] .subventions-demandes-liste,
[data-theme="dark"] .subv-demandes-liste {
    background: var(--card-bg) !important;
}

/* === CARTE DEMANDE DE SUBVENTION === */
[data-theme="dark"] .subventions-demande-card,
[data-theme="dark"] .subv-demande-card {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .subventions-demande-card:hover,
[data-theme="dark"] .subv-demande-card:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .subventions-demande-card.selected,
[data-theme="dark"] .subv-demande-card.selected {
    background: rgba(52, 152, 219, 0.15) !important;
    border-color: var(--blue-ai) !important;
}

/* === ICONE CHECK DANS LA CARTE === */
[data-theme="dark"] .subventions-demande-card .demande-icon,
[data-theme="dark"] .subv-demande-card .demande-icon {
    background: var(--bg-tertiary) !important;
    color: var(--blue-ai) !important;
}

/* === BADGES STATUT COMPLET === */
[data-theme="dark"] .subv-badge,
[data-theme="dark"] .subventions-badge,
[data-theme="dark"] .demande-statut {
    background-image: none !important;
}

[data-theme="dark"] .subv-badge.a-valider,
[data-theme="dark"] .subventions-badge.a-valider,
[data-theme="dark"] .demande-statut.a-valider,
[data-theme="dark"] .badge-a-valider {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
}

[data-theme="dark"] .subv-badge.en-cours,
[data-theme="dark"] .subventions-badge.en-cours,
[data-theme="dark"] .demande-statut.en-cours,
[data-theme="dark"] .badge-en-cours {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .subv-badge.soumise,
[data-theme="dark"] .subventions-badge.soumise,
[data-theme="dark"] .demande-statut.soumise,
[data-theme="dark"] .badge-soumise {
    background: rgba(147, 51, 234, 0.2) !important;
    color: #C4B5FD !important;
    border: 1px solid rgba(147, 51, 234, 0.4) !important;
}

[data-theme="dark"] .subv-badge.acceptee,
[data-theme="dark"] .subventions-badge.acceptee,
[data-theme="dark"] .demande-statut.acceptee,
[data-theme="dark"] .badge-acceptee {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

[data-theme="dark"] .subv-badge.refusee,
[data-theme="dark"] .subventions-badge.refusee,
[data-theme="dark"] .demande-statut.refusee,
[data-theme="dark"] .badge-refusee {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #F87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

/* === BADGE PROGRAMME (MITACS, CRSNG, etc.) === */
[data-theme="dark"] .subv-programme-badge,
[data-theme="dark"] .demande-programme {
    background-image: none !important;
}

[data-theme="dark"] .subv-programme-badge.mitacs,
[data-theme="dark"] .demande-programme.mitacs {
    background: rgba(29, 78, 216, 0.3) !important;
    color: #93C5FD !important;
    border: 1px solid rgba(29, 78, 216, 0.5) !important;
}

[data-theme="dark"] .subv-programme-badge.crsng,
[data-theme="dark"] .demande-programme.crsng {
    background: rgba(234, 88, 12, 0.3) !important;
    color: #FDBA74 !important;
    border: 1px solid rgba(234, 88, 12, 0.5) !important;
}

[data-theme="dark"] .subv-programme-badge.frqnt,
[data-theme="dark"] .demande-programme.frqnt,
[data-theme="dark"] .subv-programme-badge.frq,
[data-theme="dark"] .demande-programme.frq {
    background: rgba(147, 51, 234, 0.3) !important;
    color: #C4B5FD !important;
    border: 1px solid rgba(147, 51, 234, 0.5) !important;
}

/* === DATE DE LA DEMANDE === */
[data-theme="dark"] .subventions-demande-card .demande-date,
[data-theme="dark"] .subv-demande-card .demande-date {
    color: var(--text-secondary) !important;
}

/* === BARRE DE PROGRESSION === */
[data-theme="dark"] .subventions-demande-card .progress-bar,
[data-theme="dark"] .subv-demande-card .progress-bar,
[data-theme="dark"] .subv-progress-bar {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .subventions-demande-card .progress-fill,
[data-theme="dark"] .subv-demande-card .progress-fill,
[data-theme="dark"] .subv-progress-fill {
    background: linear-gradient(90deg, var(--red-ets) 0%, var(--green-success) 100%) !important;
}

[data-theme="dark"] .subventions-demande-card .progress-text,
[data-theme="dark"] .subv-demande-card .progress-text,
[data-theme="dark"] .subv-progress-text {
    color: var(--text-secondary) !important;
}

/* === PANNEAU DETAIL VIDE (droite) === */
[data-theme="dark"] .subventions-detail-empty,
[data-theme="dark"] .subv-detail-empty {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .subventions-detail-empty h3,
[data-theme="dark"] .subv-detail-empty h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .subventions-detail-empty p,
[data-theme="dark"] .subv-detail-empty p {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .subventions-detail-empty svg,
[data-theme="dark"] .subv-detail-empty svg {
    stroke: var(--text-muted) !important;
    fill: none !important;
}

/* === ICONE $ GRAND (panneau vide) === */
[data-theme="dark"] .subventions-detail-empty .empty-icon,
[data-theme="dark"] .subv-detail-empty .empty-icon {
    color: var(--text-muted) !important;
    opacity: 0.3;
}

/* ============================================ */
/* MODE SOMBRE - MODULE BREVETS COMPLET FIX    */
/* ============================================ */

/* === CONTAINER BREVETS - Réduire les gaps === */
[data-theme="dark"] .brevets-container {
    background: var(--bg-primary) !important;
    gap: 0.25rem !important;
    padding: 0.25rem !important;
}

/* === PANNEAU PROJETS GAUCHE === */
[data-theme="dark"] .brevet-section-projets {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .brevet-section-projets:hover {
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

/* === HEADER SECTION PROJETS === */
[data-theme="dark"] .brevet-section-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-section-header::before {
    display: none !important;
}

[data-theme="dark"] .brevet-section-header h3 {
    color: var(--text-primary) !important;
}

/* === RECHERCHE PROJETS === */
[data-theme="dark"] .brevet-projets-search {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .brevet-projets-search input {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-projets-search input::placeholder {
    color: var(--text-muted) !important;
}

/* === LISTE PROJETS === */
[data-theme="dark"] .brevet-projets-liste {
    background: var(--card-bg) !important;
}

/* === ITEMS PROJETS (Projet BP, Projet Patch, etc.) === */
[data-theme="dark"] .brevet-projet-item {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .brevet-projet-item:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .brevet-projet-item.selected {
    background: rgba(52, 152, 219, 0.15) !important;
    background-image: none !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .brevet-projet-item .projet-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-projet-item .projet-meta,
[data-theme="dark"] .brevet-projet-item .projet-indicators {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .brevet-projet-item .projet-etat {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .brevet-projet-item .projet-trl {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* === BARRE DE REALISATION === */
[data-theme="dark"] .brevet-projet-item .realisation-bar {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .brevet-projet-item .realisation-label {
    color: var(--text-muted) !important;
}

/* === SECTION DEMANDES DE BREVETS === */
[data-theme="dark"] .brevet-section-demandes {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .brevet-section-demandes:hover {
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

/* === SELECT DANS DEMANDES === */
[data-theme="dark"] .brevet-section-demandes select,
[data-theme="dark"] .brevet-demandes-filtre select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === LISTE DEMANDES === */
[data-theme="dark"] .brevet-demandes-liste {
    background: var(--card-bg) !important;
}

/* === ITEMS DEMANDES (Brevet Vetement..., Brevet Projet BP) === */
[data-theme="dark"] .brevet-demande-item,
[data-theme="dark"] .brevet-demande-card {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .brevet-demande-item:hover,
[data-theme="dark"] .brevet-demande-card:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .brevet-demande-item.selected,
[data-theme="dark"] .brevet-demande-card.selected {
    background: rgba(52, 152, 219, 0.15) !important;
    background-image: none !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .brevet-demande-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-demande-meta {
    color: var(--text-secondary) !important;
}

/* === PANNEAU PRINCIPAL DROIT === */
[data-theme="dark"] .brevet-main-panel {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* === HEADER BREVET === */
[data-theme="dark"] .brevet-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-projet-info h2 {
    color: var(--text-primary) !important;
}

/* === WORKFLOW STEPS (Cartes 1, 2, 3, 4) === */
[data-theme="dark"] .brevet-workflow-steps {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-step {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-step:hover:not(.disabled) {
    background: var(--bg-tertiary) !important;
    border-color: var(--blue-accent) !important;
}

[data-theme="dark"] .brevet-step.active {
    background: rgba(14, 165, 233, 0.15) !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .brevet-step.completed {
    background: rgba(14, 165, 233, 0.1) !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .brevet-step.disabled {
    background: var(--bg-secondary) !important;
    opacity: 0.5;
}

[data-theme="dark"] .brevet-step .step-num {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .brevet-step.active .step-num,
[data-theme="dark"] .brevet-step.completed .step-num {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .brevet-step .step-content h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-step .step-desc,
[data-theme="dark"] .brevet-step .step-info p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .brevet-step:not(:last-child)::after {
    background: var(--border-color) !important;
}

[data-theme="dark"] .brevet-step.completed:not(:last-child)::after {
    background: var(--blue-ai) !important;
}

/* === ZONE RESULTATS ETAPES === */
[data-theme="dark"] .step-result {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .step-result.positive {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34D399 !important;
}

[data-theme="dark"] .step-result.negative {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #F87171 !important;
}

[data-theme="dark"] .step-result.neutral {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #FBBF24 !important;
}

/* === ZONE CONTENU BREVET === */
[data-theme="dark"] .brevet-content-area {
    background: var(--card-bg) !important;
}

/* === ZONE SCORE FIXE (avec inline styles) === */
[data-theme="dark"] .brevet-score-fixed {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-score-fixed[style*="background"] {
    background: var(--card-bg) !important;
}

/* === CARTE DE SCORE === */
[data-theme="dark"] .brevet-score-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .score-loading {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .score-agents-progress {
    color: var(--text-muted) !important;
}

/* === RESULTATS ETUDE === */
[data-theme="dark"] .etude-result {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .etude-result.positive {
    background: rgba(16, 185, 129, 0.15) !important;
}

[data-theme="dark"] .etude-result.neutral {
    background: rgba(245, 158, 11, 0.15) !important;
}

[data-theme="dark"] .etude-result.negative {
    background: rgba(239, 68, 68, 0.15) !important;
}

[data-theme="dark"] .verdict-text h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .verdict-text p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .etude-section h5 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .etude-section ul,
[data-theme="dark"] .etude-section li {
    color: var(--text-secondary) !important;
}

/* === RESUME ETAPES === */
[data-theme="dark"] .brevet-etapes-resume {
    background: var(--card-bg) !important;
}

/* === ZONE SPLIT === */
[data-theme="dark"] .brevet-split-container {
    background: var(--bg-primary) !important;
}

[data-theme="dark"] .brevet-split-top {
    background: var(--card-bg) !important;
}

/* === EDITEUR DRAFT === */
[data-theme="dark"] .brevet-draft-editor,
[data-theme="dark"] #brevet-draft-editor {
    background: var(--card-bg) !important;
}

/* === EMPTY STATE === */
[data-theme="dark"] .brevet-empty-state {
    background: var(--card-bg) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .brevet-empty-state h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-empty-state p {
    color: var(--text-secondary) !important;
}

/* === WORKFLOW PREVIEW (petit) === */
[data-theme="dark"] .brevet-workflow-preview {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevet-workflow-preview .workflow-step {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .brevet-workflow-preview .step-number {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .brevet-workflow-preview .step-label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-workflow-preview .workflow-arrow {
    color: var(--text-muted) !important;
}

/* === BADGE STATUT REDACTION === */
[data-theme="dark"] .badge-redaction,
[data-theme="dark"] .brevet-badge-redaction {
    background: rgba(234, 88, 12, 0.2) !important;
    color: #FDBA74 !important;
}

[data-theme="dark"] .badge-nouveau {
    background: rgba(100, 116, 139, 0.2) !important;
    color: #94A3B8 !important;
}

/* === INLINE STYLE OVERRIDES === */
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"] {
    background: var(--card-bg) !important;
}

[data-theme="dark"] [style*="border-bottom: 1px solid #e5e7eb"] {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] [style*="color: #6b7280"] {
    color: var(--text-secondary) !important;
}

/* ============================================ */
/* MODE SOMBRE - DEMANDES DE BREVETS FIX       */
/* ============================================ */

/* === FILTRES BREVETS === */
[data-theme="dark"] .brevets-filtres {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevets-filtres select {
    background-color: var(--input-bg) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .brevets-filtres select:focus {
    border-color: var(--blue-ai) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    background-color: var(--input-bg) !important;
}

/* === LISTE BREVETS === */
[data-theme="dark"] .brevets-liste {
    background: var(--card-bg) !important;
}

/* === ITEMS BREVETS (Brevet Vetement, Brevet Projet BP) === */
[data-theme="dark"] .brevet-item {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .brevet-item:hover {
    background: var(--bg-tertiary) !important;
    background-image: none !important;
    border-color: var(--blue-accent) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15) !important;
}

[data-theme="dark"] .brevet-item.selected {
    background: rgba(59, 130, 246, 0.15) !important;
    background-image: none !important;
    border-color: var(--blue-ai) !important;
}

[data-theme="dark"] .brevet-item-titre {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-item-meta {
    color: var(--text-secondary) !important;
}

/* === BADGES DE STATUT === */
[data-theme="dark"] .brevet-item-badge {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .brevet-item-badge.etude {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #93C5FD !important;
}

[data-theme="dark"] .brevet-item-badge.anteriorite {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #FCD34D !important;
}

[data-theme="dark"] .brevet-item-badge.redaction {
    background: rgba(234, 88, 12, 0.2) !important;
    color: #FDBA74 !important;
}

[data-theme="dark"] .brevet-item-badge.revision {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #C4B5FD !important;
}

[data-theme="dark"] .brevet-item-badge.depose {
    background: rgba(6, 182, 212, 0.2) !important;
    color: #67E8F9 !important;
}

[data-theme="dark"] .brevet-item-badge.accorde {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6EE7B7 !important;
}

[data-theme="dark"] .brevet-item-badge.refuse {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #FCA5A5 !important;
}

/* === BOUTON SUPPRESSION === */
[data-theme="dark"] .btn-icon-delete {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .btn-icon-delete:hover {
    color: #F87171 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* === EMPTY STATE === */
[data-theme="dark"] .brevets-liste .empty-state {
    background: var(--card-bg) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .brevets-liste .empty-state svg {
    stroke: var(--text-muted) !important;
}

[data-theme="dark"] .brevets-liste .empty-state p {
    color: var(--text-secondary) !important;
}

/* ============================================ */
/* MODE SOMBRE - EDITEUR DRAFT BREVET          */
/* ============================================ */

/* === ZONE EDITEUR DRAFT === */
[data-theme="dark"] .brevet-draft-editor-zone {
    background: var(--card-bg) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3) !important;
}

/* === HEADER EDITEUR === */
[data-theme="dark"] .draft-editor-header {
    background: var(--bg-secondary) !important;
    background-image: none !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .draft-editor-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .draft-editor-title svg {
    color: var(--blue-ai) !important;
}

/* === TOOLBAR === */
[data-theme="dark"] .draft-toolbar {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .toolbar-group {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .toolbar-btn {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .toolbar-btn:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .toolbar-btn.active {
    background: var(--blue-ai) !important;
    color: var(--text-inverse) !important;
}

[data-theme="dark"] .toolbar-select {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

/* === CONTENU EDITEUR === */
[data-theme="dark"] .draft-editor-content {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .draft-editor-textarea {
    background: transparent !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .draft-rich-editor {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .draft-rich-editor h1,
[data-theme="dark"] .draft-rich-editor h2 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .draft-rich-editor p {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .draft-rich-editor:empty::before {
    color: var(--text-muted) !important;
}

/* === FOOTER EDITEUR (3506 mots) === */
[data-theme="dark"] .draft-editor-footer {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .draft-word-count {
    color: var(--text-secondary) !important;
}

/* === SPLITTER === */
[data-theme="dark"] .brevet-splitter {
    background: linear-gradient(to bottom, var(--bg-secondary), var(--border-color)) !important;
}

[data-theme="dark"] .brevet-split-top {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .brevet-split-bottom {
    background: var(--card-bg) !important;
}

/* === ZONE ABREGE (avec styles inline) === */
[data-theme="dark"] .draft-rich-editor div[style*="background: #f9f9f9"],
[data-theme="dark"] .draft-rich-editor div[style*="background:#f9f9f9"],
[data-theme="dark"] #draft-editor-text div[style*="background: #f9f9f9"],
[data-theme="dark"] #draft-editor-text div[style*="background:#f9f9f9"] {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Override inline styles génériques */
[data-theme="dark"] #draft-editor-text [style*="background: #f9f9f9"] {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] #draft-editor-text [style*="border: 1px solid #ccc"] {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] #draft-editor-text [style*="background: #e0e0e0"] {
    background: var(--bg-tertiary) !important;
}

/* === PREVIEW DRAFT === */
[data-theme="dark"] .brevet-draft-preview {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-draft-preview h1,
[data-theme="dark"] .brevet-draft-preview h2 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .brevet-draft-preview p {
    color: var(--text-primary) !important;
}

/* === CARDS DRAFT BREVET (ETUDE, ANTERIORITE, POTENTIEL) === */
.brevet-draft-etude-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}
.brevet-draft-anteriorite-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
}
.brevet-draft-potentiel-card {
    background: #fef3c7;
    color: #92400e;
}
.brevet-draft-potentiel-card h2 {
    color: #92400e;
}

[data-theme="dark"] .brevet-draft-etude-card {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .brevet-draft-etude-card h3 {
    color: #6ee7b7 !important;
}
[data-theme="dark"] .brevet-draft-anteriorite-card {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .brevet-draft-anteriorite-card h3 {
    color: #fcd34d !important;
}
[data-theme="dark"] .brevet-draft-potentiel-card {
    background: rgba(30, 30, 40, 0.95) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .brevet-draft-potentiel-card h2,
[data-theme="dark"] .brevet-draft-potentiel-card h3 {
    color: #fcd34d !important;
}
[data-theme="dark"] .brevet-draft-potentiel-card p,
[data-theme="dark"] .brevet-draft-potentiel-card li,
[data-theme="dark"] .brevet-draft-potentiel-card span,
[data-theme="dark"] .brevet-draft-potentiel-card td,
[data-theme="dark"] .brevet-draft-potentiel-card th {
    color: var(--text-primary) !important;
}

/* === VARIABLES DARK MODE BREVETS (sections info) === */
[data-theme="dark"] {
    --brevet-info-bg: rgba(59, 130, 246, 0.1);
    --brevet-info-title: #93c5fd;
    --brevet-badge-bg: rgba(59, 130, 246, 0.2);
    --brevet-reco-bg: rgba(16, 185, 129, 0.1);
    --brevet-risk-bg: rgba(239, 68, 68, 0.1);
}

/* === SELECTION DE TEXTE EN SURBRILLANCE === */
[data-theme="dark"] #draft-editor-text ::selection {
    background: rgba(59, 130, 246, 0.4) !important;
    color: var(--text-inverse) !important;
}

/* Texte rouge (pour les corrections) */
[data-theme="dark"] #draft-editor-text [style*="color: red"],
[data-theme="dark"] #draft-editor-text [style*="color:red"] {
    color: #FCA5A5 !important;
}

/* === SECTION MOTS-CLES === */
/* Conteneur des mots-clés (background: #f0f0f0) */
[data-theme="dark"] #draft-editor-text p[style*="background: #f0f0f0"],
[data-theme="dark"] #draft-editor-text p[style*="background:#f0f0f0"],
[data-theme="dark"] #draft-editor-text [style*="background: #f0f0f0"],
[data-theme="dark"] #draft-editor-text [style*="background:#f0f0f0"] {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Tags mots-clés individuels (background: #e0e0e0) - Style rouge ETS */
[data-theme="dark"] #draft-editor-text span[style*="background: #e0e0e0"],
[data-theme="dark"] #draft-editor-text span[style*="background:#e0e0e0"],
[data-theme="dark"] #draft-editor-text [style*="background: #e0e0e0"],
[data-theme="dark"] #draft-editor-text [style*="background:#e0e0e0"] {
    background: var(--red-ets) !important;
    color: var(--text-inverse) !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 6px 14px !important;
    font-weight: 500 !important;
}

/* Override générique pour tous les éléments avec fond gris clair */
[data-theme="dark"] .draft-rich-editor [style*="background: #f0f0f0"],
[data-theme="dark"] .draft-rich-editor [style*="background:#f0f0f0"] {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .draft-rich-editor [style*="background: #e0e0e0"],
[data-theme="dark"] .draft-rich-editor [style*="background:#e0e0e0"] {
    background: var(--red-ets) !important;
    color: var(--text-inverse) !important;
    border-radius: 20px !important;
}

/* ============================================
   ÉTUDE DE BREVETABILITÉ - RÉSUMÉ
   Vert intense avec texte blanc en mode sombre
   ============================================ */

/* Section avec verdict positif (vert clair -> vert intense) */
[data-theme="dark"] .brevet-resume-section[style*="background: #f0fdf4"],
[data-theme="dark"] .brevet-resume-section[style*="background:#f0fdf4"] {
    background: #16a34a !important;
    border: 1px solid #22c55e !important;
}

/* Section avec verdict négatif (rouge clair -> rouge intense) */
[data-theme="dark"] .brevet-resume-section[style*="background: #fef2f2"],
[data-theme="dark"] .brevet-resume-section[style*="background:#fef2f2"] {
    background: #dc2626 !important;
    border: 1px solid #ef4444 !important;
}

/* Section avec verdict neutre (gris clair -> gris foncé) */
[data-theme="dark"] .brevet-resume-section[style*="background: #f9fafb"],
[data-theme="dark"] .brevet-resume-section[style*="background:#f9fafb"] {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Texte blanc pour toutes les sections resume */
[data-theme="dark"] .brevet-resume-section h4,
[data-theme="dark"] .brevet-resume-section p,
[data-theme="dark"] .brevet-resume-section strong,
[data-theme="dark"] .brevet-resume-section span {
    color: var(--text-inverse) !important;
}

/* Override des couleurs de texte inline */
[data-theme="dark"] .brevet-resume-section [style*="color: #16a34a"],
[data-theme="dark"] .brevet-resume-section [style*="color:#16a34a"],
[data-theme="dark"] .brevet-resume-section [style*="color: #dc2626"],
[data-theme="dark"] .brevet-resume-section [style*="color:#dc2626"],
[data-theme="dark"] .brevet-resume-section [style*="color: #374151"],
[data-theme="dark"] .brevet-resume-section [style*="color:#374151"] {
    color: var(--text-inverse) !important;
}

/* ============================================
   PAGE D'ACCUEIL - WELCOME SCREEN
   ============================================ */

#view-welcome {
    display: none;
}

#view-welcome.active {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.welcome-container {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--grey-50) 0%, var(--grey-100) 100%);
    position: relative;
}

.welcome-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.welcome-image {
    display: none !important;
}

/* Mode clair: cacher les images */
.welcome-light {
    display: none !important;
}

.welcome-dark {
    display: none !important;
}

/* Mode sombre: cacher les images aussi */
[data-theme="dark"] .welcome-light {
    display: none !important;
}

[data-theme="dark"] .welcome-dark {
    display: none !important;
}

.welcome-overlay {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(255, 255, 255, 0.6) 100%
    );
    backdrop-filter: blur(2px);
}

[data-theme="dark"] .welcome-overlay {
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.85) 0%,
        rgba(15, 23, 42, 0.75) 50%,
        rgba(15, 23, 42, 0.65) 100%
    );
}

.welcome-text {
    text-align: center;
    padding: 3rem;
    max-width: 800px;
    animation: welcomeFadeIn 1s ease-out;
}

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

.welcome-title {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.welcome-title-main {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red-ets) 0%, var(--blue-ai) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(226, 35, 26, 0.2);
    animation: welcomeTitlePulse 3s ease-in-out infinite;
}

@keyframes welcomeTitlePulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.1);
    }
}

.welcome-title-sub {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--grey-600);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

[data-theme="dark"] .welcome-title-sub {
    color: var(--grey-400);
}

.welcome-description {
    font-size: 1.25rem;
    color: var(--grey-600);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

[data-theme="dark"] .welcome-description {
    color: var(--grey-300);
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.welcome-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: welcomeFeatureSlide 0.8s ease-out backwards;
}

.welcome-feature:nth-child(1) { animation-delay: 0.2s; }
.welcome-feature:nth-child(2) { animation-delay: 0.3s; }
.welcome-feature:nth-child(3) { animation-delay: 0.4s; }
.welcome-feature:nth-child(4) { animation-delay: 0.5s; }

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

.welcome-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .welcome-feature {
    background: rgba(51, 65, 85, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.welcome-feature svg {
    color: var(--red-ets);
    flex-shrink: 0;
}

[data-theme="dark"] .welcome-feature svg {
    color: #fb923c;
    filter: drop-shadow(0 0 3px rgba(251, 146, 60, 0.4));
}

.welcome-feature span {
    font-weight: 500;
    color: var(--grey-700);
    white-space: nowrap;
}

[data-theme="dark"] .welcome-feature span {
    color: #f8fafc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.welcome-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.welcome-btn {
    padding: 1rem 2rem !important;
    font-size: 1.1rem !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease !important;
    animation: welcomeBtnPop 0.6s ease-out 0.7s backwards;
}

@keyframes welcomeBtnPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.welcome-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.welcome-btn.btn-primary {
    background: linear-gradient(135deg, var(--red-ets) 0%, var(--red-dark) 100%);
}

.welcome-btn.btn-secondary {
    background: linear-gradient(135deg, var(--blue-ai) 0%, var(--blue-accent) 100%);
    border-color: var(--blue-ai);
}

[data-theme="dark"] .welcome-btn.btn-secondary {
    background: linear-gradient(135deg, var(--blue-accent) 0%, var(--blue-light) 100%);
}

/* Stats en bas */
.welcome-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding: 2rem;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.03) 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0; /* Ne pas rétrécir */
}

[data-theme="dark"] .welcome-stats {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .welcome-stat .stat-number {
    color: #f1f5f9;
}

[data-theme="dark"] .welcome-stat .stat-label {
    color: #94a3b8;
}

.welcome-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    animation: welcomeStatCount 1s ease-out 1s backwards;
}

@keyframes welcomeStatCount {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red-ets) 0%, var(--blue-ai) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

[data-theme="dark"] .stat-label {
    color: var(--grey-400);
}

/* Welcome tagline */
.welcome-tagline {
    font-size: 1rem;
    color: var(--grey-500);
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

[data-theme="dark"] .welcome-tagline {
    color: #94a3b8;
}

/* Demo section */
.welcome-demo {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .welcome-demo {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* ===========================================
   MODE SOMBRE AMELIORE - PAGE D'ACCUEIL
   Plus vibrant, plus visible - Palette ROUGE
   =========================================== */

/* Background plus riche avec gradient subtil */
[data-theme="dark"] .welcome-container {
    background: linear-gradient(
        145deg,
        #0f172a 0%,
        #1e293b 35%,
        #1a2744 70%,
        #0f172a 100%
    );
}

/* Overlay moins opaque pour plus de luminosite */
[data-theme="dark"] .welcome-overlay {
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.7) 0%,
        rgba(30, 41, 59, 0.6) 50%,
        rgba(15, 23, 42, 0.65) 100%
    );
    backdrop-filter: blur(1px);
}

/* Titre principal plus vibrant avec glow ROUGE */
[data-theme="dark"] .welcome-title-main {
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 40%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.4));
    animation: darkTitleGlow 3s ease-in-out infinite;
}

@keyframes darkTitleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.6));
    }
}

/* Sous-titre plus visible */
[data-theme="dark"] .welcome-title-sub {
    color: #cbd5e1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.15em;
}

/* Description plus lisible */
[data-theme="dark"] .welcome-description {
    color: #e2e8f0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Feature pills vibrantes avec bordures ROUGES */
[data-theme="dark"] .welcome-feature {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.9) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(239, 68, 68, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

[data-theme="dark"] .welcome-feature:hover {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(239, 68, 68, 0.15);
    transform: translateY(-3px);
}

/* Alternance ROUGE et BLEU pour les features */
[data-theme="dark"] .welcome-feature:nth-child(1) {
    border-color: rgba(248, 113, 113, 0.4);
}
[data-theme="dark"] .welcome-feature:nth-child(1) svg {
    color: #f87171;
    filter: drop-shadow(0 0 6px rgba(248, 113, 113, 0.5));
}

[data-theme="dark"] .welcome-feature:nth-child(2) {
    border-color: rgba(59, 130, 246, 0.4);
}
[data-theme="dark"] .welcome-feature:nth-child(2) svg {
    color: #3b82f6;
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.5));
}

[data-theme="dark"] .welcome-feature:nth-child(3) {
    border-color: rgba(239, 68, 68, 0.4);
}
[data-theme="dark"] .welcome-feature:nth-child(3) svg {
    color: #ef4444;
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}

[data-theme="dark"] .welcome-feature:nth-child(4) {
    border-color: rgba(96, 165, 250, 0.4);
}
[data-theme="dark"] .welcome-feature:nth-child(4) svg {
    color: #60a5fa;
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.5));
}

/* Texte des features plus visible */
[data-theme="dark"] .welcome-feature span {
    color: #f8fafc;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Boutons plus vibrants */
[data-theme="dark"] .welcome-btn.btn-primary {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
    box-shadow:
        0 4px 20px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .welcome-btn.btn-primary:hover {
    box-shadow:
        0 8px 30px rgba(239, 68, 68, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .welcome-btn.btn-secondary {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 50%, #1d4ed8 100%);
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow:
        0 4px 20px rgba(30, 64, 175, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .welcome-btn.btn-secondary:hover {
    box-shadow:
        0 8px 30px rgba(30, 64, 175, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(59, 130, 246, 0.7);
}

/* Section stats plus visible */
[data-theme="dark"] .welcome-stats {
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(30, 41, 59, 0.98) 50%,
        rgba(15, 23, 42, 1) 100%
    );
    border-top: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}

/* Numeros des stats avec gradient ROUGE */
[data-theme="dark"] .welcome-stat .stat-number {
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 50%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(239, 68, 68, 0.3));
}

/* Labels des stats plus lisibles */
[data-theme="dark"] .welcome-stat .stat-label {
    color: #cbd5e1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Tagline plus visible en ROUGE */
[data-theme="dark"] .welcome-tagline {
    color: #f87171;
    text-shadow: 0 2px 8px rgba(248, 113, 113, 0.2);
}

.demo-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--grey-700);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--red-ets);
}

[data-theme="dark"] .demo-title {
    color: #f1f5f9;
    border-bottom-color: #fb923c;
}

.demo-title svg {
    color: var(--red-ets);
}

[data-theme="dark"] .demo-title svg {
    color: #fbbf24;
}

.demo-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.demo-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.demo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .demo-card {
    background: rgba(51, 65, 85, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.demo-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: white;
}

.demo-subvention .demo-card-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.demo-brevet .demo-card-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.demo-matching .demo-card-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.demo-card-content {
    padding: 1.25rem;
}

.demo-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .demo-score {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red-ets) 0%, var(--blue-ai) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.demo-subvention .score-value {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.demo-brevet .score-value {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.demo-matching .score-value {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.score-label {
    font-size: 0.85rem;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

[data-theme="dark"] .score-label {
    color: #94a3b8;
}

.demo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.demo-list li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--grey-600);
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.demo-list li:last-child {
    border-bottom: none;
}

[data-theme="dark"] .demo-list li {
    color: #cbd5e1;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.demo-list strong {
    color: var(--grey-700);
    font-weight: 600;
}

[data-theme="dark"] .demo-list strong {
    color: #f1f5f9;
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-title-main {
        font-size: 2.5rem;
    }
    
    .welcome-title-sub {
        font-size: 1rem;
    }
    
    .welcome-description {
        font-size: 1rem;
    }
    
    .welcome-features {
        gap: 1rem;
    }
    
    .welcome-feature {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .welcome-stats {
        gap: 2rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }
}

/* =============================================
   WIDGET QUOTAS / LICENCES
   ============================================= */

.welcome-quotas {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    flex-shrink: 0; /* Ne pas rétrécir */
}

[data-theme="dark"] .welcome-quotas {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

.quotas-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.quotas-title svg {
    flex-shrink: 0;
}

.quotas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.quota-item {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quota-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .quota-item {
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.quota-item-label {
    font-size: 0.75rem;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.quota-item-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.quota-item-detail {
    font-size: 0.7rem;
    color: var(--grey-500);
    margin-top: 0.25rem;
}

/* Couleurs selon le niveau de quota */
.quota-item.quota-ok .quota-item-value {
    color: var(--success);
}

.quota-item.quota-warning .quota-item-value {
    color: var(--warning);
}

.quota-item.quota-danger .quota-item-value {
    color: var(--danger);
}

.quota-item.quota-unlimited .quota-item-value {
    color: var(--primary);
}

/* Barre de progression */
.quota-progress {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.quota-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.quota-ok .quota-progress-bar {
    background: var(--success);
}

.quota-warning .quota-progress-bar {
    background: var(--warning);
}

.quota-danger .quota-progress-bar {
    background: var(--danger);
}

@media (max-width: 768px) {
    .quotas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================
   MODAL GESTION UTILISATEURS (Stylisé)
   ============================================= */

.user-modal-content {
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.user-modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0d9488 50%, #059669 100%);
    color: white;
    padding: 1.5rem 1.75rem;
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}

.user-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.user-modal-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.user-modal-title svg {
    width: 32px;
    height: 32px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.user-modal-title h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-modal-header .modal-close {
    color: white;
    opacity: 0.8;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.user-modal-header .modal-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.user-modal-body {
    padding: 0;
    background: var(--bg-primary);
}

/* Sections du formulaire */
.user-form-section {
    border-bottom: 1px solid var(--border);
}

.user-form-section:last-of-type {
    border-bottom: none;
}

.user-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    background: linear-gradient(90deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

.user-section-header svg {
    color: var(--primary);
    opacity: 0.8;
}

.user-section-header.user-section-access {
    color: #059669;
    border-left-color: #059669;
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.08) 0%, var(--bg-primary) 100%);
}

.user-section-header.user-section-access svg {
    color: #059669;
}

.user-section-header.user-section-quotas {
    color: #7c3aed;
    border-left-color: #7c3aed;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.08) 0%, var(--bg-primary) 100%);
}

.section-hint {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--grey);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.user-form-content {
    padding: 1.5rem 1.75rem;
}

/* Styled form inputs for user modal */
.user-form-content .form-group input,
.user-form-content .form-group select {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.user-form-content .form-group input:focus,
.user-form-content .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: var(--bg-primary);
    outline: none;
}

.user-form-content .form-group input::placeholder {
    color: var(--grey-400);
}

.user-form-content .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--grey);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-form-content .form-group {
    margin-bottom: 1rem;
}

/* Form rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Toggle switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
    padding: 0.875rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border);
    transition: all 0.2s ease;
    position: relative;
}

.toggle-switch:hover {
    border-color: var(--primary-light);
    background: var(--bg-tertiary);
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.toggle-slider {
    display: inline-block;
    width: 52px;
    height: 28px;
    min-width: 52px;
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    border-radius: 14px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    vertical-align: middle;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.toggle-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Checkbox styled container */
.checkbox-styled {
    margin-top: 0.75rem;
}

/* Access cards */
.access-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 650px) {
    .access-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.access-card {
    cursor: pointer;
    display: block;
}

.access-card input {
    display: none;
}

.access-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.access-card-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.3s ease;
}

.access-card-content svg {
    color: var(--grey);
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.access-card-content:hover {
    border-color: var(--primary-light);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -10px rgba(102, 126, 234, 0.3);
}

.access-card-content:hover svg {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.15);
}

.access-card input:checked + .access-card-content {
    border-color: #10b981;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -10px rgba(16, 185, 129, 0.4);
}

.access-card input:checked + .access-card-content::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.access-card input:checked + .access-card-content svg {
    color: white;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.access-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.access-subtitle {
    font-size: 0.7rem;
    color: var(--grey);
    line-height: 1.3;
    max-width: 100px;
}

/* Section Universites autorisees */
.user-section-universites {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 3px solid #667eea;
}

.universites-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 8px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.universites-info svg {
    flex-shrink: 0;
    color: #667eea;
}

.universites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.universite-card {
    cursor: pointer;
    display: block;
}

.universite-card input {
    display: none;
}

.universite-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 60px;
    justify-content: center;
}

.universite-card-content:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.universite-card.selected .universite-card-content,
.universite-card input:checked + .universite-card-content {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.12);
}

.universite-nom {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.universite-full {
    font-size: 0.7rem;
    color: var(--grey);
    line-height: 1.2;
}

.universites-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.universites-actions .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.btn-icon-sm {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    color: var(--grey);
    transition: all 0.2s ease;
    margin-left: auto;
}

.btn-icon-sm:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.no-universites {
    text-align: center;
    padding: 2rem;
    color: var(--grey);
}

.no-universites p {
    margin-bottom: 1rem;
}

/* Quotas grid form */
.quotas-grid-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 550px) {
    .quotas-grid-form {
        grid-template-columns: repeat(2, 1fr);
    }
}

.quota-input-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    transition: border-color 0.2s ease;
}

.quota-input-group:hover {
    border-color: var(--primary-light);
}

.quota-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.quota-input-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.4rem;
}

.quota-input-group label svg {
    flex-shrink: 0;
}

.quota-input-group input[type="number"] {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0;
    text-align: center;
}

.quota-input-group input[type="number"]:focus {
    outline: none;
}

/* Usage display card */
.usage-display-card {
    margin-top: 1.25rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    display: none;
}

.usage-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.usage-stats-grid > div {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.usage-stats-grid strong {
    color: var(--text-primary);
}

.btn-reset-usage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    background: white;
    border: 1px solid var(--border);
    color: var(--grey-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-usage:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Modal actions */
.user-modal-actions {
    padding: 1.5rem 1.75rem;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-top: 1px solid var(--border);
    border-radius: 0 0 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.user-modal-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.user-modal-actions .btn-secondary {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    color: var(--text-secondary);
}

.user-modal-actions .btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--grey);
}

.user-modal-actions .btn-primary {
    background: linear-gradient(135deg, #14b8a6 0%, #059669 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.user-modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, #0d9488 0%, #047857 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
}

/* Dark mode adaptations */
[data-theme="dark"] .user-modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0d9488 50%, #059669 100%);
}

[data-theme="dark"] .user-section-header {
    background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

[data-theme="dark"] .user-form-content .form-group input,
[data-theme="dark"] .user-form-content .form-group select {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

[data-theme="dark"] .toggle-switch {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

[data-theme="dark"] .access-card-content {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .access-card-content svg {
    background: var(--bg-secondary);
}

[data-theme="dark"] .access-card input:checked + .access-card-content {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.15) 0%, var(--bg-tertiary) 100%);
}

[data-theme="dark"] .quota-input-group {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .usage-display-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}

[data-theme="dark"] .btn-reset-usage {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .user-modal-actions {
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

[data-theme="dark"] .user-modal-actions .btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border);
}

/* =============================================
   DSAP - Deep Search Academic Professors
   ============================================= */

/* Badge IA dans la sidebar */
.nav-badge-ai {
    font-size: 0.6rem;
    padding: 2px 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-item-dsap {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 3px solid #667eea;
}

.nav-item-dsap:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

/* Badge dans le header */
.badge-ai-header {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-left: 1rem;
    font-weight: 600;
}

/* Vue DSAP - aligné sur Publications */
#view-dsap {
    width: 100%;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
    position: relative;
    z-index: 1;
}

/* Container principal DSAP */
.dsap-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0.75rem;
    height: calc(100vh - 140px);
    overflow: hidden;
}

/* Panneau de configuration */
.dsap-config-panel {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dsap-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.dsap-section h3 svg {
    color: var(--primary-color);
}

.dsap-section select,
.dsap-section input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.dsap-section select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dsap-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dsap-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dsap-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.dsap-search-btn {
    width: 100%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.dsap-search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.dsap-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Panneau des resultats */
.dsap-results-panel {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dsap-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.dsap-results-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    margin: 0;
}

.dsap-results-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dsap-selected-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* Liste des professeurs */
.dsap-professors-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.dsap-empty-state,
.dsap-loading,
.dsap-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.dsap-empty-state h4,
.dsap-loading h4,
.dsap-error h4 {
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

.dsap-loading .dsap-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: dsap-spin 1s linear infinite;
}

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

/* Spinner pour bouton en cours de chargement */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: dsap-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Bouton DSAP desactive pendant la recherche */
.dsap-search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
}

/* Item professeur */
.dsap-professor-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dsap-professor-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.dsap-professor-item.selected {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
}

.dsap-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.dsap-checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.dsap-prof-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.dsap-prof-info {
    flex: 1;
    min-width: 0;
}

.dsap-prof-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dsap-prof-dept {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dsap-prof-expertises {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.dsap-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
}

.dsap-badge-local {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.dsap-badge-new {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.dsap-badge-verified {
    background: rgba(124, 58, 237, 0.2);
    color: #7c3aed;
}

.dsap-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
    color: var(--text-secondary);
}

.dsap-prof-actions {
    display: flex;
    gap: 0.5rem;
}

/* Actions de selection */
.dsap-selection-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-wrap: wrap;
    align-items: center;
}

/* Bouton DSSP */
.dssp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dssp-btn:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4290 100%);
    transform: translateY(-1px);
}

.badge-ai-btn {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* DSSP Progress */
.dssp-progress {
    text-align: center;
    padding: 2rem;
}

.dssp-progress h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.dssp-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin: 1rem 0;
    overflow: hidden;
}

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

.dssp-progress-text {
    font-weight: 600;
    color: var(--text-primary);
}

.dssp-current {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* DSSP Results */
.dssp-results {
    padding: 0;
}

.dssp-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.dssp-results-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #10b981;
}

.dssp-actions-header {
    display: flex;
    gap: 0.5rem;
}

.dssp-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.dssp-result-item {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.dssp-result-item:hover {
    border-color: #667eea;
}

.dssp-result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dssp-checkbox-wrapper {
    display: flex;
    align-items: center;
}

.dssp-checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

.dssp-result-info strong {
    display: block;
    color: var(--text-primary);
}

.dssp-result-univ {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dssp-result-preview {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dssp-tag {
    display: inline-block;
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* DSSP Validation actions */
.dssp-validation-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.dssp-validation-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dssp-info-readonly {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: #b45309;
    font-size: 0.85rem;
}

.dssp-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.dssp-empty svg {
    margin-bottom: 1rem;
}

/* Panneau Deep Search */
.dsap-deep-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 450px;
    max-height: calc(100vh - 100px);
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dsap-deep-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.dsap-deep-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.95rem;
}

.dsap-deep-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Loading Deep Search */
.dsap-deep-loading {
    text-align: center;
    padding: 2rem;
}

.dsap-deep-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: dsap-spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.dsap-deep-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
    text-align: left;
}

.dsap-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.dsap-step.active {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}

.dsap-step.completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.dsap-step.completed::after {
    content: '✓';
    margin-left: auto;
    font-weight: bold;
}

.step-icon {
    font-size: 1.2rem;
}

/* Resultats Deep Search */
.dsap-deep-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dsap-deep-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dsap-deep-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.dsap-deep-title {
    flex: 1;
}

.dsap-deep-title h3 {
    margin: 0;
    font-size: 1.1rem;
}

.dsap-deep-title p {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dsap-deep-score {
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
}

.dsap-deep-score .score-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
}

.dsap-deep-score .score-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.dsap-deep-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dsap-deep-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.dsap-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dsap-tags-list .dsap-tag {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.dsap-publications-list,
.dsap-projects-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.dsap-publications-list li,
.dsap-projects-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.dsap-publications-list li:last-child,
.dsap-projects-list li:last-child {
    border-bottom: none;
}

.pub-title {
    flex: 1;
    color: var(--text-primary);
}

.pub-year {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 10px;
}

.dsap-deep-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.dsap-deep-sources {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Dark mode adjustments */
[data-theme="dark"] .dsap-professor-item.selected {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .dsap-deep-panel {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 1200px) {
    .dsap-container {
        grid-template-columns: 280px 1fr;
    }

    .dsap-deep-panel {
        width: 400px;
    }
}

@media (max-width: 992px) {
    .dsap-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .dsap-config-panel {
        max-height: 300px;
    }

    .dsap-deep-panel {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
}


/* ============================================
   TRADUCTION EN COURS - INDICATEUR VISUEL
   ============================================ */

.translating {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.translating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: translating-shimmer 1.5s infinite;
}

@keyframes translating-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Dark mode */
[data-theme="dark"] .translating::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
}

/* Cards pendant traduction */
#professors-grid.translating .professor-card {
    transform: scale(0.98);
    transition: transform 0.3s ease;
}


/* ============================================
   FOOTER - DIAKON-IA
   ============================================ */

.admin-footer {
    background: linear-gradient(135deg, #0c1445 0%, #1B4F72 50%, #0a2540 100%);
    color: white;
    padding: 1rem 2rem;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.admin-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--neon-blue) 20%, 
        var(--neon-purple) 50%, 
        var(--neon-blue) 80%, 
        transparent 100%
    );
    animation: footer-glow 3s ease-in-out infinite;
}

@keyframes footer-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-company {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
}

.footer-project {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-credits {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-author strong {
    color: var(--neon-blue);
    font-weight: 600;
}

.footer-copyright {
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-brand,
    .footer-credits {
        justify-content: center;
    }
}

/* Dark mode footer reste identique */
[data-theme="dark"] .admin-footer {
    background: linear-gradient(135deg, #050a1a 0%, #0c1445 50%, #050a1a 100%);
}

/* ============================================
   SECTION ACTIVITE SERVEUR
   ============================================ */

/* Grille des statistiques */
.activity-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.activity-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon-primary {
    background: rgba(27, 79, 114, 0.15);
    color: var(--blue-ai);
}

.stat-icon-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-icon-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.stat-icon-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-icon-secondary {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-secondary);
}

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Onglets activite */
.activity-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-primary);
    padding-bottom: 0.5rem;
}

.activity-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.activity-tab.active {
    background: var(--blue-ai);
    color: white;
}

.activity-tab svg {
    width: 16px;
    height: 16px;
}

/* Filtres activite */
.activity-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.activity-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activity-filters .filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.activity-filters select,
.activity-filters input[type="text"],
.activity-filters input[type="date"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 140px;
}

.activity-filters select:focus,
.activity-filters input:focus {
    outline: none;
    border-color: var(--blue-ai);
    box-shadow: 0 0 0 3px rgba(27, 79, 114, 0.1);
}

/* Contenu onglets */
.activity-content {
    position: relative;
}

.activity-tab-content {
    display: none;
}

.activity-tab-content.active {
    display: block;
}

/* Table des activites */
.activity-table-container {
    overflow-x: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.activity-table thead {
    background: var(--bg-tertiary);
}

.activity-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-primary);
}

.activity-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
    vertical-align: middle;
}

.activity-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.activity-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges d'action */
.action-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.action-badge.login_success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.action-badge.login_failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.action-badge.page_view {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.action-badge.default {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-secondary);
}

/* Details d'activite */
.activity-details {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-details:hover {
    white-space: normal;
    word-break: break-word;
}

/* Info navigateur */
.browser-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.8rem;
}

.browser-info .browser {
    font-weight: 500;
    color: var(--text-primary);
}

.browser-info .os {
    color: var(--text-muted);
}

/* Pagination activites */
.activity-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.activity-pagination button {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-pagination button:hover:not(:disabled) {
    background: var(--blue-ai);
    color: white;
    border-color: var(--blue-ai);
}

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

.activity-pagination .page-info {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Liste des connexions */
.logins-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.login-item:hover {
    border-color: var(--blue-ai);
}

.login-item.success {
    border-left: 4px solid var(--success);
}

.login-item.failed {
    border-left: 4px solid var(--error);
}

.login-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-item.success .login-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.login-item.failed .login-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.login-info {
    flex: 1;
    min-width: 0;
}

.login-user {
    font-weight: 600;
    color: var(--text-primary);
}

.login-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.login-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Arbre utilisateurs */
.users-tree {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-tree-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    overflow: hidden;
}

.user-tree-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-tree-header:hover {
    background: var(--bg-tertiary);
}

.user-tree-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-tree-item.expanded .user-tree-toggle {
    transform: rotate(90deg);
}

.user-tree-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue-ai);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-tree-info {
    flex: 1;
    min-width: 0;
}

.user-tree-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-tree-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-tree-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.user-tree-stats span {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.user-tree-content {
    display: none;
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid var(--border-secondary);
}

.user-tree-item.expanded .user-tree-content {
    display: block;
}

.user-tree-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.user-action-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-tertiary);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-action-chip .count {
    font-weight: 600;
    color: var(--blue-ai);
}

/* Dark mode adjustments */
[data-theme="dark"] .activity-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .activity-stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .stat-icon-primary {
    background: rgba(0, 212, 255, 0.15);
    color: var(--neon-blue);
}

[data-theme="dark"] .activity-table-container {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .activity-table thead {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .activity-filters {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .login-item,
[data-theme="dark"] .user-tree-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .activity-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .activity-tabs {
        flex-wrap: wrap;
    }

    .activity-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .activity-filters .filter-group {
        width: 100%;
    }

    .activity-filters select,
    .activity-filters input {
        width: 100%;
    }

    .activity-table {
        font-size: 0.8rem;
    }

    .activity-table th,
    .activity-table td {
        padding: 0.5rem;
    }

    .login-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .user-tree-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ============================================
   IPs SUSPECTES STYLES
   ============================================ */

.suspicious-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.suspicious-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.suspicious-stat-card .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.suspicious-stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.suspicious-stat-card.stat-critical {
    border-left: 4px solid #dc2626;
}

.suspicious-stat-card.stat-critical .stat-value {
    color: #dc2626;
}

.suspicious-stat-card.stat-high {
    border-left: 4px solid #ea580c;
}

.suspicious-stat-card.stat-high .stat-value {
    color: #ea580c;
}

.suspicious-stat-card.stat-medium {
    border-left: 4px solid #d97706;
}

.suspicious-stat-card.stat-medium .stat-value {
    color: #d97706;
}

.suspicious-stat-card.stat-blocked {
    border-left: 4px solid #7c3aed;
}

.suspicious-stat-card.stat-blocked .stat-value {
    color: #7c3aed;
}

.suspicious-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-bottom: 1rem;
    align-items: center;
}

.suspicious-table-container {
    overflow-x: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
}

.suspicious-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.suspicious-table thead {
    background: var(--bg-tertiary);
}

.suspicious-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    border-bottom: 2px solid var(--border-primary);
}

.suspicious-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
    vertical-align: middle;
}

.suspicious-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.suspicious-table tbody tr.row-blocked {
    background: rgba(220, 38, 38, 0.08);
}

.suspicious-table tbody tr.row-blocked:hover {
    background: rgba(220, 38, 38, 0.12);
}

.ip-code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--neon-blue);
}

.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-critical {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.severity-high {
    background: rgba(234, 88, 12, 0.15);
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.3);
}

.severity-medium {
    background: rgba(217, 119, 6, 0.15);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.severity-low {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.severity-unknown {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.reason-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.suspicious-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pagination-buttons {
    display: flex;
    gap: 0.25rem;
}

/* Badge dans l'onglet */
.activity-tab .badge {
    margin-left: 0.5rem;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
}

.badge-danger {
    background: #dc2626;
    color: white;
}

.badge-success {
    background: #16a34a;
    color: white;
}

/* Dark mode */
[data-theme="dark"] .suspicious-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .suspicious-table-container {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .suspicious-table thead {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .suspicious-filters {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ip-code {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .suspicious-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .suspicious-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .suspicious-table {
        font-size: 0.8rem;
    }

    .suspicious-table th,
    .suspicious-table td {
        padding: 0.5rem;
    }

    .reason-cell {
        max-width: 100px;
    }
}

/* ============================================
   CARTES PROFESSEURS MATCHING - FULL DISPLAY
   ============================================ */

/* Container principal - liste responsive */
.professeurs-results-list,
.matching-results-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
}

/* Carte professeur complète */
.professeur-card-full {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.professeur-card-full:hover {
    border-color: var(--red-ets);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Header de la carte */
.prof-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-secondary);
}

.prof-card-rank {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-ets) 100%);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.prof-card-identity {
    flex: 1;
    min-width: 0;
}

.prof-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prof-card-dept {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Score avec couleurs */
.prof-card-score {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    color: white;
}

.prof-card-score.score-excellent {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.prof-card-score.score-good {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
}

.prof-card-score.score-medium {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.prof-card-score.score-low {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* Badges des agents IA */
.prof-card-agents {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-badge.claude {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: white;
}

.agent-badge.openai {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
}

.agent-badge.gemini {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
}

.agent-badge svg {
    width: 12px;
    height: 12px;
}

/* Sections de la carte */
.prof-card-section {
    margin-bottom: 1rem;
}

.prof-card-section:last-of-type {
    margin-bottom: 0.75rem;
}

.prof-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Tags d'expertise */
.prof-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.prof-tag {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.prof-tag:hover {
    background: var(--red-ets);
    color: white;
    border-color: var(--red-ets);
}

/* Justification */
.prof-card-justification {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--red-ets);
}

/* Actions de la carte */
.prof-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-secondary);
}

.prof-card-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.prof-card-actions .btn svg {
    width: 16px;
    height: 16px;
}

/* Dark mode */
[data-theme="dark"] .professeur-card-full {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .professeur-card-full:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--red-ets);
}

[data-theme="dark"] .prof-tag {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .prof-card-justification {
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .professeur-card-full {
        padding: 1rem;
    }

    .prof-card-header {
        flex-wrap: wrap;
    }

    .prof-card-score {
        width: 48px;
        height: 48px;
        font-size: 0.9rem;
    }

    .prof-card-actions {
        flex-direction: column;
    }

    .prof-card-actions .btn {
        width: 100%;
    }
}

/* Styles additionnels pour l'onglet Professeurs (Mes projets) */
.professeur-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-secondary);
}

.professeur-actions .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.professeur-agents {
    display: inline-flex;
    gap: 0.35rem;
    margin-left: auto;
}

/* Amélioration du style professeur-match pour Mes projets */
.professeurs-results-list .professeur-match {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all var(--transition-fast);
}

.professeurs-results-list .professeur-match:hover {
    border-color: var(--red-ets);
    box-shadow: var(--shadow-md);
}

.professeurs-results-list .professeur-match:last-child {
    margin-bottom: 0;
}

/* Dark mode pour professeurs-results-list */
[data-theme="dark"] .professeurs-results-list .professeur-match {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .professeurs-results-list .professeur-match:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--red-ets);
}

/* ============================================
   RESPONSIVE LAYOUT - CONTENT AREA & VIEWS
   Breakpoints: 1200px, 992px, 768px, 576px
   ============================================ */

/* === Vue Content Scrollable === */
.view-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 24px;
    min-height: 0;
}

/* Container commun pour le contenu des vues */
.view-container {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* === RESPONSIVE: Desktop Large (1200px+) === */
@media (min-width: 1200px) {
    .admin-header-banner {
        padding: 20px 32px;
    }

    .admin-header-banner h2 {
        font-size: 1.5rem;
    }

    .view-content {
        padding: 24px 32px;
    }
}

/* === RESPONSIVE: Desktop (992px - 1199px) === */
@media (max-width: 1199px) {
    .admin-header-banner {
        padding: 16px 24px;
    }

    .admin-header-banner h2 {
        font-size: 1.3rem;
    }

    .admin-header-banner .header-icon {
        width: 42px;
        height: 42px;
    }

    .admin-header-banner .header-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* === RESPONSIVE: Tablette (768px - 991px) === */
@media (max-width: 991px) {
    .content-area {
        padding: 0;
    }

    .admin-header-banner {
        padding: 14px 20px;
        gap: 10px;
    }

    .admin-header-banner h2 {
        font-size: 1.2rem;
        gap: 12px;
    }

    .admin-header-banner .header-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .admin-header-banner .header-icon svg {
        width: 20px;
        height: 20px;
    }

    .admin-header-banner .view-actions {
        gap: 8px;
    }

    .admin-header-banner .btn-header {
        padding: 8px 14px;
        font-size: 0.825rem;
    }

    .view-content {
        padding: 16px 20px;
    }
}

/* === RESPONSIVE: Mobile Large (576px - 767px) === */
@media (max-width: 767px) {
    .admin-header-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 12px;
    }

    .admin-header-banner h2 {
        font-size: 1.15rem;
        width: 100%;
    }

    .admin-header-banner .header-icon {
        width: 38px;
        height: 38px;
    }

    .admin-header-banner .view-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-header-banner .btn-header {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .view-content {
        padding: 14px 16px;
    }

    .view-header {
        padding: 12px 16px;
    }

    .view-header h2 {
        font-size: 1.2rem;
    }
}

/* === RESPONSIVE: Mobile (< 576px) === */
@media (max-width: 575px) {
    .admin-header-banner {
        padding: 12px 14px;
    }

    .admin-header-banner h2 {
        font-size: 1.05rem;
        gap: 10px;
    }

    .admin-header-banner .header-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .admin-header-banner .header-icon svg {
        width: 18px;
        height: 18px;
    }

    .admin-header-banner .btn-header {
        padding: 7px 10px;
        font-size: 0.75rem;
        border-radius: 8px;
    }

    .admin-header-banner .btn-header svg {
        width: 14px;
        height: 14px;
    }

    .view-content {
        padding: 12px 14px;
    }

    .view-header {
        padding: 10px 14px;
    }

    .view-header h2 {
        font-size: 1.1rem;
    }
}

/* === SCROLLBAR STYLING === */
.content-area::-webkit-scrollbar,
.view::-webkit-scrollbar,
.view-content::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track,
.view::-webkit-scrollbar-track,
.view-content::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb,
.view::-webkit-scrollbar-thumb,
.view-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover,
.view::-webkit-scrollbar-thumb:hover,
.view-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

[data-theme="dark"] .content-area::-webkit-scrollbar-thumb,
[data-theme="dark"] .view::-webkit-scrollbar-thumb,
[data-theme="dark"] .view-content::-webkit-scrollbar-thumb {
    background: var(--border-dark);
}

[data-theme="dark"] .content-area::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .view::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .view-content::-webkit-scrollbar-thumb:hover {
    background: var(--grey-500);
}

/* === EMPTY STATE STYLING === */
.view-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
    flex: 1;
}

.view-empty-state svg {
    width: 64px;
    height: 64px;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    margin-bottom: 20px;
    opacity: 0.5;
}

.view-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

.view-empty-state p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 24px;
    max-width: 400px;
}

/* === CARDS GRID RESPONSIVE === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

@media (max-width: 767px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 0;
    }
}

/* === FORM SECTIONS RESPONSIVE === */
.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .form-section {
        padding: 16px;
        border-radius: var(--radius-md);
    }
}

[data-theme="dark"] .form-section {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* === TABLE RESPONSIVE === */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* === ANIMATION UTILITIES === */
.fade-in {
    animation: fadeInUp 0.35s ease-out;
}

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

.scale-in {
    animation: scaleIn 0.25s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================
   REVIEW PAPER MODULE STYLES
   ========================================= */

/* Banner Review Paper */
.banner-review-paper {
    --banner-accent: #8B5CF6;
    border-left-color: var(--banner-accent) !important;
}

.banner-review-paper::before {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%) !important;
}

.nav-item-review-paper.active,
.nav-item-review-paper:hover {
    background: rgba(139, 92, 246, 0.1);
    border-left-color: #8B5CF6;
}

/* Force la vue Review Paper à prendre toute la largeur */
#view-review-paper {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

#view-review-paper .view-header {
    width: 100% !important;
}

/* Container principal - layout simple comme matching-container */
.review-paper-container {
    display: block;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* Layout 2 colonnes quand les deux panneaux sont visibles */
.review-paper-container.dual-panel {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 24px;
    overflow: hidden;
}

.review-config-panel {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* En mode dual-panel, le panneau config prend toute la hauteur */
.review-paper-container.dual-panel .review-config-panel {
    max-width: none;
    margin: 0;
    overflow-y: auto;
}

.review-intro {
    text-align: center;
    padding: 20px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(167, 139, 250, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.review-intro h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.review-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.review-intro strong {
    color: #8B5CF6;
}

.review-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.review-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.review-section h4 svg {
    color: #8B5CF6;
}

/* === SECTION PROJETS REVIEW PAPER === */
.review-projets-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 0 !important;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.review-section-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 11px 11px 0 0;
}

.review-section-header h4 {
    margin: 0;
    color: white;
}

.review-section-header h4 svg {
    color: white;
}

.review-projets-search {
    position: relative;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.review-projets-search input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--bg-primary);
    transition: all 0.2s;
}

.review-projets-search input:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.review-projets-search .search-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.review-projets-liste {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

.review-projets-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--text-muted);
    text-align: center;
}

.review-projets-empty svg {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.review-projets-empty p {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.review-projets-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Carte projet Review */
.review-projet-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin-bottom: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-projet-card:hover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.review-projet-card.selected {
    border-color: #8B5CF6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(167, 139, 250, 0.05));
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.review-projet-card.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #8B5CF6;
    border-radius: 10px 0 0 10px;
}

.review-projet-info {
    flex: 1;
    min-width: 0;
}

.review-projet-titre {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-projet-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.review-projet-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.review-projet-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.review-projet-icons svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.review-projet-card.selected .review-projet-icons svg {
    color: #8B5CF6;
}

/* Dark mode */
[data-theme="dark"] .review-projets-section {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .review-projets-search {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .review-projet-card {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .review-projet-card:hover {
    background: rgba(139, 92, 246, 0.1);
}

.review-projet-preview {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.review-projet-preview h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.preview-badge.badge-nouveau,
.preview-badge.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.preview-badge.badge-en_cours {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.preview-badge.badge-analyse,
.preview-badge.badge-cahier_genere {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.preview-badge.badge-complete {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

#review-projet-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 8px 0 0 0;
}

.review-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.review-options-grid .form-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.review-options-advanced {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
}

.review-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-mode-option input {
    display: none;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.review-mode-option input:checked + .mode-card {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.08);
}

.mode-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-info strong {
    font-size: 0.95rem;
}

.mode-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.review-actions .btn-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    border: none;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.review-actions .btn-large:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}

.review-result-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
}

.review-result-panel .review-output {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.review-result-panel .review-output > .rp-readonly-banner {
    flex-shrink: 0;
}

.review-result-panel .review-output-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.review-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
    border-bottom: 1px solid var(--border-color);
}

.review-result-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-result-header h3::before {
    display: none;
}

.review-progress {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.progress-time {
    font-family: monospace;
    font-size: 1.2rem;
    color: #8B5CF6;
    font-weight: 600;
}

.progress-agents {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.agent-status.agent-meta {
    border: 2px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.05);
}

.agent-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.agent-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.agent-info span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

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

.agent-state.pending {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.agent-state.running {
    background: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
    animation: pulse 1.5s infinite;
}

.agent-state.complete {
    background: rgba(34, 197, 94, 0.2);
    color: #22C55E;
}

.review-progress .progress-bar-container {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 24px;
    margin-bottom: 16px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.review-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #A78BFA);
    border-radius: 6px;
    transition: width 0.3s ease;
    min-width: 2%;
}

[data-theme="dark"] .review-progress .progress-bar-container {
    background: #374151;
}

.review-output {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    min-height: 0;
}

/* Toolbar style Brevets */
.review-output-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary, #f8fafc);
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
    flex-shrink: 0;
}

.review-output-toolbar .toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-output-toolbar .toolbar-right {
    display: flex;
    align-items: center;
}

.review-output-toolbar .output-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-primary);
    border-radius: 12px;
    white-space: nowrap;
}

/* Tabs style Brevets */
.review-output-tabs {
    display: flex;
    gap: 0.25rem;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.review-output-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: none;
    color: var(--grey-dark, #64748b);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.review-output-tabs .tab-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.review-output-tabs .tab-btn:hover {
    background: var(--card-bg, #ffffff);
    color: var(--text-primary);
}

.review-output-tabs .tab-btn.active {
    background: var(--card-bg, #ffffff);
    color: var(--primary-color, #8B5CF6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

.review-output-tabs .tab-btn.active svg {
    opacity: 1;
    stroke: var(--primary-color, #8B5CF6);
}

/* Boutons export compacts */
.output-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 32px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
}

.btn-export span {
    font-size: 0.6rem;
    font-weight: 800;
}

.btn-export svg {
    width: 14px;
    height: 14px;
}

.btn-export:hover {
    transform: scale(1.08);
}

.btn-copy {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.btn-word {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    width: auto;
    padding: 0 10px;
}

.btn-latex {
    background: linear-gradient(135deg, #059669, #10b981);
}

.btn-pdf {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    width: auto;
    padding: 0 10px;
}

/* Boutons dynamiques dans la toolbar */
.output-actions .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.output-actions .btn svg {
    width: 13px;
    height: 13px;
}

.review-output-content {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    background: var(--bg-primary);
    min-height: 0;
    font-size: 0.9rem;
}

.review-paper-content {
    max-width: 100%;
    margin: 0;
    line-height: 1.6;
}

.review-paper-content .review-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: left;
    margin-bottom: 12px;
}

.review-paper-content .review-subtitle {
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.review-paper-content .review-abstract {
    background: var(--bg-tertiary);
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #8B5CF6;
    font-size: 0.9rem;
}

.review-paper-content .review-section h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border-color);
}

.markdown-raw,
.latex-code {
    font-family: monospace;
    font-size: 0.85rem;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre-wrap;
}

@media (max-width: 1200px) {
    .review-paper-container.dual-panel {
        grid-template-columns: 1fr;
    }
    .review-paper-container.dual-panel .review-config-panel {
        max-width: 600px;
        margin: 0 auto;
    }
    .review-result-panel {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .review-options-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SECTION COMMUNICATIONS
   ============================================ */

.banner-communications {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
}

.communications-container {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

/* Tabs Communications */
.comm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.comm-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.comm-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.comm-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.comm-tab svg {
    flex-shrink: 0;
}

/* Panels */
.comm-panel {
    display: none;
}

.comm-panel.active {
    display: block;
}

/* Formulaire d'envoi */
.comm-form-container {
    max-width: 800px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

.comm-form-container h3 {
    margin: 0 0 24px;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.comm-form-container h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 2px;
}

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

.comm-form-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.comm-form-container input,
.comm-form-container select,
.comm-form-container textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.comm-form-container textarea {
    font-family: 'Monaco', 'Menlo', monospace;
    resize: vertical;
    min-height: 200px;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Variables du template */
.comm-variables {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.comm-variables h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.variables-grid .form-group {
    margin-bottom: 0;
}

.variables-grid label {
    font-size: 12px;
    color: var(--text-secondary);
}

.variables-grid input {
    padding: 8px 10px;
    font-size: 13px;
}

/* Aperçu email */
.comm-preview-container {
    margin-top: 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.preview-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

#comm-preview-frame {
    width: 100%;
    height: 500px;
    border: none;
    background: white;
}

/* Templates Grid */
.templates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.templates-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.template-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

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

.template-card h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.template-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 500;
}

.template-card p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.template-card-actions {
    display: flex;
    gap: 8px;
}

.template-card-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

/* Historique */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.history-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.history-stats {
    display: flex;
    gap: 12px;
}

.stat-badge {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.stat-badge.stat-sent {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-badge.stat-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.history-table-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.history-table th,
.history-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table td {
    font-size: 14px;
    color: var(--text-primary);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover td {
    background: var(--bg-tertiary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.sent {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

@media (max-width: 768px) {
    .comm-tabs {
        flex-wrap: wrap;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   REVIEW PAPER - Instructions complémentaires
   ============================================ */
.review-instructions-container {
    margin-top: 12px;
}

#review-instructions {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#review-instructions:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

#review-instructions::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.instructions-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.instructions-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
    stroke: #8B5CF6;
}

/* Bouton régénération */
#btn-regenerer-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #8B5CF6, #A78BFA);
    color: white;
    border: none;
}

#btn-regenerer-review:hover {
    background: linear-gradient(135deg, #7C3AED, #8B5CF6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Modal régénération */
#modal-regeneration .modal-info {
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 10px;
    border-left: 4px solid #8B5CF6;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.regeneration-conserved {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.regeneration-conserved li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #16a34a;
}

/* Actions du résultat */
.review-output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
}

.review-output-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Dark mode */
[data-theme="dark"] #review-instructions {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .instructions-hint {
    background: rgba(139, 92, 246, 0.12);
}

[data-theme="dark"] .regeneration-conserved li {
    background: rgba(34, 197, 94, 0.15);
}

/* === HISTORIQUE REVIEW PAPERS - TREEVIEW === */
#modal-historique-review .modal-content {
    max-width: 800px;
    background: var(--bg-primary);
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#modal-historique-review .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 18px 24px;
    border-bottom: none;
}

#modal-historique-review .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0;
    flex: 1;
}

#modal-historique-review .modal-header h3 svg {
    width: 20px;
    height: 20px;
}

.historique-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

#modal-historique-review .modal-close {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-historique-review .modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

#modal-historique-review .modal-body {
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.historique-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.historique-empty svg {
    opacity: 0.15;
    stroke: #667eea;
}

.historique-empty p {
    margin-top: 20px;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.historique-empty span {
    margin-top: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* TreeView */
.historique-treeview {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tree-item {
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.tree-item:hover {
    border-color: var(--border-color);
}

.tree-item.expanded {
    border-color: #667eea;
    background: var(--bg-primary);
}

.tree-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.tree-item-row:hover {
    background: rgba(102, 126, 234, 0.05);
}

.tree-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.tree-chevron svg {
    stroke: var(--text-muted);
    width: 14px;
    height: 14px;
}

.tree-item.expanded .tree-chevron {
    transform: rotate(90deg);
}

.tree-item.expanded .tree-chevron svg {
    stroke: #667eea;
}

.tree-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

.tree-icon svg {
    stroke: white;
    width: 16px;
    height: 16px;
}

.tree-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    white-space: nowrap;
}

.tree-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.tree-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
}

.tree-btn svg {
    width: 14px;
    height: 14px;
}

.tree-btn-view {
    color: #667eea;
}

.tree-btn-view:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tree-btn-regen {
    color: #10b981;
}

.tree-btn-regen:hover {
    background: rgba(16, 185, 129, 0.1);
}

.tree-btn-delete {
    color: #ef4444;
}

.tree-btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Details panel */
.tree-item-details {
    display: none;
    padding: 0 14px 14px 54px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.tree-item.expanded .tree-item-details {
    display: block;
}

.tree-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
}

.detail-value {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.detail-instructions {
    font-style: italic;
    color: #8B5CF6;
}

.tree-sections {
    padding: 8px 0;
}

.tree-section-list {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tree-section-list li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-num {
    font-weight: 700;
    color: #667eea;
    min-width: 20px;
}

/* Footer */
#modal-historique-review .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
}

#modal-historique-review .modal-footer .btn-danger {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#modal-historique-review .modal-footer .btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

#modal-historique-review .modal-footer .btn-secondary {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

#modal-historique-review .modal-footer .btn-secondary:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Scrollbar */
#modal-historique-review .modal-body::-webkit-scrollbar {
    width: 6px;
}

.historique-liste::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.historique-liste::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.historique-liste::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Dark mode historique */
[data-theme="dark"] .historique-item {
    background: var(--card-bg);
}

[data-theme="dark"] .historique-item:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .historique-item-date {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .historique-item-meta .meta-badge {
    background: rgba(255, 255, 255, 0.08);
}

/* ============================================
   MODAL REGENERATION - Sections commentables v2
   ============================================ */
#modal-regeneration .modal-content.modal-fullscreen {
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
}

.regen-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.regen-header h3 {
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.regen-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.regen-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.regen-count.has-comments {
    background: #10b981;
}

.regen-header .modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.regen-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.regen-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.regen-intro {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-left: 3px solid #667eea;
}

.regen-intro svg {
    color: #667eea;
    flex-shrink: 0;
}

/* Element general box */
.regen-element.regen-general-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.regen-element-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.regen-element-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    flex-shrink: 0;
}

.regen-element-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    flex: 1;
}

.regen-element-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.2s;
}

.regen-element-badge.has-comment {
    background: #10b981;
    color: white;
}

.regen-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.regen-textarea::placeholder {
    color: var(--text-muted);
}

/* Elements list */
.regen-elements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.regen-element {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.regen-element:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

.regen-elements-list .regen-element-header {
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.regen-elements-list .regen-element-icon {
    width: 28px;
    height: 28px;
}

.regen-element-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
}

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

/* Original text box */
.regen-original-text {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.regen-original-label {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.regen-original-content {
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Comment box */
.regen-comment-box {
    display: flex;
    flex-direction: column;
}

.regen-comment-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.regen-comment-textarea {
    flex: 1;
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s, background 0.2s;
}

.regen-comment-textarea:focus {
    outline: none;
    border-color: #667eea;
    border-style: solid;
    background: var(--bg-primary);
}

.regen-comment-textarea::placeholder {
    color: var(--text-muted);
}

/* Footer */
.regen-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
}

.btn-regenerate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-regenerate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-regenerate:active {
    transform: translateY(0);
}

/* Scrollbar for original content */
.regen-original-content::-webkit-scrollbar {
    width: 5px;
}

.regen-original-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.regen-original-content::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

/* Dark mode regeneration */
[data-theme="dark"] .regen-element {
    background: var(--card-bg);
}

[data-theme="dark"] .regen-original-text {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .regen-comment-textarea {
    background: var(--bg-tertiary);
}

/* ============================================
   MODULE COMMUNICATIONS - Styles améliorés
   ============================================ */

/* Éditeur Quill pour les emails */
#comm-editor-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-primary);
}

#comm-quill-editor {
    min-height: 300px;
    font-size: 0.95rem;
}

#comm-quill-editor .ql-editor {
    min-height: 280px;
}

.comm-editor-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.comm-editor-toolbar .toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.comm-editor-toolbar .toolbar-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Variables tag */
.var-tag {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: monospace;
}

/* Modal aperçu email */
.email-preview-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.email-preview-header h3 {
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.email-preview-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: calc(70vh - 140px);
}

.email-preview-meta {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.preview-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.preview-meta-row:last-child {
    margin-bottom: 0;
}

.preview-meta-row .meta-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
    font-size: 0.85rem;
}

.preview-meta-row .meta-value {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.preview-meta-row .preview-subject {
    font-weight: 600;
}

.email-preview-content {
    flex: 1;
    padding: 0;
}

.email-preview-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Modal édition template */
.template-edit-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.template-edit-header h3 {
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.template-edit-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    padding: 0;
    height: calc(80vh - 140px);
}

.template-edit-sidebar {
    padding: 20px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.template-edit-sidebar .form-group {
    margin-bottom: 16px;
}

.template-edit-sidebar label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.template-edit-sidebar input,
.template-edit-sidebar select,
.template-edit-sidebar textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.template-variables-help {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.template-variables-help h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.template-variables-help .var-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.template-variables-help code {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.template-variables-help code:hover {
    background: linear-gradient(135deg, #FDE68A 0%, #FCD34D 100%);
    transform: scale(1.05);
}

.template-edit-main {
    padding: 0;
    overflow: hidden;
}

#template-quill-editor {
    height: 100%;
}

#template-quill-editor .ql-container {
    height: calc(100% - 42px);
}

/* Templates grid amélioré */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.templates-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.templates-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.templates-empty p {
    margin-bottom: 20px;
}

.template-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

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

.template-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.template-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.template-badge-general {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.template-badge-notification {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.template-badge-invitation {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.template-badge-newsletter {
    background: rgba(236, 72, 153, 0.1);
    color: #EC4899;
}

.template-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 12px;
    line-height: 1.4;
}

.template-preview-mini {
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.template-preview-mini .preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(102, 126, 234, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.2s;
}

.template-preview-mini:hover .preview-overlay {
    background: rgba(102, 126, 234, 0.9);
    opacity: 1;
}

.template-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.template-card-actions .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.template-card-actions .btn-icon:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.template-card-actions .btn-sm {
    margin-left: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-sent {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* Responsive */
@media (max-width: 900px) {
    .template-edit-body {
        grid-template-columns: 1fr;
    }

    .template-edit-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
    }
}

/* ============================================
   COMMUNICATIONS - Structure améliorée
   (Style similaire à Review Paper)
   ============================================ */

/* Main panel */
.comm-main-panel {
    width: 100%;
}

/* Section Introduction */
.comm-intro {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.comm-intro-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 5px rgba(102, 126, 234, 0.1);
    }
}

.comm-intro h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.comm-intro p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tabs Container */
.comm-tabs-container {
    margin-bottom: 30px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid var(--border-color);
}

.comm-tabs-container .comm-tabs {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    justify-content: center;
}

.comm-tabs-container .comm-tab {
    flex: 1;
    justify-content: center;
    max-width: 200px;
}

/* Sections */
.comm-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.comm-section:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.08);
}

.comm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.comm-section-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comm-section-header h4 svg {
    color: #667eea;
    flex-shrink: 0;
}

.comm-section-header.templates-header,
.comm-section-header.history-header {
    flex-wrap: wrap;
    gap: 12px;
}

/* Form Grid */
.comm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .comm-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Form elements */
.comm-section .form-group {
    margin-bottom: 0;
}

.comm-section .form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.comm-section .form-group label .label-text {
    color: var(--text-primary);
}

.comm-section .form-group label .label-required {
    color: #ef4444;
    font-weight: 700;
}

.comm-section .form-input,
.comm-section .form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

.comm-section .form-input-lg {
    font-size: 1rem;
    padding: 14px 16px;
    font-weight: 500;
}

/* Content Section */
.comm-content-section .comm-section-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 12px;
}

/* Editor Wrapper */
.comm-editor-wrapper {
    margin-top: 8px;
}

/* Insert Variable Button */
.btn-insert-var {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-insert-var:hover {
    background: linear-gradient(135deg, #FDE68A 0%, #FCD34D 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-insert-var svg {
    width: 14px;
    height: 14px;
}

/* Variables Section */
.comm-variables-section {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.3) 0%, rgba(253, 230, 138, 0.3) 100%);
    border-color: rgba(245, 158, 11, 0.2);
}

.comm-variables-section .comm-section-header h4 svg {
    color: #F59E0B;
}

/* Actions Bar */
.comm-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.comm-actions .btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.comm-actions .btn-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 24px;
    font-weight: 600;
}

.comm-actions .btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* History Section */
.history-stats {
    display: flex;
    gap: 10px;
}

.stat-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-badge.stat-sent {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.stat-badge.stat-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* History Table */
.history-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

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

.history-table th,
.history-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
}

.history-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.history-table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Templates Grid (in Templates panel) */
.comm-section .templates-grid {
    margin-top: 16px;
    padding: 0;
}

/* Dark mode adjustments */
[data-theme="dark"] .comm-intro {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .comm-intro-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

[data-theme="dark"] .comm-section {
    background: var(--card-bg);
}

[data-theme="dark"] .comm-tabs-container {
    background: var(--card-bg);
}

[data-theme="dark"] .comm-actions {
    background: var(--card-bg);
}

[data-theme="dark"] .btn-insert-var {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.8) 0%, rgba(253, 230, 138, 0.8) 100%);
}

[data-theme="dark"] .comm-variables-section {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.1) 0%, rgba(253, 230, 138, 0.1) 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .comm-intro {
        padding: 30px 20px;
    }

    .comm-intro-icon {
        width: 60px;
        height: 60px;
    }

    .comm-intro h3 {
        font-size: 1.25rem;
    }

    .comm-section {
        padding: 16px;
    }

    .comm-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .comm-tabs-container .comm-tab {
        flex: none;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .comm-tabs-container .comm-tab span {
        display: none;
    }
}

/* ========================================
   TRANSLATION OVERLAY - Review Paper
   ======================================== */

.translation-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.translation-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.translation-overlay-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 20px;
    padding: 50px 70px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(52, 152, 219, 0.2);
    animation: overlaySlideIn 0.4s ease-out;
}

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

.translation-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: translationSpin 1s linear infinite;
    margin: 0 auto 25px;
}

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

.translation-message {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.translation-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.translation-title::before {
    content: '🌐';
    font-size: 1.5rem;
}

.translation-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Language Indicator Badge */
.review-lang-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0.6rem;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 12px;
    margin: 0;
    flex-shrink: 0;
}

.lang-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
}

.lang-original {
    color: rgba(255,255,255,0.7);
    font-size: 0.7rem;
}

.lang-badge .current-lang {
    font-weight: 600;
    color: #3498db;
    text-transform: uppercase;
}

.lang-badge .original-lang {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.lang-badge .original-lang::before {
    content: '(';
}

.lang-badge .original-lang::after {
    content: ')';
}

.btn-retranslate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retranslate:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.btn-retranslate i {
    font-size: 0.85rem;
}

/* Light theme adjustments */
html:not([data-theme="dark"]) .translation-overlay-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: rgba(52, 152, 219, 0.2);
}

html:not([data-theme="dark"]) .translation-title {
    color: #2c3e50;
}

html:not([data-theme="dark"]) .translation-subtitle {
    color: rgba(44, 62, 80, 0.6);
}

html:not([data-theme="dark"]) .translation-spinner {
    border-color: rgba(52, 152, 219, 0.1);
    border-top-color: #3498db;
}

html:not([data-theme="dark"]) .review-lang-indicator {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   CACHE STATS i18n - ADMIN PAGE
   ============================================ */

.banner-cache {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cache-stats-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Stats Grid */
.cache-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.cache-stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.cache-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.cache-stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cache-stat-card .stat-icon svg {
    width: 28px;
    height: 28px;
}

.cache-stat-card .stat-icon .lang-flag {
    font-size: 28px;
}

.cache-stat-card.stat-total .stat-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #667eea;
}

.cache-stat-card.stat-hits .stat-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
    color: var(--success);
}

.cache-stat-card.stat-en .stat-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
}

.cache-stat-card.stat-es .stat-icon {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 88, 12, 0.15) 100%);
}

.cache-stat-card .stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cache-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.cache-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Details Section */
.cache-details-section,
.cache-recent-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.cache-details-section h3,
.cache-recent-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Type Bars */
.type-bars-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.type-bar-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.type-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.type-bar-header .type-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.type-bar-header .type-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 10px;
    border-radius: 12px;
}

.type-bar-bg {
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    overflow: hidden;
}

.type-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Recent Table */
.cache-recent-table-wrapper {
    overflow-x: auto;
    margin: 0 -24px;
    padding: 0 24px;
}

.cache-recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cache-recent-table thead {
    background: var(--bg-tertiary);
}

.cache-recent-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.cache-recent-table td {
    padding: 14px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.cache-recent-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.cache-recent-table .source-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
}

.cache-recent-table .lang-cell {
    white-space: nowrap;
}

.cache-recent-table .type-cell {
    color: var(--text-secondary);
}

.cache-recent-table .hits-cell {
    font-weight: 600;
    color: var(--success);
}

.cache-recent-table .date-cell {
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 0.85rem;
}

/* Empty & Loading States */
.cache-stats-container .loading-text,
.cache-stats-container .empty-text,
.cache-stats-container .error-text {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
}

.cache-stats-container .error-text {
    color: var(--error);
}

/* Dark mode adjustments */
[data-theme="dark"] .cache-stat-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .type-bar-bg {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cache-recent-table thead {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .cache-recent-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   OVERLAY D'INITIALISATION
   Utilise les couleurs du site (mode clair/sombre)
   ============================================ */
/* Masquer le contenu admin tant que le chargement n'est pas terminé */
body:not(.app-loaded) > .admin-header,
body:not(.app-loaded) > .admin-main {
    visibility: hidden;
}

.init-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

[data-theme="dark"] .init-overlay {
    background: rgba(15, 23, 42, 0.94);
}

.init-overlay:not(.visible) {
    display: none;
    opacity: 0;
}

.init-overlay.visible {
    display: flex;
    opacity: 1;
}

.init-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.init-overlay.removed {
    display: none;
}

.init-modal {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: initModalAppear 0.6s ease-out;
}

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

.init-logo {
    margin-bottom: 16px;
    animation: initLogoPulse 2s ease-in-out infinite;
}

@keyframes initLogoPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px var(--info));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 25px var(--info));
    }
}

.init-logo img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
}

.init-title {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: 1px;
}

.init-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0 0 32px 0;
}

/* Progress Bar */
.init-progress-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.init-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.init-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--info) 0%, var(--blue-accent) 50%, var(--success) 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.3s ease-out;
    animation: initProgressGradient 3s linear infinite;
}

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

.init-progress-text {
    color: var(--info);
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 45px;
}

/* Steps List */
.init-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.init-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.init-step.pending {
    opacity: 0.5;
}

.init-step.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
}

.init-step.completed {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.init-step.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

.init-step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.init-step.pending .init-step-icon {
    background: var(--border-color);
    color: var(--text-muted);
}

.init-step.active .init-step-icon {
    background: var(--info);
    color: var(--white);
    animation: initStepPulse 1s ease-in-out infinite;
}

@keyframes initStepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.init-step.completed .init-step-icon {
    background: var(--success);
    color: var(--white);
}

.init-step.error .init-step-icon {
    background: var(--error);
    color: var(--white);
}

.init-step-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: left;
}

.init-step.pending .init-step-text {
    color: var(--text-muted);
}

/* Current Task */
.init-current-task {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    min-height: 20px;
}

/* Back link in overlay */
.init-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.init-back-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
}

.init-back-link svg {
    transition: transform 0.2s ease;
}

.init-back-link:hover svg {
    transform: translateX(-3px);
}

/* Spinner for active steps */
.init-step.active .init-step-icon::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: var(--white);
    border-radius: 50%;
    animation: initSpin 0.8s linear infinite;
}

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

/* Checkmark for completed steps */
.init-step.completed .init-step-icon::after {
    content: '✓';
    font-weight: bold;
}

/* X for error steps */
.init-step.error .init-step-icon::after {
    content: '✕';
    font-weight: bold;
}

/* Mode sombre - ajustements specifiques */
[data-theme="dark"] .init-step.active {
    background: rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .init-step.completed {
    background: rgba(34, 197, 94, 0.15);
}

[data-theme="dark"] .init-step.error {
    background: rgba(248, 113, 113, 0.15);
}

/* ================================================
   MODULE SUBVENTIONS V2 - STYLES PREMIUM
   Layout style Brevets avec theme Orange
   ================================================ */

/* Variable additionnelle pour le pale orange */
:root {
    --orange-subvention-pale: #FFF7ED;
}

[data-theme="dark"] {
    --orange-subvention-pale: rgba(249, 115, 22, 0.15);
}

/* Vue subventions - aligné sur Brevets */
#view-subventions {
    width: 100%;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
    position: relative;
    z-index: 1;
}

/* Container principal - 2 colonnes */
.subv-main-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0.75rem;
    height: calc(100vh - 140px);
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
    border-radius: 0;
    overflow: hidden;
    padding: 0.75rem;
}

/* ========================
   PANNEAU GAUCHE - PROJETS
   ======================== */
.subv-projets-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.subv-section {
    background: #ffffff;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    border: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: none;
}

.subv-section-projets {
    flex: 1;
    min-height: 0;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header de section projets - ne pas compresser */
.subv-section-projets > .subv-section-header {
    flex-shrink: 0;
}

/* Modal Subventions V2 */
.subv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.subv-modal-overlay.closing {
    animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.subv-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.subv-modal-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subv-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.subv-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.subv-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.subv-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.subv-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: #f8fafc;
}

.subv-form-group {
    margin-bottom: 1.25rem;
}

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

.subv-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.subv-projet-info {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #F97316;
}

.subv-projet-info strong {
    display: block;
    color: #1e293b;
    font-size: 0.95rem;
}

.subv-projet-info span {
    color: #64748b;
    font-size: 0.8rem;
}

.subv-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subv-select:focus {
    outline: none;
    border-color: #F97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.subv-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s ease;
}

.subv-textarea:focus {
    outline: none;
    border-color: #F97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Dark mode modal */
[data-theme="dark"] .subv-modal {
    background: var(--card-bg);
}

[data-theme="dark"] .subv-modal-body {
    background: var(--card-bg);
}

[data-theme="dark"] .subv-modal-footer {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .subv-form-group label {
    color: var(--text-primary);
}

[data-theme="dark"] .subv-projet-info {
    background: var(--bg-secondary);
}

[data-theme="dark"] .subv-projet-info strong {
    color: var(--text-primary);
}

[data-theme="dark"] .subv-select,
[data-theme="dark"] .subv-textarea {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Header de section - style coloré orange */
.subv-section-header {
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
    border-radius: 0;
    position: relative;
    flex-shrink: 0;
}

.subv-section-projets > .subv-section-header {
    border-radius: 11px 11px 0 0;
}

.subv-section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    pointer-events: none;
}

.subv-section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.subv-section-header h3 svg {
    color: rgba(255, 255, 255, 0.9);
    stroke: rgba(255, 255, 255, 0.9);
}

/* Compteur projets */
.subv-projets-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* Bouton dans le header de section */
.btn-subv {
    background: linear-gradient(135deg, var(--orange-subvention) 0%, var(--orange-subvention-dark) 100%);
    color: var(--text-inverse);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.btn-subv:hover {
    background: linear-gradient(135deg, var(--orange-subvention-dark) 0%, #C2410C 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

.btn-subv:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #9ca3af;
    box-shadow: none;
    transform: none;
}

.btn-subv svg {
    stroke: currentColor;
    width: 14px;
    height: 14px;
}

.btn-subv.btn-xs {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
}

.btn-subv.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
}

/* Bouton outline orange */
.btn-subv-outline {
    background: transparent;
    color: var(--orange-subvention-dark);
    border: 1px solid var(--orange-subvention);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.btn-subv-outline:hover {
    background: var(--orange-subvention-pale);
}

.btn-subv-outline:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #9ca3af;
    color: #9ca3af;
}

/* Bouton dans header section */
.subv-section-header .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.subv-section-header .btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.subv-section-header .btn svg {
    color: #ffffff;
    stroke: #ffffff;
}

/* Recherche projets */
.subv-projets-search {
    position: relative;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.subv-projets-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--card-bg);
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.subv-projets-search input::placeholder {
    color: var(--grey-400);
}

.subv-projets-search input:focus {
    outline: none;
    border-color: var(--orange-subvention);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.subv-projets-search svg {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-400);
    stroke: var(--grey-400);
    pointer-events: none;
}

/* Recherche projets - ne pas compresser */
.subv-section-projets .subv-projets-search {
    flex-shrink: 0;
}

/* Liste projets - prend tout l'espace restant */
.subv-projets-liste {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem;
    background: linear-gradient(180deg, #FFFAF5 0%, #FFF7ED 100%);
    min-height: 0;
}

/* Scrollbar uniquement si necessaire */
.subv-projets-liste::-webkit-scrollbar {
    width: 6px;
}

.subv-projets-liste::-webkit-scrollbar-track {
    background: transparent;
}

.subv-projets-liste::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.3);
    border-radius: 3px;
}

.subv-projets-liste::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.5);
}

/* Item projet - style coloré orange */
.subv-projet-item {
    padding: 0.875rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(249, 115, 22, 0.15);
    background: linear-gradient(135deg, #FFFAF5 0%, #FFF7ED 100%);
}

.subv-projet-item:hover {
    border-color: rgba(249, 115, 22, 0.4);
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    transform: translateY(-2px);
}

.subv-projet-item.selected {
    border-color: var(--orange-subvention);
    background: linear-gradient(135deg, #FFEDD5 0%, #FED7AA 100%);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.2);
}

.subv-projet-item .projet-titre {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subv-projet-item .projet-meta {
    font-size: 0.7rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Etat vide projets */
.subv-projets-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.8) 0%, rgba(254, 243, 199, 0.5) 100%);
    border-radius: 10px;
    margin: 0.5rem;
}

.subv-projets-empty svg {
    stroke: var(--orange-subvention);
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

.subv-projets-empty p {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0.5rem 0 0.25rem;
}

.subv-projets-empty span {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Filtres demandes */
.subv-filtres {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(249, 115, 22, 0.08);
    background: rgba(255, 255, 255, 0.8);
}

.subv-filtres select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 8px;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #374151;
    cursor: pointer;
    transition: all 0.25s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.subv-filtres select:hover {
    border-color: rgba(249, 115, 22, 0.3);
}

.subv-filtres select:focus {
    outline: none;
    border-color: var(--orange-subvention);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background-color: var(--card-bg);
}

/* Liste demandes */
.subv-demandes-liste {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: linear-gradient(180deg, #FFFAF5 0%, #FFF7ED 100%);
    min-height: 0;
}

/* Item demande */
.subv-demande-item {
    padding: 0.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.subv-demande-item:hover {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border-color: rgba(249, 115, 22, 0.15);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.1);
    transform: translateX(2px);
}

.subv-demande-item.selected {
    background: var(--orange-subvention-pale);
    border-color: var(--orange-subvention);
}

.subv-demande-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #9ca3af;
    font-size: 0.85rem;
}

/* ========================
   PANNEAU DROITE - CONTENU
   ======================== */
.subv-content-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Zones du panneau droit */
.subv-zone {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Zone 1: Demandes en cours */
.subv-zone-demandes {
    flex: 0 0 auto;
    max-height: 180px;
}

.subv-zone-header {
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border-bottom: 1px solid rgba(249, 115, 22, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subv-zone-header h4 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--orange-subvention-dark);
    margin: 0;
}

.subv-zone-header h4 svg {
    stroke: var(--orange-subvention);
}

.subv-demandes-cards {
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    background: #fafafa;
}

.subv-cards-empty {
    width: 100%;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
    padding: 1rem;
}

.subv-demande-card {
    min-width: 210px;
    max-width: 260px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(249, 115, 22, 0.10);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.subv-demande-card:hover {
    border-color: rgba(249, 115, 22, 0.35);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateY(-3px);
}

.subv-demande-card.active {
    border-color: var(--orange-subvention);
    background: var(--orange-subvention-pale);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.18);
}

.subv-demande-card .card-color-strip {
    height: 4px;
    width: 100%;
}

.subv-demande-card .card-body {
    padding: 0.85rem 1rem 0.75rem;
}

.subv-demande-card .card-organisme-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    color: white;
    margin-bottom: 0.4rem;
}

.subv-demande-card .card-programme-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 0.6rem;
}

.subv-demande-card .card-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subv-demande-card .card-progress-bar {
    flex: 1;
    height: 5px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.subv-demande-card .card-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.subv-demande-card .card-progress-pct {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    min-width: 28px;
    text-align: right;
}

/* Zone 2: Workflow */
.subv-zone-workflow {
    flex: 0 0 auto;
    padding: 0;
}

.subv-workflow-header {
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border-bottom: 1px solid rgba(249, 115, 22, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workflow-projet-titre {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--orange-subvention-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.workflow-actions {
    display: flex;
    gap: 0.4rem;
}

/* Steps du workflow */
.subv-workflow-steps {
    display: flex;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    background: #fafafa;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
    max-width: 200px;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
}

.workflow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 3px;
    background: #e5e7eb;
    z-index: 1;
}

.workflow-step:hover:not(.disabled) {
    background: var(--orange-subvention-pale);
    border-color: rgba(249, 115, 22, 0.3);
}

.workflow-step.disabled {
    opacity: 0.5;
}

.workflow-step.disabled .step-title {
    color: #9ca3af;
}

.workflow-step.completed {
    background: var(--orange-subvention-pale);
    border-color: var(--orange-subvention);
}

.workflow-step.completed::after {
    background: var(--orange-subvention);
}

.workflow-step.completed .step-icon {
    background: var(--orange-subvention);
    color: var(--text-inverse);
}

.workflow-step.active {
    background: var(--orange-subvention-pale);
    border-color: var(--orange-subvention);
}

.workflow-step.active .step-icon {
    background: var(--orange-subvention);
    color: var(--text-inverse);
    animation: pulse-step-orange 1.5s infinite;
}

@keyframes pulse-step-orange {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(249, 115, 22, 0); }
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.step-icon svg {
    width: 16px;
    height: 16px;
}

.step-info {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-status {
    font-size: 0.68rem;
    color: #6b7280;
}

.workflow-step .btn-step {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--orange-subvention);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.workflow-step .btn-step:hover:not(:disabled) {
    background: var(--orange-subvention);
    color: var(--text-inverse);
}

.workflow-step .btn-step:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.workflow-step .btn-step svg {
    width: 12px;
    height: 12px;
}

/* Zone 3: Detail avec onglets */
.subv-zone-detail {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Onglets */
.subv-detail-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border-bottom: 1px solid rgba(249, 115, 22, 0.1);
}

.subv-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subv-tab svg {
    width: 14px;
    height: 14px;
}

.subv-tab:hover {
    background: rgba(249, 115, 22, 0.1);
    color: var(--orange-subvention-dark);
}

.subv-tab.active {
    background: var(--orange-subvention);
    color: var(--text-inverse);
    font-weight: 600;
}

.subv-tab.active svg {
    stroke: var(--text-inverse);
}

/* Contenu des onglets */
.subv-tab-content {
    flex: 1;
    display: none;
    overflow-y: auto;
    padding: 1.25rem;
    min-height: 0;
}

.subv-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Etat vide dans les onglets */
.tab-content-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
}

.tab-content-empty svg {
    stroke: var(--orange-subvention);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.tab-content-empty h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--orange-subvention-dark);
    margin: 0 0 0.5rem;
}

.tab-content-empty p {
    color: #6b7280;
    font-size: 0.9rem;
    max-width: 350px;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

/* Resultat dans les onglets */
.tab-content-result {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Boutons d'export */
.export-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 1200px) {
    .subv-main-container {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 992px) {
    .subv-main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
    }

    .subv-projets-panel {
        max-height: 350px;
    }

    .subv-section-projets {
        max-height: 150px;
    }
}

@media (max-width: 768px) {
    .subv-workflow-steps {
        flex-direction: column;
    }

    .workflow-step {
        max-width: none;
        min-width: auto;
    }

    .workflow-step:not(:last-child)::after {
        display: none;
    }

    .subv-detail-tabs {
        flex-wrap: wrap;
    }
}

/* ========================
   DARK MODE
   ======================== */
[data-theme="dark"] .subv-projets-panel,
[data-theme="dark"] .subv-zone {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .subv-projets-liste,
[data-theme="dark"] .subv-demandes-liste {
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

[data-theme="dark"] .subv-projet-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .subv-projet-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--orange-subvention);
}

[data-theme="dark"] .subv-projet-item.selected {
    background: rgba(249, 115, 22, 0.15);
}

[data-theme="dark"] .subv-zone-header,
[data-theme="dark"] .subv-workflow-header,
[data-theme="dark"] .subv-detail-tabs {
    background: rgba(249, 115, 22, 0.1);
}

[data-theme="dark"] .subv-projets-empty {
    background: rgba(249, 115, 22, 0.08);
}

[data-theme="dark"] .subv-demandes-cards,
[data-theme="dark"] .subv-workflow-steps {
    background: var(--bg-secondary);
}

[data-theme="dark"] .workflow-step {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .subv-tab:hover {
    background: rgba(249, 115, 22, 0.15);
}

[data-theme="dark"] .tab-content-empty {
    background: var(--bg-secondary);
}

/* ============================================
   MODULE PERFORMANCE IA - BENCHMARK COMPARATIF
   ============================================ */

/* Container principal */
.performance-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: auto 1fr;
    gap: 12px;
    padding: 0;
    min-height: calc(100vh - 200px);
}

/* Panel de configuration */
.perf-config-panel {
    grid-row: span 2;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: fit-content;
}

.perf-config-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
    padding: 20px 24px;
    color: white;
}

.perf-config-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.perf-config-header h3 svg {
    opacity: 0.9;
}

.perf-config-body {
    padding: 24px;
}

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

.perf-config-body .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.perf-config-body .form-group label svg {
    color: #8B5CF6;
}

.perf-config-body select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.perf-config-body select:focus {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    outline: none;
}

/* Grille des méthodes */
.perf-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.perf-method-option {
    cursor: pointer;
}

.perf-method-option input[type="checkbox"] {
    display: none;
}

.perf-method-option .method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    transition: all 0.2s;
    text-align: center;
}

.perf-method-option input:checked + .method-card {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.perf-method-option .method-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.perf-method-option .method-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.perf-method-option .method-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Carte méthodes couleurs spécifiques */
.method-card.method-simple { border-color: #10B981; }
.perf-method-option input:checked + .method-card.method-simple {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.08);
}

.method-card.method-hemisync { border-color: #3B82F6; }
.perf-method-option input:checked + .method-card.method-hemisync {
    border-color: #3B82F6;
    background: rgba(59, 130, 246, 0.08);
}

.method-card.method-hemisync-plus { border-color: #F59E0B; }
.perf-method-option input:checked + .method-card.method-hemisync-plus {
    border-color: #F59E0B;
    background: rgba(245, 158, 11, 0.08);
}

.method-card.method-proteus { border-color: #8B5CF6; }
.perf-method-option input:checked + .method-card.method-proteus {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.08);
}

/* Boutons d'action */
.perf-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-benchmark {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-benchmark:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-benchmark:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Panel des résultats */
.perf-results-panel {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.perf-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.perf-results-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.perf-results-header h3 svg {
    color: #8B5CF6;
}

/* Section de progression */
.perf-progress-section {
    padding: 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(59, 130, 246, 0.05));
}

.perf-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.perf-progress-title {
    font-weight: 600;
    color: var(--text-primary);
}

.perf-progress-percent {
    font-weight: 700;
    color: #8B5CF6;
    font-size: 1.1rem;
}

.perf-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.perf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #3B82F6);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.perf-current-method {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.perf-current-method::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #8B5CF6;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

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

/* Tableau comparatif */
.perf-comparison-table {
    padding: 24px;
    overflow-x: auto;
}

.perf-comparison-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.perf-comparison-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.perf-comparison-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.perf-comparison-table tr:hover td {
    background: rgba(139, 92, 246, 0.03);
}

.perf-comparison-table .method-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.method-badge.badge-simple {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.method-badge.badge-hemisync {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.method-badge.badge-hemisync-plus {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.method-badge.badge-proteus {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.perf-comparison-table .status-success {
    color: #10B981;
    font-weight: 600;
}

.perf-comparison-table .status-error {
    color: #EF4444;
    font-weight: 600;
}

.perf-comparison-table .status-running {
    color: #F59E0B;
    font-weight: 600;
}

.perf-comparison-table .best-value {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    font-weight: 700;
    border-radius: 6px;
    padding: 4px 8px;
}

/* Grille des graphiques */
.perf-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 24px;
}

.perf-chart-card {
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
}

.perf-chart-card h4 {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.perf-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.perf-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.perf-bar-label {
    width: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.perf-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.perf-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.perf-bar-fill span {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.perf-bar-fill.bar-simple { background: linear-gradient(90deg, #10B981, #34D399); }
.perf-bar-fill.bar-hemisync { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.perf-bar-fill.bar-hemisync-plus { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.perf-bar-fill.bar-proteus { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }

/* Comparaison de contenu */
.perf-content-comparison {
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

.perf-content-comparison h4 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.perf-content-comparison h4 svg {
    color: #8B5CF6;
}

.perf-content-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.perf-tab {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.perf-tab:hover {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

.perf-tab.active {
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    color: white;
    border-color: transparent;
}

.perf-content-viewer {
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.perf-content-viewer .placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 40px;
}

/* Panel historique */
.perf-history-panel {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.perf-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.perf-history-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.perf-history-header h3 svg {
    color: #8B5CF6;
}

.perf-history-list {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.perf-history-list .placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.perf-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.perf-history-item:hover {
    border-color: #8B5CF6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.perf-history-item:last-child {
    margin-bottom: 0;
}

.perf-history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.perf-history-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.perf-history-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.perf-history-winner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8B5CF6;
}

/* Responsive */
@media (max-width: 1200px) {
    .performance-container {
        grid-template-columns: 1fr;
    }

    .perf-config-panel {
        grid-row: auto;
    }

    .perf-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .perf-methods-grid {
        grid-template-columns: 1fr;
    }

    .perf-content-tabs {
        flex-direction: column;
    }

    .perf-tab {
        width: 100%;
        text-align: center;
    }
}

/* Dark mode */
[data-theme="dark"] .perf-config-panel,
[data-theme="dark"] .perf-results-panel,
[data-theme="dark"] .perf-history-panel {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .perf-method-option .method-card {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .perf-chart-card {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .perf-content-viewer {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .perf-history-item {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* ================================================
   MODAL PROJETS PROFESSEUR
   ================================================ */

#modal-projets-professeur .modal-content {
    max-width: 800px;
}

#modal-projets-prof-titre {
    display: flex;
    align-items: center;
    gap: 8px;
}

#modal-projets-prof-titre svg {
    color: var(--primary-color);
}

.projets-prof-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.projets-prof-empty svg {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.projets-prof-empty p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.projets-prof-empty .hint {
    font-size: 0.9rem;
    opacity: 0.7;
}

.projets-prof-stats {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.projets-prof-stats .stat-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.projets-prof-stats .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.projets-prof-stats .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.projets-prof-liste {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.projet-prof-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.projet-prof-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.projet-prof-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-2px);
}

.projet-prof-card:hover::before {
    transform: scaleY(1);
}

.projet-prof-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.projet-prof-titre {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.projet-prof-score {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.projet-prof-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.projet-prof-role {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 6px;
}

.projet-prof-role strong {
    color: var(--primary-color);
}

.projet-prof-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.projet-prof-agent {
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.projet-prof-objectif {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.projet-prof-action {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.projet-prof-card:hover .projet-prof-action {
    opacity: 1;
    transform: translateX(0);
}

.projet-prof-action svg {
    transition: transform 0.3s ease;
}

.projet-prof-card:hover .projet-prof-action svg {
    transform: translateX(4px);
}

/* Dark mode */
[data-theme="dark"] .projet-prof-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .projet-prof-card:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .projet-prof-role,
[data-theme="dark"] .projet-prof-agent {
    background: var(--bg-secondary);
}

/* Bouton Historique des projets dans la fiche professeur */
.btn-projets-prof {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    text-decoration: none;
}

.btn-projets-prof:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-projets-prof svg {
    flex-shrink: 0;
}

[data-theme="dark"] .btn-projets-prof {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .btn-projets-prof:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.4);
}

/* ==============================================
   STYLES CONTENU GENERE SUBVENTIONS
   ============================================== */

.subv-contenu-genere {
    padding: 1.5rem;
}

.subv-contenu-genere .contenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.subv-contenu-genere .contenu-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.subv-contenu-genere .contenu-actions {
    display: flex;
    gap: 0.5rem;
}

.subv-contenu-genere .contenu-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.subv-contenu-genere .contenu-section {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
}

.subv-contenu-genere .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary, #f3f4f6);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.subv-contenu-genere .section-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.subv-contenu-genere .section-actions {
    display: flex;
    gap: 0.25rem;
}

.subv-contenu-genere .btn-edit-section {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    transition: all 0.2s ease;
}

.subv-contenu-genere .btn-edit-section:hover {
    background: var(--bg-hover, #e5e7eb);
    color: var(--primary-color, #E2231A);
}

.subv-contenu-genere .section-content {
    padding: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary, #374151);
}

.subv-contenu-genere .section-content p {
    margin: 0 0 1rem 0;
}

.subv-contenu-genere .section-content p:last-child {
    margin-bottom: 0;
}

.subv-contenu-genere .section-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 1.5rem 0 0.75rem 0;
}

.subv-contenu-genere .section-content h4:first-child {
    margin-top: 0;
}

.subv-contenu-genere .section-content h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary, #4b5563);
    margin: 1rem 0 0.5rem 0;
}

.subv-contenu-genere .section-content strong {
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.subv-contenu-genere .section-content ul,
.subv-contenu-genere .section-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.subv-contenu-genere .section-content li {
    margin-bottom: 0.5rem;
}

.subv-contenu-genere .section-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    justify-content: center;
    color: var(--text-muted, #6b7280);
}

/* Mode sombre */
[data-theme="dark"] .subv-contenu-genere .contenu-header {
    border-color: var(--border-color);
}

[data-theme="dark"] .subv-contenu-genere .contenu-header h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .subv-contenu-genere .contenu-section {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .subv-contenu-genere .section-header {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .subv-contenu-genere .section-header h5 {
    color: var(--text-primary);
}

[data-theme="dark"] .subv-contenu-genere .btn-edit-section {
    color: var(--text-muted);
}

[data-theme="dark"] .subv-contenu-genere .btn-edit-section:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

[data-theme="dark"] .subv-contenu-genere .section-content {
    color: var(--text-primary);
}

[data-theme="dark"] .subv-contenu-genere .section-content h4,
[data-theme="dark"] .subv-contenu-genere .section-content h5,
[data-theme="dark"] .subv-contenu-genere .section-content strong {
    color: var(--text-primary);
}

/* Boutons subventions outline */
.btn-subv-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color, #E2231A);
    background: transparent;
    border: 1px solid var(--primary-color, #E2231A);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-subv-outline:hover {
    background: var(--primary-color, #E2231A);
    color: white;
}

.btn-subv-outline svg {
    flex-shrink: 0;
}

[data-theme="dark"] .btn-subv-outline {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .btn-subv-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================== */
/* SUBVENTIONS V2 - STYLES ANALYSE               */
/* ============================================== */

.subv-analyse-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Score Card */
.analyse-score-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff8f5 0%, #fff 100%);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.score-circle {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        var(--score-color, #10B981) calc(var(--score-percent, 75) * 3.6deg),
        #e5e7eb calc(var(--score-percent, 75) * 3.6deg)
    );
    border-radius: 50%;
    flex-shrink: 0;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
}

.score-value {
    position: relative;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--score-color, #10B981);
    line-height: 1;
}

.score-label {
    position: relative;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.score-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.score-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Sections Analyse */
.analyse-section {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem;
}

.analyse-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.analyse-section h4 svg {
    flex-shrink: 0;
}

/* Points Lists */
.points-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.points-list li {
    position: relative;
    padding: 0.625rem 0 0.625rem 1.75rem;
    font-size: 0.9rem;
    color: var(--text-primary, #374151);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.points-list li:last-child {
    border-bottom: none;
}

.points-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.points-list.success li::before {
    background: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.points-list.warning li::before {
    background: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.points-list.info li::before {
    background: var(--orange-subvention, #E88B2E);
    box-shadow: 0 0 0 3px rgba(232, 139, 46, 0.2);
}

/* Programme Badges */
.programmes-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.programme-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    background: var(--prog-color, #666);
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Strategie Results */
.subv-strategie-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.strategie-card {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem;
}

.strategie-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.strategie-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border-left: 3px solid var(--orange-subvention, #E88B2E);
}

.timeline-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--orange-subvention, #E88B2E);
    white-space: nowrap;
    min-width: 80px;
}

.timeline-content {
    font-size: 0.875rem;
    color: var(--text-primary, #374151);
}

/* ============================================== */
/* SUBVENTIONS V2 - STYLES STRATEGIE             */
/* ============================================== */

.subv-strategie-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.strategie-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.strategie-header h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.strategie-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Programme Principal */
.strategie-programme {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.strategie-programme.principal {
    background: linear-gradient(135deg, #fff8f5 0%, #fff 100%);
    border: 2px solid var(--orange-subvention, #E88B2E);
    box-shadow: 0 4px 12px rgba(232, 139, 46, 0.15);
}

.strategie-programme.alt {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
}

.strategie-programme.alt:hover {
    background: var(--bg-tertiary, #f3f4f6);
    border-color: var(--orange-subvention, #E88B2E);
}

.programme-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.programme-badge-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
}

.programme-badge-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    border-radius: 6px;
    min-width: 60px;
    flex-shrink: 0;
}

.programme-info {
    flex: 1;
}

.programme-info h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.match-score {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
}

.programme-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.programme-details p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-primary, #374151);
}

.programme-details strong {
    color: #6b7280;
    font-weight: 500;
}

.programme-actions {
    display: flex;
    justify-content: flex-end;
}

.programme-nom {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #111827);
}

.programme-montant {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Conseils */
.strategie-conseils {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem;
}

.strategie-conseils h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.strategie-conseils h5::before {
    content: '💡';
    font-size: 1.125rem;
}

.strategie-conseils ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.strategie-conseils li {
    position: relative;
    padding: 0.625rem 0 0.625rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-primary, #374151);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.strategie-conseils li:last-child {
    border-bottom: none;
}

.strategie-conseils li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--orange-subvention, #E88B2E);
    font-weight: 600;
}

/* Alternatives */
.strategie-alternatives {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem;
}

.strategie-alternatives h5 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.alt-programmes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Generation Loading */
.subv-generation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.generation-progress {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.progress-item.active {
    opacity: 1;
}

.progress-item.completed {
    opacity: 1;
}

.progress-item.completed .progress-icon {
    background: #10B981;
    border-color: #10B981;
}

.progress-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--orange-subvention, #E88B2E);
    background: white;
    border: 2px solid var(--orange-subvention, #E88B2E);
    border-radius: 50%;
}

.progress-item.active .progress-icon {
    background: var(--orange-subvention, #E88B2E);
    color: white;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.progress-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

/* Dark Mode Strategie */
[data-theme="dark"] .strategie-header {
    border-color: var(--border-color);
}

[data-theme="dark"] .strategie-header h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .strategie-programme {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color);
}

[data-theme="dark"] .strategie-programme.principal {
    background: linear-gradient(135deg, rgba(232, 139, 46, 0.15) 0%, var(--bg-tertiary) 100%);
}

[data-theme="dark"] .strategie-programme.alt:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .programme-info h5,
[data-theme="dark"] .programme-nom {
    color: var(--text-primary);
}

[data-theme="dark"] .programme-details {
    background: var(--bg-secondary);
}

[data-theme="dark"] .programme-details p {
    color: var(--text-primary);
}

[data-theme="dark"] .strategie-conseils,
[data-theme="dark"] .strategie-alternatives {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color);
}

[data-theme="dark"] .strategie-conseils h5,
[data-theme="dark"] .strategie-alternatives h5 {
    color: var(--text-primary);
}

[data-theme="dark"] .strategie-conseils li {
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .progress-icon {
    background: var(--bg-secondary);
}

/* ============================================== */
/* SUBVENTIONS V2 - STYLES EXPORT                */
/* ============================================== */

.subv-export-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

.subv-export-options h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.subv-export-options > p {
    margin: 0 0 2rem 0;
    font-size: 1rem;
    color: #6b7280;
}

.export-formats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.export-format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 2.5rem;
    background: var(--bg-secondary, #f9fafb);
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.export-format-card:hover {
    border-color: var(--orange-subvention, #E88B2E);
    background: linear-gradient(135deg, #fff8f5 0%, #fff 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(232, 139, 46, 0.2);
}

.export-format-card:active {
    transform: translateY(-2px);
}

.export-format-card svg {
    transition: transform 0.3s ease;
}

.export-format-card:hover svg {
    transform: scale(1.1);
}

.export-format-card h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.export-format-card p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Export Result / Success */
.subv-export-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem;
    text-align: center;
}

.export-success-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.export-success-icon svg {
    color: white;
}

.subv-export-success h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.subv-export-success p {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    color: #6b7280;
}

.export-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Export Loading */
.subv-export-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
}

.subv-export-loading .spinner-ring {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
}

.subv-export-loading p {
    font-size: 1rem;
    color: var(--text-primary, #374151);
    margin: 0;
}

/* Dark Mode Export */
[data-theme="dark"] .subv-export-options h4,
[data-theme="dark"] .subv-export-success h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .export-format-card {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color);
}

[data-theme="dark"] .export-format-card:hover {
    background: linear-gradient(135deg, rgba(232, 139, 46, 0.15) 0%, var(--bg-tertiary) 100%);
}

[data-theme="dark"] .export-format-card h5 {
    color: var(--text-primary);
}

/* Dark Mode */
[data-theme="dark"] .analyse-score-card {
    background: linear-gradient(135deg, rgba(232, 139, 46, 0.1) 0%, var(--bg-secondary) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .score-circle::before {
    background: var(--bg-secondary);
}

[data-theme="dark"] .score-info h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .analyse-section {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color);
}

[data-theme="dark"] .analyse-section h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .points-list li {
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .strategie-card {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color);
}

[data-theme="dark"] .timeline-item {
    background: var(--bg-secondary);
}

[data-theme="dark"] .timeline-content {
    color: var(--text-primary);
}

/* Loading state */
.subv-analyse-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.spinner-container {
    margin-bottom: 1rem;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, #e5e7eb);
    border-top-color: var(--orange-subvention, #E88B2E);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.spinner-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 0.5rem 0;
}

.spinner-subtext {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    max-width: 400px;
}

/* ============================================
   ACCORDEON NOUVEAUTES - DARK MODE
   ============================================ */

[data-theme="dark"] .nouveautes-accordion {
    background: transparent;
}

[data-theme="dark"] .accordion-section {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .accordion-section:hover {
    border-color: var(--border-dark, #475569);
}

[data-theme="dark"] .accordion-header {
    background: linear-gradient(135deg, var(--bg-tertiary, #1f2937) 0%, rgba(51, 65, 85, 0.8) 100%);
}

[data-theme="dark"] .accordion-header:hover {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.9) 0%, rgba(71, 85, 105, 0.8) 100%);
}

[data-theme="dark"] .accordion-icon {
    color: var(--neon-blue, #00d4ff);
}

[data-theme="dark"] .accordion-titre {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .accordion-count {
    background: linear-gradient(135deg, var(--neon-blue, #00d4ff) 0%, var(--info, #3b82f6) 100%);
    color: #0f172a;
}

[data-theme="dark"] .accordion-preview {
    color: var(--text-muted, #94a3b8);
}

[data-theme="dark"] .accordion-chevron {
    color: var(--text-muted, #94a3b8);
}

[data-theme="dark"] .accordion-actions {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color, #334155);
}

/* Compact Items - Dark Mode */
[data-theme="dark"] .compact-item {
    background: var(--bg-tertiary, #1f2937);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .compact-item:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: var(--neon-blue, #00d4ff);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

[data-theme="dark"] .compact-titre {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .compact-desc {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .compact-date {
    color: var(--text-muted, #94a3b8);
}

[data-theme="dark"] .compact-source {
    color: var(--text-muted, #64748b);
}

[data-theme="dark"] .compact-meta {
    color: var(--text-muted, #94a3b8);
}

/* Compact Buttons - Dark Mode */
[data-theme="dark"] .compact-btn-valid {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-light, #34d399);
}

[data-theme="dark"] .compact-btn-valid:hover {
    background: var(--success, #10b981);
    color: #0f172a;
}

[data-theme="dark"] .compact-btn-reject {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-light, #f87171);
}

[data-theme="dark"] .compact-btn-reject:hover {
    background: var(--error, #ef4444);
    color: white;
}

/* Outline Buttons - Dark Mode */
[data-theme="dark"] .btn-success-outline {
    border-color: var(--success-light, #34d399);
    color: var(--success-light, #34d399);
}

[data-theme="dark"] .btn-success-outline:hover {
    background: var(--success, #10b981);
    color: #0f172a;
}

[data-theme="dark"] .btn-danger-outline {
    border-color: var(--error-light, #f87171);
    color: var(--error-light, #f87171);
}

[data-theme="dark"] .btn-danger-outline:hover {
    background: var(--error, #ef4444);
    color: white;
}

/* Nouveautes Body - Dark Mode */
[data-theme="dark"] .nouveautes-body {
    background: var(--bg-primary, #0f172a);
}

[data-theme="dark"] .nouveautes-synthese-box {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-color, #334155);
    border-left-color: var(--neon-blue, #00d4ff);
}

[data-theme="dark"] .nouveautes-synthese-box h4 {
    color: var(--neon-blue, #00d4ff);
}

[data-theme="dark"] .nouveautes-synthese-box p {
    color: var(--text-secondary, #cbd5e1);
}

/* Badges - Dark Mode */
[data-theme="dark"] .compact-badge {
    opacity: 0.9;
}

[data-theme="dark"] .confiance-haute,
[data-theme="dark"] .confiance-high,
[data-theme="dark"] .confiance-élevé {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-light, #34d399);
}

[data-theme="dark"] .confiance-moyen,
[data-theme="dark"] .confiance-medium,
[data-theme="dark"] .confiance-moyenne {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-light, #fbbf24);
}

[data-theme="dark"] .confiance-faible,
[data-theme="dark"] .confiance-low,
[data-theme="dark"] .confiance-basse {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-light, #f87171);
}

/* Nouveautes Modal - Dark Mode */
[data-theme="dark"] .nouveautes-modal-content {
    background: var(--bg-primary, #0f172a);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .nouveautes-header {
    background: linear-gradient(135deg, var(--header-gradient-start, #0c1445) 0%, var(--header-gradient-end, #1b4f72) 100%);
}

[data-theme="dark"] .nouveautes-footer {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-color, #334155);
}

/* ============================================
   DISTINCTION NOUVEAUX vs EXISTANTS
   ============================================ */

/* Badge NOUVEAU - Vert/Cyan lumineux */
.status-new {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    animation: pulseNew 2s ease-in-out infinite;
}

@keyframes pulseNew {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.3); }
}

/* Badge EXISTANT - Gris discret */
.status-existing {
    background: #94a3b8;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
}

/* Item NOUVEAU - Bordure verte lumineuse */
.compact-item.item-new {
    border-left: 4px solid #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, transparent 30%);
}

.compact-item.item-new:hover {
    border-left-color: #06b6d4;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(248, 250, 252, 1) 30%);
}

/* Item EXISTANT - Bordure grise, fond légèrement différent */
.compact-item.item-existing {
    border-left: 4px solid #94a3b8;
    background: rgba(148, 163, 184, 0.05);
    opacity: 0.85;
}

.compact-item.item-existing:hover {
    opacity: 1;
    background: rgba(148, 163, 184, 0.1);
}

.compact-item.item-existing .compact-titre {
    color: #64748b;
}

/* Dark Mode - NOUVEAU */
[data-theme="dark"] .status-new {
    background: linear-gradient(135deg, #34d399 0%, #22d3ee 100%);
    color: #0f172a;
}

[data-theme="dark"] .compact-item.item-new {
    border-left-color: #34d399;
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.15) 0%, transparent 30%);
}

[data-theme="dark"] .compact-item.item-new:hover {
    border-left-color: #22d3ee;
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.25) 0%, var(--bg-tertiary) 30%);
}

/* Dark Mode - EXISTANT */
[data-theme="dark"] .status-existing {
    background: #64748b;
    color: #e2e8f0;
}

[data-theme="dark"] .compact-item.item-existing {
    border-left-color: #64748b;
    background: rgba(100, 116, 139, 0.1);
    opacity: 0.75;
}

[data-theme="dark"] .compact-item.item-existing:hover {
    opacity: 1;
    background: rgba(100, 116, 139, 0.2);
}

[data-theme="dark"] .compact-item.item-existing .compact-titre {
    color: #94a3b8;
}

/* Compteur dans l'accordéon - distinguer nouveaux */
.accordion-count-new {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%) !important;
}

[data-theme="dark"] .accordion-count-new {
    background: linear-gradient(135deg, #34d399 0%, #22d3ee 100%) !important;
    color: #0f172a !important;
}

/* =============================================
   OVERLAY DE CHARGEMENT DETAILLE
   ============================================= */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.97);
}

.loading-overlay-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.loading-spinner-large {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loadingSpin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.loading-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-status {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.loading-steps {
    text-align: left;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.loading-step.active {
    color: var(--primary);
    font-weight: 500;
}

.loading-step.completed {
    color: var(--success);
}

.loading-step.error {
    color: var(--danger);
}

.loading-step-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.loading-step-icon .spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loadingSpin 0.8s linear infinite;
}

.loading-step-icon svg {
    width: 16px;
    height: 16px;
}

.loading-step.completed .loading-step-icon svg {
    stroke: var(--success);
}

.loading-step.error .loading-step-icon svg {
    stroke: var(--danger);
}

.loading-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ============================================
   VISUALISATEUR DE DOCUMENT
   ============================================ */

.doc-viewer-modal {
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.doc-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--blue-ai) 0%, var(--blue-accent) 100%);
    border-radius: 12px 12px 0 0;
}

.doc-viewer-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.doc-viewer-title svg {
    stroke: white;
    opacity: 0.9;
}

.doc-viewer-title h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.doc-viewer-subtitle {
    font-size: 0.85rem;
    opacity: 0.85;
    color: white;
}

.doc-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-viewer-actions .btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
}

.doc-viewer-actions .btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.doc-viewer-actions .btn-primary {
    background: white;
    color: var(--blue-ai);
}

.doc-viewer-actions .btn-primary:hover {
    background: #f0f0f0;
}

.doc-viewer-actions .modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0 8px;
}

.doc-viewer-actions .modal-close:hover {
    opacity: 1;
}

.doc-viewer-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--bg-secondary);
}

.doc-viewer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.doc-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.doc-meta-item svg {
    stroke: var(--text-muted);
    opacity: 0.7;
}

.doc-viewer-paper {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    justify-content: center;
}

.doc-paper-content {
    background: white;
    width: 100%;
    max-width: 700px;
    padding: 40px 50px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
}

/* Etat de chargement du document */
.doc-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.doc-loading-state p {
    margin-top: 16px;
    font-size: 1rem;
    color: #555;
}

.doc-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--blue-ai, #0066cc);
    border-radius: 50%;
    animation: doc-spin 1s linear infinite;
}

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

[data-theme="dark"] .doc-loading-state {
    color: #aaa;
}

[data-theme="dark"] .doc-loading-state p {
    color: #bbb;
}

[data-theme="dark"] .doc-loading-spinner {
    border-color: #444;
    border-top-color: var(--blue-ai, #4a9eff);
}

/* En-tete du document */
.doc-header-block {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.doc-logo {
    flex-shrink: 0;
}

.doc-header-info {
    flex: 1;
}

.doc-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-ai);
    margin: 0 0 4px 0;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.doc-header-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 2px 0;
}

.doc-header-contact {
    font-size: 0.85rem;
    color: var(--blue-accent);
    margin: 0;
}

.doc-divider {
    border: none;
    border-top: 2px solid var(--red-ets);
    margin: 20px 0;
}

/* Espaceur pour lignes vides (condensé) */
.doc-spacer {
    height: 4px;
}

/* Sections du document */
.doc-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--blue-ai);
    margin: 12px 0 4px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-subsection-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
    margin: 8px 0 2px 0;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.doc-paragraph {
    margin: 2px 0;
    text-align: justify;
}

.doc-paragraph strong {
    color: var(--blue-ai);
}

.doc-list {
    margin: 2px 0;
    padding-left: 20px;
}

.doc-list li {
    margin: 1px 0;
    position: relative;
}

.doc-list li::marker {
    color: var(--red-ets);
}

/* Etat vide */
.doc-empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #999;
}

.doc-empty-state svg {
    margin-bottom: 16px;
}

.doc-empty-state p {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    color: #666;
}

.doc-empty-state span {
    font-size: 0.9rem;
}

/* Dark mode */
[data-theme="dark"] .doc-paper-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .doc-main-title {
    color: var(--neon-blue);
}

[data-theme="dark"] .doc-section-title {
    color: var(--neon-blue);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .doc-subsection-title {
    color: var(--text-secondary);
}

[data-theme="dark"] .doc-divider {
    border-top-color: var(--red-light);
}

[data-theme="dark"] .doc-paragraph strong {
    color: var(--neon-blue);
}

[data-theme="dark"] .doc-header-subtitle {
    color: var(--text-muted);
}

[data-theme="dark"] .doc-empty-state p {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .doc-viewer-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .doc-viewer-header {
        border-radius: 0;
        padding: 12px 16px;
    }

    .doc-paper-content {
        padding: 24px 20px;
    }

    .doc-viewer-title h3 {
        font-size: 1rem;
    }
}

/* ========================================
   AI Detection Module Styles
   ======================================== */

.ai-detection-container {
    margin-bottom: 16px;
}

.ai-detection-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 12px 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.ai-detection-loading {
    justify-content: center;
    padding: 16px;
}

.ai-detection-loading .ai-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--blue-ai, #0066cc);
    border-radius: 50%;
    animation: doc-spin 1s linear infinite;
    margin-right: 12px;
}

.ai-detection-error {
    background: #fff5f5;
    border-color: #ffcdd2;
    color: #c62828;
    justify-content: center;
}

.ai-rate-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-rate-circle {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: conic-gradient(
        var(--rate-color) var(--rate-percent),
        #e9ecef var(--rate-percent)
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-rate-circle::before {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
}

.ai-rate-value {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 0.9rem;
    color: #333;
}

.ai-rate-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-rate-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-rate-status {
    font-weight: 600;
    font-size: 0.9rem;
}

.ai-rate-confidence {
    font-size: 0.75rem;
    color: #888;
}

.ai-rate-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-humanize-btn,
.ai-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.ai-humanize-btn {
    background: linear-gradient(135deg, var(--blue-ai) 0%, #0052a3 100%);
    color: white;
}

.ai-humanize-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.ai-details-btn {
    background: #f1f3f4;
    color: #333;
    border: 1px solid #ddd;
}

.ai-details-btn:hover {
    background: #e8eaeb;
}

/* Details Modal */
.ai-details-summary {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.ai-details-rate {
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ai-details-rate .rate-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--rate-color);
}

.ai-details-rate .rate-label {
    font-size: 0.8rem;
    color: #666;
}

.ai-details-meta p {
    margin: 4px 0;
    font-size: 0.9rem;
}

.ai-indicators-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.ai-indicator-item {
    background: #f8f9fa;
    padding: 10px 14px;
    border-radius: 8px;
}

.ai-indicator-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ai-indicator-label {
    font-size: 0.85rem;
    color: #555;
}

.ai-indicator-value {
    font-weight: 600;
    font-size: 0.85rem;
}

.ai-indicator-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.ai-indicator-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ai-details-legend {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* Humanize Modal */
.humanize-current-rate {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1rem;
}

.humanize-current-rate strong {
    font-size: 1.2rem;
}

.humanize-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.humanize-options .form-group {
    margin-bottom: 0;
}

.humanize-options label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.target-rate-slider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.target-rate-slider input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: linear-gradient(to right, #28a745, #ffc107, #dc3545);
    border-radius: 4px;
}

.target-rate-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid var(--blue-ai);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#target-rate-display {
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

.humanize-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #1565c0;
}

.humanize-info svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.humanize-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.humanize-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.humanize-progress .ai-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--blue-ai);
    border-radius: 50%;
    animation: doc-spin 1s linear infinite;
}

.humanize-error {
    padding: 12px;
    margin-bottom: 12px;
}

/* Humanize Result */
.humanize-result-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
}

.stat-box {
    text-align: center;
    padding: 12px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-box.reduction {
    background: #e8f5e9;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-arrow {
    font-size: 1.5rem;
    color: #666;
}

.humanize-result-content {
    margin-bottom: 20px;
}

.humanize-result-content .content-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.humanize-result-content .tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
}

.humanize-result-content .tab-btn:hover {
    background: #f1f3f4;
}

.humanize-result-content .tab-btn.active {
    background: var(--blue-ai);
    color: white;
}

#ai-humanize-result-modal .tab-content {
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    display: block !important;
}

#ai-humanize-result-modal .tab-content[style*="display: none"] {
    display: none !important;
}

#ai-humanize-result-modal .result-text {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    color: #333;
    word-wrap: break-word;
}

.humanize-result-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* Dark Mode */
[data-theme="dark"] .ai-detection-badge {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .ai-rate-circle::before {
    background: var(--bg-secondary);
}

[data-theme="dark"] .ai-rate-value {
    color: var(--text-primary);
}

[data-theme="dark"] .ai-rate-label,
[data-theme="dark"] .ai-rate-confidence {
    color: var(--text-muted);
}

[data-theme="dark"] .ai-details-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .ai-details-summary,
[data-theme="dark"] .ai-indicator-item,
[data-theme="dark"] .humanize-current-rate,
[data-theme="dark"] .humanize-result-stats,
[data-theme="dark"] .tab-content {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .ai-details-rate,
[data-theme="dark"] .stat-box {
    background: var(--bg-secondary);
}

[data-theme="dark"] .stat-box.reduction {
    background: rgba(40, 167, 69, 0.15);
}

[data-theme="dark"] .humanize-info {
    background: rgba(33, 150, 243, 0.1);
    color: #64b5f6;
}

[data-theme="dark"] .ai-indicator-bar {
    background: var(--bg-secondary);
}

[data-theme="dark"] .result-text {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 600px) {
    .ai-detection-badge {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-rate-display {
        justify-content: center;
    }

    .ai-rate-actions {
        justify-content: center;
    }

    .humanize-result-stats {
        flex-direction: column;
    }

    .stat-arrow {
        transform: rotate(90deg);
    }
}

/* ============================================
   AGENTS IA MUTATIFS - STYLES
   ============================================ */

/* Stats Bar */
.mutative-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.mutative-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.mutative-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mutative-stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.mutative-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.mutative-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tabs Navigation */
.mutative-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.mutative-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.mutative-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mutative-tab.active {
    background: linear-gradient(135deg, #10B981, #3B82F6);
    color: white;
}

.mutative-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #EF4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
}

/* Tab Content */
.mutative-content {
    background: var(--card-bg);
    border-radius: 12px;
    min-height: 400px;
}

.mutative-tab-content {
    display: none;
    padding: 1.5rem;
}

.mutative-tab-content.active {
    display: block;
}

/* Loading and Placeholder */
.loading-placeholder,
.suggestions-placeholder,
.profiles-placeholder,
.patterns-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    text-align: center;
}

.loading-placeholder .spinner,
.spinner-small {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

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

/* Suggestions Header */
.mutative-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.suggestions-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.suggestions-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-generate-suggestions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #10B981, #3B82F6);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-generate-suggestions:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-generate-suggestions:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Suggestion Cards */
.suggestions-list {
    display: grid;
    gap: 1rem;
}

.suggestion-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.suggestion-card:hover {
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.suggestion-priority {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.priority-high .priority-dot { background: #EF4444; }
.priority-medium .priority-dot { background: #F59E0B; }
.priority-low .priority-dot { background: #10B981; }

.priority-high { color: #EF4444; }
.priority-medium { color: #F59E0B; }
.priority-low { color: #10B981; }

.suggestion-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--bg-primary);
}

.status-pending { color: #F59E0B; }
.status-approved { color: #10B981; }
.status-rejected { color: #EF4444; }
.status-implemented { color: #3B82F6; }

.suggestion-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.suggestion-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.suggestion-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: color-mix(in srgb, var(--domain-color, #6B7280) 15%, transparent);
    color: var(--domain-color, #6B7280);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.suggestion-rationale {
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.suggestion-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.suggestion-meta .complexity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-success {
    background: #10B981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #EF4444;
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

/* Profile Cards */
.profiles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profiles-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    flex: 1;
    max-width: 400px;
}

.profiles-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.profile-card:hover {
    border-color: #3B82F6;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-email {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-scores {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-bar-item {
    display: grid;
    grid-template-columns: 24px 1fr 40px;
    align-items: center;
    gap: 0.5rem;
}

.score-label {
    font-size: 1rem;
    text-align: center;
}

.score-bar-container {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.score-value {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.profile-meta {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Pattern Cards */
.patterns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.patterns-filters {
    display: flex;
    gap: 0.75rem;
}

.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.pattern-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.pattern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pattern-domain {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.pattern-type {
    font-size: 0.85rem;
    font-weight: 500;
}

.pattern-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.pattern-confidence {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.confidence-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #3B82F6);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Evolution Metrics */
.evolution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.proteus-version {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.evolution-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.evolution-metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric-header h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.metric-trend {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.metric-trend.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.metric-trend.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.metric-trend.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: #6B7280;
}

.metric-value-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.metric-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

/* Domain Coverage */
.domain-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.domain-bar {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    align-items: center;
    gap: 0.75rem;
}

.domain-bar .domain-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.domain-bar .bar-container {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.domain-bar .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #3B82F6);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.domain-bar .bar-value {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* Evolution History */
.evolution-history {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
}

.history-header {
    margin-bottom: 1rem;
}

.history-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.history-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.history-placeholder {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* ============================================================
   MODAL MUTATIVE - Style Premium PROTEUS
   ============================================================ */

.mutative-modal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(16, 185, 129, 0.1);
    animation: mutativeModalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mutativeModalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mutative-modal .modal-header {
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 50%, #8B5CF6 100%);
    padding: 1.75rem 2rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.mutative-modal .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mutative-modal .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.mutative-modal .modal-header h3 svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.mutative-modal .modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.mutative-modal .modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.mutative-modal .modal-body {
    padding: 1.75rem 2rem;
    background: var(--card-bg);
}

.mutative-modal-intro {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.mutative-modal-intro::before {
    content: '🤖';
    font-size: 1.5rem;
    flex-shrink: 0;
}

.mutative-modal-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-suggestion-item {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border-radius: 12px;
    border-left: 4px solid #10B981;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.modal-suggestion-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-suggestion-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.modal-suggestion-item:hover::before {
    opacity: 1;
}

.modal-suggestion-item:nth-child(2) {
    border-left-color: #3B82F6;
}

.modal-suggestion-item:nth-child(2)::before {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05), transparent);
}

.modal-suggestion-item:nth-child(3) {
    border-left-color: #8B5CF6;
}

.modal-suggestion-item:nth-child(3)::before {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.05), transparent);
}

.modal-suggestion-item strong {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.modal-suggestion-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.modal-suggestion-summary {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.08));
    border-radius: 12px;
    border: 1px dashed rgba(16, 185, 129, 0.3);
}

.modal-suggestion-summary p:first-child {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.modal-suggestion-summary p:first-child strong {
    color: #10B981;
    font-size: 1.5rem;
}

.modal-suggestion-summary .text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modal-more {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.875rem;
}

.mutative-modal .modal-footer {
    padding: 1.25rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.mutative-modal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #10B981, #059669);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.mutative-modal .modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.mutative-modal .modal-footer .btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.mutative-modal .modal-footer .btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ============================================================
   VUE AGENTS IA MUTATIFS - Style Premium
   ============================================================ */

#view-mutative-agents {
    width: 100%;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
    position: relative;
    z-index: 1;
    padding-bottom: 2rem;
}

#view-mutative-agents.active {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Header Banner Premium */
#view-mutative-agents .view-header.banner-mutative {
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 50%, #8B5CF6 100%) !important;
    position: relative;
    overflow: hidden;
    padding: 2rem 2.5rem;
    margin-bottom: 0;
}

#view-mutative-agents .view-header.banner-mutative::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    from { transform: translate(0, 0); }
    to { transform: translate(60px, 60px); }
}

#view-mutative-agents .view-header h2 {
    position: relative;
    z-index: 1;
}

#view-mutative-agents .view-description {
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

/* Force le contenu à s'afficher */
#view-mutative-agents .view-header {
    flex-shrink: 0;
}

#view-mutative-agents .mutative-stats-bar,
#view-mutative-agents .mutative-tabs {
    flex-shrink: 0;
}

/* Stats Bar Premium */
.mutative-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.mutative-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.mutative-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-start, #10B981), var(--accent-end, #3B82F6));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mutative-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--border-color);
}

.mutative-stat-card:hover::before {
    opacity: 1;
}

.mutative-stat-card:nth-child(1) { --accent-start: #F59E0B; --accent-end: #D97706; }
.mutative-stat-card:nth-child(2) { --accent-start: #10B981; --accent-end: #059669; }
.mutative-stat-card:nth-child(3) { --accent-start: #3B82F6; --accent-end: #2563EB; }
.mutative-stat-card:nth-child(4) { --accent-start: #8B5CF6; --accent-end: #7C3AED; }

.mutative-stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mutative-stat-card .stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mutative-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.mutative-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs Premium */
.mutative-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.mutative-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.mutative-tab svg {
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

.mutative-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mutative-tab.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    color: #10B981;
    font-weight: 600;
}

.mutative-tab.active svg {
    stroke: #10B981;
}

.tab-badge {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* Content Area */
.mutative-content {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    min-height: 400px;
}

.mutative-tab-content {
    display: none;
}

.mutative-tab-content.active {
    display: block !important;
    animation: fadeInContent 0.3s ease;
}

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

/* Suggestions Header */
.mutative-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.suggestions-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.suggestions-filters select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestions-filters select:hover {
    border-color: #10B981;
}

.suggestions-filters select:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Bouton Générer */
.btn-generate-suggestions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-generate-suggestions:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-generate-suggestions:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-generate-suggestions .spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Suggestions List */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    min-height: 200px;
}

.suggestion-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.suggestion-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.suggestion-card-title {
    flex: 1;
}

.suggestion-card-title h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.suggestion-card-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.suggestion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.suggestion-badge.domain {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.suggestion-badge.priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.suggestion-badge.priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.suggestion-badge.priority-low {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.suggestion-card-body {
    padding: 1.25rem 1.5rem;
}

.suggestion-card-body p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
}

.suggestion-rationale {
    padding: 0.875rem 1rem;
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid #10B981;
    border-radius: 0 8px 8px 0;
    margin-top: 0.75rem;
}

.suggestion-rationale-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #10B981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.suggestion-rationale p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.suggestion-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.btn-approve, .btn-reject {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-approve {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-approve:hover {
    background: #10B981;
    color: white;
    border-color: #10B981;
}

.btn-reject {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-reject:hover {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}

/* Profiles Grid */
.profiles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profiles-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    max-width: 300px;
}

.profiles-search input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    flex: 1;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    overflow-y: auto;
    min-height: 200px;
}

.profile-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.profile-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.profile-info p {
    margin: 0.25rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-card-body {
    padding: 1.25rem;
}

.domain-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.domain-bar {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    align-items: center;
    gap: 0.75rem;
}

.domain-bar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.domain-bar-track {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.domain-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.domain-bar-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Patterns Grid */
.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    overflow-y: auto;
    min-height: 200px;
}

.pattern-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.pattern-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.pattern-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pattern-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.pattern-card-header h4 {
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.pattern-card-body p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pattern-confidence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pattern-confidence-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pattern-confidence-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.pattern-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #3B82F6);
    border-radius: 3px;
}

.pattern-confidence-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Evolution Metrics */
.evolution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.evolution-period-select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.evolution-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.evolution-metric-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
}

.evolution-metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10B981, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.evolution-metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Empty State */
.mutative-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.mutative-empty-state svg {
    width: 80px;
    height: 80px;
    stroke: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.mutative-empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.mutative-empty-state p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Loading Placeholder */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.loading-placeholder .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: #10B981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-placeholder p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Mutative */
@media (max-width: 768px) {
    .mutative-stats-bar {
        grid-template-columns: 1fr 1fr;
    }

    .mutative-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mutative-suggestions-header {
        flex-direction: column;
        align-items: stretch;
    }

    .suggestions-filters {
        flex-direction: column;
    }

    .profiles-header {
        flex-direction: column;
        gap: 1rem;
    }

    .profiles-search {
        max-width: none;
    }

    .evolution-metrics-grid {
        grid-template-columns: 1fr;
    }

    .domain-bar {
        grid-template-columns: 80px 1fr 35px;
    }
}

/* ============================================================
   MODULE RÉDACTION ACADÉMIQUE - THÈSE/MÉMOIRE
   ============================================================ */

/* Vue principale */
#view-thesis-memoir {
    width: 100%;
    min-height: calc(100vh - 80px);
    background: var(--bg-primary);
}

#view-thesis-memoir.active {
    display: flex;
    flex-direction: column;
}

/* Header avec gradient - Style premium */
.admin-header-banner.banner-thesis {
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 50%, #F59E0B 100%) !important;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
    border-bottom: none;
}

.admin-header-banner.banner-thesis::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 8s infinite linear;
    pointer-events: none;
}

.admin-header-banner.banner-thesis h2 {
    color: white !important;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.admin-header-banner.banner-thesis .header-icon {
    background: rgba(255,255,255,0.2) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    backdrop-filter: blur(8px);
}

.admin-header-banner.banner-thesis .header-icon svg {
    stroke: white !important;
}

.admin-header-banner.banner-thesis .view-description {
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.95rem;
    margin: 0.25rem 0 0 0;
    position: relative;
    z-index: 1;
}

.admin-header-banner.banner-thesis .view-header-left {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Mode sombre */
[data-theme="dark"] .admin-header-banner.banner-thesis {
    background: linear-gradient(135deg, #7C3AED 0%, #DB2777 50%, #D97706 100%) !important;
}

/* Bandeau Partages */
.admin-header-banner.banner-shares {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%) !important;
}
.admin-header-banner.banner-shares h2 {
    color: white !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.admin-header-banner.banner-shares .header-icon {
    background: rgba(255,255,255,0.2) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
}
.admin-header-banner.banner-shares .header-icon svg {
    stroke: white !important;
}
[data-theme="dark"] .admin-header-banner.banner-shares {
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%) !important;
}

/* Modal nouveau projet - Style premium */
#modal-new-thesis .modal-content {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#modal-new-thesis .modal-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    padding: 1.5rem 2rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

#modal-new-thesis .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 8s infinite linear;
    pointer-events: none;
}

#modal-new-thesis .modal-header h3 {
    color: white !important;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

#modal-new-thesis .modal-header h3 svg {
    stroke: white;
}

#modal-new-thesis .modal-close {
    color: white !important;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}

#modal-new-thesis .modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

#modal-new-thesis .modal-body {
    padding: 1.5rem 2rem;
    background: var(--bg-primary);
}

#modal-new-thesis .form-group {
    margin-bottom: 1.25rem;
}

#modal-new-thesis .form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.9rem;
}

#modal-new-thesis .form-control,
#modal-new-thesis select,
#modal-new-thesis textarea {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

#modal-new-thesis .form-control:focus,
#modal-new-thesis select:focus,
#modal-new-thesis textarea:focus {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    outline: none;
}

#modal-new-thesis .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

#modal-new-thesis .modal-footer {
    padding: 1rem 2rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

#modal-new-thesis .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#modal-new-thesis .btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

#modal-new-thesis .btn-primary {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

#modal-new-thesis .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Dark mode pour le modal */
[data-theme="dark"] #modal-new-thesis .modal-body {
    background: var(--bg-secondary);
}

[data-theme="dark"] #modal-new-thesis .modal-footer {
    background: var(--bg-tertiary);
}

/* Zone d'upload de documents */
.thesis-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.thesis-upload-zone:hover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
}

.thesis-upload-zone.drag-over {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.01);
}

.thesis-upload-zone .upload-content {
    cursor: pointer;
}

.thesis-upload-zone .upload-content svg {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.thesis-upload-zone .upload-content p {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-weight: 500;
}

.thesis-upload-zone .upload-formats {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Preview du fichier uploadé */
.thesis-upload-zone .upload-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.thesis-upload-zone .preview-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
}

.thesis-upload-zone .preview-file svg {
    color: #8B5CF6;
    flex-shrink: 0;
}

.thesis-upload-zone .preview-file span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thesis-upload-zone .btn-remove-file {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.thesis-upload-zone .btn-remove-file:hover {
    color: #EF4444;
}

/* Bouton d'analyse PROTEUS */
.thesis-upload-zone .btn-ai-analyze {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.thesis-upload-zone .btn-ai-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.thesis-upload-zone .btn-ai-analyze svg {
    animation: none;
}

.thesis-upload-zone .btn-ai-analyze:hover svg {
    animation: spin 2s linear infinite;
}

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

/* Animation pendant l'analyse */
.thesis-upload-zone .upload-analyzing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.thesis-upload-zone .analyzing-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: #8B5CF6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.thesis-upload-zone .upload-analyzing p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Hint pour texte généré */
.form-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #10B981;
}

.form-hint svg {
    color: #10B981;
    flex-shrink: 0;
}

/* Dark mode */
[data-theme="dark"] .thesis-upload-zone {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .thesis-upload-zone:hover {
    background: rgba(139, 92, 246, 0.1);
}

[data-theme="dark"] .thesis-upload-zone .preview-file {
    background: var(--bg-secondary);
}

/* Mode d'import (nouveau sujet vs brouillon existant) */
.thesis-import-mode {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    width: 100%;
}

.import-mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.import-mode-option:hover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
}

.import-mode-option input[type="radio"] {
    display: none;
}

.import-mode-option input[type="radio"]:checked + .mode-icon {
    transform: scale(1.2);
}

.import-mode-option:has(input:checked) {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.mode-icon {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.mode-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Analyse du brouillon existant */
.thesis-draft-analysis {
    margin-top: 1rem;
    border: 2px solid #3B82F6;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.draft-analysis-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.draft-analysis-header svg {
    stroke: white;
}

.draft-analysis-content {
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.draft-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid transparent;
}

.draft-section:last-child {
    margin-bottom: 0;
}

.draft-section.original {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3B82F6;
}

.draft-section.to-generate {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10B981;
}

.draft-section.to-complete {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #F59E0B;
}

.draft-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.draft-section-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.draft-section.original .draft-section-badge {
    background: #3B82F6;
    color: white;
}

.draft-section.to-generate .draft-section-badge {
    background: #10B981;
    color: white;
}

.draft-section.to-complete .draft-section-badge {
    background: #F59E0B;
    color: white;
}

.draft-section-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.draft-section-word-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Légende des couleurs */
.draft-analysis-legend {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-original .legend-color {
    background: #3B82F6;
}

.legend-generated .legend-color {
    background: #10B981;
}

/* Suggestions PROTEUS dans l'analyse de brouillon */
.draft-suggestions-header {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.75rem 0 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.draft-suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.draft-suggestion-item .suggestion-icon {
    flex-shrink: 0;
}

/* Message si pas un brouillon */
.draft-not-detected {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
}

.draft-not-detected p {
    margin: 0.5rem 0;
}

.draft-not-detected p:first-child {
    font-weight: 500;
    color: #F59E0B;
}

/* Dans l'éditeur: contenu original vs généré */
.section-content-original {
    border-left: 4px solid #3B82F6;
    padding-left: 1rem;
    margin-left: -1rem;
    background: rgba(59, 130, 246, 0.05);
}

.section-content-generated {
    border-left: 4px solid #10B981;
    padding-left: 1rem;
    margin-left: -1rem;
    background: rgba(16, 185, 129, 0.05);
}

.section-content-completed {
    border-left: 4px solid #F59E0B;
    padding-left: 1rem;
    margin-left: -1rem;
    background: rgba(245, 158, 11, 0.05);
}

/* Badge indicateur de source du contenu */
.content-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.content-source-badge.original {
    background: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
}

.content-source-badge.generated {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.content-source-badge.completed {
    background: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
}

/* Dark mode pour l'analyse de brouillon */
[data-theme="dark"] .thesis-draft-analysis {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .draft-section.original {
    background: rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .draft-section.to-generate {
    background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .draft-section.to-complete {
    background: rgba(245, 158, 11, 0.15);
}

[data-theme="dark"] .import-mode-option {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .import-mode-option:has(input:checked) {
    background: rgba(139, 92, 246, 0.15);
}

/* Container des projets */
.thesis-projects-container {
    padding: 2rem;
    background: var(--bg-primary);
}

.thesis-projects-container.hidden {
    display: none !important;
}

.thesis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.thesis-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.thesis-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Carte projet */
.thesis-project-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thesis-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    border-color: #8B5CF6;
}

.project-card-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.project-type-badge.thesis {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
}

.project-type-badge.memoir {
    background: linear-gradient(135deg, #EC4899, #DB2777);
    color: white;
}

.project-domain-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.project-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.project-card-subject {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.project-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.project-status {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-draft { background: rgba(107, 114, 128, 0.1); color: #6B7280; }
.status-in_progress { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.status-review { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.status-completed { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.status-empty { background: rgba(156, 163, 175, 0.1); color: #9CA3AF; }
.status-final { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; }

.project-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.project-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* État vide */
.thesis-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.thesis-empty-state svg {
    opacity: 0.4;
    margin-bottom: 1.5rem;
}

.thesis-empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.thesis-empty-state p {
    margin: 0 0 1.5rem 0;
    color: var(--text-muted);
}

/* Container éditeur */
.thesis-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 500px;
    overflow: hidden;
}

.thesis-editor-container.hidden {
    display: none !important;
}

/* Éditeur */
.thesis-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.thesis-editor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.thesis-editor-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.thesis-editor-title h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.thesis-editor-actions {
    display: flex;
    gap: 0.75rem;
}

/* Onglets */
.thesis-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.thesis-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.thesis-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.thesis-tab.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    color: #8B5CF6;
}

.thesis-tab .tab-badge {
    background: #E2E8F0;
    color: #475569;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

.thesis-tab.active .tab-badge {
    background: rgba(139, 92, 246, 0.25);
    color: #7C3AED;
}

/* Contenu des onglets */
.thesis-tab-contents {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    min-height: 0;
}

.thesis-tab-content {
    display: none;
    height: 100%;
}

.thesis-tab-content.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

/* Structure */
.structure-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.structure-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.structure-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.structure-actions {
    display: flex;
    gap: 0.75rem;
}

/* État vide - structure */
.structure-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--card-bg);
    border-radius: 16px;
    border: 2px dashed var(--border-color);
}

.structure-empty .empty-icon {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.structure-empty h3 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.structure-empty > p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 0 2rem;
}

.structure-empty .empty-actions {
    margin-bottom: 2rem;
}

.structure-empty .empty-info {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    max-width: 500px;
    text-align: left;
}

.structure-empty .empty-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2rem !important;
    font-size: 1.1rem !important;
}

/* Overlay de chargement PROTEUS */
.structure-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--card-bg);
    border-radius: 16px;
    min-height: 400px;
}

.structure-loading .loading-animation {
    position: relative;
    margin-bottom: 2rem;
}

.structure-loading .proteus-logo {
    color: var(--accent-primary);
    animation: pulse 1.5s ease-in-out infinite;
}

.structure-loading .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.structure-loading h3 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.structure-loading > p {
    color: var(--text-muted);
    margin: 0 0 2rem;
}

.structure-loading .loading-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.structure-loading .step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.structure-loading .step.active {
    color: var(--accent-primary);
    font-weight: 500;
}

.structure-loading .step-icon {
    width: 20px;
    text-align: center;
}

/* Overlay global de génération */
.proteus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.proteus-overlay-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

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

.proteus-overlay-content .proteus-icon {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.proteus-overlay-content h3 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.proteus-overlay-content p {
    margin: 0;
    color: var(--text-muted);
}

.proteus-overlay-content .spinner-ring {
    width: 60px;
    height: 60px;
    margin: 1.5rem auto 0;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Arbre des sections */
.structure-tree {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.section-item {
    border-bottom: 1px solid var(--border-color);
}

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

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.section-header:hover {
    background: var(--bg-secondary);
}

.section-item.level-1 > .section-header {
    padding-left: 1rem;
    font-weight: 600;
}

.section-item.level-2 > .section-header {
    padding-left: 2.5rem;
}

.section-item.level-3 > .section-header {
    padding-left: 4rem;
}

.section-toggle {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.section-toggle.expanded {
    transform: rotate(90deg);
}

.section-toggle.empty {
    visibility: hidden;
}

.section-title {
    flex: 1;
    color: var(--text-primary);
}

.section-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.ai-badge.low {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.ai-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.ai-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.word-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.section-children {
    display: none;
}

.section-children.expanded {
    display: block;
}

.section-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    padding: 0.35rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Éditeur de contenu */
.editor-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 300px);
    min-height: 500px;
}

.editor-sidebar {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

.editor-sidebar h4 {
    padding: 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--card-bg);
    z-index: 1;
}

.editor-sections-list {
    padding: 0.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.editor-section-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.editor-section-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.editor-section-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    color: #8B5CF6;
}

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

.section-dot.status-empty { background: #9CA3AF; }
.section-dot.status-draft { background: #3B82F6; }
.section-dot.status-review { background: #F59E0B; }
.section-dot.status-final { background: #10B981; }

.section-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-main {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.editor-placeholder svg {
    opacity: 0.4;
    margin-bottom: 1rem;
}

/* Section editor */
.section-editor {
    padding: 1.5rem;
    display: block;
}

.section-content-editor {
    display: flex;
    flex-direction: column;
}

.section-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-editor-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.section-editor-stats {
    display: flex;
    gap: 0.75rem;
}

.word-count-badge {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.section-instructions {
    margin-bottom: 1.5rem;
}

.section-instructions label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.section-instructions textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.btn-generate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.section-content-editor label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.editor-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

.editor-toolbar button {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-toolbar button:hover {
    background: var(--card-bg);
    color: var(--text-primary);
}

.toolbar-separator {
    width: 1px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.section-content-editor textarea {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0 0 10px 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
    resize: vertical;
    font-family: 'Georgia', serif;
}

.section-editor-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

/* Références */
.references-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.references-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
    flex-shrink: 0;
}

.references-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    width: 300px;
}

.references-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(100vh - 380px);
    padding-right: 0.5rem;
}

.references-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.reference-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
}

.reference-type {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.reference-title {
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.reference-authors {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.reference-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ref-doi {
    color: #3B82F6;
    text-decoration: none;
}

.reference-abstract {
    margin: 0.75rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Reference Card Enhanced */
.reference-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.reference-header .reference-title {
    flex: 1;
    margin-bottom: 0;
}

.reference-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.relevance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.relevance-badge.high {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.relevance-badge.medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-dark);
}

.relevance-badge.low {
    background: rgba(148, 163, 184, 0.15);
    color: var(--grey-500);
}

.citations-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.reference-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.reference-actions .btn-icon {
    padding: 0.4rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.reference-actions .btn-icon:hover {
    background: var(--grey-100);
    color: var(--text-primary);
}

.reference-actions .btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-color: var(--error);
}

.references-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--grey-50);
    border-radius: 8px;
}

.refs-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.refs-count strong {
    color: var(--text-primary);
}

/* Innovations */
.innovations-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.innovations-header {
    flex-shrink: 0;
}

.innovations-header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.innovations-description {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.innovations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 380px);
    padding-right: 0.5rem;
    align-content: start;
}

.innovations-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
}

.innovations-empty svg {
    opacity: 0.4;
    margin-bottom: 1rem;
}

.innovations-empty .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.innovation-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.innovation-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.innovation-card.status-highlighted {
    border-color: #F59E0B;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), transparent);
}

.innovation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.innovation-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.novelty-score {
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.innovation-description {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.innovation-actions {
    margin-top: 1rem;
}

/* Documents */
.documents-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.documents-header {
    flex-shrink: 0;
}

.documents-header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.documents-description {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.upload-zone {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
}

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

.upload-prompt svg {
    opacity: 0.5;
    margin-bottom: 1rem;
}

.upload-prompt p {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.upload-prompt .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.documents-list {
    margin-top: 1.5rem;
}

/* Modal analyse */
.analysis-section {
    margin-bottom: 1.5rem;
}

.analysis-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.analysis-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.analysis-item.innovation {
    border-left: 3px solid #F59E0B;
}

.analysis-item.research {
    border-left: 3px solid #3B82F6;
}

.novelty-badge, .relevance-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    height: fit-content;
}

.novelty-badge {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.relevance-badge {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.analysis-section ul {
    margin: 0;
    padding-left: 1.5rem;
}

.analysis-section li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Formulaire modal */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 1400px) {
    .thesis-editor-container {
        height: calc(100vh - 160px);
    }
}

@media (max-width: 1200px) {
    .thesis-editor-header {
        padding: 1rem 1.5rem;
    }

    .thesis-tab-contents {
        padding: 1rem 1.5rem;
    }

    .thesis-editor-title h2 {
        font-size: 1.1rem;
    }
}

@media (max-width: 992px) {
    .editor-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: calc(100vh - 350px);
    }

    .editor-sidebar {
        max-height: 250px;
    }

    .thesis-editor-container {
        height: calc(100vh - 140px);
    }

    .structure-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .thesis-projects-container {
        padding: 1rem;
    }

    .thesis-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .thesis-projects-grid {
        grid-template-columns: 1fr;
    }

    .thesis-editor-header {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .thesis-editor-title {
        order: 1;
        width: 100%;
    }

    .thesis-editor-title h2 {
        font-size: 1rem;
    }

    .btn-back {
        order: 0;
    }

    .thesis-editor-actions {
        order: 2;
        width: 100%;
        justify-content: flex-end;
    }

    .thesis-tabs {
        padding: 0.5rem 1rem;
    }

    .thesis-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .thesis-tab span:not(.tab-badge) {
        display: none;
    }

    .thesis-tab-contents {
        padding: 1rem;
    }

    .structure-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .structure-actions {
        justify-content: flex-start;
    }

    .structure-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .section-header {
        padding: 0.75rem;
    }

    .section-meta {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .thesis-editor-container {
        height: calc(100vh - 120px);
    }
}

@media (max-width: 480px) {
    .thesis-editor-header {
        padding: 0.5rem;
    }

    .thesis-tabs {
        gap: 0.25rem;
    }

    .thesis-tab {
        padding: 0.5rem;
    }

    .structure-actions .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================
   BOUTON PARTAGE & MODALE
   ============================================ */

/* Bouton partage sur carte */
.btn-share-doc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(79,70,229,0.3);
    border-radius: 6px;
    background: rgba(79,70,229,0.08);
    color: #4F46E5;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.btn-share-doc:hover {
    background: rgba(79,70,229,0.2);
    border-color: #4F46E5;
    transform: scale(1.1);
}

/* Badge partage sur carte */
.shared-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #4F46E5;
    background: rgba(79,70,229,0.08);
    border: 1px solid rgba(79,70,229,0.2);
    border-radius: 10px;
    padding: 1px 6px;
    white-space: nowrap;
}
.sharing-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #6B7280;
    background: rgba(107,114,128,0.08);
    border: 1px solid rgba(107,114,128,0.2);
    border-radius: 10px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* Modale partage - Design Premium (Light mode default) */
#share-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#share-dialog-overlay.open {
    opacity: 1;
    visibility: visible;
}
#share-dialog-modal {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 20px;
    width: 500px;
    max-width: 92vw;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.15),
        0 0 40px rgba(79, 70, 229, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#share-dialog-overlay.open #share-dialog-modal {
    transform: scale(1) translateY(0);
}

/* Header gradient */
.share-dialog-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(147, 51, 234, 0.08) 100%);
    border-bottom: 1px solid rgba(79, 70, 229, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.share-dialog-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.3), rgba(147, 51, 234, 0.3), transparent);
}
.share-dialog-header .share-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.share-dialog-header .share-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--neon-blue, #00d4ff), var(--neon-purple, #b24bf3));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}
.share-dialog-header .share-header-icon svg {
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.share-dialog-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.02em;
}
.share-dialog-header .share-header-sub {
    font-size: 0.72rem;
    color: #6366f1;
    margin-top: 1px;
}
.share-dialog-close {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    color: rgba(0, 0, 0, 0.4);
    padding: 6px;
    border-radius: 10px;
    transition: all 0.2s;
}
.share-dialog-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #ef4444;
    transform: rotate(90deg);
}

/* Body */
.share-dialog-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Add row */
.share-add-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4f46e5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
}
.share-add-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    align-items: center;
}
.share-add-row select,
.share-add-row input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.84rem;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.25s;
    -webkit-appearance: none;
    appearance: none;
}
.share-add-row select {
    flex: 0 0 auto;
    width: 150px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    background-color: #ffffff;
}
.share-add-row select:focus,
.share-add-row input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), 0 0 20px rgba(99, 102, 241, 0.05);
    background: #ffffff;
}
.share-add-row select option {
    background: #ffffff;
    color: #1e293b;
    padding: 8px;
}
.share-add-row .btn-add-share {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--neon-blue, #00d4ff), var(--neon-purple, #b24bf3));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
}
.share-add-row .btn-add-share:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(79, 70, 229, 0.4);
}
.share-add-row .btn-add-share:active {
    transform: scale(0.95);
}
.share-add-row .btn-add-share:disabled {
    background: rgba(0, 0, 0, 0.08);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.4;
}

/* Searchable user dropdown */
.share-user-search-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}
.share-user-search-wrap input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}
.share-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.share-user-dropdown.open {
    display: block;
}
.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}
.share-dropdown-item:hover {
    background: rgba(79, 70, 229, 0.06);
}
.share-dropdown-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(178, 75, 243, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
    flex-shrink: 0;
}
.share-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.share-dropdown-name {
    font-size: 0.82rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.share-dropdown-email {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.share-dropdown-empty {
    padding: 0.75rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Divider line */
.share-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.2), rgba(147, 51, 234, 0.2), transparent);
    margin: 0.25rem 0 1rem 0;
}

/* Share list title */
.share-list-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4f46e5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.share-list-title .share-count-badge {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(147, 51, 234, 0.1));
    color: #4f46e5;
    font-size: 0.65rem;
    padding: 1px 8px;
    border-radius: 20px;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

/* User list */
.share-user-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.share-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    transition: all 0.25s;
}
.share-user-item:hover {
    background: rgba(79, 70, 229, 0.04);
    border-color: rgba(79, 70, 229, 0.12);
}

/* Avatar */
.share-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--neon-blue, #00d4ff), var(--neon-purple, #b24bf3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.share-user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}
.share-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.share-user-email {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.share-user-perm {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.share-user-perm.perm-read {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.08);
    border: 1px solid rgba(8, 145, 178, 0.2);
}
.share-user-perm.perm-write {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
}
.share-user-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.share-remove-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    color: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 8px;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-remove-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* Empty state */
.share-empty {
    text-align: center;
    padding: 2rem 1.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
}
.share-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-empty-icon svg {
    color: rgba(79, 70, 229, 0.3);
}
.share-empty-text {
    color: #94a3b8;
    font-size: 0.82rem;
}

/* Footer */
.share-dialog-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    justify-content: flex-end;
}
.share-dialog-footer .btn {
    padding: 0.55rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
    color: #475569;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all 0.25s;
}
.share-dialog-footer .btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.2);
}

/* ---- Dark mode overrides for share modal ---- */
[data-theme="dark"] #share-dialog-overlay {
    background: rgba(10, 10, 30, 0.7);
}
[data-theme="dark"] #share-dialog-modal {
    background: linear-gradient(165deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-color: rgba(0, 212, 255, 0.15);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 212, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .share-dialog-header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12) 0%, rgba(178, 75, 243, 0.12) 100%);
    border-bottom-color: rgba(0, 212, 255, 0.15);
}
[data-theme="dark"] .share-dialog-header::before {
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), rgba(178, 75, 243, 0.4), transparent);
}
[data-theme="dark"] .share-dialog-header .share-header-icon {
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}
[data-theme="dark"] .share-dialog-header h3 {
    color: #f0f0f0;
}
[data-theme="dark"] .share-dialog-header .share-header-sub {
    color: rgba(0, 212, 255, 0.7);
}
[data-theme="dark"] .share-dialog-close {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .share-dialog-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}
[data-theme="dark"] .share-add-section-label {
    color: rgba(0, 212, 255, 0.6);
}
[data-theme="dark"] .share-add-row select,
[data-theme="dark"] .share-add-row input {
    border-color: rgba(0, 212, 255, 0.2);
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .share-add-row select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .share-add-row select:focus,
[data-theme="dark"] .share-add-row input:focus {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 0 20px rgba(0, 212, 255, 0.05);
    background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .share-add-row select option {
    background: #1a1a2e;
    color: #e0e0e0;
}
[data-theme="dark"] .share-add-row .btn-add-share {
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.25);
}
[data-theme="dark"] .share-add-row .btn-add-share:hover {
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.4);
}
[data-theme="dark"] .share-add-row .btn-add-share:disabled {
    background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .share-user-dropdown {
    background: #1a1a2e;
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .share-dropdown-item:hover {
    background: rgba(0, 212, 255, 0.1);
}
[data-theme="dark"] .share-dropdown-avatar {
    color: #e0e0e0;
}
[data-theme="dark"] .share-dropdown-name {
    color: #e0e0e0;
}
[data-theme="dark"] .share-dropdown-email {
    color: #8899aa;
}
[data-theme="dark"] .share-dropdown-empty {
    color: #667788;
}
[data-theme="dark"] .share-divider {
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.25), rgba(178, 75, 243, 0.25), transparent);
}
[data-theme="dark"] .share-list-title {
    color: rgba(0, 212, 255, 0.6);
}
[data-theme="dark"] .share-list-title .share-count-badge {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(178, 75, 243, 0.2));
    color: #00d4ff;
    border-color: rgba(0, 212, 255, 0.2);
}
[data-theme="dark"] .share-user-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .share-user-item:hover {
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.15);
}
[data-theme="dark"] .share-user-avatar {
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
}
[data-theme="dark"] .share-user-name {
    color: #e8e8e8;
}
[data-theme="dark"] .share-user-email {
    color: rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] .share-user-perm.perm-read {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.2);
}
[data-theme="dark"] .share-user-perm.perm-write {
    color: #b24bf3;
    background: rgba(178, 75, 243, 0.1);
    border-color: rgba(178, 75, 243, 0.2);
}
[data-theme="dark"] .share-remove-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .share-remove-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}
[data-theme="dark"] .share-empty {
    color: rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .share-empty-icon {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .share-empty-icon svg {
    color: rgba(0, 212, 255, 0.3);
}
[data-theme="dark"] .share-empty-text {
    color: rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .share-dialog-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}
[data-theme="dark"] .share-dialog-footer .btn {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
}
[data-theme="dark"] .share-dialog-footer .btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f0f0f0;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===================== Déduplication professeurs ===================== */
.dedup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dedup-summary {
    color: #cbd5e1;
    font-size: 0.92rem;
    margin-bottom: 16px;
}

.dedup-group {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    transition: opacity 0.4s, transform 0.4s;
}

.dedup-group.dedup-resolved {
    opacity: 0.35;
    transform: scale(0.97);
    pointer-events: none;
}

.dedup-group-title {
    color: #fbbf24;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dedup-count {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    font-size: 0.85rem;
}

.dedup-cards {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.dedup-card {
    flex: 1;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    transition: border-color 0.3s, background 0.3s;
}

.dedup-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.09);
}

.dedup-card.recommended {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.dedup-card.recommended::before {
    content: '★';
    position: absolute;
    top: -10px;
    right: 12px;
    background: #22c55e;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 700;
}

.dedup-card-avatar {
    color: #a78bfa;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.dedup-card-name {
    font-weight: 700;
    color: #f1f5f9;
    font-size: 1.08rem;
    margin-bottom: 6px;
}

.dedup-card-dept {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.dedup-card-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 6px;
}

.dedup-stat {
    color: #cbd5e1;
    font-size: 0.84rem;
}

.dedup-stat strong {
    color: #e2e8f0;
}

.dedup-card-date {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

/* Bouton Fusionner dans la modale doublons */
.dedup-merge-row {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-merge-dedup {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(109, 40, 217, 0.25));
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-merge-dedup:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(109, 40, 217, 0.4));
    color: #ddd6fe;
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
}

.dedup-resolved-label {
    text-align: center;
    color: #4ade80;
    font-weight: 600;
    margin-top: 12px;
    font-size: 0.9rem;
}

/* ===================== Comparaison détaillée doublons ===================== */

.dedup-comparison {
    margin-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 8px;
}

.dedup-comparison.collapsed .dedup-cmp-body {
    display: none;
}

.dedup-comparison.collapsed .dedup-cmp-chevron {
    transform: rotate(-90deg);
}

.dedup-cmp-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}

.dedup-cmp-toggle:hover {
    background: rgba(255,255,255,0.04);
}

.dedup-cmp-chevron {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.dedup-cmp-toggle-title {
    font-weight: 600;
    font-size: 0.82rem;
    color: #cbd5e1;
}

.dedup-cmp-stats {
    margin-left: auto;
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
}

.dedup-cmp-stat-identical {
    color: #4ade80;
    font-weight: 600;
}

.dedup-cmp-stat-different {
    color: #fbbf24;
    font-weight: 600;
}

.dedup-cmp-body {
    margin-top: 6px;
}

.dedup-cmp-header {
    display: grid;
    grid-template-columns: 140px 1fr 1fr;
    gap: 6px;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.dedup-cmp-header .dedup-cmp-val {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dedup-cmp-col-a {
    color: #60a5fa;
}

.dedup-cmp-col-b {
    color: #f472b6;
}

.dedup-cmp-row {
    display: grid;
    grid-template-columns: 140px 1fr 1fr;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
    font-size: 0.8rem;
}

.dedup-cmp-row.identical {
    background: rgba(34, 197, 94, 0.08);
    border-left-color: #22c55e;
}

.dedup-cmp-row.different {
    background: rgba(245, 158, 11, 0.12);
    border-left-color: #f59e0b;
}

.dedup-cmp-row.one-only {
    background: rgba(100, 116, 139, 0.08);
    border-left-color: #64748b;
}

.dedup-cmp-label {
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
}

.dedup-cmp-val {
    color: #e2e8f0;
    word-break: break-word;
    font-size: 0.8rem;
}

.dedup-cmp-val-a {
    background: rgba(96, 165, 250, 0.06);
    border-radius: 4px;
    padding: 2px 6px;
}

.dedup-cmp-val-b {
    background: rgba(244, 114, 182, 0.06);
    border-radius: 4px;
    padding: 2px 6px;
}

.dedup-cmp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.dedup-cmp-badge.identical {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.dedup-cmp-badge.different {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.dedup-cmp-badge.one-only {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.dedup-cmp-empty {
    font-style: italic;
    opacity: 0.4;
    font-size: 0.78rem;
}

.dedup-cmp-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin: 1px 2px;
}

/* ===================== Fusion (Merge) professeurs ===================== */

.merge-modal {
    background: #13132b;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    max-width: 1100px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.1);
}

.merge-header {
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
    color: white;
    padding: 16px 24px;
    border-radius: 15px 15px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.merge-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.merge-close-x {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.merge-close-x:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Header colonnes A/B */
.merge-columns-header {
    display: grid;
    grid-template-columns: 160px 1fr 1fr;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(139, 92, 246, 0.06);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    position: sticky;
    top: 0;
    z-index: 2;
}

.merge-col-label-spacer {
    /* espace vide pour aligner avec les labels de champs */
}

.merge-col-header {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.merge-col-header.merge-col-recommended {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.08);
}

.merge-col-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.merge-target-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.merge-target-radio input[type="radio"] {
    accent-color: #8B5CF6;
    width: 16px;
    height: 16px;
}

.merge-col-letter {
    font-size: 1.1rem;
    font-weight: 800;
    color: #e2e8f0;
}

.merge-col-a .merge-col-letter { color: #60a5fa; }
.merge-col-b .merge-col-letter { color: #f472b6; }

.merge-rec-badge {
    background: #22c55e;
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.merge-col-header-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.merge-col-version {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 5px;
}

.merge-col-detail {
    color: #94a3b8;
    font-size: 0.78rem;
}

.merge-body {
    overflow-y: auto;
    padding: 16px 24px;
    flex: 1;
}

.merge-section {
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.merge-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.06);
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    letter-spacing: 0.2px;
}

.merge-section-title:hover {
    background: rgba(255, 255, 255, 0.1);
}

.merge-chevron {
    transition: transform 0.25s;
    color: #fbbf24;
}

.merge-section.collapsed .merge-chevron {
    transform: rotate(-90deg);
}

.merge-section.collapsed .merge-section-content {
    display: none;
}

.merge-section-content {
    padding: 10px 16px;
}

/* Lignes de comparaison */
.merge-row {
    display: grid;
    grid-template-columns: 160px 1fr 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: start;
}

.merge-row:last-child {
    border-bottom: none;
}

.merge-row.identical {
    grid-template-columns: 160px 1fr;
    opacity: 0.65;
}

.merge-row.identical .merge-value-full {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.merge-row.array-row {
    grid-template-columns: 160px 1fr;
}

.merge-row.different {
    border-left: 3px solid #fbbf24;
    padding-left: 12px;
    margin-left: -3px;
    background: rgba(251, 191, 36, 0.03);
    border-radius: 0 6px 6px 0;
}

.merge-label {
    color: #94a3b8;
    font-size: 0.84rem;
    font-weight: 600;
    padding-top: 3px;
}

/* Colonnes A et B avec couleurs distinctes */
.merge-value-a {
    font-size: 0.85rem;
    background: rgba(96, 165, 250, 0.06);
    border: 1px solid rgba(96, 165, 250, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
}

.merge-value-b {
    font-size: 0.85rem;
    background: rgba(244, 114, 182, 0.06);
    border: 1px solid rgba(244, 114, 182, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
}

.merge-radio-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 4px;
}

.merge-radio-wrapper input[type="radio"] {
    accent-color: #8B5CF6;
    margin: 0;
    width: 15px;
    height: 15px;
}

.merge-radio-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.merge-value-a .merge-radio-label { color: #60a5fa; }
.merge-value-b .merge-radio-label { color: #f472b6; }

.merge-preview {
    color: #e2e8f0;
    font-size: 0.84rem;
    line-height: 1.5;
    padding: 4px 0 0 22px;
    word-break: break-word;
}

.merge-empty {
    color: rgba(255, 255, 255, 0.25);
    font-style: italic;
}

.merge-identical-badge {
    display: inline-block;
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    font-size: 0.68rem;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Checkboxes pour arrays */
.merge-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.merge-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 0.84rem;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.merge-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.merge-checkbox-item input[type="checkbox"] {
    accent-color: #8B5CF6;
    margin: 0;
    width: 15px;
    height: 15px;
}

.merge-source-badge {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
    text-transform: uppercase;
}

.merge-source-badge:is([class]) {
    /* fallback for unknown source */
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

/* Domaines radio */
.merge-domain-choices {
    display: flex;
    gap: 16px;
    grid-column: 2 / -1;
    padding: 4px 0;
}

/* Footer */
.merge-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0 0 15px 15px;
}

.merge-cancel-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.merge-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

.merge-execute-btn {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: white;
    border: none;
    padding: 10px 32px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
    display: flex;
    align-items: center;
    gap: 8px;
}

.merge-execute-btn:hover {
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

/* ===== Mode clair pour la modale de fusion ===== */
html:not([data-theme="dark"]) .merge-modal {
    background: #ffffff;
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 0 40px rgba(139, 92, 246, 0.08);
}

html:not([data-theme="dark"]) .merge-columns-header {
    background: rgba(139, 92, 246, 0.04);
    border-bottom-color: rgba(139, 92, 246, 0.12);
}

html:not([data-theme="dark"]) .merge-col-header {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

html:not([data-theme="dark"]) .merge-col-header.merge-col-recommended {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.06);
}

html:not([data-theme="dark"]) .merge-col-letter { color: #334155; }
html:not([data-theme="dark"]) .merge-col-a .merge-col-letter { color: #2563eb; }
html:not([data-theme="dark"]) .merge-col-b .merge-col-letter { color: #db2777; }

html:not([data-theme="dark"]) .merge-col-version {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

html:not([data-theme="dark"]) .merge-col-detail { color: #64748b; }

html:not([data-theme="dark"]) .merge-section {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.01);
}

html:not([data-theme="dark"]) .merge-section-title {
    background: rgba(0, 0, 0, 0.04);
    color: #92400e;
}

html:not([data-theme="dark"]) .merge-section-title:hover {
    background: rgba(0, 0, 0, 0.07);
}

html:not([data-theme="dark"]) .merge-chevron { color: #92400e; }

html:not([data-theme="dark"]) .merge-row {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

html:not([data-theme="dark"]) .merge-row.different {
    background: rgba(251, 191, 36, 0.06);
}

html:not([data-theme="dark"]) .merge-row.identical .merge-value-full { color: #64748b; }

html:not([data-theme="dark"]) .merge-label { color: #475569; }

html:not([data-theme="dark"]) .merge-value-a {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.15);
}

html:not([data-theme="dark"]) .merge-value-b {
    background: rgba(219, 39, 119, 0.05);
    border-color: rgba(219, 39, 119, 0.15);
}

html:not([data-theme="dark"]) .merge-value-a .merge-radio-label { color: #2563eb; }
html:not([data-theme="dark"]) .merge-value-b .merge-radio-label { color: #db2777; }

html:not([data-theme="dark"]) .merge-preview { color: #1e293b; }

html:not([data-theme="dark"]) .merge-empty { color: rgba(0, 0, 0, 0.3); }

html:not([data-theme="dark"]) .merge-identical-badge {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

html:not([data-theme="dark"]) .merge-checkbox-item { color: #1e293b; }
html:not([data-theme="dark"]) .merge-checkbox-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

html:not([data-theme="dark"]) .merge-source-badge:is([class]) {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.5);
}

html:not([data-theme="dark"]) .merge-footer {
    border-top-color: rgba(139, 92, 246, 0.12);
    background: rgba(0, 0, 0, 0.03);
}

html:not([data-theme="dark"]) .merge-cancel-btn {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.04);
    color: #475569;
}

html:not([data-theme="dark"]) .merge-cancel-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

/* ============================================
   COMBOBOX MODELES IA
   ============================================ */
.model-combobox {
    position: relative;
}

.model-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-input-wrapper input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.05);
    color: var(--text-primary, #e2e8f0);
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.model-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.model-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.model-refresh-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--text-primary, #e2e8f0);
    border-color: rgba(139, 92, 246, 0.5);
}

.model-refresh-btn.spinning svg {
    animation: spin-refresh 0.8s linear infinite;
}

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

.model-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 40px;
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 4px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    background: var(--bg-secondary, #1e293b);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.model-dropdown.open {
    display: block;
}

.model-dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
}

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

.model-dropdown-item:hover {
    background: rgba(139, 92, 246, 0.15);
}

.model-dropdown-item .model-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: var(--text-primary, #e2e8f0);
}

.model-dropdown-item .model-name {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 2px;
}

.model-dropdown-empty {
    padding: 12px;
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
}

/* Light mode overrides */
html:not([data-theme="dark"]) .model-input-wrapper input[type="text"] {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.2);
    color: #1e293b;
}

html:not([data-theme="dark"]) .model-dropdown {
    background: #fff;
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

html:not([data-theme="dark"]) .model-dropdown-item .model-id {
    color: #1e293b;
}

html:not([data-theme="dark"]) .model-refresh-btn {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.2);
    color: #64748b;
}

/* ============================================
   BANNIERE STATUS API
   ============================================ */

.api-status-banner {
    position: sticky;
    top: 0;
    z-index: 9999;
    padding: 0;
    font-size: 14px;
    animation: statusBannerSlideIn 0.4s ease-out;
}

@keyframes statusBannerSlideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.api-status-banner.degraded {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.api-status-banner.major {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.api-status-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.api-status-banner-icon::before {
    font-size: 18px;
}

.api-status-banner.degraded .api-status-banner-icon::before {
    content: '\26A0\FE0F';
}

.api-status-banner.major .api-status-banner-icon::before {
    content: '\1F6A8';
}

.api-status-banner-text {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.api-status-banner-details,
.api-status-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.api-status-banner-details:hover,
.api-status-banner-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.api-status-banner-close {
    font-size: 18px;
    padding: 2px 8px;
    line-height: 1;
}

.api-status-banner-details-panel {
    padding: 10px 20px 14px;
    background: rgba(0, 0, 0, 0.1);
    max-width: 1400px;
    margin: 0 auto;
}

.api-status-banner-details-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.api-status-banner-details-panel > ul > li {
    padding: 4px 0;
}

.api-status-banner-details-panel ul ul {
    padding-left: 24px;
    margin-top: 2px;
}

.api-status-banner-details-panel ul ul li {
    font-size: 13px;
    opacity: 0.9;
    padding: 1px 0;
}

.api-status-banner-details-panel em {
    opacity: 0.8;
}

/* Dark mode */
[data-theme="dark"] .api-status-banner.degraded {
    background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
}

[data-theme="dark"] .api-status-banner.major {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Hamburger menu + Sidebar drawer
   ══════════════════════════════════════════════════════════════ */

/* Hamburger button — hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    padding: 8px;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: rgba(255,255,255,0.25);
}

/* Sidebar backdrop overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    z-index: 199;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: sidebarFadeIn 0.25s ease;
}
.sidebar-backdrop.active {
    display: block;
}
@keyframes sidebarFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Mobile: < 768px ── */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ── Header: single compact row ── */
    .admin-header {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        height: auto;
        min-height: 48px;
        padding: 6px 10px;
        gap: 6px;
        align-items: center;
    }
    .header-left {
        flex-direction: row !important;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 0;
    }
    /* Hide back link, subtitle, and full title text on mobile */
    .header-left .back-link {
        display: none !important;
    }
    .header-left .subtitle {
        display: none !important;
    }
    .header-left .logo-section {
        gap: 6px;
    }
    .header-left .logo-icon img {
        width: 32px;
        height: 32px;
    }
    .header-left h1 {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    /* ── Header right: only essential items ── */
    .header-right {
        gap: 4px;
        flex-shrink: 0;
        flex-wrap: nowrap !important;
    }
    /* Hide DB badge on mobile */
    .header-right #test-db-badge {
        display: none !important;
    }
    /* Hide Users button */
    .header-right #btn-users,
    .header-right #btn-users-admin {
        display: none !important;
    }
    /* User info: icon only, no text */
    .header-right .user-info {
        padding: 4px;
        gap: 0;
    }
    .header-right .user-info span {
        display: none !important;
    }
    .header-right .user-info svg {
        display: block;
        width: 18px;
        height: 18px;
    }
    /* Language: compact */
    .header-right .language-selector select {
        font-size: 0.7rem;
        padding: 3px 4px;
        min-width: unset;
    }
    /* Logout button: icon only */
    .header-right #btn-logout span {
        display: none !important;
    }
    .header-right #btn-logout {
        padding: 6px 8px;
        min-width: unset;
    }
    .header-right #btn-logout svg {
        width: 16px;
        height: 16px;
    }
    /* Generic btn in header: compact */
    .header-right .btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    /* Sidebar as slide-in drawer */
    .admin-main {
        flex-direction: row;
        height: calc(100vh - 56px);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px !important;
        max-width: 85vw;
        min-width: unset;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        flex-direction: column;
        flex-wrap: nowrap;
        padding: 1rem;
        gap: 1rem;
        box-shadow: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0,0,0,0.2);
    }

    /* Hide resizer on mobile */
    .sidebar-resizer {
        display: none;
    }

    /* Sidebar sections stacked vertically on mobile */
    .sidebar-section {
        min-width: unset;
        flex: unset;
    }

    /* Nav items: larger tap targets */
    .sidebar .nav-item {
        padding: 10px 12px;
        font-size: 0.88rem;
        border-radius: 10px;
    }

    /* Content area fills screen */
    .content-area {
        width: 100%;
    }

    /* View headers — compact */
    .admin-header-banner {
        padding: 12px 14px;
        gap: 10px;
    }
    .admin-header-banner h2 {
        font-size: 1.05rem;
    }
    .admin-header-banner .header-icon {
        width: 36px;
        height: 36px;
    }
    .view-content {
        padding: 12px 14px;
    }

    /* Modals — full width on mobile */
    .modal-content,
    .modal .modal-content {
        width: 95% !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        margin: 5vh auto;
    }

    /* Tables responsive */
    .data-table,
    .activity-table table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Form grids single column */
    .form-grid,
    .partners-grid,
    .form-row {
        grid-template-columns: 1fr !important;
    }

    /* Button groups wrap */
    .view-actions,
    .btn-group {
        flex-wrap: wrap;
        gap: 6px;
    }
    .view-actions .btn,
    .btn-group .btn {
        font-size: 0.78rem;
        padding: 6px 10px;
    }
}

/* ── Small phones: < 480px ── */
@media (max-width: 480px) {
    .admin-header {
        padding: 6px 10px;
    }
    .header-left h1 {
        font-size: 0.9rem;
    }
    .sidebar {
        width: 260px !important;
        padding: 0.75rem;
    }
    .view-content {
        padding: 10px 12px;
    }
    .admin-header-banner h2 {
        font-size: 0.95rem;
    }
    /* Hide badge text on very small screens */
    #test-db-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
}

/* ── Tablet portrait: 768px-1024px ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px !important;
        min-width: 180px;
        padding: 1rem;
    }
    .sidebar-section h3 {
        font-size: 0.72rem;
    }
    .sidebar .nav-item {
        font-size: 0.82rem;
        padding: 8px 10px;
    }
}
