/* ============================================================================
   DireFlow — Prestige Legal Authority Design System (5.40 sub-livraison 2.1)
   ----------------------------------------------------------------------------
   Editorial-juridical aesthetic: charcoal ink + warm cream + champagne gold.
   Newsreader (display) + Inter (UI). Sharp corners. Editorial 1px borders.

   Source de vérité système : wireframes/DESIGN.md + wireframes/shared-styles.css.
   Cette feuille en est l'implémentation Blazor.

   Migration note (5.40 sub-livraison 2.1, 7 mai 2026) :
   - Tokens Prestige natifs en haut.
   - Palettes secondaires (doc-types, annotations, categories, events, urgency,
     deadlines, exports, toasts) re-mappées sur le registre Prestige
     (la STRUCTURE sémantique de 5.13 est conservée, seules les VALEURS changent).
   - Aliases legacy (--primary, --gray-*, --accent, etc.) conservés
     transitoirement pour ne pas casser les ~7 600 lignes de CSS suivantes.
     À retirer en sub-livraison 2.3 (fin de 5.40) une fois que tous les
     composants Razor + pages utilisent les tokens Prestige nativement.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:opsz,ital,wght@6..72,0,400;6..72,0,500;6..72,0,600;6..72,1,400;6..72,1,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* ---- Ink scale (charcoal) -------------------------------------------- */
    --ink-900: #1f2937;  /* primary text, headings, dark accents */
    --ink-700: #374151;  /* body text */
    --ink-500: #6b7280;  /* secondary text */
    --ink-400: #9ca3af;  /* tertiary, placeholders */
    --ink-300: #d8d2c4;  /* warm dividers (parchment-aware) */
    --ink-15:  rgba(31, 41, 55, 0.12);  /* 1px editorial borders */
    --ink-08:  rgba(31, 41, 55, 0.06);
    --ink-04:  rgba(31, 41, 55, 0.03);

    /* ---- Surfaces (warm cream + parchment) ------------------------------- */
    --cream:          #fdfbf7;  /* main workspace (Level 1) */
    --cream-dim:      #f6f1e7;  /* row hover, secondary surface */
    --parchment:      #ede4d3;  /* sidebar (Level 0, document-like) */
    --parchment-edge: #cdc1ad;  /* sidebar dividers */
    --white:          #ffffff;  /* inlay (inputs, nested cards — Level 2) */

    /* ---- Champagne gold (primary accent) --------------------------------- */
    --gold:       #cdb47a;  /* primary CTA bg, active states */
    --gold-hover: #b89c5a;
    --gold-deep:  #a78947;  /* small dense indicators only */
    --gold-soft:  #f6efd8;  /* tinted backgrounds */
    --gold-tint:  rgba(205, 180, 122, 0.18);

    /* ---- Bordeaux (action required, only saturated red) ------------------ */
    --bordeaux:      #9b3a4a;
    --bordeaux-soft: #f1dfe1;

    /* ---- Status (muted, document-grade) ---------------------------------- */
    --status-info:         #7a9fb0;
    --status-info-soft:    #dde7ec;
    --status-success:      #6e9079;
    --status-success-soft: #dfe8e1;
    --status-warn:         #b59554;
    --status-warn-soft:    #f0e6d0;
    --status-danger:       #9b3a4a;
    --status-danger-soft:  #f1dfe1;

    /* ---- Segment markers (dusty / poudré) -------------------------------- */
    --expertise:        #7a9fb0;  /* dusty teal-blue */
    --expertise-soft:   #e8eef2;
    --contentieux:      #a190b8;  /* dusty mauve */
    --contentieux-soft: #ece5f0;

    /* ---- Accessible text variants (5.17 WCAG AA) ------------------------- */
    /* Texte UNIQUEMENT : ces teintes assombries passent 4.5:1 sur cream et
       sur les fonds -soft. Les fonds, bordures et marqueurs gardent les
       teintes claires ci-dessus (identité Prestige préservée). Cf. DESIGN.md. */
    --gold-deep-text:      #7a6020;  /* bronze   ~5.7:1 / cream */
    --status-info-text:    #4a6b7d;  /* info (legalargument) ~4.8:1 / info-soft */
    --expertise-text:      #4a6b7d;  /* teal     ~5.4:1 / cream, ~4.8 / soft */
    --contentieux-text:    #6d5f86;  /* mauve    ~5.5:1 / cream, ~4.8 / soft */
    --status-success-text: #3f6b4f;  /* vert     ~5.9:1 / cream, ~4.9 / soft */
    --status-warn-text:    #7a5a16;  /* ambre    ~6.1:1 / cream, ~5.2 / soft */

    /* ---- Typography ------------------------------------------------------- */
    --font-serif:    'Newsreader', Georgia, 'Times New Roman', serif;
    --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
    --font-document: 'Times New Roman', Georgia, serif;  /* PDF preview body */
    --font-mono:     'Consolas', monospace;              /* stack trace */

    --display-lg-size: 41px;   --display-lg-lh: 1.15;
    --h1-size:         31px;   --h1-lh:         1.2;
    --h2-size:         23px;   --h2-lh:         1.35;
    --h3-size:         18px;   --h3-lh:         1.45;
    --body-lg-size:    17px;   --body-lg-lh:    1.7;
    --body-md-size:    15.5px; --body-md-lh:    1.65;
    --body-sm-size:    14px;   --body-sm-lh:    1.6;
    --label-caps-size: 12px;   --label-caps-tracking: 0.14em;
    --table-data-size: 14px;

    /* ---- Spacing / grid -------------------------------------------------- */
    --space-xs:  8px;
    --space-sm:  16px;
    --space-md:  28px;
    --space-lg:  48px;
    --space-xl:  80px;
    --space-2xl: 112px;
    --gutter:    24px;
    --margin:    40px;
    --max-content:   1440px;
    --sidebar-width: 248px;
    --app-header-height: 96px;  /* shared min-height for .sidebar-header + .header — must exceed both natural heights (sidebar 91px from logo + header 95px from buttons) so min-height takes effect on BOTH and bottom borders align */

    /* ---- Shape (sharp — strict 0px radius everywhere) -------------------- */
    --radius: 0;

    /* ---- Shadow (single sharp variant; no soft drop shadows allowed) ----- */
    --shadow-sharp: 2px 4px 0 rgba(31, 41, 55, 0.08);

    /* ============================================================
       DOCUMENT TYPE PALETTE (Prestige-coordinated, 5.13 structure)
       Used by .document-list-icon, .document-preview-icon,
       .batch-doc-icon, .doc-icon, .doc-item .doc-icon.
       Variante "strong" pour les contextes denses (batch).
       Mapping wireframes 5.39 :
         pdf → bordeaux, doc → expertise, xls → status-success,
         img → gold, email → contentieux.
       ============================================================ */
    --doctype-pdf-bg:          #f1dfe1;  /* bordeaux-soft */
    --doctype-pdf-fg:          #9b3a4a;  /* bordeaux */
    --doctype-pdf-fg-strong:   #7d2935;  /* deeper bordeaux */
    --doctype-doc-bg:          #e8eef2;  /* expertise-soft */
    --doctype-doc-fg:          #7a9fb0;  /* expertise */
    --doctype-doc-fg-strong:   #5e8298;  /* deeper expertise */
    --doctype-xls-bg:          #dfe8e1;  /* status-success-soft */
    --doctype-xls-fg:          #6e9079;  /* status-success */
    --doctype-xls-fg-strong:   #557260;  /* deeper status-success */
    --doctype-img-bg:          #f6efd8;  /* gold-soft */
    --doctype-img-fg:          #a78947;  /* gold-deep */
    --doctype-img-fg-strong:   #7d6433;  /* deeper gold-deep */
    --doctype-email-bg:        #ece5f0;  /* contentieux-soft */
    --doctype-email-fg:        #a190b8;  /* contentieux */
    --doctype-email-fg-strong: #7e6c97;  /* deeper contentieux */

    /* ============================================================
       ANNOTATION PALETTE — text/border per annotation type
       (.annotation-tag, .ann-{type} on regions + sidebar markers).
       Marks (.email-body-content mark.ann-{type}) use soft pastels.
       ============================================================ */
    --ann-fact:               #7a9fb0;  /* expertise — neutral observation */
    --ann-fact-mark:          #e8eef2;
    --ann-quote:              #a190b8;  /* contentieux — citation */
    --ann-quote-mark:         #ece5f0;
    --ann-proof:              #6e9079;  /* status-success — evidence */
    --ann-proof-mark:         #dfe8e1;
    --ann-contradiction:      #9b3a4a;  /* bordeaux — opposition */
    --ann-contradiction-mark: #f1dfe1;
    --ann-amount:             #a78947;  /* gold-deep — money/value */
    --ann-amount-mark:        #f6efd8;
    --ann-keydate:            #b59554;  /* status-warn — time-sensitive */
    --ann-keydate-mark:       #f0e6d0;
    --ann-actor:              #374151;  /* ink-700 — identity */
    --ann-actor-mark:         rgba(31, 41, 55, 0.06);
    --ann-legalargument-mark: #dde7ec;  /* status-info-soft */
    --ann-other:              #6b7280;  /* ink-500 — generic */
    --ann-other-mark:         rgba(31, 41, 55, 0.03);
    --annotation-quote-border: #cdb47a;  /* gold accent on quote frames */

    /* ============================================================
       DOCUMENT CATEGORY PALETTE — text only (.document-tag.category-*).
       Backgrounds restent en rgba(...) inline (alpha 0.12 sur la même teinte).
       ============================================================ */
    --category-todefine:       #b59554;  /* status-warn */
    --category-contract:       #7a9fb0;  /* expertise */
    --category-correspondence: #a78947;  /* gold-deep */
    --category-judicial:       #9b3a4a;  /* bordeaux */
    --category-evidence:       #a190b8;  /* contentieux */

    /* ============================================================
       TIMELINE / FRISE EVENT TYPES (.timeline-event.{type},
       .event-type-badge, .frise-node-type) — text + border.
       Mapping wireframes 5.39 : document → success,
       correspondence → gold, decision → bordeaux.
       ============================================================ */
    --event-document:       #6e9079;  /* status-success */
    --event-correspondence: #a78947;  /* gold-deep */
    --event-decision:       #9b3a4a;  /* bordeaux */

    /* ============================================================
       DEADLINES — urgency border/text + type pills.
       ============================================================ */
    --urgency-soon-border:             #9b3a4a;  /* bordeaux */
    --urgency-soon-text:               #7d2935;  /* deeper bordeaux for AAA */
    --urgency-near-border:             #b59554;  /* status-warn */
    --urgency-near-text:               #8a6e38;  /* deeper status-warn for AAA */
    --deadline-pill-hearing:           #9b3a4a;  /* bordeaux */
    --deadline-pill-expertise-meeting: #7a9fb0;  /* expertise */
    --deadline-pill-filing:            #1f2937;  /* ink-900 */

    /* ============================================================
       EXPORT HISTORY ICONS (.export-history-icon.{type}).
       ============================================================ */
    --export-dire-bg:        #e8eef2;  /* expertise-soft */
    --export-dire-fg:        #7a9fb0;  /* expertise */
    --export-conclusions-bg: #ece5f0;  /* contentieux-soft */
    --export-conclusions-fg: #a190b8;  /* contentieux */
    --export-bordereau-bg:   #f6efd8;  /* gold-soft */
    --export-bordereau-fg:   #a78947;  /* gold-deep */
    --export-chronology-bg:  #dfe8e1;  /* status-success-soft */
    --export-chronology-fg:  #6e9079;  /* status-success */

    /* ============================================================
       TOAST / INLINE FEEDBACK (.profile-toast, .profile-inline-feedback).
       Deeper fg values for AAA contrast on soft backgrounds.
       ============================================================ */
    --toast-success-bg:     #dfe8e1;  /* status-success-soft */
    --toast-success-fg:     #4a6855;  /* deeper status-success (AAA on soft) */
    --toast-success-border: #a8bfb0;
    --toast-error-bg:       #f1dfe1;  /* bordeaux-soft */
    --toast-error-fg:       #7d2935;  /* deeper bordeaux (AAA on soft) */
    --toast-error-border:   #c4a3a8;

    /* ============================================================
       Legacy aliases purgés en sub-livraison 2.4 (cleanup, 9 mai 2026).
       Tous les usages app.css + Razor migrés vers tokens Prestige natifs
       (--ink-900, --gold, --bordeaux, --status-success, --cream, etc.).
       Le grep test sur var\(--(primary|accent|gray|warning|danger|info|
       purple|bg|text|border|shadow-(sm|md|lg)|radius-lg|...)\) retourne 0.
       ============================================================ */
}

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

html, body {
    font-family: var(--font-sans);
    background: var(--cream);
    color: var(--ink-900);
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    color: var(--ink-900);
    font-weight: 400;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }

a { color: var(--ink-900); text-decoration: none; }
a:hover { text-decoration: underline; }

svg { flex-shrink: 0; }

/* ============================================================================
   ACCESSIBILITÉ — focus visible + skip link (5.17, WCAG 2.4.7 / 2.4.1)
   ============================================================================ */

/* Anneau de focus global, clavier uniquement. Couvre tous les contrôles, y
   compris ceux dont l'outline natif est retiré localement (champs, boutons). */
:focus-visible {
    outline: 2px solid var(--ink-900);
    outline-offset: 2px;
}
/* Surfaces charcoal : anneau or pour rester visible sur fond sombre. */
.viewer-toolbar :focus-visible,
.stat-card.alert:focus-visible,
.stat-card.alert :focus-visible { outline-color: var(--gold); }

/* Lien d'évitement — masqué hors focus, glisse en haut-gauche au focus clavier. */
.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 10px 16px;
    background: var(--ink-900);
    color: var(--gold);
    font-size: var(--body-sm-size);
    font-weight: 600;
    border: 1px solid var(--gold);
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); }
/* Cible du skip link : pas d'anneau permanent quand focalisée au clavier. */
.main-content:focus,
.main-content:focus-visible { outline: none; }

/* ============================================================================
   APP SHELL — Prestige
   ============================================================================ */

.app-layout,
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: var(--cream);
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.page-content {
    padding: var(--space-md) var(--margin) var(--space-2xl);
    flex: 1;
    max-width: var(--max-content);
    margin: 0 auto;
    width: 100%;
}

/* Tablet shell — mobile topbar + drawer backdrop (5.14).
   Hidden on desktop; activated by the @media (max-width: 1024px) block below.
   The topbar lives inside .main-content (which is flex-column) so it stacks
   above page content; the backdrop is a sibling of .sidebar inside .app-container. */
.mobile-topbar { display: none; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 41, 55, 0.40);
    z-index: 99; /* below .sidebar (z-index 100), above page content */
    border: none;
}

/* ============================================================================
   SIDEBAR — Parchment (Prestige Legal Authority, cream-on-cream)
   Logo en sceau de cire (charcoal pavé + lettre or Newsreader).
   Nav-item.active = border-left gold + tint or-soft.
   ============================================================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--parchment);
    color: var(--ink-700);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    border-right: 1px solid var(--parchment-edge);
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--parchment-edge);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--app-header-height);
    box-sizing: border-box;
}

.logo { display: flex; align-items: center; gap: 12px; }

.logo-icon {
    width: 34px;
    height: 34px;
    background: var(--ink-900);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 19px;
    letter-spacing: -0.02em;
    border-radius: 0;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: 0.01em;
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--ink-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.12s ease, color 0.12s ease;
    flex-shrink: 0;
    border-radius: 0;
}

.sidebar-toggle:hover { opacity: 1; background: transparent; color: var(--ink-900); }
.sidebar-toggle svg { width: 16px; height: 16px; transition: transform 0.3s ease; }

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) 0;
    overflow-y: auto;
    list-style: none;
}

.nav-section { margin-bottom: var(--space-md); }

.nav-section-title {
    font-size: var(--label-caps-size);
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);  /* a11y 5.17: ink-500 sur parchment ~4.0:1 (fail) → ink-700 */
    padding: var(--space-xs) var(--space-md);
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px var(--space-md);
    color: var(--ink-700);
    font-size: var(--body-sm-size);
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-left: 2px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
}

.nav-item svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.5;
    opacity: 0.65;
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--ink-900);
    background: var(--ink-04);
    text-decoration: none;
}

.nav-item.active {
    color: var(--ink-900);
    background: var(--gold-tint);
    border-left-color: var(--gold);
    font-weight: 600;
}

.nav-item.active svg { color: var(--gold-deep); opacity: 1; }

.nav-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    background: var(--ink-900);
    color: var(--cream);
    padding: 2px 7px;
    letter-spacing: 0.06em;
    border-radius: 0;
}

.sidebar-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--parchment-edge);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    background: transparent;
    border: none;
    color: var(--ink-900);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.12s ease;
    width: 100%;
    text-align: left;
    font: inherit;
}

.user-card:hover { opacity: 0.85; background: transparent; }

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--ink-900);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.02em;
    border-radius: 0;
    flex-shrink: 0;
}

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

.user-name {
    font-size: var(--body-sm-size);
    font-weight: 600;
    color: var(--ink-900);
}

.user-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    color: var(--ink-700);  /* a11y 5.17: ink-500 sur parchment ~4.0:1 (fail) → ink-700 */
    margin-top: 2px;
}

.user-logout-icon {
    color: var(--ink-500);
    flex-shrink: 0;
}

/* Language selector in sidebar footer */
.language-selector {
    display: flex;
    gap: 4px;
    background: var(--ink-04);
    padding: 4px;
    border: 1px solid var(--ink-15);
}

.lang-btn {
    flex: 1;
    padding: 6px 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    font-family: inherit;
}

.lang-btn:hover { color: var(--ink-900); }

.lang-btn.active {
    background: var(--ink-900);
    color: var(--cream);
}

/* Sidebar collapsed (user-controlled icon-rail toggle — DESKTOP ONLY).
   Two selectors kept for compatibility: `.sidebar.collapsed` (sidebar-only)
   and `.app-container.sidebar-collapsed` (parent class on app-container).
   Razor's MainLayout.razor toggles BOTH classes simultaneously.
   Gated to >=1025px so the icon-rail never fights the tablet drawer (5.14):
   on tablet the sidebar is always the full-width off-canvas drawer. */
@media (min-width: 1025px) {
    .sidebar.collapsed { width: 72px; }
    .sidebar.collapsed ~ .main-content,
    .app-container.sidebar-collapsed .main-content { margin-left: 72px; }
    .sidebar.collapsed .sidebar-header {
        padding: var(--space-sm);
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    .sidebar.collapsed .sidebar-nav { padding: var(--space-sm) 0; overflow: visible; }
    .sidebar.collapsed .logo-text { display: none; }
    .sidebar.collapsed .logo { justify-content: center; }
    .sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
    .sidebar.collapsed .nav-section-title { display: none; }
    .sidebar.collapsed .nav-section { margin-bottom: 12px; }
    .sidebar.collapsed .nav-item {
        justify-content: center;
        padding: 11px;
        gap: 0;
        border-left: none;
    }
    .sidebar.collapsed .nav-item span { display: none; }
    .sidebar.collapsed .nav-badge { display: none; }
    .sidebar.collapsed .sidebar-footer { padding: var(--space-sm); }
    .sidebar.collapsed .user-info { display: none; }
    .sidebar.collapsed .user-avatar { display: none; }
    .sidebar.collapsed .user-card { justify-content: center; padding: 4px; }
    .sidebar.collapsed .user-logout-icon {
        display: block;
        width: 20px;
        height: 20px;
        color: var(--ink-700);
    }
    .sidebar.collapsed .language-selector { display: none; }
}

/* ============================================================================
   PAGE HEADER — Prestige (cream surface, ink-15 hairline, Newsreader title)
   ============================================================================ */

.header {
    background: var(--cream);
    border-bottom: 1px solid var(--ink-15);
    padding: var(--space-md) var(--margin) var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 50;
    max-width: var(--max-content);
    margin: 0 auto;
    width: 100%;
    min-height: var(--app-header-height);
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    min-width: 0;
}

/* Blazor's <FocusOnNavigate Selector="h1"> moves focus to the page heading
   after every navigation so screen readers announce it. A heading is not an
   interactive control (it is never reached via Tab — FocusOnNavigate only
   adds tabindex="-1"), so the focus ring carries no navigational meaning and
   is visually distracting on the page title. Suppress it in BOTH states: the
   focus (and thus the SR announcement) still happens, only the outline is
   hidden. Note: after a keyboard-initiated navigation (e.g. submitting the
   Keycloak login with Enter) the browser treats the programmatic focus as
   :focus-visible, so :not(:focus-visible) alone was not enough. */
h1:focus,
h1:focus-visible {
    outline: none;
}

.header-eyebrow {
    font-size: var(--label-caps-size);
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-500);
    margin-bottom: 6px;
}

.page-title {
    font-family: var(--font-serif);
    font-size: var(--h1-size);
    font-weight: 500;
    line-height: 1;
    color: var(--ink-900);
    letter-spacing: -0.02em;
    margin: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--body-sm-size);
}

.breadcrumb a { color: var(--ink-500); text-decoration: none; border: none; }
.breadcrumb a:hover { color: var(--ink-900); border: none; text-decoration: none; }
.breadcrumb svg { width: 14px; height: 14px; color: var(--ink-400); }
.breadcrumb span { color: var(--ink-900); font-weight: 500; }

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ============================================================================
   SEARCH — bottom-border only (form-like, sophisticated)
   ============================================================================ */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ink-15);
    padding: 8px 0;
    width: 280px;
    border-radius: 0;
    box-shadow: none;
}

.search-box:focus-within {
    background: transparent;
    border-bottom-color: var(--ink-900);
    box-shadow: none;
}

.search-box svg {
    width: 15px;
    height: 15px;
    color: var(--ink-500);
    stroke-width: 1.5;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: var(--body-sm-size);
    color: var(--ink-900);
    min-width: 0;
}

.search-box input::placeholder { color: var(--ink-400); }

/* ============================================================================
   BUTTONS — Prestige (sharp, no transform, no soft shadow)
   ============================================================================ */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    font-family: var(--font-sans);
    font-size: var(--body-sm-size);
    font-weight: 600;
    line-height: 1;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: transparent;
    color: var(--ink-900);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    overflow: hidden;
    font-family: inherit;
}

.btn:hover {
    background: transparent;
    border-color: var(--ink-900);
    text-decoration: none;
}

.btn svg { width: 15px; height: 15px; stroke-width: 1.75; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }

/* Override the ripple pseudo from any legacy stylesheet — Prestige is restrained. */
.btn::after { display: none; }

.btn-primary {
    background: var(--gold);
    color: var(--ink-900);
    border-color: var(--gold);
}

.btn-primary:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
    color: var(--ink-900);
}

.btn-secondary {
    background: transparent;
    color: var(--ink-900);
    border: 1px solid var(--ink-15);
}

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

.btn-ghost {
    background: transparent;
    color: var(--ink-700);
    border: 1px solid transparent;
    padding: 9px 14px;
}

.btn-ghost:hover {
    background: transparent;
    color: var(--ink-900);
    border-color: var(--ink-15);
}

.btn-success {
    background: var(--status-success);
    color: var(--white);
    border: 1px solid var(--status-success);
}

.btn-success:hover {
    background: var(--status-success);
    border-color: var(--ink-900);
    color: var(--white);
}

.btn-danger {
    background: var(--bordeaux);
    color: var(--white);
    border: 1px solid var(--bordeaux);
}

.btn-danger:hover {
    background: var(--bordeaux);
    border-color: var(--ink-900);
    color: var(--white);
}

.btn-accent {
    background: var(--gold);
    color: var(--ink-900);
    border: 1px solid var(--gold);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: transparent;
    color: var(--ink-700);
    cursor: pointer;
    position: relative;
    transition: border-color 0.12s ease, color 0.12s ease;
}

.icon-btn:hover {
    background: transparent;
    border-color: var(--ink-900);
    color: var(--ink-900);
}

.icon-btn svg { width: 17px; height: 17px; stroke-width: 1.5; }

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: var(--gold-deep);
    border: none;
    border-radius: 0;
}

/* ============================================================================
   FORMS — Prestige (uppercase tracked labels, sharp borders)
   ============================================================================ */

.form-group { margin-bottom: var(--space-sm); }

.form-label {
    display: block;
    font-size: var(--label-caps-size);
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    margin-bottom: 6px;
}

.form-control,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-family: inherit;
    font-size: var(--body-sm-size);
    background: var(--white);
    color: var(--ink-900);
    transition: border-color 0.12s ease;
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--ink-900);
    box-shadow: none;
}

.form-control::placeholder,
.form-input::placeholder,
.form-textarea::placeholder { color: var(--ink-400); }

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

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-family: inherit;
    font-size: var(--body-sm-size);
    color: var(--ink-700);
    background: var(--white);
    cursor: pointer;
}

.filter-select:hover { border-color: var(--ink-900); }

.filters { display: flex; gap: 12px; align-items: center; }

/* ============================================================================
   CARDS — Prestige (white inlay surface, sharp 1px ink-15 border)
   ============================================================================ */

.card {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    position: relative;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--ink-15);
    margin-bottom: var(--space-sm);
}

.card-header:last-child { border-bottom: none; margin-bottom: 0; }

.card-title {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

.card-body { padding: 0; }

/* ============================================================================
   BADGES — Prestige (sharp, soft fill + colored 1px border)
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-700);
    line-height: 1.4;
}

.badge-primary  { background: var(--cream-dim);            color: var(--ink-900); border-color: var(--ink-15); }
.badge-success,
.badge-active   { background: var(--status-success-soft);  color: var(--ink-900); border-color: var(--status-success); }
.badge-warning  { background: var(--status-warn-soft);     color: var(--ink-900); border-color: var(--status-warn); }
.badge-danger,
.badge-archived { background: var(--bordeaux-soft);        color: var(--bordeaux); border-color: var(--bordeaux); }
.badge-gray     { background: var(--cream-dim);            color: var(--ink-500); border-color: var(--ink-15); }
.badge-expertise          { background: var(--expertise-soft);   color: var(--ink-900); border-color: var(--expertise); }
.badge-contentieux,
.badge-litigation         { background: var(--contentieux-soft); color: var(--ink-900); border-color: var(--contentieux); }

/* Segment badges */
.segment-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    color: var(--ink-700);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}

.segment-badge.expertise   { background: var(--expertise-soft);   color: var(--ink-900); border-color: var(--expertise); }
.segment-badge.contentieux { background: var(--contentieux-soft); color: var(--ink-900); border-color: var(--contentieux); }
.segment-badge svg { width: 13px; height: 13px; stroke-width: 1.75; }

/* ============================================================================
   SEGMENT TABS / TABS — Prestige (underline gold sur l'item actif)
   ============================================================================ */

.segment-tabs {
    display: flex;
    gap: 0;
    background: transparent;
    padding: 0;
    border-bottom: 1px solid var(--ink-15);
    border-radius: 0;
}

.segment-tab {
    padding: 12px 20px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--ink-500);
    font-family: var(--font-sans);
    font-size: var(--body-sm-size);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.12s ease, border-color 0.12s ease;
    border-radius: 0;
}

.segment-tab:hover { color: var(--ink-900); }

.segment-tab.active {
    background: transparent;
    color: var(--ink-900);
    font-weight: 600;
    box-shadow: none;
    border-bottom-color: var(--gold);
}

.segment-tab.expertise.active   { border-bottom-color: var(--expertise); }
.segment-tab.contentieux.active { border-bottom-color: var(--contentieux); }
.segment-tab svg { width: 16px; height: 16px; stroke-width: 1.5; }

.segment-filter { margin-bottom: var(--space-md); }

.segment-filter-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.segment-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--body-sm-size);
    color: var(--ink-500);
}

.segment-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 0;
}

.segment-indicator .dot.expertise   { background: var(--expertise); }
.segment-indicator .dot.contentieux { background: var(--contentieux); }

