/**
 * ─────────────────────────────────────────────────────────
 *  LeadGen — Styles globaux du back-office
 * ─────────────────────────────────────────────────────────
 *  Style "Vibrant gradient" : fond clair, accents
 *  violet→rose, typo Geist (Vercel).
 * ─────────────────────────────────────────────────────────
 */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&display=swap');

:root {
    /* ─── Surfaces ─── */
    --bg: #ffffff;
    --bg-elev: #fafafa;
    --bg-hover: #f5f3ff;          /* hover violet pâle */
    --bg-subtle: #fafafa;

    /* ─── Texte ─── */
    --text: #111827;              /* presque noir, légèrement bleuté */
    --text-soft: #4b5563;
    --text-muted: #9ca3af;

    /* ─── Bordures ─── */
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    /* ─── Couleurs sémantiques ─── */
    --accent: #8B5CF6;            /* violet primaire (fallback non-gradient) */
    --accent-hover: #7C3AED;
    --accent-soft: #ede9fe;       /* fond pour badges/tags pâles */
    --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --gradient-primary-hover: linear-gradient(135deg, #7C3AED 0%, #DB2777 100%);
    --link: #8B5CF6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* ─── Layout ─── */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: 0.2s ease;
    --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
    --shadow-md: 0 4px 12px rgba(139, 92, 246, 0.10), 0 1px 3px rgba(17, 24, 39, 0.04);
    --shadow-lg: 0 12px 32px rgba(139, 92, 246, 0.14), 0 4px 12px rgba(17, 24, 39, 0.06);
}

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

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
    min-height: 100vh;
    letter-spacing: -0.01em;
}

a { color: var(--link); text-decoration: none; transition: color var(--transition); }
/* Hover des liens — on exclut les boutons (qui gèrent leur propre couleur de texte au hover) */
a:not(.btn):not(.row-action-btn):hover { color: var(--accent); }

img { max-width: 100%; display: block; }

/* ─── Centered card layout (login) ─── */
.center-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at top right, rgba(236, 72, 153, 0.10), transparent 55%),
        radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.10), transparent 55%),
        var(--bg-elev);
}
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.card-title { font-size: 22px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.02em; }
.card-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* ─── Brand ─── */
.brand { text-align: center; margin-bottom: 32px; }
.brand-logo {
    font-family: 'Geist', sans-serif;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: -0.05em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}
.brand-tag {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 8px;
    font-weight: 600;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
    height: 36px;
    letter-spacing: -0.01em;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}
.btn-primary:hover:not(:disabled) {
    background: var(--gradient-primary-hover);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
}

.btn-ghost {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
    border-color: var(--border-strong);
    background: var(--bg-hover);
    color: var(--text);
}

.btn-block { width: 100%; }
.btn-sm    { padding: 6px 12px; font-size: 13px; height: 32px; border-radius: 6px; }
.btn-lg    { padding: 10px 20px; font-size: 15px; height: 42px; }

/* ─── Form fields ─── */
.field { margin-bottom: 16px; }
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.field-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}
.field-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    height: 36px;
    letter-spacing: -0.01em;
}
.field-input:hover:not(:focus) { border-color: var(--border-strong); }
.field-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}
.field-input::placeholder { color: var(--text-muted); }

textarea.field-input {
    resize: vertical;
    min-height: 88px;
    height: auto;
    font-family: inherit;
    line-height: 1.55;
    padding: 10px 12px;
}

/* ─── Status messages ─── */
.status {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
    display: none;
}
.status.show { display: block; }

.status-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
.status-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.status-loading {
    background: var(--bg-elev);
    border-color: var(--border);
    color: var(--text-soft);
}
.status-title { font-weight: 600; margin-bottom: 4px; }
.status-detail {
    font-size: 12px;
    opacity: 0.85;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    word-break: break-all;
}

/* ════════════════════════════════════════════════════════
   APP — Header & Layout (Vercel-style topbar)
   ════════════════════════════════════════════════════════ */

.app-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    height: 56px;
    backdrop-filter: saturate(180%) blur(8px);
    background: rgba(255,255,255,0.85);
}
.app-header .brand-logo { font-size: 20px; letter-spacing: -0.04em; }
.app-header .brand-tag { display: none; }
.app-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-email { font-size: 13px; color: var(--text-muted); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition);
}
.back-link:hover { color: var(--text); }

.app-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 32px 24px;
}
.app-main-narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px;
}
.app-main-wide {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px;
}


/* ════════════════════════════════════════════════════════
   APP-SHELL — Nouveau layout avec sidebar gauche (v2)
   ════════════════════════════════════════════════════════
   Usage : remplacer .app-header + .app-main par cette structure :
     <div class="app-shell">
        <aside class="app-sidebar">…</aside>
        <main class="app-content">…</main>
     </div>
   ════════════════════════════════════════════════════════ */

