:root {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-gold: #fbbf24;
    /* Ressources & Valeur */
    --accent-bridge: #c0362c;
    /* Thématiques & Structure (Golden Gate) */
    --accent-purple: #8b5cf6;
    /* IA & Intelligence */
    --border-color: rgba(255, 255, 255, 0.1);
    --axe-color: #f97316;
    --mega-color: var(--accent-bridge);
    --ghost-slate: #64748b;
    /* Métadonnées & Orphelins */

    /* Premium Design Tokens - Concept Obsidienne & Métal */
    --premium-gradient-metal: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #f1f5f9 100%);
    --premium-surface-bg: rgba(15, 23, 42, 0.98);
    --premium-surface-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    --premium-card-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* --- ANIMATIONS & SPECIAL EFFECTS --- */
.view-fade-in {
    animation: viewFadeIn 0.3s ease-out forwards;
}

@keyframes viewFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-thinking-glow {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4) !important;
    border-color: var(--accent-purple) !important;
    transition: box-shadow 0.5s ease;
    animation: aiThinkingPulse 2s infinite ease-in-out;
}

@keyframes aiThinkingPulse {
    0% {
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    }

    50% {
        box-shadow: 0 0 35px rgba(139, 92, 246, 0.6);
    }

    100% {
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* --- BASE STYLES --- */


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Choices.js Dark Theme Overrides */
.choices__inner {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
}

.choices__input {
    background-color: transparent !important;
    color: var(--text-primary) !important;
}

.choices__list--dropdown {
    background-color: var(--sidebar-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    z-index: 9999 !important;
}

.choices__list--dropdown .choices__item--selectable {
    padding-right: 10px;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--accent-purple) !important;
    color: white !important;
}

.choices__list--multiple .choices__item {
    background-color: var(--accent-purple) !important;
    border: none !important;
    border-radius: 4px !important;
}

/* Structural Select Overrides (Themes/Megas) */
.choices-structural .choices__list--multiple .choices__item {
    background-color: var(--accent-bridge) !important;
}

.choices-structural .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--accent-bridge) !important;
}

.axe-context {
    display: none;
}

/* Sidebar */
aside {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3.5rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    width: 100%;
}

.logo img {
    width: auto;
    height: 130px;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.2));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover img {
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.5));
    transform: scale(1.05);
}


.nav-separator {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 1rem 1rem;
    /* Espace net autour de la barre */
}

nav h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 1.8rem 0 0.8rem 1rem;
    /* Marge par défaut pour le premier titre */
    letter-spacing: 1px;
    font-weight: 800;
    opacity: 0.5;
}

/* Équilibrage contextuel : augmenté pour décoller visuellement le titre de la barre */
.nav-separator+h3 {
    margin-top: 1.8rem;
}

nav ul {
    list-style: none;
}

nav li {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

nav li:hover,
nav li.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

nav li.active {
    border-left: 3px solid var(--accent-bridge);
}


/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow-y: auto;
}

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

#view-title {
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.actions {
    display: flex;
    gap: 1rem;
}

button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--accent-gold);
    color: #000;
}

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

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-iconic {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    min-width: 50px;
    height: 50px;
    border-radius: 25px;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.btn-iconic .btn-text {
    max-width: 0;
    opacity: 0;
    display: inline-block;
    transition: all 0.4s ease;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-iconic:hover {
    padding: 0.75rem 1.5rem;
}

.btn-iconic:hover .btn-text {
    max-width: 150px;
    opacity: 1;
    margin-left: 10px;
}

.btn-iconic i {
    font-size: 1.1rem;
}

.btn-iconic.btn-add-theme {
    background: rgba(192, 54, 44, 0.1);
    color: var(--accent-bridge) !important;
    border-color: rgba(192, 54, 44, 0.3);
}

.btn-iconic.btn-add-theme:hover {
    background: var(--accent-bridge);
    color: white !important;
}

.btn-iconic.btn-primary {
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-gold);
    border-color: rgba(251, 191, 36, 0.3);
}

.btn-iconic.btn-primary:hover {
    background: var(--accent-gold);
    color: #000;
}

/* --- PREMIUM BUTTONS DNA --- */
.btn-premium,
.btn-ai,
.btn-ai-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 8px;
    padding: 0.65rem 1.4rem;
    height: 40px;
    /* Force harmonized height */
}