/* ============================================================================
   TABLES — Prestige (cream-dim header caps + 1px ink-15 row separators)
   ============================================================================ */

.table-container {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

table th {
    padding: 14px var(--space-sm);
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    background: var(--cream-dim);
    border-bottom: 1px solid var(--ink-15);
}

table td {
    padding: 16px var(--space-sm);
    border-bottom: 1px solid var(--ink-15);
    font-size: var(--table-data-size);
    color: var(--ink-700);
    vertical-align: middle;
}

table tbody tr { transition: background 0.12s ease; }
table tr:hover td { background: var(--cream-dim); }
table tr:last-child td { border-bottom: none; }

/* ============================================================================
   SECTION HEADERS — Prestige (margins tightened per 5.39 deltas)
   ============================================================================ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: var(--space-md) 0 var(--space-sm);
}

.section-title {
    font-family: var(--font-serif);
    font-size: var(--h2-size);
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

/* ============================================================================
   STATS / KPI CARDS — Prestige (Newsreader 33px value + filigrane SVG
   en filigrane absolu top-right via .stat-watermark, ajouté côté Razor
   en 2.3a Dashboard ; sans watermark, la card reste minimaliste valide).
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: var(--space-md);
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    transition: border-color 0.12s ease;
}

.stat-card:hover {
    border-color: var(--ink-900);
    transform: none;
    box-shadow: none;
}

.stat-card > * { position: relative; z-index: 1; }
.stat-card:hover .stat-value { color: var(--ink-900); }

/* Stat-card cliquable (ex. KPI "dossiers actifs" → /cases). Neutralise le style
   lien par défaut ; le :hover border-color de .stat-card reste actif. */
.stat-card-link { text-decoration: none; color: inherit; cursor: pointer; }
.stat-card-link:hover { text-decoration: none; }

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.stat-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    color: var(--ink-500);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: none;
    flex-shrink: 0;
}

.stat-icon svg { width: 20px; height: 20px; stroke-width: 1.5; }
.stat-icon.blue   { background: transparent; color: var(--ink-900); }
.stat-icon.orange { background: transparent; color: var(--gold-deep); }
.stat-icon.green  { background: transparent; color: var(--status-success); }
.stat-icon.purple { background: transparent; color: var(--contentieux); }
.stat-icon.cyan   { background: transparent; color: var(--expertise); }

.stat-value {
    font-family: var(--font-serif);
    font-size: 33px;
    font-weight: 500;
    line-height: 1;
    color: var(--ink-900);
    letter-spacing: -0.03em;
    margin-top: auto;
    margin-bottom: 4px;
}

.stat-label {
    font-size: var(--label-caps-size);
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-500);
}

.stat-label-bold {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
}

/* Watermark — large faded SVG icon clipped by card edge (Prestige signature).
   Activated when Razor markup includes <div class="stat-watermark"><svg/></div>.
   Currently only used on cards that opt in via markup. */
.stat-watermark {
    position: absolute;
    top: -64px;
    right: -56px;
    width: 168px;
    height: 168px;
    color: var(--ink-900);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.stat-watermark svg {
    width: 100%;
    height: 100%;
    stroke-width: 0.5;
    stroke: currentColor;
    fill: none;
    vector-effect: non-scaling-stroke;
}

.stat-watermark.gold { color: var(--gold-deep); opacity: 0.20; }

/* Alert variant — inverted KPI for urgency (charcoal bg + gold accents). */
.stat-card.alert {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: var(--cream);
}

.stat-card.alert:hover { border-color: var(--gold); }
.stat-card.alert .stat-value { color: var(--cream); }
.stat-card.alert .stat-label { color: var(--gold); }
.stat-card.alert .stat-icon { color: var(--gold); }
.stat-card.alert .stat-watermark { color: var(--gold); opacity: 0.35; }
.stat-card.alert .stat-watermark.gold { color: var(--gold); opacity: 0.35; }

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

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

/* ============================================================================
   ONBOARDING — Prestige (first-login guide, task 5.15)
   Welcome modal reuses .confirm-card (+ .onboarding-dialog widener). The
   "Prise en main" surface is a right-edge DRAWER (.onboarding-drawer) visible on
   every screen while onboarding is pending — collapsed it shows only a small
   gold tab on the right edge ; expanded a full-height panel slides in. Lives in
   App.razor, position:fixed, never affects page flow. z-index 900 (< upload
   panel 950 < welcome modal 1000).
   ============================================================================ */

.onboarding-dialog { max-width: 480px; }

.onboarding-step-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}

.onboarding-step-list-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--ink-15);
}

.onboarding-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-900);
    color: var(--gold);
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

.onboarding-step-text { display: flex; flex-direction: column; gap: 2px; }
.onboarding-step-title { font-weight: 600; color: var(--ink-900); font-size: 14px; }
.onboarding-step-desc { color: var(--ink-500); font-size: 13px; line-height: 1.5; }

/* ---- right-edge drawer ---- */
.onboarding-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 900;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Collapsed: slide the whole drawer right by its own width (= the panel width)
   so only the tab — which sticks out to the left of the panel — stays on screen
   at the viewport edge. */
.onboarding-drawer.collapsed { transform: translateX(100%); }

.onboarding-drawer-tab {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-100%, -50%);
    width: 40px;
    min-height: 64px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--gold);
    color: var(--ink-900);
    border: 1px solid var(--ink-15);
    border-right: none;
    border-radius: 0;
    cursor: pointer;
    box-shadow: -2px 3px 0 rgba(31, 41, 55, 0.10);
}

.onboarding-drawer-tab:hover { background: var(--gold-hover); }

.onboarding-drawer-tab-chevron { transition: transform 0.2s ease; }
.onboarding-drawer:not(.collapsed) .onboarding-drawer-tab-chevron { transform: rotate(180deg); }

.onboarding-drawer-tab-count {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}
.onboarding-drawer-tab-total { font-size: 10px; opacity: 0.7; }

.onboarding-drawer-panel {
    width: 340px;
    max-width: calc(100vw - 44px);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-left: 1px solid var(--ink-15);
    box-shadow: -2px 0 0 rgba(31, 41, 55, 0.10);
}

.onboarding-drawer-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 14px 16px;
    border-bottom: 1px solid var(--ink-15);
}

.onboarding-drawer-header-icon { flex-shrink: 0; color: var(--gold-deep); }

.onboarding-drawer-title {
    flex: 1;
    min-width: 0;
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.onboarding-drawer-count {
    flex-shrink: 0;
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-900);
}

.onboarding-drawer-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--ink-500);
    line-height: 0;
}
.onboarding-drawer-dismiss:hover { color: var(--ink-900); }

.onboarding-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px 16px;
}

.onboarding-drawer-intro {
    margin: 0 0 12px;
    color: var(--ink-500);
    font-size: 13px;
    line-height: 1.5;
}

.onboarding-drawer-progress {
    flex-shrink: 0;
    height: 3px;
    background: var(--ink-15);
}

.onboarding-drawer-progress-fill {
    display: block;
    height: 100%;
    background: var(--gold);
    transition: width 0.3s ease;
}

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

.onboarding-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--ink-15);
}

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

.onboarding-check { flex-shrink: 0; line-height: 0; margin-top: 1px; color: var(--ink-300); }
.onboarding-checklist-item.done .onboarding-check { color: var(--status-success-text); }

.onboarding-checklist-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.onboarding-checklist-label { color: var(--ink-900); font-size: 14px; font-weight: 500; }
.onboarding-checklist-desc { color: var(--ink-500); font-size: 12.5px; line-height: 1.45; }
.onboarding-checklist-item.done .onboarding-checklist-label { color: var(--ink-500); font-weight: 400; }
.onboarding-checklist-item.done .onboarding-checklist-desc { display: none; }

.onboarding-checklist-go {
    flex-shrink: 0;
    margin-top: -2px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-deep-text);
    border: 1px solid var(--ink-15);
}
.onboarding-checklist-go:hover { background: var(--gold-soft); color: var(--ink-900); }

.onboarding-done {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
}
.onboarding-done-icon { color: var(--status-success); }
.onboarding-done-title { font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--ink-900); }
.onboarding-done-desc { color: var(--ink-500); font-size: 13px; }
.onboarding-done .btn { align-self: stretch; justify-content: center; }

@media (max-width: 600px) {
    .onboarding-drawer-panel { width: 320px; }
}

/* ============================================================================
   DOSSIER CARDS — Prestige (Dashboard favoris + CaseList grid)
   Sharp inlay sur cream-dim footer + sceau de cire sur avatars membres.
   ============================================================================ */

.dossiers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gutter);
}

.dossier-card {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.12s ease;
}

.dossier-card:hover {
    border-color: var(--ink-900);
    transform: none;
    box-shadow: none;
    text-decoration: none;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--ink-400);
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
}

.favorite-btn:hover {
    background: transparent;
    color: var(--gold-deep);
}

.favorite-btn:active { transform: scale(0.92); }

.favorite-btn.is-favorite { color: var(--gold-deep); }

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

.dossier-card .favorite-btn {
    top: 14px;
    right: 14px;
}

.dossier-card .dossier-header-top { padding-right: 36px; }

.section-title-icon {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
    margin-right: 8px;
}

.favorite-section-icon { color: var(--gold-deep); }

.dossier-header-section .favorite-btn {
    position: static;
    width: 40px;
    height: 40px;
}

.dossier-header-section .favorite-btn svg {
    width: 22px;
    height: 22px;
}

.dossier-header {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    position: relative;
}

.dossier-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dossier-ref {
    font-family: var(--font-sans);
    font-size: var(--label-caps-size);
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-500);
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.dossier-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dossier-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
    color: var(--ink-500);
    flex-wrap: wrap;
}

.dossier-meta-item { display: flex; align-items: center; gap: 6px; }
.dossier-meta-item svg { width: 13px; height: 13px; stroke-width: 1.5; }

.dossier-body { padding: var(--space-sm) var(--space-md); }

.dossier-stats { display: flex; gap: 12px; }

.dossier-stat {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: var(--cream);
    border: 1px solid var(--ink-15);
    border-radius: 0;
}

.dossier-stat-value {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1;
}

.dossier-stat-label {
    font-size: 10px;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-top: 4px;
    white-space: nowrap;
}

.dossier-footer {
    padding: 12px var(--space-md);
    background: var(--cream);
    border-top: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

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

/* Member avatars — charcoal/gold sceau de cire (round here for stacking).
   32px diameter with 2px cream ring + Newsreader 9px = comfortable margin
   for any initials pair including worst-case MM/WM. */
.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ink-900);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    border: 2px solid var(--cream);
    margin-left: -8px;
}

.member-avatar:first-child { margin-left: 0; }

.member-avatar-overflow {
    background: var(--ink-400) !important;
    color: var(--cream);
}

.dossier-date {
    font-size: 12px;
    color: var(--ink-500);
    font-family: var(--font-sans);
    letter-spacing: 0.04em;
}

.dossier-status {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    color: var(--ink-700);
}

.dossier-status.active  { background: var(--status-success-soft); color: var(--ink-900); border-color: var(--status-success); }
.dossier-status.pending { background: var(--gold-soft);           color: var(--ink-900); border-color: var(--gold); }
.dossier-status.closed  { background: var(--cream-dim);           color: var(--ink-500); border-color: var(--ink-15); }

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

@media (max-width: 700px) {
    .dossiers-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   DEADLINE LIST (Dashboard)
   ============================================================================ */

.deadline-list {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

.deadline-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    transition: background 0.12s ease;
}

.deadline-item:last-child { border-bottom: none; }
.deadline-item:hover { background: var(--cream-dim); }

.deadline-date { min-width: 80px; }

.deadline-day {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1;
    letter-spacing: -0.02em;
}

.deadline-month {
    font-size: 11px;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    font-weight: 700;
    margin-top: 4px;
}

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

.deadline-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-900);
    margin-bottom: 4px;
    line-height: 1.4;
}

.deadline-meta { font-size: 13px; color: var(--ink-500); }

.deadline-urgency {
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
}

.deadline-urgency.urgent { background: var(--bordeaux-soft);       color: var(--bordeaux); border-color: var(--bordeaux); }
.deadline-urgency.soon   { background: var(--status-warn-soft);    color: var(--ink-900);  border-color: var(--status-warn); }
.deadline-urgency.normal { background: var(--cream-dim);           color: var(--ink-500);  border-color: var(--ink-15); }

/* ============================================================================
   Text helpers
   ============================================================================ */

.text-muted   { color: var(--ink-500); }
.text-danger  { color: var(--bordeaux); }
.text-success { color: var(--status-success-text); }
.mt-1 { margin-top: 4px; }

/* ============================================================================
   Documents page
   ============================================================================ */

/* ============================================================================
   Documents page (5.40 sub-livraison 2.3e, Prestige native)
   Wireframe : 03-documents.html
   ============================================================================ */

.documents-header {
    background: var(--cream);
    border-bottom: 1px solid var(--ink-15);
    padding: var(--space-md) var(--margin) var(--space-sm);
    max-width: var(--max-content);
    margin: 0 auto;
    width: 100%;
}

.documents-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.documents-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* View toggle (grid / list) — sharp segmented bar */
.view-toggle {
    display: flex;
    background: transparent;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: 0;
}

.view-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    color: var(--ink-500);
    border-right: 1px solid var(--ink-15);
    transition: color 0.12s ease, background 0.12s ease;
    font-family: inherit;
}

.view-btn:last-child { border-right: none; }
.view-btn:hover { color: var(--ink-900); background: transparent; }

.view-btn.active {
    background: var(--ink-900);
    color: var(--cream);
    box-shadow: none;
}

.view-btn svg { width: 16px; height: 16px; stroke-width: 1.5; }

/* ============================================================================
   TAB NAV (CaseHeader) — Prestige (underline gold sur item actif)
   ============================================================================ */

.tab-nav {
    background: var(--cream);
    border-bottom: 1px solid var(--ink-15);
    padding: 0 var(--margin);
    display: flex;
    gap: 0;
    overflow-x: auto;
    max-width: var(--max-content);
    margin: 0 auto;
    width: 100%;
}

button.tab-item {
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    cursor: pointer;
}

.tab-item {
    padding: 14px 20px;
    font-family: var(--font-sans);
    font-size: var(--body-sm-size);
    font-weight: 500;
    color: var(--ink-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.12s ease, border-color 0.12s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.tab-item:hover { color: var(--ink-900); text-decoration: none; }

.tab-item.active {
    color: var(--ink-900);
    border-bottom-color: var(--gold);
    font-weight: 600;
}

.tab-item svg { width: 16px; height: 16px; stroke-width: 1.5; }

.tab-badge {
    background: var(--cream-dim);
    color: var(--ink-500);
    padding: 2px 8px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.tab-item.active .tab-badge {
    background: var(--ink-900);
    color: var(--cream);
    border-color: var(--ink-900);
}

/* Segment-tinted underline variants on case detail tabs */
.tab-nav.expertise   .tab-item.active { border-bottom-color: var(--expertise); }
.tab-nav.contentieux .tab-item.active { border-bottom-color: var(--contentieux); }

/* ============================================================================
   CATEGORY BANNER (Documents page) — Prestige
   ============================================================================ */

.category-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--space-sm);
    background: var(--gold-soft);
    border: 1px solid var(--gold);
    border-radius: 0;
    margin-bottom: var(--space-sm);
}

.category-banner-icon { color: var(--gold-deep); flex-shrink: 0; }

.category-banner-text {
    flex: 1;
    font-size: var(--body-sm-size);
    color: var(--ink-900);
}

.category-banner-action {
    background: var(--gold);
    color: var(--ink-900);
    border: 1px solid var(--gold);
    padding: 8px 14px;
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease;
}

.category-banner-action:hover { background: var(--gold-hover); border-color: var(--gold-hover); }

/* ============================================================================
   VIEW FILTER (Documents page chips) — Prestige (segmented sharp)
   ============================================================================ */

.view-filter {
    display: inline-flex;
    background: transparent;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: 0;
    margin-bottom: var(--space-sm);
    gap: 0;
}

.view-filter button {
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-500);
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
}

.view-filter button:hover:not(.active) {
    color: var(--ink-900);
    background: var(--cream-dim);
}

.view-filter button.active {
    background: var(--ink-900);
    color: var(--cream);
    box-shadow: none;
}

.view-filter-divider {
    width: 1px;
    background: var(--ink-15);
    margin: 4px 0;
    align-self: stretch;
}

.view-filter button.issue { color: var(--ink-500); }
.view-filter button.issue:hover:not(.active) { color: var(--bordeaux); background: var(--bordeaux-soft); }
.view-filter button.issue.active {
    background: var(--bordeaux);
    color: var(--white);
}

.view-filter-count {
    margin-left: 6px;
    font-weight: 700;
    opacity: 0.7;
    letter-spacing: 0.04em;
}

/* Compact upload bar (always visible) */
.upload-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px dashed var(--ink-15);
    border-radius: 0;
    margin-bottom: 20px;
    transition: border-color 0.15s, background 0.15s;
}

.upload-bar:hover { border-color: var(--ink-400); }

.upload-bar-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    color: var(--ink-900);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-bar-label {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.upload-bar-label-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-900);
}

.upload-bar-label-sub {
    font-size: 12px;
    color: var(--ink-500);
    margin-top: 2px;
}

.upload-bar-category {
    flex-shrink: 0;
}

.upload-bar-category select {
    width: auto;
    min-width: 160px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 13px;
}

.upload-bar-description {
    flex: 1;
    min-width: 220px;
    max-width: 360px;
}

.upload-bar-description input {
    width: 100%;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 13px;
}

.document-list-filename-secondary,
.document-filename-secondary {
    font-size: 12px;
    color: var(--ink-500);
    font-style: italic;
}

.document-filename-secondary {
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-input-counter {
    font-size: 11px;
    color: var(--ink-500);
    text-align: right;
    margin-top: 4px;
}

.upload-bar-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.upload-bar-actions .btn {
    padding: 8px 14px;
    font-size: 13px;
}

@media (max-width: 900px) {
    .upload-bar { flex-wrap: wrap; }
    .upload-bar-label { flex-basis: 100%; order: -1; }
}

/* Fullscreen drop overlay — charcoal / gold sceau de cire (Prestige) */
.drop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31, 41, 55, 0.85);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: drop-overlay-fade 120ms ease-out;
}

.drop-overlay-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: copy;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.drop-overlay-box {
    position: relative;
    z-index: 1;
    pointer-events: none;
    width: min(560px, 80vw);
    padding: var(--space-lg) var(--space-md);
    border: 1px dashed var(--gold);
    border-radius: 0;
    text-align: center;
    color: var(--cream);
    background: rgba(205, 180, 122, 0.08);
}

.drop-overlay-icon {
    width: 56px;
    height: 56px;
    color: var(--gold);
    stroke-width: 1.5;
    margin-bottom: var(--space-sm);
}

.drop-overlay-title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 500;
    color: var(--cream);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.drop-overlay-sub {
    font-size: 13px;
    color: rgba(253, 251, 247, 0.75);
}

@keyframes drop-overlay-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.upload-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    text-align: left;
}

.upload-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--cream);
    border-radius: var(--radius);
    font-size: 13px;
}

.upload-name {
    overflow: hidden;
    max-width: 70%;
}

.upload-name > div:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-error-message {
    margin-top: 4px;
    font-size: 11px;
    color: var(--bordeaux);
    word-break: break-word;
    line-height: 1.4;
}

/* ==========================================================================
   Floating upload progress panel (bottom-right, Drive-style)
   ========================================================================== */

/* Upload progress panel (5.40 sub-livraison 2.2g — Prestige) */
.upload-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: var(--white);
    border-radius: 0;
    border: 1px solid var(--ink-15);
    box-shadow: var(--shadow-sharp);
    z-index: 950;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: upload-panel-slide-in 200ms cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes upload-panel-slide-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-panel.collapsed { width: 320px; }

.upload-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--cream-dim);
    border-bottom: 1px solid var(--ink-15);
    cursor: pointer;
    user-select: none;
}

.upload-panel.collapsed .upload-panel-header { border-bottom: none; }

.upload-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.upload-panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.upload-panel-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--ink-500);
    cursor: pointer;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.upload-panel-btn:hover {
    background: var(--ink-15);
    color: var(--ink-900);
}

.upload-panel-progress {
    height: 3px;
    background: var(--ink-15);
    overflow: hidden;
}

.upload-panel-progress-bar {
    height: 100%;
    background: var(--gold);
    transition: width 200ms ease-out;
}

.upload-panel-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 320px;
    overflow-y: auto;
}

.upload-panel-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--ink-15);
}

.upload-panel-item:last-child { border-bottom: none; }
.upload-panel-item.error { background: var(--bordeaux-soft); }

.upload-panel-item-icon {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-panel-item-info {
    flex: 1;
    min-width: 0;
}

.upload-panel-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-700);
}

.upload-panel-item-error {
    margin-top: 3px;
    font-size: 11px;
    color: var(--bordeaux);
    word-break: break-word;
    line-height: 1.35;
}

.upload-panel-footer {
    padding: 8px 14px;
    border-top: 1px solid var(--ink-15);
    background: var(--cream-dim);
    text-align: right;
}

.upload-panel-btn-text {
    background: transparent;
    border: none;
    color: var(--ink-900);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 0;
    transition: background 0.15s ease;
}

.upload-panel-btn-text:hover { background: var(--ink-15); }

.upload-panel-spinner {
    animation: upload-spin 1s linear infinite;
    transform-origin: center;
}

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

/* Documents list view (alternative to grid) */
.documents-list {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

.document-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px var(--space-sm);
    border-bottom: 1px solid var(--ink-15);
    transition: background 0.12s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.document-list-item:last-child { border-bottom: none; }
.document-list-item:hover { background: var(--cream-dim); text-decoration: none; }

.document-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.document-list-icon.pdf   { background: var(--doctype-pdf-bg);   color: var(--doctype-pdf-fg);   border-color: var(--doctype-pdf-fg); }
.document-list-icon.doc   { background: var(--doctype-doc-bg);   color: var(--doctype-doc-fg);   border-color: var(--doctype-doc-fg); }
.document-list-icon.xls   { background: var(--doctype-xls-bg);   color: var(--doctype-xls-fg);   border-color: var(--doctype-xls-fg); }
.document-list-icon.img   { background: var(--doctype-img-bg);   color: var(--doctype-img-fg);   border-color: var(--doctype-img-fg); }
.document-list-icon.email { background: var(--doctype-email-bg); color: var(--doctype-email-fg); border-color: var(--doctype-email-fg); }
.document-list-icon.other { background: var(--cream-dim);        color: var(--ink-500);          border-color: var(--ink-15); }

.document-list-info {
    flex: 1;
    min-width: 0;
}

.document-list-name {
    font-family: var(--font-serif);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
    margin-bottom: 2px;
    min-width: 0;
}

.truncate-ellipsis {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-list-desc {
    font-size: 12px;
    color: var(--ink-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-list-piece {
    background: transparent;
    color: var(--gold-deep-text);
    padding: 0;
    border-radius: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    flex-shrink: 0;
}

.document-list-date {
    font-size: 11px;
    color: var(--ink-500);
    flex-shrink: 0;
    width: 90px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.document-list-size {
    font-size: 11px;
    color: var(--ink-500);
    flex-shrink: 0;
    width: 70px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.document-list-desc-failed {
    color: var(--bordeaux);
    font-weight: 500;
    cursor: help;
}

.document-list-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.document-action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink-500);
    transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.document-action-btn:hover {
    border-color: var(--ink-900);
    color: var(--ink-900);
    background: var(--white);
}

.document-action-btn.danger:hover {
    border-color: var(--bordeaux);
    color: var(--bordeaux);
}

.document-action-btn svg { width: 14px; height: 14px; stroke-width: 1.5; }

@media (max-width: 900px) {
    .document-list-piece,
    .document-list-date,
    .document-list-size { display: none; }
}

/* Document grid (cards) */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gutter);
}

@media (max-width: 640px) {
    .documents-grid { grid-template-columns: 1fr; }
}

.document-card {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    transition: border-color 0.12s ease;
    cursor: pointer;
    text-decoration: none;
    /* flex column : .document-info grandit (flex:1) et pousse la bande
       .document-actions tout en bas → bandes alignées entre tuiles d'une rangée. */
    display: flex;
    flex-direction: column;
    color: inherit;
    /* overflow: hidden retiré — clipait les tooltips ::after des boutons d'action. */
}

.document-card:hover {
    border-color: var(--ink-900);
    box-shadow: none;
    transform: none;
    text-decoration: none;
}

.document-preview {
    height: 160px;
    background: var(--cream-dim);
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 0;
    overflow: hidden;
}

.document-preview-icon {
    width: 64px;
    height: 64px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.document-preview-icon.pdf   { background: var(--doctype-pdf-bg);   color: var(--doctype-pdf-fg);   border-color: var(--doctype-pdf-fg); }
.document-preview-icon.doc   { background: var(--doctype-doc-bg);   color: var(--doctype-doc-fg);   border-color: var(--doctype-doc-fg); }
.document-preview-icon.xls   { background: var(--doctype-xls-bg);   color: var(--doctype-xls-fg);   border-color: var(--doctype-xls-fg); }
.document-preview-icon.img   { background: var(--doctype-img-bg);   color: var(--doctype-img-fg);   border-color: var(--doctype-img-fg); }
.document-preview-icon.email { background: var(--doctype-email-bg); color: var(--doctype-email-fg); border-color: var(--doctype-email-fg); }
.document-preview-icon.other { background: var(--cream-dim);        color: var(--ink-500);          border-color: var(--ink-15); }

.document-piece-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--ink-900);
    color: var(--gold);
    padding: 4px 10px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    border: 1px solid var(--ink-900);
}

.document-info { padding: var(--space-sm); flex: 1; }

.document-name {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
    letter-spacing: -0.005em;
    margin-bottom: 6px;
    min-width: 0;
}

.document-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-500);
    margin-bottom: 12px;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
}

.document-uploader {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--ink-700);
}

.document-uploader-avatar {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 0;
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 10px;
    font-weight: 600;
}

.document-uploader-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.document-tag {
    padding: 3px 8px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    border: 1px solid var(--ink-15);
}

.document-tag.communicated      { background: var(--status-success-soft); color: var(--ink-900);  border-color: var(--status-success); }
.document-tag.annotated         { background: var(--status-success-soft); color: var(--ink-900);  border-color: var(--status-success); }
.document-tag.annotations-count { background: var(--contentieux-soft);    color: var(--ink-900);  border-color: var(--contentieux); }
.document-tag.events-count      { background: var(--gold-soft);           color: var(--gold-deep-text); border-color: var(--gold); }

.filter-option label .filter-icon {
    display: inline-block;
    vertical-align: -2px;
    margin-right: 6px;
    color: var(--ink-500);
}
.document-tag.key        { background: var(--gold-soft);     color: var(--ink-900);  border-color: var(--gold); }
.document-tag.duplicate  { background: var(--bordeaux-soft); color: var(--bordeaux); border-color: var(--bordeaux); }
.document-tag.processing { background: var(--cream-dim);     color: var(--ink-700);  border-color: var(--ink-15); }

.document-select {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--ink-900);
    margin: 0;
}

.document-card-wrapper {
    position: relative;
    display: flex;
    z-index: 1;
    /* Permet aux container queries internes (cf. .document-actions narrow mode plus bas)
       de reagir a la largeur de la tuile, pas du viewport. Critique avec sidebar repliable. */
    container-type: inline-size;
}

.document-card-wrapper:hover,
.document-card-wrapper:focus-within {
    z-index: 5;
}

.document-card-wrapper > .document-card {
    flex: 1;
    min-width: 0;
}

.document-select-grid {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

.document-list-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: var(--space-sm);
    border-bottom: 1px solid var(--ink-15);
    z-index: 1;
}

.document-list-row:hover,
.document-list-row:focus-within { z-index: 5; }

.document-list-row:last-child { border-bottom: none; }

