/* Espace clients — Dov Design. Direction : « Soft Structuralism » — clair, aéré, cartes à double contour. */
:root {
  --bg: #F4F3EF;
  --bg-2: #ECEBE6;
  --card: #FFFFFF;
  --ink: #0E1116;
  --ink-2: #3A3F47;
  --muted: #7A7F87;
  --faint: #A9ADB3;
  --line: rgba(14, 17, 22, 0.07);
  --shell: rgba(14, 17, 22, 0.035);
  --lime: #D4FF3A;
  --lime-ink: #3B4A00;
  --blue: #2F5BFF;
  --blue-soft: #E8EDFF;
  --green: #0F9D63;
  --green-soft: #E3F6EC;
  --red: #E5484D;
  --red-soft: #FDECEC;
  --amber: #E08A00;
  --amber-soft: #FFF3DC;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --shadow: 0 1px 2px rgba(14, 17, 22, 0.04), 0 12px 32px -12px rgba(14, 17, 22, 0.10);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100dvh;
  font-feature-settings: "ss01", "cv11";
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.num, .tab { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 10px; }

/* Texture papier très légère, fixe. */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); animation: pulse 1s var(--ease) infinite alternate; }
@keyframes pulse { from { transform: scale(.6); opacity: .4; } to { transform: scale(1.2); opacity: 1; } }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art::before {
  content: ""; position: absolute; width: 640px; height: 640px; right: -200px; bottom: -260px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(212,255,58,.55), rgba(212,255,58,0) 62%);
}
.login-art::after {
  content: ""; position: absolute; width: 520px; height: 520px; left: -180px; top: -200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,91,255,.45), rgba(47,91,255,0) 65%);
}
.login-art > * { position: relative; z-index: 2; }
.login-art h1 { font-family: var(--font-display); font-size: clamp(36px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 650; margin: 0 0 18px; max-width: 12ch; }
.login-art p { color: rgba(255,255,255,.62); max-width: 40ch; margin: 0; font-size: 16px; }
.login-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.login-badges span { font-size: 12px; padding: 7px 12px; border-radius: 99px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.8); }
.login-form-wrap { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(420px, 100%); }
.login-card h2 { font-family: var(--font-display); font-size: 28px; letter-spacing: -0.025em; margin: 14px 0 6px; font-weight: 650; }
.login-card .sub { color: var(--muted); margin: 0 0 26px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--ink-2); margin: 0 0 7px 4px; font-weight: 500; }
.input {
  width: 100%; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); padding: 0 16px; font-size: 16px;
  box-shadow: inset 0 1px 2px rgba(14,17,22,.03); transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.input:focus { outline: none; border-color: rgba(47,91,255,.5); box-shadow: 0 0 0 4px rgba(47,91,255,.12); }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 8px; top: 8px; height: 36px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--bg); font-size: 13px; color: var(--ink-2); }
.form-error { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 4px 10px; }
.login-foot { margin-top: 26px; font-size: 13px; color: var(--muted); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 8px 0 22px; border-radius: 99px; border: 0;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; transition: transform .5s var(--ease), background .3s var(--ease), opacity .3s;
}
.btn:active { transform: scale(.98); }
.btn .btn-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); transition: transform .5s var(--ease); }
.btn:hover .btn-ico { transform: translate(2px, -1px) scale(1.05); }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: 0 18px; }
.btn.light { background: var(--bg); color: var(--ink); padding: 0 18px; }
.btn.danger { background: var(--red); }
.btn.small { height: 40px; font-size: 14px; padding: 0 16px; }
.chip-btn { border: 0; background: transparent; color: var(--ink-2); font-size: 13px; padding: 8px 12px; border-radius: 99px; }
.chip-btn:hover { background: var(--shell); }

