/**
 * AcadIA-M - Module Juridique CSS
 * Documents contractuels, PI et analyse juridique
 * Couleurs: Indigo/Violet (#4F46E5 → #7C3AED)
 */

/* ============================================ */
/* BANNER JURIDIQUE                             */
/* ============================================ */

.admin-header-banner.banner-juridique {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #6D28D9 100%) !important;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
    border-bottom: none;
}

.admin-header-banner.banner-juridique::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: juridique-shimmer 8s infinite linear;
    pointer-events: none;
}

@keyframes juridique-shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.admin-header-banner.banner-juridique 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-juridique .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-juridique .header-icon svg {
    stroke: white !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.admin-header-banner.banner-juridique .view-header-left,
.admin-header-banner.banner-juridique .view-header-right {
    position: relative;
    z-index: 1;
}

.admin-header-banner.banner-juridique p {
    color: rgba(255,255,255,0.85);
}

/* ============================================ */
/* NAV ITEM JURIDIQUE                           */
/* ============================================ */

.nav-item-juridique {
    background: rgba(79, 70, 229, 0.08);
    border-left: 3px solid #4F46E5;
    color: var(--text-primary);
}

.nav-item-juridique::before {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
}

.nav-item-juridique:hover {
    background: rgba(79, 70, 229, 0.15);
    color: #4338CA;
}

.nav-item-juridique.active {
    background: rgba(79, 70, 229, 0.12);
    color: #4338CA;
    font-weight: 600;
}

.nav-item-juridique svg {
    color: #4F46E5;
}

/* ============================================ */
/* CONTAINER PRINCIPAL                          */
/* ============================================ */

.juridique-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.juridique-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ============================================ */
/* TOOLBAR                                      */
/* ============================================ */

.juridique-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg, white);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.juridique-toolbar .search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-primary, #f8fafc);
    font-size: 0.875rem;
}

.juridique-toolbar .filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--card-bg, white);
    font-size: 0.875rem;
    cursor: pointer;
}

/* ============================================ */
/* GRILLE DE PROJETS                            */
/* ============================================ */

