/**
 * AcadIA-M - Styles du Module Publications Scientifiques
 */

/* ============================================
   CONTENEUR PRINCIPAL
   ============================================ */

/* Vue publications */
#view-publications {
    box-sizing: border-box;
    background: var(--bg-primary, #f8fafc);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#view-publications.active {
    display: flex !important;
    flex-direction: column;
}

#view-publications .view-header {
    flex-shrink: 0;
}

/* Container principal - style coloré */
.publications-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
    max-width: 100%;
    background: var(--bg-primary, #f8fafc);
    box-sizing: border-box;
    border-radius: 0;
    overflow: hidden;
    padding: 0.75rem;
}

/* ============================================
   PANNEAU LISTE (GAUCHE) - style coloré cyan
   ============================================ */

.pub-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);
    position: relative;
}

/* Overlay de chargement pour la liste des publications */
.pub-liste-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: none; /* Masque par defaut, affiche par JS */
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: 12px;
}

.pub-liste-overlay-content {
    text-align: center;
    padding: 1.5rem;
}

.pub-liste-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #0891b2;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.pub-liste-overlay-content p {
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
    margin: 0;
}

/* Section publications - prend toute la hauteur */
.pub-section-publications {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* Header de section - style coloré cyan */
.pub-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    border-radius: 10px 10px 0 0;
    position: relative;
    overflow: hidden;
}

.pub-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;
}

.pub-section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.pub-section-header h3 svg {
    color: rgba(255, 255, 255, 0.9);
    stroke: rgba(255, 255, 255, 0.9);
}

/* Bouton dans le header Publications */
.pub-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.6rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.pub-section-header .btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.pub-section-header .btn svg {
    color: #ffffff;
    stroke: #ffffff;
}

.pub-header-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    z-index: 1;
}