.app-shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.app-sidebar {
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.app-sidebar__brand {
    padding: 4px 10px 8px;
}
.app-sidebar__brand .brand-logo {
    font-size: 22px;
    letter-spacing: -0.04em;
}

.app-sidebar__section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.app-sidebar__section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 6px 10px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.app-sidebar__section-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background var(--transition), color var(--transition);
}
.app-sidebar__section-action:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.app-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background var(--transition), color var(--transition);
    letter-spacing: -0.01em;
}
.app-sidebar__item:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.app-sidebar__item--active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}
.app-sidebar__item--active:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.app-sidebar__item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.app-sidebar__item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-sidebar__item-badge {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}
.app-sidebar__item--active .app-sidebar__item-badge {
    color: var(--accent);
}

.app-sidebar__folder-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin: 0 4px;
}

/* Container pour un item de dossier avec son menu d'actions */
.app-sidebar__folder-row {
    position: relative;
}
.app-sidebar__folder-row .app-sidebar__item { padding-right: 32px; }
.app-sidebar__folder-actions {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity var(--transition);
}
.app-sidebar__folder-row:hover .app-sidebar__folder-actions,
.app-sidebar__folder-row .dropdown.open + .app-sidebar__folder-actions,
.app-sidebar__folder-row:has(.dropdown.open) .app-sidebar__folder-actions {
    opacity: 1;
}
.app-sidebar__folder-menu {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
}
.app-sidebar__folder-menu:hover { background: var(--bg-hover); color: var(--text); }

/* Dropdown positionné à droite (pour la sidebar) */
.dropdown--right .dropdown-menu {
    top: 0;
    left: calc(100% + 6px);
    right: auto;
}

/* Logo cliquable */
.app-sidebar__brand a,
.app-sidebar__brand a:hover {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.app-sidebar__footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.app-sidebar__user {
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Content ─── */
.app-content {
    min-width: 0; /* important : permet au contenu d'éviter d'élargir la grid */
    padding: 28px 36px;
    background: var(--bg);
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 64px 1fr; }
    .app-sidebar__item-label,
    .app-sidebar__item-badge,
    .app-sidebar__section-title,
    .app-sidebar__user { display: none; }
    .app-sidebar__brand .brand-logo { font-size: 0; }
    .app-sidebar__brand .brand-logo::before {
        content: 'L';
        font-size: 22px;
        background: var(--gradient-primary);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    .app-content { padding: 20px 16px; }
}


/* ════════════════════════════════════════════════════════
   CAMPAIGN CARDS — Liste compacte (v2)
   ════════════════════════════════════════════════════════ */

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

.campaign-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    position: relative;
    z-index: 1;
}
/* Quand un dropdown est ouvert dans une card, on la passe au-dessus
   des cards suivantes pour que son menu ne soit pas masqué par leurs toggles */
.campaign-card:has(.dropdown.open) { z-index: 50; }
.campaign-card > .dropdown { flex-shrink: 0; }
.campaign-card__main { flex: 1; min-width: 0; }
.campaign-card__stats { flex-shrink: 0; }

/* Toggle ON/OFF (publish/draft) */
.campaign-card__toggle {
    width: 38px;
    height: 22px;
    background: #e5e7eb;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    position: relative;
    transition: background var(--transition), box-shadow var(--transition);
    padding: 0;
    flex-shrink: 0;
    outline: none;
}
.campaign-card__toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.campaign-card__toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.20);
}
.campaign-card__toggle--on {
    background: var(--gradient-primary);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
}
.campaign-card__toggle--on::after { transform: translateX(16px); }
.campaign-card__toggle:disabled { opacity: 0.5; cursor: not-allowed; }
.campaign-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.campaign-card__status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.campaign-card__status--draft     { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15); }
.campaign-card__status--published { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.campaign-card__status--archived  { background: #9ca3af; box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15); }

.campaign-card__main { min-width: 0; }
.campaign-card__name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.campaign-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}
.campaign-card__meta-sep::before { content: '·'; margin-right: 4px; }

.campaign-card__stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-soft);
    white-space: nowrap;
}
.campaign-card__stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.campaign-card__stat-num { font-weight: 600; color: var(--text); }

.campaign-card__menu {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius);
    font-size: 18px;
    line-height: 1;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.campaign-card__menu:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border-strong);
}


/* ════════════════════════════════════════════════════════
   PAGE TOOLBAR — Search + Sort + Filter (v2)
   ════════════════════════════════════════════════════════ */

