/* ==========================================================================
   Elias — feuille de style
   Jetons de couleur en clair / sombre, mise en page responsive (ordinateur, tablette, téléphone)
   ========================================================================== */
:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --ink: #1d1a22;
  --ink-2: #4a4652;
  --muted: #7a7581;
  --line: #e8e3dc;
  --line-2: #f0ece6;

  --side: #221a2a;
  --side-ink: #ebe5f0;
  --side-muted: #9d92a8;
  --side-hover: #2f2539;
  --side-active: #3a2d46;

  --accent: #b3255b;
  --accent-ink: #ffffff;
  --accent-soft: #fbe8ef;
  --accent-2: #5c3e74;
  --accent-2-soft: #efe8f5;

  --ok: #1d7f56;      --ok-soft: #e3f4ec;
  --ko: #c0392b;      --ko-soft: #fbe7e4;
  --warn: #a96a0f;    --warn-soft: #fbf0dc;
  --info: #2f65a0;    --info-soft: #e5eef8;
  --neutre-soft: #efece8;

  --e-medard: #2a2131;
  --e-coifflook: #d9572f;
  --e-essentiel: #24806f;
  --e-armand: #33569c;
  --e-defaut: #7a7581;

  --chart-bar: #b3255b;
  --chart-bar-2: #d97a9d;
  --chart-bar-3: #ead2dc;
  --chart-grid: #ece7e1;
  --chart-axis: #b9b2aa;

  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(30, 20, 40, .04), 0 4px 18px rgba(30, 20, 40, .05);
  --shadow-lift: 0 2px 4px rgba(30, 20, 40, .06), 0 12px 32px rgba(30, 20, 40, .10);
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141118; --surface: #1d1922; --surface-2: #221d28; --ink: #f1edf4; --ink-2: #cdc6d4; --muted: #958c9e;
    --line: #2f2936; --line-2: #27222d; --side: #0f0c12; --side-hover: #1d1722; --side-active: #2a2032;
    --accent: #e0557f; --accent-soft: #3a1d29; --accent-2: #b597d0; --accent-2-soft: #2c2236;
    --ok: #4cc08b; --ok-soft: #173326; --ko: #f07a6c; --ko-soft: #3b1d1a; --warn: #e3a64a; --warn-soft: #3a2a12;
    --info: #79a7dc; --info-soft: #1a2a3c; --neutre-soft: #2a2530;
    --e-medard: #cbbfd6; --chart-bar: #e0557f; --chart-bar-2: #9c4a66; --chart-bar-3: #4a2a37;
    --chart-grid: #2b2531; --chart-axis: #5d5566;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lift: 0 8px 28px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141118; --surface: #1d1922; --surface-2: #221d28; --ink: #f1edf4; --ink-2: #cdc6d4; --muted: #958c9e;
  --line: #2f2936; --line-2: #27222d; --side: #0f0c12; --side-hover: #1d1722; --side-active: #2a2032;
  --accent: #e0557f; --accent-soft: #3a1d29; --accent-2: #b597d0; --accent-2-soft: #2c2236;
  --ok: #4cc08b; --ok-soft: #173326; --ko: #f07a6c; --ko-soft: #3b1d1a; --warn: #e3a64a; --warn-soft: #3a2a12;
  --info: #79a7dc; --info-soft: #1a2a3c; --neutre-soft: #2a2530;
  --e-medard: #cbbfd6; --chart-bar: #e0557f; --chart-bar-2: #9c4a66; --chart-bar-3: #4a2a37;
  --chart-grid: #2b2531; --chart-axis: #5d5566;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lift: 0 8px 28px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 620; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--side) 248px, transparent 248px); }