.juridique-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.juridique-card {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.juridique-card:hover {
    border-color: rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.juridique-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.juridique-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.juridique-card-partner {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.5rem;
}

.juridique-card-date {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
}

.juridique-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(79, 70, 229, 0.1);
}

/* ============================================ */
/* BADGES TYPE JURIDIQUE                        */
/* ============================================ */

.juridique-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.juridique-type-badge.nda {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.juridique-type-badge.pi {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    color: #9d174d;
}

.juridique-type-badge.entente_cadre {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.juridique-type-badge.licence {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.juridique-type-badge.autre {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #3730a3;
}

/* ============================================ */
/* BADGES STATUT                                */
/* ============================================ */

.juridique-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.juridique-status-badge.draft {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #4b5563;
}

.juridique-status-badge.analysis {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.juridique-status-badge.review {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.juridique-status-badge.completed {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

/* ============================================ */
/* ÉTAT VIDE                                    */
/* ============================================ */

.juridique-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary, #64748b);
    grid-column: 1 / -1;
}

.juridique-empty-state svg {
    width: 64px;
    height: 64px;
    color: #a5b4fc;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.juridique-empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-primary, #1e293b);
    margin-bottom: 0.5rem;
}

.juridique-empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* ============================================ */
/* ÉDITEUR DE DOSSIER                           */
/* ============================================ */

.juridique-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Bannière lecture seule */
.juridique-readonly-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid #F59E0B;
    flex-wrap: wrap;
}
.juridique-readonly-banner svg {
    flex-shrink: 0;
    stroke: #D97706;
}
[data-theme="dark"] .juridique-readonly-banner {
    background: linear-gradient(135deg, #78350F 0%, #92400E 100%);
    color: #FDE68A;
    border-color: #B45309;
}
[data-theme="dark"] .juridique-readonly-banner svg {
    stroke: #FBBF24;
}

.juridique-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--card-bg, white);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    gap: 1rem;
}

.juridique-editor-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.juridique-editor-title h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.juridique-editor-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ============================================ */
/* ONGLETS                                      */
/* ============================================ */

.juridique-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.5rem;
    background: var(--card-bg, white);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.juridique-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.juridique-tab:hover {
    color: #4F46E5;
    background: rgba(79, 70, 229, 0.05);
}

.juridique-tab.active {
    color: #4F46E5;
    border-bottom-color: #4F46E5;
    font-weight: 600;
}

.juridique-tab svg {
    width: 16px;
    height: 16px;
}

.juridique-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

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

/* ============================================ */
/* ZONE UPLOAD DOCUMENTS                        */
/* ============================================ */

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

.juridique-upload-zone {
    border: 2px dashed rgba(79, 70, 229, 0.3);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(79, 70, 229, 0.03);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.juridique-upload-zone:hover {
    border-color: #4F46E5;
    background: rgba(79, 70, 229, 0.06);
}

.juridique-upload-zone.drag-over {
    border-color: #4F46E5;
    background: rgba(79, 70, 229, 0.1);
    transform: scale(1.01);
}

.juridique-upload-zone.has-file {
    border-style: solid;
    border-color: rgba(79, 70, 229, 0.4);
    background: rgba(79, 70, 229, 0.05);
}

.juridique-upload-zone h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.juridique-upload-zone p {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
}

.juridique-upload-zone svg {
    width: 40px;
    height: 40px;
    color: #818cf8;
    margin-bottom: 0.75rem;
}

.juridique-file-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(79, 70, 229, 0.08);
    border-radius: 8px;
    width: 100%;
}

.juridique-file-preview .file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.juridique-file-preview .file-icon svg {
    width: 18px;
    height: 18px;
    color: white;
    margin: 0;
}

.juridique-file-preview .file-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.juridique-file-preview .file-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.juridique-file-preview .file-size {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.juridique-file-preview .btn-remove {
    padding: 0.25rem;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    cursor: pointer;
    color: #ef4444;
    flex-shrink: 0;
}

.juridique-file-preview .btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ============================================ */
/* BOUTON FUSION                                */
/* ============================================ */

.juridique-fusion-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.juridique-fusion-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

.juridique-fusion-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.juridique-fusion-btn svg {
    width: 22px;
    height: 22px;
}

/* ============================================ */
/* DOCUMENT FUSION - RÉSULTAT                   */
/* ============================================ */

.juridique-fusion-container {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
}

.juridique-fusion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
}

.juridique-fusion-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.juridique-fusion-body {
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.juridique-fusion-body h1,
.juridique-fusion-body h2,
.juridique-fusion-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #312e81;
}

.juridique-fusion-body h1 { font-size: 1.3rem; }
.juridique-fusion-body h2 { font-size: 1.15rem; }
.juridique-fusion-body h3 { font-size: 1rem; }

/* Différences en rouge - texte ajouté */
.juridique-fusion-body .diff-added,
.diff-added {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    border-left: 3px solid #22c55e;
}

/* Différences en rouge - texte supprimé */
.juridique-fusion-body .diff-removed,
.diff-removed {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    text-decoration: line-through;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    border-left: 3px solid #ef4444;
}

/* Différences - texte modifié (en rouge comme demandé) */
.juridique-fusion-body .diff-modified,
.diff-modified {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    border-left: 3px solid #dc2626;
    font-weight: 500;
}

/* Clause conservée telle quelle */
.juridique-fusion-body .diff-unchanged {
    color: var(--text-primary);
}

/* ============================================ */
/* RÉSUMÉ DES DIFFÉRENCES                       */
/* ============================================ */

.juridique-diff-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(79, 70, 229, 0.04);
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.diff-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.diff-stat .stat-count {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
}

.diff-stat.added .stat-count {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
}

.diff-stat.removed .stat-count {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
}

.diff-stat.modified .stat-count {
    background: rgba(245, 158, 11, 0.15);
    color: #92400e;
}

.diff-stat.unchanged .stat-count {
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

/* ============================================ */
/* MODAL NOUVEAU PROJET                         */
/* ============================================ */

.juridique-modal-header {
    background: linear-gradient(135deg, #4F46E5, #7C3AED) !important;
    padding: 1.25rem 1.5rem !important;
}

.juridique-modal-header h3 {
    color: white !important;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.juridique-modal-header h3 svg {
    flex-shrink: 0;
}

.juridique-modal-header .modal-close {
    color: white !important;
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
}

.juridique-modal-header .modal-close:hover {
    background: rgba(255,255,255,0.3) !important;
}

.juridique-form-group {
    margin-bottom: 1.15rem;
}

.juridique-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #312e81;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.juridique-form-group input,
.juridique-form-group select,
.juridique-form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    font-size: 0.875rem;
    background: #faf9ff;
    color: var(--text-primary, #1e293b);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.juridique-form-group input:focus,
.juridique-form-group select:focus,
.juridique-form-group textarea:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background: white;
}

.juridique-form-group input::placeholder,
.juridique-form-group textarea::placeholder {
    color: #a5b4fc;
}

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

.juridique-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ============================================ */
/* TEMPLATES DE CONTRATS                        */
/* ============================================ */

.juridique-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.juridique-template-card {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.juridique-template-card:hover {
    border-color: #818cf8;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.juridique-template-card.selected {
    border-color: #4F46E5;
    background: rgba(79, 70, 229, 0.05);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.juridique-template-card h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.juridique-template-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================ */
/* GÉNÉRATION CONTRAT                           */
/* ============================================ */

.juridique-contract-preview {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 2rem;
    font-size: 0.9rem;
    line-height: 1.8;
    max-height: 500px;
    overflow-y: auto;
}

.juridique-contract-preview .contract-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #312e81;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.juridique-contract-preview .contract-field {
    background: rgba(79, 70, 229, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    color: #4F46E5;
    border-bottom: 2px dashed #818cf8;
}

/* ============================================ */
/* PROTEUS OVERLAY                              */
/* ============================================ */

.juridique-proteus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.juridique-proteus-content {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.juridique-proteus-content .proteus-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: juridique-pulse 2s ease-in-out infinite;
}

@keyframes juridique-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(79, 70, 229, 0); }
}

.juridique-proteus-content .proteus-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.juridique-proteus-content h3 {
    font-size: 1.1rem;
    color: #312e81;
    margin-bottom: 0.5rem;
}

.juridique-proteus-content p {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.juridique-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #4F46E5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ============================================ */
/* BOUTONS                                      */
/* ============================================ */

.btn-juridique {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-juridique-primary {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
}

.btn-juridique-primary:hover {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-juridique-secondary {
    background: rgba(79, 70, 229, 0.1);
    color: #4F46E5;
}

.btn-juridique-secondary:hover {
    background: rgba(79, 70, 229, 0.2);
}

.btn-juridique-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.btn-juridique-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */

@media (max-width: 768px) {
    .juridique-projects-grid {
        grid-template-columns: 1fr;
    }

    .juridique-documents-panel {
        grid-template-columns: 1fr;
    }

    .juridique-form-row {
        grid-template-columns: 1fr;
    }

    .juridique-diff-summary {
        grid-template-columns: 1fr 1fr;
    }

    .juridique-editor-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================ */
/* DARK MODE                                    */
/* ============================================ */

[data-theme="dark"] .juridique-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(124, 58, 237, 0.08) 100%);
    border-color: rgba(79, 70, 229, 0.2);
}

[data-theme="dark"] .juridique-card:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15) 0%, rgba(124, 58, 237, 0.12) 100%);
    border-color: rgba(79, 70, 229, 0.4);
}

[data-theme="dark"] .juridique-fusion-body .diff-added,
[data-theme="dark"] .diff-added {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

[data-theme="dark"] .juridique-fusion-body .diff-removed,
[data-theme="dark"] .diff-removed {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .juridique-fusion-body .diff-modified,
[data-theme="dark"] .diff-modified {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

[data-theme="dark"] .juridique-upload-zone {
    background: rgba(79, 70, 229, 0.05);
    border-color: rgba(79, 70, 229, 0.25);
}

[data-theme="dark"] .juridique-proteus-content {
    background: var(--card-bg, #1e293b);
}

[data-theme="dark"] .juridique-proteus-content h3 {
    color: #c4b5fd;
}

[data-theme="dark"] .juridique-form-group label {
    color: #c4b5fd;
}

[data-theme="dark"] .juridique-form-group input,
[data-theme="dark"] .juridique-form-group select,
[data-theme="dark"] .juridique-form-group textarea {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.3);
    color: #e2e8f0;
}

[data-theme="dark"] .juridique-form-group input:focus,
[data-theme="dark"] .juridique-form-group select:focus,
[data-theme="dark"] .juridique-form-group textarea:focus {
    background: rgba(79, 70, 229, 0.12);
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .juridique-form-group input::placeholder,
[data-theme="dark"] .juridique-form-group textarea::placeholder {
    color: rgba(167, 139, 250, 0.5);
}

[data-theme="dark"] .juridique-form-group select option {
    background: #1e293b;
    color: #e2e8f0;
}

/* ============================================ */
/* BOUTON PREVIEW SUR CARTE PROJET             */
/* ============================================ */

.juridique-preview-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.1);
    color: #4F46E5;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.juridique-preview-btn:hover {
    background: rgba(79, 70, 229, 0.25);
    border-color: #4F46E5;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.juridique-preview-btn svg {
    width: 16px;
    height: 16px;
    color: inherit;
    stroke: currentColor;
}

[data-theme="dark"] .juridique-preview-btn {
    background: rgba(129, 140, 248, 0.15);
    border-color: rgba(129, 140, 248, 0.3);
    color: #a5b4fc;
}

[data-theme="dark"] .juridique-preview-btn:hover {
    background: rgba(129, 140, 248, 0.3);
    border-color: #818cf8;
}

/* ============================================ */
/* BOUTONS HEADER JURIDIQUE                     */
/* ============================================ */

.btn-inc-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 10px;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn-inc-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transition: left 0.5s ease;
}

.btn-inc-header:hover::before {
    left: 100%;
}

.btn-inc-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.btn-inc-header:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(124, 58, 237, 0.3);
}

.btn-inc-icon {
    font-size: 1.15rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.btn-dossier-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    color: rgba(255,255,255,0.92);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.btn-dossier-header:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.5);
    color: white;
    transform: translateY(-1px);
}

.btn-dossier-header:active {
    transform: translateY(0);
    background: rgba(255,255,255,0.15);
}

.btn-dossier-header svg {
    opacity: 0.85;
}

/* ============================================ */
/* MODALE INCORPORATION                         */
/* ============================================ */

.inc-modal-content {
    max-width: 700px;
    border-radius: 16px !important;
    overflow: hidden;
}

.inc-modal-header {
    background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 50%, #4C1D95 100%) !important;
    padding: 1.5rem 1.75rem !important;
    border-bottom: none !important;
    position: relative;
    overflow: hidden;
}

.inc-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.inc-modal-header h3 {
    color: white !important;
    font-size: 1.2rem !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.inc-modal-header .modal-close {
    color: white !important;
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    border-radius: 8px !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    z-index: 1;
}

.inc-modal-header .modal-close:hover {
    background: rgba(255,255,255,0.3) !important;
}

[data-theme="dark"] .inc-modal-header {
    background: linear-gradient(135deg, #6D28D9 0%, #4C1D95 50%, #3B0764 100%) !important;
}

[data-theme="dark"] .inc-modal-header h3 {
    color: white !important;
}

/* Bouton supprimer sur les cartes */
.juridique-card-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.juridique-card-delete-btn:hover {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #DC2626;
}
[data-theme="dark"] .juridique-card-delete-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.3);
    color: #F87171;
}

/* ============================================ */
/* MODALE CONTRAT                               */
/* ============================================ */

#juridique-contract-modal .modal-content {
    animation: juridique-modal-enter 0.3s ease;
}

@keyframes juridique-modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#juridique-contract-modal .juridique-contract-preview {
    max-height: none;
    overflow: visible;
    border: none;
    padding: 0;
}

/* ============================================ */
/* CHAMPS ÉDITABLES INLINE DANS CONTRAT        */
/* ============================================ */

.contract-field-input {
    border: none;
    border-bottom: 2px solid #4F46E5;
    background: rgba(79, 70, 229, 0.08);
    color: #4F46E5;
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    padding: 0.15rem 0.4rem;
    border-radius: 3px 3px 0 0;
    min-width: 120px;
    outline: none;
    transition: all 0.2s;
    line-height: inherit;
}

.contract-field-input:focus {
    border-bottom-color: #7C3AED;
    background: rgba(79, 70, 229, 0.15);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.contract-field-input::placeholder {
    color: rgba(79, 70, 229, 0.45);
    font-style: italic;
    font-weight: 500;
}

/* Mode édition : contour du body */
#jur-modal-contract-body.editing {
    border: 2px dashed rgba(79, 70, 229, 0.25);
    border-radius: 8px;
    padding: 1.5rem;
    outline: none;
    min-height: 200px;
}

#jur-modal-contract-body.editing:focus {
    border-color: rgba(79, 70, 229, 0.4);
}

/* Bannière mode édition */
.contract-edit-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.06));
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #4338CA;
    animation: contract-banner-fade 0.3s ease;
}