.btn-premium:hover,
.btn-ai:hover,
.btn-ai-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Modifier: Compact size for inline suggestions */
.btn-sm {
    height: 30px !important;
    padding: 0 0.8rem !important;
    font-size: 0.65rem !important;
    border-radius: 6px !important;
}

/* --- AI VARIANTS --- */
.btn-ai {
    background-color: var(--accent-purple);
    color: white;
    border: none;
}

.btn-ai:hover {
    background-color: #7c3aed;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.btn-ai-outline {
    background-color: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
}

.btn-ai-outline:hover {
    background-color: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.btn-bridge {
    background-color: var(--accent-bridge);
    color: white;
}

.btn-bridge:hover {
    background-color: #a02d25;
    color: white;
}

/* Mini Action Buttons (Order, Edit, Delete) */
.btn-action-mini {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.btn-action-mini:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: scale(1.05);
}

.btn-action-mini.edit {
    color: #3b82f6;
}

.btn-action-mini.delete {
    color: #ef4444;
}

.btn-action-mini.move {
    color: var(--ghost-slate);
}

.badge-id-mini {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--ghost-slate);
    background: rgba(100, 116, 139, 0.05);
    padding: 1px 4px;
    border-radius: 4px;
    opacity: 0.7;
    letter-spacing: 0.02em;
}

.action-buttons-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: var(--premium-surface-bg);
    width: 90%;
    max-width: 800px;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--premium-surface-shadow);
    border: 1px solid var(--border-color);
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 900px;
}

.modal-xl {
    max-width: 1100px;
}

.modal-centered {
    text-align: center;
}

.rating {
    direction: rtl;
    display: inline-flex;
    gap: 0.5rem;
}

.rating input {
    display: none;
}

.rating label {
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.2s;
}

.rating input:checked~label {
    color: var(--accent-gold);
}

.rating label:hover,
.rating label:hover~label {
    color: var(--accent-gold);
}


/* Transcription Icon & Editor */
.transcription-icon {
    color: var(--accent-purple);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.transcription-icon:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.editor-textarea {
    width: 100%;
    height: 400px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 1.5rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.editor-textarea:focus {
    border-color: var(--accent-purple);
}

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

.badge-retranscription {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.4);
    font-size: 0.75rem;
    transition: all 0.2s;
    margin: 4px;
}

.attachment-badge a {
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.attachment-badge button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.5;
    padding: 0;
    display: flex;
}

.attachment-badge button:hover {
    opacity: 1;
    color: #ef4444;
}

.attachment-gold {
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.attachment-gold a {
    color: var(--accent-gold);
}

.attachment-purple {
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.05);
}

.attachment-purple a {
    color: var(--accent-purple);
}

.attachment-actions {
    display: flex;
    gap: 8px;
    margin-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 8px;
}

.btn-action-mini-alt {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.btn-action-mini-alt:hover {
    transform: scale(1.05);
}

.btn-action-mini-alt.edit-trans {
    color: var(--accent-purple);
}

.btn-action-mini-alt.delete-source {
    color: #ef4444;
    opacity: 0.6;
}

.btn-action-mini-alt.delete-source:hover {
    opacity: 1;
}

/* Z-index safety for sub-modals */
#modal-transcription {
    z-index: 2100;
}

#modal-confirm-delete {
    z-index: 2200;
}