.page-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.page-search {
    flex: 1;
    position: relative;
}
.page-search input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.page-search input::placeholder { color: var(--text-muted); }
.page-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}
.page-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}


/* ════════════════════════════════════════════════════════
   KPI CARDS — couleurs cycliques (v2)
   ════════════════════════════════════════════════════════ */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.kpi-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 20px 18px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    --kpi-color: var(--accent);
    --kpi-tint: rgba(139, 92, 246, 0.08);
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--kpi-color);
}
.kpi-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    background: radial-gradient(circle at top right, var(--kpi-tint), transparent 70%);
    pointer-events: none;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}
.kpi-card:nth-child(5n+1) { --kpi-color: #8B5CF6; --kpi-tint: rgba(139, 92, 246, 0.12); }
.kpi-card:nth-child(5n+2) { --kpi-color: #EC4899; --kpi-tint: rgba(236, 72, 153, 0.12); }
.kpi-card:nth-child(5n+3) { --kpi-color: #06B6D4; --kpi-tint: rgba(6, 182, 212, 0.12); }
.kpi-card:nth-child(5n+4) { --kpi-color: #10B981; --kpi-tint: rgba(16, 185, 129, 0.12); }
.kpi-card:nth-child(5n+5) { --kpi-color: #F59E0B; --kpi-tint: rgba(245, 158, 11, 0.12); }

.kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}
.kpi-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--kpi-color);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}
.kpi-suffix {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 4px;
}


/* ════════════════════════════════════════════════════════
   DROPDOWN — Menu d'actions contextuel
   ════════════════════════════════════════════════════════ */

.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 1000;
    display: none;
    animation: dd-fade 0.15s ease;
}
.dropdown.open .dropdown-menu { display: block; }
@keyframes dd-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item--danger { color: var(--danger); }
.dropdown-item--danger:hover { background: rgba(239, 68, 68, 0.08); }
.dropdown-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.dropdown-section-title {
    padding: 6px 12px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}


/* ════════════════════════════════════════════════════════
   NOTIFICATION BELL — Cloche avec badge
   ════════════════════════════════════════════════════════ */

.notif-wrap { position: relative; }
.notif-bell {
    position: relative;
    width: 38px;
    height: 38px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-soft);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.notif-bell:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--bg-hover);
}
.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    border: 2px solid var(--bg);
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
    animation: notif-pulse 2s ease-in-out infinite;
}
@keyframes notif-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}
.notif-wrap.has-unread .notif-bell {
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    overflow: hidden;
    flex-direction: column;
}
.notif-wrap.open .notif-panel { display: flex; }
.notif-panel__header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.notif-panel__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.notif-panel__mark-all {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background var(--transition);
}
.notif-panel__mark-all:hover { background: var(--accent-soft); }
.notif-panel__list {
    overflow-y: auto;
    max-height: 410px;
}
.notif-panel__empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: var(--text);
    position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item--unread::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #EF4444;
    border-radius: 50%;
}
.notif-item--unread { padding-left: 22px; }
.notif-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.notif-item__main { min-width: 0; flex: 1; }
.notif-item__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item__campaign {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item__time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.notif-item__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition), color var(--transition);
    font-family: inherit;
    padding: 0;
}
.notif-item:hover .notif-item__remove,
.notif-item:focus-within .notif-item__remove { opacity: 1; }
.notif-item__remove:hover { background: var(--bg-hover); color: var(--text); }
.notif-panel__footer {
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    display: flex;
    justify-content: flex-end;
    background: var(--bg);
}
.notif-panel__clear-all {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background var(--transition), color var(--transition);
}
.notif-panel__clear-all:hover { background: var(--bg-hover); color: var(--text); }


/* ════════════════════════════════════════════════════════
   LIVE NOTIFICATIONS — Nouveau lead en temps réel
   ════════════════════════════════════════════════════════ */

#liveNotificationStack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.live-notification {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px 14px 16px;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 340px;
    cursor: pointer;
    animation: live-slide-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.15);
    transition: opacity 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}
