/* =============================================================================
   Hermès Sales OS — CSS vanilla maison (sobre, sombre, responsive)
   ========================================================================== */

/* =============================================================================
   THÈMES — palette par défaut (dark) et override clair via [data-theme="light"]
   ============================================================================= */
:root, [data-theme="dark"] {
    --bg-0: #0a0b14;
    --bg-1: #11131f;
    --bg-2: #161927;
    --bg-3: #1c2030;
    --line: rgba(255,255,255,0.06);
    --line-2: rgba(255,255,255,0.10);
    --fg: #ecedf4;
    --fg-muted: #a4a8b8;
    --fg-soft: #7b8094;
    --brand-50:  #f4ecff;
    --brand-300: #b790ff;
    --brand-400: #9a66ff;
    --brand-500: #7916ff;
    --brand-600: #6510dd;
    --brand-700: #520bb3;
    --accent: #4cc9c0;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow:    0 6px 24px -10px rgba(0,0,0,0.6);
    --shadow-lg: 0 18px 50px -10px rgba(0,0,0,0.55);
    --bg-gradient-1: rgba(121, 22, 255, 0.10);
    --bg-gradient-2: rgba(76, 201, 192, 0.06);
    --card-gradient-from: var(--bg-1);
    --card-gradient-to:   var(--bg-2);
}

/* Mode clair : surcharge les couleurs (texte foncé sur fond clair) */
[data-theme="light"] {
    --bg-0: #f5f7fb;
    --bg-1: #ffffff;
    --bg-2: #f1f3f9;
    --bg-3: #e6e9f2;
    --line: rgba(15,18,33,0.08);
    --line-2: rgba(15,18,33,0.14);
    --fg: #14172a;
    --fg-muted: #54596b;
    --fg-soft: #8a8f9f;
    --brand-300: #8b3dff;  /* + saturé en clair pour rester lisible */
    --brand-400: #7a23ff;
    --shadow-sm: 0 1px 2px rgba(15,18,33,0.05);
    --shadow:    0 6px 24px -10px rgba(15,18,33,0.10);
    --shadow-lg: 0 18px 50px -10px rgba(15,18,33,0.15);
    --bg-gradient-1: rgba(121, 22, 255, 0.06);
    --bg-gradient-2: rgba(76, 201, 192, 0.04);
    --card-gradient-from: #ffffff;
    --card-gradient-to:   #fafbfd;
}

/* Mode auto : suit la préférence système */
[data-theme="auto"] {
    color-scheme: light dark;
}
@media (prefers-color-scheme: light) {
    [data-theme="auto"] {
        --bg-0: #f5f7fb;
        --bg-1: #ffffff;
        --bg-2: #f1f3f9;
        --bg-3: #e6e9f2;
        --line: rgba(15,18,33,0.08);
        --line-2: rgba(15,18,33,0.14);
        --fg: #14172a;
        --fg-muted: #54596b;
        --fg-soft: #8a8f9f;
        --brand-300: #8b3dff;
        --brand-400: #7a23ff;
        --shadow-sm: 0 1px 2px rgba(15,18,33,0.05);
        --shadow:    0 6px 24px -10px rgba(15,18,33,0.10);
        --shadow-lg: 0 18px 50px -10px rgba(15,18,33,0.15);
        --bg-gradient-1: rgba(121, 22, 255, 0.06);
        --bg-gradient-2: rgba(76, 201, 192, 0.04);
        --card-gradient-from: #ffffff;
        --card-gradient-to:   #fafbfd;
    }
}

* { box-sizing: border-box; }
*, *::before, *::after { margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    background: var(--bg-0);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(1200px 600px at 80% -10%, var(--bg-gradient-1), transparent 60%),
        radial-gradient(900px 500px at -10% 30%, var(--bg-gradient-2), transparent 60%);
    transition: background-color .18s, color .18s;
}
a { color: var(--brand-300); text-decoration: none; }
a:hover { color: var(--brand-400); }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { color: var(--fg-muted); }

