:root {
    /* Base Fond Blanc Pur & Nuances Porcelaine */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-elevated: #fcfaf5;
    --bg-input: #ffffff;

    /* Palette Institutionnelle : Bleu, Blanc, Rouge, Noir & Or */
    --black-primary: #0a0d14;
    --black-soft: #1e293b;
    --blue-primary: #0b3b8c;
    --blue-royal: #1d4ed8;
    --blue-soft-bg: #eff6ff;
    --blue-border: rgba(11, 59, 140, 0.28);

    --red-primary: #c8102e;
    --red-bright: #dc2626;
    --red-soft-bg: #fef2f2;
    --red-border: rgba(200, 16, 46, 0.30);

    --gold-primary: #b8860b;
    --gold-metallic: #c59b27;
    --gold-light: #9a6f0b;
    --gold-bright: #d4af37;
    --gold-soft-bg: #fdfaf2;
    --border-subtle: rgba(184, 134, 11, 0.28);
    --border-strong: rgba(184, 134, 11, 0.65);

    /* Typographie Haute Lisibilité sur Fond Blanc */
    --text-primary: #0a0d14;
    --text-secondary: #1e293b;
    --text-muted: #475569;

    /* Arguments Contradictoires : Bleu (Mes Arguments / Défense) vs Rouge (Contre-Argument) */
    --defense-bg: #eff6ff;
    --defense-border: rgba(11, 59, 140, 0.35);
    --defense-text: #0b3b8c;

    --counter-bg: #fef2f2;
    --counter-border: rgba(200, 16, 46, 0.35);
    --counter-text: #b91c1c;

    /* Articles de Lois : Or & Noir sur Fond Ivoire/Blanc */
    --law-bg: #fdfaf2;
    --law-border: rgba(184, 134, 11, 0.45);

    /* Ombres & Rayons */
    --shadow-lg: 0 12px 32px rgba(10, 13, 20, 0.07), 0 2px 8px rgba(10, 13, 20, 0.04);
    --shadow-gold: 0 8px 24px rgba(184, 134, 11, 0.14);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition-soft: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(11, 59, 140, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 100% 0%, rgba(200, 16, 46, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(197, 155, 39, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Liseré supérieur Tricolore Bleu - Blanc - Rouge + Filet Or */
body::before {
    content: "";
    display: block;
    height: 5px;
    width: 100%;
    background: linear-gradient(
        90deg,
        #0b3b8c 0%,
        #0b3b8c 33%,
        #ffffff 33%,
        #ffffff 66%,
        #c8102e 66%,
        #c8102e 100%
    );
    border-bottom: 2px solid var(--gold-metallic);
}

/* ============================================================================
   ANIMATIONS DOUCES & ÉLÉGANTES
   ============================================================================ */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ============================================================================
   BANNIÈRE D'AVERTISSEMENT LÉGAL & CONFIDENTIALITÉ (NOIR, ROUGE, OR & BLANC)
   ============================================================================ */
.confidential-top-banner {
    background: linear-gradient(90deg, #0a0d14 0%, #111827 50%, #0a0d14 100%);
    border-bottom: 2px solid var(--gold-metallic);
    color: #f8fafc;
    padding: 10px 20px;
    font-size: 0.84rem;
    text-align: center;
    letter-spacing: 0.02em;
}

.confidential-top-banner strong {
    color: #ef4444;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    text-transform: uppercase;
}

.confidential-top-banner code {
    color: #facc15;
    font-weight: 700;
}

.legal-disclaimer-box {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-top: 3px solid var(--blue-primary);
    border-left: 5px solid var(--red-primary);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.legal-disclaimer-owner {
    color: var(--red-primary);
    font-weight: 800;
    font-size: 0.96rem;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(200, 16, 46, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-soft);
}

.legal-disclaimer-owner:hover {
    color: var(--blue-primary);
}

.legal-disclaimer-box:has(.legal-disclaimer-pre.is-collapsed) .legal-disclaimer-owner {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.legal-disclaimer-pre {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--black-primary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.5;
    margin: 0;
    background: #f8fafc;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    border-left: 3px solid var(--gold-primary);
    text-align: justify;
}

.legal-disclaimer-pre.is-collapsed {
    display: none;
}

/* ============================================================================
   ÉCRAN DE CONNEXION & PORTAIL VISITEUR (FOND BLANC, BORDURES OR & NOIR)
   ============================================================================ */
.auth-screen-wrapper {
    min-height: calc(100vh - 50px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 18px;
    background: #ffffff;
}

.auth-card {
    width: 100%;
    max-width: 580px;
    background: #ffffff;
    border: 2px solid var(--gold-metallic);
    border-top: 5px solid var(--blue-primary);
    border-radius: var(--radius-lg);
    padding: 36px 34px;
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    animation: fadeSlideUp 0.45s ease-out;
}

.auth-logo-wrap {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo-wrap img {
    max-width: 290px;
    width: 100%;
    height: auto;
}

.auth-subtitle {
    text-align: center;
    color: var(--blue-primary);
    font-size: 0.84rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    margin-top: -2px;
    margin-bottom: 22px;
    font-weight: 800;
}

.member-pills {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.member-pill {
    background: var(--gold-soft-bg);
    border: 1px solid var(--gold-metallic);
    color: var(--black-primary);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-soft);
}

.member-pill:hover {
    background: var(--blue-primary);
    border-color: var(--blue-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ============================================================================
   HEADER PRINCIPAL (BLANC PUR, FILET OR & BLEU/ROUGE/NOIR)
   ============================================================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--gold-metallic);
    box-shadow: 0 4px 18px rgba(10, 13, 20, 0.06);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-brand img {
    height: 56px;
    width: auto;
}

.header-meta {
    display: flex;
    flex-direction: column;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--blue-primary);
    background: var(--blue-soft-bg);
    border: 1px solid var(--blue-border);
    padding: 4px 11px;
    border-radius: 999px;
    width: fit-content;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

/* ============================================================================
   BOUTONS & CONTRÔLES DE FORMULAIRE (OR, BLEU, ROUGE, NOIR & BLANC)
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-soft);
    text-decoration: none;
    white-space: nowrap;
}

.btn-gold {
    background: linear-gradient(135deg, #0a0d14 0%, #1e293b 100%);
    color: #f5d061;
    border: 1px solid var(--gold-metallic);
    box-shadow: 0 4px 12px rgba(10, 13, 20, 0.16);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #c59b27 0%, #9a6f0b 100%);
    color: #ffffff;
    border-color: #9a6f0b;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(184, 134, 11, 0.32);
}

.btn-outline {
    background: #ffffff;
    color: var(--black-primary);
    border: 1px solid #cbd5e1;
    border-bottom: 2px solid var(--gold-metallic);
}

.btn-outline:hover {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
    background: var(--blue-soft-bg);
}

.btn-danger {
    background: var(--red-soft-bg);
    color: var(--red-primary);
    border: 1px solid var(--red-border);
}

.btn-danger:hover {
    background: var(--red-primary);
    color: #ffffff;
    border-color: var(--red-primary);
}

.btn-emerald {
    background: var(--blue-soft-bg);
    color: var(--blue-primary);
    border: 1px solid var(--blue-border);
}

.btn-emerald:hover {
    background: var(--blue-primary);
    color: #ffffff;
    border-color: var(--blue-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.79rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--blue-primary);
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.form-control,
.form-select {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--black-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    transition: var(--transition-soft);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(11, 59, 140, 0.14);
}

/* ============================================================================
   LAYOUT PRINCIPAL DU DOSSIER & CARTES STATISTIQUES
   ============================================================================ */
.app-container {
    max-width: 1420px;
    margin: 0 auto;
    padding: 28px 24px 80px;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-top: 3px solid var(--gold-metallic);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 14px rgba(10, 13, 20, 0.04);
    transition: var(--transition-soft);
}

.stat-card:nth-child(1) { border-top-color: var(--blue-primary); }
.stat-card:nth-child(2) { border-top-color: var(--gold-metallic); }
.stat-card:nth-child(3) { border-top-color: var(--blue-royal); }
.stat-card:nth-child(4) { border-top-color: var(--red-primary); }
.stat-card:nth-child(5) { border-top-color: var(--black-primary); }

.stat-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 900;
    color: var(--black-primary);
}

.stat-card .stat-label {
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* ============================================================================
   CARTE TITRE & SYNOPSIS DU DOSSIER (FOND BLANC, CADRE OR & BLEU/ROUGE/NOIR)
   ============================================================================ */
.dossier-hero-card {
    background: #ffffff;
    border: 2px solid var(--gold-metallic);
    border-top: 5px solid var(--black-primary);
    border-radius: var(--radius-lg);
    padding: 28px 30px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.dossier-ref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.dossier-ref-tag {
    background: var(--black-primary);
    border: 1px solid var(--gold-metallic);
    color: #f5d061;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.dossier-main-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--black-primary);
    margin: 0 0 10px 0;
    line-height: 1.3;
    text-align: center;
}

.dossier-jurisdiction {
    color: var(--blue-primary);
    font-size: 0.94rem;
    margin-bottom: 18px;
    font-weight: 700;
    text-align: center;
}

.dossier-synopsis-content {
    background: var(--gold-soft-bg);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-left: 4px solid var(--blue-primary);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    color: var(--black-soft);
    font-size: 0.96rem;
}

.dossier-synopsis-content p:first-child {
    margin-top: 0;
}
.dossier-synopsis-content p:last-child {
    margin-bottom: 0;
}

/* ============================================================================
   BARRE DE FILTRES, CATÉGORIES & AJOUT DE COLONNE
   ============================================================================ */
.controls-bar {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--gold-metallic);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(10, 13, 20, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.controls-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.category-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cat-pill {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: var(--black-soft);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-soft);
}

.cat-pill.active,
.cat-pill:hover {
    background: var(--blue-primary);
    border-color: var(--blue-primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(11, 59, 140, 0.22);
}

/* ============================================================================
   TABLEAU SYNTHÉTIQUE DYNAMIQUE (AVEC AJOUT DE COLONNE)
   ============================================================================ */
.matrix-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-top: 3px solid var(--blue-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
    overflow-x: auto;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.matrix-table th,
.matrix-table td {
    padding: 11px 13px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    color: var(--black-primary);
}

.matrix-table th {
    background: var(--black-primary);
    color: #f5d061;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border-bottom: 2px solid var(--gold-metallic);
}

.matrix-table tr:nth-child(even) td {
    background: #f8fafc;
}

.matrix-table tr:hover td {
    background: var(--gold-soft-bg);
}

.matrix-link {
    color: var(--blue-primary);
    font-weight: 700;
    text-decoration: none;
}

.matrix-link:hover {
    color: var(--red-primary);
    text-decoration: underline;
}

/* ============================================================================
   TIMELINE & BLOCS CHRONOLOGIQUES (GLISSER-DÉPOSER SUR FOND BLANC)
   ============================================================================ */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.block-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 5px solid var(--blue-primary);
    border-top: 2px solid var(--gold-metallic);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-soft);
    position: relative;
}

.block-card:hover {
    border-color: var(--gold-primary);
    border-left-color: var(--red-primary);
    box-shadow: 0 16px 36px rgba(10, 13, 20, 0.09);
}

.block-card.dragging {
    opacity: 0.65;
    border: 2px dashed var(--gold-primary);
    transform: scale(0.99);
}

.block-card.drag-over {
    border-top: 4px solid var(--red-primary);
    box-shadow: 0 0 28px rgba(184, 134, 11, 0.28);
}

.block-header-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.block-badges-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.drag-handle {
    cursor: grab;
    background: var(--black-primary);
    border: 1px solid var(--gold-metallic);
    color: #f5d061;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.drag-handle:active {
    cursor: grabbing;
}

.badge-date {
    background: var(--blue-primary);
    border: 1px solid var(--blue-primary);
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.84rem;
}

.badge-category {
    background: var(--blue-soft-bg);
    border: 1px solid var(--blue-border);
    color: var(--blue-primary);
    padding: 4px 11px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-type {
    background: var(--gold-soft-bg);
    border: 1px solid var(--gold-metallic);
    color: var(--black-primary);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.block-title {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--black-primary);
    margin: 0 0 12px 0;
}

.block-custom-cols-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.custom-col-chip {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 3px solid var(--gold-metallic);
    color: var(--black-primary);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.81rem;
}

.custom-col-chip span {
    color: var(--blue-primary);
    font-weight: 800;
}

.block-description {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--gold-metallic);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    color: var(--black-primary);
    margin-bottom: 18px;
}

/* ============================================================================
   CONVERSATION CONTRADICTOIRE : MES ARGUMENTS (BLEU) vs CONTRE ARGUMENT (ROUGE)
   ============================================================================ */
.conversation-section {
    margin-top: 18px;
    margin-bottom: 18px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-top: 3px solid var(--black-primary);
    border-radius: var(--radius-md);
    padding: 18px;
}

.section-subtitle {
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--black-primary);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.arguments-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.arg-bubble {
    border-radius: var(--radius-md);
    padding: 14px 18px;
    position: relative;
    max-width: 92%;
}

.arg-bubble.side-defense {
    background: var(--defense-bg);
    border: 1px solid var(--defense-border);
    border-left: 5px solid var(--blue-primary);
    align-self: flex-start;
}

.arg-bubble.side-counter {
    background: var(--counter-bg);
    border: 1px solid var(--counter-border);
    border-right: 5px solid var(--red-primary);
    align-self: flex-end;
}

.arg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.79rem;
    margin-bottom: 6px;
}

.arg-side-tag {
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.side-defense .arg-side-tag {
    background: var(--blue-primary);
    color: #ffffff;
}

.side-counter .arg-side-tag {
    background: var(--red-primary);
    color: #ffffff;
}

.arg-speaker-badge {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 2px 9px;
    border-radius: 4px;
    color: var(--black-primary);
    font-weight: 700;
}

.arg-title {
    font-weight: 800;
    color: var(--black-primary);
    font-size: 0.96rem;
    margin-bottom: 4px;
}

.arg-desc {
    color: var(--black-soft);
    font-size: 0.91rem;
    white-space: pre-wrap;
}

/* ============================================================================
   ARTICLES DE LOIS & FONDEMENTS JURIDIQUES DU BLOC (OR, NOIR & BLEU)
   ============================================================================ */
.laws-section {
    margin-top: 16px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 12px;
}

.law-card {
    background: var(--law-bg);
    border: 1px solid var(--law-border);
    border-left: 4px solid var(--gold-primary);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.law-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.law-qual-tag {
    background: var(--black-primary);
    color: #f5d061;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.law-art-num {
    font-weight: 800;
    color: var(--blue-primary);
    font-size: 0.85rem;
}

.law-title {
    font-weight: 800;
    color: var(--black-primary);
    font-size: 0.91rem;
    margin-bottom: 6px;
}

.law-text {
    font-size: 0.86rem;
    color: var(--black-soft);
    font-style: italic;
}

/* ============================================================================
   PIÈCES JOINTES MULTI-FORMATS & LECTEUR MULTIMÉDIA
   ============================================================================ */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 12px;
    margin-top: 14px;
}

.attachment-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-top: 3px solid var(--gold-metallic);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 3px 10px rgba(10, 13, 20, 0.04);
}

.attachment-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--black-primary);
    margin-bottom: 8px;
    word-break: break-word;
}

.attachment-preview img {
    width: 100%;
    max-height: 170px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.attachment-preview audio,
.attachment-preview video {
    width: 100%;
    border-radius: 6px;
}

.attachment-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    word-break: break-all;
}

/* ============================================================================
   ÉDITEUR RICHE & VÉRIFICATEUR ORTHOGRAPHE / GRAMMAIRE
   ============================================================================ */
.rich-editor-shell {
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #ffffff;
}

.rich-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #cbd5e1;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rich-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--black-primary);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-soft);
}

.rich-btn:hover {
    background: var(--blue-primary);
    border-color: var(--blue-primary);
    color: #ffffff;
}

.rich-editor-area {
    min-height: 160px;
    max-height: 380px;
    overflow-y: auto;
    padding: 14px 16px;
    color: var(--black-primary);
    background: #ffffff;
    font-size: 0.95rem;
    line-height: 1.65;
    outline: none;
}

.grammar-panel {
    background: var(--gold-soft-bg);
    border-top: 1px solid var(--border-subtle);
    padding: 12px 14px;
    font-size: 0.84rem;
    display: none;
}

.grammar-panel.active {
    display: block;
}

.grammar-issue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--red-primary);
    border-radius: 5px;
    margin-bottom: 6px;
}

/* ============================================================================
   MODALES (ÉDITION DE BLOC, BORDEREAU, LOGS IP, PARTAGE VISITEUR)
   ============================================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 13, 20, 0.65);
    backdrop-filter: blur(5px);
    z-index: 900;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 28px 16px;
    overflow-y: auto;
}

.modal-backdrop.open {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-width: 1020px;
    background: #ffffff;
    border: 2px solid var(--gold-metallic);
    border-top: 5px solid var(--blue-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(10, 13, 20, 0.25);
    overflow: hidden;
    animation: fadeSlideUp 0.3s ease-out;
    margin: auto 0;
}

.modal-header {
    padding: 18px 24px;
    background: var(--black-primary);
    border-bottom: 2px solid var(--gold-metallic);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.12rem;
    color: #f5d061;
}

.modal-body {
    padding: 24px;
    max-height: 78vh;
    overflow-y: auto;
    background: #ffffff;
}

.modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-section-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--blue-primary);
    border-radius: 10px;
    padding: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.inline-add-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-add-group .form-control {
    flex: 1 1 140px;
    min-width: 0;
}

.modal-body .matrix-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================================
   TOAST NOTIFICATION (NOIR, OR & BLANC)
   ============================================================================ */
.toast-container {
    position: fixed;
    bottom: 22px;
    right: 22px;
    left: 22px;
    pointer-events: none;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.toast-msg {
    pointer-events: auto;
    max-width: 100%;
    background: var(--black-primary);
    border: 1px solid var(--gold-metallic);
    border-left: 4px solid var(--gold-bright);
    color: #ffffff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 28px rgba(10, 13, 20, 0.25);
    font-size: 0.88rem;
    font-weight: 600;
    animation: fadeSlideUp 0.25s ease-out;
}

/* ============================================================================
   RESPONSIVE TABLETTE (<= 1024px), MOBILE (<= 768px) & SMARTPHONE (<= 480px)
   ============================================================================ */
@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 > * {
        grid-column: auto !important;
    }
    .app-container {
        padding: 22px 18px 64px;
    }
}

@media (max-width: 860px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .grid-2 > *,
    .grid-3 > * {
        grid-column: auto !important;
    }
    .app-header {
        position: relative;
        padding: 12px 14px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .header-brand {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    .header-meta {
        align-items: center;
    }
    .header-actions {
        justify-content: center;
        width: 100%;
    }
    .app-container {
        padding: 16px 12px 56px;
    }
    .auth-card {
        padding: 26px 18px;
    }
    .dossier-hero-card,
    .block-card {
        padding: 18px 14px;
    }
    .dossier-main-title {
        font-size: 1.32rem;
    }
    .block-title {
        font-size: 1.12rem;
    }
    .arg-bubble {
        max-width: 100%;
    }
    .modal-backdrop {
        padding: 12px 8px;
    }
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .confidential-top-banner {
        padding: 8px 12px;
        font-size: 0.76rem;
    }
    .stats-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-card {
        padding: 12px;
    }
    .stat-card .stat-value {
        font-size: 1.35rem;
    }
    .header-actions .btn,
    .header-actions .form-select {
        flex: 1 1 100%;
        max-width: 100% !important;
        justify-content: center;
    }
    .block-header-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .modal-footer .btn {
        width: 100%;
    }
}

@media print {
    body {
        background: #ffffff !important;
        color: #0a0d14 !important;
    }
    .app-header,
    .controls-bar,
    .editor-only-btn,
    .drag-handle {
        display: none !important;
    }
    .dossier-hero-card,
    .block-card,
    .legal-disclaimer-box {
        background: #ffffff !important;
        color: #0a0d14 !important;
        border: 1px solid #9ca3af !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    .dossier-main-title,
    .block-title,
    .arg-title {
        color: #000000 !important;
    }
}