.badge-orphan {
    background: rgba(100, 116, 139, 0.1);
    color: var(--ghost-slate);
    border: 1px solid rgba(100, 116, 139, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Chatbot UI */
.chatbot-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    max-width: 900px;
    margin: 0 auto;
    background: var(--premium-surface-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--premium-surface-shadow);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.ai {
    align-self: flex-start;
}

.message-bubble {
    padding: 1rem 1.5rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.user .message-bubble {
    background: var(--accent-purple);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai .message-bubble {
    background: var(--sidebar-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    border-left: 3px solid var(--accent-purple);
}

.loading-notice {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.8;
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 6px;
}


.chat-input-area {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    max-height: 200px;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--accent-purple);
}


#chat-send-btn {
    width: 45px;
    height: 45px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Presentation Page */
.presentation-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.presentation-hero {
    padding: 1rem 0 1rem 0;
    text-align: center;
}

.presentation-hero .premium-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    background: var(--premium-gradient-metal);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.presentation-intro-box {
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 3rem;
    border-radius: 20px;
    /* Aligné sur le rayon des cartes */
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%),
        var(--premium-surface-bg);
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--premium-surface-shadow);
    width: 100%;
    /* Prend toute la largeur du conteneur parent */
}

.presentation-intro-box p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.presentation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 4rem;
}

.presentation-card {
    background: var(--premium-surface-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--premium-card-transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--premium-surface-shadow);
}


.card-icon-header {
    padding: 2rem;
    text-align: center;
    font-size: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-structure .card-icon-header {
    background: rgba(192, 54, 44, 0.1);
    color: var(--accent-bridge);
}

.card-ia .card-icon-header {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}

.card-content {
    padding: 2rem;
    flex: 1;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    font-weight: 800;
}

.card-pillar-bridge h3 {
    color: var(--accent-bridge);
}

.card-pillar-purple h3 {
    color: var(--accent-purple);
}



.card-content p {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.card-content ul {
    list-style: none;
    padding: 0;
}

.card-content li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-content li::before {
    content: "→";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.card-structure li::before {
    color: var(--accent-bridge);
}

.card-ia li::before {
    color: var(--accent-purple);
}

.presentation-footer {
    text-align: center;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-top: 4rem;
    opacity: 0.9;
    width: 100%;
    box-shadow: var(--premium-surface-shadow);
}

.presentation-footer p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.btn-icon-only {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.archive-item {
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    position: relative;
    padding-right: 2rem;
}

.archive-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-purple);
}

.archive-item .archive-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
}

.archive-item .btn-delete-archive {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ghost-slate);
    opacity: 0.5;
    transition: all 0.2s;
    background: none;
    border: none;
    padding: 5px;
}

.archive-item:hover .btn-delete-archive {
    opacity: 1;
}

.archive-item.is-archived {
    border-left: 3px solid var(--accent-gold);
}

.health-card {
    background: var(--premium-surface-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--premium-surface-shadow);
}


.health-card .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.health-card .score {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.health-card .sub-label {
    font-size: 0.75rem;
    color: var(--ghost-slate);
}

/* --- SOUVERAINETÉ & ARCHIVES --- */
.export-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 1200px) {
    .export-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .export-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.export-card {
    background: var(--premium-surface-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--premium-card-transition);
    cursor: pointer;
    box-shadow: var(--premium-surface-shadow);
}

/* --- PILLARS & CARD THEMES (Clean Code Architecture) --- */
/* Base for any card using pillars */
.presentation-card,
.export-card {
    border: 1px solid var(--border-color);
    /* Fallback neutre */
}

/* Pillar: Structure (Bridge Red) */
.card-pillar-bridge {
    border: 1px solid rgba(192, 54, 44, 0.3);
}

.card-pillar-bridge:hover {
    border-color: var(--accent-bridge);
    background: rgba(192, 54, 44, 0.05);
}

.card-pillar-bridge i,
.card-pillar-bridge h3 {
    color: var(--accent-bridge) !important;
}

/* Pillar: Intelligence (Cyber Purple) */
.card-pillar-purple {
    border-color: rgba(139, 92, 246, 0.3);
}

.card-pillar-purple:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.05);
}

.card-pillar-purple>i,
.card-pillar-purple h2 i,
.card-pillar-purple h3 i,
.card-pillar-purple h4 i,
.card-pillar-purple .card-icon-header i {
    color: var(--accent-purple) !important;
}

/* Pillar: Content (Liquid Gold) */
.card-pillar-gold {
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.card-pillar-gold:hover {
    border-color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.05);
}

.card-pillar-gold i,
.card-pillar-gold h4 {
    color: var(--accent-gold) !important;
}

/* Trash Pillar Specifics (Obsidian Density) */
.trash-pillar-card {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--premium-card-transition);
}

.trash-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--premium-card-transition);
}

.trash-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.trash-container-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.trash-pillar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trash-pillar-header i {
    font-size: 1.2rem;
}

.trash-pillar-header h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    font-weight: 800;
}

.trash-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trash-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.trash-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.4;
    font-size: 0.8rem;
    font-style: italic;
}

.badge-restore {
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.card-pillar-bridge .badge-restore {
    background: rgba(192, 54, 44, 0.1);
    color: var(--accent-bridge);
    border-color: rgba(192, 54, 44, 0.3);
}

.card-pillar-gold .badge-restore {
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-gold);
    border-color: rgba(251, 191, 36, 0.3);
}

.badge-restore:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Maintenance Specifics (Analysis Tab) */
.maintenance-pillar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2.5rem;
    background: rgba(30, 41, 59, 0.4);
    padding: 1.5rem;
    border-radius: 16px;
    transition: var(--premium-card-transition);
}