/* ---------- Coquille de l'application ---------- */
.shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; padding: 16px; }
.side-in {
  height: 100%; border-radius: var(--r-xl); background: var(--card); box-shadow: var(--shadow); padding: 22px 14px 14px; display: flex; flex-direction: column;
  outline: 6px solid var(--shell);
}
.side .brand { padding: 0 8px; }
.side-client { margin: 22px 8px 18px; padding: 14px; border-radius: 18px; background: var(--bg); }
.side-client small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 3px; }
.side-client b { font-weight: 620; letter-spacing: -0.01em; }
.nav-group { margin: 12px 0 4px; padding: 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 14px; border: 0; background: transparent; text-align: left;
  color: var(--ink-2); font-weight: 520; text-decoration: none; transition: background .3s var(--ease), color .3s var(--ease);
}
.nav-item:hover { background: var(--bg); }
.nav-item.on { background: var(--ink); color: #fff; }
.nav-item.on .nav-ico { background: var(--lime); color: var(--ink); }
.nav-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); flex: none; }
.nav-item .soon { margin-left: auto; font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.side-foot { margin-top: auto; padding: 12px 8px 4px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--lime); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: var(--muted); font-size: 12px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--bg-2); }

.main-wrap { min-width: 0; }
.main { min-width: 0; padding: 28px clamp(16px, 3.2vw, 44px) 80px; }
.topbar { display: none; }
.tabbar { display: none; }