.live-notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
}
.live-notification:hover {
    transform: translateX(-4px);
    box-shadow: 0 16px 36px rgba(139, 92, 246, 0.20);
}
.live-notification--leaving {
    opacity: 0;
    transform: translateX(60px);
}
.live-notification__badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.live-notification__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.live-notification__campaign {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
@keyframes live-slide-in {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}


/* ════════════════════════════════════════════════════════
   MODAL — Fenêtre modale (création dossier, etc.)
   ════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: modal-pop 0.2s ease;
}
@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}
.modal-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.modal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Folder color picker */
.folder-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform var(--transition), border-color var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
.folder-color-swatch:hover { transform: scale(1.12); }
.folder-color-swatch.selected {
    border-color: var(--text);
    transform: scale(1.18);
}


.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-title { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ════════════════════════════════════════════════════════
   TABLE de campagnes
   ════════════════════════════════════════════════════════ */

.table-wrap {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.data-table thead th {
    text-align: left;
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
}

.data-table tbody td {
    padding: 18px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    letter-spacing: -0.01em;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
    transition: background var(--transition);
    cursor: pointer;
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .col-name { color: var(--text); font-weight: 500; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    border: 1px solid transparent;
}
.badge-draft     { background: #fefce8; color: #a16207; border-color: #fde68a; }
.badge-published { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge-archived  { background: var(--bg-elev); color: var(--text-muted); border-color: var(--border); }

.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border);
    vertical-align: middle;
    margin-right: 6px;
}

/* Drag column (drag handle on hover) */
.col-drag {
    width: 28px;
    padding-left: 14px !important;
    padding-right: 0 !important;
    text-align: center;
    white-space: nowrap;
}
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    padding: 4px 2px;
    border-radius: 4px;
    user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.data-table tbody tr:hover .drag-handle { opacity: 0.7; }
.drag-handle:hover { opacity: 1 !important; color: var(--text); }

/* États SortableJS pendant le drag */
.row-drag-ghost { opacity: 0.35; background: var(--bg-hover) !important; }
.row-drag-chosen { background: var(--bg-hover) !important; }
.row-drag-dragging { cursor: grabbing !important; }

/* Action column (delete button on hover) */
.col-actions {
    width: 90px;
    text-align: right;
    padding-right: 14px !important;
    white-space: nowrap;
}
.col-actions .row-action-btn + .row-action-btn { margin-left: 4px; }

.row-action-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
    opacity: 0;
}
.data-table tbody tr:hover .row-action-btn { opacity: 1; }
.row-action-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}
/* Override : le bouton copier a un hover bleu (info) au lieu de rouge (danger) */
.row-action-copy:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--link);
}
.row-action-btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed;
    pointer-events: auto;  /* garde le tooltip */
}
.row-action-btn:disabled:hover {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}
/* Bouton "publier" (campagne en draft) — accent vert pour inviter à l'action */
.row-action-publish:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
/* Bouton "dépublier" (campagne publiée) — œil barré, hover neutre */
.row-action-published {
    color: #15803d;
    opacity: 1 !important;  /* toujours visible (signal positif) */
}
.row-action-published:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

/* ─── Toast (notification flottante) ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    border: 1px solid var(--text);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 9999;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════════════════ */

.empty-state {
    background: var(--bg);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 72px 32px;
    text-align: center;
}
.empty-state-icon { font-size: 48px; margin-bottom: 20px; filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.25)); }
.empty-state-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 22px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ════════════════════════════════════════════════════════
   FULL LOADING
   ════════════════════════════════════════════════════════ */