/* ----- Utilitaires ----- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }
.text-muted { color: var(--fg-muted); }
.text-soft  { color: var(--fg-soft); }
.text-sm    { font-size: 0.85rem; }
.text-xs    { font-size: 0.75rem; }
.text-center{ text-align: center; }
.mt-2 { margin-top: 8px;  } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; } .mt-10{ margin-top: 40px; }
.mb-2 { margin-bottom: 8px;  } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; } .mb-10{ margin-bottom: 40px; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: 4px;  } .gap-2 { gap: 8px;  } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.full   { width: 100%; }
.hidden { display: none; }
.no-wrap { white-space: nowrap; }
.gradient-text {
    background: linear-gradient(135deg, var(--brand-300) 0%, #4cc9c0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--fg);
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .04s;
    font-weight: 500;
    text-decoration: none;
}
.btn:hover { background: var(--bg-3); border-color: rgba(255,255,255,0.16); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); border-color: transparent; color: white; }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); color: white; }
.btn-secondary { background: var(--bg-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn-ghost:hover { background: var(--bg-2); color: var(--fg); }
.btn-danger  { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.3); color: #fca5a5; }
.btn-danger:hover { background: rgba(248,113,113,0.18); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ----- Forms ----- */
.form-group { margin-bottom: 16px; }
.label { display: block; font-size: 12px; color: var(--fg-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.input, .textarea, .select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    color: var(--fg);
    transition: border-color .12s, background .12s;
    outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand-500); background: var(--bg-2); }
.textarea { min-height: 80px; resize: vertical; }
.hint { font-size: 12px; color: var(--fg-soft); margin-top: 4px; }
.error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand-500); }

/* ----- Cards ----- */
.card {
    background: linear-gradient(180deg, var(--card-gradient-from), var(--card-gradient-to));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.card-compact { padding: 14px; }
.card-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.card-meta  { font-size: 12px; color: var(--fg-soft); }

.kpi-card {
    background: linear-gradient(180deg, var(--card-gradient-from), var(--card-gradient-to));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}
.kpi-label { font-size: 11px; color: var(--fg-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-value { font-size: 1.8rem; font-weight: 600; margin-top: 4px; }
.kpi-delta { font-size: 12px; color: var(--success); margin-top: 4px; }
.kpi-delta.neg { color: var(--danger); }

/* ----- Badges ----- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--fg-muted);
}
.badge-success { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.3); color: #86efac; }
.badge-info    { background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.3); color: #93c5fd; }
.badge-warning { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.3); color: #fcd34d; }
.badge-danger  { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.3); color: #fca5a5; }
.badge-primary { background: rgba(121,22,255,0.18); border-color: rgba(121,22,255,0.4); color: var(--brand-300); }

/* ----- Layout app (sidebar + topbar) ----- */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--bg-1);
    border-right: 1px solid var(--line);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 6px 8px 14px 8px; }
.sidebar-brand .logo {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px;
}
.sidebar-brand .name { font-weight: 600; }
.sidebar-section { font-size: 10px; color: var(--fg-soft); text-transform: uppercase; letter-spacing: 0.08em; margin: 14px 8px 6px; }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--fg-muted);
    font-size: 13px;
    text-decoration: none;
    transition: background .12s, color .12s;
}
.nav-link:hover { background: var(--bg-2); color: var(--fg); }
.nav-link.active { background: linear-gradient(135deg, rgba(121,22,255,0.18), rgba(121,22,255,0.06)); color: white; }
.nav-link .ico { width: 16px; height: 16px; opacity: 0.8; }

.main-area { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 56px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-0) 70%, transparent);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 5;
}
.topbar .breadcrumbs { font-size: 13px; color: var(--fg-muted); }
.org-switcher { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line-2); cursor: pointer; }
.org-switcher select { background: transparent; border: 0; color: var(--fg); cursor: pointer; }
.page { padding: 28px 24px 60px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 600; }
.page-subtitle { color: var(--fg-muted); font-size: 14px; margin-top: 2px; }

@media (max-width: 1024px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ----- Tables ----- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table th, .table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    vertical-align: middle;
}
.table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-soft);
    background: var(--bg-2);
}
.table tbody tr:hover { background: var(--bg-2); }
.table-wrap { overflow-x: auto; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--fg-muted); border: 1px dashed var(--line-2); border-radius: var(--radius-lg); }
.empty-state h3 { color: var(--fg); margin-bottom: 6px; }

