/* Aislemate – tableau de bord (thème sombre par défaut, thème clair via [data-theme="light"]) */

:root,
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0c10;
    --text: #e6e7eb;
    --line: #1c1e26;
    --surface: #11131a;
    --border: #1f222c;
    --row: #0d0f14;
    --row-border: #181a22;
    --btn-bg: #13151c;
    --btn-border: #2a2d38;
    --muted: #9ca3af;
    --subtle: #8b8f9c;
    --label: #c4c6cd;
    --input-bg: #0b0c10;
    --indigo-bg: #1e1b4b;
    --indigo-strong: #e0e7ff;
    --indigo-text: #c7d2fe;
    --link: #a5b4fc;
    --link-hover: #c7d2fe;
    --amber-bg: #2a210b;
    --amber-text: #fcd34d;
    --ok-bg: #0f2a22;
    --ok-border: #14532d;
    --ok-text: #6ee7b7;
    --error-bg: #2b1215;
    --error-border: #7f1d1d;
    --error-text: #fca5a5;
    --shadow: none;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f7fb;
    --text: #111827;
    --line: #e5e7eb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --row: #f9fafb;
    --row-border: #f1f2f5;
    --btn-bg: #ffffff;
    --btn-border: #d1d5db;
    --muted: #4b5563;
    --subtle: #6b7280;
    --label: #374151;
    --input-bg: #ffffff;
    --indigo-bg: #eef2ff;
    --indigo-strong: #3730a3;
    --indigo-text: #3730a3;
    --link: #4338ca;
    --link-hover: #312e81;
    --amber-bg: #fef3c7;
    --amber-text: #92400e;
    --ok-bg: #d1fae5;
    --ok-border: #a7f3d0;
    --ok-text: #065f46;
    --error-bg: #fee2e2;
    --error-border: #fecaca;
    --error-text: #991b1b;
    --shadow: 0 1px 2px rgba(17, 24, 39, .06);
}