.maintenance-pillar-header h2 {
    margin: 0;
    color: var(--accent-purple);
    font-size: 1.5rem;
    font-weight: 800;
}

.maintenance-pillar-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
    line-height: 1.4;
}

/* Alert alignment and Success standardization */

.scan-warning-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-left: 4px solid var(--accent-purple);
    border-radius: 12px;
    color: var(--accent-purple);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.5;
    animation: fadeIn 0.4s ease;
}

.scan-warning-banner i {
    color: var(--accent-purple);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.maintenance-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Doublon supprimé pour consolidation */

.maintenance-list li {
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
}

.maintenance-list li i {
    margin-top: 3px;
    flex-shrink: 0;
}

.maintenance-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.theme-row {
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
    /* contain: content supprimé car il brise le layout table-row sur certains navigateurs */
}

.theme-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.audit-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.success-message {
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    padding: 3rem;
    font-style: italic;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

/* Pillar: Neutral (Ghost Slate) */
.card-pillar-neutral {
    border-color: var(--border-color);
}

.card-pillar-neutral:hover {
    border-color: var(--ghost-slate);
    background: rgba(255, 255, 255, 0.05);
}

.card-pillar-neutral i {
    color: var(--text-secondary);
}

.card-pillar-neutral h3 {
    color: var(--text-primary);
}

/* Common Hover Effects */
.presentation-card:hover,
.export-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--premium-surface-shadow), 0 20px 40px rgba(0, 0, 0, 0.4);
}

.export-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.export-card:hover i {
    transform: scale(1.05);
}

.export-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--text-primary);
}

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


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

.trash-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.trash-card:hover {
    background: rgba(255, 255, 255, 0.02);
}

.trash-info .name {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

.trash-info .meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
}



.badge-restore {
    background: transparent;
    border: 1px solid var(--ghost-slate);
    color: var(--ghost-slate);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.badge-restore:hover {
    background: var(--ghost-slate);
    color: var(--bg-color);
}

/* --- CLEAN CODE AUDIT: ANALYSIS MODULE SEMANTICS --- */
.analysis-title-bridge {
    color: var(--accent-bridge) !important;
}

.analysis-title-gold {
    color: var(--accent-gold) !important;
}

.analysis-title-purple {
    color: var(--accent-purple) !important;
}

.analysis-title-slate {
    color: var(--ghost-slate) !important;
}

.analysis-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.analysis-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.analysis-header-info {
    flex: 1;
}

.analysis-header-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
}

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


.analysis-card-master {
    background: var(--premium-surface-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--premium-surface-shadow);
    margin-bottom: 2.5rem;
}

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

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

.analysis-sub-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--premium-card-transition);
    overflow: hidden; /* Empêche le tableau de déborder de la carte */
    min-width: 0;    /* Autorise la compression dans une grille flex */
}

.analysis-sub-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.analysis-title-compact {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.theme-row,
.audit-row {
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.audit-row {
    cursor: pointer;
}

.audit-row td {
    vertical-align: middle;
    padding: 0.4rem 0.8rem;
    /* Plus compact */
}

.theme-row {
    cursor: default;
}

.theme-row:hover,
.audit-row:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
}

/* --- Notes Personnelles (System) --- */
.resource-notes {
    margin-top: 0;
    margin-bottom: 0;
}

.note-prefix {
    font-weight: 800;
    color: var(--ghost-slate);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    margin-right: 4px;
}

.notes-toggle {
    color: var(--ghost-slate);
    font-size: 0.7rem;
    cursor: pointer;
    font-weight: 800;
    opacity: 0.8;
    transition: all 0.2s;
    user-select: none;
    margin-left: 5px;
}

.notes-toggle:hover {
    opacity: 1;
    text-decoration: underline;
}

.notes-content,
.notes-preview,
.notes-full {
    display: block;
    font-size: 0.75rem;
    color: var(--ghost-slate);
    line-height: 1.5;
    overflow-wrap: anywhere;
    /* Sécurité ultime pour les URLs */
    word-break: break-word;
    text-align: justify;
    /* Pour une exploitation propre de la largeur */
}

.notes-full {
    padding-left: 0;
    /* Aligné sur l'aperçu maintenant que le liséré est supprimé */
}

/* Isolation de la couleur des IDs d'audit */
.audit-row .audit-id-cell {
    color: var(--ghost-slate);
    font-weight: 500;
    font-size: 0.7rem;
    opacity: 0.3;
    text-align: center;
    font-family: 'Inter', sans-serif;
    padding: 0.4rem 0;
    /* Aligné sur la compacité */
}


/* Gestion des largeurs des colonnes du tableau d'audit (Dashboard Santé) */
col.col-audit-id    { width: 2.5rem; }
col.col-audit-title { width: 1px; }
col.col-audit-body  { width: auto; }

/* Tableau du Dashboard Santé (fixed-layout pour garantir les largeurs) */
.audit-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 0.3rem;
}