/* ----- Marketing ----- */
.marketing-nav {
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg-0) 75%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.marketing-nav .container { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.marketing-nav .nav-items { display: flex; align-items: center; gap: 22px; }
.marketing-nav .nav-items a { color: var(--fg-muted); font-weight: 500; }
.marketing-nav .nav-items a:hover { color: var(--fg); }
.hero { padding: 80px 0 60px; }
.hero h1 { font-size: 3.2rem; line-height: 1.1; max-width: 920px; }
.hero p.lead { font-size: 1.1rem; color: var(--fg-muted); max-width: 700px; margin-top: 18px; }
.hero-actions { display: inline-flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.section { padding: 70px 0; }
.section h2 { font-size: 2.1rem; max-width: 700px; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(121,22,255,0.12); border: 1px solid rgba(121,22,255,0.3);
    color: var(--brand-300); font-size: 12px; font-weight: 500;
    margin-bottom: 14px;
}
.feature-card {
    background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
    border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px;
    transition: border-color .12s, transform .12s;
}
.feature-card:hover { border-color: rgba(121,22,255,0.35); transform: translateY(-2px); }
.feature-card h3 { margin: 10px 0 6px; }
.feature-card .icon-wrap {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(121,22,255,0.15); border: 1px solid rgba(121,22,255,0.25);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--brand-300); font-size: 18px;
}
.pricing-card { padding: 28px; border-radius: var(--radius-lg); background: linear-gradient(180deg, var(--bg-1), var(--bg-2)); border: 1px solid var(--line); }
.pricing-card.featured { border-color: rgba(121,22,255,0.45); box-shadow: 0 10px 50px -20px rgba(121,22,255,0.55); position: relative; }
.pricing-card .price { font-size: 2.6rem; font-weight: 600; }
.pricing-card .price small { font-size: 1rem; color: var(--fg-muted); font-weight: 400; }
.pricing-card ul { list-style: none; margin: 18px 0 22px; }
.pricing-card li { padding: 5px 0; color: var(--fg-muted); }
.pricing-card li::before { content: "✓ "; color: var(--success); margin-right: 6px; }

.footer { border-top: 1px solid var(--line); padding: 50px 0 30px; color: var(--fg-muted); }
.footer .columns { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 30px; }
@media (max-width: 768px) { .footer .columns { grid-template-columns: 1fr 1fr; } }
.footer h4 { color: var(--fg); font-size: 13px; margin-bottom: 10px; }
.footer ul { list-style: none; }
.footer li { padding: 3px 0; font-size: 13px; }
.footer .bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--fg-soft); }

/* ----- Auth ----- */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .auth-meta { color: var(--fg-muted); font-size: 14px; }

/* ----- Onboarding chat ----- */
.chat-shell { display: grid; grid-template-columns: 1fr 380px; height: 100vh; }
.chat-main  { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.chat-header { padding: 14px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.chat-steps  { display: flex; gap: 8px; flex-wrap: wrap; }
.step-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    border: 1px solid var(--line-2); background: var(--bg-2);
    font-size: 12px; color: var(--fg-muted);
}
.step-pill.active   { background: rgba(121,22,255,0.22); border-color: rgba(121,22,255,0.5); color: var(--brand-300); font-weight: 600; }
.step-pill.done     { background: rgba(52,211,153,0.14); border-color: rgba(52,211,153,0.35); color: #86efac; }

/* Conversation centrée + grandes bulles lisibles */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}
.chat-messages > .bubble {
    width: 100%;
    max-width: 720px;
}
.bubble {
    padding: 16px 22px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 17px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.bubble-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(121,22,255,0.22), rgba(121,22,255,0.12));
    border: 1px solid rgba(121,22,255,0.38);
    text-align: right;
    margin-left: auto;
    max-width: 600px;
}
.bubble-assistant {
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    font-size: 18px;
    line-height: 1.65;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.bubble-loading { color: var(--fg-soft); font-style: italic; }

/* Zone de saisie centrée et plus large */
.chat-form {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: flex-end;
    background: rgba(10,11,20,0.6);
}
.chat-form > * { max-width: 720px; width: 100%; }
.chat-form textarea {
    flex: 1;
    min-height: 52px;
    max-height: 180px;
    resize: none;
    font-size: 16px;
    padding: 14px 16px;
    line-height: 1.5;
}
.chat-form button { white-space: nowrap; padding: 12px 18px; font-size: 15px; }

/* Actions sous le formulaire (passer / corriger / valider) */
.chat-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 24px 20px;
    background: rgba(10,11,20,0.6);
}
.chat-actions > .actions-inner { width: 100%; max-width: 720px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.chat-side { background: rgba(10,11,20,0.4); padding: 24px; overflow-y: auto; }
.chat-side h2 { font-size: 14px; }
.kv { background: var(--bg-2); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; border: 1px solid var(--line); }
.kv-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-soft); }
.kv-value { font-size: 14px; line-height: 1.4; }
@media (max-width: 900px) {
    .chat-shell { grid-template-columns: 1fr; }
    .chat-side { display: none; }
    .chat-messages { padding: 24px 16px; }
    .bubble { font-size: 16px; padding: 14px 18px; }
    .bubble-assistant { font-size: 17px; }
}