.document-list-row > .document-list-item {
    flex: 1;
    min-width: 0;
    padding-left: 0;
    border-bottom: none;
}

.document-select-list { flex-shrink: 0; }

.document-card-wrapper.is-selected > .document-card {
    border-color: var(--ink-900);
    box-shadow: inset 0 0 0 1px var(--ink-900);
}

/* Bulk action bar (sélection multiple) — alert charcoal/or sceau de cire */
.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px var(--space-sm);
    background: var(--ink-900);
    color: var(--cream);
    border: 1px solid var(--ink-900);
    border-radius: 0;
    margin-bottom: var(--space-sm);
}

.bulk-count {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--gold);
}

.bulk-action-bar .btn {
    padding: 7px 12px;
    font-size: 12px;
}

.bulk-action-bar .btn svg { margin-right: 4px; vertical-align: -3px; }

.bulk-clear {
    background: transparent;
    border: 1px solid transparent;
    color: var(--cream);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 8px;
    text-decoration: none;
    border-radius: 0;
    transition: border-color 0.12s ease;
}

.bulk-clear:hover { color: var(--gold); border-color: var(--gold); }
.document-tag[data-tooltip]:not([data-tooltip=""]):hover { cursor: help; }

/* Custom styled tooltip (replaces the browser-default title= popup).
   Usage: <element data-tooltip="text"> — appears below the element on hover.
   Add data-tooltip-position="top" to flip it above. */
[data-tooltip]:not([data-tooltip=""]) {
    position: relative;
}

[data-tooltip]:not([data-tooltip=""])::after,
[data-tooltip]:not([data-tooltip=""])::before {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease 0.2s, transform 0.15s ease 0.2s;
    z-index: 10000;
}

[data-tooltip]:not([data-tooltip=""])::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--ink-900);
    color: var(--white);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 320px;
    width: max-content;
    white-space: normal;
    text-align: center;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.28);
    font-family: var(--font-sans);
    font-style: normal;
}

[data-tooltip]:not([data-tooltip=""])::before {
    content: "";
    position: absolute;
    top: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: var(--ink-900);
}

[data-tooltip-position="top"]:not([data-tooltip=""])::after {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
}

[data-tooltip-position="top"]:not([data-tooltip=""])::before {
    top: auto;
    bottom: calc(100% + 3px);
    border: 5px solid transparent;
    border-top-color: var(--ink-900);
    border-bottom-color: transparent;
}

[data-tooltip-position="right"]:not([data-tooltip=""])::after {
    top: 50%;
    bottom: auto;
    left: calc(100% + 8px);
    transform: translateY(-50%) translateX(-4px);
}

[data-tooltip-position="right"]:not([data-tooltip=""])::before {
    top: 50%;
    bottom: auto;
    left: calc(100% + 3px);
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--ink-900);
    border-bottom-color: transparent;
}

[data-tooltip]:not([data-tooltip=""]):hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-tooltip]:not([data-tooltip=""]):hover::before {
    opacity: 1;
}

/* Variant-specific hover transforms — must come AFTER the default hover rule */
[data-tooltip-position="top"]:not([data-tooltip=""]):hover::after {
    transform: translateX(-50%) translateY(0);
}

[data-tooltip-position="right"]:not([data-tooltip=""]):hover::after {
    transform: translateY(-50%) translateX(0);
}

.doc-spinner {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid var(--ink-15);
    border-top-color: var(--gold-deep);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -1px;
    animation: doc-spin 0.8s linear infinite;
}

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

/* i18n boot gate: centered spinner shown while MainLayout waits for the
   localization service to load translations before mounting the page body. */
.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.page-loading-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--ink-15);
    border-top-color: var(--gold-deep);
    border-radius: 50%;
    animation: doc-spin 0.8s linear infinite;
}

.doc-info-error {
    margin-top: 4px;
    padding: 6px 8px;
    background: var(--bordeaux-soft);
    border-left: 2px solid var(--bordeaux);
    border-radius: 0;
    font-size: 12px;
    color: var(--ink-700);
    line-height: 1.4;
}

/* Category tags — Prestige : background soft + colored border + ink-900 text.
   font-weight retained 700 (caps tracked from .document-tag base). */
/* Base = neutral fallback so custom firm natures (no dedicated colour) still render as a chip. */
.document-tag.category { font-weight: 700; background: var(--cream-dim); color: var(--ink-700); border: 1px solid var(--ink-15); }
.document-tag.category-to_define      { background: var(--cream-dim);        color: var(--status-warn-text);        border: 1px dashed var(--category-todefine); }
.document-tag.category-contract       { background: var(--expertise-soft);   color: var(--ink-900); border-color: var(--category-contract); }
.document-tag.category-correspondence { background: var(--gold-soft);        color: var(--ink-900); border-color: var(--category-correspondence); }
.document-tag.category-financial      { background: var(--status-success-soft); color: var(--ink-900); border-color: var(--status-success); }
.document-tag.category-technical      { background: var(--contentieux-soft); color: var(--ink-900); border-color: var(--contentieux); }
.document-tag.category-judicial       { background: var(--bordeaux-soft);    color: var(--ink-900); border-color: var(--category-judicial); }
.document-tag.category-expertise      { background: var(--gold-soft);        color: var(--ink-900); border-color: var(--gold-deep); }
.document-tag.category-evidence       { background: var(--contentieux-soft); color: var(--ink-900); border-color: var(--category-evidence); }
.document-tag.category-other          { background: var(--cream-dim);        color: var(--ink-700); border-color: var(--ink-15); }


/* Bande d'actions collée en bas de la tuile — full-width, fond gold-soft
   (= --doctype-img-bg : même teinte que la pastille de type de document),
   séparée du contenu par une hairline. Les .document-card sont en flex column
   + .document-info flex:1 pour pousser cette bande tout en bas → alignement
   uniforme entre les tuiles d'une même rangée. */
.document-actions {
    margin-top: auto;
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    padding: 8px var(--space-sm);
    background: var(--gold-soft);
    border-top: 1px solid var(--ink-15);
}

/* Boutons icon-only sur la bande dorée — sans bordure au repos, couleur
   gold-deep ; fond blanc + bordure au hover. Labels masqués systématiquement
   (les data-tooltip donnent le libellé). La classe .is-icon-only sur
   Télécharger / Supprimer est devenue redondante mais reste tolérée. */
.document-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 7px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    color: var(--gold-deep-text);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.document-action-label { display: none; }

.document-action:hover {
    background: var(--white);
    border-color: var(--gold-deep);
    color: var(--gold-deep-text);
    text-decoration: none;
}

.document-action.danger { color: var(--bordeaux); }
.document-action.danger:hover {
    background: var(--white);
    border-color: var(--bordeaux);
    color: var(--bordeaux);
}

.document-action svg { width: 16px; height: 16px; stroke-width: 1.75; }

/* Filter sidebar */
.documents-content-fullwidth {
    width: 100%;
}

/* Filter drawer (slides from right) — Prestige editorial */
.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.filter-toggle-badge {
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    border-radius: 0;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    line-height: 1.4;
}

.filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 41, 55, 0.4);
    z-index: 900;
    animation: confirm-fade-in 150ms ease-out;
}

.filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 360px;
    max-width: 90vw;
    background: var(--cream);
    border-left: 1px solid var(--ink-15);
    box-shadow: -8px 0 24px rgba(31, 41, 55, 0.12);
    transform: translateX(100%);
    /* a11y 5.17 : visibility:hidden retire le panneau fermé du tab order et de
       l'arbre AT (sinon ses contrôles restent focusables hors-écran). Le délai
       sur visibility conserve l'animation de fermeture. */
    visibility: hidden;
    transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 220ms;
    display: flex;
    flex-direction: column;
    z-index: 901;
}

.filter-drawer.open { transform: translateX(0); visibility: visible; transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s; }

.filter-drawer-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    background: var(--cream);
}

.filter-drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

.filter-drawer-title svg { color: var(--gold-deep); stroke-width: 1.5; }

.filter-drawer-count {
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    border-radius: 0;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    font-family: var(--font-sans);
}

.filter-drawer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-drawer-clear {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ink-900);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 0;
    transition: border-color 0.12s ease;
}

.filter-drawer-clear:hover {
    background: transparent;
    border-color: var(--gold);
}

.filter-drawer-close {
    background: transparent;
    border: 1px solid var(--ink-15);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 0;
    color: var(--ink-700);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s ease, color 0.12s ease;
}

.filter-drawer-close:hover {
    background: transparent;
    border-color: var(--ink-900);
    color: var(--ink-900);
}

.filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.filter-section { margin-bottom: var(--space-md); }
.filter-section:last-child { margin-bottom: 0; }

.filter-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-options { display: flex; flex-direction: column; gap: 4px; }

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.12s ease;
}

.filter-option:hover { background: var(--cream-dim); }

.filter-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--ink-900);
    margin: 0;
}

.filter-option label {
    font-size: 13px;
    color: var(--ink-700);
    cursor: pointer;
    flex: 1;
}

.filter-option .count {
    font-size: 11px;
    color: var(--ink-400);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
   PDF Viewer (V2 - PDF.js based)
   ============================================================================ */

.viewer-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.viewer-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 1200px) {
    .viewer-layout { grid-template-columns: 1fr; }
    .annotation-panel { display: none; }
}

/* ============================================================================
   Document Viewer (5.40 sub-livraison 2.3e suite, Prestige native)
   Wireframe : 04-viewer.html
   Charcoal canvas (ink-900) + gold accents (sceau de cire) + cream typography.
   ============================================================================ */

.viewer-main {
    display: flex;
    flex-direction: column;
    background: var(--ink-900);
    min-height: 0;
    overflow: hidden;
}

.viewer-toolbar {
    background: var(--ink-900);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(253, 251, 247, 0.1);
    gap: var(--space-sm);
    flex-wrap: nowrap;
}

.viewer-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1 1 0;
}

.viewer-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cream);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease;
}

.viewer-back:hover { color: var(--gold); border-bottom-color: var(--gold); text-decoration: none; }
.viewer-back svg { width: 14px; height: 14px; stroke-width: 1.75; }

.viewer-doc-info {
    padding-left: var(--space-sm);
    border-left: 1px solid rgba(253, 251, 247, 0.15);
    min-width: 0;
    flex: 1 1 0;
}

.viewer-doc-name {
    font-family: var(--font-serif);
    color: var(--cream);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.005em;
    margin-bottom: 4px;
    min-width: 0;
}

.viewer-doc-meta {
    color: var(--ink-500);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.viewer-doc-badge {
    background: var(--gold);
    color: var(--ink-900);
    padding: 2px 8px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
}

.viewer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.viewer-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(253, 251, 247, 0.15);
    background: transparent;
    border-radius: 0;
    color: var(--ink-400);
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    text-decoration: none;
}

.viewer-tool-btn:hover {
    border-color: var(--gold);
    color: var(--cream);
    background: rgba(205, 180, 122, 0.08);
    text-decoration: none;
}

.viewer-tool-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--ink-900);
}

.viewer-tool-btn svg { width: 14px; height: 14px; stroke-width: 1.5; }

.viewer-category-label {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-divider {
    width: 1px;
    height: 24px;
    background: rgba(253, 251, 247, 0.15);
    margin: 0 4px;
}

.viewer-content {
    flex: 1;
    overflow: auto;
    background: var(--ink-900);
    padding: var(--space-md);
}

/* PDF.js container */
.pdf-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-height: 100%;
}

.pdf-page {
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    background: var(--white);
    line-height: 0;
    border-radius: 0;
    overflow: hidden;
}

.pdf-page canvas { display: block; max-width: 100%; }

.pdf-page-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.pdf-page-markers .annotation-rect {
    pointer-events: auto;
}

.pdf-page-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    background: rgba(253, 251, 247, 0.02);
}

/* Image viewer */
.image-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    cursor: default;
    padding: 24px;
    min-height: 100%;
}

.image-frame.drawing-active { cursor: crosshair; }

.image-page {
    position: relative;
    display: inline-block;
    line-height: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    background: var(--white);
}

.image-page img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.image-page-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.image-page-markers .annotation-rect {
    pointer-events: auto;
}

.image-page-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    background: rgba(253, 251, 247, 0.02);
}

/* Annotation rectangle styling */
.annotation-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    background: rgba(253, 251, 247, 0.02);
}

.annotation-rect-draft {
    position: absolute;
    border: 2px dashed var(--gold);
    background: rgba(205, 180, 122, 0.18);
    pointer-events: none;
}

.annotation-rect {
    position: absolute;
    border: 2px solid;
    cursor: pointer;
    transition: filter 0.15s, box-shadow 0.15s;
    pointer-events: auto;
}

.annotation-rect:hover { filter: brightness(1.08); }
.annotation-rect.is-selected { box-shadow: 0 0 0 3px rgba(205, 180, 122, 0.45); }

.annotation-marker {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 2px 4px 0 rgba(31, 41, 55, 0.25);
    z-index: 2;
    pointer-events: auto;
}

/* Annotation panel (right side) — Prestige editorial cream */
.annotation-panel {
    background: var(--cream);
    border-left: 1px solid var(--ink-15);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.annotation-header {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.annotation-title {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.annotation-title svg { width: 16px; height: 16px; color: var(--gold-deep); stroke-width: 1.5; }

.annotation-count {
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    padding: 2px 8px;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
}

.annotation-tabs {
    display: flex;
    border-bottom: 1px solid var(--ink-15);
    background: var(--cream);
}

.annotation-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-500);
    cursor: pointer;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    transition: color 0.12s ease, border-color 0.12s ease;
}

.annotation-tab:hover { color: var(--ink-900); }

.annotation-tab.active {
    color: var(--ink-900);
    border-bottom-color: var(--gold);
    font-weight: 700;
}

.annotation-list { flex: 1; overflow-y: auto; padding: var(--space-sm); }

.doc-info-scroll { flex: 1; overflow-y: auto; min-height: 0; }

.annotation-item {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: var(--space-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.annotation-item:hover {
    border-color: var(--ink-900);
    box-shadow: none;
}

.annotation-item.selected,
.annotation-item.active {
    border-color: var(--gold);
    background: var(--gold-soft);
}

/* Separateur "Toutes les annotations (N)" entre le bloc detail/edit/create actif (en haut)
   et la liste des autres annotations. Pattern texte centre + filets horizontaux pour casser
   la continuite visuelle qui fondait le bloc actif dans la liste (UX v1.24). */
.annotation-list-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    margin: var(--space-sm) 0 12px;
    color: var(--ink-500);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}
.annotation-list-divider::before,
.annotation-list-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ink-15);
}
.annotation-list-divider span {
    flex-shrink: 0;
}

.annotation-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.annotation-number {
    width: 24px;
    height: 24px;
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.annotation-item-meta { font-size: 11px; color: var(--ink-500); }

.annotation-quote {
    font-family: var(--font-serif);
    font-size: 13px;
    font-style: italic;
    color: var(--ink-700);
    padding: 10px 12px;
    background: var(--gold-tint);
    border-left: 3px solid var(--gold);
    margin-bottom: 10px;
    border-radius: 0;
    white-space: pre-line;
    line-height: 1.5;
}

.annotation-note { font-size: 13px; color: var(--ink-900); margin-bottom: 10px; line-height: 1.5; }

.annotation-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--ink-500);
}

.annotation-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 0;
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 9px;
    font-weight: 600;
}

.annotation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.annotation-tag {
    padding: 3px 8px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}

/* Annotation tag variants — sharp caps + soft bg + colored 1px border */
.annotation-tag.fact          { background: var(--ann-fact-mark);          color: var(--ann-fact);          border-color: var(--ann-fact); }
.annotation-tag.quote         { background: var(--ann-quote-mark);         color: var(--ann-quote);         border-color: var(--ann-quote); }
.annotation-tag.proof         { background: var(--ann-proof-mark);         color: var(--ann-proof);         border-color: var(--ann-proof); }
.annotation-tag.contradiction { background: var(--ann-contradiction-mark); color: var(--ann-contradiction); border-color: var(--ann-contradiction); }
.annotation-tag.amount        { background: var(--ann-amount-mark);        color: var(--gold-deep-text);    border-color: var(--ann-amount); }
.annotation-tag.keydate       { background: var(--ann-keydate-mark);       color: var(--status-warn-text);  border-color: var(--ann-keydate); }
.annotation-tag.actor         { background: var(--ann-actor-mark);         color: var(--ann-actor);         border-color: var(--ink-15); }
.annotation-tag.legalargument { background: var(--ann-legalargument-mark); color: var(--status-info-text);  border-color: var(--status-info); }
.annotation-tag.other         { background: var(--ann-other-mark);         color: var(--ann-other);         border-color: var(--ink-15); }
.annotation-tag.key           { background: var(--gold-soft);              color: var(--gold-deep-text);         border-color: var(--gold); }

.annotation-read-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.annotation-read-quote {
    background: var(--gold-tint);
    border-left: 3px solid var(--gold);
    padding: 10px 12px;
    border-radius: 0;
    font-family: var(--font-serif);
    font-size: 13px;
    font-style: italic;
    color: var(--ink-700);
    line-height: 1.5;
    margin-top: 4px;
}
.annotation-read-content {
    font-size: 13px;
    color: var(--ink-900);
    line-height: 1.5;
    margin-top: 4px;
    white-space: pre-wrap;
}
.annotation-read-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-900);
    margin-top: 4px;
}

.annotation-form {
    padding: var(--space-sm);
    border-top: 1px solid var(--ink-15);
    background: var(--cream-dim);
}

.annotation-form-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    margin-bottom: 12px;
}

.annotation-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.annotation-form-actions .btn {
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.annotation-form-actions .btn-primary,
.annotation-form-actions .btn:not(.btn-primary):not(.btn-danger) {
    flex: 1 1 auto;
}

.annotation-form-actions .btn-danger {
    flex: 1 1 100%;
}

.annotation-form-actions.compact {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
}

.annotation-form-actions.compact .icon-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.annotation-form-actions.compact .icon-btn svg { width: 16px; height: 16px; }

.icon-btn.icon-btn-primary {
    background: var(--gold);
    color: var(--ink-900);
    border-color: var(--gold);
}

.icon-btn.icon-btn-primary:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
    color: var(--ink-900);
}

.icon-btn.icon-btn-danger {
    color: var(--bordeaux);
    border-color: var(--ink-15);
}

.icon-btn.icon-btn-danger:hover {
    background: var(--bordeaux);
    color: var(--white);
    border-color: var(--bordeaux);
}

/* Doc info grid */
.doc-info-section {
    padding: var(--space-sm);
    border-top: 1px solid var(--ink-15);
}

.doc-info-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    margin-bottom: 12px;
}

.doc-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.doc-info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold-deep-text);
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    margin-bottom: 2px;
}

.doc-info-value {
    font-size: 13px;
    color: var(--ink-900);
    font-weight: 500;
}

/* Annotation type color tokens (region rectangles use same palette).
   Soft pastel mark backgrounds via :root --ann-*-mark + colored border. */
.ann-fact          { border-color: var(--ann-fact);          background-color: var(--ann-fact-mark); }
.ann-quote         { border-color: var(--ann-quote);         background-color: var(--ann-quote-mark); }
.ann-proof         { border-color: var(--ann-proof);         background-color: var(--ann-proof-mark); }
.ann-contradiction { border-color: var(--ann-contradiction); background-color: var(--ann-contradiction-mark); }
.ann-amount        { border-color: var(--ann-amount);        background-color: var(--ann-amount-mark); }
.ann-keydate       { border-color: var(--ann-keydate);       background-color: var(--ann-keydate-mark); }
.ann-actor         { border-color: var(--ann-actor);         background-color: var(--ann-actor-mark); }
.ann-legal         { border-color: var(--status-info);       background-color: var(--ann-legalargument-mark); }
.ann-other         { border-color: var(--ann-other);         background-color: var(--ann-other-mark); }

/* Override des backgrounds sur les rectangles d'annotation du viewer PDF/image —
   les variables --ann-{type}-mark sont des pastels solides pensés pour les <mark>
   du viewer email (lisibilité sur fond blanc). Sur une zone qui se superpose au
   contenu d'un PDF, ils masquent le texte en-dessous. On utilise des rgba alpha
   bas dérivés de la couleur de bordure pour garder le repère visuel sans cacher
   le contenu. La bordure reste opaque pour bien délimiter la zone. */
.annotation-rect.ann-fact          { background-color: rgba(122, 159, 176, 0.20); }
.annotation-rect.ann-quote         { background-color: rgba(161, 144, 184, 0.20); }
.annotation-rect.ann-proof         { background-color: rgba(110, 144, 121, 0.20); }
.annotation-rect.ann-contradiction { background-color: rgba(155, 58, 74, 0.18); }
.annotation-rect.ann-amount        { background-color: rgba(167, 137, 71, 0.20); }
.annotation-rect.ann-keydate       { background-color: rgba(181, 149, 84, 0.20); }
.annotation-rect.ann-actor         { background-color: rgba(55, 65, 81, 0.12); }
.annotation-rect.ann-legal         { background-color: rgba(122, 159, 176, 0.18); }
.annotation-rect.ann-other         { background-color: rgba(107, 114, 128, 0.12); }

/* ============================================================================
   Empty states
   ============================================================================ */

/* ============================================================================
   EMPTY STATE — Prestige (sharp icon container, Newsreader title)
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-sm);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-sm);
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 36px;
    height: 36px;
    color: var(--ink-500);
    stroke-width: 1.25;
}

.empty-state-title {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.empty-state-text {
    font-size: var(--body-sm-size);
    color: var(--ink-500);
    margin-bottom: var(--space-sm);
}

.empty-state.compact { padding: 28px 20px; }

.empty-state.compact .empty-state-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    background: transparent;
    border: none;
}

.empty-state.compact .empty-state-icon svg {
    width: 28px;
    height: 28px;
    color: var(--ink-400);
}

.empty-state.compact .empty-state-title {
    font-family: var(--font-sans);
    font-size: var(--body-sm-size);
    font-weight: 600;
    color: var(--ink-500);
    margin-bottom: 14px;
}

.empty-state.compact .btn {
    font-size: 13px;
    padding: 6px 14px;
}

/* ============================================================================
   Animations
   ============================================================================ */

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

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

.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }

.animate-stagger > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.10s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.20s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.30s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.40s; }

/* Loading spinner (existing from index.html) */
.loading-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
}

.loading-progress circle {
    fill: none;
    stroke: var(--ink-900);
    stroke-width: 3;
    stroke-dasharray: 251.32;
    stroke-dashoffset: 251.32;
    transform-origin: 50% 50%;
    animation: progress 2s linear infinite;
}

@keyframes progress {
    0% { stroke-dashoffset: 251.32; transform: rotate(0); }
    100% { stroke-dashoffset: 0; transform: rotate(360deg); }
}

.loading-progress-text {
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: var(--ink-500);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bordeaux);
    color: var(--white);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sharp);
    z-index: 1000;
}

#blazor-error-ui .dismiss,
#blazor-error-ui .reload {
    margin-left: 12px;
    cursor: pointer;
    color: var(--white);
}

/* ============================================================================
   RESPONSIVE — Tablet shell (5.14, iPad 1024x768 priority)
   <=1024px: the parchment sidebar becomes an off-canvas drawer (hidden by
   default, slid in over a backdrop via the .mobile-topbar hamburger); the
   main content takes the full width. Desktop (>=1025px) is untouched —
   the .sidebar.collapsed icon-rail is gated above to >=1025px.
   ============================================================================ */

@media (max-width: 1024px) {
    /* Sidebar -> off-canvas drawer */
    .sidebar {
        transform: translateX(-100%);
        /* a11y 5.17 : hors-écran = retiré du tab order (visibility:hidden). */
        visibility: hidden;
        transition: transform 0.25s ease, box-shadow 0.25s ease, visibility 0s linear 0.25s;
        box-shadow: none;
    }
    .app-container.drawer-open .sidebar {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.25s ease, box-shadow 0.25s ease, visibility 0s;
        box-shadow: 4px 0 28px rgba(31, 41, 55, 0.20);
    }
    .app-container.drawer-open .sidebar-backdrop { display: block; }

    /* Main content spans the full width (no sidebar gutter) */
    .main-content,
    .sidebar.collapsed ~ .main-content,
    .app-container.sidebar-collapsed .main-content { margin-left: 0; }

    /* The in-sidebar collapse toggle has no role in drawer mode */
    .sidebar-toggle { display: none; }

    /* Mobile topbar (hamburger + logo) — replaces the absent page-level chrome
       for reaching the drawer. Sticky so it stays reachable while scrolling. */
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        height: 56px;
        padding: 0 16px;
        background: var(--cream);
        border-bottom: 1px solid var(--ink-15);
        position: sticky;
        top: 0;
        z-index: 80;
        flex-shrink: 0;
    }
    .mobile-topbar-toggle {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 1px solid var(--ink-15);
        border-radius: 0;
        color: var(--ink-900);
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.12s ease, border-color 0.12s ease;
    }
    .mobile-topbar-toggle:hover { background: var(--ink-04); border-color: var(--ink-900); }
    .mobile-topbar-toggle svg { width: 20px; height: 20px; stroke-width: 1.75; }
    .mobile-topbar .logo { gap: 10px; }
    .mobile-topbar .logo-icon { width: 30px; height: 30px; font-size: 17px; }
    .mobile-topbar .logo-text { display: inline; font-size: 19px; }

    /* The page-level .header / standalone toolbar already carry their own
       breadcrumb/title — keep them, just trim the side margins on tablet. */
    .header { padding: var(--space-sm) var(--space-md); }
    .search-box { width: 200px; }
}

@media (max-width: 640px) {
    .page-content { padding: 16px; }
    .header { padding: 12px 16px; }
    .header-actions .search-box { display: none; }
    .documents-header { padding: 16px; }
    .tab-nav { padding: 0 16px; }
    .viewer-doc-info { display: none; }
    .mobile-topbar { padding: 0 12px; }
}

/* ==========================================================================
   Confirm Dialog (5.40 sub-livraison 2.2a — Prestige modal foundation)
   Sharp 0px radius, cream-dim icon nest with ink-15 border, ink scale on text,
   bordeaux variant for danger. No backdrop blur (Prestige sober).
   ========================================================================== */

.confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 41, 55, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: confirm-fade-in 120ms ease-out;
}

.confirm-card {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    box-shadow: var(--shadow-sharp);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: confirm-slide-in 160ms ease-out;
}

.confirm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0 24px;
}

.confirm-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    color: var(--ink-900);
}

.confirm-header.danger .confirm-icon {
    background: var(--bordeaux-soft);
    border-color: var(--bordeaux);
    color: var(--bordeaux);
}

.confirm-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--ink-900);
}

.confirm-body {
    padding: 12px 24px 20px 24px;
}

.confirm-message {
    margin: 0;
    color: var(--ink-700);
    font-size: 15px;
    line-height: 1.55;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--ink-15);
    background: var(--cream-dim);
}

.confirm-actions .btn {
    min-width: 90px;
}

@keyframes confirm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes confirm-slide-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.category-dialog { max-width: 480px; }

/* Upload modal — wider than confirm-card default to fit two side-by-side
   "select files" / "select folder" buttons without wrapping. */
.upload-dialog { max-width: 560px; }

.upload-dialog-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.upload-dialog-actions .btn {
    flex: 1 1 220px;
    justify-content: center;
}

.category-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
    /* Cap the list height so a firm with many custom natures scrolls the options
       instead of pushing the header/actions out of the viewport. */
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 2px;
}

.category-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-700);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.category-option:hover {
    border-color: var(--ink-900);
    color: var(--ink-900);
}

.category-option.selected {
    background: var(--cream-dim);
    border-color: var(--gold);
    color: var(--ink-900);
    font-weight: 600;
}

.category-option svg {
    flex-shrink: 0;
    color: var(--gold-deep);
}