.contract-edit-banner svg {
    flex-shrink: 0;
    color: #4F46E5;
}

@keyframes contract-banner-fade {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dark mode pour champs éditables */
[data-theme="dark"] .contract-field-input {
    background: rgba(129, 140, 248, 0.15);
    border-bottom-color: #818cf8;
    color: #a5b4fc;
}

[data-theme="dark"] .contract-field-input:focus {
    background: rgba(129, 140, 248, 0.25);
    border-bottom-color: #a78bfa;
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .contract-field-input::placeholder {
    color: rgba(165, 180, 252, 0.5);
}

[data-theme="dark"] #jur-modal-contract-body.editing {
    border-color: rgba(129, 140, 248, 0.25);
}

[data-theme="dark"] .contract-edit-banner {
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.25);
    color: #a5b4fc;
}

/* ============================================ */
/* BOUTON QUITTER JURIDIQUE                     */
/* ============================================ */

.btn-deconnexion-juridique {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #4338CA 0%, #4F46E5 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg, 12px);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

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

.btn-deconnexion-juridique:hover {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.btn-deconnexion-juridique:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

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

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

/* ============================================ */
/* MODULE INCORPORATION QUÉBEC                  */
/* ============================================ */

.inc-wizard {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Stepper */
.inc-stepper {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--card-bg, white);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    gap: 0;
}

.inc-step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
}

.inc-step-indicator:hover {
    background: rgba(124, 58, 237, 0.05);
}

.inc-step-indicator.active {
    background: rgba(124, 58, 237, 0.1);
    color: #7C3AED;
    font-weight: 600;
}

.inc-step-indicator.completed {
    color: #059669;
}

.inc-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-secondary, #64748b);
    border: 2px solid var(--border-color, #e2e8f0);
    transition: all 0.2s;
}

.inc-step-indicator.active .inc-step-num {
    background: #7C3AED;
    color: white;
    border-color: #7C3AED;
}

.inc-step-indicator.completed .inc-step-num {
    background: #059669;
    color: white;
    border-color: #059669;
}

.inc-step-label {
    white-space: nowrap;
}

.inc-step-line {
    flex: 1;
    height: 2px;
    background: var(--border-color, #e2e8f0);
    min-width: 20px;
    transition: background 0.3s;
}

.inc-step-line.completed {
    background: #059669;
}

/* Step content */
.inc-step-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.inc-form-section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.inc-form-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.75rem;
}

/* Form elements */
.inc-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

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

.inc-form-group.inc-form-grow {
    flex: 1;
    min-width: 200px;
}

.inc-form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
}