.full-loading {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ════════════════════════════════════════════════════════
   WIZARD — création de campagne
   ════════════════════════════════════════════════════════ */

.wizard-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.wizard-section-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.wizard-section-help {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

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

.choice-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.choice-card:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.choice-card.selected {
    border-color: var(--text);
    box-shadow: 0 0 0 1px var(--text) inset;
    background: var(--bg);
}

.choice-card-preview {
    aspect-ratio: 16 / 10;
    background: var(--bg-elev);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.choice-card-preview svg { display: block; width: 100%; height: 100%; }

.choice-card-label { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.choice-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.theme-card {
    aspect-ratio: 5 / 3;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    position: relative;
}
.theme-card.theme-light { background: linear-gradient(180deg, #fafafa 0%, #fff 100%); color: #111; }
.theme-card.theme-dark  { background: linear-gradient(180deg, #161616 0%, #0d0d0d 100%); color: #f5f5f5; }

.color-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform var(--transition), border-color var(--transition);
    position: relative;
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch.selected {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--bg);
}
.color-swatch.selected::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.color-custom-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.color-custom-row label { font-size: 13px; color: var(--text-soft); font-weight: 500; }
.color-custom-input {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}
.color-custom-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-custom-input::-webkit-color-swatch { border: 1px solid var(--border); border-radius: 50%; }
.color-custom-input::-moz-color-swatch { border: 1px solid var(--border); border-radius: 50%; }

.color-custom-text {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    outline: none;
    text-transform: uppercase;
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

/* ════════════════════════════════════════════════════════
   STEPPER — barre de progression d'édition
   ════════════════════════════════════════════════════════ */

.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
}
.step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.step.active .step-number {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
}
.step.active .step-label { color: var(--text); font-weight: 600; }

.step.done .step-number {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.step.done .step-label { color: var(--text-soft); }

.step-divider {
    flex: 1;
    height: 1px;
    background: var(--border);
    margin: 0 12px;
    min-width: 14px;
}

/* ════════════════════════════════════════════════════════
   EDIT — split layout (form gauche + preview droite)
   ════════════════════════════════════════════════════════ */

.edit-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: flex-start;
}

.edit-form-col {
    min-width: 0;
}

.edit-preview-col {
    position: sticky;
    top: 80px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.edit-preview-toolbar {
    padding: 10px 16px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.edit-preview-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0;
    text-transform: none;
}

.edit-preview-frame-wrap {
    width: 100%;
    background: #fff;
    height: calc(100vh - 220px);
    min-height: 500px;
    overflow: hidden;
    position: relative;
}
.edit-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.preview-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    color: var(--text-soft);
    font-size: 13px;
    z-index: 5;
    transition: opacity 0.3s;
    pointer-events: none;
}
.preview-loading-overlay.hidden { opacity: 0; }

/* ════════════════════════════════════════════════════════
   UPLOAD — zone d'upload d'image
   ════════════════════════════════════════════════════════ */

.upload-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.upload-row:last-child { border-bottom: none; }

.upload-preview {
    aspect-ratio: 1;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.upload-preview-placeholder {
    color: var(--text-muted);
    font-size: 24px;
    opacity: 0.5;
}

.upload-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.upload-info-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.upload-info-help {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.upload-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
}
.upload-status {
    font-size: 11px;
    color: var(--text-muted);
}
.upload-status.uploading { color: var(--warning); }
.upload-status.done      { color: var(--success); }
.upload-status.error     { color: var(--error); }

/* Hide native file inputs */
.file-input-hidden {
    display: none;
}

/* ════════════════════════════════════════════════════════
   FIELDS LIST (textes éditables)
   ════════════════════════════════════════════════════════ */

.fields-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fields-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    text-transform: none;
    margin-top: 22px;
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.fields-group-title:first-child { margin-top: 0; }

.field-richtext {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* ════════════════════════════════════════════════════════
   SAVE BAR (sticky en bas pendant l'édition)
   ════════════════════════════════════════════════════════ */

.save-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    z-index: 40;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}
.save-bar.show { transform: translateY(0); }

.save-bar-status {
    font-size: 13px;
    color: var(--text-muted);
}
.save-bar-status.dirty { color: var(--warning); }
.save-bar-status.saving { color: var(--text-soft); }
.save-bar-status.saved  { color: var(--success); }

/* Pour que le contenu ne soit pas masqué par la save-bar */
.save-bar-spacer { height: 80px; }

/* ════════════════════════════════════════════════════════
   MOBILE
   ════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .edit-layout { grid-template-columns: 1fr; }
    .edit-preview-col { position: static; }
    .edit-preview-frame-wrap { height: 70vh; }
}

@media (max-width: 640px) {
    .app-header { padding: 12px 16px; }
    .app-main, .app-main-narrow, .app-main-wide { padding: 22px 16px; }

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

    .user-email { display: none; }

    .data-table thead { display: none; }
    .data-table tbody td { display: block; padding: 8px 16px; border-bottom: none; }
    /* Drag & drop désactivé en mobile : la poignée est masquée et ne prend pas de place */
    .data-table .col-drag { display: none; }
    .data-table tbody tr {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
    }
    .data-table tbody tr:last-child { border-bottom: none; }
    .data-table .col-name { font-size: 16px; padding-top: 14px; }

    /* Sur mobile, le bouton supprimer est toujours visible */
    .row-action-btn { opacity: 1; }
    .col-actions { text-align: left; padding-left: 16px !important; }

    .choice-grid.cols-3,
    .choice-grid.cols-2 { grid-template-columns: 1fr; }
    .color-grid { grid-template-columns: repeat(5, 1fr); }

    .wizard-section { padding: 22px 18px; }
    .wizard-footer { flex-direction: column-reverse; }
    .wizard-footer .btn { width: 100%; }

    .stepper {
        padding: 14px 18px;
        font-size: 12px;
    }
    .step-label { font-size: 12px; }

    .upload-row { grid-template-columns: 80px 1fr; gap: 12px; }

    .save-bar { padding: 12px 16px; }
}


/* ════════════════════════════════════════════════════════
   FORM BUILDER (Sprint 4)
   ════════════════════════════════════════════════════════ */

.form-builder {
    max-width: 760px;
    margin: 0 auto;
}

/* ─── Group section (Champs obligatoires / Custom / Add) ─── */
.fb-group {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.fb-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.fb-group-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--text);
}

.fb-group-help {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.55;
}

/* ─── Field rows ─── */
.fb-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fb-row {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 14px 14px 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.fb-row:hover { border-color: var(--border-strong); background: var(--bg-hover); }

.fb-row.dragging {
    opacity: 0.4;
    border-style: dashed;
}
.fb-row.drag-over {
    box-shadow: 0 -2px 0 0 var(--text);
}

.fb-row-system {
    background: var(--bg);
}
.fb-row-system .fb-type-badge {
    background: #fefce8;
    color: #a16207;
    border-color: #fde68a;
}

/* Drag handle */
.fb-drag {
    width: 24px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    flex-shrink: 0;
    align-self: stretch;
    user-select: none;
    transition: color 0.15s;
}
.fb-drag:hover { color: var(--text); }
.fb-drag:active { cursor: grabbing; }

/* Field content */
.fb-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fb-label-input {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 4px 6px;
    margin-left: -6px;
    border-radius: 4px;
    outline: none;
    transition: background 0.15s;
    width: 100%;
}
.fb-label-input:hover  { background: var(--bg-hover); }
.fb-label-input:focus  { background: var(--bg-hover); box-shadow: 0 0 0 2px var(--border-strong); }
.fb-label-input:disabled {
    color: var(--text-soft);
    background: transparent !important;
    cursor: default;
    box-shadow: none !important;
}

.fb-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fb-type-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 100px;
    letter-spacing: 0;
}

.fb-required-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.fb-required-toggle:hover { color: var(--text-soft); }
.fb-required-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: 3px;
    background: var(--bg);
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}
.fb-required-toggle input[type="checkbox"]:checked {
    background: var(--text);
    border-color: var(--text);
}
.fb-required-toggle input[type="checkbox"]:checked::after {
    content: '✓';
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.fb-required-locked {
    font-size: 11px;
    font-weight: 500;
    color: #a16207;
    background: #fefce8;
    border: 1px solid #fde68a;
    padding: 2px 8px;
    border-radius: 100px;
    letter-spacing: 0;
}

/* Action buttons (delete) */
.fb-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: -2px;
}
.fb-action-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fb-action-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* ─── Options editor (for choice types) ─── */
.fb-options {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.fb-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fb-option-bullet {
    color: var(--text-muted);
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.fb-option-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 5px 8px;
    border-radius: 3px;
    outline: none;
    transition: background 0.15s;
}
.fb-option-input:hover { background: var(--bg-hover); }
.fb-option-input:focus { background: var(--bg-hover); box-shadow: 0 0 0 1.5px var(--border-strong); }

.fb-option-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.fb-option-remove:hover { background: rgba(239, 68, 68, 0.15); color: var(--error); }

.fb-option-add {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.15s;
    align-self: flex-start;
}
.fb-option-add:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

/* ─── Add field section (type picker) ─── */
.fb-add-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.fb-type-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fb-type-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

.fb-type-card-icon {
    font-size: 18px;
    line-height: 1;
}
.fb-type-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.fb-type-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.fb-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

@media (max-width: 640px) {
    .fb-group { padding: 18px 14px; }
    .fb-add-types { grid-template-columns: 1fr 1fr; }
    .fb-meta { gap: 8px; }
    .fb-type-badge { font-size: 10px; }
}


/* ════════════════════════════════════════════════════════
   LEADS PILL (dashboard) + LEADS PAGE (Sprint 5)
   ════════════════════════════════════════════════════════ */

/* Pill cliquable dans la colonne "Leads" du dashboard */
.leads-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-soft);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.leads-pill:hover {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
}
.leads-pill svg { flex-shrink: 0; opacity: 0.9; }
.leads-pill-count { font-variant-numeric: tabular-nums; }

/* ─── Leads page ─── */
/* ─── Widgets stats leads ─── */
.leads-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 20px 0 24px;
}
.leads-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--border, #ececec);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.leads-widget-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 10px;
    background: #f4f4f6;
}
.leads-widget-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.leads-widget-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--text, #1a1a1a);
}
.leads-widget-label {
    font-size: 12px;
    color: var(--text-muted, #888);
    margin-top: 4px;
}
/* Widget doublons : cliquable */
.leads-widget-dup {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.leads-widget-dup:hover {
    border-color: #d0d0d4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
}
.leads-widget-dup .leads-widget-value::after {
    content: ' ›';
    color: var(--text-muted, #bbb);
    font-weight: 400;
}
@media (max-width: 720px) {
    .leads-widgets { grid-template-columns: 1fr; }
}

/* ─── Popup doublons ─── */
.dup-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    align-items: center; justify-content: center;
    padding: 24px;
}
.dup-modal-backdrop.show { display: flex; }
.dup-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%; max-width: 560px;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0,0,0,0.28);
}
.dup-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid #eee;
}
.dup-modal-header h3 { margin: 0; font-size: 16px; }
.dup-modal-close {
    background: none; border: none; font-size: 26px;
    line-height: 1; cursor: pointer; color: #888;
}
.dup-modal-close:hover { color: #000; }
/* ~5 lignes visibles puis scroll */
.dup-modal-body {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px 0;
}
.dup-group {
    padding: 10px 20px;
    border-bottom: 1px solid #f2f2f2;
}
.dup-group:last-child { border-bottom: none; }
.dup-group-email {
    font-size: 13px; font-weight: 600; color: var(--text, #1a1a1a);
    display: flex; align-items: center; gap: 8px;
}
.dup-group-badge {
    font-size: 11px; font-weight: 600;
    background: #fff4e5; color: #c77700;
    padding: 1px 7px; border-radius: 999px;
}
.dup-group-leads {
    margin-top: 4px; font-size: 12px; color: var(--text-muted, #888);
    line-height: 1.5;
}

.leads-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.leads-search {
    flex: 1;
    min-width: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0 12px;
    height: 36px;
    font-size: 14px;
    border-radius: var(--radius);
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.leads-search:hover { border-color: var(--border-strong); }
.leads-search:focus {
    border-color: var(--text);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05);
}
.leads-search::placeholder { color: var(--text-muted); }

.leads-filter {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0 12px;
    height: 36px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s;
}
.leads-filter:hover { border-color: var(--border-strong); }

.leads-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0 14px;
    height: 36px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.leads-export:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.leads-summary {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.leads-summary strong { color: var(--text); font-weight: 600; }

.leads-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    box-shadow: var(--shadow-sm);
}
.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 700px;
}
.leads-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.leads-table tbody tr {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
}
.leads-table tbody tr:hover { background: var(--bg-hover); }
.leads-table tbody tr:last-child { border-bottom: none; }
.leads-table tbody td {
    padding: 14px 16px;
    color: var(--text-soft);
    vertical-align: top;
    letter-spacing: -0.01em;
}
.leads-table .lead-name { color: var(--text); font-weight: 500; }
.leads-table .lead-email a { color: var(--link); text-decoration: none; }
.leads-table .lead-email a:hover { text-decoration: underline; }
.leads-table .lead-cell-truncate {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lead-action-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
    opacity: 0;
}
.leads-table tbody tr:hover .lead-action-btn { opacity: 1; }
.lead-action-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.leads-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.leads-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.leads-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.leads-empty-detail {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── Modal détail lead ─── */
.lead-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s;
}
.lead-modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}
.lead-modal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 580px;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    transform: translateY(10px) scale(0.97);
    transition: transform 0.22s cubic-bezier(.4,0,.2,1);
}
.lead-modal-backdrop.show .lead-modal {
    transform: translateY(0) scale(1);
}
.lead-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lead-modal-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.lead-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.lead-modal-close:hover { background: var(--bg-hover); color: var(--text); }
.lead-modal-body {
    padding: 18px 24px 22px;
}
.lead-detail-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    align-items: baseline;
}
.lead-detail-row:last-child { border-bottom: none; }
.lead-detail-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}
.lead-detail-value {
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
    line-height: 1.55;
}
.lead-detail-value a {
    color: var(--link);
    text-decoration: none;
}
.lead-detail-value a:hover { text-decoration: underline; }

