/* ==========================================================================
   ALL-EMAILING : feuille de style unique (aucune dépendance externe).
   Palette : anthracite + orange Alter Création (#6366f1), contrastes AA.
   ========================================================================== */

:root {
    --brand: #6366f1;
    --brand-strong: #4f46e5;      /* texte / boutons sur fond clair (contraste ≥ 4.5:1) */
    --brand-soft: #eef2ff;
    --chart-a: #6366f1;
    --brand-rgb: 99, 102, 241;
    --chart-b: var(--chart-b);
    --chart-c: #4f46e5;
    --ink: #1c2230;
    --ink-2: #3c4558;
    --muted: #5f6b7d;
    --line: #e3e7ee;
    --line-strong: #cfd6e1;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --sidebar: #191e29;
    --sidebar-2: #232a38;
    --sidebar-text: #c5ccd9;
    --success: #1f8a4c;
    --success-soft: #e6f5ec;
    --danger: #c0352b;
    --danger-soft: #fdecea;
    --warning: #a35c00;
    --warning-soft: #fff4e0;
    --info: #0e7c86;
    --info-soft: #e1f4f6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .85em; background: #eef1f6; padding: 1px 5px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
:focus-visible { outline: 3px solid rgba(var(--brand-rgb, 99, 102, 241), .55); outline-offset: 2px; border-radius: 4px; }
.sprite { display: none; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.icon-lg { width: 40px; height: 40px; color: var(--line-strong); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- Layout ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    background: var(--sidebar); color: var(--sidebar-text);
    display: flex; flex-direction: column; z-index: 40;
}
.sidebar-brand { padding: 22px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-brand img { display: block; height: 38px; width: auto; }
.sidebar-product { display: block; margin-top: 10px; font-size: 11px; letter-spacing: .14em; font-weight: 700; color: var(--v-soft-border, #a5b4fc); }
.sidebar-nav { padding: 12px; flex: 1; overflow-y: auto; }
.nav-section { margin: 18px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #8590a3; font-weight: 600; }
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--sidebar-text); font-weight: 500; margin-bottom: 2px;
}
.nav-link:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav-link.is-active { background: rgba(var(--brand-rgb, 99, 102, 241), .14); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav-link.is-active .icon { color: var(--brand); }
.nav-link.is-disabled { opacity: .55; cursor: default; }
.nav-link.is-disabled:hover { background: none; color: var(--sidebar-text); }
.sidebar-nav-bottom { flex: 0 0 auto; padding-top: 8px; padding-bottom: 8px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-foot { padding: 16px 22px; font-size: 12px; color: #7d889b; border-top: 1px solid rgba(255,255,255,.06); }

.shell { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 16px;
    padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.menu-toggle { display: none; }
/* Raccourcis GreenArrow (admins) : même dégradé bleu que les bandeaux de cartes */
.topbar-links { display: flex; align-items: center; gap: 8px; }
.button-platform-light {
    background: linear-gradient(180deg, #f6f7ff 0%, #eef0ff 100%); border-color: #d9ddf7; color: var(--brand-strong); font-weight: 600;
}
.button-platform-light:hover { background: linear-gradient(180deg, #eef0ff 0%, #e4e8ff 100%); border-color: #c7cdf3; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-menu form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--ink); }
.user-chip:hover { background: var(--bg); text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.avatar-logo { background: #fff; border: 1px solid var(--line); overflow: hidden; }
.avatar-logo img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; padding: 3px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--muted); }
.icon-button {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-button:hover { background: var(--bg); color: var(--ink); }

.simulation-banner {
    display: flex; align-items: center; gap: 10px; padding: 10px 28px;
    background: repeating-linear-gradient(-45deg, #fff4e0, #fff4e0 12px, #ffeccc 12px, #ffeccc 24px);
    color: #6b3d00; border-bottom: 1px solid #f3d29a; font-size: 14px;
}
.main { padding: 28px 32px; width: 100%; max-width: none; outline: none; }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { margin: 6px 0 0; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-strong); font-weight: 700; }
.campaign-subject { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.switch:hover, .switch:has(input:checked) { color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--brand-strong); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 99, 102, 241), .35); }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--muted); font-weight: 500; }
.freshness { margin: -6px 0 16px; color: var(--muted); font-size: 13px; }
/* Fiche stats : barre d'export des adresses, entre le bandeau titre et le parcours */
.export-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -4px 0 18px; padding: 10px 14px;
    border: 1px solid rgba(var(--brand-rgb), .22); border-radius: var(--radius);
    background: linear-gradient(100deg, rgba(var(--brand-rgb), .10), rgba(var(--brand-rgb), .03) 60%, #fff);
}
.export-bar form { margin: 0; }
.export-bar-label { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; font-weight: 700; color: var(--ink); }
.export-bar-label small { padding: 1px 7px; border-radius: 999px; background: rgba(var(--brand-rgb), .14); color: var(--brand-strong); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.export-bar-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--brand-strong), var(--brand)); box-shadow: 0 4px 10px rgba(var(--brand-rgb), .3); }
.export-bar-icon .icon { width: 16px; height: 16px; }
.export-chip {
    --chip: 37, 99, 235;
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px 0 12px; border-radius: 10px; cursor: pointer;
    border: 1px solid rgba(var(--chip), .35); background: #fff; color: rgb(var(--chip)); font: inherit; font-size: 14px; font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06); transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.export-chip .icon { width: 16px; height: 16px; }
.export-chip:hover:not(:disabled) { background: rgba(var(--chip), .08); box-shadow: 0 4px 12px rgba(var(--chip), .22); transform: translateY(-1px); }
.export-chip:disabled { cursor: not-allowed; opacity: .45; filter: grayscale(1); }
.export-chip.is-loading { opacity: .7; }
.export-chip-envoi { --chip: 37, 99, 235; }
.export-chip-desinscriptions { --chip: 194, 65, 12; }
.export-chip-bounces { --chip: 190, 18, 60; }
.export-bar-count { min-width: 24px; padding: 1px 7px; border-radius: 6px; background: rgba(var(--chip), .12); font-weight: 700; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .export-bar-label { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .export-chip { transition: none; } .export-chip:hover:not(:disabled) { transform: none; } }

/* ---------- Boutons ---------- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px;
    cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.button:hover { background: #f8f9fb; border-color: #b9c2d0; text-decoration: none; }
.button-primary { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.button-primary:hover { background: #4338ca; border-color: #4338ca; }
.button-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.button-ghost:hover { background: #eceff4; border-color: transparent; }
.button-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button-danger:hover { background: #a12c24; border-color: #a12c24; }
.button[disabled] { opacity: .5; cursor: not-allowed; }
.button-small { height: 32px; padding: 0 10px; font-size: 13px; }
.button-icon-only { width: 32px; padding: 0; }
.button-icon-only .icon { width: 17px; height: 17px; }
.button-block { width: 100%; }
.button[aria-busy="true"] { opacity: .7; cursor: progress; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-flush { padding: 0; overflow: hidden; }
.card-muted { background: #fafbfc; box-shadow: none; }
/* En-tête de carte : bandeau distinct pour séparer visuellement les blocs */
.card-head {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: -20px -20px 18px; padding: 14px 20px;
    background: linear-gradient(180deg, #f6f7ff 0%, #fbfbff 100%);
    border-bottom: 1px solid #e6e8f5; border-radius: var(--radius) var(--radius) 0 0;
}
.card-head-padded { margin: 0; padding: 14px 20px; }
.card-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.card-title::before {
    content: ""; flex: none; width: 4px; height: 20px; border-radius: 4px;
    background: linear-gradient(180deg, var(--brand), var(--chart-b));
}
.card-muted .card-head { background: #f3f4f7; }
.card-muted .card-title::before { background: var(--line-strong); }
.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.two-cols > .card { margin-bottom: 20px; }
.two-cols-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.kpi {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
    box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line-strong); }
.kpi-brand::before { background: var(--brand); }
.kpi-success::before { background: var(--success); }
.kpi-danger::before { background: var(--danger); }
.kpi-warning::before { background: #e0a020; }
.kpi-info::before { background: var(--info); }
.kpi-ink::before { background: var(--ink); }
.kpi-label { margin: 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { margin: 6px 0 2px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value-sm { font-size: 20px; }
.kpi-sub { margin: 0; font-size: 13px; color: var(--ink-2); }
.hint {
    display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
    background: #eef1f6; color: var(--muted); font-size: 11px; font-weight: 700; cursor: help;
}

/* ---------- Filtres ---------- */
.filters {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 20px;
    padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters-actions { display: flex; gap: 8px; margin-left: auto; }
.segmented { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; }
.segment { padding: 7px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.segment:hover { text-decoration: none; color: var(--ink); }
.segment.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .fieldset legend { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field-inline { gap: 4px; }
.field-inline label { font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* Onglets de Réglages : bandeau teinté comme les entêtes de carte, onglet actif en pastille blanche. */
.settings-tabs {
    display: flex; flex-wrap: wrap; gap: 6px; width: fit-content; max-width: 100%; margin-bottom: 20px; padding: 6px;
    background: linear-gradient(90deg, var(--v-head-1, #f6f7ff) 0%, var(--v-head-2, #fbfbff) 100%);
    border: 1px solid var(--v-head-border, #e6e8f5); border-radius: 16px;
}
.settings-tab {
    display: flex; align-items: center; gap: 12px; padding: 10px 22px 10px 10px; border-radius: 12px;
    color: var(--ink-2); transition: background .15s, color .15s, box-shadow .15s;
}
.settings-tab:hover { background: rgba(255, 255, 255, .7); color: var(--brand-strong); text-decoration: none; }
.settings-tab-icon {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
    background: #fff; color: var(--brand); box-shadow: 0 0 0 1px var(--v-head-border, #e6e8f5);
}
.settings-tab-text { display: flex; flex-direction: column; line-height: 1.25; }
.settings-tab-label { font-weight: 700; font-size: 15px; }
.settings-tab-hint { font-size: 12px; color: var(--muted); }
.settings-tab.is-active {
    background: #fff; color: var(--brand-strong);
    box-shadow: 0 6px 16px rgba(var(--v-shadow-rgb, 67, 56, 202), .14), 0 0 0 1px var(--v-soft-border, #c7d2fe);
}
.settings-tab.is-active .settings-tab-icon {
    color: #fff; box-shadow: 0 4px 10px rgba(var(--v-shadow-rgb, 67, 56, 202), .25);
    background: linear-gradient(135deg, var(--brand-strong) 0%, var(--v-hero-3, var(--brand)) 100%);
}
.card > .alert { margin-bottom: 14px; }
.backup-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 6px; }
.backup-confirm[open] { display: flex; flex-direction: column; align-items: flex-end; }
.card > .plain-list + .form { margin-top: 14px; }
.backup-confirm { display: inline-block; }
.backup-confirm summary { list-style: none; }
.backup-confirm summary::-webkit-details-marker { display: none; }
.backup-confirm[open] .form {
    width: 240px; margin-top: 8px; padding: 12px; gap: 8px; text-align: left; white-space: normal;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.field-help { margin: 0; font-size: 12px; color: var(--muted); }
.field-check { flex-direction: row; align-items: center; gap: 10px; }
.field-check label { font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="time"], input[type="number"], input:not([type]), select, textarea {
    font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; min-height: 40px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 99, 102, 241), .2); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-strong); }
.field-search { position: relative; flex: 1 1 260px; }
.field-search .icon { position: absolute; left: 12px; bottom: 11px; color: var(--muted); }
.field-search input { padding-left: 38px; }
.form-actions { display: flex; gap: 10px; }
.form-inline { display: flex; gap: 8px; margin-bottom: 12px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; }
.check-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.check-card:hover { border-color: var(--line-strong); background: #fafbfc; }
.check-card small { display: block; color: var(--muted); font-size: 12px; }
.check-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Alertes ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 14px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--success-soft); border-color: #b9e2c9; color: #14532d; }
.alert-error { background: var(--danger-soft); border-color: #f5c2bd; color: #7f1d1d; }
.alert-info { background: var(--info-soft); border-color: #a9dde2; color: #0b5560; }
.alert-warning { background: var(--warning-soft); border-color: #f3d29a; color: #6b3d00; margin-bottom: 16px; }
.alert-secret { background: #1c2230; border-color: #1c2230; color: #fff; font-family: var(--mono); font-size: 13px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td, .table tbody tr:last-child th, .table-kv tr:last-child th, .table-kv tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; }
.table-kv th { font-weight: 500; color: var(--ink-2); }
.table-kv th, .table-kv td { padding: 9px 4px; }
.cell-main { min-width: 220px; }
.row-link { font-weight: 600; color: var(--ink); }
.row-link:hover { color: var(--brand-strong); }
.cell-meta { display: block; font-size: 12px; color: var(--muted); }
.rate { display: block; font-weight: 600; }
.sort { color: inherit; }
.sort:hover, .sort.is-active { color: var(--ink); text-decoration: none; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef1f6; color: var(--ink-2); }
.badge-finished, .badge-sync-success { background: var(--success-soft); color: #166534; }
.badge-sending, .badge-sync-running { background: var(--info-soft); color: #0b5560; }
.badge-scheduled { background: #f3e8ff; color: #6b21a8; }
.badge-idle { background: #eef1f6; color: var(--ink-2); }
.badge-cancelled, .badge-failed, .badge-sync-failed { background: var(--danger-soft); color: #991b1b; }
.badge-sync-partial { background: var(--warning-soft); color: #7c4a03; }
.badge-role-admin { background: var(--brand-soft); color: var(--brand-strong); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pagination-info { margin: 0; color: var(--muted); font-size: 13px; }
.pagination ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.pagination li > * { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 14px; }
.pagination a { color: var(--ink-2); border: 1px solid var(--line); }
.pagination a:hover { background: var(--bg); text-decoration: none; }
.pagination [aria-current] { background: var(--ink); color: #fff; font-weight: 600; }
.pagination [aria-disabled] { color: #a5adbb; }
.per-page { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.per-page select { width: auto; min-height: 34px; padding: 4px 8px; }

/* ---------- États vides / erreurs ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state h2 { font-size: 17px; color: var(--ink); margin: 12px 0 6px; }
.empty-state p { margin: 0 auto; max-width: 520px; }
.error-page { max-width: 520px; margin: 12vh auto; text-align: center; padding: 0 20px; }
.error-code { font-size: 64px; font-weight: 800; color: var(--brand); margin: 0; letter-spacing: -.03em; }
.error-page h1 { margin-bottom: 10px; }
.debug { text-align: left; white-space: pre-wrap; background: #1c2230; color: #fff; padding: 12px; border-radius: 8px; font-size: 12px; }

/* ---------- Fiche campagne ---------- */
.deliver-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.big-number { background: linear-gradient(135deg, #1c2230, #2b3446); color: #fff; border-radius: var(--radius); padding: 24px 20px; text-align: center; }
.big-number-value { margin: 0; font-size: 38px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big-number-label { margin: 2px 0 0; color: #c5ccd9; font-size: 14px; }
.stat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.stat-item { padding: 10px 12px; border-radius: var(--radius-sm); background: #f7f8fa; border-left: 3px solid var(--line-strong); }
.stat-item dt { font-size: 12px; color: var(--muted); }
.stat-item dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-item dd small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat-success { border-left-color: var(--success); }
.stat-danger { border-left-color: var(--danger); }
.stat-warning { border-left-color: #e0a020; }

.gauges { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.gauge { margin: 0; width: 132px; text-align: center; }
.gauge svg { width: 112px; height: 112px; }
.gauge-track { stroke: #edf0f4; }
.gauge-value { stroke: var(--brand); }
.gauge-success .gauge-value { stroke: var(--success); }
.gauge-danger .gauge-value { stroke: var(--danger); }
.gauge-brand-soft .gauge-value { stroke: var(--v-soft-border, #a5b4fc); }
.gauge-info .gauge-value { stroke: var(--info); }
.gauge-info-soft .gauge-value { stroke: #67c6cf; }
.gauge-text { font-size: 15px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.gauge figcaption { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.gauge figcaption small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }

.link-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.link-bars li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 120px; gap: 14px; align-items: center; font-size: 14px; }
.link-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.link-svg { width: 100%; height: 14px; }
.bar-total { fill: var(--brand); }
.bar-unique { fill: var(--v-soft-border, #c7d2fe); }
.link-count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.link-count small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend-bar { display: inline-block; width: 14px; height: 8px; border-radius: 2px; background: var(--brand); }
.legend-bar-alt { background: var(--v-soft-border, #c7d2fe); }
.legend-line { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--ink); margin-left: 6px; }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 24px; margin: 0; }
.meta-grid-single { grid-template-columns: 1fr; }
.meta-grid dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.meta-grid dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Graphique ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart-axis { stroke: var(--line-strong); }
.chart-bar { fill: var(--v-soft-border, #c7d2fe); }
.chart-bar:hover { fill: var(--brand); }
.chart-line { stroke: var(--ink); stroke-width: 2; }
.chart-dot { fill: var(--ink); }
.chart-label { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.formulas { margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.formulas summary { cursor: pointer; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.formulas dl { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; margin: 14px 0 4px; font-size: 14px; }
.formulas dt { font-weight: 600; }
.formulas dd { margin: 0; color: var(--ink-2); }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Connexion ---------- */
.guest { background: var(--bg); }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); max-width: 560px; width: 100%; margin: 0 auto; }
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 40px; }
.login-product { margin: 0; font-weight: 800; letter-spacing: .06em; }
.login-tagline { margin: 0; color: var(--muted); font-size: 14px; }
.login-title { font-size: 28px; margin-bottom: 20px; }
.login-help { margin-top: 20px; font-size: 13px; color: var(--muted); }
.login-intro { margin: 0 0 18px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.field-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.login-forgot { font-size: 13px; font-weight: 600; }
.login-aside {
    background: radial-gradient(circle at 20% 20%, #2b3446 0, #191e29 60%), #191e29;
    color: #c5ccd9; display: flex; flex-direction: column; justify-content: flex-end; padding: 56px; position: relative; overflow: hidden;
}
.login-aside::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; right: -120px; top: -120px; background: rgba(var(--brand-rgb, 99, 102, 241), .25); filter: blur(10px); }
.login-aside img { width: 200px; height: auto; margin-bottom: 20px; position: relative; z-index: 1; }
.login-aside p { max-width: 420px; font-size: 18px; line-height: 1.5; position: relative; z-index: 1; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .deliver-grid { grid-template-columns: 1fr; }
    .two-cols, .two-cols-wide { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .sidebar.is-open { transform: none; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 20, 30, .45); z-index: 35; }
    .shell { margin-left: 0; }
    .menu-toggle { display: inline-grid; }
    .topbar, .simulation-banner { padding-left: 16px; padding-right: 16px; }
    .main { padding: 18px 16px; }
    .user-meta { display: none; }
    .topbar-link-label { display: none; }
    .login { grid-template-columns: 1fr; }
    .login-aside { display: none; }
    .formulas dl { grid-template-columns: 1fr; gap: 2px; }
    .formulas dd { margin-bottom: 8px; }
}
@media (max-width: 600px) {
    .page-title { font-size: 21px; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 12px 14px; }
    .kpi-value { font-size: 22px; }
    .filters { padding: 12px; }
    .filters .field-inline, .filters-actions { flex: 1 1 140px; }
    .filters-actions { margin-left: 0; }
    .link-bars li { grid-template-columns: 1fr 90px; }
    .link-bars .link-svg { grid-column: 1 / -1; grid-row: 2; }
    /* Tableau de campagnes en cartes */
    .table-campaigns thead { display: none; }
    .table-campaigns, .table-campaigns tbody, .table-campaigns tr, .table-campaigns td { display: block; width: 100%; }
    .table-campaigns tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; }
    .table-campaigns td { border: 0; padding: 0; text-align: left !important; }
    .table-campaigns td.cell-main, .table-campaigns td.nowrap { grid-column: 1 / -1; }
    .table-campaigns td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
    .table-campaigns td.nowrap::before { display: inline; margin-right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
@media print {
    .sidebar, .topbar, .filters, .head-actions, .back-link, .simulation-banner { display: none !important; }
    .shell { margin: 0; }
    .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Audience Matomo ---------- */
.audience-block { margin-top: 18px; }
.audience-title { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 0 0 10px; }
.audience-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 32px; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 6.5rem; gap: 10px; align-items: center; font-size: 13px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-svg { width: 100%; height: 8px; }
.hbar { fill: #67c6cf; }
.hbar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar-value small { color: var(--muted); font-weight: 500; }

/* ==========================================================================
   Fiche campagne (refonte)
   ========================================================================== */
.hero {
    display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap;
    padding: 26px 28px; margin-bottom: 18px; border-radius: 16px; color: #fff;
    background: radial-gradient(circle at 92% -20%, rgba(var(--brand-rgb, 99, 102, 241), .55), transparent 45%),
                linear-gradient(135deg, #1c2230 0%, #2a3346 100%);
    box-shadow: var(--shadow-lg);
}
.hero-main { min-width: 0; flex: 1 1 420px; }
.hero-eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--v-soft-border, #c7d2fe); font-weight: 700; }
.hero-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; overflow-wrap: anywhere; }
.hero-subject { margin: 8px 0 0; font-size: 17px; color: #dfe4ee; }
.hero-meta { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: #b8c1d1; font-size: 14px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-actions form { margin: 0; }
.button-on-dark { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }
.button-platform { background: rgba(var(--brand-rgb, 99, 102, 241), .35); border-color: rgba(165, 180, 252, .6); }
.button-on-dark:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .35); }

.funnel-card { padding: 22px 24px 14px; }
.funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.funnel-step { position: relative; }
.funnel-step + .funnel-step::before { content: "\203A"; position: absolute; left: -14px; top: 22px; color: var(--line-strong); font-size: 22px; }
.funnel-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.funnel-value { margin: 4px 0 10px; font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.funnel-bar { width: 100%; height: 10px; display: block; }
.funnel-track { fill: #eef1f6; }
.step-sent .funnel-fill { fill: #2b3446; }
.step-accepted .funnel-fill { fill: var(--success); }
.step-opened .funnel-fill { fill: var(--brand); }
.step-clicked .funnel-fill { fill: var(--info); }
.funnel-rate { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.funnel-rate strong { font-size: 15px; color: var(--ink); }
.funnel-card .freshness { margin: 16px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }

.insights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
.insight {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
    box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.insight::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; opacity: .12; }
.insight-brand::after { background: var(--brand); }
.insight-info::after { background: var(--info); }
.insight-success::after { background: var(--success); }
.insight-warning::after { background: #e0a020; }
.insight-kicker { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.insight-big { margin: 6px 0 4px; font-size: 34px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.insight-brand .insight-big { color: var(--brand-strong); }
.insight-info .insight-big { color: var(--info); }
.insight-success .insight-big { color: var(--success); }
.insight-warning .insight-big { color: var(--warning); }
.insight-text { margin: 0; font-size: 14px; color: var(--ink-2); flex: 1; }
.insight-foot { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.delta { display: inline-block; padding: 1px 7px; border-radius: 999px; font-weight: 700; font-size: 12px; margin-right: 4px; }
.delta-good { background: var(--success-soft); color: #166534; }
.delta-bad { background: var(--danger-soft); color: #991b1b; }
.delta-flat { background: #eef1f6; color: var(--ink-2); }
.bench-note { margin: 0 0 20px; font-size: 12px; color: var(--muted); }

.source-chip { font-size: 12px; color: var(--muted); background: #f1f3f7; padding: 3px 10px; border-radius: 999px; }
.audience-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 6px; }
.highlight { background: linear-gradient(180deg, var(--brand-soft), #fff); border: 1px solid var(--v-soft-border, #e0e7ff); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; }
.highlight-value { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.highlight-label { font-size: 13px; color: var(--ink-2); }
.chart-line-brand { stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; }
.chart-dot-brand { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.chart-label-strong { font-weight: 700; fill: var(--ink); }
.skeleton { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.skeleton span, .skeleton-chart {
    display: block; height: 72px; border-radius: var(--radius-sm);
    background: linear-gradient(90deg, #f1f3f7 25%, #f8f9fb 50%, #f1f3f7 75%); background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-chart { height: 200px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.chart-future { fill: #f8f9fb; stroke: var(--line-strong); stroke-dasharray: 6 6; }
.chart-future-label { font-size: 17px; fill: var(--muted); font-family: var(--font); font-style: italic; }

/* Courbes lissées (tableau de bord, fiche campagne) */
.chart-curve { max-height: 320px; overflow: visible; }
.chart-grid { stroke: #e9ecf2; stroke-dasharray: 3 6; }
.chart-tick { font-size: 15px; fill: #8a94a6; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-tick-rate { fill: #4b5568; }
.chart-day { font-size: 17px; font-weight: 700; fill: var(--ink-2); font-family: var(--font); }
.chart-curve-line { stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 6px 8px rgba(var(--brand-rgb, 99, 102, 241), .35)); }
.chart-curve-ink { stroke: var(--ink); stroke-width: 3; filter: drop-shadow(0 4px 6px rgba(28, 34, 48, .25)); }
.chart-drop { stroke: var(--v-soft-border, #c7d2fe); stroke-width: 1.5; stroke-dasharray: 2 5; }
.chart-halo { fill: rgba(var(--brand-rgb, 99, 102, 241), .16); transition: r .15s; }
.chart-halo-ink { fill: rgba(28, 34, 48, .1); }
.chart-node { fill: #fff; stroke: var(--brand-strong); stroke-width: 3.5; }
.chart-node-ink { stroke: var(--ink); }
.chart-value { font-size: 19px; font-weight: 800; fill: var(--ink); font-family: var(--font); paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.chart-point:hover .chart-halo { r: 17; }
.chart-bar-soft { transition: opacity .15s; }
.chart-col:hover .chart-bar-soft { opacity: .8; }
.curve-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.curve-facts strong { color: var(--brand-strong); font-size: 15px; }
.heat { width: 100%; height: auto; display: block; }
.heat-cell { fill: var(--brand); }
.heat-peak { stroke: var(--ink); stroke-width: 2; }
.hbar-track { fill: #f0f2f6; }
.hbar { fill: var(--brand); }
.hbars li { grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) 3rem; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 128px; height: 128px; }
.donut-track { stroke: #f0f2f6; }
.donut-a { stroke: var(--brand); background: var(--brand); }
.donut-b { stroke: #2b3446; background: #2b3446; }
.donut-c { stroke: var(--info); background: var(--info); }
.donut-d { stroke: #e0a020; background: #e0a020; }
.donut-e { stroke: #9aa5b8; background: #9aa5b8; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }

.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rank li { display: grid; grid-template-columns: 28px minmax(0, 1fr) 76px; gap: 12px; align-items: center; }
.rank-pos { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #f1f3f7; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.rank li:first-child .rank-pos { background: var(--brand-strong); color: #fff; }
.rank-label { display: block; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rank-svg { width: 100%; height: 14px; display: block; margin-top: 6px; }
.rank-value { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-value small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }

.stack { width: 100%; height: 22px; display: block; border-radius: 8px; overflow: hidden; margin: 6px 0 14px; }
.seg-ok { fill: var(--success); background: var(--success); }
.seg-hard { fill: var(--danger); background: var(--danger); }
.seg-soft { fill: #e0a020; background: #e0a020; }
.seg-other { fill: #9aa5b8; background: #9aa5b8; }
.stack-legend { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 14px; color: var(--ink-2); }
.stack-legend strong { color: var(--ink); margin: 0 4px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--line); }
.mini-stats dt { font-size: 12px; color: var(--muted); }
.mini-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.more { margin-top: 12px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.more[open] summary { margin-bottom: 10px; }
.more-card summary { font-size: 16px; font-weight: 700; color: var(--ink); }

@media (max-width: 1100px) {
    .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .funnel-step + .funnel-step::before { display: none; }
    .hero { padding: 20px; }
    .hero-title { font-size: 21px; }
}
@media (max-width: 480px) {
    .insights { grid-template-columns: 1fr; }
    .funnel-value { font-size: 26px; }
    .stack-legend { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Thème « vif » (proposition) : menu en dégradé, fond teinté, cartes en relief,
   tableau de bord illustré. Activé par le bouton de l'en-tête (cookie ae_theme).
   ========================================================================== */
.theme-switch {
    font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; white-space: nowrap;
    color: var(--brand-strong); background: var(--brand-soft); border: 1px solid var(--v-soft-border);
}
.theme-switch:hover { text-decoration: none; background: var(--v-soft-border); }

.theme-vivid { --bg: var(--v-bg); --line: #e6e8f3; }
.theme-vivid .sidebar {
    background: linear-gradient(190deg, var(--v-side-1) 0%, var(--v-side-2) 55%, var(--v-side-3) 100%);
    color: var(--v-soft-border); box-shadow: 4px 0 24px rgba(var(--v-shadow-rgb), .18);
}
.theme-vivid .sidebar-brand, .theme-vivid .sidebar-foot, .theme-vivid .sidebar-nav-bottom { border-color: rgba(255, 255, 255, .14); }
.theme-vivid .sidebar-product { color: #fff; opacity: .9; }
.theme-vivid .nav-section { color: rgba(255, 255, 255, .62); }
.theme-vivid .nav-link { color: var(--v-soft-border); border-radius: 12px; }
.theme-vivid .nav-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.theme-vivid .nav-link.is-active { background: #fff; color: var(--v-side-1); box-shadow: 0 6px 16px rgba(var(--v-shadow-rgb), .25); }
.theme-vivid .nav-link.is-active .icon { color: var(--brand); }
.theme-vivid .sidebar-foot { color: rgba(255, 255, 255, .6); }
.theme-vivid .topbar { background: rgba(255, 255, 255, .85); border-bottom-color: transparent; box-shadow: 0 1px 0 #e6e8f3; }
.theme-vivid .card, .theme-vivid .kpi, .theme-vivid .insight, .theme-vivid .filters, .theme-vivid .formulas {
    border-color: transparent; box-shadow: 0 6px 24px rgba(var(--v-shadow-rgb), .08), 0 1px 2px rgba(16, 24, 40, .05);
}
.theme-vivid .card-head { background: linear-gradient(90deg, var(--v-head-1) 0%, var(--v-head-2) 60%, #fff 100%); border-bottom-color: var(--v-head-border); }
.theme-vivid .card-title::before { background: linear-gradient(180deg, var(--brand), var(--v-hero-3)); }

/* Bandeau d'accueil */
.dash-hero {
    position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between;
    padding: 30px 32px; margin-bottom: 18px; border-radius: 20px; color: #fff;
    background: linear-gradient(120deg, var(--brand-strong) 0%, var(--v-hero-2) 55%, var(--v-hero-3) 100%);
    box-shadow: 0 18px 40px rgba(var(--v-hero-rgb), .28);
}
.dash-hero::before, .dash-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.dash-hero::before { width: 360px; height: 360px; right: -90px; top: -170px; }
.dash-hero::after { width: 220px; height: 220px; right: 260px; bottom: -150px; background: rgba(255, 255, 255, .07); }
.dash-hero > * { position: relative; z-index: 1; }
.dash-hero-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.dash-hero-title { margin: 6px 0 4px; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.dash-hero-sub { margin: 0 0 18px; font-size: 16px; opacity: .9; }
.dash-periods { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px); }
.dash-period { padding: 7px 14px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 13px; }
.dash-period:hover { text-decoration: none; background: rgba(255, 255, 255, .16); }
.dash-period.is-active { background: #fff; color: var(--brand-strong); }
.dash-hero-figures { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-figure {
    display: flex; flex-direction: column; min-width: 150px; padding: 14px 18px; border-radius: 16px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px);
}
.dash-figure-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dash-figure-label { font-size: 13px; opacity: .85; }

.dash-filters { margin: 0 0 18px; }
.dash-filters summary { cursor: pointer; font-weight: 700; color: var(--brand-strong); font-size: 14px; padding: 4px 2px; }
.dash-filters[open] summary { margin-bottom: 10px; }
.filters-flat { margin-bottom: 0; }

/* Indicateurs illustrés */
.vkpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 6px; }
.vkpi {
    position: relative; overflow: hidden; background: #fff; border-radius: 18px; padding: 18px 20px;
    box-shadow: 0 6px 24px rgba(var(--v-shadow-rgb), .08), 0 1px 2px rgba(16, 24, 40, .05);
    transition: transform .15s ease, box-shadow .15s ease;
}
.vkpi:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(var(--v-shadow-rgb), .14); }
.vkpi::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--vk1); }
.vkpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.vkpi-icon {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none;
    background: linear-gradient(135deg, var(--vk1), var(--vk2)); box-shadow: 0 8px 18px var(--vk-shadow);
}
.vkpi-icon .icon { width: 22px; height: 22px; }
.vkpi-value { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.vkpi-label { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.vkpi-sub { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.vkpi-violet { --vk1: var(--brand-strong); --vk2: var(--brand); --vk-shadow: rgba(var(--v-shadow-rgb), .3); }
.vkpi-indigo { --vk1: #334155; --vk2: #64748b; --vk-shadow: rgba(51, 65, 85, .3); }
.vkpi-pink { --vk1: var(--v-hero-2); --vk2: var(--v-hero-3); --vk-shadow: rgba(var(--v-hero-rgb), .3); }
.vkpi-teal { --vk1: #0d9488; --vk2: #2dd4bf; --vk-shadow: rgba(13, 148, 136, .3); }
.vkpi-amber { --vk1: #d97706; --vk2: #fbbf24; --vk-shadow: rgba(217, 119, 6, .3); }
.vkpi-rose { --vk1: #e11d48; --vk2: #fb7185; --vk-shadow: rgba(225, 29, 72, .3); }
.spark { width: 120px; height: 36px; flex: none; }
.spark-line { stroke: var(--vk1); stroke-width: 2.5; stroke-linecap: round; }
.spark-area { fill: var(--vk2); opacity: .22; }
.spark-dot { fill: #fff; stroke: var(--vk1); stroke-width: 2; }
.vkpi-note { margin: 4px 0 20px; font-size: 12px; color: var(--muted); }
.vkpi-grid-lists { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
@media (max-width: 760px) {
    .dash-hero { padding: 22px 20px; }
    .dash-hero-title { font-size: 25px; }
    .dash-figure { min-width: 0; flex: 1 1 120px; }
    .theme-switch { display: none; }
}

/* Palettes du thème vif (sélecteur dans l'en-tête, cookie ae_palette). Océan par défaut. */
.theme-vivid, .theme-vivid.palette-ocean {
    --brand: #2563eb; --brand-strong: #1d4ed8; --brand-soft: #eff6ff; --v-soft-border: #bfdbfe;
    --v-side-1: #172554; --v-side-2: #1e40af; --v-side-3: #0e7490;
    --v-hero-2: #0284c7; --v-hero-3: #06b6d4; --v-hero-rgb: 2, 132, 199; --v-shadow-rgb: 30, 64, 175;
    --v-head-1: #eff6ff; --v-head-2: #f0fbff; --v-head-border: #dbeafe; --v-bg: #eef3fa;
    --chart-a: #2563eb; --chart-b: #22d3ee; --chart-c: #1d4ed8; --brand-rgb: 37, 99, 235;
}
.theme-vivid.palette-emerald {
    --brand: #059669; --brand-strong: #047857; --brand-soft: #ecfdf5; --v-soft-border: #a7f3d0;
    --v-side-1: #022c22; --v-side-2: #065f46; --v-side-3: #0f766e;
    --v-hero-2: #059669; --v-hero-3: #2dd4bf; --v-hero-rgb: 5, 150, 105; --v-shadow-rgb: 4, 120, 87;
    --v-head-1: #ecfdf5; --v-head-2: #f0fdfa; --v-head-border: #d1fae5; --v-bg: #eef6f2;
    --chart-a: #059669; --chart-b: #34d399; --chart-c: #047857; --brand-rgb: 5, 150, 105;
}
.theme-vivid.palette-indigo {
    --brand: #6366f1; --brand-strong: #4f46e5; --brand-soft: #eef2ff; --v-soft-border: #c7d2fe;
    --v-side-1: #312e81; --v-side-2: #4338ca; --v-side-3: #6d28d9;
    --v-hero-2: #7c3aed; --v-hero-3: #db2777; --v-hero-rgb: 124, 58, 237; --v-shadow-rgb: 67, 56, 202;
    --v-head-1: #eef0ff; --v-head-2: #f8f5ff; --v-head-border: #e4e6f7; --v-bg: #f1f2fb;
    --chart-a: #6366f1; --chart-b: #a78bfa; --chart-c: #4f46e5; --brand-rgb: 99, 102, 241;
}
.theme-vivid .sidebar { color: rgba(255, 255, 255, .9); }
.theme-vivid .nav-link { color: rgba(255, 255, 255, .88); }
.palette-picker { display: inline-flex; gap: 6px; align-items: center; }
.palette-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.palette-dot.is-active { box-shadow: 0 0 0 2px var(--ink); }
.palette-dot-ocean { background: linear-gradient(135deg, #1d4ed8, #06b6d4); }
.palette-dot-emerald { background: linear-gradient(135deg, #047857, #2dd4bf); }
.palette-dot-indigo { background: linear-gradient(135deg, #4f46e5, #db2777); }
.stop-a { stop-color: var(--chart-a); }
.stop-b { stop-color: var(--chart-b); }
.stop-c { stop-color: var(--chart-c); }

/* Connexion aux couleurs du design retenu */
.theme-vivid.guest { background: var(--v-bg); }
.theme-vivid .login-aside {
    background: linear-gradient(150deg, var(--v-side-1) 0%, var(--v-side-2) 50%, var(--v-hero-3) 100%);
    color: rgba(255, 255, 255, .9);
}
.theme-vivid .login-aside::before, .theme-vivid .login-aside::after { content: ""; position: absolute; border-radius: 50%; filter: none; }
.theme-vivid .login-aside::after { width: 460px; height: 460px; right: -140px; top: -160px; background: rgba(255, 255, 255, .1); }
.theme-vivid .login-aside::before { width: 300px; height: 300px; left: -90px; bottom: 120px; background: rgba(255, 255, 255, .07); }
.theme-vivid .login-aside p { font-size: 20px; font-weight: 600; }
.login-badge {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none;
    background: linear-gradient(135deg, var(--brand-strong), var(--v-hero-3, var(--brand)));
    box-shadow: 0 10px 22px rgba(var(--brand-rgb, 99, 102, 241), .35);
}
.login-badge .icon { width: 24px; height: 24px; }
.theme-vivid .login-panel { background: #fff; border-radius: 24px; margin: 40px auto; width: calc(100% - 48px); height: fit-content; align-self: center;
    box-shadow: 0 20px 50px rgba(var(--v-shadow-rgb), .12); padding: 44px clamp(24px, 4vw, 56px); }
.theme-vivid .login-panel .button-primary {
    background: linear-gradient(120deg, var(--brand-strong), var(--v-hero-3)); border: 0; height: 46px; font-size: 15px;
    box-shadow: 0 10px 22px rgba(var(--brand-rgb, 99, 102, 241), .3);
}
.theme-vivid .login-panel .button-primary:hover { filter: brightness(1.05); }

/* Fiche campagne harmonisée avec le tableau de bord (design Océan) */
.theme-vivid .hero {
    position: relative; overflow: hidden; border-radius: 20px; padding: 30px 32px;
    background: linear-gradient(120deg, var(--brand-strong) 0%, var(--v-hero-2) 55%, var(--v-hero-3) 100%);
    box-shadow: 0 18px 40px rgba(var(--v-hero-rgb), .28);
}
.theme-vivid .hero::before, .theme-vivid .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.theme-vivid .hero::before { width: 360px; height: 360px; right: -90px; top: -180px; background: rgba(255, 255, 255, .1); }
.theme-vivid .hero::after { width: 220px; height: 220px; right: 280px; bottom: -160px; background: rgba(255, 255, 255, .07); }
.theme-vivid .hero > * { position: relative; z-index: 1; }
.theme-vivid .hero-eyebrow { color: rgba(255, 255, 255, .8); }
.theme-vivid .hero-subject, .theme-vivid .hero-meta { color: rgba(255, 255, 255, .88); }
.theme-vivid .button-on-dark { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); backdrop-filter: blur(6px); }
.theme-vivid .button-on-dark:hover { background: rgba(255, 255, 255, .26); }
.theme-vivid .button-platform { background: #fff; color: var(--brand-strong); border-color: #fff; }
.theme-vivid .button-platform:hover { background: rgba(255, 255, 255, .9); }

.theme-vivid .funnel-card { border-radius: 18px; }
.theme-vivid .funnel-value { color: var(--ink); }

.theme-vivid .insight { border-radius: 18px; padding-top: 20px; }
.theme-vivid .insight::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; }
.theme-vivid .insight-brand::before { background: linear-gradient(90deg, var(--brand-strong), var(--v-hero-3)); }
.theme-vivid .insight-info::before { background: linear-gradient(90deg, #0d9488, #2dd4bf); }
.theme-vivid .insight-success::before { background: linear-gradient(90deg, #047857, #34d399); }
.theme-vivid .insight-warning::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.theme-vivid .insight::after { opacity: .1; width: 110px; height: 110px; right: -36px; top: -36px; }
.theme-vivid .insight-info .insight-big { color: #0f766e; }
.theme-vivid .insight-kicker { color: var(--ink-2); }

.theme-vivid .highlight { background: linear-gradient(180deg, var(--brand-soft), #fff); border-color: var(--v-soft-border); border-radius: 14px; }
.theme-vivid .highlight-value { color: var(--brand-strong); }
.theme-vivid .rank li:first-child .rank-pos { background: linear-gradient(135deg, var(--brand-strong), var(--v-hero-3)); }
.theme-vivid .step-clicked .funnel-fill, .theme-vivid .bar-total { fill: var(--brand); }
.theme-vivid .step-opened .funnel-fill { fill: var(--v-hero-3); }
.theme-vivid .bar-unique { fill: var(--v-soft-border); }
@media (max-width: 760px) { .theme-vivid .hero { padding: 22px 20px; } }

/* Points clés de la fiche campagne, sur le modèle des indicateurs du tableau de bord */
.vkpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vkpi-green { --vk1: #047857; --vk2: #34d399; --vk-shadow: rgba(4, 120, 87, .3); }
.vkpi-bench { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.vkpi-bench .delta { margin: 0; }
.vkpi-bench small { font-size: 11px; color: var(--muted); }
@media (max-width: 1100px) { .vkpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .vkpi-grid-4 { grid-template-columns: 1fr; } }

/* Audience des lecteurs : section mise en avant */
.audience-feature { padding-bottom: 24px; }
.audience-kpis { margin: 6px 0 8px; }
.audience-feature .audience-title { font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 12px; }
.audience-tile { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-top: 16px; }
.audience-feature .audience-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.audience-feature .audience-grid .audience-tile { margin-top: 0; }
.audience-feature .audience-grid { margin-top: 16px; }
.audience-feature .heat { margin-top: 4px; }
.audience-feature .donut { width: 150px; height: 150px; }

/* Répartitions en anneaux (fiche campagne) */
.donut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 18px 0 20px; }
.donut-grid .donut-card { margin-bottom: 0; display: flex; flex-direction: column; }
.donut-chart { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-big { width: 168px; height: 168px; flex: none; }
.donut-big .donut-track { stroke: #eef1f6; }
.donut-seg { fill: none !important; transition: stroke-width .15s; }
.donut-seg:hover { stroke-width: 7; }
.donut-center { font-size: 6.4px; font-weight: 800; fill: var(--ink); font-family: var(--font); }
.donut-center-sub { font-size: 3.3px; fill: var(--muted); font-family: var(--font); }
.donut-chart-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 160px; display: flex; flex-direction: column; gap: 10px; }
.donut-chart-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); }
.donut-chart-legend .dot { margin: 0; }
.dcl-value { font-weight: 800; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.dcl-value small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.donut-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.donut-empty { margin: 30px 0; text-align: center; color: var(--success); font-weight: 700; }

/* Couleurs des segments (anneaux et pastilles de légende) */
.seg-click { stroke: var(--brand-strong); background: var(--brand-strong); }
.seg-open { stroke: var(--v-hero-3, #06b6d4); background: var(--v-hero-3, #06b6d4); }
.seg-unread { stroke: #cbd5e1; background: #cbd5e1; }
.seg-privacy { stroke: #93c5fd; background: #93c5fd; }
.donut-seg.seg-hard { stroke: var(--danger); }
.donut-seg.seg-soft { stroke: #e0a020; }
.donut-seg.seg-other { stroke: #94a3b8; }

/* Anneau de taux dans les points clés, trait = moyenne de la liste */
.ring { width: 58px; height: 58px; flex: none; }
.ring-track { stroke: #eef1f6; }
.ring-value { stroke: var(--vk1, var(--brand)); }
.ring-ref { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
p.vkpi-bench { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; margin: 10px 0 0; text-align: left; }
p.vkpi-bench small { font-size: 12px; }

/* Motifs des bounces */
.hbars-wide li { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 3.5rem; }
.hbar.hbar-bounce-hard { fill: var(--danger); }
.hbar.hbar-bounce-soft { fill: #e0a020; }
.hbar.hbar-bounce-autre { fill: #94a3b8; }

/* Tableaux de campagnes : objet de l'email en première colonne */
.table .cell-subject { min-width: 260px; max-width: 420px; }
.table .cell-subject .row-link { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell-campaign { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }
@media (max-width: 600px) {
    .table-campaigns td.cell-subject { grid-column: 1 / -1; }
    .table-campaigns .cell-subject .row-link { font-size: 15px; }
}

.inline-form { display: inline-block; margin: 0; }
.actions .inline-form + .button, .actions .button + .inline-form { margin-left: 4px; }

/* Entête de tableau stylisé (campagnes, clients, utilisateurs) : bandeau teinté comme les entêtes de carte,
   colonne triée en pastille blanche comme l'entrée active du menu. */
.table-styled thead th {
    padding-top: 13px; padding-bottom: 13px;
    background: linear-gradient(180deg, var(--v-head-1, #f6f7ff) 0%, var(--v-head-2, #fbfbff) 100%);
    border-bottom: 2px solid var(--v-head-border, #e6e8f5);
    color: var(--ink-2); font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
}
.table-styled thead th:first-child { padding-left: 20px; }
.table-styled thead th:last-child { padding-right: 20px; }
.table-styled thead th[aria-sort] { border-bottom-color: var(--brand); }
.table-styled .sort {
    display: inline-flex; align-items: center; gap: 4px; margin: -5px -10px; padding: 5px 10px;
    border-radius: 999px; transition: background .15s, color .15s, box-shadow .15s;
}
.table-styled .sort:hover { color: var(--brand-strong); background: rgba(255, 255, 255, .75); }
.table-styled .sort.is-active {
    color: var(--brand-strong); background: #fff;
    box-shadow: 0 4px 12px rgba(var(--v-shadow-rgb, 67, 56, 202), .14), 0 0 0 1px var(--v-soft-border, #c7d2fe);
}
.sort-arrow { font-size: 12px; line-height: 1; opacity: .35; transition: opacity .15s; }
.sort:hover .sort-arrow { opacity: .7; }
.sort.is-active .sort-arrow { opacity: 1; }
@media (min-width: 601px) {
    .table-styled tbody td:first-child { padding-left: 20px; }
    .table-styled tbody td:last-child { padding-right: 20px; }
}

/* ==========================================================================
   Rapport PDF d'une campagne (impression navigateur → « Enregistrer au format PDF »)
   ========================================================================== */
.print-report { background: var(--bg); }
.print-page { max-width: 1040px; margin: 0 auto; padding: 24px 24px 32px; }
.print-toolbar {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.print-toolbar p { margin: 0; flex: 1 1 260px; color: var(--muted); font-size: 14px; }
.print-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.print-foot { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.print-report .formulas { display: none; }
@page { size: A4; margin: 10mm; }
@media print {
    .print-report { background: #fff; }
    .print-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-toolbar { display: none !important; }
    .print-page { max-width: none; padding: 0; zoom: .78; }
    .print-report .hero { box-shadow: none; }
    .print-report .card, .print-report .vkpi, .print-report .funnel-card { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; }
    .print-report .vkpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .print-report .two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .print-report .donut-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .print-report .audience, .print-report .donut-grid, .print-report .two-cols { break-inside: avoid; }
    .print-report a { color: inherit; text-decoration: none; }
}

/* ---------- Fiche client ---------- */
.client-hero {
    position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
    padding: 22px 26px; margin-bottom: 20px; border-radius: 20px; color: #fff;
    background: linear-gradient(120deg, var(--brand-strong) 0%, var(--v-hero-2, var(--brand)) 55%, var(--v-hero-3, var(--brand)) 100%);
    box-shadow: 0 18px 40px rgba(var(--v-hero-rgb, 79, 70, 229), .24);
}
.client-hero::after { content: ""; position: absolute; width: 300px; height: 300px; right: -80px; top: -160px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.client-hero > * { position: relative; z-index: 1; }
.client-avatar {
    display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; flex: none;
    background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); font-size: 24px; font-weight: 800; letter-spacing: .02em;
}
.client-avatar .icon-lg { color: #fff; width: 32px; height: 32px; }
.client-avatar-logo { background: #fff; overflow: hidden; }
.client-avatar-logo img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; padding: 6px; }
/* Fiche client : bloc « Page de désabonnement » (logo, couleur générale, mentions légales). */
/* Bloc repliable (details) : l'entête coloré garde ses coins arrondis une fois replié. */
.card-details:not([open]) > summary.block-head { margin-bottom: -20px; }
.branding-logo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
/* Logo toujours contenu dans sa zone, quelle que soit sa taille (SVG sans dimensions, image très large ou très haute). */
.branding-logo-preview { display: flex; align-items: center; justify-content: center; width: 180px; height: 80px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; flex: none; overflow: hidden; }
.branding-logo-preview img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.branding-color { display: flex; align-items: center; gap: 8px; }
.branding-color input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; flex: none; }
.branding-color input[type=text] { max-width: 140px; }
.client-hero-text { flex: 1 1 320px; min-width: 0; }
.client-hero .eyebrow { color: rgba(255, 255, 255, .8); }
.client-hero .page-title { color: #fff; margin: 0; overflow-wrap: anywhere; }
.client-hero .page-sub { color: rgba(255, 255, 255, .88); margin-top: 8px; }
.client-hero-actions .button-primary { background: #fff; border-color: #fff; color: var(--brand-strong); }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.section-icon { color: var(--brand-strong); }
.card-title:has(.section-icon)::before { display: none; }
.switch-list { display: flex; flex-direction: column; gap: 2px; }
.switch-list .switch { min-height: 34px; white-space: normal; }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-help-warning { color: var(--warning); font-weight: 600; }
.input-mono { font-family: var(--mono) !important; font-size: 13px !important; }
.input-with-action { position: relative; display: flex; }
.input-with-action input:has(+ .input-action) { padding-right: 42px; }
.input-action {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
    width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.input-action:hover { background: var(--brand-soft); color: var(--brand-strong); }
.input-action.is-done { color: var(--success, #15803d); }
.card-details > summary { list-style: none; cursor: pointer; }
.card-details > summary::-webkit-details-marker { display: none; }
.card-details:not([open]) > summary { margin-bottom: -20px; border-bottom: 0; border-radius: var(--radius); }
.card-details > summary .card-title::after { content: "▾"; font-size: 14px; color: var(--muted); transition: transform .15s; }
.card-details:not([open]) > summary .card-title::after { transform: rotate(-90deg); }
.table-senders td { padding: 6px 6px; border-bottom: 0; }
.table-senders th { padding: 8px 6px; }
.table-senders tbody tr:hover { background: transparent; }
.bat-emails { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 12px; }
.bat-email { position: relative; display: flex; }
.bat-email input { padding-right: 42px; font-size: 13px; }
.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 700; }
.empty-rows { margin: 8px 0 0; }
.sticky-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; padding: 12px 16px; margin: 0 -4px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
@media (max-width: 1100px) {
    .client-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .field-row-3, .client-sheet .field-row { grid-template-columns: 1fr; }
    .table-senders thead { display: none; }
    .table-senders, .table-senders tbody, .table-senders tr, .table-senders td { display: block; width: 100%; }
    .table-senders tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .table-senders td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
}

/* ---------- Gestion des campagnes : envois ---------- */
.sending-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.sending-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.sending-tabs a:hover { border-color: var(--brand); color: var(--brand-strong); text-decoration: none; }
.sending-tabs .dot { margin: 0; }
.dot-sending { background: var(--v-hero-2, #0284c7); }
.dot-scheduled { background: #9333ea; }
.dot-idle { background: #ea580c; }
.sending-block { margin-bottom: 18px; scroll-margin-top: 80px; }
.sending-block .empty-rows { padding: 16px 20px 18px; }
/* En-têtes des trois tableaux : style « en-têtes de bloc colorés » (voir plus bas), une couleur par état */
.sending-head-count { min-width: 44px; padding: 3px 14px; border-radius: 999px; color: rgb(var(--bh-rgb)); background: rgba(var(--bh-rgb), .12); font-size: 20px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.sending-block-live .table-styled thead th { color: #075985; }
.sending-block-scheduled .table-styled thead th { color: #6b21a8; }
.sending-block-todo .table-styled thead th { color: #9a3412; }
.table-sending .actions { white-space: nowrap; }
.table-sending .actions > * { display: inline-flex; vertical-align: middle; margin: 0 0 0 6px; }
.table-sending .actions form { margin: 0 0 0 6px; }
.button-delete { color: var(--danger); }
.button-delete:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }
.table-sending .cell-meta strong { color: var(--warning); }

.live-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.live-toolbar p { margin: 0; }
[data-live-now][aria-busy="true"] .icon { animation: live-spin 1s linear infinite; }
@keyframes live-spin { to { transform: rotate(360deg); } }
/* Suivi d'envoi : points de vigilance (entête rouge, ambre ou vert selon l'alerte la plus grave), puis cartes
   de chiffres du tableau de bord et deux blocs de chiffres deux par deux */
.live-health { margin-bottom: 18px; }
.card.live-health-ok { --bh1: #059669; --bh2: #34d399; --bh-rgb: 5, 150, 105; }
.card.live-health-info { --bh1: #0284c7; --bh2: #22d3ee; --bh-rgb: 2, 132, 199; }
.card.live-health-warning { --bh1: #d97706; --bh2: #fbbf24; --bh-rgb: 217, 119, 6; }
.card.live-health-danger { --bh1: #dc2626; --bh2: #fb7185; --bh-rgb: 220, 38, 38; }
.health-alerts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.health-alert { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 8px; border-left: 4px solid; font-size: 14px; }
.health-alert strong { font-weight: 700; }
.health-alert span { color: var(--ink-2); }
.health-danger { background: #fef2f2; border-color: #dc2626; } .health-danger strong { color: #b91c1c; }
.health-warning { background: #fffbeb; border-color: #d97706; } .health-warning strong { color: #92400e; }
.health-info { background: #eff6ff; border-color: #0284c7; } .health-info strong { color: #075985; }
.health-subtitle { margin: 20px 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.health-subtitle small { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.health-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.health-reason { padding: 8px 0; border-top: 1px solid var(--line); }
.health-reason dt { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.health-reason dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.health-reason dd strong { font-size: 20px; font-weight: 700; color: var(--ink); margin-right: 8px; }
.health-reason dd small { font-size: 13px; color: var(--ink-2); }
.health-reason-block dd strong { color: var(--danger); }
.health-domains td, .health-domains th { font-size: 13px; }
.health-num-danger { color: var(--danger); font-weight: 700; }
.health-sample { color: var(--ink-2); font-family: var(--mono); font-size: 12px !important; overflow-wrap: anywhere; min-width: 240px; }
.health-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.health-note:empty { display: none; }
.health-rules { margin-top: 10px; font-size: 13px; color: var(--muted); }
.health-rules summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.health-rules p { margin: 6px 0 0; line-height: 1.5; }
.live-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.live-pair > .card { margin: 0; }
.card.live-block-rhythm { --bh1: #0284c7; --bh2: #06b6d4; --bh-rgb: 2, 132, 199; }
.card.live-block-reactions { --bh1: #c026d3; --bh2: #f472b6; --bh-rgb: 192, 38, 211; }
.pair-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 6px 0 0; }
.pair-stats > div { padding: 12px 0; border-top: 1px solid var(--line); }
.pair-stats > div:nth-child(-n+2) { border-top: 0; }
.pair-stats dt { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pair-stats dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; }
.pair-stats dd small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.pair-stat-danger dd { color: var(--danger); }

/* Vérification avant enregistrement dans GreenArrow : blocs de la fiche liste, avant barré → après en couleur */
.card.block-review-when { --bh1: #7c3aed; --bh2: #c026d3; --bh-rgb: 124, 58, 237; }
.card.block-review-now { --bh1: #c2410c; --bh2: #f59e0b; --bh-rgb: 194, 65, 12; }
.review-block .meta-grid { margin-top: 2px; }
.review-notes { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.5; }
.review-change dd { display: flex; flex-direction: column; gap: 2px; }
.review-before { font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(95, 107, 125, .5); }
.review-before-none { text-decoration: none; }
.review-after { display: block; color: rgb(var(--bh-rgb)); font-weight: 700; overflow-wrap: anywhere; }
.review-after::before { content: "\2192\00a0"; font-weight: 800; }
.list-block .meta-grid > .review-change { background: rgba(var(--bh-rgb), .09); border-left-color: rgb(var(--bh-rgb)); }
.review-warning { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--warning-soft); color: #7a4300; font-weight: 600; }
.review-actions { justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.review-actions p { margin: 0; }

@media (max-width: 720px) {
    .table-sending .actions { white-space: normal; text-align: left; }
    .live-toolbar { flex-direction: column; align-items: flex-start; }
    .live-pair, .health-reasons { grid-template-columns: 1fr; }
}

/* ---------- Gestion des campagnes : listes d'envoi ---------- */
.sending-block-lists .table-styled thead th { color: #115e59; }
.table-lists td.strong { font-weight: 700; color: var(--ink); }
.list-block { scroll-margin-top: 80px; }
.list-block .card-head { gap: 12px; flex-wrap: wrap; }
/* En-têtes de bloc colorés (fiche liste, page segment, Envois, Listes) : pastille d'icône, résumé, reflet au survol,
   surbrillance à l'arrivée par l'ancre. Une couleur par bloc : --bh1, --bh2, --bh-rgb, posées sur la carte. */
.card { --bh1: var(--brand-strong); --bh2: var(--brand); --bh-rgb: var(--brand-rgb, 79, 70, 229); }
.block-subscribers { --bh1: #2563eb; --bh2: #06b6d4; --bh-rgb: 37, 99, 235; }
.block-settings { --bh1: #0284c7; --bh2: #22d3ee; --bh-rgb: 2, 132, 199; }
.block-tech { --bh1: #334155; --bh2: #64748b; --bh-rgb: 51, 65, 85; }
.block-fields { --bh1: #0d9488; --bh2: #2dd4bf; --bh-rgb: 13, 148, 136; }
.block-segments { --bh1: #7c3aed; --bh2: #c084fc; --bh-rgb: 124, 58, 237; }
.block-campaigns { --bh1: #1d4ed8; --bh2: #3b82f6; --bh-rgb: 29, 78, 216; }
.sending-block-live { --bh1: #0284c7; --bh2: #06b6d4; --bh-rgb: 2, 132, 199; }
.sending-block-scheduled { --bh1: #7c3aed; --bh2: #c026d3; --bh-rgb: 124, 58, 237; }
.sending-block-todo { --bh1: #ea580c; --bh2: #f59e0b; --bh-rgb: 234, 88, 12; }
.sending-block-lists { --bh1: #0d9488; --bh2: #06b6d4; --bh-rgb: 13, 148, 136; }
.sending-block-seeds, .block-seeds { --bh1: #c2410c; --bh2: #f59e0b; --bh-rgb: 194, 65, 12; }
/* Fiche client */
.block-branding { --bh1: #db2777; --bh2: #f472b6; --bh-rgb: 219, 39, 119; }
.block-identity { --bh1: #4f46e5; --bh2: #818cf8; --bh-rgb: 79, 70, 229; }
.card > .block-head {
    position: relative; overflow: hidden; isolation: isolate; padding-top: 16px; padding-bottom: 16px;
    background: linear-gradient(100deg, rgba(var(--bh-rgb), .11) 0%, rgba(var(--bh-rgb), .04) 55%, #fff 100%);
    border-bottom: 1px solid rgba(var(--bh-rgb), .16);
}
.card > .block-head::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 3px; z-index: -1;
    background: linear-gradient(90deg, var(--bh1), var(--bh2));
}
.card > .block-head::after {
    content: ""; position: absolute; z-index: -1; top: -60%; left: -40%; width: 30%; height: 220%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
    transform: skewX(-20deg) translateX(0); opacity: 0; pointer-events: none;
}
.card:hover > .block-head::after { animation: block-shine .9s ease-out; }
.block-heading { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 260px; }
.block-icon {
    flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff;
    background: linear-gradient(135deg, var(--bh1), var(--bh2));
    box-shadow: 0 6px 14px rgba(var(--bh-rgb), .32), inset 0 1px 0 rgba(255, 255, 255, .3);
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
}
.block-icon .icon { width: 20px; height: 20px; color: #fff; }
.card:hover > .block-head .block-icon { transform: translateY(-2px) rotate(-6deg) scale(1.06); box-shadow: 0 10px 20px rgba(var(--bh-rgb), .38), inset 0 1px 0 rgba(255, 255, 255, .3); }
.block-heading-text { min-width: 0; }
.block-head .card-title { margin: 0; line-height: 1.25; gap: 14px; }
.block-head .card-title::before { display: none; }
.block-head .card-title small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.block-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.block-sub strong { color: rgb(var(--bh-rgb)); font-weight: 700; }
.block-sub-good { color: var(--success); font-weight: 600; }
.block-sub-live { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-strong); font-weight: 600; }
.block-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(31, 138, 76, .5); animation: block-pulse 1.6s ease-out infinite; }
.card:target > .block-head { animation: block-arrive 1.4s ease-out; }
@keyframes block-shine { from { opacity: 1; transform: skewX(-20deg) translateX(0); } to { opacity: 1; transform: skewX(-20deg) translateX(520%); } }
@keyframes block-pulse { 70% { box-shadow: 0 0 0 7px rgba(31, 138, 76, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 138, 76, 0); } }
@keyframes block-arrive { 0%, 30% { box-shadow: inset 0 0 0 2px rgba(var(--bh-rgb), .55); background-color: rgba(var(--bh-rgb), .12); } 100% { box-shadow: inset 0 0 0 2px rgba(var(--bh-rgb), 0); background-color: transparent; } }
@media (prefers-reduced-motion: reduce) {
    .card:hover > .block-head::after, .block-live-dot, .card:target > .block-head { animation: none; }
    .block-icon { transition: none; } .card:hover > .block-head .block-icon { transform: none; }
}
/* Fiche liste : chiffres des abonnés en une bande de statistiques alignées, séparées par un filet */
.subs-strip { display: flex; flex-wrap: wrap; margin: 0; }
.subs-stat { flex: 1 1 120px; padding: 4px 20px; border-left: 1px solid var(--line); }
.subs-stat:first-child { padding-left: 0; border-left: 0; }
.subs-stat dt { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.subs-stat dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; }
.subs-stat dd small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.subs-stat-active dd { font-size: 30px; color: var(--success); }
.subs-stat-bounced dd, .subs-stat-scomp dd { color: var(--danger); }
@media (max-width: 640px) {
    .subs-stat { flex: 1 1 45%; padding: 8px 0; border-left: 0; border-top: 1px solid var(--line); }
    .subs-stat:first-child, .subs-stat:nth-child(2) { border-top: 0; }
}
/* Fiche liste : un peu d'air entre le bandeau de la carte et l'en-tête du tableau */
.card-flush > .block-head + .table-wrap { margin-top: 14px; border-top: 1px solid var(--line); }
.raw-attributes { margin-top: 16px; }
.raw-attributes summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--brand-strong); }
.code-block { margin: 8px 0 0; padding: 12px 14px; background: #f3f5f9; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.danger-zone { border-color: #f5c2bd; }
.danger-zone .card-title::before { background: var(--danger); }
.danger-zone p { margin-top: 0; }
.card-muted .plain-list li { color: var(--ink-2); }
.list-id { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }

/* Éditeur visuel des segments (Listes > segment) */
.seg-builder .field-label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg-tree { margin: 0; padding: 0; border: 0; min-width: 0; }
.seg-tree:disabled { opacity: .5; }
.seg-group { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: #f8f9fc; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.seg-subgroup { background: var(--surface); border-left: 3px solid var(--brand); }
.seg-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg-group-head select { width: auto; }
.seg-items { display: flex; flex-direction: column; gap: 8px; }
.seg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.seg-subgroup .seg-row { background: #f8f9fc; }
.seg-row select, .seg-row input[type="text"], .seg-row input[type="date"], .seg-row input[type="number"] { width: auto; min-width: 0; max-width: 100%; }
.seg-row input[type="text"] { flex: 1 1 180px; }
.seg-row .seg-number { width: 110px; }
.seg-word { font-size: 13px; color: var(--muted); }
.seg-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.seg-checks label { display: inline-flex; align-items: center; gap: 6px; }
.seg-remove { margin-left: auto; color: var(--danger); }
.seg-raw { flex-direction: column; align-items: stretch; }
.seg-raw .seg-remove { align-self: flex-end; }
.seg-raw textarea.is-error { border-color: var(--danger); }
.seg-empty { margin: 0; font-size: 13px; color: var(--muted); }
.seg-actions { display: flex; gap: 8px; }
.seg-status { margin: 0; }
.list-page-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.list-page-links .back-link { margin-bottom: 0; }

/* Abonnés d'une liste et imports CSV */
.badge-sub-active { background: var(--success-soft); color: #166534; }
.badge-sub-bounced, .badge-sub-scomp { background: var(--danger-soft); color: #991b1b; }
.badge-sub-unsubscribed, .badge-sub-deactivated { background: #eef1f6; color: var(--ink-2); }
.badge-importing, .badge-splitting, .badge-downloading { background: var(--info-soft); color: #0b5560; }
.badge-paused { background: var(--warning-soft); color: #7c4a03; }
.subscribers-help { margin: -8px 0 16px; }
.search-note { margin: 0; padding: 0 20px 12px; }
.import-preview th select { min-width: 160px; font-weight: 400; }
.import-preview td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.import-preview th .import-col-name { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.subscriber-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 20px; margin: 0; }
.subscriber-meta dt { font-size: 12px; color: var(--muted); }
.subscriber-meta dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.check-list label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }
.form-section-title { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.import-form { display: flex; flex-direction: column; gap: 16px; }
.import-form .card { margin: 0; }
.radio { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 500; font-size: 14px; }
.import-update { margin: 8px 0 0 26px; display: flex; flex-direction: column; gap: 8px; }
.import-summary td { white-space: pre-line; }
.card-head-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Import CSV : zone de dépôt du fichier (comportement dans app.js) ---------- */
.dropzone {
    position: relative; display: flex; align-items: center; gap: 16px; padding: 26px 24px; cursor: pointer;
    border: 2px dashed rgba(var(--bh-rgb), .35); border-radius: var(--radius); background: rgba(var(--bh-rgb), .04);
    transition: border-color .15s ease, background-color .15s ease;
}
.dropzone:hover, .dropzone.is-over { border-color: rgb(var(--bh-rgb)); background: rgba(var(--bh-rgb), .09); }
.dropzone.is-chosen { border-style: solid; border-color: rgba(var(--bh-rgb), .5); }
.dropzone:focus-within { outline: 2px solid rgb(var(--bh-rgb)); outline-offset: 2px; }
.dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: rgb(var(--bh-rgb)); background: rgba(var(--bh-rgb), .12); }
.dropzone-icon .icon { width: 22px; height: 22px; }
.dropzone-empty, .dropzone-chosen { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; color: var(--muted); }
.dropzone-empty[hidden], .dropzone-chosen[hidden] { display: none; }
.dropzone strong { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.dropzone-link { color: rgb(var(--bh-rgb)); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.dropzone-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 24px; margin: 4px 0 0; }
.dropzone-cols dt { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dropzone-cols dd { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }

/* Outils au-dessus d'un tableau paginé dans le navigateur (recherche en direct) */
.table-tools { display: flex; gap: 12px; padding: 14px 20px 0; }
.table-tools .field-search { max-width: 420px; margin: 0; }
.table-tools + .table-wrap { margin-top: 14px; }


/* Fiche liste : blocs libellé / valeur (Réglages par défaut, Infos techniques) bien distincts.
   Libellé petit et gris, valeur plus grande et foncée, chaque info sur un fond teinté de la couleur du bloc. */
.list-block .meta-grid { gap: 10px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .list-block .meta-grid { grid-template-columns: 1fr; } }
.list-block .meta-grid > div { padding: 9px 12px 10px; border-radius: 8px; background: rgba(var(--bh-rgb), .05); border-left: 3px solid rgba(var(--bh-rgb), .45); min-width: 0; }
.list-block .meta-grid dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.list-block .meta-grid dd { margin-top: 3px; font-size: 15px; font-weight: 600; color: var(--ink); }

/* ---------- Envois : fiche de programmation (objet, segment, seeds, BAT) ---------- */
/* BAT : le violet des « Programmées » ; date d'envoi : l'orange des « À programmer » (page Envois). */
.block-bat { --bh1: #7c3aed; --bh2: #c026d3; --bh-rgb: 124, 58, 237; }
.block-when { --bh1: #ea580c; --bh2: #f59e0b; --bh-rgb: 234, 88, 12; }
.block-danger { --bh1: #dc2626; --bh2: #fb7185; --bh-rgb: 220, 38, 38; }
.block-sender { --bh1: #059669; --bh2: #34d399; --bh-rgb: 5, 150, 105; }
.block-pixel { --bh1: #0d9488; --bh2: #2dd4bf; --bh-rgb: 13, 148, 136; }
.field .label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field-static { margin: 0; padding: 8px 0; font-weight: 600; color: var(--ink); }
.check-list-stacked { flex-direction: column; gap: 6px; }
.check-list label { overflow-wrap: anywhere; }
.bat-actions { display: flex; justify-content: flex-end; }
.bat-recipients { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.bat-recipients li { padding: 9px 12px; border-radius: 8px; background: rgba(var(--bh-rgb), .06); border-left: 3px solid rgba(var(--bh-rgb), .5); font-weight: 600; overflow-wrap: anywhere; }
.bat-recipients .muted { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
@media (max-width: 640px) { .bat-recipients { grid-template-columns: 1fr; } }
.bat-groups { display: grid; gap: 12px; }
.bat-group { position: relative; margin: 0; padding: 10px 14px 12px; border: 1px solid rgba(var(--bh-rgb), .22); border-left: 3px solid rgba(var(--bh-rgb), .6); border-radius: 8px; background: rgba(var(--bh-rgb), .04); min-width: 0; }
.bat-group legend { padding: 0 6px; margin-left: -6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--bh-rgb)); }
.bat-group .field-help { margin: 2px 0 0; }
.bat-check-all { position: absolute; top: 4px; right: 10px; padding: 0 4px; background: transparent; font-size: 12px; font-weight: 600; color: rgb(var(--bh-rgb)); border: 0; cursor: pointer; }
.bat-check-all:hover { text-decoration: underline; }
.card > .form-actions { margin-top: 16px; }
/* Listes BAT : adresses en pastilles côte à côte, pour qu'une liste de 20 adresses reste compacte. */
.bat-group .check-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
.bat-group .check-list label {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px 3px 6px; font-size: 12.5px; font-weight: 500;
    white-space: nowrap; border: 1px solid rgba(var(--bh-rgb), .22); border-radius: 999px; background: var(--surface); cursor: pointer;
}
.bat-group .check-list label span { overflow: hidden; text-overflow: ellipsis; }
.bat-group .check-list label:has(input:checked) { border-color: rgb(var(--bh-rgb)); background: rgba(var(--bh-rgb), .1); color: rgb(var(--bh-rgb)); font-weight: 600; }
.bat-group .check-list input { flex: none; margin: 0; }
.bat-group legend { display: flex; align-items: baseline; gap: 10px; }
.bat-group legend .bat-check-all { position: static; padding: 0; font-size: 11px; letter-spacing: 0; text-transform: none; }
/* Bloc BAT pleine largeur, au-dessus de la programmation : saisie libre et bouton sur une ligne. */
.block-bat .bat-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: end; }
@media (max-width: 760px) { .block-bat .bat-bottom { grid-template-columns: 1fr; } }

/* ---------- Gestion des campagnes : seed lists ---------- */
.sending-block-seeds .table-styled thead th { color: #9a3412; }
.table-seeds td.strong { font-weight: 700; color: var(--ink); }
.table-seeds .seed-preview { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.seed-actions { align-items: center; padding: 10px 14px; }
.seed-actions > p { margin: 0; }
/* Bouton d'accès aux seed lists : même orange que l'entête de leur card. */
.button-seeds { background: linear-gradient(135deg, #c2410c, #f59e0b); border-color: #c2410c; color: #fff; box-shadow: 0 4px 12px rgba(194, 65, 12, .28); }
.button-seeds:hover { background: linear-gradient(135deg, #9a3412, #d97706); border-color: #9a3412; color: #fff; text-decoration: none; }
.button-seeds .icon { color: #fff; }
.page-head-lists > div:first-child { flex: 1 1 380px; min-width: 0; }

/* Réglages > Alter Création : les deux liens publics à coller dans les campagnes */
.public-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 4px 0 8px; }
.public-link {
    --pl: 5, 150, 105;
    padding: 14px 16px; border: 1px solid rgba(var(--pl), .22); border-left: 4px solid rgb(var(--pl)); border-radius: 12px;
    background: linear-gradient(180deg, rgba(var(--pl), .05), #fff 70%);
}
.public-link-unsubscribe { --pl: 220, 38, 38; }
.public-link-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.public-link-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: rgb(var(--pl)); background: rgba(var(--pl), .12); }
.public-link-title { margin: 0; font-size: 14px; font-weight: 800; color: var(--ink); }
.public-link-use { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.public-link .input-mono { font-size: 12.5px; background: #fff; }
.public-link .field-help { margin-top: 8px; }