.category-option-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Row wrapping an option + an optional delete button (custom natures only). */
.category-option-row { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.category-option-row .category-option { flex: 1; min-width: 0; }
.category-option-delete {
    flex-shrink: 0; width: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ink-15); background: var(--white); color: var(--ink-400);
    cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease;
}
.category-option-delete:hover { color: var(--bordeaux); border-color: var(--bordeaux); }

/* Upload modal: nature select + "add new nature" button on one row. */
.upload-category-row { display: flex; gap: 8px; align-items: stretch; }
.upload-category-row .form-select { flex: 1; min-width: 0; }
.upload-category-add { flex-shrink: 0; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; }

/* Create-on-the-fly inside the category picker dialog. */
.category-add-trigger {
    margin-top: 10px; width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px; background: transparent; border: 1px dashed var(--ink-15);
    color: var(--gold-deep); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.category-add-trigger:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--ink-900); }
.category-add-trigger svg { width: 16px; height: 16px; }
.category-add-row { margin-top: 10px; display: flex; gap: 8px; align-items: stretch; }
.category-add-row .form-input { flex: 1; min-width: 0; }
.category-add-error { margin: 8px 0 0; font-size: 12px; color: var(--bordeaux); }

/* Batch categorize wizard (5.40 sub-livraison 2.2c — Prestige) */
.batch-dialog { max-width: 560px; }

.batch-header {
    padding: 20px 24px 12px 24px;
    border-bottom: 1px solid var(--ink-15);
}

.batch-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.batch-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--ink-900);
}

.batch-close {
    background: transparent;
    border: none;
    color: var(--ink-500);
    cursor: pointer;
    padding: 4px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.batch-close:hover {
    background: var(--ink-15);
    color: var(--ink-900);
}

.batch-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ink-500);
    margin-bottom: 6px;
}

.batch-progress-applied { color: var(--gold-deep-text); font-weight: 600; }

.batch-progress {
    width: 100%;
    height: 4px;
    background: var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

.batch-progress-bar {
    height: 100%;
    background: var(--gold);
    transition: width 0.3s ease;
}

.batch-body {
    padding: 20px 24px;
}

.batch-doc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-radius: 0;
}

.batch-doc-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
}

.batch-doc-icon.pdf { background: var(--doctype-pdf-bg); color: var(--doctype-pdf-fg-strong); }
.batch-doc-icon.img { background: var(--doctype-img-bg); color: var(--doctype-img-fg-strong); }
.batch-doc-icon.doc { background: var(--doctype-doc-bg); color: var(--doctype-doc-fg-strong); }
.batch-doc-icon.xls { background: var(--doctype-xls-bg); color: var(--doctype-xls-fg-strong); }
.batch-doc-icon.email { background: var(--doctype-email-bg); color: var(--doctype-email-fg-strong); }
.batch-doc-icon.other { background: var(--ink-15); color: var(--ink-700); }

.batch-doc-info {
    flex: 1;
    min-width: 0;
}

.batch-doc-name {
    font-weight: 600;
    color: var(--ink-900);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-doc-meta {
    display: flex;
    gap: 6px;
    color: var(--ink-500);
    font-size: 12px;
    margin-top: 2px;
}

.batch-hint {
    margin: 16px 0 8px 0;
    font-size: 13px;
    color: var(--ink-700);
    font-weight: 500;
}

/* ==========================================================================
   Email viewer (5.40 sub-livraison 2.2f — Prestige editorial)
   ========================================================================== */

.email-viewer {
    width: 100%;
    min-height: 100%;
    padding: 32px;
    background: var(--cream);
    box-sizing: border-box;
}

.email-loading,
.email-error {
    color: var(--ink-500);
    padding: 32px;
    text-align: center;
}

.email-error { color: var(--bordeaux); }

.email-card {
    background: var(--white);
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    box-shadow: var(--shadow-sharp);
}

.email-header {
    padding: 24px 32px 20px 32px;
    border-bottom: 1px solid var(--ink-15);
    background: var(--white);
}

.email-subject {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink-900);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.email-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.email-meta-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 13px;
}

.email-meta-label {
    flex-shrink: 0;
    width: 50px;
    color: var(--ink-500);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: var(--label-caps-tracking);
}

.email-meta-value {
    color: var(--ink-700);
    word-break: break-word;
}

.email-body {
    padding: 24px 32px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-700);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.email-body-frame {
    display: block;
    width: 100%;
    min-height: 200px;
    border: none;
    background: var(--white);
}

.email-body-text {
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* Email body content : direct HTML render with Ganss.Xss sanitization. The cosmetic reset
   contains email-injected styles ; <mark> highlights apply per-AnnotationType via the
   ann-* tokens (consistent with PDF/image annotations). */
.email-body-content {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-700);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.email-body-content img { max-width: 100%; height: auto; }
/* Image distante bloquee (cf. EmailParserService.NeutralizeRemoteImages) : le src a ete retire,
   on affiche un placeholder discret en parchemin avec un glyphe « image » plutot qu une icone
   d image cassee. min-* garantit une zone visible meme sans width/height d origine. */
.email-body-content img.df-remote-blocked {
    min-width: 56px;
    min-height: 40px;
    background-color: var(--parchment);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none' stroke='%236b7280' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='1'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    border: 1px dashed var(--ink-300);
}
/* Banniere « Afficher les images » au-dessus du corps quand HasRemoteImages. */
.email-remote-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 0 0 16px;
    background: var(--parchment);
    border: 1px solid var(--ink-15);
    font-size: 13px;
    color: var(--ink-700);
}
.email-remote-banner svg { color: var(--ink-500); flex-shrink: 0; }
.email-remote-banner-text { flex: 1; }
.email-body-content table { max-width: 100%; }
.email-body-content pre { white-space: pre-wrap; font-family: inherit; margin: 0; }
.email-body-content a { color: var(--ink-900); text-decoration-color: var(--gold); text-underline-offset: 2px; }
.email-body-content mark { padding: 1px 2px; border-radius: 0; cursor: pointer; position: relative; }
.email-body-content mark.ann-fact { background: var(--ann-fact-mark); }
.email-body-content mark.ann-quote { background: var(--ann-quote-mark); }
.email-body-content mark.ann-proof { background: var(--ann-proof-mark); }
.email-body-content mark.ann-contradiction { background: var(--ann-contradiction-mark); }
.email-body-content mark.ann-amount { background: var(--ann-amount-mark); }
.email-body-content mark.ann-keydate { background: var(--ann-keydate-mark); }
.email-body-content mark.ann-actor { background: var(--ann-actor-mark); }
.email-body-content mark.ann-legalargument { background: var(--ann-legalargument-mark); }
.email-body-content mark.ann-other { background: var(--ann-other-mark); }
.email-body-content mark:hover { outline: 1px solid var(--gold); }

/* Annotation number badge — sharp pill on ink-900, mirrors the PDF/image marker convention. */
.email-body-content mark[data-annotation-number]::after {
    content: attr(data-annotation-number);
    position: absolute;
    top: -8px;
    left: -8px;
    background: var(--ink-900);
    color: var(--cream);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Hint pedagogique dans le sidebar annotations email : explique a l utilisateur qu il
   doit selectionner du texte pour creer une annotation (la creation par drag-rect comme
   PDF/image n existe pas pour les emails). */
.annotation-hint {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 12px;
    padding: 10px 12px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-left: 3px solid var(--gold);
    border-radius: 0;
    color: var(--ink-700);
    font-size: 12px;
    line-height: 1.45;
}
.annotation-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--gold-deep);
    stroke-width: 1.5;
}
.annotation-hint-compact {
    margin: 8px 12px;
    padding: 6px 10px;
    font-size: 11px;
    background: transparent;
    border: none;
    border-left: 2px solid var(--gold);
    color: var(--ink-500);
}

/* Mode annotations masquees (toggle toolbar) : neutralise visuellement les <mark> et le badge,
   sans modifier le DOM (les marks restent pour preserver position du texte + restoration au
   re-toggle). Le selection capture reste fonctionnel pour creer de nouvelles annotations. */
.email-body-content.annotations-hidden mark { background: transparent; cursor: text; }
.email-body-content.annotations-hidden mark:hover { outline: none; }
.email-body-content.annotations-hidden mark[data-annotation-number]::after { display: none; }

/* Pending highlight (transient during annotation creation, before save). */
.email-body-content mark.ann-pending {
    background: var(--gold-soft);
    box-shadow: 0 0 0 2px var(--gold-tint);
    cursor: text;
}

/* Pulse on click-from-sidebar (scroll + attention). */
.email-body-content mark.ann-focused {
    animation: ann-focus-pulse 1.6s ease-out;
}
@keyframes ann-focus-pulse {
    0% { box-shadow: 0 0 0 0 rgba(205, 180, 122, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(205, 180, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(205, 180, 122, 0); }
}

.email-empty {
    color: var(--ink-500);
    font-style: italic;
}

.email-annotate-fab {
    position: fixed;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--ink-900);
    color: var(--cream);
    border: 1px solid var(--ink-900);
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-sharp);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.email-annotate-fab:hover {
    background: var(--gold);
    color: var(--ink-900);
    border-color: var(--gold);
}

.email-attachments {
    padding: 20px 32px 24px 32px;
    border-top: 1px solid var(--ink-15);
    background: var(--cream-dim);
}

.email-attachments-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-700);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}

.email-attachments-title svg { color: var(--ink-500); }

.email-attachments-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-attachment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
}

.email-attachment-icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}

.email-attachment-info {
    flex: 1;
    min-width: 0;
}

.email-attachment-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-attachment-meta {
    font-size: 11px;
    color: var(--ink-500);
    margin-top: 2px;
}

.email-attachment .btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
}

/* Event form */

.form-banner.error {
    background: var(--bordeaux-soft);
    border: 1px solid var(--bordeaux);
    color: var(--bordeaux);
    padding: 0.75rem 1rem;
    border-radius: 0;
    margin-bottom: 1rem;
    font-size: 14px;
}

.form-hint {
    font-size: 13px;
    color: var(--ink-500);
    font-style: italic;
    margin-bottom: 1rem;
}

.form-hint-inline {
    font-size: 12px;
    color: var(--ink-500);
    font-weight: 400;
    margin-left: 0.5rem;
}

.importance-value {
    float: right;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

.importance-slider {
    width: 100%;
    height: 4px;
    border-radius: 0;
    background: var(--ink-15);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.importance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: var(--gold);
    cursor: pointer;
    border: 1px solid var(--ink-900);
}

.importance-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: var(--gold);
    cursor: pointer;
    border: 1px solid var(--ink-900);
}

.pill-toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill-toggle {
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    padding: 6px 12px;
    border: 1px solid var(--ink-15);
    background: transparent;
    color: var(--ink-700);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.pill-toggle:hover { background: var(--cream-dim); border-color: var(--ink-900); color: var(--ink-900); }
.pill-toggle.selected {
    background: var(--ink-900);
    color: var(--cream);
    border-color: var(--ink-900);
    font-weight: 700;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: var(--white);
    overflow: hidden;
}

.checkbox-list.scrollable {
    max-height: 320px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--ink-15);
    transition: background 0.12s ease;
}

.checkbox-item:last-child { border-bottom: none; }
.checkbox-item:hover { background: var(--cream-dim); }
.checkbox-item.selected { background: var(--gold-soft); }

.checkbox-item input[type="checkbox"] {
    accent-color: var(--ink-900);
    flex-shrink: 0;
}

.checkbox-item-prefix {
    font-size: 11px;
    color: var(--gold-deep-text);
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    flex-shrink: 0;
}

.checkbox-item-name {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-900);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.checkbox-item-meta {
    font-size: 11px;
    color: var(--ink-500);
    margin-left: auto;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Tag + Actor managers (5.40 sub-livraison 2.3i — Prestige) */

.color-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    cursor: pointer;
    padding: 0;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.color-swatch:hover { border-color: var(--ink-900); }

.color-swatch.selected {
    border-color: var(--ink-900);
    box-shadow: 0 0 0 2px var(--cream), 0 0 0 3px var(--gold);
}

.color-custom {
    width: 38px;
    height: 26px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    cursor: pointer;
    padding: 0;
    background: none;
}

.tag-preview-row {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    background: var(--cream-dim);
    border: 1px dashed var(--ink-15);
    border-radius: 0;
}

/* Inline loader next to the "Texte extrait" label while server-side
   region OCR is running on a scan PDF (raster + crop + Tesseract). */
.quoted-text-loader {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 400;
    color: var(--ink-500);
    font-style: italic;
}

.quoted-text-wrapper.is-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 120ms ease-out;
}

/* Pill rendering for case tags. Background/foreground/border colors are
   set inline via the tag's hex — this rule only owns size + shape. */
.timeline-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] { accent-color: var(--ink-900); }

.manager-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.manager-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ink-15);
    transition: background 0.12s ease;
}

.manager-item:last-child { border-bottom: none; }
.manager-item:hover { background: var(--cream-dim); }
.manager-item.editing {
    background: var(--cream-dim);
    box-shadow: inset 3px 0 0 var(--gold);
}

.manager-item-meta {
    font-size: 13px;
    color: var(--ink-500);
    margin-top: 2px;
}

.manager-item-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.actor-item { align-items: flex-start; }

/* Avatar = sceau de cire (cohérence avec profile-avatar et gen-moyen-number) */
.actor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0;
    background: var(--ink-900);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: -0.01em;
    flex-shrink: 0;
    text-transform: uppercase;
}

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

.actor-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
    color: var(--ink-900);
}

.filter-date-range {
    display: flex;
    gap: 8px;
}

.filter-date-range .form-group {
    flex: 1;
    margin-bottom: 0;
}

.filter-date-range .form-group label {
    font-size: 11px;
    color: var(--ink-700);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    margin-bottom: 2px;
}

.filter-date-range input[type="date"] {
    font-size: 13px;
    padding: 6px 8px;
}

/* Annotation event link chip */

.annotation-event-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 0;
    background: var(--cream-dim);
    color: var(--ink-900);
    border: 1px solid var(--ink-15);
    text-decoration: none;
    max-width: 180px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.annotation-event-chip:hover {
    background: var(--white);
    border-color: var(--ink-900);
    text-decoration: none;
    color: var(--ink-900);
}

/* Search page (5.40 sub-livraison 2.3i — Prestige editorial) */

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    color: var(--ink-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    font-size: 15.5px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: var(--white);
    color: var(--ink-900);
    font-family: inherit;
    transition: border-color 0.12s ease;
}

.search-input::placeholder { color: var(--ink-400); }
.search-input:focus { outline: none; border-color: var(--ink-900); }

.search-clear {
    position: absolute;
    right: 10px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 0;
    background: var(--ink-15);
    color: var(--ink-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, color 0.12s ease;
}

.search-clear:hover { background: var(--ink-900); color: var(--cream); }

.search-results {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 16px;
}

.search-section {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

.search-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--cream-dim);
    border-bottom: 1px solid var(--ink-15);
}

.search-section-header h2 {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    margin: 0;
}

.search-section-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-700);
    background: var(--white);
    padding: 2px 8px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
}

.search-section-items {
    display: flex;
    flex-direction: column;
}

.search-result {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ink-15);
    color: inherit;
    text-decoration: none;
    transition: background 0.12s ease;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--cream-dim); text-decoration: none; color: inherit; }

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-icon.document   { background: var(--expertise-soft);   color: var(--expertise-text); }
.search-result-icon.event      { background: var(--gold-soft);        color: var(--gold-deep-text); }
.search-result-icon.annotation { background: var(--contentieux-soft); color: var(--contentieux-text); }

.search-result-body { flex: 1; min-width: 0; }

.search-result-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-900);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-snippet {
    font-size: 13px;
    color: var(--ink-700);
    line-height: 1.5;
    margin-bottom: 4px;
}

.search-result-snippet mark {
    background: var(--gold-soft);
    color: var(--ink-900);
    padding: 0 2px;
    border-radius: 0;
    font-weight: 600;
}

.search-result-meta {
    font-size: 11px;
    color: var(--ink-500);
}

/* Document viewer — linked events section */

.doc-info-linked {
    padding: var(--space-sm);
    border-top: 1px solid var(--ink-15);
}

.doc-info-linked-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.doc-info-linked-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.doc-new-event-form {
    margin-top: 10px;
    padding: var(--space-sm);
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-radius: 0;
}

.doc-new-event-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.doc-info-linked-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.doc-linked-event {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 0;
    background: var(--white);
    border: 1px solid var(--ink-15);
    color: var(--ink-900);
    text-decoration: none;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.doc-linked-event:hover {
    background: var(--cream-dim);
    border-color: var(--ink-900);
    text-decoration: none;
    color: var(--ink-900);
}

.doc-linked-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 0;
    flex-shrink: 0;
    background: var(--ink-400);
}

/* Event type accent dots — Prestige semantic mapping (cf. timeline) */
.doc-linked-event-dot[data-type="fact"]           { background: var(--ink-900); }
.doc-linked-event-dot[data-type="document"]       { background: var(--status-success); }
.doc-linked-event-dot[data-type="correspondence"] { background: var(--gold); }
.doc-linked-event-dot[data-type="meeting"]        { background: var(--expertise); }
.doc-linked-event-dot[data-type="decision"]       { background: var(--bordeaux); }
.doc-linked-event-dot[data-type="expertise"]      { background: var(--expertise); }

.doc-linked-event-body {
    flex: 1;
    min-width: 0;
}

.doc-linked-event-title {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-linked-event-meta {
    font-size: 11px;
    color: var(--ink-500);
    margin-top: 2px;
}

/* ============================================================================
   Timeline (Sprint 3) — aligned with wireframes/05-timeline.html
   ============================================================================ */

/* ============================================================================
   Timeline (5.40 sub-livraison 2.3f, Prestige native)
   Wireframe : 05-timeline.html — list + frise views
   Type-of-event en eyebrow caps (vs chip soft+border) — 5.39 delta
   ============================================================================ */

.timeline-page { display: grid; grid-template-columns: 1fr 400px; gap: var(--space-md); align-items: start; }
.timeline-page.frise-mode { grid-template-columns: 1fr; display: flex; flex-direction: column; align-items: stretch; }
.timeline-page.frise-mode .event-detail-panel { display: none; }
.timeline-page.frise-mode .timeline-main { display: flex; flex-direction: column; }

.timeline-main { background: var(--white); border-radius: 0; border: 1px solid var(--ink-15); overflow: hidden; }

.timeline-toolbar {
    padding: 14px var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
    flex-shrink: 0;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* View toggle (Liste / Frise) — sharp segmented (cohérent .view-toggle Documents) */
.view-toggle-pills {
    display: flex;
    background: transparent;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: 0;
}
.view-toggle-pills .view-btn {
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-right: 1px solid var(--ink-15);
    transition: color 0.12s ease, background 0.12s ease;
}
.view-toggle-pills .view-btn:last-child { border-right: none; }
.view-toggle-pills .view-btn:hover { color: var(--ink-900); background: transparent; }
.view-toggle-pills .view-btn.active {
    background: var(--ink-900);
    color: var(--cream);
    box-shadow: none;
}
.view-toggle-pills .view-btn svg { width: 14px; height: 14px; stroke-width: 1.5; }

/* Filter tags (type filters) — sharp Prestige */
.filter-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid var(--ink-15);
    background: transparent;
    color: var(--ink-700);
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
    font-family: inherit;
}
.filter-tag:hover { border-color: var(--ink-900); color: var(--ink-900); }
.filter-tag.active {
    border-color: var(--ink-900);
    background: var(--ink-900);
    color: var(--cream);
}
.filter-tag .dot { width: 8px; height: 8px; border-radius: 0; }

/* Tags filter section (custom user-defined tags) */
.tags-filter-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px var(--space-md);
    border-top: 1px solid var(--ink-15);
    background: var(--cream-dim);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.tags-filter-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    white-space: nowrap;
}
.tags-filter-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--ink-15);
    background: var(--white);
    color: var(--ink-700);
    cursor: pointer;
    transition: border-color 0.12s ease;
}
.tag-filter-btn:hover { border-color: var(--ink-900); }
.tag-filter-btn.active { border-color: currentColor; }
.tag-filter-btn .tag-dot { width: 6px; height: 6px; border-radius: 0; }

/* Timeline content — chronologie verticale */
.timeline-content { padding: var(--space-md); }
.timeline-year-group { margin-bottom: var(--space-md); }
.timeline-year-group:last-child { margin-bottom: 0; }
.timeline-year-header { display: flex; align-items: center; gap: 16px; margin-bottom: var(--space-sm); }

/* Year badge — sceau de cire charcoal/or (signature Prestige) */
.year-badge {
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    padding: 4px 12px;
    border-radius: 0;
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.year-line { flex: 1; height: 1px; background: var(--ink-15); }

/* Timeline events — editorial vertical rail */
.timeline-events { position: relative; padding-left: 28px; }
.timeline-events::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--ink-15);
}

.timeline-event {
    display: block;
    position: relative;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    color: inherit;
    text-decoration: none;
}
.timeline-event:hover {
    border-color: var(--ink-900);
    background: var(--cream-dim);
    box-shadow: none;
    transform: none;
    color: inherit;
    text-decoration: none;
}
.timeline-event.selected {
    border-color: var(--gold);
    background: var(--gold-soft);
    box-shadow: none;
}

/* Event marker on rail — sharp 14×14 (vs circle 12, ::before square) */
.timeline-event::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 0;
    background: var(--white);
    border: 1px solid var(--ink-700);
}

/* Event type semantic mapping (cohérent wireframe + DocumentViewer linked-event) */
.timeline-event.fact::before          { background: var(--ink-900);        border-color: var(--ink-900); }
.timeline-event.document::before      { background: var(--status-success); border-color: var(--status-success); }
.timeline-event.correspondence::before{ background: var(--gold);           border-color: var(--gold-deep); }
.timeline-event.meeting::before       { background: var(--expertise);      border-color: var(--expertise); }
.timeline-event.decision::before      { background: var(--bordeaux);       border-color: var(--bordeaux); }
.timeline-event.expertise::before     { background: var(--expertise);      border-color: var(--expertise); }
.timeline-event.other::before         { background: var(--ink-400);        border-color: var(--ink-400); }

.event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.event-date {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--gold-deep-text);
}

/* Event type badge — EYEBROW caps coloré (sans fill ni border, 5.39 delta).
   Distingue le type structurel des custom-tags annotation chip. */
.event-type-badge {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    white-space: nowrap;
}
.event-type-badge.fact          { color: var(--ink-900); }
.event-type-badge.document      { color: var(--status-success-text); }
.event-type-badge.correspondence{ color: var(--gold-deep-text); }
.event-type-badge.meeting       { color: var(--expertise-text); }
.event-type-badge.decision      { color: var(--bordeaux); }
.event-type-badge.expertise     { color: var(--expertise-text); }
.event-type-badge.other         { color: var(--ink-500); }

.event-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
.event-description {
    font-size: 13.5px;
    color: var(--ink-700);
    line-height: 1.5;
    margin-bottom: 10px;
}
.event-footer { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.event-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--ink-500);
}
.event-meta svg { width: 12px; height: 12px; stroke-width: 1.5; }

/* Custom tags — chip soft (vs eyebrow, distinguishe from event-type-badge) */
.custom-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; margin-bottom: 8px; }
.custom-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
}
.custom-tag .tag-dot { width: 6px; height: 6px; border-radius: 0; }

/* Add event button — dashed editorial */
.add-event-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: 1px dashed var(--ink-15);
    border-radius: 0;
    background: transparent;
    color: var(--ink-700);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
    margin-top: 8px;
    text-decoration: none;
}
.add-event-btn:hover {
    border-color: var(--ink-900);
    color: var(--ink-900);
    background: var(--cream-dim);
    text-decoration: none;
}
.add-event-btn svg { width: 16px; height: 16px; stroke-width: 1.5; }

.timeline-empty-inline { text-align: center; padding: var(--space-lg) var(--space-md); color: var(--ink-500); }
.timeline-empty-inline svg { color: var(--ink-400); margin-bottom: 12px; stroke-width: 1.25; }
.timeline-empty-inline h3 {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.timeline-empty-inline p { max-width: 360px; margin: 0 auto; font-size: 13px; }

/* Event detail panel (right side in list mode) — Prestige editorial cream */

.event-detail-panel {
    background: var(--cream);
    border-radius: 0;
    border: 1px solid var(--ink-15);
    position: sticky;
    top: var(--space-md);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}
.event-detail-panel.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg) var(--space-md);
    color: var(--ink-500);
    font-size: 13px;
    text-align: center;
}
.event-detail-panel.empty-state svg {
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    color: var(--ink-300);
    stroke-width: 1.25;
}

.detail-header { padding: var(--space-md); border-bottom: 1px solid var(--ink-15); background: var(--cream); }
.detail-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.detail-date {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--gold-deep-text);
}
.detail-actions { display: flex; gap: 6px; }
.detail-actions .icon-btn { width: 32px; height: 32px; }
.detail-actions .icon-btn svg { width: 14px; height: 14px; stroke-width: 1.5; }

.detail-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 500;
    color: var(--ink-900);
    margin-bottom: 8px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* Detail type — eyebrow caps (vs chip), cohérent .event-type-badge */
.detail-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
}
.detail-type .type-dot { width: 8px; height: 8px; border-radius: 0; }

.detail-body { padding: var(--space-md); }
.detail-section { margin-bottom: var(--space-md); }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-section-title svg { width: 14px; height: 14px; color: var(--gold-deep); stroke-width: 1.5; }
.detail-description { font-size: 14px; color: var(--ink-700); line-height: 1.7; white-space: pre-wrap; }

/* Linked documents in detail panel — editorial sharp */
.linked-docs { display: flex; flex-direction: column; gap: 6px; }
.linked-doc {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    text-decoration: none;
    color: inherit;
}
.linked-doc:hover {
    background: var(--cream-dim);
    border-color: var(--ink-900);
    text-decoration: none;
    color: inherit;
}
/* .doc-icon / .doc-info / .doc-name / .doc-meta also defined in 02-dossier-overview block.
   Kept here for linked-doc context (different sizes). Variants .pdf/.doc/.xls/.img/.eml/.file
   inherit the global rules from line ~6262+. doc-piece is custom for linked-doc. */