/* ---------- En-tête de page ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 660; margin: 14px 0 10px; }
.head-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; }
.status.live { background: var(--green-soft); color: var(--green); }
.status.live i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ping 2s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.status.off { background: var(--bg-2); color: var(--ink-2); }
.status.paused { background: var(--amber-soft); color: var(--amber); }
.status.wait { background: var(--blue-soft); color: var(--blue); }

.refresh { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: 13px; font-weight: 580; padding: 7px 13px 7px 11px; border-radius: 99px; transition: transform .4s var(--ease), background .3s var(--ease); }
.refresh:hover { background: var(--bg-2); }
.refresh:active { transform: scale(.96); }
.refresh.spin svg { animation: spin .8s linear infinite; }

/* ---------- Sélecteur de période ---------- */
.periods { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 5px; margin: 0 0 22px; background: var(--card); border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); width: max-content; max-width: 100%; }
.periods::-webkit-scrollbar { display: none; }
.periods button { flex: none; border: 0; background: transparent; padding: 9px 15px; border-radius: 99px; font-size: 14px; font-weight: 520; color: var(--ink-2); white-space: nowrap; transition: background .35s var(--ease), color .35s var(--ease); }
.periods button.on { background: var(--ink); color: #fff; }
.custom-range { display: flex; gap: 8px; align-items: center; margin: -10px 0 22px; flex-wrap: wrap; }
.custom-range input { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 12px; }

/* ---------- Grille & cartes (double contour) ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-7 { grid-column: span 7; } .c-6 { grid-column: span 6; }
.c-5 { grid-column: span 5; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; }
.card { background: var(--shell); border-radius: var(--r-xl); padding: 6px; min-width: 0; }
.card-in { background: var(--card); border-radius: var(--r-lg); padding: 22px; height: 100%; box-shadow: 0 1px 1px rgba(14,17,22,.03), inset 0 1px 0 rgba(255,255,255,.9); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 640; letter-spacing: -0.015em; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--bg); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 99px; font-size: 13px; color: var(--ink-2); font-weight: 520; white-space: nowrap; transition: background .3s var(--ease); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(14,17,22,.1); }

/* Carte « dépenses » sombre */
.hero .card-in { background: var(--ink); color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.hero .card-in::before { content: ""; position: absolute; width: 420px; height: 420px; right: -160px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(212,255,58,.22), rgba(212,255,58,0) 65%); }
.hero-label { font-size: 13px; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 8px; position: relative; }
.hero-amount { font-family: var(--font-display); font-size: clamp(42px, 5.4vw, 68px); letter-spacing: -0.045em; font-weight: 640; line-height: 1; margin: 12px 0 10px; position: relative; }
.hero-amount small { font-size: .42em; color: rgba(255,255,255,.55); letter-spacing: -0.02em; margin-left: 4px; }
.hero-spark { margin-top: auto; position: relative; height: 70px; }
.hero-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hero-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; position: relative; }
.hero-tile { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.hero-tile small { display: block; font-size: 12px; color: rgba(255,255,255,.55); white-space: nowrap; }
.hero-tile b { display: block; font-size: 19px; font-weight: 620; letter-spacing: -0.02em; margin-top: 3px; white-space: nowrap; }
.budget-bar { height: 6px; border-radius: 9px; background: rgba(255,255,255,.1); margin-top: 8px; overflow: hidden; }
.budget-bar i { display: block; height: 100%; border-radius: 9px; background: var(--lime); transform-origin: left; transition: transform 1.2s var(--ease); }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 620; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.delta.good { background: var(--green-soft); color: var(--green); }
.delta.bad { background: var(--red-soft); color: var(--red); }
.delta.flat { background: var(--bg); color: var(--muted); }
.hero .delta.good { background: rgba(212,255,58,.16); color: var(--lime); }
.hero .delta.bad { background: rgba(229,72,77,.2); color: #FF9A9D; }
.hero .delta.flat { background: rgba(255,255,255,.08); color: rgba(255,255,255,.6); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; height: 100%; }
.kpi { background: var(--card); border-radius: 20px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 1px rgba(14,17,22,.03); min-width: 0; position: relative; }
.kpi small { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi b { font-family: var(--font-display); font-size: 26px; font-weight: 640; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; }
.kpi .delta { align-self: flex-start; margin-top: 2px; }
.kpi.accent { background: var(--lime); }
.kpi.accent small { color: var(--lime-ink); }
.kpi.accent .delta { background: rgba(14,17,22,.08); color: var(--ink); }
.info { width: 16px; height: 16px; border-radius: 50%; border: 0; background: var(--bg); color: var(--muted); font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; padding: 0; }
.kpi.accent .info { background: rgba(14,17,22,.08); color: var(--ink); }

/* Graphique principal */
.chart { position: relative; width: 100%; height: 280px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .bar { transition: opacity .25s var(--ease); }
.chart .bar.dim { opacity: .35; }
.tip {
  position: absolute; top: 0; left: 0; pointer-events: none; background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 12px; font-size: 13px;
  min-width: 140px; box-shadow: 0 12px 30px -8px rgba(14,17,22,.4); opacity: 0; transform: translateY(4px); transition: opacity .2s var(--ease), transform .2s var(--ease); z-index: 5;
}
.tip.on { opacity: 1; transform: none; }
.tip small { display: block; color: rgba(255,255,255,.55); font-size: 11px; margin-bottom: 4px; text-transform: capitalize; }
.tip div { display: flex; justify-content: space-between; gap: 14px; }
.tip b { font-weight: 620; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Listes à barres */
.bars-list { display: flex; flex-direction: column; gap: 12px; }
.bl-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.bl-row .name { font-size: 14px; font-weight: 520; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-row .val { font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums; }
.bl-row .track { grid-column: 1 / -1; height: 8px; border-radius: 9px; background: var(--bg); overflow: hidden; }
.bl-row .track i { display: block; height: 100%; border-radius: 9px; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease); }
.bl-row .sub { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -2px; }

/* Grand total conversions */
.big-stat { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.big-stat b { font-family: var(--font-display); font-size: 44px; font-weight: 650; letter-spacing: -0.04em; line-height: 1; }
.big-stat span { color: var(--muted); font-size: 14px; }

/* Carte de chaleur */
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.heat .hl { font-size: 11px; color: var(--muted); }
.heat .hh { font-size: 10px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.heat .cell { aspect-ratio: 1; border-radius: 4px; background: var(--bg); position: relative; transition: transform .3s var(--ease); }
.heat .cell:hover { transform: scale(1.35); z-index: 2; }
.heat-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 12px; }
.heat-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.heat-best { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 12px; border-radius: 99px; background: var(--bg); color: var(--ink-2); }
.pill b { color: var(--ink); font-weight: 620; }

/* Horaires */
.sched { display: flex; flex-direction: column; gap: 8px; }
.sched-row { display: grid; grid-template-columns: 38px 1fr 92px; gap: 10px; align-items: center; font-size: 13px; }
.sched-row .d { color: var(--ink-2); font-weight: 600; }
.sched-row .t { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sched-row.today .d { color: var(--ink); }
.sched-track { position: relative; height: 22px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.sched-track .on { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: var(--ink); }
.sched-row.today .sched-track .on { background: var(--blue); }
.sched-track .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); border-radius: 2px; }
.sched-axis { display: grid; grid-template-columns: 38px 1fr 92px; gap: 10px; font-size: 10px; color: var(--faint); }
.sched-axis div { display: flex; justify-content: space-between; }

/* Créneaux lisibles */
.slot-now { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 560; padding: 7px 12px; border-radius: 99px; background: var(--bg); color: var(--ink-2); margin-bottom: 14px; }
.slot-now i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.slot-now.on { background: var(--green-soft); color: var(--green); }
.slot-now.on i { background: var(--green); }
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 18px; }
.slot { border-radius: 16px; padding: 12px 14px; background: var(--ink); color: #fff; }
.slot span { display: block; font-size: 12px; color: rgba(255,255,255,.6); margin-bottom: 2px; }
.slot b { font-size: 17px; font-weight: 640; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.slot.off { background: var(--bg); color: var(--muted); }
.slot.off span { color: var(--muted); }
.slot.off b { font-size: 14px; font-weight: 560; }
.sched-sep { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }

/* Sélecteur de campagne */
.camp-switch { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -6px 0 16px; padding: 2px; }
.camp-switch::-webkit-scrollbar { display: none; }
.camp-switch button { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 8px 4px; margin-right: 14px; font-size: 15px; font-weight: 560; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 0; transition: color .3s var(--ease), border-color .3s var(--ease); }
.camp-switch button.on { color: var(--ink); border-bottom-color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.live { background: var(--green); } .dot.paused { background: var(--amber); } .dot.wait { background: var(--blue); }
.camp-list { display: grid; gap: 10px; }
.camp-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 16px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--bg); }
.cr-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.cr-main b { font-weight: 640; letter-spacing: -0.01em; }
.cr-main small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.cr-main .status { padding: 3px 9px 3px 8px; font-size: 12px; }
.cr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cr-stats small { display: block; font-size: 11px; color: var(--muted); }
.cr-stats b { font-weight: 640; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pause-list { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.pause-item { display: flex; align-items: center; gap: 12px; }
.pi-name { font-size: 14px; font-weight: 560; color: var(--ink-2); }

/* Sélecteur de campagne (bouton + liste) */
.cpick { position: relative; margin: 10px 0 8px; }
.cpick-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: transparent; color: var(--ink);
  padding: 4px 8px 4px 0; border-radius: 12px; text-align: left;
  font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); font-weight: 640; letter-spacing: -0.03em; line-height: 1.15;
  transition: opacity .3s var(--ease);
}
.cpick-btn:hover { opacity: .75; }
.cpick-btn svg { flex: none; width: 20px; height: 20px; color: var(--muted); margin-top: 3px; transition: transform .4s var(--ease); }
.cpick-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.cpick-btn small { display: none; }
.cpick-pop {
  position: absolute; z-index: 30; left: 0; top: calc(100% + 8px); width: min(420px, calc(100vw - 28px)); max-height: min(70vh, 560px); overflow: auto;
  background: var(--card); border-radius: 22px; padding: 8px; box-shadow: 0 24px 60px -20px rgba(14,17,22,.4), 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left; pointer-events: none; transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.cpick-pop.on { opacity: 1; transform: none; pointer-events: auto; }
.cp-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 10px; border-radius: 14px; text-align: left; }
.cp-item:hover { background: var(--bg); }
.cp-item.on { background: var(--ink); color: #fff; }
.cp-item.on small { color: rgba(255,255,255,.6); }
.cp-ico { width: 34px; height: 34px; border-radius: 11px; background: var(--bg); display: grid; place-items: center; flex: none; color: var(--ink); }
.cp-item.on .cp-ico { background: var(--lime); }
.cp-txt b { display: block; font-size: 15px; font-weight: 600; }
.cp-txt small { font-size: 12px; color: var(--muted); }
.cp-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); padding: 12px 10px 6px; }
.cp-multi { display: grid; gap: 4px; padding: 0 4px 4px; }
.cp-check { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; font-size: 14px; cursor: pointer; }
.cp-check:hover { background: var(--bg); }
.cp-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.cp-multi .btn { margin-top: 6px; }

/* Admin : choix des campagnes */
.pick-list { display: grid; gap: 6px; margin-bottom: 6px; }
.pick { display: grid; grid-template-columns: auto 1fr minmax(140px, 220px); gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--bg); cursor: pointer; }
.pick.on, .pick:has(input:checked) { background: var(--green-soft); }
.pick input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); }
.pick-main { min-width: 0; } .pick-main b { display: block; font-size: 14px; font-weight: 600; } .pick-main small { color: var(--muted); font-size: 12px; }
.pick-name { height: 38px; font-size: 13px; border-radius: 10px; }
@media (max-width: 900px) { .pick { grid-template-columns: auto 1fr; } .pick-name { grid-column: 1 / -1; } }

/* Menu discret (mobile) */
.menu-wrap { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 2px; color: var(--ink-2); border-radius: 99px; }
.menu-btn .avatar { width: 34px; height: 34px; font-size: 12px; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; border-radius: 20px; background: var(--card);
  box-shadow: 0 18px 50px -16px rgba(14,17,22,.35), 0 0 0 1px var(--line); display: grid; gap: 2px;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.menu-pop.on { opacity: 1; transform: none; pointer-events: auto; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; border: 0; background: transparent; text-decoration: none; font-size: 14px; font-weight: 540; color: var(--ink); text-align: left; width: 100%; }
.menu-pop a.on { background: var(--bg); }
.menu-pop .nav-ico { width: 28px; height: 28px; border-radius: 9px; }
.menu-pop button { color: var(--red); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; margin-top: 4px; padding-top: 12px; }

/* Appareils */
.split { display: flex; height: 14px; border-radius: 9px; overflow: hidden; gap: 3px; margin: 6px 0 16px; }
.split i { display: block; height: 100%; border-radius: 4px; }
.dev-list { display: grid; gap: 10px; }
.dev { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; }
.dev .ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--bg); }
.dev b { font-weight: 600; font-size: 14px; } .dev small { display: block; color: var(--muted); font-size: 12px; }
.dev .pct { font-weight: 640; font-variant-numeric: tabular-nums; }

/* Termes de recherche */
.terms-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 1; min-width: 180px; }
.search input { width: 100%; height: 42px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); padding: 0 16px 0 40px; font-size: 14px; }
.search svg { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: right; font-weight: 520; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th button { border: 0; background: none; padding: 0; color: inherit; font-weight: inherit; }
.table th.on { color: var(--ink); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td:first-child { white-space: normal; font-weight: 520; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FBFBF9; }
.conv-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-weight: 620; font-size: 12px; }
.zero { color: var(--faint); }
.term-cards { display: none; }
.more { display: flex; justify-content: center; margin-top: 14px; }

/* Mise en veille */
.pause-card .card-in { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.pause-card h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.015em; }
.pause-card p { margin: 0; color: var(--muted); font-size: 14px; max-width: 60ch; }
.btn-pause { background: var(--card); color: var(--red); border: 1px solid rgba(229,72,77,.25); padding: 0 8px 0 18px; }
.btn-pause .btn-ico { background: var(--red-soft); }
.btn-pause:hover { background: var(--red-soft); }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; margin-bottom: 18px; font-size: 14px; flex-wrap: wrap; }
.banner.wait { background: var(--blue-soft); color: #1A3BB8; }
.banner.paused { background: var(--amber-soft); color: #7A4A00; }
.banner.fail { background: var(--red-soft); color: #A1252A; }
.banner .grow { flex: 1; min-width: 200px; }
.banner b { font-weight: 640; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Feuille (bottom sheet) */
.sheet-bg { position: fixed; inset: 0; background: rgba(14,17,22,.38); z-index: 40; opacity: 0; transition: opacity .4s var(--ease); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-bg.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(520px, 100%); transform: translate(-50%, 100%); transition: transform .55s var(--ease);
  background: var(--card); border-radius: 30px 30px 0 0; padding: 10px 24px calc(24px + var(--safe-b)); box-shadow: 0 -20px 60px -20px rgba(14,17,22,.35);
}
.sheet.on { transform: translate(-50%, 0); }
.sheet .grab { width: 42px; height: 5px; border-radius: 9px; background: var(--bg-2); margin: 0 auto 18px; }
.sheet h2 { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.025em; margin: 14px 0 8px; font-weight: 650; }
.sheet p { color: var(--ink-2); margin: 0 0 12px; }
.sheet ul { padding: 0; margin: 0 0 20px; list-style: none; display: grid; gap: 10px; }
.sheet li { display: flex; gap: 10px; font-size: 14px; color: var(--ink-2); }
.sheet li i { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-style: normal; font-size: 12px; }
.sheet-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; }
.hold {
  position: relative; overflow: hidden; width: 100%; height: 60px; border-radius: 99px; border: 0; background: var(--red); color: #fff; font-weight: 650; font-size: 16px;
  user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none;
}
.hold .fill { position: absolute; inset: 0; background: rgba(0,0,0,.22); transform: scaleX(0); transform-origin: left; }
.hold span { position: relative; }
.sheet .cancel { width: 100%; margin-top: 10px; }
.done-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 8px 0 4px; }
.done-ico path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .7s .15s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Toast */
#toast-root { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 99px; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(14,17,22,.5); animation: toast .5s var(--ease); }
@keyframes toast { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* États vides */
.empty { text-align: center; padding: 26px 10px; color: var(--muted); font-size: 14px; }
.empty .e-ico { width: 46px; height: 46px; border-radius: 15px; background: var(--bg); display: grid; place-items: center; margin: 0 auto 10px; color: var(--faint); }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } * { animation-duration: .01ms !important; } }

/* Admin & compte */
.stack { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--ink); color: var(--lime); padding: 14px; border-radius: 14px; overflow-wrap: anywhere; user-select: all; }
.admin-client { display: grid; gap: 14px; }
.tag { display: inline-flex; font-size: 11px; padding: 3px 8px; border-radius: 99px; background: var(--bg); color: var(--ink-2); font-weight: 600; }
.viewing { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 16px; margin-bottom: 16px; font-size: 14px; }
.viewing button { margin-left: auto; }