/* ─── Inline edit du nom de campagne (toolbar #campaignName) ─── */
.toolbar-campaign-name-editable {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    transition: background 0.15s, color 0.15s;
}
.toolbar-campaign-name-editable:hover {
    background: rgba(91, 63, 191, 0.08);
    color: #5b3fbf;
}
.toolbar-campaign-name-input {
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid #5b3fbf;
    border-radius: 4px;
    padding: 3px 8px;
    margin: -4px -9px;
    outline: none;
    min-width: 220px;
    max-width: 360px;
}

/* ─── Colonne checkbox (sélection multi-leads) ─── */
.lead-col-check {
    width: 48px;
    text-align: center;
    padding-left: 12px !important;
    padding-right: 12px !important;
    cursor: pointer;
}
.leads-table tbody td.lead-col-check:hover {
    background: #f5f1ff;
}
.lead-check-master,
.lead-check-row {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #5b3fbf;
    margin: 0;
}
.leads-table tbody tr.lead-row-selected {
    background: #f5f1ff;
}
.leads-table tbody tr.lead-row-selected:hover {
    background: #ebe3ff;
}

/* ─── Bouton "Questions" dans la cellule du tableau ─── */
.lead-questions-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f0eaff;
    color: #5b3fbf;
    border: 1px solid #ddd0fb;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.lead-questions-btn:hover {
    background: #e5dbff;
    border-color: #c4b0f9;
}