.linked-doc .doc-icon {
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.linked-doc .doc-icon.pdf  { background: var(--doctype-pdf-bg);   color: var(--doctype-pdf-fg);   border-color: var(--doctype-pdf-fg); }
.linked-doc .doc-icon.doc  { background: var(--doctype-doc-bg);   color: var(--doctype-doc-fg);   border-color: var(--doctype-doc-fg); }
.linked-doc .doc-icon.xls  { background: var(--doctype-xls-bg);   color: var(--doctype-xls-fg);   border-color: var(--doctype-xls-fg); }
.linked-doc .doc-icon.img  { background: var(--doctype-img-bg);   color: var(--doctype-img-fg);   border-color: var(--doctype-img-fg); }
.linked-doc .doc-icon.eml  { background: var(--doctype-email-bg); color: var(--doctype-email-fg); border-color: var(--doctype-email-fg); }
.linked-doc .doc-icon.file { background: var(--cream-dim);        color: var(--ink-500);          border-color: var(--ink-15); }
.linked-doc .doc-name {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
}
.linked-doc .doc-meta { font-size: 11px; color: var(--ink-500); }
.linked-doc .doc-piece {
    background: transparent;
    color: var(--gold-deep-text);
    padding: 0;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Linked annotations in detail panel — gold accent border-left */
.linked-annotations { display: flex; flex-direction: column; gap: 6px; }
.linked-annotation {
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    border-left: 3px solid var(--gold);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.linked-annotation:hover {
    background: var(--cream-dim);
    text-decoration: none;
    color: inherit;
}
.annotation-text {
    font-family: var(--font-serif);
    font-size: 13px;
    color: var(--ink-700);
    font-style: italic;
    margin-bottom: 6px;
    line-height: 1.5;
    white-space: pre-wrap;
}
.annotation-comment {
    font-size: 13px;
    color: var(--ink-900);
    margin-bottom: 6px;
    line-height: 1.5;
    white-space: pre-wrap;
}
.linked-annotation-doc {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    color: var(--gold-deep-text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}
.linked-annotation-doc svg { width: 11px; height: 11px; flex-shrink: 0; stroke-width: 1.5; }
.linked-annotation-doc-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
}
.linked-annotation-doc-piece {
    background: transparent;
    color: var(--gold-deep-text);
    padding: 0;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    flex-shrink: 0;
}
.annotation-meta-row { font-size: 11px; color: var(--ink-500); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.annotation-type-pill {
    background: transparent;
    color: var(--ink-900);
    padding: 0;
    border: none;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
}
.annotation-key-pill {
    background: var(--gold-soft);
    color: var(--gold-deep-text);
    padding: 2px 6px;
    border: 1px solid var(--gold);
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.annotation-key-pill svg { width: 10px; height: 10px; }

/* Actors list — sharp chip cohérent .actor-chip */
.actors-list { display: flex; flex-wrap: wrap; gap: 6px; }
.actor-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-size: 12px;
    color: var(--ink-700);
}
/* .actor-dot — keep at line 5307 base + Timeline-specific overrides */
.actor-dot { width: 8px; height: 8px; border-radius: 0; background: var(--ink-400); }
.actor-dot.client     { background: var(--expertise); }
.actor-dot.party      { background: var(--expertise); }
.actor-dot.plaintiff  { background: var(--ink-900); }
.actor-dot.defendant  { background: var(--bordeaux); }
.actor-dot.intervening{ background: var(--gold); }
.actor-dot.tribunal   { background: var(--ink-900); }

.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
}
.detail-tag .tag-dot { width: 6px; height: 6px; border-radius: 0; }

/* ============================================================================
   Timeline frise (horizontal view) — aligned with wireframe 05-timeline.html
   Charcoal markers / cream-dim canvas / sceau de cire year-label.
   ============================================================================ */

.timeline-horizontal { display: flex; flex-direction: column; }

.frise-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    background: var(--cream);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Zoom group — sharp segmented (cohérent .view-toggle-pills) */
.zoom-group {
    display: flex;
    align-items: center;
    gap: 0;
    background: transparent;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: 0;
}
.zoom-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-500);
    transition: color 0.12s ease, background 0.12s ease;
}
.zoom-btn:hover:not(:disabled) { background: var(--cream-dim); color: var(--ink-900); }
.zoom-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.zoom-btn svg { width: 14px; height: 14px; stroke-width: 1.5; }
.zoom-level {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    color: var(--ink-700);
    min-width: 44px;
    text-align: center;
    border-left: 1px solid var(--ink-15);
    border-right: 1px solid var(--ink-15);
    padding: 0 8px;
    line-height: 32px;
    font-variant-numeric: tabular-nums;
}

.frise-legend { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
}
.legend-dot { width: 10px; height: 10px; border-radius: 0; }

/* Frise canvas — cream-dim background, full-bleed editorial.
   Hauteur 550px : lane 0 (closest to axis) + lane 1 (offset 100px). */
.frise-wrapper { overflow-x: auto; overflow-y: hidden; background: var(--cream-dim); height: 550px; }

.frise-container {
    position: relative;
    width: 100%;
    min-width: min-content;
    /* Gouttières latérales >= demi-carte (105px) pour que les events aux
       bornes 0%/100% ne soient pas rognés par overflow-x du wrapper. */
    padding: 30px 110px;
    box-sizing: border-box;
    transform-origin: left top;
}

.frise-years {
    display: flex;
    gap: 0;
    height: 490px;
    align-items: center;
    width: 100%;
}
.frise-year {
    border-left: 1px solid var(--ink-15);
    position: relative;
    padding-left: 20px;
    height: 490px;
    flex: 1 1 var(--year-min-width, 600px);
    min-width: var(--year-min-width, 600px);
}

.frise-container > .timeline-empty-inline {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 490px;
}
.frise-year:first-child { border-left: none; padding-left: 0; }

/* Year label — sceau de cire charcoal/or */
.frise-year-label {
    position: absolute;
    top: 15px;
    left: 20px;
    background: var(--ink-900);
    color: var(--gold);
    border: 1px solid var(--ink-900);
    padding: 4px 12px;
    border-radius: 0;
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
}
.frise-year:first-child .frise-year-label { left: 0; }

/* Axis line — 1px ink-15 with caret arrows */
.frise-axis {
    height: 1px;
    background: var(--ink-15);
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 0;
}

/* Trait bicolore — alternance de couleur par mois directement sur la ligne de
   temps (segments posés sur l'axe, sous les ticks et les markers). */
.frise-line-seg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 2px;
    background: var(--ink-300);
}
.frise-line-seg.alt { background: var(--ink-400); }
.frise-axis::before, .frise-axis::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
}
.frise-axis::before { left: -8px; border-width: 6px 8px 6px 0; border-color: transparent var(--ink-15) transparent transparent; }
.frise-axis::after  { right: -8px; border-width: 6px 0 6px 8px; border-color: transparent transparent transparent var(--ink-15); }

.frise-months { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.frise-month-tick {
    position: absolute;
    top: -6px;
    transform: translateX(-50%);
    width: 1px;
    height: 14px;
    background: var(--ink-15);
}
.frise-month-label {
    position: absolute;
    top: 14px;
    transform: translateX(-50%);
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--ink-500);
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    white-space: nowrap;
}

.frise-events { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); height: 4px; }

/* Lane offsets — variables CSS pour empiler verticalement les events trop proches.
   Lane 0 = à 32px de l'axe (défaut), lane 1 = à 132px (100px de plus). */
.frise-node {
    position: absolute;
    transform: translateX(-50%);
    cursor: pointer;
    transition: transform 0.12s ease;
    --card-offset: 32px;
    --line-height: 24px;
}
.frise-node.lane-1 {
    --card-offset: 132px;
    --line-height: 124px;
}
.frise-node.top { bottom: 4px; }
.frise-node.bottom { top: 4px; }
.frise-node:hover { z-index: 100; }
.frise-node.selected { z-index: 50; }
.frise-node:hover .frise-node-card { border-color: var(--ink-900); box-shadow: var(--shadow-sharp); }
.frise-node.top:hover .frise-node-card { transform: translateY(-2px); }
.frise-node.bottom:hover .frise-node-card { transform: translateY(2px); }
.frise-node.selected .frise-node-card {
    border-color: var(--gold);
    background: var(--gold-soft);
    box-shadow: none;
}

/* Frise marker — sharp 14×14 square (vs circle 16) cohérent timeline-event */
.frise-node-marker {
    width: 14px;
    height: 14px;
    border-radius: 0;
    background: var(--white);
    border: 1px solid;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}
.frise-node.top .frise-node-marker { bottom: -7px; }
.frise-node.bottom .frise-node-marker { top: -7px; }
.frise-node.fact          .frise-node-marker { background: var(--ink-900);        border-color: var(--ink-900); }
.frise-node.document      .frise-node-marker { background: var(--status-success); border-color: var(--status-success); }
.frise-node.correspondence.frise-node-marker { background: var(--gold);           border-color: var(--gold-deep); }
.frise-node.meeting       .frise-node-marker { background: var(--expertise);      border-color: var(--expertise); }
.frise-node.decision      .frise-node-marker { background: var(--bordeaux);       border-color: var(--bordeaux); }
.frise-node.expertise     .frise-node-marker { background: var(--expertise);      border-color: var(--expertise); }
.frise-node.other         .frise-node-marker { background: var(--ink-400);        border-color: var(--ink-400); }

.frise-node-line {
    position: absolute;
    left: 50%;
    width: 1px;
    background: var(--ink-15);
    transform: translateX(-50%);
    pointer-events: none;
}
.frise-node.top .frise-node-line { bottom: 0; height: var(--line-height); }
.frise-node.bottom .frise-node-line { top: 0; height: var(--line-height); }

.frise-node-card {
    width: 210px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: 12px;
    transition: border-color 0.12s ease, transform 0.12s ease, background 0.12s ease;
    box-shadow: none;
}
.frise-node.top .frise-node-card { margin-bottom: var(--card-offset); }
.frise-node.bottom .frise-node-card { margin-top: var(--card-offset); }
.frise-node-date {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--gold-deep-text);
    margin-bottom: 4px;
}
.frise-node-title {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-900);
    margin-bottom: 6px;
    line-height: 1.35;
    letter-spacing: -0.005em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.frise-node-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.frise-node-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
}
.frise-node-tag .tag-dot { width: 4px; height: 4px; border-radius: 0; }
.frise-node-meta { display: flex; align-items: center; gap: 8px; }

/* Frise node type — eyebrow caps coloré (5.39 delta, vs chip) */
.frise-node-type {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 700;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}
.frise-node-type.fact          { color: var(--ink-900); }
.frise-node-type.document      { color: var(--status-success-text); }
.frise-node-type.correspondence{ color: var(--gold-deep-text); }
.frise-node-type.meeting       { color: var(--expertise-text); }
.frise-node-type.decision      { color: var(--bordeaux); }
.frise-node-type.expertise     { color: var(--expertise-text); }
.frise-node-type.other         { color: var(--ink-500); }

.frise-node-pieces {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
    color: var(--ink-500);
    display: flex;
    align-items: center;
    gap: 3px;
}
.frise-node-pieces svg { width: 10px; height: 10px; }

/* Today marker — bordeaux 1px line + caps label */
.frise-today { position: absolute; top: -150px; bottom: -150px; width: 1px; background: var(--bordeaux); z-index: 5; }
.frise-today-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--bordeaux);
    white-space: nowrap;
    background: var(--cream);
    border: 1px solid var(--bordeaux);
    padding: 2px 8px;
    border-radius: 0;
}

/* Frise detail panel (below the frise, not right side) */

.frise-detail-panel {
    background: var(--cream);
    border-top: 1px solid var(--ink-15);
    min-height: 280px;
    flex-shrink: 0;
}
.frise-detail-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
}
.frise-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--ink-15);
    gap: 16px;
}
.frise-detail-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}
.frise-detail-title-section { flex: 1; min-width: 0; }
.frise-detail-date {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--gold-deep-text);
    margin-bottom: 6px;
}
.frise-detail-title {
    font-family: var(--font-serif);
    font-size: var(--h2-size);
    font-weight: 500;
    color: var(--ink-900);
    margin-bottom: 10px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
/* Frise detail type — eyebrow caps coloré (vs chip), cohérent .event-type-badge */
.frise-detail-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
}
.frise-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }
.frise-detail-section-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.frise-detail-section-title svg { width: 14px; height: 14px; color: var(--gold-deep); stroke-width: 1.5; }

.frise-no-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    color: var(--ink-400);
    font-size: 13px;
    gap: 8px;
}
.frise-no-selection svg { width: 18px; height: 18px; stroke-width: 1.5; }

@media (max-width: 1200px) {
    .timeline-page { grid-template-columns: 1fr; }
    .event-detail-panel { position: static; max-height: none; }
}
@media (max-width: 720px) {
    .frise-detail-row-2col { grid-template-columns: 1fr; gap: 16px; }
}

/* ============================================================================
   Cases list page (wireframes/02-dossiers.html)
   All classes scoped under .cases-page to avoid conflicts with dashboard cards
   ============================================================================ */

/* ============================================================================
   CASES PAGE — Prestige (Liste dossiers, /cases)
   ============================================================================ */

/* CaseList stats use the global .stat-card + .stat-watermark pattern (same as
   Dashboard) — see ~ligne 1190 pour les rules. Le bloc .cases-page
   .dossier-stat-card-* a été supprimé en 2.3b après bascule du markup
   Razor sur le pattern Dashboard. */

.cases-page .filters-bar {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.cases-page .search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
    display: block;
}

.cases-page .search-input-wrapper > svg {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--ink-500);
    stroke-width: 1.5;
    pointer-events: none;
}

.cases-page .search-input {
    width: 100%;
    padding: 8px 0 8px 26px;
    border: none;
    border-bottom: 1px solid var(--ink-15);
    border-radius: 0;
    font-family: inherit;
    font-size: var(--body-sm-size);
    color: var(--ink-900);
    background: transparent;
}

.cases-page .search-input::placeholder { color: var(--ink-400); }

.cases-page .search-input:focus {
    outline: none;
    border-bottom-color: var(--ink-900);
    background: transparent;
}

.cases-page .filter-group {
    display: flex;
    gap: 0;
    background: transparent;
    padding: 0;
    border: 1px solid var(--ink-15);
    border-radius: 0;
}

.cases-page .filter-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-500);
    background: transparent;
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
    white-space: nowrap;
}

.cases-page .filter-btn:hover:not(.active) {
    color: var(--ink-900);
    background: var(--cream-dim);
}

.cases-page .filter-btn.active {
    background: var(--ink-900);
    color: var(--cream);
    box-shadow: none;
}

.cases-page .filter-btn.active.expertise   { background: var(--expertise);   color: var(--white); }
.cases-page .filter-btn.active.contentieux { background: var(--contentieux); color: var(--white); }

.cases-page .filter-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink-700);
    background-color: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.cases-page .filter-select:hover { border-color: var(--ink-900); }

.cases-page .dossiers-table-card {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

.cases-page .dossiers-table-header {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cases-page .dossiers-table-header h3 {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

.cases-page .dossiers-count {
    font-size: 13px;
    color: var(--ink-500);
    font-family: var(--font-sans);
}

.cases-page .dossiers-table { width: 100%; border-collapse: collapse; }

.cases-page .dossiers-table th {
    padding: 14px var(--space-md);
    text-align: left;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    background: var(--cream-dim);
    border-bottom: 1px solid var(--ink-15);
    white-space: nowrap;
}

.cases-page .dossiers-table th.sortable { cursor: pointer; user-select: none; }
.cases-page .dossiers-table th.sortable:hover { color: var(--ink-900); }
.cases-page .dossiers-table th svg { width: 14px; height: 14px; vertical-align: middle; margin-left: 4px; stroke-width: 1.5; }

.cases-page .dossiers-table td {
    padding: 16px var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    font-size: var(--table-data-size);
    color: var(--ink-700);
    vertical-align: middle;
}

.cases-page .dossiers-table tr:last-child td { border-bottom: none; }
.cases-page .dossiers-table tbody tr { cursor: pointer; transition: background 0.12s ease; }
.cases-page .dossiers-table tbody tr:hover td { background: var(--cream-dim); }
.cases-page .dossiers-table tbody tr.closed { opacity: 0.6; }

/* Status accent bar 3px on the left edge of each row (Prestige editorial) */
.cases-page .dossiers-table tbody tr td:first-child { position: relative; }
.cases-page .dossiers-table tbody tr td:first-child::before {
    content: ''; position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gold);
}
.cases-page .dossiers-table tbody tr.closed td:first-child::before { background: var(--ink-300); }

.cases-page .case-list-ref {
    font-family: var(--font-sans);
    font-size: var(--label-caps-size);
    font-weight: 700;
    color: var(--ink-500);
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    margin-bottom: 4px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: block;
}

.cases-page .case-list-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.cases-page .case-list-matter {
    font-size: 12px;
    color: var(--ink-500);
    margin-top: 2px;
}

.cases-page .segment-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    color: var(--ink-700);
}

.cases-page .segment-pill.expertise   { background: var(--expertise-soft);   color: var(--ink-900); border-color: var(--expertise); }
.cases-page .segment-pill.contentieux { background: var(--contentieux-soft); color: var(--ink-900); border-color: var(--contentieux); }
.cases-page .segment-pill svg { width: 13px; height: 13px; stroke-width: 1.75; }

.cases-page .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    color: var(--ink-700);
}

.cases-page .status-pill.actif    { background: var(--status-success-soft); color: var(--ink-900); border-color: var(--status-success); }
.cases-page .status-pill.cloture  { background: var(--cream-dim);            color: var(--ink-500); border-color: var(--ink-15); }

.cases-page .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 0;
    background: currentColor;
}

.cases-page .case-pieces-count {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-900);
}

.cases-page .case-date-main { font-size: 13px; color: var(--ink-700); }
.cases-page .case-date-sub  { font-size: 11px; color: var(--ink-500); letter-spacing: 0.04em; }

.cases-page .case-row-actions { display: flex; gap: 4px; }

.cases-page .case-action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--ink-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s ease, color 0.12s ease;
}

.cases-page .case-action-btn:hover {
    background: transparent;
    border-color: var(--ink-900);
    color: var(--ink-900);
}

.cases-page .case-action-btn svg { width: 17px; height: 17px; stroke-width: 1.5; }

.cases-page .pagination {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cases-page .pagination-info {
    font-size: 13px;
    color: var(--ink-500);
}

.cases-page .pagination-btns { display: flex; gap: 4px; }

.cases-page .pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: var(--white);
    color: var(--ink-700);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.cases-page .pagination-btn:hover:not(:disabled) {
    background: var(--cream-dim);
    border-color: var(--ink-900);
    color: var(--ink-900);
}

.cases-page .pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cases-page .pagination-btn.active {
    background: var(--ink-900);
    color: var(--cream);
    border-color: var(--ink-900);
}

.cases-page .pagination-btn svg { width: 16px; height: 16px; stroke-width: 1.5; }

.cases-page .cases-empty {
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    color: var(--ink-500);
    font-size: var(--body-md-size);
}

/* ============================================================================
   Dashboard placeholders (pending features Sprint 4 / Sprint 5)
   ============================================================================ */

.stat-value-placeholder {
    color: var(--ink-300);
    font-style: normal;
}

.deadline-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 20px;
    color: var(--ink-500);
    font-size: var(--body-sm-size);
    text-align: center;
}

.deadline-empty svg {
    width: 20px;
    height: 20px;
    color: var(--ink-400);
    stroke-width: 1.5;
}

/* ============================================================================
   Case detail page header (CaseHeader.razor — Prestige port, 5.40 fix)
   Wireframes : 02-dossier-{contentieux,expertise}.html
   ----------------------------------------------------------------------------
   Layout : .dossier-header-section enveloppe .dossier-header-top = sticky 96px
   (aligné avec .sidebar-header). La barre KPI (.dossier-stats-bar) a été
   retirée (12 mai 2026 — gain de lisibilité). La « ligne du bas du header bar »
   est dessinée par le ::after de .dossier-header-top (rangée 95 du box 96px,
   au pixel près sur la border-bottom du .sidebar-header).
   ============================================================================ */

.dossier-header-section {
    background: var(--cream);
}

.dossier-header-section .dossier-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    /* Padding inline = max(--margin, half-of-overflow + --margin) → aligne le contenu
       sur la grille de .page-content (max-content 1440 centré) à toute résolution.
       Le bg cream + sticky restent full-width pour couvrir le scroll proprement. */
    padding-block: var(--space-sm);
    padding-inline: max(var(--margin), calc((100% - var(--max-content)) / 2 + var(--margin)));
    min-height: var(--app-header-height);
    box-sizing: border-box;
    /* Override du margin-bottom: 12px générique de .dossier-header-top (utilisé sur
       les CaseCard) — ici le header doit s'arrêter net à 96px pour que son ::after
       s'aligne avec la border-bottom du .sidebar-header. */
    margin-bottom: 0;
    /* Sticky : le header reste collé en haut du viewport au scroll */
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--cream);
}

/* Ligne du bas du header bar dessinée en pseudo-élément au pixel près sur la même
   rangée que la border-bottom du .sidebar-header (rangée 95 du box 96px avec
   box-sizing: border-box). */
.dossier-header-section .dossier-header-top::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--ink-15);
    pointer-events: none;
}

.dossier-header-section .header-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 8px;
}

.dossier-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* Réf dossier en eyebrow caps gold-deep (label éditorial Prestige) */
.dossier-ref-badge {
    background: transparent;
    color: var(--gold-deep-text);
    padding: 0;
    border: none;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: var(--label-caps-size);
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
}
/* Variants .expertise/.contentieux conservées pour compat — mais le label
   en eyebrow doit rester gold-deep (signature Prestige), pas tinté segment. */
.dossier-ref-badge.expertise   { color: var(--gold-deep-text); }
.dossier-ref-badge.contentieux { color: var(--gold-deep-text); }

.dossier-main-title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Stack carré des icônes méta (favoris + segment côte à côte, statut centré dessous)
   à droite du title. Hauteur ~34px (vs 60px en vertical) — économise la hauteur.
   align-self: flex-start pour coller au top du title plutôt qu'au centre. */
.dossier-meta-stack {
    display: grid;
    grid-template-columns: 22px 22px;
    column-gap: 4px;
    row-gap: 4px;
    justify-items: center;
    align-items: center;
    flex-shrink: 0;
    margin-left: 12px;
    align-self: flex-start;
    padding-top: 1px;
}
.dossier-meta-stack .favorite-btn {
    position: static;
    top: auto;
    right: auto;
    width: 22px;
    height: 22px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    color: var(--ink-500);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.dossier-meta-stack .favorite-btn:hover {
    color: var(--gold-deep);
    border-color: var(--gold);
}
.dossier-meta-stack .favorite-btn.is-favorite {
    color: var(--gold);
    border-color: var(--gold);
}
.dossier-meta-stack .favorite-btn svg { width: 12px; height: 12px; stroke-width: 1.75; }

/* Override taille segment-icon spécifiquement dans le stack (au lieu du défaut 28×28) */
.dossier-meta-stack .dossier-segment-icon {
    width: 22px;
    height: 22px;
}
.dossier-meta-stack .dossier-segment-icon svg { width: 12px; height: 12px; }

/* Status dot plus petit dans le stack (8×8 au lieu de 10), centré sur la 2e ligne du grid */
.dossier-meta-stack .dossier-status-dot {
    width: 8px;
    height: 8px;
    grid-column: 1 / -1;
}

/* Segment icon dans le CaseHeader — nest 28×28 sharp + couleur per-segment + tooltip.
   Remplace l'ancien .segment-badge texte (réduction visuelle 5.41 paire CaseHeader). */
.dossier-segment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    color: var(--ink-700);
    flex-shrink: 0;
}
.dossier-segment-icon svg { width: 14px; height: 14px; stroke-width: 1.75; }
.dossier-segment-icon.expertise   { background: var(--expertise-soft);   color: var(--ink-900); border-color: var(--expertise); }
.dossier-segment-icon.contentieux { background: var(--contentieux-soft); color: var(--ink-900); border-color: var(--contentieux); }

/* Status dot — pastille 10×10 colorée per-state + tooltip.
   Remplace l'ancien .dossier-status-badge texte. */
.dossier-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ink-15);
    flex-shrink: 0;
    cursor: help;
}
.dossier-status-dot.actif    { background: var(--status-success); }
.dossier-status-dot.cloture  { background: var(--ink-400); }

/* Tab nav — segment-colored active state */
.tab-nav.expertise .tab-item.active.expertise {
    color: var(--expertise-text);
    border-bottom-color: var(--expertise);
}

.tab-nav.expertise .tab-item.active.expertise .tab-badge {
    background: var(--expertise-soft);
    color: var(--expertise-text);
}

.tab-nav.contentieux .tab-item.active.contentieux {
    color: var(--contentieux-text);
    border-bottom-color: var(--contentieux);
}

.tab-nav.contentieux .tab-item.active.contentieux .tab-badge {
    background: var(--contentieux-soft);
    color: var(--contentieux-text);
}

/* ============================================================================
   Vue d'ensemble — CaseDetail.razor (5.40 sub-livraison 2.3c, Prestige native)
   Wireframes : 02-dossier-expertise.html + 02-dossier-contentieux.html
   ============================================================================ */

.case-overview {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-md);
}

@media (max-width: 1200px) {
    .case-overview { grid-template-columns: 1fr; }
}

.case-overview-main { display: flex; flex-direction: column; gap: var(--space-md); }

.sidebar-panels { display: flex; flex-direction: column; gap: var(--space-md); }

/* Danger zone — Hard-delete (Archive vit dans header actions) */
.danger-zone {
    border: 1px solid var(--bordeaux);
    background: var(--bordeaux-soft);
    border-radius: 0;
    padding: var(--space-sm) var(--space-md);
}

.danger-zone-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--bordeaux);
    margin: 0 0 8px;
}

.danger-zone-title svg { width: 14px; height: 14px; stroke-width: 1.5; }

.danger-zone-desc {
    font-size: 13px;
    color: var(--ink-700);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Panel (sidebar + main column container) — sharp editorial card */
.panel {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

.panel-header {
    padding: 14px var(--space-sm);
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.panel-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.panel-title svg { width: 14px; height: 14px; color: var(--gold-deep); stroke-width: 1.5; }

.panel-action {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-900);
    text-decoration: none;
    border-bottom: 1px solid var(--ink-15);
    padding-bottom: 1px;
}

.panel-action.expertise   { color: var(--ink-900); }
.panel-action.contentieux { color: var(--ink-900); }
.panel-action:hover { border-bottom-color: var(--gold); text-decoration: none; }

.panel-content { padding: var(--space-sm); }

/* Quick actions sidebar grid */
.panel .quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    background: transparent;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    text-decoration: none;
    font-family: inherit;
    text-align: center;
    color: inherit;
}

.quick-action-btn:hover:not(.disabled) {
    background: var(--cream-dim);
    border-color: var(--ink-900);
    box-shadow: none;
    text-decoration: none;
}

.quick-action-btn.expertise:hover:not(.disabled)   { border-color: var(--expertise); }
.quick-action-btn.contentieux:hover:not(.disabled) { border-color: var(--contentieux); }

.quick-action-btn svg { width: 20px; height: 20px; color: var(--gold-deep); stroke-width: 1.5; }
.quick-action-btn.expertise svg   { color: var(--expertise-text); }
.quick-action-btn.contentieux svg { color: var(--contentieux-text); }

.quick-action-btn span {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-700);
    text-align: center;
    line-height: 1.3;
}

.quick-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.quick-action-btn.disabled svg { color: var(--ink-400); }

/* Documents list panel — editorial 1px separators */
.doc-list { display: flex; flex-direction: column; }

.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--space-sm);
    border-bottom: 1px solid var(--ink-15);
    transition: background 0.12s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: var(--cream-dim); text-decoration: none; }
/* Button variant (e.g. compact "Latest documents" widget: click downloads the export) */
button.doc-item { width: 100%; text-align: left; background: none; border: none; font: inherit; }