/* ---------- Tablette ---------- */
@media (max-width: 1180px) {
  .c-8, .c-7, .c-6, .c-5, .c-4 { grid-column: span 12; }
  .c-3 { grid-column: span 6; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1180px) and (min-width: 721px) {
  .half-md { grid-column: span 6 !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
    background: rgba(244,243,239,.82); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  }
  .topbar .brand { font-size: 15px; }
  .topbar .brand small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
  .tabbar {
    display: flex; position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); padding: 6px; gap: 4px; border-radius: 24px;
    background: rgba(14,17,22,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 16px 40px -12px rgba(14,17,22,.5);
  }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 18px; color: rgba(255,255,255,.55); font-size: 11px; font-weight: 560; text-decoration: none; border: 0; background: transparent; }
  .tabbar .on { color: var(--ink); background: var(--lime); }
  .main { padding: 6px 14px calc(40px + var(--safe-b)); }
  .camp-row { grid-template-columns: 1fr; gap: 12px; }
  .cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .camp-row .btn { width: 100%; }
  .pause-list { align-items: stretch; }
  .pause-item { flex-direction: column; align-items: stretch; gap: 6px; }
  .slot-list { grid-template-columns: 1fr 1fr; }
  .page-head { margin-bottom: 16px; }
  .page-head > div { width: 100%; }
  .page-head .btn-pause { width: 100%; height: 48px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .periods { width: auto; margin-left: -14px; margin-right: -14px; border-radius: 0; background: transparent; box-shadow: none; padding: 4px 14px; }
  .periods button { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
  .periods button.on { box-shadow: none; }
  .grid { gap: 12px; }
  .card { border-radius: 26px; padding: 5px; }
  .card-in { padding: 18px 16px; border-radius: 21px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 14px; }
  .kpi b { font-size: 23px; }
  .c-3 { grid-column: span 12; }
  .chart { height: 230px; }
  .hero-tiles { grid-template-columns: 1fr 1fr; }
  .hero-tiles .hero-tile:first-child { grid-column: span 2; }
  .pause-card .card-in { grid-template-columns: 1fr; }
  .pause-card .btn { width: 100%; }
  .table-wrap { display: none; }
  .term-cards { display: grid; gap: 8px; }
  .term-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; border-radius: 16px; background: var(--bg); }
  .term-card b { font-weight: 560; font-size: 14px; }
  .term-card .meta { grid-column: 1 / -1; display: flex; gap: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .heat { grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .heat .cell { border-radius: 3px; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 22px 34px; min-height: 0; }
  .login-art h1 { font-size: 34px; margin-top: 34px; }
  .login-art .login-badges { display: none; }
  .login-form-wrap { align-items: start; padding: 26px 18px 40px; }
  .login-card .brand { display: none; }
  .login-card h2 { margin-top: 0; }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; }
  #toast-root { bottom: calc(24px + var(--safe-b)); }
}
@media (max-width: 380px) {
  .kpi b { font-size: 20px; }
  .hero-amount { font-size: 40px; }
}