/* Typographies spécifiques pour l'audit */
.audit-item-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.audit-item-meta {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.audit-theme-title {
    font-weight: 700;
}

.nebula-extract,
.nebula-description {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    /* Plus compact que le 0.85rem par défaut */
    line-height: 1.3;
    color: var(--text-primary);
}

.nebula-extract {
    font-style: italic;
    opacity: 0.9;
}

.nebula-description {
    font-weight: 700;
}

.audit-alerts-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    line-height: 1.3;
    vertical-align: middle;
}

/* Système d'alertes modulaire */
.audit-alert-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.audit-alert-text {
    flex: 1;
    font-size: 0.75rem;
}

.audit-alert-theme strong {
    color: var(--accent-bridge);
}

.audit-alert-theme .audit-bullet {
    background: var(--accent-bridge);
}

.audit-alert-resource strong {
    color: var(--accent-gold);
}

.audit-alert-resource .audit-bullet {
    background: var(--accent-gold);
}

.audit-alert-item .mute-icon {
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 0.2s;
}

.audit-alert-item:hover .mute-icon {
    opacity: 1;
}

/* Neutralisation des marges pour un centrage vertical pur dans les audits */
.audit-row .resource-extract,
.audit-row .nebula-extract,
.audit-row .nebula-description {
    margin-bottom: 0 !important;
}

.audit-actions-cell {
    text-align: right;
    white-space: nowrap;
    min-width: 45px;
    vertical-align: middle;
}

/* Removed obsolete AI mini override */

.placeholder-diagnostic {
    margin-top: 2rem;
    border: 2px dashed rgba(148, 163, 184, 0.15);
    padding: 5rem;
    border-radius: 20px;
    text-align: center;
    color: var(--text-secondary);
    background: rgba(30, 41, 59, 0.2);
    transition: all 0.3s ease;
}

.placeholder-diagnostic:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.05);
}

/* Analysis Success Messages */
.analysis-success-box {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    text-align: center;
    animation: fadeIn 0.4s ease;
    margin: 1rem 0;
}

.analysis-success-box i {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: block;
}