/* ─── Colonne "Exporté" ─── */
.lead-col-exported {
    width: 90px;
    text-align: center;
    white-space: nowrap;
}
.lead-exported-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #e6f7ea;
    color: #1e7634;
    border: 1px solid #b8e6c4;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.lead-exported-badge-btn {
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.lead-exported-badge-btn:hover {
    background: #d5f0dc;
    border-color: #9ddbaf;
}
.lead-exported-wrap {
    display: inline-block;
    position: relative;
}
.lead-export-popover {
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 160px;
    overflow: hidden;
}
.lead-export-popover-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #8a6d3b;
    font-family: inherit;
    transition: background 0.15s;
}
.lead-export-popover-item:hover { background: #fff7e6; }

/* ─── Master checkbox popover (sélection page / tout) ─── */
.lead-master-wrap {
    display: inline-block;
    position: relative;
}
.lead-master-popover {
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e5e5e7;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.16);
    min-width: 240px;
    overflow: hidden;
}
.lead-master-popover-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 1px solid #f3f3f5;
    transition: background 0.15s;
}
.lead-master-popover-item:last-child { border-bottom: none; }
.lead-master-popover-item:hover { background: #f5f1ff; }
.lead-master-popover-item strong {
    font-size: 13px;
    color: var(--text);
}
.lead-master-popover-hint {
    font-size: 11px;
    color: var(--text-muted);
}
.lead-master-popover-clear {
    border-top: 2px solid #f3f3f5;
}
.lead-master-popover-clear strong { color: #8a6d3b; }
.lead-master-popover-clear:hover { background: #fff7e6; }

.lead-master-popover-new strong { color: #5b3fbf; }
.lead-master-popover-new:hover { background: #f5f1ff; }
.lead-master-popover-item.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.lead-master-popover-item.is-disabled:hover { background: none; }

/* ─── Pagination ─── */
.leads-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--text-muted);
}
.leads-pagination-info strong { color: var(--text); }
.leads-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.leads-page-btn {
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s;
}
.leads-page-btn:hover:not(:disabled) { background: #f5f5f5; }
.leads-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.leads-page-indicator { padding: 0 8px; color: var(--text); font-size: 12px; }
.leads-page-indicator strong { color: #5b3fbf; }
.lead-not-exported {
    color: var(--text-muted);
    font-size: 12px;
}

/* ─── Dropdown "Exporter" ─── */
.export-dropdown {
    position: relative;
    display: inline-block;
}
.export-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 280px;
    background: #fff;
    border: 1px solid #e5e5e7;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 100;
    overflow: hidden;
}
.export-menu.open { display: block; }
.export-menu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s;
    border-bottom: 1px solid #f3f3f5;
}
.export-menu-item:last-child { border-bottom: none; }
.export-menu-item:hover:not(:disabled) { background: #f7f5ff; }
.export-menu-item strong {
    font-size: 13px;
    font-weight: 600;
}
.export-menu-hint {
    font-size: 11px;
    color: var(--text-muted);
}
.export-menu-item-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.export-menu-item-disabled:hover { background: none; }

/* ─── Sélecteur de format dans le menu Exporter ─── */
.export-format-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fafafa;
    border-bottom: 1px solid #ececec;
}
.export-format-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}
.export-format-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.export-format-pill {
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.export-format-pill:hover { background: #f5f5f5; }
.export-format-pill.is-active {
    background: #5b3fbf;
    border-color: #5b3fbf;
    color: #fff;
}

/* Item "Remettre en non-exporté" — séparé visuellement */
.export-menu-item-reset {
    border-top: 2px solid #f3f3f5;
    color: #8a6d3b;
}
.export-menu-item-reset:hover:not(:disabled) { background: #fff7e6; }

/* ─── Pop-up "Questions & réponses" ─── */
.qa-modal-lead-info {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--bg-subtle, #f7f7f9);
    border-radius: 8px;
    font-size: 13px;
}
.qa-row {
    padding: 12px 0;
    border-bottom: 1px solid #ececec;
}
.qa-row:last-child { border-bottom: none; }
.qa-question {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}
.qa-answer {
    font-size: 14px;
    color: var(--text);
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}
.qa-answer-empty {
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 600px) {
    .leads-table { font-size: 12px; }
    .leads-table thead th, .leads-table tbody td { padding: 10px 8px; }
    .lead-detail-row { grid-template-columns: 1fr; gap: 4px; }
}