.doc-item .doc-icon {
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.doc-item .doc-icon.pdf   { background: var(--doctype-pdf-bg);   color: var(--doctype-pdf-fg);   border-color: var(--doctype-pdf-fg); }
.doc-item .doc-icon.doc   { background: var(--doctype-doc-bg);   color: var(--doctype-doc-fg);   border-color: var(--doctype-doc-fg); }
.doc-item .doc-icon.xls   { background: var(--doctype-xls-bg);   color: var(--doctype-xls-fg);   border-color: var(--doctype-xls-fg); }
.doc-item .doc-icon.img   { background: var(--doctype-img-bg);   color: var(--doctype-img-fg);   border-color: var(--doctype-img-fg); }
.doc-item .doc-icon.email { background: var(--doctype-email-bg); color: var(--doctype-email-fg); border-color: var(--doctype-email-fg); }
.doc-item .doc-icon.file  { background: var(--cream-dim);        color: var(--ink-500);          border-color: var(--ink-15); }

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

.doc-name {
    font-family: var(--font-serif);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

.doc-piece {
    background: transparent;
    color: var(--gold-deep-text);
    padding: 0;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Parties list (contentieux pattern — avatar sceau de cire + role + badge)
   Scopé `.case-overview` pour ne pas entrer en conflit avec les règles
   `.parties-list` / `.party-item` de CaseForm (display: grid + border-left). */
.case-overview .parties-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }

.case-overview .party-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-left: 1px solid var(--ink-15);
    border-radius: 0;
    grid-template-columns: none;
}

.party-avatar {
    width: 36px;
    height: 36px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid var(--ink-900);
    background: var(--ink-900);
    color: var(--gold);
}

.party-avatar.client   { background: var(--ink-900);      color: var(--gold);      border-color: var(--ink-900); }
.party-avatar.adverse  { background: var(--bordeaux-soft); color: var(--bordeaux); border-color: var(--bordeaux); }
.party-avatar.neutral  { background: var(--cream-dim);    color: var(--ink-700);   border-color: var(--ink-15); }

.party-info { flex: 1; min-width: 0; }
.party-name {
    font-family: var(--font-serif);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
}
.party-role { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

.party-badge {
    padding: 3px 8px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    border: 1px solid var(--ink-15);
    white-space: nowrap;
    flex-shrink: 0;
}

.party-badge.demandeur   { background: var(--contentieux-soft); color: var(--ink-900);  border-color: var(--contentieux); }
.party-badge.defendeur   { background: var(--bordeaux-soft);    color: var(--bordeaux); border-color: var(--bordeaux); }
.party-badge.intervenant { background: var(--gold-soft);        color: var(--gold-deep-text); border-color: var(--gold); }

/* Actors grid (expertise pattern — chip with colored dot) */
.actors-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.actor-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-size: 12px;
    color: var(--ink-700);
}

.actor-chip .actor-dot {
    width: 8px;
    height: 8px;
    border-radius: 0;
    flex-shrink: 0;
}

.actor-chip .actor-dot.client  { background: var(--expertise); }
.actor-chip .actor-dot.adverse { background: var(--bordeaux); }
.actor-chip .actor-dot.expert  { background: var(--gold); }
.actor-chip .actor-dot.tiers   { background: var(--ink-400); }

.panel-empty {
    padding: var(--space-md) var(--space-sm);
    text-align: center;
    color: var(--ink-500);
    font-size: 13px;
}

/* Details card — segment, matter, jurisdiction, RG, dates, description */
.case-details-card {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

.case-details-header {
    padding: 14px var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.case-details-header h2 {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
    margin: 0;
}

.case-details-body { padding: var(--space-md); }

.case-details-card > .table-container { margin: var(--space-sm) var(--space-md); }

.case-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-sm);
}

.case-detail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.case-detail-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold-deep-text);
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}

.case-detail-value {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--ink-900);
}

.case-detail-value.empty { color: var(--ink-400); }

.case-description-block {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--ink-15);
}

.case-description-text {
    font-size: 14px;
    color: var(--ink-700);
    line-height: 1.6;
    white-space: pre-wrap;
    margin-top: 8px;
}

/* ============================================================================
   Create/Edit case form (wireframes/02-nouveau-dossier.html)
   ============================================================================ */

/* ============================================================================
   CaseForm Prestige (5.40 sub-livraison 2.3d)
   Wireframe : 02-nouveau-dossier.html
   ============================================================================ */

.create-dossier-layout {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.progress-step { display: flex; align-items: center; gap: 12px; }

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 500;
    background: var(--cream-dim);
    color: var(--ink-500);
    border: 1px solid var(--ink-15);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.step-number.active    { background: var(--ink-900); color: var(--gold);     border-color: var(--ink-900); }
.step-number.completed { background: var(--gold);    color: var(--ink-900);  border-color: var(--gold); }
.step-number svg { width: 14px; height: 14px; stroke-width: 1.75; }

.step-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-400);
    transition: color 0.2s ease;
}

.step-label.active    { color: var(--ink-900); }
.step-label.completed { color: var(--ink-700); }

.step-connector {
    width: 60px;
    height: 1px;
    background: var(--ink-15);
    margin: 0 16px;
    transition: background 0.2s ease;
}

.step-connector.completed { background: var(--gold); }

.form-card {
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.form-card-header {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-card-header-icon {
    width: 36px;
    height: 36px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream-dim);
    color: var(--ink-700);
    flex-shrink: 0;
}

.form-card-header-icon.primary     { background: var(--cream-dim);        color: var(--ink-900); border-color: var(--ink-15); }
.form-card-header-icon.expertise   { background: var(--expertise-soft);   color: var(--ink-900); border-color: var(--expertise); }
.form-card-header-icon.contentieux { background: var(--contentieux-soft); color: var(--ink-900); border-color: var(--contentieux); }
.form-card-header-icon svg { width: 18px; height: 18px; stroke-width: 1.5; }

.form-card-header h3 {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
}

.form-card-header p {
    font-size: 12.5px;
    color: var(--ink-500);
    margin-top: 4px;
    line-height: 1.4;
}

.form-card-body { padding: var(--space-md); }

.segment-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: var(--space-sm);
}

.segment-option {
    position: relative;
    padding: var(--space-sm);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    background: var(--white);
    display: block;
    font-family: inherit;
    text-align: left;
    width: 100%;
    color: inherit;
}

.segment-option:hover {
    border-color: var(--ink-900);
    transform: none;
    box-shadow: none;
}

.segment-option.selected.expertise {
    border-color: var(--expertise);
    background: var(--expertise-soft);
}

.segment-option.selected.contentieux {
    border-color: var(--contentieux);
    background: var(--contentieux-soft);
}

.segment-option-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.segment-option-icon svg { width: 20px; height: 20px; stroke-width: 1.5; }

.segment-option.expertise .segment-option-icon {
    background: var(--expertise-soft);
    color: var(--ink-900);
    border-color: var(--expertise);
}

.segment-option.contentieux .segment-option-icon {
    background: var(--contentieux-soft);
    color: var(--ink-900);
    border-color: var(--contentieux);
}

.segment-option h4 {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}

.segment-option p {
    font-size: 12.5px;
    color: var(--ink-500);
    line-height: 1.45;
    margin: 0;
}

.segment-check {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 20px;
    height: 20px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.segment-check svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    color: var(--ink-900);
    stroke-width: 2;
    transition: opacity 0.12s ease;
}

.segment-option.selected .segment-check { border-color: transparent; background: var(--ink-900); }
.segment-option.selected .segment-check svg { opacity: 1; color: var(--gold); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px; /* row-gap column-gap */
}

.form-grid.single { grid-template-columns: 1fr; }
.form-grid .form-group.full-width { grid-column: span 2; }
.form-grid > .form-group { margin-bottom: 0; }

.matiere-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.matiere-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-700);
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.matiere-pill:hover {
    border-color: var(--ink-900);
    color: var(--ink-900);
    background: transparent;
}

.matiere-pill.selected             { background: var(--ink-900);          color: var(--cream);   border-color: var(--ink-900); }
.matiere-pill.selected.expertise   { background: var(--expertise-soft);   color: var(--ink-900); border-color: var(--expertise); }
.matiere-pill.selected.contentieux { background: var(--contentieux-soft); color: var(--ink-900); border-color: var(--contentieux); }

.matiere-pill svg { width: 14px; height: 14px; stroke-width: 1.5; }

.matiere-section { animation: form-fadeIn 0.3s ease; }

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

.form-helper {
    font-size: 12px;
    color: var(--ink-500);
    margin-top: 6px;
    display: block;
    line-height: 1.4;
}

.form-required { color: var(--bordeaux); font-weight: 600; }

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--cream);
    border-top: 1px solid var(--ink-15);
    flex-wrap: wrap;
    gap: 12px;
}

.form-actions-left,
.form-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: var(--space-sm);
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-left: 3px solid var(--gold);
    border-radius: 0;
    margin-top: var(--space-sm);
}

.info-box-icon {
    width: 18px;
    height: 18px;
    color: var(--gold-deep);
    stroke-width: 1.5;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box-content { flex: 1; }

.info-box-title {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
    margin-bottom: 4px;
}

.info-box-text {
    font-size: 13px;
    color: var(--ink-700);
    line-height: 1.5;
}

.info-box-link {
    color: var(--ink-900);
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
    border-bottom: 1px solid var(--ink-15);
}
.info-box-link:hover { border-bottom-color: var(--gold); }

.form-helper-link {
    margin-left: 8px;
    font-size: 12px;
    color: var(--ink-900);
    text-decoration: none;
    font-weight: 500;
}
.form-helper-link:hover { text-decoration: underline; }

/* GenerateDirePage — Note recipients prefill button (used on cream surface inside option-section-title) */
.gen-prefill-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: transparent;
    color: var(--ink-700);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.gen-prefill-btn:hover { border-color: var(--gold); color: var(--gold-deep-text); background: var(--gold-soft); }

/* ActorForm — toggle card "Partie au litige" (5.40 sub-livraison 2.3i — Prestige) */
.party-toggle-card {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.party-toggle-card:hover { border-color: var(--ink-900); }
.party-toggle-card.selected {
    border-color: var(--gold);
    background: var(--cream-dim);
}
.party-toggle-icon {
    width: 44px;
    height: 44px;
    border-radius: 0;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    color: var(--ink-500);
    display: flex;
    align-items: center;
    justify-content: center;
}
.party-toggle-icon svg { width: 20px; height: 20px; stroke-width: 1.5; }
.party-toggle-card.selected .party-toggle-icon {
    background: var(--gold-soft);
    border-color: var(--gold);
    color: var(--gold-deep-text);
}
.party-toggle-title { font-family: var(--font-serif); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-900); margin-bottom: 2px; }
.party-toggle-desc { font-size: 12px; color: var(--ink-500); line-height: 1.4; }
.party-toggle-input { width: 18px; height: 18px; accent-color: var(--ink-900); cursor: pointer; }

/* ActorForm — quality selector (3 cards : plaintiff/defendant/intervening) */
.quality-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 720px) { .quality-selector { grid-template-columns: 1fr; } }
.quality-card {
    position: relative;
    padding: 16px 14px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    text-align: center;
    font-family: inherit;
}
.quality-card:hover { border-color: var(--ink-900); }
.quality-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 0;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    color: var(--ink-500);
}
.quality-card-icon svg { width: 18px; height: 18px; stroke-width: 1.5; }
.quality-card h4 { font-family: var(--font-serif); font-size: 14px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-900); margin: 0; }
.quality-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.quality-card-check svg { width: 10px; height: 10px; opacity: 0; color: var(--ink-900); }

.quality-card.plaintiff.selected { border-color: var(--expertise); background: var(--expertise-soft); }
.quality-card.plaintiff.selected .quality-card-icon { background: var(--white); border-color: var(--expertise); color: var(--expertise); }
.quality-card.plaintiff.selected .quality-card-check { background: var(--expertise); border-color: var(--expertise); }
.quality-card.plaintiff.selected .quality-card-check svg { opacity: 1; color: var(--white); }

.quality-card.defendant.selected { border-color: var(--contentieux); background: var(--contentieux-soft); }
.quality-card.defendant.selected .quality-card-icon { background: var(--white); border-color: var(--contentieux); color: var(--contentieux); }
.quality-card.defendant.selected .quality-card-check { background: var(--contentieux); border-color: var(--contentieux); }
.quality-card.defendant.selected .quality-card-check svg { opacity: 1; color: var(--white); }

.quality-card.intervening.selected { border-color: var(--gold); background: var(--gold-soft); }
.quality-card.intervening.selected .quality-card-icon { background: var(--white); border-color: var(--gold); color: var(--gold-deep); }
.quality-card.intervening.selected .quality-card-check { background: var(--gold); border-color: var(--gold); }
.quality-card.intervening.selected .quality-card-check svg { opacity: 1; color: var(--ink-900); }

/* ActorForm — entity type selector (Personne physique / morale) */
.entity-type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
@media (max-width: 720px) { .entity-type-selector { grid-template-columns: 1fr; } }
.entity-type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    text-align: left;
    font-family: inherit;
}
.entity-type-card:hover { border-color: var(--ink-900); }
.entity-type-card.selected { border-color: var(--ink-900); background: var(--cream-dim); }
.entity-type-card svg { width: 22px; height: 22px; color: var(--ink-500); stroke-width: 1.5; flex-shrink: 0; }
.entity-type-card.selected svg { color: var(--gold-deep); }
.entity-type-title { font-family: var(--font-serif); font-size: 14px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-900); margin-bottom: 2px; }
.entity-type-desc { font-size: 12px; color: var(--ink-500); line-height: 1.4; }
.legal-entity-grid { margin-top: 16px; }

/* ActorForm — company lookup (recherche-entreprises.api.gouv.fr) */
.company-lookup { margin-top: 16px; }
.company-lookup-modes { display: flex; gap: 0; margin-bottom: 12px; }
.company-lookup-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--ink-15);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-500);
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.company-lookup-mode + .company-lookup-mode { border-left: 0; }
.company-lookup-mode:hover { border-color: var(--ink-900); color: var(--ink-900); }
.company-lookup-mode.active { background: var(--ink-900); color: var(--gold); border-color: var(--ink-900); }
.company-lookup-mode.active svg { color: var(--gold); }
.company-lookup-mode svg { color: var(--ink-500); flex-shrink: 0; }

.company-lookup-search { position: relative; }
.company-lookup-spinner { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-500); }

.company-lookup-results {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    max-height: 280px;
    overflow-y: auto;
}
.company-lookup-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--ink-15);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.1s ease;
}
.company-lookup-results li:last-child .company-lookup-result { border-bottom: 0; }
.company-lookup-result:hover { background: var(--cream-dim); }
.company-lookup-result-name { font-family: var(--font-serif); font-size: 14px; font-weight: 500; color: var(--ink-900); }
.company-lookup-result-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--ink-500); }
.company-lookup-badge {
    align-self: flex-start;
    margin-top: 2px;
    padding: 1px 7px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}
.company-lookup-badge.active { background: var(--gold-soft); color: var(--gold-deep-text); }
.company-lookup-badge.ceased { background: var(--bordeaux-soft); color: var(--bordeaux); }

.company-lookup-empty { margin-top: 6px; font-size: 12px; color: var(--ink-500); }

.company-lookup-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--gold);
    background: var(--gold-soft);
    font-size: 13px;
    color: var(--ink-900);
}
.company-lookup-selected svg { color: var(--gold-deep); flex-shrink: 0; }
.company-lookup-selected span { flex: 1; }
.company-lookup-change {
    border: 1px solid var(--ink-900);
    background: var(--white);
    padding: 5px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-900);
    cursor: pointer;
}
.company-lookup-change:hover { background: var(--ink-900); color: var(--gold); }

/* ActorForm — lawyer dropdown with adjacent create button */
.lawyer-row-with-create { display: flex; gap: 8px; align-items: stretch; }
.lawyer-row-with-create select.form-input { flex: 1; }
.lawyer-row-with-create .btn { flex-shrink: 0; }

/* ActorsManager — quality badge colored by quality (sharp eyebrow caps) */
.quality-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    color: var(--ink-700);
}
.quality-badge.plaintiff   { background: var(--expertise-soft);   border-color: var(--expertise);   color: var(--expertise-text); }
.quality-badge.defendant   { background: var(--contentieux-soft); border-color: var(--contentieux); color: var(--contentieux-text); }
.quality-badge.intervening { background: var(--gold-soft);        border-color: var(--gold);        color: var(--gold-deep-text); }

/* LawyerCreateDialog — compact modal for inline party lawyer creation (Prestige 2.2d) */
.lawyer-create-dialog { max-width: 480px; }
.lawyer-create-dialog .confirm-header { align-items: flex-start; gap: 12px; }
.lawyer-create-dialog .confirm-subtitle { margin: 4px 0 0; font-size: 13px; color: var(--ink-500); font-weight: 400; }
.lawyer-create-dialog .form-group { margin-bottom: 12px; }
.lawyer-dialog-hint { color: var(--ink-500); font-style: italic; margin-top: 4px; }
.practice-mode-compact { gap: 8px; }
.practice-mode-compact .practice-mode-card { padding: 12px 14px; }
.practice-mode-compact .practice-mode-card h4 { margin: 0; font-size: 13px; }
.practice-mode-compact .practice-mode-check { top: 8px; right: 8px; width: 18px; height: 18px; }
.practice-mode-compact .practice-mode-check svg { width: 10px; height: 10px; }

/* LawyerForm — practice mode selector (firm vs solo) */
.practice-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.practice-mode-card {
    position: relative;
    padding: 20px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    background: var(--white);
    text-align: left;
    font-family: inherit;
}
.practice-mode-card:hover {
    border-color: var(--ink-900);
}
.practice-mode-card.selected {
    border-color: var(--gold);
    background: var(--cream-dim);
}
.practice-mode-icon {
    width: 40px;
    height: 40px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    color: var(--ink-500);
}
.practice-mode-icon svg { width: 20px; height: 20px; }
.practice-mode-card.selected .practice-mode-icon {
    background: var(--gold-soft);
    border-color: var(--gold);
    color: var(--gold-deep-text);
}
.practice-mode-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-900);
    margin: 0 0 4px;
    font-family: inherit;
}
.practice-mode-card p {
    font-size: 12px;
    color: var(--ink-500);
    line-height: 1.4;
    margin: 0;
}
.practice-mode-check {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 22px;
    height: 22px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.practice-mode-check svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    color: var(--ink-900);
}
.practice-mode-card.selected .practice-mode-check {
    background: var(--gold);
    border-color: var(--gold);
}
.practice-mode-card.selected .practice-mode-check svg { opacity: 1; }
@media (max-width: 720px) {
    .practice-mode-selector { grid-template-columns: 1fr; }
}

/* LawyersManager — search filter scoping (5.40 sub-livraison 2.3i — Prestige) */
.lawyers-filters { margin-bottom: 20px; }
.lawyers-filters .search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
    display: block;
}
.lawyers-filters .search-input-wrapper > svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--ink-400);
    stroke-width: 1.5;
    pointer-events: none;
}
.lawyers-filters .search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-size: 14px;
    color: var(--ink-900);
    background: var(--cream-dim);
    font-family: inherit;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.lawyers-filters .search-input::placeholder { color: var(--ink-400); }
.lawyers-filters .search-input:focus { outline: none; border-color: var(--ink-900); background: var(--white); }

/* CaseForm — section Parties (5.40 sub-livraison 2.3d, Prestige native).
   Pattern : grid auto/1fr/auto = quality-tag + party-stack + delete.
   Border-left 3px tinté par quality (plaintiff=expertise, defendant=
   bordeaux, intervening=gold). NB : règle non scopée car pas de conflit
   ailleurs dans l'app — `.party-item` est CaseForm-only ; le port
   CaseDetail (.case-overview .party-item) est scopé pour ne pas l'écraser. */
.parties-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.parties-empty {
    padding: var(--space-sm);
    border: 1px dashed var(--ink-15);
    border-radius: 0;
    text-align: center;
    color: var(--ink-500);
    font-size: 13px;
}
.party-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 12px;
    background: var(--cream);
    border: 1px solid var(--ink-15);
    border-left: 3px solid var(--ink-15);
    border-radius: 0;
}
.party-item.plaintiff   { border-left-color: var(--expertise); }
.party-item.defendant   { border-left-color: var(--bordeaux); }
.party-item.intervening { border-left-color: var(--gold); }

.party-quality-tag {
    padding: 4px 8px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    white-space: nowrap;
    background: var(--cream-dim);
    color: var(--ink-700);
    border: 1px solid var(--ink-15);
    margin-top: 6px;
}
.party-quality-tag.plaintiff   { background: var(--expertise-soft);   color: var(--ink-900);   border-color: var(--expertise); }
.party-quality-tag.defendant   { background: var(--bordeaux-soft);    color: var(--bordeaux);  border-color: var(--bordeaux); }
.party-quality-tag.intervening { background: var(--gold-soft);        color: var(--gold-deep-text); border-color: var(--gold); }

.party-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.party-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; }

.party-input {
    padding: 8px 10px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    background: var(--white);
    color: var(--ink-900);
}
.party-input:focus { outline: none; border-color: var(--ink-900); }
.party-name { font-weight: 500; }
.party-name-field .party-name { width: 100%; }

/* CaseForm — per-row party type toggle (natural person / legal entity) */
.party-type-toggle { display: flex; gap: 0; }
.party-type-btn {
    padding: 5px 12px;
    border: 1px solid var(--ink-15);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-500);
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.party-type-btn + .party-type-btn { border-left: 0; }
.party-type-btn:hover { border-color: var(--ink-900); color: var(--ink-900); }
.party-type-btn.active { background: var(--ink-900); color: var(--gold); border-color: var(--ink-900); }

/* CaseForm — per-row company lookup */
.party-name-field { position: relative; }
.party-company-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 20;
    border: 1px solid var(--ink-15);
    background: var(--white);
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 6px 18px rgba(31, 41, 55, 0.12);
}
.party-company-option {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--ink-15);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.party-company-dropdown .party-company-option:last-child { border-bottom: 0; }
.party-company-option:hover { background: var(--cream-dim); }
.party-company-option-name { font-family: var(--font-serif); font-size: 13px; font-weight: 500; color: var(--ink-900); }
.party-company-option-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--ink-500); }
.party-company-loading { padding: 8px 12px; font-size: 12px; color: var(--ink-500); }

.party-company-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 2px 6px 2px 7px;
    background: var(--gold-soft);
    color: var(--gold-deep-text);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}
.party-company-badge svg { color: var(--gold-deep); }
.party-company-clear {
    border: 0;
    background: transparent;
    padding: 0 0 0 2px;
    color: var(--gold-deep-text);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}
.party-company-clear:hover { color: var(--bordeaux); }

.party-lawyer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--ink-15);
    margin-top: 4px;
}
.party-lawyer-icon { color: var(--gold-deep); flex-shrink: 0; stroke-width: 1.5; }
.party-lawyer-select { flex: 1; min-width: 0; font-size: 12px; padding: 6px 8px; }
.party-lawyer-select.is-self {
    background: var(--gold-soft);
    border-color: var(--gold);
    color: var(--gold-deep-text);
    font-weight: 600;
}

.party-lawyer-create {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: var(--white);
    color: var(--ink-900);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.party-lawyer-create:hover {
    border-color: var(--ink-900);
    background: var(--cream-dim);
}

.party-delete {
    background: none;
    border: 1px solid transparent;
    color: var(--ink-500);
    cursor: pointer;
    padding: 6px;
    border-radius: 0;
    transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.party-delete:hover { color: var(--bordeaux); border-color: var(--bordeaux); background: var(--white); }
.party-delete svg { width: 14px; height: 14px; stroke-width: 1.5; }

.parties-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.parties-actions .btn svg { width: 14px; height: 14px; }
.parties-helper { margin-top: 4px; }
@media (max-width: 720px) {
    .party-item { grid-template-columns: 1fr auto; }
    .party-quality-tag { grid-column: 1 / 2; }
    .party-row { grid-template-columns: 1fr; }
}

/* CaseList + Home — sous-ligne parties */
.cases-page .case-list-parties {
    font-size: 12px;
    color: var(--ink-500);
    margin-top: 4px;
    font-style: italic;
}
.dossier-parties {
    font-family: var(--font-serif);
    font-size: 13px;
    font-style: italic;
    color: var(--ink-500);
    margin-top: 2px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.optional-section-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    cursor: pointer;
    user-select: none;
    background: transparent;
    border: none;
    font-family: inherit;
    text-align: left;
    width: 100%;
    color: var(--ink-700);
    transition: color 0.12s ease;
}
.optional-section-toggle:hover { color: var(--ink-900); }

.optional-section-toggle svg {
    width: 14px;
    height: 14px;
    color: var(--ink-500);
    stroke-width: 1.75;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.optional-section-toggle.expanded svg { transform: rotate(90deg); }

.optional-section-toggle span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
}

.optional-section-content {
    display: none;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--ink-15);
    margin-top: 8px;
}

.optional-section-content.visible {
    display: block;
    animation: form-fadeIn 0.3s ease;
}

.form-error-banner {
    margin-bottom: var(--space-sm);
    padding: 12px var(--space-sm);
    border-radius: 0;
    border: 1px solid var(--bordeaux);
    background: var(--bordeaux-soft);
    color: var(--bordeaux);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .segment-selector { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .form-group.full-width { grid-column: span 1; }
    .form-actions { flex-direction: column; }
    .form-actions-left,
    .form-actions-right { width: 100%; justify-content: center; }
    .step-connector { width: 24px; margin: 0 8px; }
}

/* Standalone toolbar (below CaseHeader on Documents page) */
.documents-toolbar-standalone {
    background: var(--cream);
    border-bottom: 1px solid var(--ink-15);
    /* Padding inline aligné sur la grille .page-content (max-content 1440 centré) */
    padding-block: 14px;
    padding-inline: max(var(--margin), calc((100% - var(--max-content)) / 2 + var(--margin)));
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* Marge interne gauche : la toolbar a margin-left: -40px (= --margin) pour s'étendre
   full-width sous le CaseHeader ; on compense avec padding-left: 40px pour ramener le
   contenu (search-box) sur la grille .page-content. */
.documents-toolbar-standalone .search-box {
    padding-left: 40px;
}

.main-content > .documents-toolbar-standalone {
    margin-left: calc(var(--margin) * -1);
    margin-right: calc(var(--margin) * -1);
}

/* Espace toolbar → contenu (filtres rapides) aligné sur l'espace tab-nav → toolbar
   (14px = padding-block de .documents-toolbar-standalone). On annule la margin-top
   var(--space-sm) (16px) et on remplace le padding-top var(--space-md) (28px) de
   .page-content par 14px, uniquement quand la toolbar la précède directement. */
.main-content > .documents-toolbar-standalone + .page-content {
    margin-top: 0;
    padding-top: 14px;
}

/* =========================================
   Sprint 4 — Document generation pages
   Wireframes 06-generation-dire / 06-generation-conclusions
   ========================================= */

/* ============================================================================
   Export wizard (5.40 sub-livraison 2.3g — Prestige Legal Authority)
   Pattern : wireframes/06-generation-dire.html — options + preview pane.
   Toolbar charcoal partagée avec viewer-toolbar (DocumentViewer).
   ============================================================================ */
.generation-page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--cream);
}

.generation-toolbar {
    background: var(--ink-900);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(253, 251, 247, 0.1);
    gap: 16px;
    flex-shrink: 0;
}

.generation-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1 1 0;
}

.generation-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.generation-page {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 24px;
    padding: 24px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.generation-options {
    background: var(--white);
    border-radius: 0;
    border: 1px solid var(--ink-15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.generation-options .options-header { padding: 20px; border-bottom: 1px solid var(--ink-15); }
.generation-options .options-header h2 {
    font-family: var(--font-serif);
    font-size: var(--h3-size);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-900);
    line-height: 1.2;
    margin: 0 0 4px 0;
}
.generation-options .options-header p { font-size: 12.5px; color: var(--ink-500); margin: 0; line-height: 1.4; }
.generation-options .options-body { padding: 20px; flex: 1; overflow-y: auto; }
.generation-options .options-footer { padding: 16px 20px; border-top: 1px solid var(--ink-15); background: var(--cream); display: flex; flex-direction: column; gap: 8px; }
.gen-save-draft-btn { width: 100%; justify-content: center; gap: 6px; }
.gen-save-draft-btn:disabled { opacity: 0.7; cursor: default; }
.generation-options .option-section { margin-bottom: 24px; }
.generation-options .option-section:last-child { margin-bottom: 0; }

/* Lot 4 — collapsible options sidebar (widens the preview) */
.generation-options { position: relative; }
.options-collapse-btn {
    position: absolute; top: 16px; right: 14px; z-index: 2;
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ink-15); background: var(--cream);
    color: var(--ink-500); cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.options-collapse-btn:hover { color: var(--ink-900); border-color: var(--ink-900); }
.options-collapse-btn svg { width: 16px; height: 16px; }
.generation-page.is-collapsed { grid-template-columns: 48px 1fr; }
.generation-page.is-collapsed .options-header > h2,
.generation-page.is-collapsed .options-header > p,
.generation-page.is-collapsed .options-body,
.generation-page.is-collapsed .options-footer { display: none; }
.generation-page.is-collapsed .options-header { padding: 0; border-bottom: 0; }
.generation-page.is-collapsed .options-collapse-btn { position: static; margin: 10px auto; }

.option-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-700);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: var(--label-caps-tracking);
}
.option-section-title svg { width: 14px; height: 14px; color: var(--gold-deep); stroke-width: 1.5; }