.side {
  background: var(--side); color: var(--side-ink); padding: 22px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 680; font-size: 17px; line-height: 1.1; color: #fff; }
.brand-sub { font-size: 11.5px; color: var(--side-muted); letter-spacing: .04em; text-transform: uppercase; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 16px 12px 6px; }
.nav a, .nav span {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--side-ink); font-weight: 520; font-size: 14.5px;
}
.nav a:hover { background: var(--side-hover); }
.nav a.active { background: var(--side-active); color: #fff; }
.nav a.active svg { color: #ff8fb2; }
.nav span.soon { color: var(--side-muted); cursor: default; font-size: 13.5px; white-space: nowrap; }
.nav span.soon em { margin-left: auto; font-style: normal; font-size: 10.5px; border: 1px solid #4a3d55; border-radius: 99px; padding: 1px 7px; }
.nav svg { width: 19px; height: 19px; flex: none; }
.side-foot { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--side-hover); font-size: 12px; color: var(--side-muted); line-height: 1.45; }
.side-foot strong { color: var(--side-ink); font-weight: 600; display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #f0b44c; display: inline-block; flex: none; }
.dot.live { background: #4cc08b; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 16px; padding: 18px 32px; position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-mobile-brand { display: none; }
.search {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; height: 44px; box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; width: 100%; height: 100%; }
.search kbd { font: 11px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip-date { font-size: 12.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.content { padding: 8px 32px 48px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumb { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.crumb:hover { color: var(--accent); }
.crumb svg { width: 15px; height: 15px; }

/* ---------- Cartes & grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head .muted { font-size: 13px; }
.card-body { padding: 14px 22px 20px; }
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.mt { margin-top: 18px; }

/* ---------- Indicateurs ---------- */
.kpi { padding: 18px 20px 18px; position: relative; overflow: hidden; }
.kpi-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi-label svg { width: 16px; height: 16px; color: var(--accent); }
.kpi-value { font-family: var(--font-display); font-size: 32px; font-weight: 660; letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; }
.kpi-value small { font-size: 16px; font-weight: 560; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.kpi.hero { background: linear-gradient(135deg, #2a1d33 0%, #4a2440 55%, #b3255b 130%); color: #fff; border: 0; }
.kpi.hero .kpi-label, .kpi.hero .kpi-foot { color: rgba(255,255,255,.75); }
.kpi.hero .kpi-label svg { color: #ffb3c9; }
.kpi.hero .kpi-value small { color: rgba(255,255,255,.7); }

/* ---------- Pastilles ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.4; }
.pill svg { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.ko { background: var(--ko-soft); color: var(--ko); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutre { background: var(--neutre-soft); color: var(--ink-2); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.brandtag { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.brandtag i { width: 9px; height: 9px; border-radius: 3px; background: var(--e-defaut); display: inline-block; }
.brandtag.e-medard i { background: var(--e-medard); }
.brandtag.e-coifflook i { background: var(--e-coifflook); }
.brandtag.e-essentiel i { background: var(--e-essentiel); }
.brandtag.e-armand i { background: var(--e-armand); }

/* ---------- Graphiques ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .value-text { fill: var(--ink-2); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart .bar { fill: var(--chart-bar); transition: opacity .15s; }
.chart .bar-2 { fill: var(--chart-bar-2); }
.chart .bar-3 { fill: var(--chart-bar-3); }
.chart .hit { fill: transparent; cursor: default; }
.chart g.col:hover .bar, .chart g.col:hover .bar-2, .chart g.col:hover .bar-3 { opacity: .78; }
.chart .cut { stroke: var(--surface); stroke-width: 3; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: var(--surface); padding: 8px 11px; border-radius: 9px;
  font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-lift); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; max-width: 260px;
}
.tip.show { opacity: 1; transform: none; }
.tip b { font-weight: 650; }

.split { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface); }
.split div { height: 100%; }
.split .s1 { background: var(--accent); }
.split .s2 { background: var(--chart-bar-2); }
.split .s3 { background: var(--chart-bar-3); }

.meter { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- Listes & tableaux ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-top: 1px solid var(--line-2); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list .sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.list .right { text-align: right; white-space: nowrap; }
.list .big { font-weight: 650; font-size: 15px; }
.list a.row-link:hover .title { color: var(--accent); }
.time-badge { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; min-width: 56px; text-align: center; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.r, .t th.r { text-align: right; }
.t tbody tr { transition: background .1s; }
.t tbody tr.link { cursor: pointer; }
.t tbody tr.link:hover { background: var(--surface-2); }
.t .name { font-weight: 580; }
.t tr.link:hover .name { color: var(--accent); }

.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 560; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.tabs a span { font-size: 12px; color: var(--muted); font-weight: 600; }
.tabs a.on { background: var(--accent); color: var(--accent-ink); }
.tabs a.on span { color: rgba(255,255,255,.8); }
.filter-input { height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 0 12px; font: inherit; color: var(--ink); min-width: 240px; }
.filter-input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- Recherche cliente ---------- */
.search-hero { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.search-hero form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-hero .search { max-width: none; height: 54px; font-size: 17px; }
.btn { height: 44px; padding: 0 18px; border-radius: 11px; border: 0; background: var(--accent); color: var(--accent-ink); font: 600 14.5px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { filter: brightness(1.06); }
.btn.big { height: 54px; padding: 0 24px; font-size: 15.5px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.hints { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.hints a { border: 1px dashed var(--line); padding: 3px 10px; border-radius: 99px; color: var(--ink-2); }
.hints a:hover { border-color: var(--accent); color: var(--accent); }

.avatar { width: 42px; height: 42px; border-radius: 13px; background: var(--accent-2-soft); color: var(--accent-2); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; letter-spacing: .02em; }
.avatar.xl { width: 68px; height: 68px; border-radius: 20px; font-size: 22px; background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft)); color: var(--accent); }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.result { display: flex; gap: 14px; padding: 16px; align-items: flex-start; transition: transform .12s, box-shadow .12s, border-color .12s; }
.result:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.result .name { font-weight: 620; font-size: 15.5px; }
.result .meta { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.result .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--line); margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }

/* ---------- Fiche cliente ---------- */
.profile { display: flex; gap: 20px; align-items: center; padding: 24px; flex-wrap: wrap; }
.profile h1 { font-size: 24px; }
.profile .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.profile .meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile .meta svg { width: 15px; height: 15px; color: var(--muted); }
.verdict { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--radius); }
.verdict.ok { background: var(--ok-soft); }
.verdict.ko { background: var(--ko-soft); }
.verdict .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.verdict.ok .ico { background: var(--ok); color: #fff; }
.verdict.ko .ico { background: var(--ko); color: #fff; }
.verdict .ico svg { width: 20px; height: 20px; }
.verdict h3 { font-size: 15.5px; }
.verdict.ok h3 { color: var(--ok); }
.verdict.ko h3 { color: var(--ko); }
.checks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 9px; }
.checks li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.checks li svg { width: 18px; height: 18px; flex: none; }
.checks li.y svg { color: var(--ok); }
.checks li.n svg { color: var(--ko); }
.checks li.n { color: var(--ink); font-weight: 560; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border-radius: 12px; overflow: hidden; }
.facts div { background: var(--surface); padding: 14px 16px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-weight: 640; font-size: 17px; font-family: var(--font-display); }
.facts dd small { font-weight: 500; font-size: 12px; color: var(--muted); font-family: var(--font); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); border-radius: 2px; }
.tl { position: relative; padding: 0 0 24px 56px; }
.tl:last-child { padding-bottom: 4px; }
.tl-dot { position: absolute; left: 6px; top: 2px; width: 28px; height: 28px; border-radius: 9px; background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.tl-dot svg { width: 14px; height: 14px; }
.tl.recu .tl-dot { border-color: var(--ok); color: var(--ok); }
.tl.echec .tl-dot { border-color: var(--ko); color: var(--ko); }
.tl.encours .tl-dot { border-color: var(--accent); color: #fff; background: var(--accent); }
.tl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tl-head .title { font-weight: 620; }
.tl-when { font-size: 13px; color: var(--muted); }
.tl-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bubble-wrap { margin-top: 12px; max-width: 520px; }
.bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 12px 15px; font-size: 14px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.bubble-note svg { width: 13px; height: 13px; }

/* ---------- Téléphone (aperçu SMS) ---------- */
.phone { width: 100%; max-width: 330px; margin: 0 auto; border-radius: 34px; background: #17121c; padding: 12px; box-shadow: var(--shadow-lift); }
.phone-screen { background: #f3f1ee; border-radius: 26px; overflow: hidden; min-height: 330px; display: flex; flex-direction: column; }
:root[data-theme="dark"] .phone-screen { background: #241f29; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone-screen { background: #241f29; } }
.phone-top { text-align: center; padding: 16px 12px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.phone-top .avatar { margin: 0 auto 6px; width: 38px; height: 38px; border-radius: 50%; }
.phone-top b { font-size: 13px; display: block; }
.phone-top span { font-size: 11px; color: var(--muted); }
.phone-body { padding: 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.phone-body .when { text-align: center; font-size: 11px; color: var(--muted); }
.phone-body .bubble { background: var(--surface); border-color: transparent; box-shadow: 0 1px 1px rgba(0,0,0,.05); font-size: 13.5px; }
.sms-count { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 12px; }

.code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.code mark { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 2px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 520; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--info-soft); border-radius: 12px; padding: 12px 14px; }
.note svg { width: 17px; height: 17px; color: var(--info); flex: none; margin-top: 1px; }
.salon-list { display: flex; flex-wrap: wrap; gap: 6px; }
.salon-list span { font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; }

/* ---------- Barre mobile ---------- */
.tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { display: none; }
  .top { padding: 12px 16px; gap: 10px; }
  .top-mobile-brand { display: flex; align-items: center; gap: 9px; font-weight: 680; font-family: var(--font-display); }
  .top-mobile-brand .brand-mark { width: 30px; height: 30px; }
  .top .search { order: 3; flex-basis: 100%; max-width: none; }
  .top { flex-wrap: wrap; }
  .top .search kbd { display: none; }
  .chip-date { display: none; }
  .content { padding: 4px 16px 96px; }
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .card-head { flex-direction: column; gap: 2px; align-items: flex-start; }
  .aside-first { order: -1; }
  .chart .axis-text, .chart .value-text { font-size: 19px; }
  .chart .axis-text.alt { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px; border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); }
  h1 { font-size: 22px; }
  .kpi-value { font-size: 26px; }
  .results { grid-template-columns: 1fr; }
  .hide-m { display: none; }
  .t th, .t td { padding: 11px 10px; }
  .kv { grid-template-columns: 110px 1fr; }
  .list li { padding: 12px 16px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 12px 16px 16px; }
  .filter-input { min-width: 0; width: 100%; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-foot { font-size: 11.5px; }
  .tl { padding-left: 46px; }
  .timeline::before { left: 15px; }
  .tl-dot { left: 2px; }
  .facts dd { font-size: 15px; }
}

/* Compléments */
.card h3 svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; color: var(--accent); }
.list li > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.tl-head a.title:hover { color: var(--accent); }
.pill.accent svg { width: 14px; height: 14px; }

.chart-foot { display: flex; gap: 10px 26px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.chart-foot b { display: block; font-size: 17px; color: var(--ink); font-family: var(--font-display); font-weight: 640; }

/* ---------- Éditeur de campagne ---------- */
.g-edit { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); align-items: start; }
.sticky { position: sticky; top: 86px; }
.step { display: flex; flex-direction: column; gap: 16px; }
.step-head { display: flex; gap: 14px; align-items: center; }
.step-n { width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.step-n svg { width: 18px; height: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, .field > summary > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field.inline { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.field.inline > span { font-weight: 500; }
.input { height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 0 12px; font: inherit; width: 100%; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.num-in { width: 84px; display: inline-block; text-align: center; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; background: var(--surface); font-size: 14px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); margin: 0; }
.small-choices .choice { padding: 5px 9px; font-size: 13px; }
details.salons { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
details.salons summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.salons summary::-webkit-details-marker { display: none; }
details.salons summary em { font-style: normal; font-size: 13px; color: var(--accent); }
.salon-group { margin-top: 10px; }
.salon-group b { font-size: 12.5px; display: block; margin-bottom: 6px; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; flex-wrap: wrap; gap: 2px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 560; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.triggers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.trigger input { position: absolute; opacity: 0; pointer-events: none; }
.trigger > span { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; height: 100%; background: var(--surface); }
.trigger > span svg { width: 20px; height: 20px; color: var(--muted); margin-bottom: 4px; }
.trigger b { font-size: 14px; }
.trigger em { font-style: normal; font-size: 12px; color: var(--muted); }
.trigger input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.trigger input:checked + span svg { color: var(--accent); }
.trigger input:focus-visible + span { outline: 2px solid var(--accent); }
.cond { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cond[hidden], [data-show][hidden], [data-show-val][hidden] { display: none; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.var { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 99px; padding: 5px 11px; font: 600 12.5px var(--font); cursor: pointer; }
.var:hover { border-color: var(--accent); color: var(--accent); }
.sms-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.link-btn { background: none; border: 0; color: var(--accent); font: 600 13px var(--font); cursor: pointer; padding: 0; }
.warn-box { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; flex-wrap: wrap; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.toggle > span { display: none; }
.row-fields { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.row-fields .field { min-width: 160px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.flash { display: flex; gap: 10px; align-items: center; background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 12px 16px; font-weight: 560; margin-bottom: 18px; }
.flash svg { width: 18px; height: 18px; flex: none; }
.sim-big { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 4px; }
.sim-big span { font-family: var(--font-display); font-size: 44px; font-weight: 680; letter-spacing: -.02em; color: var(--accent); line-height: 1; }
.sim-big small { color: var(--muted); font-size: 14px; }
.sim-loading { font-size: 12.5px; color: var(--muted); }
.sim-loading[hidden] { display: none; }
.sim-list { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13.5px; }
.sim-list li { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line-2); }
.sim-list li.minus { color: var(--muted); }
.sim-list li.minus b { font-weight: 560; }
.sim-salons { margin-top: 14px; display: grid; gap: 8px; }
.sim-salon { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 13px; }
.sim-salon .meter { grid-column: 1 / -1; }
.ex-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.tests li { padding: 10px 0; }
@media (max-width: 1180px) {
  .g-edit { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 700px) {
  .triggers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn { white-space: nowrap; }

/* ---------- Version améliorée : critères, vérification, brouillons ---------- */
.flash.info { background: var(--info-soft); color: var(--info); font-weight: 500; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.small svg, .btn svg { width: 16px; height: 16px; }
.btn.danger { color: var(--ko); }
.btn.ghost.danger:hover { background: var(--ko-soft); border-color: var(--ko-soft); }
.nav a .nav-count, .nav .nav-count { display: inline-block; height: auto; line-height: 1.5; margin-left: auto; font-size: 11.5px; font-weight: 700; background: var(--side-active); color: var(--side-ink); border-radius: 99px; padding: 1px 8px; }

.criteres { display: flex; flex-direction: column; gap: 10px; }
.crit { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.crit-top { display: flex; align-items: center; gap: 10px; }
.crit-top b { font-size: 14.5px; }
.crit-groupe { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--accent-2); background: var(--accent-2-soft); border-radius: 6px; padding: 2px 7px; }
.crit-x { margin-left: auto; width: 30px; height: 30px; font-size: 19px; line-height: 1; }
.crit-body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.crit-body .input { height: 38px; width: auto; }
.crit-op { min-width: 150px; }
.crit-op-fixe { font-size: 13.5px; color: var(--ink-2); font-weight: 560; }
.crit-minmax, .crit-periode { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.crit-minmax .num-in { width: 96px; }
.crit-texte { width: 100% !important; max-width: 420px; height: 38px; }
.crit-aide { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.crit-vide { margin: 0; }
.crit-liste { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 560; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 4px 6px 4px 11px; border: 0; }
.chip.add { background: var(--surface); color: var(--ink-2); border: 1px dashed var(--line); padding: 4px 12px; cursor: pointer; font: 560 13px var(--font); }
.chip.add:hover { border-color: var(--accent); color: var(--accent); }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; }
.chip-x:hover { background: rgba(0,0,0,.08); }
.pick { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.pick-search { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; box-shadow: none !important; height: 42px !important; width: 100% !important; }
.pick-list { max-height: 290px; overflow: auto; padding: 6px 0; }
.pick-g { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--muted); padding: 10px 14px 4px; }
.pick-i { display: flex; align-items: center; gap: 10px; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.pick-i:hover { background: var(--surface-2); }
.pick-i.sub { padding-left: 38px; font-size: 13.5px; color: var(--ink-2); }
.pick-i input { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; flex: none; }
.pick-i em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.pick-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.crit-add { position: relative; margin-top: 12px; }
.crit-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(640px, calc(100vw - 40px)); max-height: 440px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.crit-menu[hidden] { display: none; }
.crit-menu-t { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--accent-2); padding: 8px 10px 4px; }
.crit-menu-i { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; cursor: pointer; color: var(--ink); font: inherit; }
.crit-menu-i:hover, .crit-menu-i:focus-visible { background: var(--accent-soft); outline: 0; }
.crit-menu-i b { display: block; font-size: 14px; font-weight: 600; }
.crit-menu-i span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

.verif { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.verif-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.verif-head svg { width: 18px; height: 18px; color: var(--accent-2); }
#verif-liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#verif-liste li { display: flex; gap: 9px; align-items: baseline; font-size: 13px; color: var(--ink-2); }
#verif-liste li > span { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); background: var(--muted); }
#verif-liste li.v-erreur { color: var(--ko); font-weight: 560; } #verif-liste li.v-erreur > span { background: var(--ko); }
#verif-liste li.v-attention > span { background: var(--warn); }
#verif-liste li.v-info > span { background: var(--info); }
#verif-liste li.v-ok { color: var(--ok); } #verif-liste li.v-ok > span { background: var(--ok); }

.funnel { list-style: none; margin: 4px 0 12px; padding: 0; counter-reset: f; }
.funnel li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 6px 0 6px 22px; border-top: 1px dashed var(--line); position: relative; color: var(--ink-2); }
.funnel li::before { content: "↳"; position: absolute; left: 4px; color: var(--muted); }
.funnel li.first { border-top: 0; padding-left: 0; font-weight: 560; color: var(--ink); }
.funnel li.first::before { content: none; }
.funnel li b { color: var(--ink); }

.banner-link { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 22px; color: var(--ink); text-decoration: none; }
.banner-link > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.banner-link .grow { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.banner-link:hover { box-shadow: var(--shadow-lift); }
.drafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.draft { display: flex; flex-direction: column; overflow: hidden; }
.draft-main { display: block; padding: 18px 20px 12px; color: var(--ink); text-decoration: none; flex: 1; }
.draft-main:hover h3 { color: var(--accent); }
.draft-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.draft h3 { margin: 0 0 4px; font-size: 16.5px; }
.draft-text { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); margin: 10px 0 6px; white-space: pre-line; }
.draft-main .muted svg { width: 13px; height: 13px; vertical-align: -2px; }
.draft-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px 12px 20px; border-top: 1px solid var(--line-2); }
.draft-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.draft-actions form { margin: 0; }
@media (max-width: 560px) {
  .crit-menu { grid-template-columns: 1fr; position: fixed; left: 16px; right: 16px; top: auto; bottom: 76px; width: auto; max-height: 60vh; }
  .crit-op { min-width: 0; flex: 1 1 100%; }
  .crit-periode { flex: 1 1 100%; } .crit-periode select { flex: 1; }
  .drafts { grid-template-columns: 1fr; }
}
.seg.seg-sm span { padding: 5px 10px; font-size: 13px; }
.crit-min { font-size: 12px; color: var(--muted); }
.crit-min.bump { color: var(--warn); font-weight: 560; }
.exp-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.exp-row .input { flex: 1; min-width: 240px; }
.exp-field em { display: block; margin-top: 4px; font-style: normal; }
.exp-badge { font: 650 13.5px ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--accent-2-soft); color: var(--accent-2); border-radius: 8px; padding: 5px 10px; min-width: 120px; text-align: center; }
.flash.ko { background: var(--ko-soft); color: var(--ko); }
.ok-txt { color: var(--ok); } .ko-txt { color: var(--ko); }
.rules { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 6px; }
.card form .field + .field, form.card .field { margin-bottom: 12px; }
.ens-list { display: grid; gap: 8px; }
.ens-group { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ens-group.partiel { border-color: var(--accent-2-soft); }
.ens-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px; flex-wrap: wrap; }
.ens-head .choice { border: 0; padding: 4px 6px; background: transparent; }
.ens-head .choice:has(input:checked) { background: transparent; }
.ens-compte { flex: 1; }
.ens-group.partiel .ens-compte { color: var(--accent-2); font-weight: 600; }
.ens-salons { border-top: 1px dashed var(--line); padding: 10px 12px 12px; }
.ens-salons[hidden] { display: none; }
.ens-actions { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
#visite-24 { flex-basis: 100%; }
#visite-24[hidden] { display: none; }
.crit-menu-i[hidden] { display: none; }
.crit-case { flex-basis: 100%; font-size: 13.5px; } .crit-case > span { display: inline !important; }
.onglets { display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); margin: 0 0 20px; flex-wrap: wrap; }
.onglets a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglets a svg { width: 17px; height: 17px; }
.onglets a span { font-size: 12px; background: var(--neutre-soft); border-radius: 99px; padding: 1px 8px; }
.onglets a.on { color: var(--accent); border-bottom-color: var(--accent); }
.onglets a.nouvelle { margin-left: auto; color: var(--accent); }
.annees { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.chip-an { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; }
.chip-an span { color: var(--muted); font-weight: 500; margin-left: 3px; }
.chip-an.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.sel-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.sel-bar .toggle > span { display: inline !important; }
.sel-cell { width: 36px; text-align: center; }
.sel-cell input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.age-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; } .age-inconnu { margin-top: 8px; font-size: 13.5px; }
.interrupteur-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 99px; border: 0; background: #c9c3cf; cursor: pointer; padding: 0; transition: background .2s; flex: none; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.switch.on { background: #34c759; }
.switch.on span { left: 21px; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-lib { font-size: 12.5px; font-weight: 650; color: var(--muted); min-width: 56px; }
.switch-lib.on { color: #1f9d48; }
.unicode-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; } .warn-box[hidden] { display: none; }

/* ==========================================================================
   Connexion, activation, comptes, installation de l'application
   ========================================================================== */
.auth-body { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-2-soft), transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--accent-soft), transparent 60%), var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 44px; height: 44px; }
.auth-brand-name { font: 700 19px var(--font-display); color: var(--ink); }
.auth-brand-sub { font-size: 13px; color: var(--muted); }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift); padding: 26px 26px 22px; }
.auth-card.large { max-width: 640px; }
.auth-card h1 { font: 700 22px var(--font-display); margin: 0 0 6px; color: var(--ink); }
.auth-card > p { margin: 0 0 16px; }
.auth-foot { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.auth-foot a { color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.auth-foot svg { width: 16px; height: 16px; }
.stack-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.btn.wide { width: 100%; justify-content: center; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.code-input { font-size: 24px; letter-spacing: .35em; text-align: center; height: 54px; font-variant-numeric: tabular-nums; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; font-size: 14px; }
.auth-links a, .linkbtn { color: var(--accent); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.auth-links a:hover, .linkbtn:hover { text-decoration: underline; }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.flash a { color: inherit; font-weight: 700; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input.small { height: 34px; font-size: 13px; padding: 0 8px; width: auto; }
.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); }
.plain a { color: var(--accent); }
.nowrap { white-space: nowrap; }
.list.users .sub { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.user-actions { position: relative; }
.user-actions summary { list-style: none; cursor: pointer; }
.user-actions summary::-webkit-details-marker { display: none; }
.user-actions .menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 250px; }
.user-actions .menu-pop .btn { width: 100%; justify-content: flex-start; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 6px 4px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }
.side-user .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12.5px; background: var(--side-active); color: var(--side-ink); }
.side-user .who { flex: 1; min-width: 0; line-height: 1.3; }
.side-user .who strong { display: block; color: var(--side-ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { color: var(--side-muted); font-size: 12px; }
.side-user button { background: none; border: 0; color: var(--side-muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.side-user button:hover { background: var(--side-hover); color: var(--side-ink); }
.side-user svg { width: 18px; height: 18px; }
.lecture-seule { display: flex; gap: 8px; align-items: center; background: var(--info-soft); color: var(--info); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px; }
.lecture-seule svg { width: 16px; height: 16px; }

/* Installation (PWA) */
.install-grid { display: grid; gap: 14px; }
.install-step { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.install-step .num { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.install-step .ico { display: inline-flex; vertical-align: middle; width: 26px; height: 26px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); align-items: center; justify-content: center; margin: 0 2px; color: var(--info); }
.install-step .ico svg { width: 16px; height: 16px; }
.install-step p { margin: 2px 0 0; font-size: 14.5px; color: var(--ink); }
.install-step em { display: block; font-style: normal; color: var(--muted); font-size: 13px; margin-top: 4px; }
.install-qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.install-qr .qr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); line-height: 0; }
.install-qr .qr svg, .install-qr .qr img { width: 168px; height: 168px; }
.install-ok { display: flex; gap: 10px; align-items: center; background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.platform-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.platform-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 6px 12px; font: 600 13px var(--font); cursor: pointer; }
.platform-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
[data-plateforme] { display: none; }
[data-plateforme].visible { display: block; }
.top-logout { display: none; }
@media (max-width: 960px) { .top-logout { display: block; } }
[hidden] { display: none !important; }
.install-ok svg { width: 20px; height: 20px; flex: none; }
.install-qr { margin-top: 4px; }