/* ----- Progress ----- */
.progress { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--accent)); transition: width .25s; }

/* ----- Flash ----- */
.flash-zone { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.flash {
    padding: 10px 14px; border-radius: var(--radius);
    background: var(--bg-2); border: 1px solid var(--line-2);
    box-shadow: var(--shadow);
    animation: flashIn .25s ease;
}
.flash.success { border-color: rgba(52,211,153,0.4); }
.flash.error   { border-color: rgba(248,113,113,0.4); }
.flash.info    { border-color: rgba(96,165,250,0.4); }
.flash.warning { border-color: rgba(251,191,36,0.4); }
@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ----- Integration card ----- */
.integration-card { display: flex; flex-direction: column; gap: 8px; }
.integration-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.integration-card .name { font-weight: 600; }
.integration-card .desc { font-size: 12.5px; color: var(--fg-muted); }
.integration-card .row  { display: flex; align-items: center; gap: 6px; }
.integration-card .row .input { font-family: monospace; font-size: 13px; }

/* ----- Tabs ----- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 10px 14px; color: var(--fg-muted); border-bottom: 2px solid transparent; cursor: pointer; font-size: 13px; text-decoration: none; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-color: var(--brand-500); }

/* ----- Score pill ----- */
.score-pill {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 22px;
    background: var(--bg-2); border-radius: 6px;
    font-size: 12px; font-weight: 600;
    border: 1px solid var(--line-2);
}
.score-pill.cold { color: var(--fg-soft); }
.score-pill.warm { color: var(--warning); border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.08); }
.score-pill.hot  { color: var(--success); border-color: rgba(52,211,153,0.4); background: rgba(52,211,153,0.08); }

/* ----- Timeline ----- */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.timeline-item { padding: 8px 0 14px; position: relative; }
.timeline-item::before {
    content: ''; position: absolute; left: -18px; top: 12px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--brand-500); border: 2px solid var(--bg-0);
}
.timeline-item.email::before { background: var(--brand-500); }
.timeline-item.event::before { background: var(--info); }
.timeline-item.call::before  { background: var(--warning); }
.timeline-item.note::before  { background: var(--fg-soft); }
.timeline-item.score::before { background: var(--success); }
.timeline-time { font-size: 11px; color: var(--fg-soft); }
.timeline-title { font-weight: 500; font-size: 13px; }
.timeline-detail { font-size: 12.5px; color: var(--fg-muted); margin-top: 2px; }

/* ----- Misc ----- */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.kbd { font-family: monospace; font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2); color: var(--fg-muted); }
.code-inline { font-family: monospace; font-size: 12.5px; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; color: var(--brand-300); }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 6px 0; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.dialog { background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 480px; }

/* Modale (popup) — utilisée pour la génération de prospects */
.modal { display: none; position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); }
.modal-dialog {
    position: relative; z-index: 1;
    background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
input[type="range"] { accent-color: var(--brand-500); }

/* Cartes de sélection de thème (page Préférences) */
.theme-card {
    display: block;
    cursor: pointer;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--line);
    background: var(--bg-1);
    transition: border-color .15s, transform .12s;
}
.theme-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.theme-card.selected { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(121,22,255,0.12); }
.theme-card input[type="radio"] { display: none; }

.theme-preview { border-radius: 8px; padding: 12px; height: 90px; position: relative; overflow: hidden; }
.theme-preview-bar   { width: 30%; height: 6px; border-radius: 3px; background: var(--brand-500); }
.theme-preview-block { width: 60%; height: 14px; border-radius: 4px; margin-top: 10px; }
.theme-preview-line  { width: 80%; height: 6px; border-radius: 3px; margin-top: 8px; }
.theme-preview-line.short { width: 50%; }