.doc-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.doc-type-card {
    padding: 14px 10px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    text-align: center;
    background: var(--white);
    /* a11y 5.17 : vrais <button> (Espace/Entrée natifs) — resets UA. */
    font-family: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    display: block;
}
.doc-type-card:hover:not(.disabled) { border-color: var(--ink-900); }
.doc-type-card.disabled { opacity: 0.5; cursor: not-allowed; }
.doc-type-card.selected,
.doc-type-card.selected.expertise,
.doc-type-card.selected.contentieux {
    border-color: var(--ink-900);
    background: var(--cream-dim);
}
.doc-type-card.selected .doc-type-icon {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: var(--gold);
}
.doc-type-card.selected .doc-type-icon svg { color: var(--gold); }

.doc-type-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.doc-type-icon svg { width: 18px; height: 18px; color: var(--ink-700); stroke-width: 1.5; transition: color 0.12s ease; }
.doc-type-name { font-family: var(--font-serif); font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--ink-900); margin-bottom: 4px; }
.doc-type-desc { font-size: 11px; color: var(--ink-500); }

.gen-date-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gen-date-range label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    margin-bottom: 6px;
}
.gen-date-range input {
    width: 100%;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-size: var(--body-sm-size);
    font-family: inherit;
    color: var(--ink-900);
    outline: none;
    transition: border-color 0.12s ease;
}
.gen-date-range input:focus { border-color: var(--ink-900); }

.gen-checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.gen-checkbox-group label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-700); cursor: pointer; line-height: 1.4; }
.gen-checkbox-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ink-900); cursor: pointer; }

.event-type-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.event-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--ink-15);
    background: var(--white);
    color: var(--ink-700);
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.event-type-tag:hover { border-color: var(--ink-900); }
.event-type-tag.active { border-color: currentColor; background: var(--cream-dim); color: var(--ink-900); }
.event-type-tag .dot { width: 8px; height: 8px; border-radius: 0; background: currentColor; flex-shrink: 0; }

.gen-party-selector { display: flex; gap: 10px; }
.gen-party-option {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--ink-15);
    border-radius: 0;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;  /* a11y 5.17 : <button> — reset UA font (garde size/weight ci-dessus) */
    appearance: none;
    -webkit-appearance: none;
    color: var(--ink-700);
    background: var(--white);
}
.gen-party-option:hover { border-color: var(--ink-900); color: var(--ink-900); }
.gen-party-option.selected { border-color: var(--ink-900); background: var(--cream-dim); color: var(--ink-900); }

.gen-moyens-list, .gen-demandes-list { display: flex; flex-direction: column; gap: 8px; }
/* Column layout: a header row (number/bullet + title + delete) then the rich-text body
   spanning the full card width below — so the editor is as wide as a free-section editor. */
.gen-moyen-item, .gen-demande-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-radius: 0;
}
.gen-moyen-head, .gen-demande-head { display: flex; align-items: center; gap: 12px; }
.gen-demande-head { justify-content: space-between; }
.gen-moyen-number {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 0;
    background: var(--ink-900);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 500;
}
.gen-demande-bullet { color: var(--gold-deep-text); font-weight: 700; font-family: var(--font-serif); }
.gen-moyen-item input[type="text"] {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    color: var(--ink-900);
}
.gen-moyen-delete, .gen-demande-delete { background: none; border: none; color: var(--ink-400); cursor: pointer; padding: 4px; transition: color 0.12s ease; }
.gen-moyen-delete:hover, .gen-demande-delete:hover { color: var(--bordeaux); }
.gen-moyen-item .rich-text-editor-wrapper, .gen-demande-item .rich-text-editor-wrapper { width: 100%; }

.gen-add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: 1px dashed var(--ink-15);
    border-radius: 0;
    background: transparent;
    color: var(--ink-500);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease;
    width: 100%;
}
.gen-add-button:hover,
.gen-add-button.expertise:hover,
.gen-add-button.contentieux:hover { border-color: var(--ink-900); color: var(--ink-900); border-style: solid; }

/* Lot 3 — act structure editor (reorderable / hideable / editable sections) */
.struct-editor { display: flex; flex-direction: column; gap: 8px; }
.struct-section { border: 1px solid var(--ink-15); background: var(--cream); }
.struct-section.editing { border-color: var(--ink-900); }
.struct-section.is-hidden { opacity: 0.55; }
.struct-section.drag-over { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.struct-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.struct-handle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 22px; flex: 0 0 auto;
    color: var(--ink-500); cursor: grab;
}
.struct-handle:active { cursor: grabbing; }
.struct-handle svg { width: 16px; height: 16px; }
/* Bordereau annex: pinned last, not draggable */
.struct-handle.is-pinned { cursor: default; color: var(--ink-400); }
.struct-handle.is-pinned svg { width: 13px; height: 13px; }
.struct-title-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: transparent;
    text-align: left; cursor: pointer;
}
.struct-title { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.struct-section.is-hidden .struct-title { text-decoration: line-through; }
.struct-volume { font-size: 11px; color: var(--ink-500); }
.struct-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex: 0 0 auto;
    border: 1px solid transparent; background: transparent; color: var(--ink-500); cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.struct-icon-btn svg { width: 16px; height: 16px; }
.struct-icon-btn:hover { color: var(--ink-900); border-color: var(--ink-15); }
.struct-icon-btn.active { color: var(--ink-900); background: var(--parchment); }
.struct-icon-btn.danger:hover { color: var(--bordeaux); border-color: var(--bordeaux); }
.struct-edit {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px; border-top: 1px solid var(--ink-15); background: var(--parchment-tint, var(--cream));
}
.struct-field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-500); }
.struct-hint { font-size: 12px; color: var(--ink-500); margin: 0; line-height: 1.5; }
.struct-add { margin-top: 2px; }

.gen-textarea {
    width: 100%;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink-900);
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.12s ease;
}
.gen-textarea::placeholder { color: var(--ink-400); }
.gen-textarea:focus { border-color: var(--ink-900); }

.gen-text-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink-900);
    outline: none;
    transition: border-color 0.12s ease;
}
.gen-text-input::placeholder { color: var(--ink-400); }
.gen-text-input:focus { border-color: var(--ink-900); }

.gen-importance-slider { display: flex; align-items: center; gap: 12px; }
.gen-importance-slider input { flex: 1; accent-color: var(--gold); }
.gen-importance-value { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--ink-900); min-width: 24px; text-align: right; }

/* Generate CTA = btn-primary gold sur cream-dim footer ; segment classes neutralisées
   pour préserver l'accent gold uniforme (était navy/orange en pré-Prestige). */
.gen-generate-btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; font-weight: 600; }
.gen-generate-btn.expertise,
.gen-generate-btn.contentieux { background: var(--gold); color: var(--ink-900); border-color: var(--gold); }
.gen-generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.gen-preview-panel {
    background: var(--white);
    border-radius: 0;
    border: 1px solid var(--ink-15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.gen-preview-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.gen-preview-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
}
.gen-preview-actions { display: flex; gap: 8px; }
.gen-preview-body { flex: 1; overflow: auto; padding: 40px; background: var(--cream); }

/* Zoom du document d'aperçu — stepper en % + ajustements largeur / page entière. */
.gen-zoom { display: flex; align-items: center; gap: 2px; border: 1px solid var(--ink-15); background: var(--white); }
.gen-zoom-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 28px; min-width: 28px; padding: 0 6px;
    background: transparent; border: 0; cursor: pointer;
    font-family: var(--font-sans); font-size: 11px; font-weight: 600; color: var(--ink-700);
}
.gen-zoom-btn svg { width: 14px; height: 14px; }
.gen-zoom-btn:hover:not(:disabled) { background: var(--cream-dim); color: var(--ink-900); }
.gen-zoom-btn:disabled { opacity: 0.4; cursor: default; }
.gen-zoom-text { padding: 0 10px; text-transform: uppercase; letter-spacing: var(--label-caps-tracking); }
.gen-zoom-level {
    min-width: 46px; height: 28px; padding: 0 4px; text-align: center;
    border: 0; background: transparent; cursor: pointer;
    font-family: var(--font-sans); font-size: 11px; font-weight: 700;
    font-variant-numeric: tabular-nums; color: var(--ink-900);
}
.gen-zoom-level:hover:not(:disabled) { background: var(--cream-dim); }
.gen-zoom-level:disabled { cursor: default; }
.gen-zoom-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--ink-15); }

/* "Printed paper" feel — sharp shadow simule l'impression sur cream desk. */
.gen-document-preview {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    box-shadow: var(--shadow-sharp);
    padding: 60px 50px;
    min-height: 900px;
    font-family: var(--font-document);
    color: var(--ink-900);
}
.gen-doc-header { text-align: center; margin-bottom: 40px; }
.gen-doc-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
    color: var(--ink-900);
}
.gen-doc-ref { font-size: 13px; color: var(--ink-700); margin-bottom: 30px; line-height: 1.6; }
.gen-doc-parties { text-align: left; margin-bottom: 30px; line-height: 1.8; color: var(--ink-900); }
.gen-doc-parties strong { display: block; margin-top: 15px; }
.gen-doc-jurisdiction { text-align: center; margin-bottom: 40px; padding: 15px; border: 1px solid var(--ink-15); }
.gen-doc-section { margin-bottom: 30px; }
.gen-doc-section-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--ink-15);
    padding-bottom: 8px;
    color: var(--ink-900);
}
.gen-doc-paragraph { text-align: justify; line-height: 1.8; margin-bottom: 15px; font-size: 13px; color: var(--ink-900); }
.para-number { font-weight: 700; color: var(--ink-900); margin-right: 6px; }
.gen-doc-paragraph .piece-ref,
.gen-doc-paragraph .piece-ref.expertise,
.gen-doc-paragraph .piece-ref.contentieux { color: var(--gold-deep-text); font-weight: 600; }
.gen-doc-quote {
    margin: 15px 30px;
    padding: 14px 16px;
    background: var(--gold-tint);
    border-left: 3px solid var(--gold);
    font-style: italic;
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-700);
}
.gen-doc-quote.contentieux { border-left-color: var(--gold); }
.gen-doc-comment { font-style: italic; color: var(--ink-700); margin-top: 10px; margin-bottom: 4px; }
.gen-doc-year,
.gen-doc-year.expertise,
.gen-doc-year.contentieux {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--gold-deep-text);
    margin: 30px 0 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gold);
    letter-spacing: 0.04em;
}
.gen-doc-event-date { font-weight: 700; color: var(--ink-900); }
.gen-doc-subsection { margin-left: 20px; margin-bottom: 20px; }
.gen-doc-subsection-title { font-weight: 700; margin-bottom: 10px; color: var(--ink-900); }
.gen-doc-motifs { margin-top: 40px; }
.gen-doc-motifs-title { font-family: var(--font-serif); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; margin-bottom: 20px; color: var(--ink-900); }
.gen-doc-motifs-list { margin-left: 20px; }
.gen-doc-motifs-item { margin-bottom: 10px; line-height: 1.6; color: var(--ink-900); }
.gen-doc-signature { margin-top: 60px; text-align: right; color: var(--ink-900); }
.gen-doc-bordereau { margin-top: 50px; border-top: 1px solid var(--ink-15); padding-top: 30px; }
.gen-doc-bordereau-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 20px;
    color: var(--ink-900);
}
.gen-doc-bordereau-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.gen-doc-bordereau-table th, .gen-doc-bordereau-table td { border: 1px solid var(--ink-15); padding: 8px 12px; text-align: left; color: var(--ink-900); }
.gen-doc-bordereau-table th {
    background: var(--cream-dim);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
}

.gen-doc-html { font-family: var(--font-document); font-size: 13px; line-height: 1.8; text-align: justify; color: var(--ink-900); }
.gen-doc-html p { margin: 0 0 12px; }
.gen-doc-html ul, .gen-doc-html ol { margin: 0 0 12px 24px; padding-left: 16px; }
.gen-doc-html li { margin-bottom: 4px; }
.gen-doc-html blockquote {
    margin: 12px 24px;
    padding: 10px 14px;
    background: var(--gold-tint);
    border-left: 3px solid var(--gold);
    font-style: italic;
    color: var(--ink-700);
}
.gen-doc-html strong { font-weight: 700; }
.gen-doc-html em { font-style: italic; }
.gen-doc-html u { text-decoration: underline; }

/* DocumentModelView helpers — preview renders the same model as the .docx/.pdf output */
.gen-doc-signature-line { text-align: right; margin-bottom: 4px; }
.gen-doc-list-item { margin-left: 20px; }
.gen-doc-page-break { border-top: 1px dashed var(--ink-15); margin: 24px 0; }

/* ============================================================
   Inline editing in the generator preview ("Notion-like")
   Specs: implementation/INLINE-EDITING.md + GENERIC-SECTIONS.md (Lot A)
   Wireframes: 06-generation-dire.html · 06-generation-conclusions.html
   Inline body (FreeText) = editable in place; list sections (Moyens,
   Demandes) = editable items inside a panel-handing frame; data views
   (Facts, Bordereau) = read-only + hand-off to the Structure panel.
   ============================================================ */
.gen-doc-inline-section { position: relative; }

/* Shared floating hint (pill at the top-right of the hovered section) */
.gen-doc-edit-hint {
    position: absolute;
    top: -16px; right: -12px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: var(--ink-900);
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 10px; font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    opacity: 0; pointer-events: none;
    transition: opacity 0.12s ease;
}
.gen-doc-edit-hint svg { width: 12px; height: 12px; stroke-width: 2; }

/* Auto sections: read-only, parchment hint pointing to the Structure panel */
.gen-doc-inline-section.is-auto:hover { outline: 1px dashed var(--ink-15); outline-offset: 12px; }
.gen-doc-auto-hint { background: var(--parchment); color: var(--ink-700); cursor: pointer; }
.gen-doc-inline-section.is-auto:hover .gen-doc-edit-hint { opacity: 1; }

/* FreeText: gold affordance on hover, ink frame while editing */
.gen-doc-inline-section.is-editable { cursor: text; }
.gen-doc-inline-section.is-editable:hover { outline: 1px dashed var(--gold); outline-offset: 12px; }
.gen-doc-inline-section.is-editable:hover .gen-doc-edit-hint { opacity: 1; }
/* margin-bottom reserves the frame's footprint (offset + border) in the layout, so the
   ink frame can never sit on top of the section below, whatever the editor's height
   (user feedback 6 juil. 2026). Bottom only: a top margin would shift the text between
   the click and the caret placement. */
.gen-doc-inline-section.is-editing { outline: 1px solid var(--ink-900); outline-offset: 12px; cursor: auto; margin-bottom: 18px; }
.gen-doc-inline-section.is-editing:hover .gen-doc-edit-hint { opacity: 0; }

/* List sections (GENERIC-SECTIONS.md Lot A — ex-Moyens/Demandes): the frame (heading,
   intro/outro) hands over to the panel like an auto section, while each item inside is
   its own editable zone with the FreeText affordance language, tighter offset. */
.gen-doc-inline-section.is-frame { cursor: pointer; }
.gen-doc-inline-section.is-frame:hover { outline: 1px dashed var(--ink-15); outline-offset: 12px; }
.gen-doc-frame-hint { background: var(--parchment); color: var(--ink-700); cursor: pointer; }
.gen-doc-inline-section.is-frame:hover .gen-doc-frame-hint { opacity: 1; }
/* Hovering an item retargets the affordance: mute the frame's outline and hint */
.gen-doc-inline-section.is-frame:hover:has(.gen-doc-inline-item:hover) { outline: none; }
.gen-doc-inline-section.is-frame:hover:has(.gen-doc-inline-item:hover) .gen-doc-frame-hint { opacity: 0; }

.gen-doc-inline-item { position: relative; cursor: text; }
.gen-doc-inline-item:hover { outline: 1px dashed var(--gold); outline-offset: 6px; }
/* Same layout reserve as the section-level frame (offset 6px + border). */
.gen-doc-inline-item.is-editing { outline: 1px solid var(--ink-900); outline-offset: 6px; cursor: auto; margin-bottom: 12px; }
.gen-doc-inline-item:hover .gen-doc-title-editable { border-bottom-color: var(--gold); }
/* Item title input inherits the subsection line metrics (bold, document font) */
.gen-doc-inline-item .gen-doc-title-input { font-weight: inherit; }

/* Persistent while a zone is being edited: the bubble theme has no visible chrome,
   so this pill teaches the two non-obvious gestures — select text to reveal the
   formatting toolbar, Escape to finish (user feedback 6 juil. 2026). Placed after
   the is-editing:hover rule above so it wins and stays visible. */
.gen-doc-editing-hint { opacity: 1; }
.gen-doc-inline-section.is-editing:hover .gen-doc-editing-hint { opacity: 1; }

/* FreeText section title renamed in place (the numeral stays server-computed) */
.gen-doc-title-editable { border-bottom: 1px dashed transparent; cursor: text; }
.gen-doc-inline-section.is-editable:hover .gen-doc-title-editable { border-bottom-color: var(--gold); }
.gen-doc-title-input {
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ink-900);
    outline: none;
    padding: 0;
    width: min(70%, 420px);
}

/* In-place bubble-themed Quill editor: same type metrics as the server rendering
   (gen-doc-paragraph), zero chrome — the zone must still read as "the document". */
.gen-doc-inline-surface.ql-container { font-family: var(--font-document); font-size: 13px; }
.gen-doc-inline-surface .ql-editor {
    padding: 0;
    font-family: var(--font-document);
    font-size: 13px;
    line-height: 1.8;
    text-align: justify;
    color: var(--ink-900);
    caret-color: var(--ink-900);
}
.gen-doc-inline-surface .ql-editor p { margin-bottom: 15px; }
.gen-doc-inline-surface .ql-editor ul,
.gen-doc-inline-surface .ql-editor ol { margin: 0 0 15px 20px; }
/* The editor box must hug the text exactly like the rendered zone: in the rendered
   preview the last paragraph's bottom margin collapses OUT of the zone box, but
   .ql-editor is a scroll container (BFC) that would keep those 15px inside the box —
   making the editing frame ~15px taller than the hover frame and pushing it onto the
   section below (user feedback 6 juil. 2026). */
.gen-doc-inline-surface .ql-editor > :last-child { margin-bottom: 0; }
.gen-doc-inline-surface .ql-editor blockquote {
    margin: 15px 30px;
    padding: 14px 16px;
    background: var(--gold-tint);
    border-left: 3px solid var(--gold);
    font-style: italic;
    color: var(--ink-700);
}

/* Bubble toolbar restyled to Prestige: ink background, cream icons / gold hover,
   sharp corners. The bubble lives INSIDE the zoomed container, so its positioning
   follows the CSS zoom. */
.gen-doc-inline-surface .ql-tooltip {
    background: var(--ink-900);
    border-radius: 0;
    box-shadow: var(--shadow-sharp);
    z-index: 60;
}
.gen-doc-inline-surface .ql-tooltip-arrow { display: none; }
.gen-doc-inline-surface .ql-toolbar .ql-stroke { stroke: var(--cream); }
.gen-doc-inline-surface .ql-toolbar .ql-fill { fill: var(--cream); }
.gen-doc-inline-surface .ql-toolbar button:hover .ql-stroke,
.gen-doc-inline-surface .ql-toolbar button.ql-active .ql-stroke { stroke: var(--gold); }
.gen-doc-inline-surface .ql-toolbar button:hover .ql-fill,
.gen-doc-inline-surface .ql-toolbar button.ql-active .ql-fill { fill: var(--gold); }

/* Visual hand-off: gold flash of the targeted Structure section in the sidebar */
.struct-section.flash { outline: 2px solid var(--gold); outline-offset: 1px; }

/* Rich text editor (Quill) — Prestige 2.2e */
.rich-text-editor-wrapper { position: relative; }
.rte-expand-bar { position: absolute; top: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 12px; }
.rte-expand-title { display: none; }
.rte-expand-btn {
    width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ink-15); background: var(--cream); color: var(--ink-500); cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.rte-expand-btn:hover { color: var(--ink-900); border-color: var(--ink-900); }
.rte-expand-btn svg { width: 14px; height: 14px; }

/* Agrandissement plein écran : le wrapper devient le backdrop, le host la carte centrée.
   La même instance Quill reste montée (aucune ré-init) — on ne fait que restyler le conteneur. */
.rich-text-editor-wrapper.is-expanded {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(31, 41, 55, 0.55);
    display: flex; flex-direction: column;
    padding: 5vh 5vw;
}
.rich-text-editor-wrapper.is-expanded .rte-expand-bar {
    position: static; align-self: stretch; justify-content: space-between;
    padding: 12px 16px; background: var(--ink-900); border-bottom: 1px solid var(--gold);
}
.rich-text-editor-wrapper.is-expanded .rte-expand-title {
    display: block; font-family: var(--font-serif); font-size: 15px; color: var(--cream); font-weight: 500;
}
.rich-text-editor-wrapper.is-expanded .rte-expand-btn { background: transparent; border-color: rgba(253,251,247,0.3); color: var(--cream); }
.rich-text-editor-wrapper.is-expanded .rte-expand-btn:hover { border-color: var(--gold); color: var(--gold); }
.rich-text-editor-wrapper.is-expanded .rich-text-editor-host {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    background: var(--white); box-shadow: 0 24px 60px rgba(31,41,55,0.4);
}
.rich-text-editor-wrapper.is-expanded .rich-text-editor-surface { flex: 1; min-height: 0 !important; }
.rich-text-editor-host { position: relative; }
.rich-text-editor-surface { background: var(--white); }
.rich-text-editor-host .ql-toolbar { border-color: var(--ink-15); border-radius: 0; background: var(--cream-dim); }
.rich-text-editor-host .ql-toolbar .ql-stroke { stroke: var(--ink-700); }
.rich-text-editor-host .ql-toolbar .ql-fill { fill: var(--ink-700); }
.rich-text-editor-host .ql-toolbar button:hover .ql-stroke,
.rich-text-editor-host .ql-toolbar button.ql-active .ql-stroke { stroke: var(--ink-900); }
.rich-text-editor-host .ql-toolbar button:hover .ql-fill,
.rich-text-editor-host .ql-toolbar button.ql-active .ql-fill { fill: var(--ink-900); }
/* Le min-height inline (RichTextEditor.MinHeight) est pose sur .ql-container. On en fait un flex
   column pour que .ql-editor (la zone contenteditable) remplisse toute la hauteur visible. Sans
   ca, .ql-editor { min-height: 100% } ne se resout pas (le conteneur n'a pas de height definie,
   seulement un min-height) : il reste un bandeau vide en bas qui, au clic, ne focus pas l'editeur. */
.rich-text-editor-host .ql-container { display: flex; flex-direction: column; border-color: var(--ink-15); border-radius: 0; font-family: var(--font-sans); font-size: 13px; color: var(--ink-700); }
.rich-text-editor-host .ql-editor { flex: 1 1 auto; padding: 12px; }
/* Placeholder natif Quill (option `placeholder`) — remplace l'ancien noeud Blazor absolu.
   Aligne sur le padding 12px de .ql-editor et reprend le ton discret de --ink-400. */
.rich-text-editor-host .ql-editor.ql-blank::before { left: 12px; right: 12px; color: var(--ink-400); font-size: 13px; font-style: italic; }

.gen-export-stats { display: flex; gap: 28px; padding: 14px 20px; background: var(--cream); border-top: 1px solid var(--ink-15); }
.gen-export-stat { text-align: center; }
.gen-export-stat-value,
.gen-export-stat-value.expertise,
.gen-export-stat-value.contentieux {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1;
    letter-spacing: -0.02em;
}
.gen-export-stat-label {
    font-size: 10px;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    font-weight: 700;
    margin-top: 4px;
}

.gen-preview-empty { text-align: center; color: var(--ink-400); padding: 60px 20px; font-size: 14px; font-style: italic; }

/* ==========================================================================
   Documents tab (generated documents) — DocumentsTabPage + DraftsList /
   ExportsHistoryList table rendering. Pattern : wireframes/02-dossier-documents.html.
   Data-table Prestige : header cream-dim caps, wax-seal first cell, format/status
   pills, hover accent. Ported from the wireframe's inline styles.
   ========================================================================== */

/* Generate CTA bar */
.generate-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    margin-bottom: var(--space-md);
}
.generate-bar-text { display: flex; flex-direction: column; gap: 3px; }
.generate-bar-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}
.generate-bar-sub { font-size: 12px; color: var(--ink-500); }
.generate-bar-actions { display: flex; gap: 10px; align-items: center; }

/* Flush panel body so the table sits edge-to-edge inside the panel */
.panel-content.flush { padding: 0; }
.doc-table-wrap { overflow-x: auto; }

.doc-table { width: 100%; border-collapse: collapse; }
.doc-table thead th {
    text-align: left;
    padding: 11px 16px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    color: var(--ink-700);
    background: var(--cream-dim);
    border-bottom: 1px solid var(--ink-15);
    white-space: nowrap;
}
.doc-table thead th.num, .doc-table td.num { text-align: right; }
.doc-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ink-15);
    font-size: 13px;
    color: var(--ink-700);
    vertical-align: middle;
}
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table tbody tr:hover td { background: var(--cream-dim); }
.doc-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* Wax seal (gold on ink-900 = admitted a11y exception, cf. avatars) */
.doc-cell-seal {
    width: 34px; height: 34px; flex-shrink: 0;
    background: var(--ink-900); color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-serif); font-size: 15px; font-weight: 500;
}
.doc-cell-seal.draft { background: var(--cream-dim); color: var(--gold-deep-text); border: 1px solid var(--gold); }
.doc-cell-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-cell-name {
    font-family: var(--font-serif); font-size: 14px; font-weight: 500;
    color: var(--ink-900); letter-spacing: -0.01em; line-height: 1.3;
}
.doc-cell-sub { font-size: 11px; color: var(--ink-500); }
.doc-format-pill {
    display: inline-block; padding: 2px 8px;
    font-size: 10px; font-weight: 700; letter-spacing: var(--label-caps-tracking); text-transform: uppercase;
    background: var(--cream-dim); border: 1px solid var(--ink-15); color: var(--ink-700);
}
.doc-status-pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
    font-size: 10px; font-weight: 700; letter-spacing: var(--label-caps-tracking); text-transform: uppercase;
    background: var(--gold-soft); border: 1px solid var(--gold); color: var(--gold-deep-text);
}
.doc-status-dot-pill { width: 5px; height: 5px; background: currentColor; display: inline-block; }
.doc-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-table td.actions-cell { text-align: right; white-space: nowrap; }
.doc-table-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.doc-icon-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; color: var(--ink-500);
    border: 1px solid transparent; background: none; cursor: pointer;
}
.doc-icon-action:hover { color: var(--ink-900); border-color: var(--ink-15); background: var(--white); }
.doc-icon-action.danger:hover { color: var(--bordeaux); border-color: var(--bordeaux); }
.doc-icon-action svg { width: 16px; height: 16px; }

@media (max-width: 1200px) {
    .generation-page-wrapper { height: auto; min-height: 100vh; overflow: visible; }
    .generation-page { grid-template-columns: 1fr; overflow: visible; }
    .generation-options { max-height: 800px; }
}

/* ==========================================================================
   Profile + Cabinet (5.40 sub-livraison 2.3h — Prestige Legal Authority)
   Pattern : wireframes/11-profil.html + wireframes/10-cabinet.html.
   Avatar = sceau de cire (square ink-900 + gold initials serif).
   ========================================================================== */