.analysis-success-box span {
    font-size: 0.8rem;
    opacity: 0.6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.analysis-success-box.border-bridge {
    border-color: rgba(192, 54, 44, 0.3);
}

.analysis-success-box.border-bridge i {
    color: var(--accent-bridge);
}

.analysis-success-box.border-gold {
    border-color: rgba(251, 191, 36, 0.3);
}

.analysis-success-box.border-gold i {
    color: var(--accent-gold);
}

/* --- UTILS --- */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.visible-flex {
    display: flex !important;
}

/* --- COMMON UTILITIES --- */
.flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.m-0 {
    margin: 0 !important;
}

.mb-1 {
    margin-bottom: 0.5rem !important;
}

.mb-2 {
    margin-bottom: 1rem !important;
}

.mt-1 {
    margin-top: 0.5rem !important;
}

.mt-2 {
    margin-top: 1rem !important;
}

.mt-3 {
    margin-top: 1.5rem !important;
}

.text-ai {
    color: var(--accent-purple) !important;
}

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

.text-small-secondary {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.text-red {
    color: #ef4444 !important;
}

.text-gold {
    color: var(--accent-gold) !important;
}

.flex-align-center {
    display: flex;
    align-items: center;
}

.flex-align-center.gap-1 {
    gap: 1rem;
}

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

.flex-center-all {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.gap-0-5 {
    gap: 0.5rem;
}

.gap-1 {
    gap: 1rem;
}

.font-heavy {
    font-weight: 800;
}

.font-italic {
    font-style: italic;
}

.line-height-1-6 {
    line-height: 1.6;
}

.btn-full {
    width: 100% !important;
}

.w-full {
    width: 100% !important;
}

.btn-gold {
    background: var(--accent-gold) !important;
    color: #000 !important;
    border: none !important;
}

.btn-gold:hover {
    background: #fcd34d !important;
}

.btn-danger {
    background: #ef4444 !important;
    color: #fff !important;
    border: none !important;
}

.btn-danger:hover {
    background: #dc2626 !important;
}

.loader-icon-ai {
    font-size: 2rem;
    color: var(--accent-purple);
    margin-bottom: 1rem;
}

.modal-alert-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.modal-alert-icon.red {
    color: #ef4444;
}

.modal-alert-icon.gold {
    color: var(--accent-gold);
}

.maintenance-intro-text {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-style: italic;
}

.maintenance-suggestions-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.analysis-results-scroll {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1.5rem;
    scrollbar-width: thin;
}

.chat-archives-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

#content-area {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.btn-close-modal,
.btn-close-editor {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-modal:hover,
.btn-close-editor:hover {
    color: var(--text-primary);
}

.btn-delete-alt {
    background: rgba(192, 54, 44, 0.1);
    color: var(--accent-bridge);
    border: 1px solid rgba(192, 54, 44, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-alt:hover {
    background: rgba(192, 54, 44, 0.2);
    border-color: var(--accent-bridge);
}

.audit-scroll-area {
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.analysis-header-highlight {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
}

/* --- TOAST SYSTEM --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
}

.toast-notification {
    background: var(--premium-surface-bg);
    border-left: 4px solid var(--accent-purple);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    min-width: 300px;
    animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    backdrop-filter: blur(10px);
}

.toast-notification.success {
    border-left-color: #10b981;
}

.toast-notification.error {
    border-left-color: #ef4444;
}

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

.toast-action-btn {
    margin-left: auto;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toast-action-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* --- MUTE ICON (ANALYSIS) --- */
.mute-icon {
    font-size: 0.6rem;
    color: var(--ghost-slate);
    opacity: 0.2;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
    align-self: center;
}

.audit-row:hover .mute-icon {
    opacity: 0.6;
}

.mute-icon:hover {
    color: var(--accent-purple) !important;
    opacity: 1 !important;
    transform: scale(1.05);
}

/* --- AI & ANALYSIS PREMIUM COMPONENTS (AUDIT 5.1) --- */

/* Chatbot Suggestion Area */
.ai-action-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.partner-name-highlight {
    color: var(--accent-purple);
    font-weight: 800;
}

/* Analysis Progress Bar */
.analysis-progress-wrapper {
    width: 100%;
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    margin: 1.5rem 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.analysis-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-purple);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-progress-label {
    font-size: 0.7rem;
    opacity: 0.7;
    color: var(--accent-gold);
}

/* Chatbot Archive Items */
.archive-item-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-status-icon {
    margin-right: 5px;
}

.archive-status-icon.archived {
    color: var(--accent-gold);
}

.archive-status-icon.recent {
    color: var(--text-secondary);
}

/* --- MODAL STRUCTURES (AUDIT 6.0) --- */
.modal-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-section {
    margin-top: 1rem;
}

.modal-field-full {
    width: 100%;
}

.modal-select-premium {
    width: 100%;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-primary);
}

.rating-stars-container {
    margin-top: 0.5rem;
}

.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* --- CHATBOT LAYOUT (AUDIT 6.0) --- */
.chatbot-main-area-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chat-archives-panel-layout {
    width: 250px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}


.chat-archives-list-layout {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-welcome-highlight {
    color: var(--accent-purple);
    font-weight: 800;
}

/* --- DATAVISUALISATION 3D --- */
.graph-controls {
    position: absolute;
    top: 100px;
    right: 20px;
    width: 280px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.graph-controls h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

.control-group label {
    font-size: 0.8rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: var(--accent-purple);
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.ai-suggestion-box {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-purple);
    font-style: italic;
    padding: 0.5rem;
    background: rgba(139, 92, 246, 0.05);
    border-left: 2px solid var(--accent-purple);
    border-radius: 4px;
}

.analysis-loader-container {
    text-align: center;
    padding: 2rem;
}

.discovery-card {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 450px;
    background: var(--premium-surface-bg);
    border: 1px solid var(--accent-purple);
    border-radius: 20px;
    padding: 1.5rem;
    z-index: 100;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.4s ease-out;
}

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

.discovery-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.discovery-reason {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--accent-purple);
    margin-bottom: 1rem;
    padding: 0.6rem;
    background: rgba(139, 92, 246, 0.05);
    border-left: 2px solid var(--accent-purple);
    border-radius: 4px;
}

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

.btn-exploration {
    padding: 8px 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
    border-radius: 10px;
}

/* --- ADDITIONAL PURIFICATION UTILITIES --- */
.cursor-pointer {
    cursor: pointer !important;
}

.display-none {
    display: none !important;
}

.display-block {
    display: block !important;
}

.display-flex {
    display: flex !important;
}

.flex-row {
    flex-direction: row !important;
}

.flex-col {
    flex-direction: column !important;
}

.justify-between {
    justify-content: space-between !important;
}

.justify-center {
    justify-content: center !important;
}

.justify-end {
    justify-content: flex-end !important;
}

.align-center {
    align-items: center !important;
}

.align-end {
    align-items: flex-end !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.5rem !important;
}

.mb-2 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 2rem !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 0.5rem !important;
}

.mt-1-5 {
    margin-top: 1.5rem !important;
}

.mt-2 {
    margin-top: 1rem !important;
}

.mt-3 {
    margin-top: 1.5rem !important;
}

.mt-4 {
    margin-top: 2rem !important;
}

.p-0-5 {
    padding: 0.5rem !important;
}

.p-1 {
    padding: 1rem !important;
}

.p-2 {
    padding: 2rem !important;
}

.p-5 {
    padding: 5rem !important;
}

.pt-1 {
    padding-top: 1rem !important;
}

.text-center {
    text-align: center !important;
}

.text-xs {
    font-size: 0.7rem !important;
}

.text-sm {
    font-size: 0.75rem !important;
}

.text-md {
    font-size: 0.8rem !important;
}

.text-lg {
    font-size: 0.9rem !important;
}

.text-xl {
    font-size: 1rem !important;
}

.text-3xl {
    font-size: 3rem !important;
}

.text-huge {
    font-size: 3rem !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.text-italic {
    font-style: italic !important;
}

.font-bold {
    font-weight: bold !important;
}

.font-extrabold {
    font-weight: 800 !important;
}

.opacity-3 {
    opacity: 0.3 !important;
}

.opacity-5 {
    opacity: 0.5 !important;
}

.opacity-6 {
    opacity: 0.6 !important;
}

.text-red {
    color: #c0362c !important;
}

.text-danger {
    color: #ef4444 !important;
}

.ls-02 {
    letter-spacing: 0.02em !important;
}

.border-top {
    border-top: 1px solid var(--border-color) !important;
}

.bg-red-alpha {
    background: rgba(239, 68, 68, 0.1) !important;
}

.bg-ai-alpha {
    background: rgba(139, 92, 246, 0.05) !important;
}

.border-left-ai {
    border-left: 2px solid var(--accent-purple) !important;
}

.border-left-red {
    border-left: 4px solid #ef4444 !important;
}

.ls-02 {
    letter-spacing: 0.02em !important;
}

.ls-05 {
    letter-spacing: 0.05em !important;
}

.archives-container {
    max-width: 1100px;
    margin: 0 auto;
}

.gap-0-8 {
    gap: 0.8rem !important;
}

/* Column Widths */
.col-id {
    width: 35px !important;
}

.col-auto {
    width: auto !important;
}

.col-action {
    width: 100px !important;
}

.col-40 {
    width: 40% !important;
}

.col-full {
    width: 100% !important;
}

/* Thematic Groups */
.theme-group-row {
    background: rgba(192, 54, 44, 0.1) !important;
    padding: 12px 20px !important;
    border-left: 4px solid #c0362c !important;
}

.badge-count {
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    font-size: 0.8rem !important;
}

.scroll-y-300 {
    max-height: 300px !important;
    overflow-y: auto !important;
}

.discovery-card-fixed-bottom {
    width: 300px !important;
    bottom: 20px !important;
    left: 20px !important;
    transform: none !important;
}

.toast-fade-out {
    animation: toastFadeOut 0.4s forwards !important;
}

/* --- QUICK EDIT HIERARCHY --- */
.clickable-cell {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.clickable-cell:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.clickable-cell.editing {
    background: var(--sidebar-bg);
    cursor: default;
    padding: 2px !important;
}

/* Choices.js override for inline table usage */
.quick-choices-container {
    margin-bottom: 0 !important;
    font-size: 0.85rem !important;
}

.quick-choices-container .choices__inner {
    min-height: 32px !important;
    padding: 2px 4px !important;
    background: rgba(0, 0, 0, 0.3) !important;
}

.quick-choices-container .choices__list--single {
    padding: 0 16px 0 4px !important;
}

.quick-choices-container .choices__list--dropdown {
    width: 250px !important;
    /* Fixed width to prevent table jumping */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

/* --- HIERARCHY BADGES (TABLE THEMATIQUES) --- */
.hierarchy-badge {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-bridge);
    /* Golden Gate Red - Unique pour la cohérence */
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 4px;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.hierarchy-badge i {
    margin-right: 6px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.hierarchy-badge:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.badge-label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-bottom: 2px;
}

/* --- ROBUSTESSE ÉDITION EN LIGNE (QUICK EDIT) --- */
.row-editing {
    z-index: 1000 !important;
    position: relative !important;
    overflow: visible !important;
}

.row-editing td {
    overflow: visible !important;
}

td.editing {
    overflow: visible !important;
    position: relative;
    z-index: 1001 !important;
    background: rgba(0, 0, 0, 0.2) !important;
}

.quick-edit-container {
    width: 100%;
    min-width: 150px;
}

.quick-edit-input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.quick-edit-input:focus {
    border-color: var(--accent-bridge);
    box-shadow: 0 0 8px rgba(192, 54, 44, 0.2);
}

/* On s'assure que Choices n'est pas bridé par le contenant */
/* Amélioration de la spécificité pour se passer de !important autant que possible */
.bdd-table td.editing .choices {
    min-width: 250px;
    z-index: 1002;
    margin-bottom: 0;
}

td.editing .choices__list--dropdown {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
    border: 1px solid var(--accent-bridge) !important;
    background-color: var(--sidebar-bg) !important;
    backdrop-filter: blur(10px);
}

td.editing .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--accent-bridge) !important;
    color: white !important;
}

td.editing .choices__inner {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    padding: 2px 4px !important;
    min-height: 32px !important;
}

/* Chat Hint (Info message) */
.chat-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
    opacity: 0.8;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Row Highlight Glow Animation for BDD Scroll */
.row-highlight-glow td {
    animation: rowGlow 2s ease-in-out;
}
@keyframes rowGlow {
    0% { background-color: rgba(139, 92, 246, 0.2); }
    100% { background-color: transparent; }
}

.mr-1 {
    margin-right: 0.25rem !important;
}
.flex-wrap {
    flex-wrap: wrap !important;
}

/* Cyber Bold styling for Chatbot bold text */
.cyber-bold {
    color: var(--accent-purple);
    font-weight: 700;
}

/* AI Cogitation & Thinking process styles (Audit 9.1) */
.ai-thinking-block {
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid var(--accent-purple);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease-out;
}

.ai-thinking-header {
    color: var(--accent-purple);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-thinking-header i {
    animation: pulse 2s infinite ease-in-out;
}

.ai-thinking-content {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.85;
    font-size: 0.72rem;
    line-height: 1.45;
    max-height: 80px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.2) transparent;
}

.ai-thinking-content.expanded {
    max-height: 400px;
    overflow-y: auto;
}

/* Bouton toggle Voir tout / Réduire */
.ai-thinking-toggle {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--accent-purple);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    height: auto;
}

.ai-thinking-toggle:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: none;
    box-shadow: none;
}

/* Placeholder animé pendant la phase de cogitation en direct (stream en cours) */
.ai-thinking-stream-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-purple);
    font-size: 0.78rem;
    font-style: italic;
    opacity: 0.85;
    animation: thinking-pulse 1.6s ease-in-out infinite;
}

.ai-thinking-stream-placeholder i {
    font-size: 0.9rem;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes thinking-pulse {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
}

/* --- COMPOSANT BACKUP STATUS --- */
.backup-status-container {
    width: 100%;
}

.backup-status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1.2rem 1.8rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.backup-status-card.success {
    border-color: rgba(251, 191, 36, 0.25);
    background: radial-gradient(circle at left, rgba(251, 191, 36, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.backup-status-card.failed {
    border-color: rgba(239, 68, 68, 0.25);
    background: radial-gradient(circle at left, rgba(239, 68, 68, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.backup-status-card.neutral {
    border-color: var(--border-color);
}

.status-indicator {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-indicator.success-gold {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
    animation: gold-pulse 2s infinite ease-in-out;
}

@keyframes gold-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 6px var(--accent-gold);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 14px var(--accent-gold);
    }
}

.status-text {
    color: var(--text-primary);
}

.status-text strong.text-gold {
    color: var(--accent-gold);
    font-weight: 700;
}