:root {
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --success: #059669;
    --radius: 14px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    transition: background-color .2s, color .2s;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
svg { flex: 0 0 auto; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Mise en page ---------- */

.app { display: flex; flex-wrap: wrap; min-height: 100vh; }

.sidebar {
    flex: 1 1 232px;
    max-width: 260px;
    padding: 20px 14px;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; }

.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--muted); }
.nav-link:hover { color: var(--text); background: var(--row); }
.nav-link.is-active { background: var(--indigo-bg); color: var(--indigo-strong); font-weight: 600; }
.nav-section { margin-top: 24px; padding: 0 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.nav-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--subtle); }
.nav-dot.is-ready { background: #34d399; }
.nav-dot.is-syncing, .nav-dot.is-pending { background: #fbbf24; }
.nav-dot.is-error { background: #f87171; }

.sidebar-footer { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 15px; background: var(--btn-bg); border: 1px solid var(--btn-border); display: grid; place-items: center; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.sidebar-footer .who { flex: 1; min-width: 0; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer a { font-size: 12px; color: var(--muted); }

.main { flex: 999 1 560px; min-width: 0; max-width: 1200px; padding: 36px 40px 56px; display: flex; flex-direction: column; gap: 28px; }

.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 32px 16px; }
.auth .card { width: 100%; max-width: 440px; }
.auth-top { width: 100%; max-width: 440px; display: flex; align-items: center; justify-content: space-between; }
.auth-top .brand { padding: 0; }

@media (max-width: 820px) {
    .sidebar { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar-footer { margin-top: 12px; }
    .main { padding: 24px 18px 40px; }
}

/* ---------- Composants ---------- */

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head .titles { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.page-head .title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-note { font-size: 12px; color: var(--subtle); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-3 > .span-2 { grid-column: span 2; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } .grid-3 > .span-2 { grid-column: auto; } }
@media (max-width: 520px) { .stats { grid-template-columns: minmax(0, 1fr); } }

.stat { gap: 10px; padding: 20px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-value small { font-size: 16px; color: var(--subtle); font-weight: 500; }
.stat-note { font-size: 13px; color: var(--subtle); }
.meter { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 2px; background: #34d399; transition: width .4s; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 16px; border-radius: 10px;
    border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--text);
    font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn:hover { color: var(--text); border-color: var(--subtle); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-danger { color: var(--error-text); border-color: var(--error-border); background: transparent; }
.btn-danger:hover { color: var(--error-text); background: var(--error-bg); border-color: var(--error-border); }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: currentColor; }
.badge-ready { color: var(--ok-text); background: var(--ok-bg); border-color: var(--ok-border); }
.badge-pending, .badge-syncing { color: var(--amber-text); background: var(--amber-bg); }
.badge-error { color: var(--error-text); background: var(--error-bg); border-color: var(--error-border); }

.tag { font-size: 12px; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.tag-indigo { color: var(--indigo-text); background: var(--indigo-bg); }
.tag-amber { color: var(--amber-text); background: var(--amber-bg); }
.tag-green { color: var(--ok-text); background: var(--ok-bg); }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--row); border: 1px solid var(--row-border); }
.list-row .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .time { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bubble { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: 0 0 auto; background: var(--indigo-bg); color: var(--indigo-text); }
.empty { padding: 18px; border-radius: 10px; border: 1px dashed var(--btn-border); color: var(--muted); text-align: center; }

.checklist { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.check { width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; background: var(--success); color: #fff; flex: 0 0 auto; }
.check.is-todo { background: transparent; border: 2px solid var(--btn-border); }

.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid; }
.flash-success { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.flash-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-border); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--subtle); text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
td small { color: var(--subtle); }

details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 12px; }
ul.plain, ol.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

pre.snippet { margin: 0; padding: 14px; border-radius: 10px; background: var(--row); border: 1px solid var(--row-border); white-space: pre-wrap; word-break: break-all; }

/* ---------- Formulaires (rendu par défaut de Symfony) ---------- */

form .field, form div:has(> label) { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
label { font-size: 14px; font-weight: 500; color: var(--label); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], textarea, select {
    width: 100%; border-radius: 10px; border: 1px solid var(--btn-border); background: var(--input-bg); color: var(--text);
    padding: 11px 14px; font: 14px/1.5 Inter, system-ui, sans-serif;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .25); }
textarea { resize: vertical; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.help-text, form small { font-size: 12px; color: var(--subtle); }
form ul { margin: 0; padding: 0; list-style: none; color: var(--error-text); font-size: 13px; }

/* ---------- Panneau de synchronisation ---------- */

.sync { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; border-left: 4px solid var(--border); transition: border-color .3s; }
.sync[data-state="running"] { border-left-color: #d97706; }
.sync[data-state="done"] { border-left-color: var(--success); }
.sync[data-state="error"] { border-left-color: #dc2626; }
.sync .sync-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.sync .sync-text strong { font-weight: 600; }
.sync .sync-text small { color: var(--muted); }
.sync form { margin: 0; }
.sync-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--row); color: var(--muted); flex: 0 0 auto; }
.sync[data-state="running"] .sync-icon { background: var(--amber-bg); color: var(--amber-text); }
.sync[data-state="running"] .sync-icon svg { animation: spin 1.2s linear infinite; }
.sync[data-state="done"] .sync-icon { background: var(--ok-bg); color: var(--ok-text); animation: pop .4s ease-out; }
.sync[data-state="error"] .sync-icon { background: var(--error-bg); color: var(--error-text); }
.sync-progress { flex-basis: 100%; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.sync:not([data-state="running"]) .sync-progress { display: none; }
.sync-progress > span { display: block; height: 100%; width: 0; background: #d97706; border-radius: 3px; transition: width .4s; }
.sync-progress.is-indeterminate > span { width: 35%; animation: slide 1.2s ease-in-out infinite; }
.sync-hint { flex-basis: 100%; color: var(--amber-text); font-size: 13px; }
.counter-updated { animation: flash 1.2s ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes flash { 0% { color: var(--success); } 100% { color: inherit; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Abonnement ---------- */

[data-theme="dark"], :root { --indigo-border: #312e81; --track-on-indigo: #312e81; --plan-bg: #14122b; --plan-text: #e0e7ff; }
[data-theme="light"] { --indigo-border: #c7d2fe; --track-on-indigo: #c7d2fe; --plan-bg: #eef2ff; --plan-text: #312e81; }

.trial { background: var(--indigo-bg); border: 1px solid var(--indigo-border); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.trial-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.trial-body { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.trial-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.trial strong { font-size: 15px; color: var(--indigo-strong); }
.trial small, .trial p { font-size: 13px; color: var(--indigo-text); }
.trial .meter { height: 6px; background: var(--track-on-indigo); }
.trial .meter > span { background: var(--accent); }

.meter-lg { height: 6px; border-radius: 3px; }
.grow-in { animation: grow-in 1.2s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes grow-in { from { width: 0; } }

.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.segmented button { height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background-color .2s, color .2s; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.save-tag { font-size: 11px; font-weight: 700; color: var(--ok-text); background: var(--ok-bg); border-radius: 999px; padding: 2px 8px; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 1000px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; gap: 18px; position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.plan:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0, 0, 0, .18); }
.plan.featured { background: var(--plan-bg); border: 2px solid var(--accent); }
.plan-flag { position: absolute; top: -13px; left: 26px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 12px; }
.plan-name { font-size: 17px; font-weight: 700; }
.plan-desc { font-size: 14px; color: var(--muted); }
.plan.featured .plan-desc, .plan.featured .per { color: var(--indigo-text); }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price strong { font-size: 36px; font-weight: 800; letter-spacing: -.03em; }
.per { color: var(--muted); }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; color: var(--label); }
.plan.featured ul { color: var(--plan-text); }
.plan li { display: flex; gap: 10px; }
.plan li svg { color: #34d399; margin-top: 2px; }
.plan .btn { margin-top: auto; }

.card-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px; border-radius: 12px; background: var(--row); border: 1px solid var(--row-border); text-align: center; color: var(--subtle); }
.card-empty strong { color: var(--text); }
.pay-row { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px; border: 1px dashed var(--btn-border); }
.pay-row .grow { flex: 1; color: var(--muted); }
.card-chip { width: 44px; height: 30px; border-radius: 6px; background: var(--row); border: 1px solid var(--border); display: grid; place-items: center; color: var(--subtle); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.foot-row { border-top: 1px solid var(--line); padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
@media (prefers-reduced-motion: reduce) { .plan:hover { transform: none; } }

/* ---------- Pages légales ---------- */

.legal-main { max-width: 820px; margin: 0 auto; padding: 56px 32px 96px; display: flex; flex-direction: column; gap: 32px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-nav a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.legal-nav a:hover { color: var(--text); }
.legal-nav a[aria-current="page"] { background: var(--indigo-bg); color: var(--indigo-strong); border-color: var(--indigo-border); font-weight: 600; }
.prose { display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.7; color: var(--label); }
.prose h1 { font-size: 34px; color: var(--text); }
.prose h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 18px; }
.prose h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-top: 6px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose strong { color: var(--text); }
.prose .updated { font-size: 13px; color: var(--subtle); }
.prose table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 14px; }
.prose th, .prose td { padding: 10px 14px; }
.prose .callout { padding: 14px 16px; border-radius: 10px; background: var(--row); border: 1px solid var(--row-border); }
.form-check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; }
.form-check label { font-weight: 400; font-size: 13px; }
.form-check input[type="checkbox"] { order: -1; margin-top: 3px; flex: 0 0 auto; }

.legal-links { margin: 0; padding: 10px 10px 0; font-size: 12px; color: var(--subtle); }
.legal-links a { color: var(--subtle); }
.legal-links a:hover { color: var(--text); }

.verify-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--amber-bg); color: var(--amber-text); }
.verify-banner span { flex: 1; min-width: 220px; }
.verify-banner strong { color: inherit; }
.verify-banner form { margin: 0; }
.verify-banner .btn { height: 36px; }

.auth-top .actions { gap: 8px; }
.back-home { height: 42px; font-weight: 500; }
@media (max-width: 480px) { .back-home { padding: 0 12px; font-size: 13px; } }

/* ---------- Personnalisation du widget ---------- */

.widget-editor { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.widget-editor > .card { flex: 1 1 380px; min-width: 0; }
.preview-wrap { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 24px; }
.color-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.color-row > div:first-child { margin-bottom: 0; }
input[type="color"] { width: 64px; height: 44px; padding: 4px; border-radius: 10px; border: 1px solid var(--btn-border); background: var(--input-bg); cursor: pointer; }
.swatches { display: flex; gap: 8px; padding-bottom: 6px; }
.swatch { width: 30px; height: 30px; border-radius: 15px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--btn-border); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.segmented-radio { display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 8px !important; margin: 0 !important; }
.segmented-radio input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented-radio label { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 1px solid var(--btn-border); border-radius: 10px;
    background: var(--input-bg); color: var(--muted); font-weight: 500; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.segmented-radio input:checked + label { background: var(--indigo-bg); border-color: var(--accent); color: var(--indigo-strong); }
.segmented-radio input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.preview-page { --w-color: #4f46e5; position: relative; height: 560px; border-radius: 16px; border: 1px solid var(--border); overflow: hidden;
    background: #eef0f4; color: #111827; font: 14px/1.45 Inter, system-ui, sans-serif; }
.preview-site { position: absolute; inset: 0; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.preview-site > span { height: 12px; border-radius: 6px; background: #d9dce3; width: 60%; }
.preview-site > span.short { width: 35%; }
.preview-products { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.preview-products i { height: 120px; border-radius: 12px; background: #dfe2e8; }
.preview-panel { position: absolute; bottom: 86px; right: 20px; width: 300px; height: 400px; display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 18px 40px rgba(17, 24, 39, .22); transition: left .3s, right .3s; }
.preview-launcher { position: absolute; bottom: 20px; right: 20px; width: 54px; height: 54px; border-radius: 27px; background: var(--w-color); color: #fff; display: grid; place-items: center;
    box-shadow: 0 8px 20px rgba(17, 24, 39, .25); transition: left .3s, right .3s, background-color .2s; }
.preview-page[data-side="left"] .preview-panel, .preview-page[data-side="left"] .preview-launcher { right: auto; left: 20px; }
.preview-head { background: var(--w-color); color: #fff; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; transition: background-color .2s; }
.preview-head strong { display: block; font-size: 14px; }
.preview-head small { font-size: 11px; opacity: .85; }
.preview-body { flex: 1; overflow: hidden; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #f9fafb; }
.preview-bubble { align-self: flex-start; max-width: 88%; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px 14px 14px 4px; padding: 8px 11px; font-size: 13px; white-space: pre-wrap; }
.preview-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-chips span { border: 1px solid var(--w-color); color: var(--w-color); background: #fff; border-radius: 999px; padding: 5px 10px; font-size: 12px; }
.preview-input { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #e5e7eb; }
.preview-input span { flex: 1; border: 1px solid #d1d5db; border-radius: 9px; padding: 7px 9px; font-size: 12px; color: #6b7280; }
.preview-input b { background: var(--w-color); color: #fff; border-radius: 9px; padding: 7px 10px; font-size: 12px; font-weight: 600; }
.preview-foot { text-align: center; font-size: 11px; color: #6b7280; padding-bottom: 6px; }
@media (max-width: 900px) { .preview-wrap { position: static; } }

/* ---------- Statistiques ---------- */

[data-theme="dark"], :root { --chart-1: #6366f1; --chart-2: #0fa47a; }
[data-theme="light"] { --chart-1: #4f46e5; --chart-2: #059669; }

.segmented .seg-link { height: 36px; padding: 0 14px; border-radius: 9px; display: inline-flex; align-items: center; color: var(--muted); font-weight: 600; }
.segmented .seg-link:hover { color: var(--text); }
.segmented .seg-link[aria-current="page"] { background: var(--accent); color: #fff; }
.stat-link { color: inherit; transition: border-color .15s, transform .15s; }
.stat-link:hover { color: inherit; border-color: var(--accent); transform: translateY(-2px); }
.stat-hero { background: var(--indigo-bg); border-color: var(--indigo-border); }
.stat-hero .stat-label, .stat-hero .stat-note { color: var(--indigo-text); }
.stat-hero .stat-value { color: var(--indigo-strong); }

.chart-card { gap: 10px; }
.bars { height: 160px; display: flex; align-items: flex-end; gap: 2px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.bar-slot { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; outline: none; }
.bar { width: 100%; border-radius: 4px 4px 0 0; transition: filter .15s; }
.bar-1 { background: var(--chart-1); }
.bar-2 { background: var(--chart-2); }
.bar.is-zero { background: var(--border); }
.bar-slot:hover .bar, .bar-slot:focus-visible .bar { filter: brightness(1.2); }
.bar-slot::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
    background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2; }
.bar-slot:hover::after, .bar-slot:focus-visible::after { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--subtle); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-slot:nth-child(-n+4)::after { left: 0; transform: none; }
.bar-slot:nth-last-child(-n+4)::after { left: auto; right: 0; transform: none; }

/* ---------- Administration ---------- */

.admin-eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--link); font-weight: 600; }
.search-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.search-bar input { flex: 1 1 280px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; }
.message-card .message-body { white-space: pre-line; color: var(--text); padding: 14px 16px; border-radius: 10px; background: var(--row); border: 1px solid var(--row-border); }
.message-card.is-handled { opacity: .7; }
.message-card form { margin: 0; }
.verify-banner .btn { flex: 0 0 auto; min-width: 0; }
.tag-red { color: var(--error-text); background: var(--error-bg); }
.admin-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.admin-action > div { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.inline-form input[type="text"], .inline-form input[type="email"] { flex: 1 1 240px; width: auto; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; }
.impersonation-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); }
.impersonation-banner span { flex: 1; min-width: 220px; }
.impersonation-banner strong { color: inherit; }
.impersonation-banner .btn { height: 36px; flex: 0 0 auto; }

/* Logo (icône + nom en tracés, police Outfit) */
.brand-logo { display: block; width: auto; }
.brand-logo .brand-word { fill: currentColor; }
.brand-logo .brand-word-accent { fill: #818cf8; }
[data-theme="light"] .brand-logo .brand-word-accent { fill: #4f46e5; }

/* Pages d'informations indexées (sous la synchronisation) */
.sync-pages { display: block; margin-top: 4px; color: var(--muted); }
.sync-pages.is-warning { color: var(--amber-text); }

/* Administration › Coûts IA */
.muted { color: var(--muted); }
.cost-notes { margin-top: 14px; font-size: 13px; line-height: 1.6; }
.verify-banner-danger { background: var(--error-bg); color: var(--error-text); }
.stat-warning .meter span { background: #d97706; }
.stat-danger .meter span { background: #dc2626; }
.stat-danger .stat-note strong { color: var(--error-text); }

/* Limite de boutiques du forfait */
.limit-card { display: flex; gap: 18px; align-items: flex-start; }
.limit-body { display: flex; flex-direction: column; gap: 10px; }
.limit-body h2 { margin: 0; }
.limit-body p { margin: 0; color: var(--muted); line-height: 1.6; }
.limit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* Candidatures pilotes (administration) */
.pilot-status-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.pilot-status-form select { width: auto; padding-top: 8px; padding-bottom: 8px; }