.profile-header { display: flex; align-items: flex-start; gap: 32px; margin-bottom: 32px; }
.profile-avatar-section { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 0;
    background: var(--ink-900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 44px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--gold);
    text-transform: uppercase;
    box-shadow: var(--shadow-sharp);
}
.profile-avatar-actions { display: flex; gap: 8px; }
.profile-info { flex: 1; }
.profile-name {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink-900);
    margin: 0 0 4px 0;
    line-height: 1.15;
}
.profile-role { font-size: 15px; color: var(--ink-500); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-role-badge {
    background: var(--ink-900);
    color: var(--cream);
    padding: 3px 10px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
}
.profile-meta { display: flex; gap: 24px; flex-wrap: wrap; }
.profile-meta-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-700); }
.profile-meta-item svg { width: 16px; height: 16px; color: var(--ink-500); stroke-width: 1.5; }

.profile-tabs { display: flex; border-bottom: 1px solid var(--ink-15); margin-bottom: 32px; gap: 0; }
.profile-tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-500);
    cursor: pointer;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.12s ease, border-color 0.12s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.profile-tab:hover { color: var(--ink-900); }
.profile-tab.active { color: var(--ink-900); border-bottom-color: var(--gold); font-weight: 600; }
.profile-tab svg { width: 16px; height: 16px; stroke-width: 1.5; }
.profile-tab.disabled,
.profile-tab.disabled:hover { color: var(--ink-300); cursor: not-allowed; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.profile-section { margin-bottom: 32px; }
.profile-section-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-900);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    gap: 10px;
}
.profile-section-title svg { width: 18px; height: 18px; color: var(--gold-deep); stroke-width: 1.5; }

.profile-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--ink-15); }

.profile-readonly-input { background: var(--cream-dim); cursor: not-allowed; color: var(--ink-700); }

.security-banner {
    padding: 14px 18px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-left: 3px solid var(--gold);
    border-radius: 0;
    margin-bottom: 24px;
    font-size: 13.5px;
    color: var(--ink-700);
    line-height: 1.55;
}
.security-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    margin-bottom: 12px;
}
.security-item:last-child { margin-bottom: 0; }
.security-item-info { display: flex; align-items: center; gap: 16px; }
.security-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 0;
    background: var(--white);
    border: 1px solid var(--ink-15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-700);
}
.security-item-icon svg { width: 20px; height: 20px; stroke-width: 1.5; }
.security-item-title { font-size: 14px; font-weight: 600; color: var(--ink-900); margin-bottom: 2px; }
.security-item-desc { font-size: 12.5px; color: var(--ink-500); }

.profile-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 0;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-sharp);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: profile-toast-in 0.2s ease;
}
.profile-toast.success { background: var(--toast-success-bg); color: var(--toast-success-fg); border: 1px solid var(--toast-success-border); }
.profile-toast.error { background: var(--toast-error-bg); color: var(--toast-error-fg); border: 1px solid var(--toast-error-border); }
.profile-toast svg { width: 18px; height: 18px; }
@keyframes profile-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.profile-inline-feedback {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    margin-right: auto;
    animation: profile-toast-in 0.2s ease;
}
.profile-inline-feedback.success { background: var(--toast-success-bg); color: var(--toast-success-fg); border: 1px solid var(--toast-success-border); }
.profile-inline-feedback.error { background: var(--toast-error-bg); color: var(--toast-error-fg); border: 1px solid var(--toast-error-border); }
.profile-inline-feedback svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Cabinet logo upload */
.logo-upload { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.logo-preview {
    width: 100px;
    height: 100px;
    border: 1px dashed var(--ink-15);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ink-500);
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
    background: var(--cream-dim);
    position: relative;
    overflow: hidden;
}
.logo-preview:hover { border-color: var(--gold); color: var(--gold-deep-text); background: var(--gold-soft); border-style: solid; }
.logo-preview svg { width: 28px; height: 28px; margin-bottom: 4px; stroke-width: 1.5; }
.logo-preview span { font-size: 11px; font-weight: 700; letter-spacing: var(--label-caps-tracking); text-transform: uppercase; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-upload-info { font-size: 13px; color: var(--ink-500); flex: 1; line-height: 1.55; }
.logo-upload-info strong { display: block; font-family: var(--font-serif); font-size: 15px; font-weight: 500; color: var(--ink-900); margin-bottom: 4px; letter-spacing: -0.01em; }
.logo-upload-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Cabinet members table */
.member-info { display: flex; align-items: center; gap: 12px; }
.member-info .avatar {
    width: 36px;
    height: 36px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 500;
    color: var(--gold);
    flex-shrink: 0;
    background: var(--ink-900);
    text-transform: uppercase;
    letter-spacing: -0.01em;
}
.member-info .name { font-weight: 600; color: var(--ink-900); }
.cabinet-table { width: 100%; border-collapse: collapse; }
.cabinet-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    color: var(--ink-700);
    font-weight: 700;
    border-bottom: 1px solid var(--ink-15);
    background: var(--cream-dim);
}
.cabinet-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--ink-15);
    font-size: 14px;
    color: var(--ink-700);
    vertical-align: middle;
}
.cabinet-table tr:last-child td { border-bottom: none; }

/* Pending invitation rows (5.37): muted seal avatar + inline resend/revoke actions */
.member-info .avatar.avatar-pending { background: var(--ink-300); color: var(--ink-700); }
.cabinet-table .actions-cell { display: flex; gap: 6px; align-items: center; }

/* Preferences grid */
.pref-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 24px; }
@media (max-width: 768px) { .pref-grid { grid-template-columns: 1fr; } }

/* ============================================
   Calendar / Deadlines (Sprint 5 task 5.34)
   Wireframe-fidele : 08-calendrier-contentieux.html / 08-calendrier-expertise.html
   ============================================ */
.calendar-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}
@media (max-width: 1100px) {
    .calendar-layout { grid-template-columns: 1fr; }
}

/* Calendar nav header */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.calendar-nav-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.calendar-nav-arrows { display: flex; gap: 4px; }
.calendar-nav-btn {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ink-15);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink-500);
    cursor: pointer;
    transition: all 0.2s;
}
.calendar-nav-btn:hover { background: var(--cream); border-color: var(--ink-400); color: var(--ink-900); }
.calendar-nav-btn svg { width: 18px; height: 18px; }
.calendar-month-title {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--ink-900);
    min-width: 200px;
}
.btn-today {
    padding: 8px 16px;
    border: 1px solid var(--ink-15);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    cursor: pointer;
}
.btn-today:hover { background: var(--cream); }

/* View tabs (Mois / Semaine) */
.view-tabs {
    display: flex;
    gap: 4px;
    background: var(--cream-dim);
    padding: 4px;
    border-radius: var(--radius);
}
.view-tab {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-500);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.view-tab:hover:not(:disabled) { color: var(--ink-900); }
.view-tab.active { background: var(--white); color: var(--ink-900); border: 1px solid var(--ink-15); }
.view-tab:disabled { cursor: not-allowed; opacity: 0.5; }
.view-tab svg { width: 16px; height: 16px; }

/* Calendar grid card */
.calendar-card {
    background: var(--white);
    border-radius: 0;
    border: 1px solid var(--ink-15);
    overflow: hidden;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.calendar-day-header {
    padding: 12px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--cream);
    border-bottom: 1px solid var(--ink-15);
}

.calendar-day {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--cream-dim);
    border-bottom: 1px solid var(--cream-dim);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day:hover:not(.other-month) { background: var(--cream); }
.calendar-day.other-month { background: var(--cream); cursor: default; }
.calendar-day.other-month .day-number { color: var(--ink-15); }

.day-number {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-700);
    margin-bottom: 6px;
    line-height: 1;
    height: 18px;
    display: inline-flex;
    align-items: center;
}

/* Today highlight: segment-aware soft tint */
.calendar-day.today.expertise { background: var(--expertise-soft); }
.calendar-day.today.contentieux { background: var(--contentieux-soft); }
.calendar-day.today .day-number {
    color: var(--white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 4px;
}
.calendar-day.today.expertise .day-number { background: var(--expertise); }
.calendar-day.today.contentieux .day-number { background: var(--contentieux); }

/* Day events (pills inside cells) */
.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.day-event {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    border: none;
    text-align: left;
    line-height: 1.4;
}
.day-event:hover { filter: brightness(0.95); }
.day-event.hearing,
.day-event.deadline-urgent {
    background: var(--bordeaux-soft);
    color: var(--bordeaux);
    border-left: 2px solid var(--bordeaux);
}
.day-event.expertise-meeting {
    background: var(--expertise-soft);
    color: var(--expertise-text);
    border-left: 2px solid var(--expertise);
}
.day-event.filing {
    background: var(--contentieux-soft);
    color: var(--contentieux-text);
    border-left: 2px solid var(--contentieux);
}
.day-event.other {
    background: var(--cream-dim);
    color: var(--ink-700);
    border-left: 2px solid var(--ink-400);
}
.day-event.done { opacity: 0.55; text-decoration: line-through; }

.day-event-more {
    font-size: 10px;
    color: var(--ink-500);
    padding: 0 6px;
    cursor: pointer;
}

/* Legend */
.calendar-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: var(--cream);
    border-top: 1px solid var(--cream-dim);
    font-size: 12px;
    color: var(--ink-500);
    flex-wrap: wrap;
}
.calendar-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}
.calendar-legend-dot.expertise-meeting { background: var(--expertise); }
.calendar-legend-dot.filing { background: var(--contentieux); }
.calendar-legend-dot.hearing { background: var(--bordeaux); }
.calendar-legend-dot.other { background: var(--ink-400); }

/* Right sidebar (upcoming) */
.calendar-sidebar { display: flex; flex-direction: column; gap: 20px; }
.upcoming-card {
    background: var(--white);
    border-radius: 0;
    border: 1px solid var(--ink-15);
    overflow: hidden;
}
.upcoming-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--cream-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.upcoming-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-900);
}
.upcoming-count {
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.upcoming-count.expertise { background: var(--expertise); }
.upcoming-count.contentieux { background: var(--contentieux); }

.upcoming-list {
    max-height: 480px;
    overflow-y: auto;
}
.upcoming-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--cream-dim);
    cursor: pointer;
    transition: background 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    width: 100%;
    text-align: left;
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-item:hover { background: var(--cream); }
.upcoming-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}
.upcoming-item-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-500);
}
.upcoming-item-urgency {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.upcoming-item-urgency.urgent { background: var(--bordeaux-soft); color: var(--bordeaux); }
.upcoming-item-urgency.soon { background: var(--status-warn-soft); color: var(--status-warn-text); }
.upcoming-item-urgency.normal { background: var(--cream-dim); color: var(--ink-500); }
.upcoming-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upcoming-item-meta {
    font-size: 12px;
    color: var(--ink-500);
    display: flex;
    align-items: center;
    gap: 8px;
}
.upcoming-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.upcoming-item-dot.expertise-meeting { background: var(--expertise); }
.upcoming-item-dot.filing { background: var(--contentieux); }
.upcoming-item-dot.hearing { background: var(--bordeaux); }
.upcoming-item-dot.other { background: var(--ink-400); }

.upcoming-empty {
    padding: 32px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-500);
}
.upcoming-empty svg {
    width: 32px;
    height: 32px;
    color: var(--ink-15);
    margin-bottom: 8px;
}

/* V1.0+ deferred features hint */
.calendar-feature-deferred {
    padding: 12px 20px;
    background: var(--cream);
    border-top: 1px solid var(--cream-dim);
    text-align: center;
    font-size: 11px;
    color: var(--ink-500);
    line-height: 1.5;
}

/* Deadline form dialog (global, Prestige 2.2d) */
.deadline-form-dialog {
    max-width: 600px;
    width: 90vw;
}
.deadline-form-dialog .confirm-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--ink-15);
    align-items: flex-start;
}
.deadline-form-dialog .confirm-body { padding: 20px 24px; }
.deadline-form-dialog .form-error-banner { margin: 16px 24px 0; }

.confirm-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--ink-500);
}

.deadline-form-dialog-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.deadline-form-dialog-actions-right {
    display: flex;
    gap: 8px;
}

.btn-text-danger {
    background: transparent;
    border: none;
    color: var(--bordeaux);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}
.btn-text-danger:hover:not(:disabled) {
    background: var(--bordeaux-soft);
}
.btn-text-danger:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-text-danger svg { width: 16px; height: 16px; }

/* ============================================
   Case overview deadline panel (5.40 sub-livraison 2.3c, Prestige native)
   Pattern : wireframes/02-dossier-*.html — Réunions / Calendrier procédural
   Nom .deadline-panel-* pour éviter collision avec month-grid .calendar-day.
   Status (urgent/upcoming/normal) accents bordeaux/gold/cream-dim.
   ============================================ */
.deadline-panel-list {
    display: flex;
    flex-direction: column;
}
.deadline-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--space-sm);
    border: none;
    border-bottom: 1px solid var(--ink-15);
    color: inherit;
    text-decoration: none;
    transition: background 0.12s ease;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.deadline-panel-item:last-child { border-bottom: none; }
.deadline-panel-item:hover { background: var(--cream-dim); color: inherit; text-decoration: none; }

.deadline-panel-date {
    flex-shrink: 0;
    min-width: 48px;
    text-align: center;
    padding: 6px 4px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-radius: 0;
}
.deadline-panel-day {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink-900);
}
.deadline-panel-month {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--ink-500);
    letter-spacing: var(--label-caps-tracking);
    font-weight: 700;
    margin-top: 2px;
}

.deadline-panel-info { flex: 1; min-width: 0; }
.deadline-panel-title {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.deadline-panel-meta {
    font-size: 11px;
    color: var(--ink-500);
    margin-top: 2px;
}

.deadline-panel-status {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    white-space: nowrap;
    border: 1px solid var(--ink-15);
}
.deadline-panel-status.urgent   { background: var(--bordeaux-soft); color: var(--bordeaux);  border-color: var(--bordeaux); }
.deadline-panel-status.upcoming { background: var(--gold-soft);     color: var(--gold-deep-text); border-color: var(--gold); }
.deadline-panel-status.normal   { background: var(--cream-dim);     color: var(--ink-500);   border-color: var(--ink-15); }

/* ============================================
   Dashboard upcoming deadlines (Sprint 5 task 5.35)
   ============================================ */
.deadline-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px var(--space-md);
    border-bottom: 1px solid var(--ink-15);
    color: inherit;
    text-decoration: none;
    transition: background 0.12s ease;
}

.deadline-row:last-child { border-bottom: none; }
.deadline-row:hover { background: var(--cream-dim); color: inherit; text-decoration: none; }

/* Status accent bar 3px on the left edge — Prestige row pattern */
.deadline-row.soon { border-left: 3px solid var(--urgency-soon-border); }
.deadline-row.near { border-left: 3px solid var(--urgency-near-border); }
.deadline-row.far  { border-left: 3px solid var(--ink-300); }

.deadline-row-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 90px;
    line-height: 1.2;
}

.deadline-row-day {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

.deadline-row.soon .deadline-row-day { color: var(--urgency-soon-text); }
.deadline-row.near .deadline-row-day { color: var(--urgency-near-text); }

.deadline-row-fulldate {
    font-size: 11px;
    color: var(--ink-500);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.deadline-row-body { flex: 1; min-width: 0; }

.deadline-row-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-900);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.deadline-row-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: var(--ink-500);
    flex-wrap: wrap;
}

.deadline-row-case-ref {
    font-weight: 700;
    color: var(--ink-700);
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    font-size: 11px;
}

.deadline-row-case-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.deadline-row-type-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 0;
    border: 1px solid var(--ink-15);
    background: var(--white);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
    color: var(--ink-700);
}

.deadline-row-type-pill.hearing           { background: var(--bordeaux-soft);    color: var(--bordeaux);     border-color: var(--bordeaux); }
.deadline-row-type-pill.expertise-meeting { background: var(--expertise-soft);   color: var(--expertise-text);    border-color: var(--expertise); }
.deadline-row-type-pill.filing            { background: var(--cream-dim);        color: var(--ink-900);      border-color: var(--ink-15); }
.deadline-row-type-pill.other             { background: var(--cream-dim);        color: var(--ink-500);      border-color: var(--ink-15); }

.deadline-row-chevron { color: var(--ink-400); flex-shrink: 0; }
.deadline-row:hover .deadline-row-chevron { color: var(--ink-900); }

/* ============================================================================
   Error pages (404 / 500 / maintenance) — 5.40 sub-livraison 2.2h Prestige
   ============================================================================ */
.error-page {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--cream);
}
.error-page--standalone {
    min-height: 100vh;
    background: var(--cream);
}
.error-card {
    max-width: 480px;
    width: 100%;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--shadow-sharp);
}
.error-illustration {
    width: 200px;
    height: 160px;
    margin: 0 auto 24px;
    display: block;
}
.error-code {
    font-family: var(--font-serif);
    font-size: 31px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink-900);
    margin-bottom: 12px;
    line-height: 1.2;
}
.error-message {
    font-size: 15.5px;
    color: var(--ink-700);
    margin-bottom: 28px;
    line-height: 1.65;
}
.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.error-trace {
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-500);
    word-break: break-all;
}

/* ============================================================================
   CaseMembers — refonte 5.41 paire 8 (Prestige Legal Authority)
   Wireframe : wireframes/02-dossier-membres.html
   Pattern member-row : avatar sceau de cire 44×44 + name+email + role-badge
   per-quality + invited-at + actions inline.
   ============================================================================ */

.case-members-add {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.case-members-add-field { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.case-members-add-field:nth-child(2) { flex: 0 0 220px; }

.case-members-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--ink-500);
}
.case-members-hint.text-danger { color: var(--bordeaux); }

.case-members-list {
    margin-top: 24px;
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    overflow: hidden;
}

.case-members-list-header,
.case-members-list .member-row {
    display: grid;
    /* 5 colonnes : avatar 44px | nom (flex) | rôle 180px | invité le 140px | actions 220px */
    grid-template-columns: 44px minmax(0, 1fr) 180px 140px 220px;
    gap: 16px;
    align-items: center;
    padding: 12px 20px;
}
.case-members-list-header {
    background: var(--cream-dim);
    border-bottom: 1px solid var(--ink-15);
}
.case-members-list-header .case-members-list-col {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: var(--label-caps-tracking);
}
/* Alignement des colonnes : NOM à gauche (cols 1-2), RÔLE / INVITÉ LE / actions centrés (cols 3-5) */
.case-members-list-header .case-members-list-col:nth-child(3),
.case-members-list-header .case-members-list-col:nth-child(4),
.case-members-list-header .case-members-list-col:nth-child(5) {
    text-align: center;
}

.case-members-list .member-row {
    padding-block: 14px;
    border-bottom: 1px solid var(--ink-15);
    transition: background 0.12s ease;
}
.case-members-list .member-row:last-child { border-bottom: none; }
.case-members-list .member-row:hover { background: var(--cream-dim); }

/* Scoped override of .member-avatar (default 32px round used in stacked avatars) */
.case-members-list .member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 0;
    border: none;
    margin-left: 0;
    background: var(--ink-900);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.case-members-list .member-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* override .member-info { align-items: center; } global rule */
    gap: 2px;
    min-width: 0;
}
.case-members-list .member-name {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-900);
    line-height: 1.3;
}
.case-members-list .member-email {
    font-size: 12px;
    color: var(--ink-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-members-list .member-role-badge {
    justify-self: center;
    padding: 3px 10px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    background: var(--cream-dim);
    border: 1px solid var(--ink-15);
    border-radius: 0;
    color: var(--ink-700);
    white-space: nowrap;
}
.case-members-list .member-role-badge.owner        { background: var(--gold-soft);        border-color: var(--gold);        color: var(--gold-deep-text); }
.case-members-list .member-role-badge.collaborator { background: var(--expertise-soft);   border-color: var(--expertise);   color: var(--expertise-text); }
.case-members-list .member-role-badge.viewer       { background: var(--cream-dim);        border-color: var(--ink-15);      color: var(--ink-700); }
.case-members-list .member-role-badge.client       { background: var(--contentieux-soft); border-color: var(--contentieux); color: var(--contentieux-text); }

.case-members-list .member-meta {
    font-size: 11px;
    color: var(--ink-500);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
}

.case-members-list .member-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.case-members-list .member-actions .btn { padding: 6px 12px; font-size: 11px; }

/* ============================================================================
   RESPONSIVE — Tablet refinements (5.14, end-of-file so source order wins
   over the per-component max-width caps defined earlier).
   ============================================================================ */

@media (max-width: 1024px) {
    /* Page-level sticky case header sits below the 56px mobile topbar */
    .dossier-header-section .dossier-header-top { top: 56px; }

    /* Profile / Cabinet tab strip becomes horizontally scrollable like .tab-nav */
    .profile-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .profile-tabs .profile-tab { white-space: nowrap; flex-shrink: 0; }
}

@media (max-width: 768px) {
    /* Modals go (near) full-screen on narrow tablets/phones — bigger touch
       targets, no tiny dialog floating in a sea of backdrop. Overrides the
       per-dialog max-width caps (.category-dialog / .batch-dialog /
       .upload-dialog / .deadline-form-dialog / .lawyer-create-dialog) by
       sheer source order (this block is at end-of-file). */
    .confirm-backdrop { padding: 0; align-items: stretch; }
    .confirm-card {
        max-width: none;
        width: 100%;
        min-height: 100%;
        border: none;
        box-shadow: none;
        overflow-y: auto;
        animation: none;
    }
    /* Upload modal action buttons stack full-width when the modal is full-screen */
    .upload-dialog-actions .btn { flex: 1 1 100%; }

    /* Members table -> wrapping rows (header row hidden) */
    .case-members-list-header { display: none; }
    .case-members-list .member-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 14px;
    }
    .case-members-list .member-info { flex: 1 1 55%; min-width: 0; }
    .case-members-list .member-meta { text-align: left; }
    .case-members-list .member-actions { flex: 1 1 100%; justify-content: flex-start; }
}

/* ============================================================================
   ACCESSIBILITÉ 5.17 — anneau de focus clavier sur les contrôles dont
   `outline: none` est posé plus haut (champs, recherche, sliders). Placé en
   fin de fichier pour l'emporter à spécificité égale (ordre-source). WCAG 2.4.7.
   ============================================================================ */
input:focus-visible, select:focus-visible, textarea:focus-visible,
.form-control:focus-visible, .form-input:focus-visible, .form-select:focus-visible,
.form-textarea:focus-visible, .search-input:focus-visible,
.search-box input:focus-visible, .party-input:focus-visible {
    outline: 2px solid var(--ink-900);
    outline-offset: 1px;
}
.importance-slider:focus-visible,
.gen-importance-slider input:focus-visible {
    outline: 2px solid var(--ink-900);
    outline-offset: 2px;
}

/* a11y 5.17 — anneau INSET sur les pastilles dont le conteneur a overflow:hidden
   (sinon l'anneau offset:2px est rogné). Cas : pastilles du calendrier. */
.day-event:focus-visible {
    outline: 2px solid var(--ink-900);
    outline-offset: -2px;
}

/* ============================================
   Public invitation acceptance page (5.37 — EmptyLayout, no sidebar)
   ============================================ */
.invite-accept-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    padding: 32px 16px;
}
.invite-accept-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
}
.invite-accept-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink-900);
}
.invite-accept-seal {
    width: 32px;
    height: 32px;
    background: var(--ink-900);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 600;
    flex-shrink: 0;
}
.invite-accept-title { font-family: var(--font-serif); font-size: 22px; color: var(--ink-900); margin: 0 0 8px; }
.invite-accept-intro { font-size: 14px; color: var(--ink-700); line-height: 1.5; margin: 0 0 20px; }
.invite-accept-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.invite-accept-email { font-size: 14px; color: var(--ink-700); }
.invite-accept-submit { width: 100%; margin-top: 8px; }
.invite-accept-status { color: var(--ink-500); }
.invite-accept-success, .invite-accept-invalid { text-align: center; padding: 8px 0; }
.invite-accept-success h1, .invite-accept-invalid h1 { font-family: var(--font-serif); font-size: 20px; color: var(--ink-900); margin: 16px 0 8px; }
.invite-accept-success p, .invite-accept-invalid p { font-size: 14px; color: var(--ink-700); line-height: 1.5; margin: 0 0 20px; }

/* ============================================================================
   Subscription status banner (BILLING-SUBSCRIPTION.md v1.1 §6.1) — sits at the
   top of .main-content on every screen. Variants:
     .is-info     beta, more than 14 days before its end (discreet)
     .is-urgent   last 14 days of the beta and the 30-day grace period
     .is-readonly read-only workspace (action required)
   Gold is a marker only (never body text); bordeaux = action required.
   ========================================================================= */
.subscription-banner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px var(--margin);
    font-size: var(--body-sm-size);
    line-height: var(--body-sm-lh);
    color: var(--ink-900);
    border-bottom: 1px solid var(--ink-15);
    border-left: 3px solid transparent;
}
.subscription-banner svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.75; }
.subscription-banner-text { flex: 1; min-width: 0; }
.subscription-banner-text strong { font-weight: 600; }
.subscription-banner .btn { flex-shrink: 0; }

.subscription-banner.is-info { background: var(--cream-dim); color: var(--ink-700); border-left-color: var(--parchment-edge); }
.subscription-banner.is-info svg { color: var(--ink-500); }
.subscription-banner.is-urgent { background: var(--gold-soft); border-left-color: var(--gold); }
.subscription-banner.is-urgent svg { color: var(--gold-deep-text); }
.subscription-banner.is-readonly { background: var(--bordeaux-soft); border-left-color: var(--bordeaux); }
.subscription-banner.is-readonly svg { color: var(--bordeaux); }

@media (max-width: 768px) {
    .subscription-banner { flex-wrap: wrap; padding: 12px var(--space-sm); }
    .subscription-banner .btn { width: 100%; justify-content: center; }
}

/* Access ended (status "closed") — replaces the page content. */
.access-ended {
    max-width: 560px;
    margin: var(--space-xl) auto;
    padding: var(--space-lg) var(--space-md);
    background: var(--white);
    border: 1px solid var(--ink-15);
    border-top: 3px solid var(--bordeaux);
}
.access-ended-eyebrow {
    font-size: var(--label-caps-size);
    letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--bordeaux);
    margin-bottom: var(--space-xs);
}
.access-ended h1 {
    font-family: var(--font-serif);
    font-size: var(--h2-size);
    line-height: var(--h2-lh);
    font-weight: 500;
    color: var(--ink-900);
    margin: 0 0 var(--space-sm);
}
.access-ended p { color: var(--ink-700); margin: 0 0 var(--space-sm); }
.access-ended .btn { margin-top: var(--space-xs); }

/* ===== Cabinet — Data tab: restitution archive (wireframe 10-cabinet.html, tab "Données") ===== */
.archive-intro { font-size: 14px; color: var(--ink-700); margin: 0 0 var(--space-md); max-width: 72ch; }
.archive-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink-15); margin-bottom: var(--space-md); }
.archive-stat { display: flex; flex-direction: column; gap: calc(var(--space-xs) / 2); padding: var(--space-sm); border-right: 1px solid var(--ink-15); }
.archive-stat:last-child { border-right: none; }
.archive-stat-value { font-family: var(--font-serif); font-size: 28px; font-weight: 500; color: var(--ink-900); line-height: 1.1; }
.archive-stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-500); font-weight: 600; }
.archive-contents { margin: 0 0 var(--space-md); padding-left: var(--space-sm); font-size: 14px; color: var(--ink-700); display: flex; flex-direction: column; gap: var(--space-xs); }
.archive-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.archive-actions .btn svg { width: 16px; height: 16px; }
.archive-hint { font-size: 13px; color: var(--ink-500); margin: 0 0 var(--space-md); }
.archive-actions .archive-hint { margin: 0; }
.archive-feedback { margin: var(--space-sm) 0 0; }
.archive-note { font-size: 13px; color: var(--ink-500); margin-top: var(--space-sm); }
@media (max-width: 768px) {
    .archive-stats { grid-template-columns: 1fr 1fr; }
    .archive-stat:nth-child(2) { border-right: none; }
    .archive-stat:nth-child(-n+2) { border-bottom: 1px solid var(--ink-15); }
}