.pub-liste {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(180deg, #f0fdff 0%, #e6fbff 100%);
    min-height: 0;
}

/* Scrollbar personnalisé pour la liste */
.pub-liste::-webkit-scrollbar {
    width: 6px;
}

.pub-liste::-webkit-scrollbar-track {
    background: transparent;
}

.pub-liste::-webkit-scrollbar-thumb {
    background-color: rgba(8, 145, 178, 0.3);
    border-radius: 3px;
}

.pub-liste::-webkit-scrollbar-thumb:hover {
    background-color: rgba(8, 145, 178, 0.5);
}

/* Card publication - style coloré cyan */
.pub-card {
    background: linear-gradient(135deg, #f0fdff 0%, #e6fbff 100%);
    border: 1px solid rgba(8, 145, 178, 0.15);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pub-card:hover {
    border-color: rgba(8, 145, 178, 0.4);
    background: linear-gradient(135deg, #e6fbff 0%, #d4f7ff 100%);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15);
    transform: translateY(-2px);
}

.pub-card.active {
    border-color: #06b6d4;
    background: linear-gradient(135deg, #d4f7ff 0%, #c4f3ff 100%);
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.2);
}

.pub-card-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pub-type-badge, .pub-statut-badge {
    font-size: 0.62rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.pub-type-badge.article { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
.pub-type-badge.conference { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.pub-type-badge.rapport { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #3730a3; }
.pub-type-badge.these { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: #9d174d; }

.pub-statut-badge.brouillon { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); color: #4b5563; }
.pub-statut-badge.en_cours { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.pub-statut-badge.soumis { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
.pub-statut-badge.publie { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; }

.pub-delete-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #c4c4c4;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pub-delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.pub-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.pub-card-date {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

.pub-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #6b7280);
}

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

.pub-empty-state p {
    margin: 0 0 1rem 0;
}

/* ============================================
   PANNEAU CONTENU (DROITE)
   ============================================ */

.pub-content-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    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);
}

/* Etat vide */
.pub-empty-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.pub-empty-icon {
    margin-bottom: 1.5rem;
    opacity: 0.2;
}

.pub-empty-content h3 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.pub-empty-content p {
    color: var(--text-muted, #6b7280);
    margin: 0 0 2rem 0;
}

.pub-agents-preview {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pub-agent-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.agent-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

/* Agents IA AcadIA-M */
.agent-icon.deephemisyncplus { background: linear-gradient(135deg, #10b981, #059669); }
.agent-icon.deephemisync { background: linear-gradient(135deg, #1B4F72, #2E86C1); }
.agent-icon.deepspin { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.agent-icon.triad { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.agent-icon.mentia { background: linear-gradient(135deg, #10b981, #34d399); }

.pub-agent-card span {
    font-weight: 600;
    font-size: 0.875rem;
}

.pub-agent-card small {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

/* ============================================
   EDITEUR DE PUBLICATION
   ============================================ */

.pub-editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.pub-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(8, 145, 178, 0.1);
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    border-radius: 11px 11px 0 0;
    position: relative;
}

.pub-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;
    border-radius: 11px 11px 0 0;
}

.pub-titre-input {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 0.75rem;
    outline: none;
    color: #ffffff;
    border-radius: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.pub-titre-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.pub-titre-input:focus {
    background: rgba(255, 255, 255, 0.25);
}

.pub-actions {
    display: flex;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.pub-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.pub-actions .btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.pub-actions .btn svg {
    color: #ffffff;
    stroke: #ffffff;
}

/* ============================================
   ONGLETS - style coloré cyan
   ============================================ */

.pub-tabs {
    display: flex;
    gap: 0;
    padding: 0 0.75rem;
    border-bottom: 1px solid rgba(8, 145, 178, 0.1);
    background: linear-gradient(180deg, #f0fdff 0%, #f8fafc 100%);
    flex-shrink: 0;
}

.pub-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.pub-tab:hover {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.05);
}

.pub-tab.active {
    color: #0891b2;
    border-bottom-color: #06b6d4;
    background: rgba(8, 145, 178, 0.08);
}

.pub-tab svg {
    color: currentColor;
    stroke: currentColor;
}

.pub-tab-badge {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(8, 145, 178, 0.3);
    transition: transform 0.3s ease;
}

.pub-tab-badge.pulse {
    animation: badge-pulse 0.5s ease-out;
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); background: linear-gradient(135deg, #10b981, #34d399); }
    100% { transform: scale(1); }
}

/* ============================================
   CONTENU DES ONGLETS
   ============================================ */

.pub-tab-content {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
    padding-bottom: 2rem;
    min-height: 0;
    max-height: calc(100vh - 280px);
}

.pub-pane {
    display: none;
}

.pub-pane.active {
    display: block;
}

/* Formulaire */
.pub-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pub-form-grid .form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary, #374151);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--bg-primary, #fff);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* Auteurs */
.pub-auteurs-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

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

.section-header h4 {
    margin: 0;
    font-size: 1rem;
}

.pub-auteurs-liste {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pub-auteur-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
}

/* ============================================
   BIBLIOGRAPHIE
   ============================================ */

/* Overlay de recherche bibliographique */
.biblio-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

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

.biblio-overlay-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.biblio-overlay-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #14b8a6;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

.biblio-overlay-content .agent-badge.large {
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.biblio-overlay-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0 0 0.75rem 0;
}

.biblio-overlay-content p {
    color: var(--text-secondary, #64748b);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

.biblio-overlay-sources {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.biblio-overlay-sources .source-badge {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    color: #0d9488;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #99f6e4;
    animation: pulse 2s ease-in-out infinite;
}

.biblio-overlay-sources .source-badge:nth-child(2) {
    animation-delay: 0.5s;
}

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

/* Le pane biblio doit etre en position relative pour l'overlay */
#pub-pane-biblio {
    position: relative;
    min-height: 500px;
}

#pub-pane-biblio.active {
    display: block;
    height: 100%;
}

/* Layout deux colonnes pour bibliographie */
.pub-biblio-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    height: 100%;
    min-height: 500px;
}

@media (max-width: 1200px) {
    .pub-biblio-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Zone générique */
.pub-biblio-zone {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, #e2e8f0);
    overflow: hidden;
}

/* Zone de recherche - style cyan */
.pub-biblio-search-zone {
    background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
    border-color: #99f6e4;
}

/* Zone des références retenues - style violet */
.pub-biblio-selected-zone {
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
    border-color: #e9d5ff;
}

/* Header de zone */
.biblio-zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
}

.pub-biblio-search-zone .biblio-zone-header {
    border-bottom-color: #5eead4;
}

.pub-biblio-selected-zone .biblio-zone-header {
    border-bottom-color: #c4b5fd;
}

.biblio-zone-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.biblio-zone-title svg {
    color: var(--text-muted, #6b7280);
}

.pub-biblio-search-zone .biblio-zone-title svg {
    color: #0d9488;
}

.pub-biblio-selected-zone .biblio-zone-title svg {
    color: #7c3aed;
}

.biblio-zone-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Badge compteur pour références retenues */
.selected-count-badge {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    font-size: 0.875rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Ancien header (rétrocompat) */
.pub-biblio-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.biblio-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.biblio-info p {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

.pub-biblio-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary, #374151);
}

.results-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pub-biblio-results-header .btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.pub-biblio-results-header .btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.pub-biblio-results-header .btn-success svg {
    stroke-width: 3;
}

.results-count {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

/* État vide stylisé */
.biblio-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #9ca3af);
    min-height: 150px;
}

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

.biblio-empty-state p {
    font-size: 0.875rem;
    margin: 0;
    max-width: 250px;
    line-height: 1.5;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted, #6b7280);
}

.loading-state .agent-badge {
    margin-right: 0.5rem;
}

.loading-state p {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted, #6b7280);
    font-size: 0.875rem;
}

.pub-biblio-search {
    margin-bottom: 1.5rem;
}

.search-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    font-size: 0.875rem;
}

.biblio-sources {
    display: flex;
    gap: 1.5rem;
}

.biblio-sources label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.pub-biblio-results {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
}

.biblio-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

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

.biblio-result-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.biblio-source {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.biblio-source.semantic_scholar { background: #dbeafe; color: #1e40af; }
.biblio-source.arxiv { background: #fecaca; color: #991b1b; }

.biblio-year, .biblio-citations {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

.biblio-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.biblio-authors {
    font-size: 0.8rem;
    color: var(--text-secondary, #374151);
    margin-bottom: 0.5rem;
}

.biblio-abstract {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

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

/* References selectionnees */
.pub-biblio-selected h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.pub-refs-liste {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ref-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
}

.ref-number {
    font-weight: 600;
    font-size: 0.75rem;
    color: #0891b2;
    min-width: 24px;
}

.ref-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ref-authors {
    font-size: 0.75rem;
    color: var(--text-secondary, #374151);
}

.ref-title {
    font-size: 0.8rem;
    font-weight: 500;
}

.ref-meta {
    font-size: 0.7rem;
    color: var(--text-muted, #6b7280);
}

/* ============================================
   STRUCTURE
   ============================================ */

.pub-structure-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.structure-info h4 {
    margin: 0 0 0.25rem 0;
}

.structure-info p {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

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

.btn-ai {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    background: var(--bg-primary, #fff);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-ai:hover:not(:disabled) {
    border-color: #06b6d4;
    background: #f0fdff;
}

.btn-ai:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.agent-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
}

/* Badges agents IA AcadIA-M */
.agent-badge.deephemisyncplus { background: linear-gradient(135deg, #10b981, #059669); }
.agent-badge.deephemisync { background: linear-gradient(135deg, #1B4F72, #2E86C1); }
.agent-badge.deepspin { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.agent-badge.triad { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.agent-badge.mentia { background: linear-gradient(135deg, #10b981, #34d399); }

/* Analyse nouveaute */
.pub-analyse-nouveaute {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.pub-analyse-nouveaute h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.analyse-section {
    margin-bottom: 1rem;
}

.analyse-section:last-child {
    margin-bottom: 0;
}

.analyse-section h6 {
    font-size: 0.8rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary, #374151);
}

.analyse-section ul {
    margin: 0;
    padding-left: 1.25rem;
}

.analyse-section li {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.score-bar {
    height: 24px;
    background: var(--border-color, #e0e0e0);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #0891b2, #06b6d4);
    border-radius: 12px;
}

.score-value {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    font-size: 0.8rem;
}

/* Structure preview */
.pub-structure-preview {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 1rem;
}

.structure-empty {
    text-align: center;
    color: var(--text-muted, #6b7280);
    padding: 2rem;
}

.structure-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.structure-header h5 {
    margin: 0 0 0.25rem 0;
}

.structure-header p {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

.structure-section {
    margin-bottom: 0.5rem;
}

.section-header-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-primary, #fff);
    border-radius: 6px;
}

.section-number {
    font-weight: 700;
    color: #0891b2;
    min-width: 24px;
}

.section-title {
    flex: 1;
    font-weight: 500;
}

.section-words {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

.sous-sections {
    padding-left: 2rem;
    margin-top: 0.25rem;
}

.sous-section {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.ss-number {
    color: var(--text-muted, #6b7280);
    min-width: 32px;
}

/* ============================================
   REDACTION
   ============================================ */

.pub-redaction-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.redaction-info h4 {
    margin: 0 0 0.25rem 0;
}

.redaction-info p {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

/* Selecteur de methode de redaction */
.redaction-method-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.redaction-method-selector > label {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    font-weight: 500;
}

.method-options {
    display: flex;
    gap: 0.75rem;
}

.method-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary, #f8f9fa);
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.method-option:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.method-option:has(input:checked) {
    border-color: #0891b2;
    background: linear-gradient(135deg, #f0fdff 0%, #e6fbff 100%);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.method-option input[type="radio"] {
    display: none;
}

.method-option .method-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary, #1e293b);
}

.method-option .method-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

.method-option .agent-badge {
    flex-shrink: 0;
}

.pub-sections-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.redaction-section-card {
    padding: 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.redaction-section-card:hover {
    border-color: #06b6d4;
    background: rgba(8, 145, 178, 0.05);
}

.redaction-section-card.active {
    border-color: #06b6d4;
    background: linear-gradient(135deg, #f0fdff 0%, #e6fbff 100%);
}

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

.section-ai-rate-mini {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    background: #e0e0e0;
    color: #666;
    min-width: 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.section-ai-rate-mini:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.section-card-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.section-card-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.section-card-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.section-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted, #6b7280);
    padding: 2rem;
}

.pub-section-editor {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 1rem;
}

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

.section-editor-header h5 {
    margin: 0;
}

#section-editor-content {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
}

/* ============================================
   LATEX EDITOR
   ============================================ */

.pub-latex-header {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.latex-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.latex-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pub-latex-editor {
    height: 500px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
}

.pub-latex-editor pre {
    margin: 0;
    padding: 1rem;
    height: 100%;
    overflow: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    background: var(--bg-secondary, #f8f9fa);
}

/* ============================================
   SPINNER
   ============================================ */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted, #6b7280);
}

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

[data-theme="dark"] .publications-container {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --border-color: #404040;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
}

[data-theme="dark"] .pub-liste-panel,
[data-theme="dark"] .pub-content-panel {
    background: var(--bg-secondary);
}

[data-theme="dark"] .pub-card,
[data-theme="dark"] .section-header-item,
[data-theme="dark"] .biblio-result-item {
    background: var(--bg-primary);
}

[data-theme="dark"] .pub-card.active {
    background: rgba(8, 145, 178, 0.15);
    border-color: rgba(6, 182, 212, 0.4);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] #section-editor-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .pub-tabs {
    background: #1a1a1a;
    border-color: #404040;
}

[data-theme="dark"] .pub-tab:hover {
    background: rgba(8, 145, 178, 0.1);
}

[data-theme="dark"] .pub-tab.active {
    background: rgba(8, 145, 178, 0.15);
}

[data-theme="dark"] .pub-latex-editor pre {
    background: #1a1a1a;
    color: #d4d4d4;
}

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

@media (max-width: 1024px) {
    .publications-container {
        grid-template-columns: 1fr;
    }

    .pub-liste-panel {
        max-height: 200px;
    }

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

@media (max-width: 768px) {
    .pub-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .pub-tab {
        flex-shrink: 0;
    }

    .structure-actions {
        flex-direction: column;
    }

    .pub-sections-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FORMULAIRE - SECTIONS CARTES
   ============================================ */

.pub-section-card {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Section titre - style coloré cyan */
.pub-section-card.pub-section-titre {
    background: linear-gradient(135deg, #e6fbff 0%, #d4f7ff 100%);
    border: 1px solid rgba(8, 145, 178, 0.2);
    color: var(--text-primary);
}

.pub-section-card.pub-section-titre h4 {
    color: #0891b2;
}

.pub-section-card.pub-section-titre .form-help {
    color: var(--text-secondary);
}

.pub-section-card.pub-section-titre input {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.pub-section-card.pub-section-titre input::placeholder {
    color: var(--grey);
}

.section-header-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-header-icon svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.section-header-icon h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    flex: 1;
}

.section-header-icon .btn {
    margin-left: auto;
}

/* Textarea dans les cartes de section - bien visible */
.pub-section-card textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    resize: vertical;
    transition: all 0.2s ease;
}

.pub-section-card textarea::placeholder {
    color: #94a3b8;
}

.pub-section-card textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.pub-titre-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: 500;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.pub-titre-large:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.5rem;
}

/* ============================================
   ZONE D'UPLOAD DE FICHIERS
   ============================================ */

.pub-pieces-jointes {
    margin-top: 0.5rem;
}

.pub-upload-zone {
    border: 2px dashed var(--border-color, #cbd5e1);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: var(--bg-tertiary, #f8fafc);
    transition: all 0.2s ease;
    cursor: pointer;
}

.pub-upload-zone:hover {
    border-color: #06b6d4;
    background: #f0fdff;
}

.pub-upload-zone.dragover {
    border-color: #06b6d4;
    background: #e6fbff;
    transform: scale(1.01);
}

.pub-upload-zone svg {
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 1rem;
}

.pub-upload-zone p {
    margin: 0 0 0.25rem 0;
    font-weight: 500;
    color: var(--text-primary, #475569);
}

.pub-upload-zone small {
    color: var(--text-secondary, #94a3b8);
}

.pub-upload-zone .btn {
    margin-top: 1rem;
}

.pub-fichiers-liste {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pub-fichier-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.pub-fichier-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.pub-fichier-icon.pdf { background: #fee2e2; color: #dc2626; }
.pub-fichier-icon.image { background: #dbeafe; color: #2563eb; }
.pub-fichier-icon.excel { background: #d1fae5; color: #059669; }
.pub-fichier-icon.csv { background: #fef3c7; color: #d97706; }
.pub-fichier-icon.other { background: #f3f4f6; color: #6b7280; }

.pub-fichier-info {
    flex: 1;
    min-width: 0;
}

.pub-fichier-nom {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pub-fichier-taille {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
}

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

.pub-fichier-actions button {
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    border-radius: 4px;
    transition: all 0.2s;
}

.pub-fichier-actions button:hover {
    background: var(--bg-tertiary, #e2e8f0);
    color: var(--text-primary, #1e293b);
}

.pub-fichier-actions button.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================
   LISTE DES AUTEURS
   ============================================ */

.pub-auteurs-liste {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pub-auteur-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    align-items: center;
}

.pub-auteur-item input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    font-size: 0.875rem;
}

.pub-auteur-item input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}

.pub-auteur-actions {
    display: flex;
    gap: 0.25rem;
}

.pub-auteur-actions button {
    padding: 0.375rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    border-radius: 4px;
    transition: all 0.2s;
}

.pub-auteur-actions button:hover {
    background: var(--bg-tertiary, #e2e8f0);
}

.pub-auteur-actions button.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Animation d'entree */
.pub-section-card {
    animation: slideIn 0.3s ease-out;
}

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

/* ============================================
   EDITEUR QUILL - RESUME
   ============================================ */

.pub-resume-editor-container {
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-primary, #fff);
}

.pub-resume-editor-container .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    background: var(--bg-secondary, #f8f9fa);
    padding: 0.5rem;
}

.pub-resume-editor-container .ql-container {
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
}

.pub-resume-editor-container .ql-editor {
    min-height: 180px;
    max-height: 350px;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    line-height: 1.6;
}

.pub-resume-editor-container .ql-editor.ql-blank::before {
    font-style: normal;
    color: var(--text-muted, #9ca3af);
}

/* Boutons toolbar Quill */
.pub-resume-editor-container .ql-toolbar button {
    width: 28px;
    height: 28px;
    padding: 3px;
}

.pub-resume-editor-container .ql-toolbar button:hover {
    background: var(--border-color, #e0e0e0);
    border-radius: 4px;
}

.pub-resume-editor-container .ql-toolbar button.ql-active {
    background: var(--primary-bg, #eff6ff);
    color: var(--primary-color, #3b82f6);
    border-radius: 4px;
}

/* Dark mode pour Quill */
[data-theme="dark"] .pub-resume-editor-container {
    border-color: #404040;
}

[data-theme="dark"] .pub-resume-editor-container .ql-toolbar {
    background: #2d2d2d;
    border-color: #404040;
}

[data-theme="dark"] .pub-resume-editor-container .ql-container {
    background: #1e1e1e;
}

[data-theme="dark"] .pub-resume-editor-container .ql-editor {
    color: #e0e0e0;
}

[data-theme="dark"] .pub-resume-editor-container .ql-stroke {
    stroke: #b0b0b0;
}

[data-theme="dark"] .pub-resume-editor-container .ql-fill {
    fill: #b0b0b0;
}

[data-theme="dark"] .pub-resume-editor-container .ql-picker-label {
    color: #b0b0b0;
}

[data-theme="dark"] .pub-resume-editor-container .ql-toolbar button:hover {
    background: #404040;
}

[data-theme="dark"] .pub-resume-editor-container .ql-toolbar button.ql-active {
    background: rgba(59, 130, 246, 0.2);
}

/* ============================================
   BOUTON DECOUVRIR JOURNAL
   ============================================ */

.input-with-button {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-with-button input {
    flex: 1;
    min-width: 0;
}

.btn-discover {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-discover:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-discover:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn-discover .agent-badge {
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
}

.btn-discover .spinner {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* ============================================
   MODAL SUGGESTIONS JOURNAL
   ============================================ */

.pub-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pub-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pub-modal {
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.pub-modal-overlay.active .pub-modal {
    transform: translateY(0);
}

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

.pub-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.1rem;
}

.pub-modal-header .btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted, #6b7280);
    padding: 0.25rem;
    line-height: 1;
}

.pub-modal-header .btn-close:hover {
    color: var(--text-primary, #1f2937);
}

.pub-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.suggestions-intro {
    font-size: 0.9rem;
    color: var(--text-secondary, #4b5563);
    margin: 0 0 1rem 0;
}

.suggestions-liste {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    border-color: #06b6d4;
    background: #f0fdff;
    transform: translateX(4px);
}

.suggestion-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-nom {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
    margin-bottom: 0.25rem;
}

.suggestion-impact {
    font-size: 0.8rem;
    color: #0891b2;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.suggestion-raison {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
}

.suggestion-select {
    color: var(--text-muted, #9ca3af);
    transition: color 0.2s;
}

.suggestion-item:hover .suggestion-select {
    color: #0891b2;
}

.pub-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

/* Dark mode modal */
[data-theme="dark"] .pub-modal {
    background: #1e1e1e;
}

[data-theme="dark"] .pub-modal-header,
[data-theme="dark"] .pub-modal-footer {
    border-color: #404040;
}

[data-theme="dark"] .suggestion-item {
    background: #2d2d2d;
    border-color: #404040;
}

[data-theme="dark"] .suggestion-item:hover {
    background: rgba(8, 145, 178, 0.15);
    border-color: rgba(6, 182, 212, 0.4);
}

/* ============================================
   BOUTON DE SAUVEGARDE FLOTTANT
   ============================================ */

.pub-floating-save {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.btn-floating-save {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4), 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-floating-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5), 0 4px 10px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-floating-save:active {
    transform: translateY(0);
}

.btn-floating-save svg {
    flex-shrink: 0;
}

/* Style btn-success pour le bouton dans le header */
.pub-actions .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.pub-actions .btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Dark mode pour le bouton flottant */
[data-theme="dark"] .btn-floating-save {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .btn-floating-save:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* ============================================
   COMPTEURS DE MOTS
   ============================================ */

/* Compteur global */
.pub-word-count-global {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

[data-theme="dark"] .pub-word-count-global {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e3a8a 100%);
    border-color: #3b82f6;
}

.word-count-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #0369a1;
}

[data-theme="dark"] .word-count-header {
    color: #93c5fd;
}

.word-count-icon {
    font-size: 1.2em;
}

.word-count-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.word-count-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.word-count-item .count-label {
    color: #64748b;
}

[data-theme="dark"] .word-count-item .count-label {
    color: #94a3b8;
}

.word-count-item .count-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0ea5e9;
}

[data-theme="dark"] .word-count-item .count-value {
    color: #38bdf8;
}

.word-count-item.total .count-value {
    color: #0369a1;
    font-size: 1.3rem;
}

[data-theme="dark"] .word-count-item.total .count-value {
    color: #7dd3fc;
}

.count-separator {
    color: #94a3b8;
    font-weight: 500;
}

.count-unit {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Compteur par section dans les cartes */
.section-card-word-count {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.word-count-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.word-count-badge.ok {
    background: #dcfce7;
    color: #166534;
}

.word-count-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.word-count-badge.over {
    background: #fee2e2;
    color: #991b1b;
}

[data-theme="dark"] .word-count-badge.ok {
    background: #14532d;
    color: #86efac;
}

[data-theme="dark"] .word-count-badge.warning {
    background: #78350f;
    color: #fcd34d;
}

[data-theme="dark"] .word-count-badge.over {
    background: #7f1d1d;
    color: #fca5a5;
}

/* Mini barre de progression */
.mini-progress-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

[data-theme="dark"] .mini-progress-bar {
    background: #334155;
}

.mini-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.mini-progress-fill.ok {
    background: #22c55e;
}

.mini-progress-fill.warning {
    background: #f59e0b;
}

.mini-progress-fill.over {
    background: #ef4444;
}

/* Editeur de section - header avec config mots */
.section-editor-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 1;
}

.section-word-config {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.section-word-config label {
    color: #64748b;
    white-space: nowrap;
}

[data-theme="dark"] .section-word-config label {
    color: #94a3b8;
}

.section-word-config input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
}

[data-theme="dark"] .section-word-config input {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

/* Compteur de mots dans l'éditeur */
.section-editor-word-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

[data-theme="dark"] .section-editor-word-count {
    background: #1e293b;
}

.section-editor-word-count .current-words {
    font-weight: 700;
    color: #0ea5e9;
    font-size: 1.1rem;
}

[data-theme="dark"] .section-editor-word-count .current-words {
    color: #38bdf8;
}

.section-editor-word-count .word-separator {
    color: #94a3b8;
}

.section-editor-word-count .max-words {
    font-weight: 600;
    color: #64748b;
}

[data-theme="dark"] .section-editor-word-count .max-words {
    color: #94a3b8;
}

/* Barre de progression dans l'éditeur */
.word-progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-left: 12px;
}

[data-theme="dark"] .word-progress-bar {
    background: #334155;
}

.word-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
}

.word-progress-fill.ok {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.word-progress-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.word-progress-fill.over {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Section editor header ajustement */
.section-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* ============================================
   ONGLET REVISION
   ============================================ */

.revision-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 8px;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.revision-round-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.revision-round-selector label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary, #475569);
    white-space: nowrap;
}

.revision-round-selector select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-primary, #fff);
    font-size: 0.85rem;
    min-width: 180px;
}

.revision-actions-header {
    display: flex;
    gap: 8px;
}

.revision-section {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.revision-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.revision-section-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary, #1e293b);
}

.revision-reviewer-info {
    display: flex;
    gap: 8px;
}

.revision-input-sm {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.85rem;
    min-width: 200px;
}

.revision-textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    font-family: 'Source Code Pro', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1e293b);
}

.revision-comments-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.revision-upload-btn {
    cursor: pointer;
}

/* Questions parsees */
.revision-questions-count {
    background: var(--accent-primary, #6366f1);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.revision-questions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.revision-question-card {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.revision-question-card:hover {
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.revision-question-card.revision-answered {
    border-left: 3px solid #22c55e;
}

.revision-question-card.revision-generating {
    opacity: 0.7;
    pointer-events: none;
}

.revision-question-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.revision-category-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.revision-badge-major {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.revision-badge-minor {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.revision-badge-editorial {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.revision-badge-question {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.revision-badge-computation {
    background: #faf5ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.revision-question-num {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 600;
}

.revision-related-section {
    font-size: 0.7rem;
    background: var(--bg-tertiary, #e2e8f0);
    color: var(--text-secondary, #475569);
    padding: 2px 6px;
    border-radius: 4px;
}

.revision-question-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
}

.revision-original-text {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    padding: 8px;
    background: var(--bg-tertiary, #f1f5f9);
    border-radius: 4px;
    margin-bottom: 8px;
    max-height: 80px;
    overflow-y: auto;
}

.revision-question-response {
    margin: 8px 0;
}

.revision-response-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary, #1e293b);
    padding: 10px;
    background: #f0fdf4;
    border-radius: 6px;
    border-left: 3px solid #22c55e;
}

.revision-no-response {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
}

.revision-error {
    color: #dc2626;
    font-size: 0.85rem;
}

.revision-question-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Loading spinner */
.revision-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: var(--text-secondary, #475569);
    font-size: 0.85rem;
}

.revision-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-top-color: var(--accent-primary, #6366f1);
    border-radius: 50%;
    animation: revision-spin 0.8s linear infinite;
}

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

/* Preview document */
.revision-preview-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.revision-preview-actions {
    display: flex;
    gap: 6px;
}

.revision-document {
    font-size: 0.9rem;
    line-height: 1.6;
}

.revision-doc-section {
    margin-bottom: 20px;
}

.revision-doc-section h3 {
    font-size: 1.05rem;
    color: var(--accent-primary, #6366f1);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent-primary, #6366f1);
}

.revision-doc-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

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

.revision-doc-comment {
    background: #fff7ed;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.revision-doc-response {
    background: #f0fdf4;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #22c55e;
    font-size: 0.85rem;
}

.revision-doc-pending {
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    padding: 8px;
}

/* Espace de calcul */
.revision-computation-toggle {
    cursor: pointer;
    user-select: none;
}

.revision-computation-toggle:hover {
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 6px;
    padding: 4px 8px;
    margin: -4px -8px;
}

.revision-chevron {
    transition: transform 0.2s;
    margin-left: auto;
}

.revision-computation-body {
    padding-top: 12px;
}

.revision-computation-description {
    font-size: 0.85rem;
    color: var(--text-secondary, #475569);
    margin-bottom: 12px;
}

.revision-code-description {
    margin-top: 6px;
    color: var(--text-secondary, #475569);
}

.revision-code-libs {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

.revision-code-editor {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.revision-code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Source Code Pro', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 0;
    white-space: pre;
}

.revision-code-actions {
    display: flex;
    gap: 8px;
}

/* Badge revision dans l'onglet */
.revision-badge {
    background: #6366f1;
}

/* ============================================
   MODAL IMPORT
   ============================================ */

#modal-import-pub .modal-content {
    max-width: 700px;
}

.import-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--border-color, #cbd5e1);
    border-radius: 12px;
    background: var(--bg-secondary, #f8fafc);
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    gap: 10px;
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--accent-primary, #6366f1);
    background: #eef2ff;
}

.import-dropzone svg {
    color: var(--text-muted, #94a3b8);
}

.import-dropzone p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    margin: 0;
}

.import-dropzone small {
    color: var(--text-muted, #94a3b8);
    font-size: 0.8rem;
}

.import-browse-btn {
    cursor: pointer;
    margin-top: 8px;
}

.import-files-list {
    margin-top: 16px;
}

.import-files-list h4 {
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.import-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 6px;
    margin-bottom: 4px;
}

.import-file-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
}

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

.btn-icon-sm {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-icon-sm:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Progress bar */
.import-progress {
    margin-top: 16px;
}

.import-progress-bar {
    height: 6px;
    background: var(--bg-tertiary, #e2e8f0);
    border-radius: 3px;
    overflow: hidden;
}

.import-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0;
}

.import-progress p {
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
    margin: 6px 0 0;
}

/* Preview des champs importes */
.import-preview {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.import-preview h4 {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary, #6366f1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-preview h4::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--accent-primary, #6366f1);
    border-radius: 2px;
}

.import-field {
    margin-bottom: 14px;
}

.import-field label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.import-field input.form-control,
.import-field textarea.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color, #e2e8f0);
    font-size: 0.88rem;
    font-family: inherit;
    background: #fff;
    color: var(--text-primary, #1e293b);
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

.import-field input.form-control:focus,
.import-field textarea.form-control:focus {
    outline: none;
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.import-field textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

.import-sections-preview {
    max-height: 150px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border-radius: 8px;
    border: 1.5px solid var(--border-color, #e2e8f0);
}

.import-section-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.import-section-item:hover {
    background: var(--bg-secondary, #f8fafc);
}

.import-section-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.import-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: var(--accent-primary, #6366f1);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.import-section-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
}

.import-section-len {
    font-size: 0.75rem;
    color: var(--text-tertiary, #94a3b8);
    flex-shrink: 0;
}

.import-quill-container {
    background: #fff;
    border-radius: 8px;
    min-height: 120px;
}
.import-quill-container .ql-toolbar {
    border-radius: 8px 8px 0 0;
    border-color: rgba(99, 102, 241, 0.15);
}
.import-quill-container .ql-container {
    border-radius: 0 0 8px 8px;
    border-color: rgba(99, 102, 241, 0.15);
    font-size: 0.92rem;
}
.import-quill-container .ql-editor {
    min-height: 100px;
}

.import-refs-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-primary, #6366f1);
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 20px;
}