.theme-preview-dark  { background: #0a0b14; }
.theme-preview-dark  .theme-preview-block { background: rgba(255,255,255,0.10); }
.theme-preview-dark  .theme-preview-line  { background: rgba(255,255,255,0.06); }
.theme-preview-light { background: #f5f7fb; }
.theme-preview-light .theme-preview-block { background: rgba(15,18,33,0.12); }
.theme-preview-light .theme-preview-line  { background: rgba(15,18,33,0.06); }
.theme-preview-auto  { background: linear-gradient(135deg, #0a0b14 0%, #0a0b14 49%, #f5f7fb 51%, #f5f7fb 100%); }
.theme-preview-auto  .theme-preview-block { background: rgba(255,255,255,0.20); }
.theme-preview-auto  .theme-preview-line  { background: rgba(255,255,255,0.15); }

/* Bar chart simple SVG */
.bar-chart { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 60px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--accent)); }

/* =============================================================================
   Lead generator — streaming UI (progress bar + leads remontés en direct)
   ============================================================================= */
.lg-stream-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.lg-stream-stage {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.lg-stream-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--line-2);
    border-top-color: var(--brand-400);
    animation: lgSpin 0.8s linear infinite;
    display: inline-block;
}
@keyframes lgSpin { to { transform: rotate(360deg); } }
.lg-stream-progress-text { font-variant-numeric: tabular-nums; color: var(--fg-muted); font-size: 13px; }

.lg-stream-bar {
    height: 8px;
    background: var(--bg-2);
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 10px;
}
.lg-stream-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-500), var(--accent));
    transition: width 250ms ease, background-color 200ms ease;
    box-shadow: 0 0 10px rgba(154, 102, 255, 0.45);
}

.lg-stream-prospect {
    font-size: 12.5px;
    color: var(--fg-muted);
    min-height: 18px;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Petite ligne sous le prospect qui montre l'output de chaque provider en live */
.lg-stream-attempts {
    font-size: 11.5px;
    min-height: 16px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-variant-numeric: tabular-nums;
}
.lg-attempt { transition: color 200ms ease; }

/* Panneau de stats agrégées par provider (en bas de la card streaming) */
.lg-provider-stats {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 4px;
}
.lg-prov-title {
    font-size: 11.5px;
    color: var(--fg-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.lg-prov-row {
    display: grid;
    grid-template-columns: 100px repeat(3, 1fr);
    gap: 10px;
    font-size: 12px;
    align-items: center;
    padding: 3px 0;
    font-variant-numeric: tabular-nums;
}
.lg-prov-name { font-weight: 600; }
.lg-prov-stat { color: var(--fg-muted); }

.lg-stream-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}
.lg-stream-stat {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* Liste live des leads remontés */
.lg-stream-leads {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 2px;
}
.lg-stream-lead {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    background: var(--bg-1);
    animation: lgLeadIn 220ms ease;
}
.lg-stream-lead.is-skipped { opacity: 0.55; background: var(--bg-2); }
@keyframes lgLeadIn {
    from { opacity: 0; transform: translateY(-6px); background: rgba(154, 102, 255, 0.12); }
    to   { opacity: 1; transform: none; }
}
.lg-stream-lead-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.lg-stream-lead-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.lg-stream-lead-contact {
    margin-top: 4px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Cartes de sélection des providers d'enrichissement (popup /leads) */
.enricher-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-1);
    transition: border-color 120ms ease, background 120ms ease;
}
.enricher-card:hover {
    border-color: var(--brand-400);
    background: rgba(154, 102, 255, 0.05);
}
.enricher-card.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.enricher-card.is-disabled:hover {
    border-color: var(--line-2);
    background: var(--bg-1);
}
.enricher-card .enricher-checkbox {
    margin-top: 3px;
    flex-shrink: 0;
}
.enricher-card .enricher-meta { flex: 1; min-width: 0; }
.enricher-card .enricher-name { font-weight: 600; font-size: 13.5px; }
.enricher-card .enricher-desc { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.enricher-card .enricher-cost { font-size: 11px; color: var(--fg-soft); margin-top: 4px; font-variant-numeric: tabular-nums; }
.enricher-card:has(.enricher-checkbox:checked) {
    border-color: var(--brand-500);
    background: rgba(121, 22, 255, 0.08);
}