.inc-form-group input,
.inc-form-group select,
.inc-form-group textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--card-bg, white);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.inc-form-group input:focus,
.inc-form-group select:focus,
.inc-form-group textarea:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Navigation buttons */
.inc-nav-buttons {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: var(--card-bg, white);
}

/* People tables */
.inc-people-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.inc-people-table th {
    text-align: left;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inc-people-table td {
    padding: 0.35rem 0.25rem;
}

.inc-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    font-size: 0.82rem;
    width: 100%;
    background: var(--card-bg, white);
    color: var(--text-primary);
    box-sizing: border-box;
}

.inc-input[type="checkbox"] {
    width: auto;
}

.inc-input:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.inc-btn-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.inc-btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.inc-add-row-btn {
    background: none;
    border: 1px dashed var(--border-color, #cbd5e1);
    color: #7C3AED;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s;
}

.inc-add-row-btn:hover {
    background: rgba(124, 58, 237, 0.05);
    border-color: #7C3AED;
}

/* Share class cards */
.inc-share-class-card {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.inc-share-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.inc-share-card-header h4 {
    font-size: 0.95rem;
    color: #7C3AED;
    margin: 0;
}

/* Document dashboard */
.inc-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.inc-doc-card {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.2s;
}

.inc-doc-card:hover {
    border-color: #7C3AED;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.inc-doc-card.generated {
    border-left: 3px solid #059669;
}

.inc-doc-card.edited {
    border-left: 3px solid #f59e0b;
}

.inc-doc-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inc-doc-icon {
    font-size: 1.1rem;
}

.inc-doc-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.inc-status-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
}

.inc-status-badge.pending {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.inc-status-badge.generating {
    background: rgba(124, 58, 237, 0.1);
    color: #7C3AED;
    animation: incPulse 1.5s infinite;
}

.inc-status-badge.generated {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.inc-status-badge.edited {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

@keyframes incPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.inc-doc-actions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.inc-doc-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--card-bg, white);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #64748b);
    transition: all 0.2s;
}

.inc-doc-btn:hover {
    border-color: #7C3AED;
    color: #7C3AED;
    background: rgba(124, 58, 237, 0.05);
}

/* Progress bar */
.inc-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.inc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7C3AED, #a78bfa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Incorporation badge */
.juridique-type-badge.incorporation {
    background: #7C3AED !important;
    color: white !important;
}

/* Dark mode */
[data-theme="dark"] .inc-doc-card {
    background: var(--card-bg, #1e293b);
}

[data-theme="dark"] .inc-share-class-card {
    background: var(--card-bg, #1e293b);
}

[data-theme="dark"] .inc-input {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
    color: var(--text-primary, #e2e8f0);
}

[data-theme="dark"] .inc-progress-bar {
    background: var(--bg-secondary, #334155);
}

/* ============================================ */
/* LIVRE CORPORATIF — Header & Stats            */
/* ============================================ */

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

.inc-book-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.15rem;
}

.inc-book-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
    margin: 0;
    font-style: italic;
}

.inc-book-stats {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.inc-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    min-width: 80px;
}

.inc-stat-obligatoire {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.inc-stat-total {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.inc-stat-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.inc-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Boutons d'action principaux */
.inc-book-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.inc-btn-generate-all {
    background: linear-gradient(135deg, #7C3AED, #5B21B6) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.inc-btn-generate-all:hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

/* ============================================ */
/* FILTRES DOCUMENTS                            */
/* ============================================ */

.inc-doc-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 10px;
    width: fit-content;
}

.inc-filter-btn {
    padding: 0.4rem 0.9rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.inc-filter-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #7C3AED;
}

.inc-filter-btn.active {
    background: white;
    color: #7C3AED;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    font-weight: 600;
}

[data-theme="dark"] .inc-doc-filters {
    background: var(--card-bg, #1e293b);
}

[data-theme="dark"] .inc-filter-btn.active {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
}

/* ============================================ */
/* BADGES PRIORITÉ                              */
/* ============================================ */

.inc-priority-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    line-height: 1;
    margin-top: 0.2rem;
}

.inc-priority-badge.obligatoire {
    background: rgba(220, 38, 38, 0.1);
    color: #DC2626;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.inc-priority-badge.recommande {
    background: rgba(234, 179, 8, 0.1);
    color: #B45309;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

[data-theme="dark"] .inc-priority-badge.obligatoire {
    background: rgba(220, 38, 38, 0.15);
    color: #F87171;
    border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="dark"] .inc-priority-badge.recommande {
    background: rgba(234, 179, 8, 0.12);
    color: #FBBF24;
    border-color: rgba(234, 179, 8, 0.25);
}

/* Doc card avec priorité */
.inc-doc-card.obligatoire {
    border-left: 3px solid #DC2626;
}

.inc-doc-card.recommande {
    border-left: 3px solid #EAB308;
}

.inc-doc-card.generated.obligatoire {
    border-left-color: #16A34A;
}

.inc-doc-card.generated.recommande {
    border-left-color: #16A34A;
}

/* Doc info layout */
.inc-doc-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.inc-doc-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.inc-doc-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Catégorie sections */
.inc-cat-section {
    margin-bottom: 1.25rem;
}

.inc-cat-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0 0 0.6rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .inc-stat-obligatoire {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.25);
}

[data-theme="dark"] .inc-stat-total {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.25);
}

[data-theme="dark"] .inc-stat-number {
    color: var(--text-primary, #e2e8f0);
}

/* ============================================ */
/* INCORPORATION GENERATION OVERLAY             */
/* ============================================ */

.inc-gen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: incOverlayFadeIn 0.3s ease;
}

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

.inc-gen-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.inc-gen-header {
    text-align: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.inc-gen-header .inc-gen-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: juridique-pulse 2s ease-in-out infinite;
    font-size: 1.6rem;
}

.inc-gen-header h3 {
    font-size: 1.1rem;
    color: #312e81;
    margin: 0 0 0.25rem;
}

.inc-gen-header p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.inc-gen-steps {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
    min-height: 0;
}

.inc-gen-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: background 0.3s, opacity 0.3s;
}

.inc-gen-step.pending {
    opacity: 0.45;
}

.inc-gen-step.generating {
    background: rgba(124, 58, 237, 0.07);
    opacity: 1;
}

.inc-gen-step.generated {
    opacity: 1;
}

.inc-gen-step.error {
    opacity: 1;
    background: rgba(220, 38, 38, 0.07);
}

.inc-gen-step.skipped {
    opacity: 0.4;
}

.inc-gen-step-icon {
    font-size: 1.1rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.inc-gen-step-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
}

.inc-gen-step-status {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.inc-gen-step-status .inc-gen-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #7C3AED;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.inc-gen-step-status .inc-gen-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-block;
}

.inc-gen-footer {
    flex-shrink: 0;
    text-align: center;
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding-top: 1rem;
}

.inc-gen-counter {
    font-size: 0.9rem;
    font-weight: 600;
    color: #312e81;
    margin-bottom: 0.75rem;
}

.inc-gen-close-btn {
    display: none;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.inc-gen-close-btn.visible {
    display: inline-block;
}

.inc-gen-close-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Dark mode — overlay */
[data-theme="dark"] .inc-gen-content {
    background: var(--card-bg, #1e293b);
}

[data-theme="dark"] .inc-gen-header h3 {
    color: #c4b5fd;
}

[data-theme="dark"] .inc-gen-header p {
    color: #94a3b8;
}

[data-theme="dark"] .inc-gen-step-name {
    color: var(--text-primary, #e2e8f0);
}

[data-theme="dark"] .inc-gen-step.generating {
    background: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .inc-gen-step.error {
    background: rgba(220, 38, 38, 0.15);
}

[data-theme="dark"] .inc-gen-counter {
    color: #c4b5fd;
}

[data-theme="dark"] .inc-gen-footer {
    border-top-color: var(--border-color, #334155);
}

[data-theme="dark"] .inc-gen-step-status .inc-gen-dot {
    border-color: #475569;
}

[data-theme="dark"] .inc-gen-step-status .inc-gen-spinner {
    border-color: #334155;
    border-top-color: #a78bfa;
}

/* ============================================ */
/* SEND CORPORATE BOOK MODAL                    */
/* ============================================ */

#modal-send-corporate-book .modal-content {
    border-radius: 16px;
}

.inc-send-person-cb {
    accent-color: #7C3AED;
    width: 16px;
    height: 16px;
}

.inc-send-person-email:focus {
    outline: none;
    border-color: #7C3AED !important;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

#inc-send-extra-email:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

#inc-send-message:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

/* ============================================
   ÉVALUATION LÉGALE - Split View
   ============================================ */

.juridique-eval-header {
    margin-bottom: 1.5rem;
}
.juridique-eval-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2937;
}

.juridique-eval-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 1.5rem;
}

.juridique-eval-panel {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.juridique-eval-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.9rem;
}
.juridique-eval-panel-icon {
    font-size: 1.1rem;
}
.juridique-eval-panel-title {
    flex: 1;
}

.juridique-eval-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}
.juridique-eval-status-ok {
    background: #d1fae5;
    color: #065f46;
}
.juridique-eval-status-template {
    background: #ede9fe;
    color: #5b21b6;
}
.juridique-eval-status-empty {
    background: #fee2e2;
    color: #991b1b;
}

.juridique-eval-panel-body {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.juridique-eval-doc-preview {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

.juridique-eval-template-notice {
    color: #5b21b6;
    background: #f5f3ff;
    padding: 12px;
    border-radius: 8px;
}

.juridique-eval-doc-empty {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

.juridique-eval-launch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}
.juridique-eval-launch-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.juridique-eval-launch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sélecteur de favorisation */
.juridique-eval-favor-selector {
    margin: 16px 0;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.juridique-eval-favor-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 10px;
}
.juridique-eval-favor-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.juridique-eval-favor-option {
    cursor: pointer;
}
.juridique-eval-favor-option input[type="radio"] {
    display: none;
}
.juridique-eval-favor-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 2px solid #e2e8f0;
    background: #fff;
    transition: all 0.2s ease;
}
.juridique-eval-favor-badge.university { color: #4F46E5; }
.juridique-eval-favor-badge.balanced { color: #7C3AED; }
.juridique-eval-favor-badge.partner { color: #0891b2; }

.juridique-eval-favor-option input[type="radio"]:checked + .juridique-eval-favor-badge.university {
    background: #EEF2FF;
    border-color: #4F46E5;
    box-shadow: 0 0 0 1px #4F46E5;
}
.juridique-eval-favor-option input[type="radio"]:checked + .juridique-eval-favor-badge.balanced {
    background: #F5F3FF;
    border-color: #7C3AED;
    box-shadow: 0 0 0 1px #7C3AED;
}
.juridique-eval-favor-option input[type="radio"]:checked + .juridique-eval-favor-badge.partner {
    background: #ECFEFF;
    border-color: #0891b2;
    box-shadow: 0 0 0 1px #0891b2;
}
.juridique-eval-favor-option:hover .juridique-eval-favor-badge {
    border-color: #94a3b8;
}

/* Résultat évaluation */
.juridique-eval-result-container {
    margin-top: 1rem;
}
.juridique-eval-result-container h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.juridique-eval-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 1rem;
}
.juridique-eval-summary-card {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}
.juridique-eval-summary-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}
.juridique-eval-summary-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
}

.juridique-eval-overall-risk {
    padding: 10px 16px;
    border: 2px solid;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.juridique-eval-concerns {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 1rem;
}
.juridique-eval-concerns h4 {
    color: #991b1b;
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.juridique-eval-concerns ul {
    margin: 0;
    padding-left: 1.2rem;
}
.juridique-eval-concerns li {
    font-size: 0.85rem;
    color: #7f1d1d;
    margin-bottom: 4px;
}

/* Clause comparison */
.juridique-eval-clause {
    border: 1px solid #e5e7eb;
    border-left: 4px solid #6b7280;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}
.juridique-eval-clause-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.juridique-eval-risk-badge {
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.juridique-eval-clause-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.juridique-eval-clause-ref,
.juridique-eval-clause-ext {
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.5;
}
.juridique-eval-clause-ref {
    border-right: 1px solid #e5e7eb;
    background: #fafafa;
}
.juridique-eval-clause-ext {
    background: #fff;
}
.juridique-eval-clause-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.juridique-eval-clause-text {
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}
.juridique-eval-clause-analysis,
.juridique-eval-clause-recommendation {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #4b5563;
    border-top: 1px solid #e5e7eb;
}
.juridique-eval-clause-recommendation {
    background: #eff6ff;
    color: #1e40af;
}

/* Document remanié */
.juridique-eval-balanced-section {
    margin-top: 1.5rem;
    border: 2px dashed #c4b5fd;
    border-radius: 10px;
    padding: 16px;
    background: #faf5ff;
}
.juridique-eval-balanced-section h4 {
    color: #5b21b6;
    margin-bottom: 4px;
}
.juridique-eval-balanced-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}
.juridique-eval-balanced-content:focus {
    outline: 2px solid #7C3AED;
    outline-offset: 2px;
}
.juridique-eval-save-btn {
    margin-top: 12px;
    padding: 10px 20px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.juridique-eval-save-btn:hover {
    background: #047857;
}

/* Responsive */
@media (max-width: 768px) {
    .juridique-eval-split,
    .juridique-eval-clause-split {
        grid-template-columns: 1fr;
    }
    .juridique-eval-clause-ref {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .juridique-eval-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}
