@import url("fonts/nunito.css");
@import url("fonts/archivo.css");
@import url("fonts/ibm-plex-mono.css");

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef2f8;
  --border: #e4e8f0;
  --border-strong: #d3d9e4;
  --text: #0f1b2d;
  --muted: #64718a;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --primary-ink: #ffffff;
  --primary-soft: #eaf1ff;
  --elec: #c27c00;
  --elec-soft: #fff6dd;
  --gaz: #0f8a66;
  --gaz-soft: #e1f6ee;
  --ok: #12945a;
  --ok-soft: #e3f6ec;
  --warn: #b86a00;
  --warn-soft: #fff3df;
  --err: #d23b3b;
  --err-soft: #fdecec;
  --violet: #7c3aed;
  --violet-soft: #f1eafe;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 4px 14px rgba(15, 27, 45, .05);
  --shadow-md: 0 2px 4px rgba(15, 27, 45, .04), 0 10px 28px rgba(15, 27, 45, .08);
  --shadow-lg: 0 24px 60px rgba(15, 27, 45, .18);
  --ring: 0 0 0 4px rgba(37, 99, 235, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 100% -10%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, rgba(124, 58, 237, .05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1 { font-size: 1.6rem; margin: 0 0 .2rem; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: .95rem; margin: 1.1rem 0 .5rem; font-weight: 650; }
p { margin: .35rem 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }

/* --- En-tête --------------------------------------------------------- */
.topbar {
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(228, 232, 240, .8);
  box-shadow: 0 1px 0 rgba(15, 27, 45, .02), 0 6px 20px rgba(15, 27, 45, .04);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1520px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px; height: 64px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; color: var(--brand, var(--text)); text-decoration: none; letter-spacing: -.01em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: block;
  box-shadow: 0 4px 12px rgba(7, 84, 184, .35);
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; line-height: 1.15; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a {
  padding: 8px 13px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 550;
  position: relative; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary-2); }
.badge-count {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff;
  font-size: .7rem; text-align: center; line-height: 18px; margin-left: 5px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(210, 59, 59, .35);
}
.user-box { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .86rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  background: linear-gradient(135deg, #e0e7ff, #dbeafe); color: var(--primary-2); box-shadow: var(--shadow-xs);
}

/* --- Mise en page ---------------------------------------------------- */
.container { max-width: 1520px; margin: 0 auto; padding: 28px 24px 70px; }
.container.narrow { max-width: 900px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card.tight { padding: 16px 18px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .grid-2, .grid-3 { grid-template-columns: 1fr !important; } .nav { display: none; } }

/* --- Formulaires ----------------------------------------------------- */
label { display: block; font-weight: 600; margin: 0 0 5px; font-size: .86rem; }
.field { margin-bottom: 15px; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=url], input[type=search],
select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit;
  background: var(--field); color: var(--text); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
input[type=search] { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; cursor: pointer; opacity: .55;
  background: var(--muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
input[type=search]::-webkit-search-cancel-button:hover { opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input:disabled { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--primary); }
.req { color: var(--err); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; font-size: .87rem; box-shadow: var(--shadow-xs);
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
}
.btn:hover { background: var(--surface-2); border-color: #c4ccda; box-shadow: 0 2px 6px rgba(15, 27, 45, .07); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 82%, #fff), var(--primary)); border-color: var(--primary-2); color: var(--primary-ink);
  box-shadow: 0 1px 2px rgba(37, 99, 235, .3), 0 4px 12px rgba(37, 99, 235, .22), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn.primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 90%, #fff), var(--primary-2)); }
.btn.success {
  background: linear-gradient(180deg, #19a866, var(--ok)); border-color: #0e7d4b; color: #fff;
  box-shadow: 0 1px 2px rgba(18, 148, 90, .3), 0 4px 12px rgba(18, 148, 90, .2), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn.success:hover { filter: brightness(1.05); }
.btn.warn { background: var(--warn-soft); border-color: #f2d3a2; color: var(--warn); }
.btn.danger { color: var(--err); border-color: #f2c9c9; }
.btn.danger:hover { background: var(--err-soft); }
.btn.danger-solid { background: var(--err); border-color: #b42f2f; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { padding: 6px 11px; font-size: .8rem; border-radius: 9px; }
.btn.lg { padding: 11px 20px; font-size: .95rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Messages -------------------------------------------------------- */
.flash { padding: 12px 15px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; box-shadow: var(--shadow-xs); }
.flash.success { background: var(--ok-soft); border-color: #bfe7d0; color: #0c4f31; }
.flash.error { background: var(--err-soft); border-color: #f5c6c6; color: #7d1d1d; }
.flash.info { background: var(--primary-soft); border-color: #cddcfb; color: #183d84; }
.flash.warn { background: var(--warn-soft); border-color: #f4d8ab; color: #6b3f00; }

/* --- Pastilles, barres ----------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: var(--primary-soft); color: var(--primary-2); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.pill.neutral { background: var(--surface-3); color: var(--muted); }
.pill.elec { background: var(--elec-soft); color: #8a5700; }
.pill.gaz { background: var(--gaz-soft); color: var(--gaz); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 80%, #fff), var(--primary)); border-radius: 99px; transition: width .5s ease; }
.progress.big { height: 12px; }
.progress-cell { display: flex; align-items: center; gap: 9px; }
.progress-cell b { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; font-size: .86rem; }

/* --- Indicateurs ----------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; position: relative; overflow: hidden;
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi .kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi .icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: var(--primary-soft); }
.kpi .icon.ok { background: var(--ok-soft); } .kpi .icon.warn { background: var(--warn-soft); } .kpi .icon.violet { background: var(--violet-soft); } .kpi .icon.elec { background: var(--elec-soft); }
.kpi .label { color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 8px; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.kpi.alert { border-color: #f4d8ab; background: linear-gradient(180deg, #fffaf1, #fff); }

.steps { display: flex; gap: 10px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: .86rem; font-weight: 500; }
.step .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; color: #fff; background: #b5bfcd; font-weight: 700; }
.step.done { background: var(--ok-soft); border-color: #c5ead5; }
.step.done .dot { background: var(--ok); }
.step.todo .dot { background: var(--warn); }

/* --- Stepper de campagne -------------------------------------------- */
.stepper { display: flex; align-items: center; gap: 0; margin: 4px 0 2px; }
.stepper .st { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.stepper .st .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: .85rem; border: 2px solid var(--border); }
.stepper .st.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .st.current .n { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--ring); }
.stepper .st.current, .stepper .st.done { color: var(--text); }
.stepper .bar { flex: 1; height: 2px; background: var(--border); margin: 0 14px; min-width: 30px; border-radius: 2px; }
.stepper .bar.done { background: var(--ok); }

.hero {
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; color: #fff;
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 75%, #000) 0%, var(--primary) 45%, color-mix(in srgb, var(--primary) 70%, #6366f1) 100%);
  box-shadow: 0 10px 30px rgba(37, 99, 235, .25);
  display: flex; justify-content: space-between; gap: 18px; align-items: center; flex-wrap: wrap;
}
.hero h2 { color: #fff; margin: 0 0 4px; font-size: 1.2rem; }
.hero p { margin: 0; opacity: .9; }
.hero .pill { background: rgba(255, 255, 255, .18); color: #fff; }
.hero.closed { background: linear-gradient(120deg, #334155, #475569); box-shadow: 0 10px 30px rgba(51, 65, 85, .25); }
.hero.draft { background: linear-gradient(120deg, #6d28d9, #7c3aed 50%, #a855f7); box-shadow: 0 10px 30px rgba(124, 58, 237, .22); }

/* --- Tableaux simples ------------------------------------------------ */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th, table.list td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.list th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); font-weight: 600; position: sticky; top: 0; }
table.list th:first-child { border-top-left-radius: 10px; } table.list th:last-child { border-top-right-radius: 10px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover td { background: var(--row-hover); }
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.clickable-row { cursor: pointer; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .btn { padding: 5px 9px; }

/* --- Mot de passe ----------------------------------------------------- */
.pw-tools { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.pw-generated { margin-top: 8px; padding: 10px 13px; border-radius: 10px; background: var(--ok-soft); border: 1px solid #c5ead5; font-size: .86rem; }
.pw-generated code { font-family: Consolas, "Courier New", monospace; font-size: .98rem; letter-spacing: .05em; background: var(--field); padding: 2px 8px; border-radius: 6px; user-select: all; }

/* --- Captcha ------------------------------------------------------------ */
.captcha {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 16px 10px 12px;
  background: var(--field); color: var(--text); border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 27, 45, .18);
  font-weight: 600; font-size: .92rem; cursor: pointer; user-select: none; min-width: 270px;
}
.captcha .box {
  width: 26px; height: 26px; border-radius: 7px; border: 2px solid #b8c2d1; display: grid; place-items: center;
  font-size: 15px; color: #fff; transition: all .15s; flex: none;
}
.captcha:hover .box { border-color: var(--primary); }
.captcha.busy .box { border-color: var(--primary); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.captcha.done { cursor: default; }
.captcha.done .box { background: var(--ok); border-color: var(--ok); }
.captcha.error .box { border-color: var(--err); }
.captcha .meta { margin-left: auto; font-size: .7rem; color: var(--muted); font-weight: 500; text-align: right; line-height: 1.2; }
@keyframes spin { to { transform: rotate(360deg); } }
.hcaptcha-wrap { margin-top: 16px; min-height: 78px; }
.hcaptcha-wrap[hidden], .captcha[hidden] { display: none; }

/* --- Bloc SIREN (inscription) ------------------------------------- */
.siren-hero {
  border-radius: var(--radius); padding: 24px 26px; margin-bottom: 20px; color: #fff;
  background: linear-gradient(125deg, #1e3a8a 0%, #1d4ed8 45%, #3b82f6 80%, #60a5fa 100%);
  box-shadow: 0 12px 34px rgba(29, 78, 216, .28), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.siren-hero > label { color: #fff; font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.siren-hint-small { font-weight: 400; opacity: .75; font-size: .85rem; margin-left: 6px; }
.siren-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.siren-hero input#siren {
  width: 320px; max-width: 100%; padding: 12px 18px; font-size: 2rem; font-weight: 600; letter-spacing: .18em;
  font-variant-numeric: tabular-nums; text-align: center; color: var(--text);
  border: 2px solid rgba(255, 255, 255, .6); border-radius: 14px; background: var(--field);
  box-shadow: 0 6px 18px rgba(15, 27, 45, .18);
}
.siren-hero input#siren::placeholder { color: #c3cbd8; letter-spacing: .18em; }
.siren-hero input#siren:focus { border-color: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .3), 0 6px 18px rgba(15, 27, 45, .18); }
.siren-status { font-weight: 600; font-size: .95rem; padding: 6px 12px; border-radius: 999px; }
.siren-status:empty { display: none; }
.siren-status { background: rgba(255, 255, 255, .16); }
.siren-status.good { background: #e3f6ec; color: var(--ok); }
.siren-status.bad { background: #fdecec; color: var(--err); }
.siren-result { margin-top: 16px; }
.siren-company {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); border-radius: 12px;
  padding: 13px 16px; line-height: 1.5; backdrop-filter: blur(4px);
}
.siren-company-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.siren-source { font-size: .8rem; opacity: .85; margin-top: 8px; }
.siren-source a, .siren-hero .siren-company a { color: #fff; font-weight: 600; }
.siren-loading, .siren-note { font-size: .9rem; opacity: .9; }
.siren-note { background: rgba(255, 255, 255, .14); border-radius: 10px; padding: 10px 14px; }
.siren-alert {
  margin-top: 12px; background: var(--field); color: var(--text); border-radius: 12px; padding: 16px 18px;
  border-left: 5px solid var(--err); box-shadow: 0 8px 22px rgba(15, 27, 45, .2);
}
.siren-alert-title { font-weight: 700; color: var(--err); font-size: 1rem; margin-bottom: 4px; }
.siren-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.siren-actions .siren-source { margin-top: 0; }
.siren-hero .btn { box-shadow: 0 4px 12px rgba(15, 27, 45, .18); }
input.filled-flash { animation: filledFlash .9s ease-out; }
@keyframes filledFlash { from { background: #dbeafe; border-color: var(--primary); } }
.rest-form { border: 0; padding: 0; margin: 0; min-width: 0; transition: opacity .2s; }
.rest-form.locked { opacity: .55; pointer-events: none; filter: grayscale(.6); }

/* --- Mandat ---------------------------------------------------------- */
.mandate-box {
  white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 15px 17px; max-height: 300px; overflow-y: auto; font-size: .87rem;
}
.mail-preview { background: var(--field); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.mail-preview .mail-head { padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .85rem; }
.mail-preview .mail-body { padding: 16px; white-space: pre-wrap; font-size: .9rem; }

/* --- Grille des compteurs ------------------------------------------- */
.grid-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.grid-toolbar .group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: .82rem; cursor: pointer; color: var(--muted); font-weight: 600; border-radius: 8px; }
.seg button.on { background: var(--field); color: var(--text); box-shadow: var(--shadow-xs), 0 1px 4px rgba(15, 27, 45, .08); }
.search { width: 230px !important; }
.save-state { font-size: .83rem; color: var(--muted); font-weight: 500; }
.save-state.dirty { color: var(--warn); font-weight: 600; }
.save-state.saved { color: var(--ok); }
#grid { border: 1px solid var(--border); border-radius: 12px; background: var(--field); overflow: hidden; box-shadow: var(--shadow-xs); }
.tabulator { font-size: 13.3px; border: 0 !important; font-family: inherit; }
.tabulator .tabulator-header { border-bottom: 1px solid var(--border) !important; }
.tabulator .tabulator-header .tabulator-col { background: var(--surface-2) !important; border-right: 1px solid #edf0f5 !important; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-title { white-space: normal; font-weight: 600; font-size: .78rem; color: #3b4a62; }
.tabulator .tabulator-header .tabulator-col input { border-radius: 7px; border: 1px solid var(--border) !important; padding: 4px 6px !important; font-size: .78rem; }
.tabulator-row { border-bottom: 1px solid #f0f2f6 !important; }
.tabulator-row.tabulator-row-even { background: var(--row-alt); }
.tabulator-row:hover { background: var(--row-hover) !important; }
.tabulator-row.tabulator-selected { background: #e8f0ff !important; }
.tabulator-row .tabulator-cell { border-right: 1px solid #f2f4f8 !important; padding: 7px 8px !important; }
.tabulator-row .tabulator-cell.tabulator-editing { border: 2px solid var(--primary) !important; box-shadow: var(--ring); }
.tabulator .tabulator-col.col-required .tabulator-col-title::after { content: " *"; color: var(--err); }
.tabulator-row .tabulator-cell.cell-error { background: var(--err-soft) !important; box-shadow: inset 0 -2px 0 var(--err); }
.tabulator-row .tabulator-cell.cell-na { background: repeating-linear-gradient(45deg, #f7f8fa, #f7f8fa 6px, #f0f2f5 6px, #f0f2f5 12px) !important; color: #b3bccb; }
.tabulator-row.row-new .tabulator-cell:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.tabulator-row.row-changed .tabulator-cell:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.tabulator .tabulator-placeholder-contents { color: var(--muted) !important; font-size: .95rem !important; font-weight: 500 !important; }
.read-only .edit-only { display: none !important; }
.grid-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: .83rem; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .l-err::before { background: var(--err-soft); border: 1px solid var(--err); }
.legend .l-na::before { background: #eef0f3; border: 1px solid #cdd3da; }
.legend .l-new::before { background: var(--primary); }
.legend .l-chg::before { background: var(--warn); }

/* --- Modales, toasts, bannières ------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.modal-backdrop.open { display: flex; animation: fadeIn .15s ease-out; }
.modal { background: var(--field); border-radius: 18px; max-width: 720px; width: 100%; max-height: 88vh; overflow: auto; padding: 26px; box-shadow: var(--shadow-lg); animation: popIn .18s ease-out; }
.modal h2 { margin-top: 0; }
.modal ul { max-height: 280px; overflow: auto; padding-left: 20px; font-size: .87rem; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toast-zone { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: #111c2e; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-md); max-width: 420px; font-size: .88rem; animation: toastIn .2s ease-out; }
.toast.error { background: var(--err); }
.toast.success { background: var(--ok); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }
.banner { display: none; }
.banner.show { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; box-shadow: 0 0 0 0 rgba(18, 148, 90, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(18, 148, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 148, 90, 0); } }

.tabs { display: inline-flex; gap: 2px; background: var(--surface-3); padding: 4px; border-radius: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-radius: 9px; font-size: .87rem; }
.tabs a.active { background: var(--field); color: var(--text); box-shadow: var(--shadow-xs), 0 1px 4px rgba(15, 27, 45, .08); }

.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 28px 16px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card .card { padding: 30px; box-shadow: var(--shadow-md); }
.auth-logo { display: block; width: 64px; height: 64px; border-radius: 18px; margin-bottom: 16px; box-shadow: 0 8px 22px rgba(7, 84, 184, .3); }
.notif-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { font-weight: 600; }
.diff { font-size: .84rem; }
.diff del { color: var(--err); }
.diff ins { color: var(--ok); text-decoration: none; }
details > summary { cursor: pointer; }
code.var { background: var(--primary-soft); color: var(--primary-2); padding: 2px 7px; border-radius: 6px; cursor: pointer; font-size: .8rem; }
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .big-icon { font-size: 44px; width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 24px; display: grid; place-items: center; background: var(--primary-soft); box-shadow: var(--shadow); }

/* --- Navigation compacte ------------------------------------------------ */
.nav a { padding: 8px 10px; font-size: .86rem; white-space: nowrap; }
.nav-bell { margin-left: auto; }
@media (max-width: 1320px) { .user-box > span:not(.avatar) { display: none; } }
.mono { font-family: Consolas, "Courier New", monospace; }
.badge-soft { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-size: .72rem; text-align: center; line-height: 18px; margin-left: 4px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack > .card { margin-bottom: 0; }
.grid-2.align-stretch { align-items: stretch; margin-bottom: 20px; }
.grid-2.align-stretch > .card { margin-bottom: 0; }

/* --- Codes adhérents ---------------------------------------------------- */
.code-chip { display: inline-block; font-family: Consolas, monospace; font-size: .74rem; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  background: #eef2ff; color: #3730a3; border: 1px solid #dfe3ff; vertical-align: 1px; white-space: nowrap; }
.code-chip.big { font-size: .9rem; padding: 3px 10px; vertical-align: middle; }
input.code-input { font-family: Consolas, monospace; font-weight: 600; letter-spacing: .04em; }

/* --- Campagnes : bandeau, tuiles, onglets ------------------------------- */
.camp-strip { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 14px; margin-bottom: 8px; scroll-snap-type: x proximity; }
.camp-card { flex: 0 0 250px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px 15px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s, border-color .15s; position: relative; }
.camp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.camp-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14), var(--shadow-md); }
.camp-card .cc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.camp-card .cc-name { font-weight: 650; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-card .cc-meta { font-size: .78rem; color: var(--muted); margin-top: 7px; }
.camp-card.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--primary); font-weight: 600;
  border-style: dashed; background: transparent; box-shadow: none; flex-basis: 170px; }
.camp-card.add span { font-size: 1.4rem; }
.st-open { border-top: 3px solid var(--ok); } .st-draft { border-top: 3px solid var(--violet); }
.st-scheduled { border-top: 3px solid var(--primary); } .st-closed { border-top: 3px solid #94a3b8; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.camp-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.camp-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.camp-tile h2 { margin: 10px 0 4px; }
.camp-tile .cc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.camp-tile .progress { margin-top: auto; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.tile-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center; }
.tile-stats b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.tile-stats span { font-size: .74rem; color: var(--muted); }
.campaign-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.campaign-tabs a { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.campaign-tabs a:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.campaign-tabs a.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.campaign-tabs .ct-name { font-weight: 650; }

/* Étapes de campagne cliquables (onglets) */
.stepper-tabs { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; box-shadow: var(--shadow); margin-bottom: 20px; overflow-x: auto; }
.stepper-tabs .st { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--muted); font-size: .9rem; white-space: nowrap;
  text-decoration: none; padding: 8px 12px; border-radius: 11px; transition: background .15s; }
.stepper-tabs .st:hover { background: var(--surface-3); color: var(--text); }
.stepper-tabs .st.active { background: var(--primary-soft); color: var(--primary-2); }
.stepper-tabs .st .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted);
  font-size: .82rem; border: 2px solid var(--border); flex: none; }
.stepper-tabs .st.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper-tabs .st.current .n { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--ring); }
.stepper-tabs .st.done, .stepper-tabs .st.current { color: var(--text); }
.stepper-tabs .st.active.done, .stepper-tabs .st.active.current { color: var(--primary-2); }
.stepper-tabs .bar { flex: 1; height: 2px; background: var(--border); min-width: 18px; border-radius: 2px; margin: 0 2px; }
.stepper-tabs .bar.done { background: var(--ok); }
.stepper-tabs .bar:nth-last-of-type(1) { flex: .4; background: transparent; }
.stepper-tabs .st.msg { margin-left: 8px; border: 1px solid var(--border); }
.stepper-tabs .st.msg .n { background: var(--violet-soft); color: var(--violet); border-color: #e2d4fd; }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; }
.checklist li { padding: 7px 0 7px 30px; position: relative; border-bottom: 1px dashed var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: "○"; position: absolute; left: 4px; color: var(--muted); font-weight: 700; }
.checklist li.ok::before { content: "✓"; color: var(--ok); }
.checklist li.warn::before { content: "!"; color: var(--warn); left: 8px; }
.check-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; margin: 8px 0; background: var(--surface-2); }
.check-list .check { margin: 4px 0; }
.seg-radio { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg-radio label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; padding: 8px 13px; border: 1px solid var(--border-strong);
  border-radius: 10px; cursor: pointer; background: var(--field); margin: 0; }
.seg-radio label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-2); }
.seg-radio input { accent-color: var(--primary); }

/* --- Rédaction de message avec aperçu -------------------------------------- */
.composer { --composer-h: 380px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.composer-col { display: flex; flex-direction: column; min-width: 0; }
.composer-label { font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px; min-height: 30px; }
.composer-sample { width: auto !important; padding: 3px 8px !important; font-size: .8rem; text-transform: none; letter-spacing: 0; max-width: 260px; }
.composer-subject { height: 44px; margin-bottom: 10px; font-weight: 600; }
div.composer-subject.preview { display: flex; align-items: center; padding: 0 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.composer-body { height: var(--composer-h); min-height: var(--composer-h); resize: none; font: inherit; line-height: 1.55; font-size: .9rem; }
textarea.composer-body { padding: 13px 14px; }
div.composer-body.preview { white-space: pre-wrap; overflow: auto; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--field); box-shadow: inset 0 0 0 4px var(--surface-2); }
.composer-vars { margin-bottom: 10px; line-height: 2; }
.recipient-count { height: 42px; display: flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-2); }
.recipient-count b { font-size: 1.2rem; }
tr.msg-detail > td { background: var(--surface-2) !important; padding: 14px !important; }
.msg-detail-box table.list { background: var(--field); border-radius: 10px; }
@media (max-width: 960px) { .composer { grid-template-columns: 1fr; } }

/* --- Import contrôlé ----------------------------------------------------- */
.import-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.is-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; background: var(--surface-2); }
.is-box b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.is-box span { font-size: .78rem; color: var(--muted); }
.is-box.ok { background: var(--ok-soft); border-color: #c5ead5; } .is-box.ok b { color: var(--ok); }
.is-box.err { background: var(--err-soft); border-color: #f5c6c6; } .is-box.err b { color: var(--err); }
.import-question { font-size: .98rem; background: var(--warn-soft); border: 1px solid #f4d8ab; padding: 12px 14px; border-radius: 12px; }
.import-mode { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.import-mode .check { font-size: .86rem; }

/* --- Champs personnalisés -------------------------------------------------- */
.custom-grid .field.wide, .grid-2 .field.wide { grid-column: 1 / -1; }

/* --- Éditeur de questionnaires ------------------------------------------- */
.form-switch { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.fe-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 330px; gap: 18px; align-items: start; padding-bottom: 80px; }
.fe-palette, .fe-preview { position: sticky; top: calc(var(--stick, 64px) + 20px); margin-bottom: 0; max-height: calc(100vh - 170px); overflow: auto; }
.fe-palette h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fe-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fe-type { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 11px 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; color: var(--text); transition: all .15s; }
.fe-type span { font-size: 1.3rem; }
.fe-type:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); box-shadow: var(--shadow); }
.fe-type:last-child { grid-column: 1 / -1; flex-direction: row; justify-content: center; }
.fe-builtins { display: flex; flex-direction: column; gap: 5px; }
.fe-builtin { display: flex; gap: 8px; align-items: center; text-align: left; padding: 7px 10px; border: 1px dashed var(--border-strong); border-radius: 9px;
  background: var(--field); cursor: pointer; font: inherit; font-size: .82rem; color: var(--text); }
.fe-builtin:hover { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.fe-list { display: flex; flex-direction: column; gap: 10px; }
.fe-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s; }
.fe-card:hover { box-shadow: var(--shadow-md); }
.fe-card.open { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12), var(--shadow-md); }
.fe-card.is-hidden { opacity: .78; border-style: dashed; }
.fe-card.is-hidden .fe-label { color: var(--muted); }
.fe-card.dragging { opacity: .45; }
.fe-card.drop-before { box-shadow: 0 -3px 0 var(--primary), var(--shadow); }
.fe-card.drop-after { box-shadow: 0 3px 0 var(--primary), var(--shadow); }
.fe-card-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; flex-wrap: wrap; }
.fe-handle { cursor: grab; color: #b3bccb; font-weight: 700; letter-spacing: -2px; user-select: none; width: 18px; }
.fe-card.locked .fe-handle { letter-spacing: 0; }
.fe-num { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: .74rem; font-weight: 700; color: var(--muted); flex: none; }
.fe-badge { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex: none; background: var(--primary-soft); }
.fe-badge.t-number { background: var(--violet-soft); } .fe-badge.t-date { background: var(--warn-soft); }
.fe-badge.t-choice { background: var(--gaz-soft); } .fe-badge.t-yesno { background: var(--ok-soft); }
input.fe-label { flex: 1 1 220px; min-width: 160px; border: 1px solid transparent; box-shadow: none; font-weight: 600; font-size: .95rem; padding: 7px 9px; background: transparent; }
input.fe-label:hover { border-color: var(--border); background: var(--field); }
input.fe-label:focus { background: var(--field); }
.fe-energies { display: inline-flex; gap: 4px; }
.chip { border: 1px solid var(--border-strong); background: var(--field); border-radius: 999px; padding: 3px 9px; font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--elec-soft); border-color: #f2d27a; color: #8a5700; }
.chip.on[data-energy="gaz"] { background: var(--gaz-soft); border-color: #a7e3cf; color: var(--gaz); }
.switch { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: #cfd6e2; position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked + span { background: var(--err); }
.switch input:checked + span::after { left: 16px; }
.switch input:disabled + span { opacity: .55; }
.fe-tag { font-size: .7rem; color: var(--muted); background: var(--surface-3); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.fe-tag-hidden { color: var(--warn); background: var(--warn-soft); font-weight: 700; }
.fe-move { display: inline-flex; flex-direction: column; }
.fe-move button, .fe-toggle { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: .7rem; line-height: 1; padding: 2px 4px; border-radius: 5px; }
.fe-move button:hover, .fe-toggle:hover { background: var(--surface-3); color: var(--text); }
.fe-toggle { font-size: 1rem; padding: 6px 8px; }
.fe-settings { border-top: 1px solid var(--border); padding: 14px 16px 12px 52px; background: var(--surface-2); border-radius: 0 0 14px 14px; }
.fe-type-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.fe-type-picker button { border: 1px solid var(--border-strong); background: var(--field); border-radius: 9px; padding: 6px 11px; font: inherit; font-size: .82rem; cursor: pointer; }
.fe-type-picker button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-2); font-weight: 600; }
.fe-options { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fe-option { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--field); overflow: hidden; }
.fe-option input { border: 0 !important; box-shadow: none !important; width: 150px; padding: 6px 8px; }
.fe-option button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 0 8px; }
.fe-option button:hover { color: var(--err); }
.fe-card-actions { display: flex; justify-content: flex-end; gap: 6px; }
.fe-add-inline { width: 100%; margin-top: 12px; padding: 14px; border: 2px dashed var(--border-strong); border-radius: 14px; background: transparent;
  font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; transition: background .15s, border-color .15s; }
.fe-add-inline:hover { background: var(--primary-soft); border-color: var(--primary); }
.fe-pv-form .field { margin-bottom: 11px; }
.fe-pv-form label { font-size: .8rem; }
.fe-pv-form input, .fe-pv-form select { padding: 7px 10px; font-size: .85rem; }
.fe-num-input { display: flex; align-items: center; gap: 6px; }
.fe-num-input span { color: var(--muted); font-size: .82rem; }
.fe-pv-cols { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fe-pv-cols span { font-size: .72rem; background: #5b8db8; color: #fff; padding: 2px 7px; border-radius: 5px; }
.fe-pv-cols span.req-col { background: #1f4e79; }
.fe-savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
  background: var(--topbar-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(15, 27, 45, .06); }
.fe-savebar.dirty { background: rgba(255, 250, 241, .95); }
@media (max-width: 1200px) { .fe-layout { grid-template-columns: 1fr; } .fe-palette, .fe-preview { position: static; max-height: none; } }

/* --- Données, énergie, analyses ---------------------------------------------- */
.data-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dropzone { position: relative; border: 2px dashed var(--border-strong); border-radius: 14px; padding: 26px 18px; text-align: center; background: var(--surface-2);
  transition: border-color .15s, background .15s; }
.dropzone.over, .dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone ul { list-style: none; padding: 0; margin: 10px 0 0; text-align: left; }
.format-list { padding-left: 18px; }
.format-list li { margin-bottom: 8px; }
.chart-card { margin-bottom: 0; }
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 360px; }
.card.chart-card + .card, .grid-2.align-stretch + .card.chart-card { margin-top: 0; }
.card.chart-card:not(.grid-2 .chart-card) { margin-bottom: 20px; }

@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}

/* =====================================================================
   Thèmes (clair / sombre) et vision des couleurs
   ===================================================================== */
:root {
  --field: #ffffff;
  --row-alt: #fcfdff;
  --row-hover: #f5f9ff;
  --topbar-bg: rgba(255, 255, 255, .82);
  --subnav-bg: rgba(248, 250, 253, .72);
  --chart-1: #2563eb; --chart-2: #7c3aed; --chart-3: #0ea5e9; --chart-4: #6366f1; --chart-5: #a855f7;
  --chart-6: #12945a; --chart-7: #20c997; --chart-8: #f59e0b; --chart-9: #e8590c; --chart-10: #94a3b8;
  --st-cours: #2563eb; --st-valide: #12945a; --st-attente: #d97706; --st-retirer: #94a3b8;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2c; --surface-2: #162238; --surface-3: #1d2a44;
  --border: #23314d; --border-strong: #31415f; --text: #e6ecf7; --muted: #93a1ba;
  --primary: #4f8bff; --primary-2: #8db4ff; --primary-soft: #18294a;
  --elec-soft: #33280d; --gaz-soft: #0d2e26; --ok-soft: #0f2d20; --warn-soft: #33240b; --err-soft: #3a1717; --violet-soft: #251a44;
  --ok: #34c88a; --warn: #f2a93b; --err: #f07171; --violet: #b59bff; --gaz: #3fc8a0; --elec: #f2b53b;
  --field: #0f1829; --row-alt: #121c30; --row-hover: #18263f;
  --topbar-bg: rgba(13, 21, 37, .82); --subnav-bg: rgba(13, 21, 37, .7);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
  --ring: 0 0 0 4px rgba(79, 139, 255, .25);
  color-scheme: dark;
}
html[data-theme="dark"] body { background: radial-gradient(1200px 500px at 100% -10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%), var(--bg); }
html[data-theme="dark"] .flash.success { color: #9be7c3; border-color: #1e5a40; }
html[data-theme="dark"] .flash.error { color: #ffb4b4; border-color: #6b2a2a; }
html[data-theme="dark"] .flash.info { color: #b9d0ff; border-color: #2a4170; }
html[data-theme="dark"] .flash.warn { color: #ffd79a; border-color: #6b4a14; }
html[data-theme="dark"] .pill.elec { color: #f7c769; }
html[data-theme="dark"] .code-chip { background: #1d2550; color: #b8c4ff; border-color: #2c3670; }
html[data-theme="dark"] .kpi.alert { background: linear-gradient(180deg, #2a2210, var(--surface)); border-color: #6b4a14; }
html[data-theme="dark"] .tabulator, html[data-theme="dark"] .tabulator .tabulator-tableholder,
html[data-theme="dark"] .tabulator-row, html[data-theme="dark"] .tabulator .tabulator-header,
html[data-theme="dark"] .tabulator .tabulator-header .tabulator-col { background: var(--surface) !important; color: var(--text); }
html[data-theme="dark"] .tabulator .tabulator-header .tabulator-col { background: var(--surface-2) !important; }
html[data-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-col-title { color: var(--muted); }
html[data-theme="dark"] .tabulator-row .tabulator-cell { border-right-color: var(--border) !important; }
html[data-theme="dark"] .tabulator-row { border-bottom-color: var(--border) !important; }
html[data-theme="dark"] .tabulator-row.tabulator-row-even { background: var(--row-alt) !important; }
html[data-theme="dark"] .tabulator-row.tabulator-selected { background: #1d3157 !important; }
html[data-theme="dark"] .tabulator input, html[data-theme="dark"] .tabulator select { background: var(--field); color: var(--text); }
html[data-theme="dark"] .tabulator-edit-list { background: var(--surface-2) !important; color: var(--text); border-color: var(--border) !important; }
html[data-theme="dark"] .tabulator-edit-list .tabulator-edit-list-item:hover,
html[data-theme="dark"] .tabulator-edit-list .tabulator-edit-list-item.active { background: var(--primary-soft) !important; color: var(--text) !important; }
html[data-theme="dark"] .tabulator-row .tabulator-cell.cell-na { background: repeating-linear-gradient(45deg, #121b2d, #121b2d 6px, #172238 6px, #172238 12px) !important; color: #4b5a75; }
html[data-theme="dark"] .tabulator .tabulator-footer { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
html[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .toast { background: #26324a; }
html[data-theme="dark"] .avatar { background: linear-gradient(135deg, #22305a, #1d3157); color: #b9d0ff; }
html[data-theme="dark"] .fe-builtin, html[data-theme="dark"] .fe-type { color: var(--text); }
html[data-theme="dark"] img.brand-mark { box-shadow: 0 4px 12px rgba(0, 0, 0, .45); }

/* Vision des couleurs : statuts, énergies et graphiques */
html[data-cvd="deuteranopia"], html[data-cvd="protanopia"] {
  --ok: #0072b2; --ok-soft: #e1eef7; --warn: #b26e00; --warn-soft: #fbefd9; --err: #c64b00; --err-soft: #fbe4d6;
  --elec: #b26e00; --elec-soft: #fbefd9; --gaz: #0072b2; --gaz-soft: #e1eef7; --violet: #a54f86; --violet-soft: #f6e6f0;
  --chart-1: #0072b2; --chart-2: #e69f00; --chart-3: #56b4e9; --chart-4: #cc79a7; --chart-5: #f0e442;
  --chart-6: #009e73; --chart-7: #d55e00; --chart-8: #999999; --chart-9: #332288; --chart-10: #bbbbbb;
  --st-cours: #56b4e9; --st-valide: #0072b2; --st-attente: #e69f00; --st-retirer: #999999;
}
html[data-cvd="protanopia"] { --chart-2: #f0e442; --chart-5: #e69f00; }
html[data-cvd="tritanopia"] {
  --ok: #00796b; --ok-soft: #dff1ee; --warn: #c2185b; --warn-soft: #fbe3ec; --err: #8e0000; --err-soft: #f5dcdc;
  --elec: #c2185b; --elec-soft: #fbe3ec; --gaz: #00796b; --gaz-soft: #dff1ee;
  --chart-1: #d81b60; --chart-2: #1e88e5; --chart-3: #004d40; --chart-4: #ffc107; --chart-5: #8e24aa;
  --chart-6: #26a69a; --chart-7: #6d4c41; --chart-8: #f06292; --chart-9: #455a64; --chart-10: #b0bec5;
  --st-cours: #1e88e5; --st-valide: #004d40; --st-attente: #d81b60; --st-retirer: #b0bec5;
}
html[data-cvd="achromatopsia"] {
  --ok: #1f1f1f; --ok-soft: #e9e9e9; --warn: #5c5c5c; --warn-soft: #f1f1f1; --err: #000; --err-soft: #dcdcdc;
  --elec: #3a3a3a; --elec-soft: #ededed; --gaz: #6b6b6b; --gaz-soft: #f3f3f3; --violet: #4a4a4a; --violet-soft: #eeeeee;
  --primary: #333; --primary-2: #111; --primary-soft: #ececec;
  --chart-1: #111111; --chart-2: #444444; --chart-3: #777777; --chart-4: #999999; --chart-5: #bbbbbb;
  --chart-6: #2a2a2a; --chart-7: #5a5a5a; --chart-8: #888888; --chart-9: #aaaaaa; --chart-10: #d0d0d0;
  --st-cours: #888; --st-valide: #111; --st-attente: #555; --st-retirer: #bbb;
}
html[data-theme="dark"][data-cvd="achromatopsia"] { --ok: #eee; --err: #fff; --warn: #aaa; --primary: #ddd; --primary-2: #fff; --primary-soft: #2a2a2a;
  --st-valide: #f2f2f2; --st-cours: #9a9a9a; --st-attente: #c8c8c8; --chart-1: #f2f2f2; --chart-2: #c8c8c8; --chart-3: #a0a0a0; --chart-4: #7a7a7a; }
html[data-cvd="achromatopsia"] .btn.primary, html[data-cvd="achromatopsia"] .btn.success, html[data-cvd="achromatopsia"] .hero,
html[data-cvd="achromatopsia"] .siren-hero, html[data-cvd="achromatopsia"] .btn-new { filter: grayscale(1); }
html[data-theme="dark"][data-cvd="deuteranopia"], html[data-theme="dark"][data-cvd="protanopia"], html[data-theme="dark"][data-cvd="tritanopia"] {
  --ok-soft: #10261f; --warn-soft: #2e2410; --err-soft: #321818; --gaz-soft: #0f2633; --elec-soft: #2e2410; --violet-soft: #2a1a2a; }

/* =====================================================================
   Navigation : icônes animées, menus déroulants, sous-menu de campagne
   ===================================================================== */
svg.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
svg.ic.big { width: 22px; height: 22px; }
svg.ic.chev { width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
.nav { align-items: center; }
.nav .nav-ic { display: inline-flex; align-items: center; gap: 7px; }
.nav-drop { position: relative; }
.nav-drop > button { border: 0; background: transparent; font: inherit; color: var(--muted); font-weight: 550; padding: 8px 10px;
  border-radius: 10px; cursor: pointer; font-size: .86rem; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.nav-drop > button:hover, .nav-drop.open > button { background: var(--surface-3); color: var(--text); }
.nav-drop > button.active { background: var(--primary-soft); color: var(--primary-2); }
.nav-drop.open > button svg.chev { transform: rotate(180deg); }
.drop-menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px; max-width: 380px; z-index: 80;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; }
.drop-menu.right { left: auto; right: 0; }
.nav-drop.open > .drop-menu { display: block; animation: popIn .15s ease-out; }
.drop-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px 10px; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.drop-title { padding: 10px 10px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.drop-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; border: 0;
  background: transparent; font: inherit; font-size: .88rem; color: var(--text); text-decoration: none; cursor: pointer; }
.drop-item:hover { background: var(--surface-3); }
.drop-item.current, .drop-item.checked { background: var(--primary-soft); color: var(--primary-2); font-weight: 600; }
.drop-item.checked::after { content: "✓"; margin-left: auto; }
.drop-item[hidden] { display: none; }
.drop-item .di-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-item .di-meta { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.drop-item.more { border-top: 1px dashed var(--border); border-radius: 0 0 9px 9px; margin-top: 4px; color: var(--primary); }
.drop-note { font-size: .76rem; color: var(--muted); border-top: 1px solid var(--border); margin: 8px 0 0; padding: 10px 10px 4px; }
.drop-user { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.drop-user span { font-size: .8rem; color: var(--primary-2); }
.drop-search { margin: 0 0 6px; padding: 7px 10px !important; font-size: .85rem; }
.drop-scroll { max-height: 360px; overflow: auto; }
.swatch { display: inline-flex; border-radius: 4px; overflow: hidden; flex: none; }
.swatch i { width: 9px; height: 16px; display: block; }
.nav .btn-new, .btn-new { width: 56px; height: 30px; padding: 0; border-radius: 9px; display: grid; place-items: center; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, #19a866, #12945a); box-shadow: 0 3px 10px rgba(18, 148, 90, .35); transition: box-shadow .2s, filter .2s; }
.nav .btn-new:hover, .btn-new:hover { color: #fff; background: linear-gradient(180deg, #1bb56e, #12945a); box-shadow: 0 4px 14px rgba(18, 148, 90, .5); }
.btn-new svg.ic { width: 18px; height: 18px; color: #fff; vertical-align: 0; transition: transform .25s; }
.btn-new:hover svg.ic { transform: rotate(90deg); }
.btn.new-square { width: 72px; height: 42px; padding: 0; justify-content: center; border-radius: 12px; background: linear-gradient(180deg, #19a866, #12945a);
  border-color: #0e7d4b; color: #fff; box-shadow: 0 4px 12px rgba(18, 148, 90, .3); text-decoration: none; flex: none; }
.btn.new-square:hover { background: linear-gradient(180deg, #1bb56e, #12945a); border-color: #0e7d4b; color: #fff; box-shadow: 0 5px 16px rgba(18, 148, 90, .45); }
.btn.new-square svg.ic { width: 22px; height: 22px; color: #fff; vertical-align: 0; transition: transform .25s; }
.btn.new-square:hover svg.ic { transform: rotate(90deg); }
.dot-st { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: #94a3b8; }
.dot-st.st-open { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .dot-st.st-draft { background: var(--violet); }
.dot-st.st-scheduled { background: var(--primary); } .dot-st.st-closed { background: #94a3b8; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.icon-btn:hover, .icon-btn.active { background: var(--surface-3); color: var(--text); }
.icon-btn .badge-count { position: absolute; top: 1px; right: -2px; margin: 0; }
.nav-drop > button.theme-btn { gap: 6px; border: 1px solid var(--border-strong); background: var(--field); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-weight: 600; }
.nav-drop > button.avatar-btn { padding: 2px; border-radius: 50%; }
.user-box { gap: 6px; }

/* Animations au survol */
.ic-gauge .needle { transform-origin: 12px 15.5px; transform: rotate(-55deg); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.ic-gauge.active .needle { transform: rotate(35deg); }
.ic-gauge:hover .needle { animation: needle 1.1s cubic-bezier(.4, 0, .3, 1) forwards; }
@keyframes needle { 0% { transform: rotate(-55deg); } 45% { transform: rotate(70deg); } 65% { transform: rotate(40deg); } 80% { transform: rotate(58deg); } 100% { transform: rotate(50deg); } }
.ic-gears .g1, .ic-gears .g2 { transform-box: fill-box; transform-origin: center; }
.ic-gears:hover .g1 { animation: spin 3s linear infinite; }
.ic-gears:hover .g2 { animation: spin 1.96s linear infinite reverse; }
.ic-flag:hover svg.ic:first-child { animation: wave .6s ease-in-out 2; transform-origin: 20% 90%; }
.ic-users:hover svg.ic, .ic-building:hover svg.ic, .ic-home:hover svg.ic, .ic-chat:hover svg.ic { animation: hop .45s ease; }
.ic-bell:hover svg.ic { animation: ring .6s ease; transform-origin: 50% 10%; }
.ic-bolt:hover svg.ic, .ic-meter:hover svg.ic { animation: zap .5s ease; }
.ic-chart .bar1, .ic-chart .bar2, .ic-chart .bar3 { transform-box: fill-box; transform-origin: bottom; }
.ic-chart:hover .bar1 { animation: grow .5s ease; } .ic-chart:hover .bar2 { animation: grow .5s .08s ease both; } .ic-chart:hover .bar3 { animation: grow .5s .16s ease both; }
.ic-mail:hover svg.ic, .ic-clip:hover svg.ic { animation: tilt .5s ease; }
.ic-sliders .k1, .ic-sliders .k2 { transition: transform .35s ease; }
.ic-sliders:hover .k1 { transform: translateX(-5px); } .ic-sliders:hover .k2 { transform: translateX(5px); }
@keyframes wave { 50% { transform: rotate(-12deg); } }
@keyframes hop { 40% { transform: translateY(-3px); } }
@keyframes ring { 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@keyframes zap { 30% { transform: scale(1.18); } }
@keyframes grow { from { transform: scaleY(.15); } }
@keyframes tilt { 30% { transform: rotate(-8deg); } 70% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { svg.ic * , svg.ic { animation: none !important; transition: none !important; } }

/* Sous-menu de campagne : toujours visible, avec flou du contenu qui défile dessous */
.subnav { border-top: 1px solid var(--border); background: var(--subnav-bg); }
.subnav-inner { max-width: 1520px; margin: 0 auto; padding: 6px 24px; display: flex; gap: 2px; align-items: center; overflow-x: auto; scrollbar-width: thin; }
.subnav a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px; text-decoration: none; color: var(--muted);
  font-weight: 550; font-size: .84rem; white-space: nowrap; }
.subnav a:hover { background: var(--surface-3); color: var(--text); }
.subnav a.active { background: var(--surface); color: var(--primary-2); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.subnav a .badge-count { margin-left: 2px; }
.subnav .sub-camp { font-weight: 700; color: var(--text); margin-right: 10px; padding-right: 14px; border-right: 1px solid var(--border);
  border-radius: 9px 0 0 9px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.subnav .sub-camp:hover { background: transparent; color: var(--primary); }

/* =====================================================================
   Jauge de vérification, statuts de vérification, tickets
   ===================================================================== */
.gauge { position: relative; width: 150px; height: 92px; flex: none; }
.gauge svg { width: 150px; height: 84px; overflow: visible; }
.gauge .g-track { stroke: var(--surface-3); }
.gauge .g-value { stroke: var(--st-valide); transition: stroke-dashoffset 1.1s cubic-bezier(.3, .9, .3, 1); }
.gauge .g-num { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 1.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge .g-num small { display: block; font-size: .7rem; font-weight: 500; color: var(--muted); margin-top: 3px; }
.verif-card { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.verif-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.rv { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap;
  border: 1px solid transparent; cursor: default; user-select: none; }
.rv::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rv.en_cours { color: var(--st-cours); background: color-mix(in srgb, var(--st-cours) 12%, transparent); }
.rv.valide { color: var(--st-valide); background: color-mix(in srgb, var(--st-valide) 13%, transparent); }
.rv.en_attente { color: var(--st-attente); background: color-mix(in srgb, var(--st-attente) 14%, transparent); }
.rv.a_retirer { color: var(--muted); background: var(--surface-3); text-decoration: line-through; }
.rv.cyclable { cursor: pointer; border-color: color-mix(in srgb, currentColor 30%, transparent); }
.rv.cyclable:hover { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.tk-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong); background: var(--field); color: var(--muted);
  border-radius: 8px; padding: 2px 7px; font: inherit; font-size: .75rem; cursor: pointer; }
.tk-btn.has { color: var(--st-attente); border-color: color-mix(in srgb, var(--st-attente) 45%, transparent); font-weight: 700; }
.tk-btn svg.ic { width: 14px; height: 14px; }
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.ticket.open { border-left: 4px solid var(--st-attente); }
.ticket.answered { border-left: 4px solid var(--st-cours); }
.ticket.closed { opacity: .78; }
.ticket-head { display: flex; gap: 10px; align-items: center; padding: 11px 14px; cursor: pointer; flex-wrap: wrap; }
.ticket-head:hover { background: var(--surface-2); }
.ticket-head .t-subject { font-weight: 650; flex: 1; min-width: 180px; }
.ticket-head .unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--err); flex: none; }
.ticket-body { border-top: 1px solid var(--border); padding: 12px 14px 14px; background: var(--surface-2); }
.msg-thread { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 380px; overflow: auto; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; font-size: .88rem; box-shadow: var(--shadow-xs); }
.msg.staff { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.member { background: var(--primary-soft); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg .meta { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 3px; }
.change-table { width: 100%; font-size: .84rem; border-collapse: collapse; margin: 6px 0 10px; }
.change-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.change-table del { color: var(--err); } .change-table ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.reply-row { display: flex; gap: 8px; align-items: flex-end; }
.reply-row textarea { min-height: 44px; height: 44px; flex: 1; }
.invite-card { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 2px dashed var(--primary);
  background: var(--primary-soft); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.campaign-tabs a.declined { opacity: .6; }
.campaign-tabs a.invited { border-style: dashed; border-color: var(--primary); }

/* Tableaux éditables (gestion) */
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); margin-bottom: 12px; }
.bulk-bar[hidden] { display: none; }
.bulk-bar select, .bulk-bar input { width: auto; padding: 6px 10px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips button { border: 1px solid var(--border-strong); background: var(--field); color: var(--muted); border-radius: 999px; padding: 4px 11px;
  font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.filter-chips button.on { background: var(--primary-soft); color: var(--primary-2); border-color: var(--primary); }
.camp-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.camp-filters input { width: 280px; }
.meter-form { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; min-height: 420px; }
.meter-form .mf-list { border: 1px solid var(--border); border-radius: 12px; overflow: auto; max-height: 64vh; background: var(--surface-2); }
.meter-form .mf-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 9px 12px; border: 0;
  border-bottom: 1px solid var(--border); background: transparent; font: inherit; font-size: .85rem; color: var(--text); cursor: pointer; }
.meter-form .mf-list button.on { background: var(--primary-soft); }
.meter-form .mf-list button small { color: var(--muted); font-size: .74rem; }
.meter-form .mf-list button.err { box-shadow: inset 3px 0 0 var(--err); }
.meter-form .mf-panel { border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: var(--surface); }
.meter-form .mf-panel .field.err input, .meter-form .mf-panel .field.err select { border-color: var(--err); background: var(--err-soft); }
.meter-form .mf-panel .err-msg { color: var(--err); font-size: .78rem; }
.meter-form[hidden] { display: none; }
@media (max-width: 900px) { .meter-form { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }
.input-icon { position: relative; display: inline-flex; align-items: center; }
.input-icon svg.ic { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 34px !important; }
html[data-theme="dark"] .topbar { border-bottom-color: var(--border); }
table.list.compact th, table.list.compact td { padding: 7px 10px; font-size: .86rem; }
table.list.compact th { width: 40%; text-transform: none; letter-spacing: 0; font-size: .8rem; position: static; }
.tpl-item { border-bottom: 1px solid var(--border); padding: 10px 0; }
.grid-3.align-stretch { align-items: stretch; }

/* Cartes des campagnes (widget du tableau de bord) : la carte s'adapte à sa propre largeur, les chiffres ne débordent plus */
.dash-camps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.dash-camp { container-type: inline-size; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; gap: 6px; }
.dash-camp:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-camp h2 { margin: 4px 0 0; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.dash-camp .cc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dash-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dash-row .tile-stats { flex: 1; min-width: 0; margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dash-row .tile-stats > div { padding: 8px 4px; min-width: 0; }
.dash-row .tile-stats b { font-size: clamp(.95rem, 5cqi, 1.3rem); line-height: 1.15; overflow-wrap: anywhere; }
.dash-row .tile-stats b small { font-size: .62em; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dash-row .tile-stats span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-foot { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.mini-gauge { --p: 0; width: 78px; height: 78px; border-radius: 50%; flex: none; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 72%, transparent 73% 100%), conic-gradient(var(--st-valide) calc(var(--p) * 1%), var(--surface-3) 0); }
.mini-gauge span { font-weight: 700; font-size: 1rem; line-height: 1; }
.mini-gauge small { font-size: .65rem; color: var(--muted); }
@container (max-width: 330px) {
  .dash-row { flex-direction: column; align-items: stretch; }
  .dash-row .mini-gauge { align-self: center; }
}

/* Tableau de bord personnalisable : grille libre de 12 colonnes × lignes de 40 px */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 40px; gap: 16px; position: relative; grid-auto-flow: row; }
.dash-grid:not(.free) { grid-auto-flow: row dense; }
.dw { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; container-type: inline-size; }
.dw-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; flex: none; }
.dw-head h2 { margin: 0; font-size: 1rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-head .dash-camp-sel { width: auto; max-width: 48%; padding: 4px 8px; font-size: .8rem; }
.dw-body { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.dw-body > div { height: 100%; }
.dw-chart .dw-body { overflow: hidden; }
.chart-box.fill { height: 100%; min-height: 0; }
/* widget « Campagnes en cours (cartes) » : sans cadre propre, les cartes font office de cadres */
.dw[data-type="camps"] { background: transparent; border: 0; box-shadow: none; padding: 0; }
.dw[data-type="camps"] .dw-body { padding: 2px 4px 6px 2px; margin: -2px -4px -6px -2px; }
.dw[data-type="camps"] .dash-camps { height: auto; }
/* indicateurs : la tuile elle-même ; texte réduit quand la tuile est étroite */
.dw-kpi { padding: 0; background: transparent; border: 0; box-shadow: none; }
.dw-kpi .dw-body { overflow: hidden; }
.dw-kpi .kpi { height: 100%; overflow: hidden; }
@container (max-width: 190px) {
  .dw-kpi .kpi { padding: 12px; }
  .dw-kpi .kpi .value { font-size: 1.35rem; }
  .dw-kpi .kpi .icon { width: 28px; height: 28px; font-size: 13px; }
  .dw-kpi .kpi .label { font-size: .68rem; }
}
.dash-editbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -6px 0 18px; padding: 10px 14px; border-radius: 12px;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); position: sticky; top: calc(var(--stick, 64px) + 10px); z-index: 20; }
.dash-editbar .grow { flex: 1; }
.dash-editbar select { width: auto; max-width: 260px; padding: 6px 10px; font-size: .85rem; }
/* mode personnalisation : repères de colonnes et de lignes, poignées, fantôme du déplacement */
.dash-grid .col-guides { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; pointer-events: none; z-index: 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0 40px, color-mix(in srgb, var(--primary) 14%, transparent) 40px 56px); }
.dash-grid .col-guides i { background: color-mix(in srgb, var(--primary) 5%, transparent); border-inline: 1px dashed color-mix(in srgb, var(--primary) 28%, transparent); border-radius: 6px; }
.dash-grid.editing .dw { z-index: 1; outline: 1px dashed color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }
.dash-grid.editing .dw-kpi, .dash-grid.editing .dw[data-type="camps"] { background: var(--surface); border: 1px solid var(--border); padding: 10px 12px; }
.dash-grid.editing .dw-head { cursor: grab; user-select: none; touch-action: none; }
.dash-grid.editing .dw-body { pointer-events: none; }
.dw-head .grip { color: var(--primary); font-size: 16px; line-height: 1; }
.w-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.w-tools .icon-btn { width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; font-size: .85rem; }
.w-tools .icon-btn.danger:hover { background: var(--err-soft, #fde8e8); color: var(--err, #d23b3b); }
.w-span { font-family: ui-monospace, Consolas, monospace; font-size: .72rem; color: var(--primary-2); }
.dw.placeholder { opacity: .35; outline: 2px dashed var(--primary) !important; }
.dw.ghost { position: fixed; z-index: 100; pointer-events: none; opacity: .92; box-shadow: 0 18px 40px rgba(0, 0, 0, .25); overflow: hidden; transform: rotate(.6deg); }
.dw.resizing { outline: 2px solid var(--primary) !important; }
.w-rs { position: absolute; z-index: 4; touch-action: none; display: grid; place-items: center; }
.rs-n, .rs-s { left: 18px; right: 18px; height: 10px; cursor: ns-resize; }
.rs-n { top: -2px; } .rs-s { bottom: -2px; }
.rs-e, .rs-w { top: 18px; bottom: 18px; width: 10px; cursor: ew-resize; }
.rs-e { right: -2px; } .rs-w { left: -2px; }
.rs-ne, .rs-nw, .rs-se, .rs-sw { width: 18px; height: 18px; }
.rs-nw { top: -2px; left: -2px; cursor: nwse-resize; } .rs-se { bottom: -2px; right: -2px; cursor: nwse-resize; }
.rs-ne { top: -2px; right: -2px; cursor: nesw-resize; } .rs-sw { bottom: -2px; left: -2px; cursor: nesw-resize; }
.rs-n::after, .rs-s::after { content: ""; height: 4px; width: 44px; border-radius: 2px; background: var(--primary); opacity: .5; }
.rs-e::after, .rs-w::after { content: ""; width: 4px; height: 44px; border-radius: 2px; background: var(--primary); opacity: .5; }
.rs-ne::after, .rs-nw::after, .rs-se::after, .rs-sw::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: .55; }
.w-rs:hover::after, .dw.resizing .w-rs::after { opacity: 1; }
.dash-grid:not(.free) :is(.rs-e, .rs-w, .rs-ne, .rs-nw, .rs-se, .rs-sw, .rs-n) { display: none; }

.form-name { display: flex; align-items: center; gap: 14px; }
.form-name input { max-width: 520px; font-weight: 600; }

/* Ligne de modification groupée, alignée sur les colonnes du tableau */
.bulk-row { position: relative; height: 46px; overflow: clip; margin-bottom: 6px; border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 10px; background: var(--primary-soft); }
.bulk-cell { position: absolute; top: 0; bottom: 0; padding: 6px 4px; box-sizing: border-box; display: flex; align-items: center; }
.bulk-cell.frozen { z-index: 2; background: var(--primary-soft); }
.bulk-cell input, .bulk-cell select { width: 100%; height: 32px; padding: 4px 22px 4px 7px; font-size: .8rem; border-radius: 7px; }
.bulk-cell select[data-bstatus] { padding-right: 7px; }
.bulk-pen { width: 100%; text-align: center; color: var(--primary); font-size: 1rem; }
.bulk-clear { position: absolute; top: 3px; right: 1px; width: 15px; height: 15px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: #9aa4b5; color: #fff; font-size: 11px; line-height: 15px; font-weight: 700; display: grid; place-items: center; z-index: 1; }
.bulk-cell:focus-within .bulk-clear, .bulk-cell.clearing .bulk-clear { background: var(--err); }
.bulk-cell.clearing input, .bulk-cell.clearing select { border-color: var(--err); box-shadow: 0 0 0 2px color-mix(in srgb, var(--err) 25%, transparent);
  background: var(--err-soft); }

/* --- Clients : sélecteur, thème de la barre de menu, page Clients et thèmes --------------------------------- */
html { --page-text: var(--text); --page-muted: var(--muted); --page-surface-3: var(--surface-3); }
html.ct-topbar .topbar-inner { --text: var(--top-text); --muted: var(--top-muted); --surface-3: var(--top-hover); }
html.ct-topbar .topbar-inner .drop-menu { --text: var(--page-text); --muted: var(--page-muted); --surface-3: var(--page-surface-3); }
.client-logo { height: 30px; max-width: 120px; object-fit: contain; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--border); }
.client-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 5px; border: 1px solid var(--border); border-radius: 12px;
  background: transparent; color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; max-width: 240px; }
.client-btn:hover, .nav-drop.open > .client-btn { background: var(--surface-3); }
.client-btn.static { cursor: default; }
.client-btn .cl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-ava { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--primary-soft);
  color: var(--primary-2); font-size: .7rem; font-weight: 700; }
.cl-ava img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cl-ava.all svg.ic { width: 16px; height: 16px; }
.cl-ava.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.2rem; }
.client-menu { min-width: 330px; }
.client-menu .drop-head a { text-transform: none; letter-spacing: 0; font-weight: 600; }
.client-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.client-chip .cl-ava { width: 20px; height: 20px; border-radius: 6px; font-size: .55rem; }

.cl-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.cl-list { position: sticky; top: calc(var(--stick, 64px) + 20px); padding: 10px; }
.cl-list .drop-item { padding: 8px; }
.cl-list .drop-item.current { outline: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.cl-list .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.cl-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.cl-head h2 { margin: 0; }
.cl-head .client-logo { height: 40px; }
.theme-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.theme-col { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.theme-col h3 { margin: 0 0 8px; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.color-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--border); }
.color-row:first-of-type { border-top: 0; }
.color-row input[type=color] { width: 38px; height: 30px; padding: 2px; border-radius: 8px; cursor: pointer; }
.color-row .lbl { line-height: 1.25; }
.color-row .lbl small { display: block; color: var(--muted); font-size: .74rem; }
.color-row.default input[type=color] { opacity: .45; }
.color-row .ratio { font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.color-row .ratio.bad { color: var(--err); font-weight: 700; }
.color-row .reset { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .95rem; padding: 2px 4px; border-radius: 6px; }
.color-row .reset:hover { background: var(--surface-3); color: var(--text); }
.color-row.default .reset { visibility: hidden; }
.img-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
@media (max-width: 900px) { .cl-layout, .theme-grid { grid-template-columns: minmax(0, 1fr); } .cl-list { position: static; } }

/* --- Banque d'images (reprise de FOX) --------------------------------------------------------------------- */
dialog.dlg { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--text); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .08); }
dialog.dlg::backdrop { background: rgba(10, 14, 20, .42); }
.dlg-form { display: grid; gap: 14px; padding: 18px 20px 20px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-form .hint { margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.spacer { flex: 1; }
dialog.ib-pick { width: min(760px, calc(100vw - 32px)); }
.ib-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ib-tools .ib-search { width: min(280px, 100%); }
.ib-tools select { width: auto; }
.ib-up { cursor: pointer; }
.ib-note { display: block; font-size: .8rem; color: var(--muted); margin: 6px 0 10px; }
.ib-note.bad { color: var(--err); }
.ib-body { max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; display: grid; gap: 6px; align-content: start; }
#image-bank .ib-body { max-height: 70vh; }
.ib-body h3 { margin: 8px 0 2px; font-size: 13px; }
.ib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px 8px; }
.ib-item { display: grid; grid-template-rows: auto 17px; gap: 3px; min-width: 0; }
.ib-tile { position: relative; padding: 0; border: 2px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; aspect-ratio: 1; overflow: hidden; contain: paint; }
.ib-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ib-tile:hover { border-color: var(--border-strong); }
.ib-tile.on { border-color: var(--primary); }
.ib-name { font-size: 11px; line-height: 1.25; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 0; background: transparent; padding: 1px 2px; border-radius: 5px; font-family: inherit; width: 100%; box-shadow: none; }
button.ib-name { cursor: text; }
button.ib-name:hover { background: var(--surface-3); color: var(--text); }
input.ib-name { border: 1px solid var(--primary); background: var(--surface); color: var(--text); box-shadow: var(--ring); height: auto; }
.ib-count { font-size: 12px; }
.ib-tag { position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; background: rgba(0, 0, 0, .55); color: #fff; }
.ib-del { position: absolute; right: 4px; top: 4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transition: opacity .12s; }
.ib-tile:hover .ib-del, .ib-del:focus, .ib-del.confirm { opacity: 1; }
.ib-del.confirm { background: var(--err); }
dialog.ib-crop { width: min(620px, calc(100vw - 32px)); }
.ib-crop-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ib-stage { position: relative; overflow: hidden; border-radius: 8px; background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px;
  touch-action: none; user-select: none; }
.ib-stage img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ib-sq { position: absolute; cursor: move; box-shadow: 0 0 0 9999px rgba(10, 14, 20, .55); outline: 2px solid #fff; }
.ib-sq:focus-visible { outline: 3px solid var(--primary); }
.ib-circle { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .95); box-shadow: 0 0 0 9999px rgba(255, 255, 255, .28); clip-path: inset(0); }
.ib-prev { display: grid; justify-items: center; gap: 4px; }
.ib-prev canvas { width: 96px; height: 96px; border-radius: 50%; box-shadow: var(--shadow-md); background: var(--surface-3); }
.ib-zoom { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.ib-zoom input { flex: 1; accent-color: var(--primary); }
/* Barre de chargement des images : visible dès le choix des fichiers, estompée une fois terminée */
.ib-progress { display: grid; gap: 4px; margin: 6px 0 8px; transition: opacity 1.2s ease, transform 1.2s ease; }
.ib-progress.fade { opacity: 0; transform: translateY(-4px); }
.ib-progress-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ib-progress-track i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .25s ease;
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 70%, #fff), var(--primary)); }
.ib-progress span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-progress.bad .ib-progress-track i { background: var(--err); }
.img-row .ib-progress { flex-basis: 100%; order: 10; }

/* =====================================================================
   Menu vertical des gestionnaires : rail d'icônes ; un menu à sous-menus ouvre une 2e barre (une campagne, une 3e)
   qui sort de derrière le rail, alignée sur l'icône parente, sur la couleur principale du thème. Tiroir sur mobile.
   ===================================================================== */
html { --side-w: 76px; --fly-w: 252px; --fly-pad: 0px; }
body.with-sidebar { padding-left: calc(var(--side-w) + var(--fly-pad)); }
/* le contenu ne se décale en douceur qu'une fois la page affichée (pas d'effet vers la droite au changement de page) */
html.sb-ready body.with-sidebar { transition: padding-left .3s cubic-bezier(.2, .8, .2, 1); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 60; display: flex; flex-direction: column; align-items: center;
  padding: 22px 0 18px; background: var(--side-bg, var(--surface)); border-right: 1px solid var(--border); transition: transform .25s; }
.sb-top { display: flex; flex-direction: column; align-items: center; }
.sb-head .brand { display: block; }
.sb-head .brand-mark { width: 40px; height: 40px; border-radius: 50%; box-shadow: none; }
.sb-label { display: none; }

.sb-nav { margin-top: 44px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sb-link, .sb-back { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px;
  background: transparent; color: var(--muted); text-decoration: none; cursor: pointer; font: inherit; padding: 0; transition: background .15s, color .15s; }
.sb-link svg.ic, .sb-back svg.ic { width: 22px; height: 22px; vertical-align: 0; }
.sb-link svg.ic.big { width: 24px; height: 24px; }
.sb-link:hover, .sb-back:hover { background: var(--surface-3); color: var(--text); }
.sb-link.active, .sb-link.in-path, .sb-nav .sb-link.open { background: var(--primary-soft); color: var(--primary-2); }
.sb-link .badge-count { position: absolute; top: 2px; right: 0; margin: 0; }
/* petite flèche : ce menu ouvre une barre de sous-menus */
.sb-more-dot { position: absolute; right: 3px; top: 50%; width: 5px; height: 5px; border: solid currentColor; border-width: 2px 2px 0 0;
  transform: translateY(-50%) rotate(45deg); opacity: .45; transition: transform .25s, opacity .25s; }
.sb-link.open .sb-more-dot { opacity: .9; transform: translateY(-50%) rotate(45deg) translate(1px, -1px); }

/* Barres secondaires et onglet du menu ouvert : un même calque au-dessus du rail, dont l'ombre légère suit le contour commun.
   Le calque ne fait aucune taille : ses éléments fixes se placent sur la fenêtre. */
.sb-flies { position: fixed; top: 0; left: 0; width: 0; height: 0; z-index: 61;
  filter: drop-shadow(-2px 0 5px rgba(15, 27, 45, .16)) drop-shadow(3px 6px 12px rgba(15, 27, 45, .12)); }
[data-theme="dark"] .sb-flies { filter: drop-shadow(-2px 0 6px rgba(0, 0, 0, .45)) drop-shadow(3px 6px 14px rgba(0, 0, 0, .35)); }
/* barre : sur la couleur principale, libellés à côté des icônes ; une ligne survolée passe sur une version claire de la couleur,
   la page affichée sur une version foncée. Elle se déroule depuis le rail, son contenu glisse avec elle */
.sb-fly { position: fixed; top: 80px; left: var(--side-w); width: var(--fly-w); max-height: calc(100vh - 20px); overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 10px 14px; border-radius: 0 0 16px 0;
  --fly-bg: var(--primary); --fly-ink: var(--primary-ink);
  --fly-hover: color-mix(in srgb, var(--primary) 14%, #fff); --fly-hover-ink: color-mix(in srgb, var(--primary) 70%, #000);
  --fly-active: color-mix(in srgb, var(--primary) 70%, #000);
  background: var(--fly-bg); color: var(--fly-ink);
  clip-path: inset(0 100% 0 0); transition: clip-path .3s cubic-bezier(.2, .8, .2, 1), opacity .15s; }
/* survol d'un autre menu du rail : barre et onglet s'effacent le temps du survol */
.sb-flies.peek-off .sb-fly, .sb-flies.peek-off .sb-tab { opacity: 0; pointer-events: none; }
.sb-tab { transition: opacity .15s; }
.sb-fly > * { transition: translate .3s cubic-bezier(.2, .8, .2, 1); }
.sb-fly:not(.on) > * { translate: -28px 0; }
.sb-fly[hidden] { display: none; }
.sb-fly.on { clip-path: inset(0 0 0 0); }
.sb-fly.no-anim, .sb-fly.no-anim > * { transition: none; }
/* onglet : l'icône du menu ouvert, prolongée jusqu'à sa barre, avec des congés arrondis sur le fond du rail */
.sb-tab { --r: 10px; --fly-bg: var(--primary); position: fixed; display: flex; align-items: center;
  border-radius: 12px 0 0 12px; cursor: pointer; background: var(--fly-bg); color: var(--primary-ink); }
/* l'onglet n'apparaît en fondu que pour une ouverture faite sur la page : au chargement il est là tout de suite (pas de clignotement) */
.sb-tab.fade-in { animation: tab-in .2s ease both; }
/* avant le script, l'icône du menu de la page a déjà la couleur de son onglet */
@media (min-width: 901px) { html:not(.sb-ready) .sb-nav .sb-link.in-path[data-open] { background: var(--primary); color: var(--primary-ink); } }
/* la flèche du menu reste visible sur l'onglet */
.sb-tab .sb-more-dot { opacity: .9; }
.sb-tab .pi { position: relative; flex: none; width: var(--iw); height: 100%; display: grid; place-items: center; }
.sb-tab svg.ic { width: 22px; height: 22px; }
.sb-tab svg.ic.big { width: 24px; height: 24px; }
.sb-tab .badge-count { position: absolute; top: 2px; right: 0; margin: 0; }
.sb-tab::before, .sb-tab::after { content: ""; position: absolute; right: 0; width: var(--r); height: var(--r); pointer-events: none; }
.sb-tab::before { bottom: 100%; background: radial-gradient(circle at 0 0, transparent calc(var(--r) - .5px), var(--fly-bg) var(--r)); }
.sb-tab::after { top: 100%; background: radial-gradient(circle at 0 100%, transparent calc(var(--r) - .5px), var(--fly-bg) var(--r)); }
@keyframes tab-in { from { opacity: 0; } }
/* lignes de la barre : icône + libellé */
.sb-fly .sb-back { display: none; }
.sb-fly .sb-link { display: flex; align-items: center; gap: 10px; width: auto; height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--fly-ink); font-size: .875rem; font-weight: 550; text-align: left; }
.sb-fly .sb-link > svg.ic { flex: none; width: 20px; height: 20px; opacity: .8; }
.sb-fly .sb-label { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.sb-fly .sb-label small { display: block; font-size: .72rem; font-weight: 500; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
/* campagne dépliée ou en cours : fond un peu plus clair que la barre */
.sb-fly .sb-link.open, .sb-fly .sb-link.in-path { background: color-mix(in srgb, var(--fly-ink) 16%, transparent); font-weight: 650; }
/* page affichée : version foncée de la couleur, trait clair à gauche */
.sb-fly .sb-link.active { background: var(--fly-active); color: var(--fly-ink); font-weight: 650; }
.sb-fly .sb-link.active > svg.ic { opacity: 1; }
.sb-fly .sb-link.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--fly-ink); }
/* survol : version claire de la couleur, texte foncé */
.sb-fly .sb-link:hover { background: var(--fly-hover); color: var(--fly-hover-ink); }
.sb-fly .sb-link:hover > svg.ic { opacity: 1; }
.sb-fly .badge-count { position: static; margin-left: auto; box-shadow: none; }
/* titre du menu, en haut de la barre */
.sb-ptitle { display: block; padding: 6px 10px 10px; margin: 0 0 6px; border-bottom: 1px solid color-mix(in srgb, var(--primary-ink) 25%, transparent); font-size: .72rem; font-weight: 750;
  letter-spacing: .07em; text-transform: uppercase; color: color-mix(in srgb, var(--primary-ink) 80%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* séparateurs entre « toutes », la liste et « nouvelle » */
.sb-fly .sb-sep { height: 1px; margin: 6px 10px; background: color-mix(in srgb, var(--fly-ink) 25%, transparent); flex: none; }
/* 2e niveau (pages d'une campagne) : se déplie sous la campagne, en retrait, relié à elle par un trait */
.sb-sub { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 1px; padding: 0 0 0 22px; margin-left: 12px;
  overflow: hidden; max-height: 0; opacity: 0; transition: max-height .3s cubic-bezier(.2, .8, .2, 1), opacity .25s, padding .3s; }
/* le trait s'arrête au crochet de la dernière page : marge du bas + demi-hauteur d'une ligne */
.sb-sub { --sub-pb: 6px; --sub-h: 34px; }
.sb-sub::before { content: ""; position: absolute; left: 0; top: 2px; bottom: calc(var(--sub-pb) + var(--sub-h) / 2 - 1px); width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--fly-ink) 35%, transparent); }
.sb-sub[hidden] { display: none; }
.sb-sub.on { max-height: 640px; opacity: 1; padding-top: 4px; padding-bottom: var(--sub-pb); }
.sb-sub.no-anim { transition: none; }
.sb-fly .sb-sub .sb-link { height: var(--sub-h); font-size: .83rem; font-weight: 500; }
.sb-fly .sb-sub .sb-link > svg.ic { width: 17px; height: 17px; }
/* petit crochet du trait vers chaque page */
.sb-sub .sb-link::after { content: ""; position: absolute; left: -22px; top: 50%; width: 12px; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--fly-ink) 35%, transparent); }
/* page sélectionnée : bordure blanche de 2 px qui suit l'arrondi du rectangle */
.sb-fly .sb-sub .sb-link.active { box-shadow: inset 2px 0 0 var(--fly-ink); }
.sb-fly .sb-sub .sb-link.active::before { content: none; }
/* page sélectionnée : son cran va jusqu'au rectangle et rejoint la bordure blanche, avec la même épaisseur (2 px) */
.sb-fly .sb-sub .sb-link.active::after { left: -22px; width: 22px; height: 2px; margin-top: -1px; border-radius: 2px 0 0 2px; background: var(--fly-ink); }
/* campagnes : initiales dans une pastille, et pastille de statut */
.sb-initials { font-size: .78rem; font-weight: 750; letter-spacing: .02em; }
.sb-fly .sb-initials { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-left: -3px; border-radius: 8px; font-size: .68rem;
  background: color-mix(in srgb, var(--fly-ink) 22%, transparent); }
.sb-fly .sb-link:hover .sb-initials { background: color-mix(in srgb, var(--primary) 22%, #fff); }
/* nom de campagne : sur 2 lignes au plus, le statut en dessous */
.sb-fly .sb-link.sb-camp { height: auto; min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
.sb-fly .sb-camp .sb-label { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-height: 1.25; }
.sb-camp .dot-st { position: absolute; left: 30px; top: 50%; translate: 0 -17px; margin: 0; width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--fly-bg, var(--primary)); }
.sb-fly .sb-link.sb-new:not(:hover) { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--fly-ink) 35%, transparent); }
.sb-link.sb-new svg { transition: transform .25s; }
.sb-link.sb-new:hover svg { transform: rotate(90deg); }

/* sur ordinateur : la barre part du haut de la page, son titre à la hauteur du logo */
@media (min-width: 901px) { .sb-fly { top: 0; padding-top: 30px; } }

/* Pastille : au survol (ou au clavier), l'icône s'allonge vers la droite avec son nom, sur la couleur principale */
.sb-pill { position: fixed; z-index: 62; display: flex; align-items: center; border-radius: 12px; white-space: nowrap; cursor: pointer;
  --pill-bg: var(--primary); background: var(--pill-bg); color: var(--primary-ink);
  box-shadow: 4px 6px 18px color-mix(in srgb, var(--primary) 30%, transparent); animation: pill-in .22s cubic-bezier(.2, .8, .2, 1) both; }
.sb-pill.hover { z-index: 63; animation-duration: .16s; }
/* icône du rail survolée pendant qu'une barre est ouverte : liseré clair + ombre, pour ne pas se fondre dans la barre */
.sb-pill.over-bar { box-shadow: 0 0 0 2px var(--surface), 0 10px 24px rgba(0, 0, 0, .3); }
.sb-pill .pi { position: relative; flex: none; width: var(--iw); height: 100%; display: grid; place-items: center; border-radius: 12px; }
.sb-pill svg.ic { width: 22px; height: 22px; vertical-align: 0; }
.sb-pill svg.ic.big { width: 24px; height: 24px; }
.sb-pill .badge-count { position: absolute; top: 2px; right: 0; margin: 0; box-shadow: 0 0 0 2px var(--pill-bg); }
.sb-pill .dot-st { position: absolute; right: 3px; bottom: 3px; margin: 0; width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--pill-bg); }
.sb-pill .pl { max-width: 230px; padding: 0 16px 0 4px; overflow: hidden; text-overflow: ellipsis; font-size: .86rem; font-weight: 650; line-height: 1.2; }
.sb-pill .pl small { display: block; font-size: .7rem; font-weight: 500; opacity: .8; overflow: hidden; text-overflow: ellipsis; }
@keyframes pill-in { from { clip-path: inset(0 calc(100% - var(--iw)) 0 0 round 12px); } to { clip-path: inset(0 0 0 0 round 12px); } }
@media (prefers-reduced-motion: reduce) { .sb-pill { animation: none; } }

/* Écran peu haut : icônes plus serrées */
@media (min-width: 901px) and (max-height: 760px) {
  .sb-nav { margin-top: 26px; gap: 8px; }
  .sb-client { margin-top: 18px !important; }
  .sb-fly .sb-link { height: 36px; }
  .sb-sub { --sub-h: 31px; }
}

/* Client affiché : tuile encadrée sous les icônes */
.sb-client { margin-top: 36px; }
.sidebar .client-btn { width: 44px; height: 44px; padding: 0; justify-content: center; border: 1.5px solid var(--primary); border-radius: 12px; background: var(--primary-soft); }
.sidebar .client-btn .cl-ava { width: 30px; height: 30px; background: transparent; }
.sidebar .client-btn .chev { display: none; }
.sidebar .client-drop .drop-menu { top: 0; left: calc(100% + 16px); }
.sidebar .client-menu { min-width: 300px; }

/* Pied : thème et compte */
.sb-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sb-foot .drop-menu { top: auto; bottom: 0; left: calc(100% + 16px); right: auto; max-height: calc(100vh - 24px); overflow-y: auto; }
.nav-drop > button.theme-btn.theme-btn { width: 44px; height: 44px; padding: 0; justify-content: center; border: 0; border-radius: 12px; background: transparent; color: var(--muted); }
.sb-foot .theme-btn svg.ic { width: 22px; height: 22px; }
.sb-foot .theme-btn:hover, .sb-foot .nav-drop.open > .theme-btn { background: var(--surface-3); color: var(--text); }
.sb-foot #theme-label { display: none; }
.sb-user { border: 0; background: transparent; cursor: pointer; padding: 0; border-radius: 50%; font: inherit; color: var(--text); text-align: left; }
.nav-drop > button.sb-user { padding: 2px; }

/* Couleur de barre de menu du client appliquée au rail (menus déroulants aux couleurs de la page) */
html.ct-topbar .sidebar { --side-bg: var(--topbar-bg); --text: var(--top-text); --muted: var(--top-muted); --surface-3: var(--top-hover); }
html.ct-topbar .sidebar .drop-menu { --text: var(--page-text); --muted: var(--page-muted); --surface-3: var(--page-surface-3); }

/* Sans en-tête fixe, les zones collantes remontent */
body.with-sidebar .fe-palette, body.with-sidebar .fe-preview, body.with-sidebar .cl-list { top: 20px; }

/* Changement de page : le contenu glisse vers le haut quand on descend dans le menu, vers le bas quand on remonte */
@media (prefers-reduced-motion: no-preference) {
  @keyframes pg-from-below { from { opacity: 0; transform: translateY(34px); } }
  @keyframes pg-from-above { from { opacity: 0; transform: translateY(-34px); } }
  @keyframes pg-fade { from { opacity: 0; } }
  html.pg-from-below body.with-sidebar > main { animation: pg-from-below .42s cubic-bezier(.2, .8, .2, 1) backwards; }
  html.pg-from-above body.with-sidebar > main { animation: pg-from-above .42s cubic-bezier(.2, .8, .2, 1) backwards; }
  html.pg-fade body.with-sidebar > main { animation: pg-fade .25s ease backwards; }
  body.with-sidebar > main { transition: transform .16s ease-in, opacity .16s ease-in; }
  html.pg-out-up body.with-sidebar > main { transform: translateY(-34px); opacity: 0; }
  html.pg-out-down body.with-sidebar > main { transform: translateY(34px); opacity: 0; }
}

/* Mobile : le menu devient un tiroir avec libellés ; une barre secondaire recouvre le tiroir, avec une flèche de retour */
.sb-mobilebar, .sb-backdrop { display: none; }
@media (max-width: 900px) {
  body.with-sidebar { padding-left: 0; }
  .sidebar { width: 280px; align-items: stretch; padding: 16px 12px; overflow-y: auto; transform: translateX(-100%); }
  html.sb-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  html.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 27, 45, .35); }
  .sb-top { align-items: flex-start; }
  .sb-head .brand { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
  .sb-head .brand .sb-label { display: block; }
  .sb-nav { margin-top: 18px; align-items: stretch; gap: 2px; }
  .sb-link, .sb-back { display: flex; align-items: center; width: auto; height: auto; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: .88rem;
    font-weight: 550; min-width: 0; text-align: left; }
  .sb-link svg.ic, .sb-link svg.ic.big, .sb-back svg.ic { width: 20px; height: 20px; }
  .sb-link .sb-label, .sb-back .sb-label { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sb-link .sb-label small { display: none; }
  .sb-link .badge-count { position: static; margin-left: auto; }
  .sb-more-dot, .sb-link.open .sb-more-dot { position: static; transform: rotate(45deg); flex: none; margin-right: 4px; }
  .sb-fly { inset: 0 auto 0 0 !important; width: 280px; max-height: none; z-index: 61; align-items: stretch; gap: 2px; padding: 16px 12px; border-radius: 0; }
  html:not(.sb-open) .sb-fly { display: none; }
  .sb-flies { position: static; width: auto; height: auto; filter: none !important; }
  .sb-tab { display: none; }
  .sb-fly .sb-back { display: flex; color: var(--fly-ink); }
  .sb-fly .sb-back:hover { background: var(--fly-hover); color: var(--fly-hover-ink); }
  .sb-client { margin-top: 18px; }
  .sidebar .client-btn { width: 100%; justify-content: flex-start; padding: 0 8px; gap: 8px; }
  .sidebar .client-btn .cl-name { display: block; }
  .sidebar .client-drop .drop-menu { top: calc(100% + 8px); left: 0; min-width: 0; width: 256px; }
  .sb-foot { margin-top: 18px; flex-direction: row; justify-content: space-between; }
  .sb-foot .drop-menu { left: 0; bottom: calc(100% + 8px); max-height: calc(100vh - 140px); width: 256px; }
  .sb-foot .user-drop .drop-menu { left: auto; right: 0; }
  .sb-mobilebar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 50; padding: 8px 12px;
    background: var(--topbar-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
  .sb-mobilebar .brand { font-size: .92rem; }
  .sb-mobilebar .brand-mark { width: 30px; height: 30px; border-radius: 50%; }
}
@media print { .sidebar, .sb-mobilebar, .sb-fly { display: none !important; } body.with-sidebar { padding-left: 0; } }

/* ---- Validation d'une inscription : encart du numéro d'adhérent ---- */
.approve-card { border: 2px solid var(--warn); background: linear-gradient(180deg, var(--warn-soft), var(--surface) 70%); scroll-margin-top: 20px; }
.approve-card .ap-head { display: flex; gap: 12px; align-items: flex-start; }
.approve-card .ap-ico { font-size: 1.6rem; line-height: 1; }
.approve-card h2 { margin: 0 0 2px; }
.approve-card .ap-body { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-start; margin: 14px 0 6px; }
.approve-card .ap-code { flex: 1 1 360px; margin: 0; }
.approve-card .ap-fmt { flex: 0 1 260px; margin: 0; }
.approve-card .ap-row { display: flex; gap: 8px; flex-wrap: wrap; }
.approve-card .ap-row input { flex: 1 1 200px; font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; padding: 10px 14px; height: auto; }
.approve-card .ap-row input[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 18%, transparent); }
.approve-card .ap-status { min-height: 1.4em; margin-top: 6px; font-size: .9rem; color: var(--muted); }
.approve-card .ap-status.ok { color: var(--ok); font-weight: 600; }
.approve-card .ap-status.bad { color: var(--err); font-weight: 600; }

/* ---- Format des numéros d'adhérent (clients) ---- */
.cf-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.cf-item { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cf-item .cf-type { font-weight: 600; min-width: 150px; }
.cf-item input, .cf-item select { width: auto; max-width: 200px; }
.cf-item .spacer { flex: 1; }
.cf-preview { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 1.05rem; }
fieldset.code-format { border: 0; padding: 0; margin: 14px 0 16px; min-width: 0; }
/* ---- Panneau client : sections séparées (image et logo / thème / format des numéros) ---- */
.cl-sec { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; }
.cl-sec-title { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cl-sec fieldset.code-format { margin: 0; }
.cl-foot { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ===================== Campagne : barre des étapes (essai — ancienne disposition : campaign_classic.html, ?vue=classique) ===================== */
.ctl-back { margin-bottom: 10px; }
.ctl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px 14px; margin-bottom: 20px; }
.ctl-top { display: flex; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; align-items: flex-start; }
.ctl-title { min-width: 0; flex: 1 1 380px; }
.ctl-title h1 { margin: 6px 0 4px; }
.ctl-title p { margin: 0 0 2px; }
.ctl-status { background: var(--primary-soft); color: var(--primary-2); }
.st-open .ctl-status { background: var(--ok-soft); color: var(--ok); }
.st-closed .ctl-status { background: var(--surface-3); color: var(--muted); }
.st-draft .ctl-status, .st-scheduled .ctl-status { background: var(--violet-soft); color: var(--violet); }
.ctl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ctl-score { text-align: right; min-width: 220px; }
.ctl-score b { display: block; font-size: 1.9rem; line-height: 1; }
.ctl-score span { font-size: .82rem; color: var(--muted); }
.ctl-score .progress { margin-top: 6px; }

.ctl-tabs, .ctl-mini-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ctl-tabs { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.ctl-tabs a, .ctl-mini-tabs a { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 10px; font-weight: 600; font-size: .86rem;
  color: var(--muted); text-decoration: none; white-space: nowrap; }
.ctl-tabs a:hover, .ctl-mini-tabs a:hover { background: var(--surface-3); color: var(--text); }
.ctl-tabs a.active, .ctl-mini-tabs a.active { background: var(--primary-soft); color: var(--primary-2); }
.ctl-tabs .n, .ctl-mini-tabs .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; flex: none;
  background: var(--surface-3); border: 2px solid var(--border); box-sizing: border-box; }
.ctl-tabs .done .n, .ctl-mini-tabs .done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.ctl-tabs .current .n, .ctl-mini-tabs .current .n { background: var(--primary); border-color: var(--primary); color: #fff; }
.ctl-tabs .msg { margin-left: auto; }

@media (max-width: 900px) {
  .ctl-side { align-items: flex-start; }
  .ctl-score { text-align: left; }
}
/* ---- Barre des étapes : jauges en demi-cercle (100 % = demi-cercle plein), en haut / en bas en alternance ---- */
.sg-wrap { overflow-x: auto; margin: 6px -6px 4px; padding: 0 6px; }
.sg { --node: 116px; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(118px, 1fr));
  position: relative; min-width: calc(var(--n) * 120px); }
/* rail gris derrière les cercles */
.sg::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--text-h, 118px) + var(--node) / 2 - 12px); height: 24px;
  border-radius: 12px; background: var(--surface-3); box-shadow: inset 0 1px 3px rgba(15, 27, 45, .06); }
.sg-step { position: relative; display: grid; grid-template-rows: var(--text-h, 118px) var(--node) var(--text-h, 118px); justify-items: center; min-width: 0; }
/* texte : sous le cercle quand la jauge est en haut, au-dessus quand elle est en bas */
.sg-text { width: 100%; max-width: 230px; padding: 0 4px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.sg-step.up .sg-text { grid-row: 3; justify-content: flex-start; padding-top: 10px; }
.sg-step.down .sg-text { grid-row: 1; justify-content: flex-end; padding-bottom: 10px; }
.sg-title { font-weight: 800; font-size: .86rem; letter-spacing: .03em; text-transform: uppercase; color: var(--text); text-decoration: none; line-height: 1.15; }
.sg-title:hover { color: var(--c); }
.sg-detail { margin: 0; font-size: .74rem; line-height: 1.3; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sg-closed { margin: 0; font-size: .72rem; font-weight: 700; color: var(--ok); }
.sg-btn { margin-top: 2px; padding: 3px 9px; font-size: .74rem; opacity: 0; transition: opacity .15s; }
.sg-step:hover .sg-btn, .sg-step.current .sg-btn, .sg-btn:focus-visible { opacity: 1; }
@media (hover: none) { .sg-btn { opacity: 1; } }

/* cercle : jauge + disque blanc */
.sg-node { grid-row: 2; position: relative; width: var(--node); height: var(--node); display: grid; place-items: center; text-decoration: none; color: var(--text);
  z-index: 1; transition: transform .2s ease; }
.sg-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sg-track, .sg-val { fill: none; stroke-width: 16; stroke-linecap: butt; }
.sg-track { stroke: color-mix(in srgb, var(--c) 16%, var(--surface-3)); }
.sg-val { transition: stroke-dasharray .6s ease; }
.sg-disc { position: relative; width: 74%; height: 74%; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0; box-shadow: 0 6px 16px rgba(15, 27, 45, .12); text-align: center; }
.sg-disc .ic { width: 22px; height: 22px; color: var(--c); margin-bottom: 1px; }
.sg-disc b { font-size: 1.02rem; line-height: 1.1; }
.sg-disc small { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.sg-node:hover { transform: translateY(-2px); }
.sg-node:hover .sg-disc { box-shadow: 0 10px 22px rgba(15, 27, 45, .18); }

/* étape en cours : agrandie et mise en avant */
.sg-step.current .sg-node { transform: scale(1.17); z-index: 2; }
.sg-step.current .sg-node:hover { transform: scale(1.17) translateY(-2px); }
.sg-step.current .sg-disc { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent), 0 10px 26px rgba(15, 27, 45, .2); }
.sg-step.current .sg-disc small { color: var(--c); }
.sg-step.current .sg-title { color: var(--c); }
.sg-step.current.up .sg-text { padding-top: 20px; }
.sg-step.current.down .sg-text { padding-bottom: 20px; }
/* étapes terminées : coche discrète */
.sg-step.full .sg-disc b { color: var(--c); }

/* liaison entre deux étapes : tronçon du rail, coloré quand l'étape est terminée */
.sg-link { position: absolute; left: 50%; right: -50%; top: calc(var(--text-h, 118px) + var(--node) / 2 - 12px); height: 24px; z-index: 0;
  pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 30%, var(--surface-3)) var(--fill, 0%), transparent var(--fill, 0%)); }
.sg-link i, .sg-link em { display: none; }
.sg-step.full .sg-link { --fill: 100%; }
.sg-step:first-child .sg-link { border-radius: 0; }

/* ---- Menu principal horizontal des gestionnaires ---- */
.staff-top .topbar-inner { max-width: none; gap: 22px; }
.staff-top .brand > span { white-space: nowrap; }
.staff-top .nav { gap: 2px; min-width: 0; }
.staff-top .nav > a, .staff-top .nav > .nav-drop > button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.staff-top .nav .ic { width: 17px; height: 17px; flex: none; }
.staff-top .nav-drop > button.active { background: var(--primary-soft); color: var(--primary-2); }
.staff-top .nav .drop-item.checked, .staff-top .nav .drop-item.active { color: var(--primary-2); font-weight: 650; }
.staff-top .client-btn { padding: 4px 10px 4px 4px; }
.staff-top .client-btn .cl-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-top .user-box .drop-menu { left: auto; right: 0; }
@media (max-width: 1280px) { .staff-top .nav-lab { display: none; } .staff-top .nav > a, .staff-top .nav > .nav-drop > button { padding: 8px 10px; } }
@media (max-width: 900px) {
  .staff-top .topbar-inner { padding: 0 10px; gap: 8px; }
  .staff-top .brand > span, .staff-top .client-btn .cl-name { display: none; }
  .staff-top .nav { overflow-x: auto; scrollbar-width: none; }
}

/* Menu principal et bandeau d'onglets sur fond foncé : couleur principale très foncée.
   Toujours foncé côté gestion (la couleur de barre choisie dans le thème d'un client ne vaut que pour l'espace adhérent). */
html { --page-primary-soft: var(--primary-soft); --page-primary-2: var(--primary-2); --page-border: var(--border);
  --page-border-strong: var(--border-strong); --page-field: var(--field); --dark-bar: color-mix(in srgb, var(--primary) 30%, #03060c);
  --dark-band: color-mix(in srgb, var(--primary) 16%, #010205); }
html .staff-top, .cband { background: var(--dark-bar); border-bottom: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
html .staff-top .topbar-inner, .cband { --text: #fff; --muted: rgba(255, 255, 255, .72); --surface-3: rgba(255, 255, 255, .1);
  --surface: var(--dark-bar); --primary-soft: rgba(255, 255, 255, .16); --primary-2: #fff; --brand: #fff; --border: rgba(255, 255, 255, .2);
  --border-strong: rgba(255, 255, 255, .26); --field: rgba(255, 255, 255, .06); color: var(--text); }
html .staff-top .drop-menu, .cband .drop-menu { --text: var(--page-text); --muted: var(--page-muted); --surface-3: var(--page-surface-3);
  --surface: var(--page-surface); --primary-soft: var(--page-primary-soft); --primary-2: var(--page-primary-2); --border: var(--page-border);
  --border-strong: var(--page-border-strong); --field: var(--page-field); color: var(--text); }
html { --page-surface: var(--surface); }
.staff-top { height: 64px; box-sizing: border-box; }

/* ---- Onglets (pages d'une campagne, pages des paramètres) : bandeau foncé collé sous le menu,
   le titre (nom de la campagne) et les onglets sur la même ligne.
   L'onglet de la page a la couleur de fond de la page : il se prolonge dans le contenu. ---- */
body.has-ctabs { --stick: 122px; }   /* menu (64 px) + bandeau (52 px) : repère des éléments collants des pages */
.cband { position: sticky; top: 64px; z-index: 40; background: var(--dark-band); --surface: var(--dark-band); }
.cband.stuck { box-shadow: 0 8px 18px rgba(15, 27, 45, .18); }
.cband-in { max-width: 1520px; margin: 0 auto; padding: 0 24px; height: 58px; display: flex; align-items: flex-end; gap: 14px; }
.ctabs-head { border-top: 0; align-self: center; display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; max-width: min(30%, 270px); }
.ctabs-head .sgp-switch { min-width: 0; flex: 0 1 auto; }
.ctabs-head .nav-drop > button.sgp-camp b { font-size: 1rem; }
.ctabs-head .pill { flex: none; }
.cband-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; white-space: nowrap; }
.cband-title .ic, .cband-title svg { width: 18px; height: 18px; }
.ctabs { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ctabs::-webkit-scrollbar { display: none; }
.ctab { --s: var(--c, var(--primary)); position: relative; display: flex; align-items: center; gap: 7px; height: 50px; box-sizing: border-box;
  padding: 0 11px 10px; flex: none; font-size: .86rem; font-weight: 550; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-radius: 10px 10px 0 0; transition: color .15s, background .15s; }
.ctab .ic { width: 17px; height: 17px; flex: none; color: var(--c, currentColor); }
.ctab:hover { color: var(--text); background: var(--surface-3); }
/* jauge de l'étape, dans sa couleur (celles de l'ancienne frise) */
.ctab i { position: absolute; left: 11px; right: 11px; bottom: 10px; height: 4px; border-radius: 4px; overflow: hidden;
  background: color-mix(in srgb, var(--s) 24%, rgba(255, 255, 255, .1)); }
.ctab i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--s); border-radius: 4px; transition: width .4s ease; }
/* étape en cours : pastille */
.ctab.cur:not(.here)::before { content: ""; position: absolute; top: 7px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--s); }
.ctab.here { color: var(--page-text); font-weight: 700; background: var(--bg); }
.ctab.here::before, .ctab.here::after { content: ""; position: absolute; bottom: 0; width: 12px; height: 12px; pointer-events: none; }
.ctab.here::before { left: -12px; background: radial-gradient(circle at 0 0, transparent 11.5px, var(--bg) 12px); }
.ctab.here::after { right: -12px; background: radial-gradient(circle at 100% 0, transparent 11.5px, var(--bg) 12px); }
.ctabs { padding: 0 12px; margin: 0 -12px; position: relative; }   /* place pour les arrondis du premier et du dernier onglet */
/* fond clair commun qui glisse jusqu'à l'onglet de la page (posé par le script ; sans script, chaque onglet a son propre fond) */
.ctab-pill { position: absolute; left: 0; bottom: 0; height: 50px; width: 0; background: var(--bg); border-radius: 10px 10px 0 0; pointer-events: none;
  transition: transform .38s cubic-bezier(.3, .9, .25, 1), width .38s cubic-bezier(.3, .9, .25, 1), opacity .2s; }
.ctab-pill::before, .ctab-pill::after { content: ""; position: absolute; bottom: 0; width: 12px; height: 12px; }
.ctab-pill::before { left: -12px; background: radial-gradient(circle at 0 0, transparent 11.5px, var(--bg) 12px); }
.ctab-pill::after { right: -12px; background: radial-gradient(circle at 100% 0, transparent 11.5px, var(--bg) 12px); }
.ctabs.has-pill .ctab.here, .ctabs.has-pill .ctab.here:hover { background: transparent; }
.ctabs.has-pill .ctab.here::before, .ctabs.has-pill .ctab.here::after { display: none; }
.ctab { transition: color .25s, background .15s; }
.ctab.here .ic { color: var(--c, var(--page-primary-2)); }
.ctab.here i { background: color-mix(in srgb, var(--s) 16%, var(--page-surface-3)); }
/* pas assez de place pour tous les noms : seulement les icônes, sauf l'onglet de la page (classe posée par le script) */
.ctabs.compact .ctab:not(.here) .ctab-lab { display: none; }
.ctabs.compact .ctab:not(.here) i { left: 8px; right: 8px; }
@media (max-width: 900px) { .cband-in { padding: 0 10px; gap: 8px; } .ctabs-head .pill { display: none; } .ctabs-head { max-width: 40%; } }

/* Changement de page avec le menu horizontal : le contenu glisse de côté, vers la gauche quand on avance dans les menus et les onglets */
@media (prefers-reduced-motion: no-preference) {
  @keyframes pg-from-right { from { opacity: 0; transform: translateX(46px); } }
  @keyframes pg-from-left { from { opacity: 0; transform: translateX(-46px); } }
  body:not(.with-sidebar) > main { overflow-x: clip; }   /* le glissement n'élargit pas la page */
  html.pg-from-right body:not(.with-sidebar) > main > * { animation: pg-from-right .38s cubic-bezier(.2, .8, .2, 1) backwards; }
  html.pg-from-left body:not(.with-sidebar) > main > * { animation: pg-from-left .38s cubic-bezier(.2, .8, .2, 1) backwards; }
  html.pg-fade body:not(.with-sidebar) > main { animation: pg-fade .25s ease backwards; }
  /* sans rechargement : l'ancien contenu sort d'un côté, le nouveau entre de l'autre */
  main.soft-out > * { transition: transform .16s ease-in, opacity .16s ease-in; opacity: 0; transform: translateX(-46px); }
  main.soft-out.soft-prev > * { transform: translateX(46px); }
  main.soft-in > * { animation: pg-from-right .34s cubic-bezier(.2, .8, .2, 1) both; }
  main.soft-in.soft-prev > * { animation-name: pg-from-left; }
}

/* nom de la campagne : ouvre la liste des campagnes */
.sgp-switch { min-width: 0; }
.nav-drop > button.sgp-camp { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 10px; margin-left: -6px; border-radius: 10px; color: var(--text); font-weight: 700; }
.nav-drop > button.sgp-camp b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.12rem; }
.nav-drop > button.sgp-camp .chev { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform .15s; }
.sgp-switch .drop-menu { min-width: 340px; max-width: 440px; font-size: .9rem; }
.sgp-switch .drop-item .dot-st { position: static; flex: none; }

/* vue d'ensemble : cartes des étapes (la frise graphique est mise de côté dans _frise_etapes.html) */
.stp-grid { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.stp { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.stp.current { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.stp-head { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.stp-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.stp-ic .ic { width: 18px; height: 18px; }
.stp-name { flex: 1; min-width: 0; font-weight: 700; line-height: 1.2; }
.stp-name small { display: block; font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stp.current .stp-name small { color: var(--c); }
.stp-head:hover .stp-name { color: var(--c); }
.stp-pct { font-size: 1.05rem; }
.stp.full .stp-pct { color: var(--c); }
.stp-bar { height: 6px; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--c) 16%, var(--surface-3)); }
.stp-bar i { display: block; height: 100%; border-radius: 6px; background: var(--c); transition: width .5s ease; }
.stp .sg-detail { -webkit-line-clamp: 2; }
.stp-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stp-foot .sg-btn { margin: 0 0 0 auto; opacity: 1; }

/* contenu remplacé sans rechargement : il apparaît en douceur sous les onglets restés en place */


/* ---- Menu du haut : 69 px ; bandeau d'onglets : 53 px (total inchangé : 122 px) ---- */
.staff-top, .staff-top .topbar-inner { height: 69px; }
body:has(.staff-top) { --stick: 69px; }
body.has-ctabs { --stick: 122px; }
.cband { top: 69px; }
.cband-in { height: 53px; }
.ctab, .ctab-pill { height: 45px; }
/* à droite du menu : client affiché (nom visible), thème, compte, bien espacés */
.staff-top .user-box { gap: 18px; margin-left: auto; flex: none; }
.staff-top .client-btn .sb-label { display: block; }
.staff-top .client-btn svg.sb-label { display: inline-block; }
.staff-top .client-btn { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .08); }
@media (max-width: 1100px) { .staff-top .user-box { gap: 10px; } .staff-top .client-btn .cl-name { max-width: 110px; } }
@media (max-width: 900px) { .staff-top .user-box { gap: 6px; } .staff-top .client-btn .cl-name, .staff-top .client-btn svg.chev { display: none; } }

/* le sous-menu (bandeau d'onglets) se déroule sous le menu quand il apparaît (classe posée par le script de base.html) */
@media (prefers-reduced-motion: no-preference) {
  @keyframes band-unroll { from { clip-path: inset(0 0 100% 0); margin-bottom: -53px; } to { clip-path: inset(0 0 0 0); margin-bottom: 0; } }
  @keyframes band-drop { from { opacity: 0; transform: translateY(-14px); } }
  .cband.unroll { animation: band-unroll .42s cubic-bezier(.2, .8, .2, 1) backwards; }
  .cband.unroll .cband-in > * { animation: band-drop .42s .08s cubic-bezier(.2, .8, .2, 1) backwards; }
}

/* ---- Affichage condensé : moins d'espace vide dans et entre les blocs ---- */
.container { padding: 16px 20px 48px; }
.page-head { margin-bottom: 12px; gap: 10px; }
h1 { font-size: 1.4rem; }
h2 { margin-bottom: .55rem; }
.card { padding: 14px 16px; margin-bottom: 12px; }
.card.tight { padding: 10px 12px; }
.card-head { margin-bottom: 8px; }
.grid-2, .grid-3, .stack { gap: 12px; }
.grid-2.align-stretch { margin-bottom: 12px; }
.field { margin-bottom: 10px; }
hr.sep { margin: 12px 0; }
.kpis { gap: 10px; margin-bottom: 12px; }
.kpi { padding: 10px 12px; }
.kpi .icon { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.kpi .value { font-size: 1.45rem; margin-top: 3px; }
.kpi .sub { margin-top: 0; }
table.list th, table.list td { padding: 7px 10px; }
.tabs { margin-bottom: 12px; }
.empty-state { padding: 28px 16px; }
.camp-tile { padding: 12px 14px; }
.camp-tile h2 { margin: 6px 0 2px; }
.tile-stats { margin: 8px 0; gap: 6px; }
.tile-stats > div { padding: 5px 6px; }
.tile-stats b { font-size: 1.15rem; }
.dash-camps { gap: 12px; }
.dash-camp { padding: 12px 14px; gap: 4px; }
.dash-grid, .dash-grid .col-guides { gap: 12px; }
.dw { padding: 10px 12px; }
.dw-head { margin-bottom: 6px; }
.dash-editbar { margin: -2px 0 12px; padding: 8px 12px; }
.ctl { padding: 14px 16px 10px; margin-bottom: 12px; }
.stp-grid { margin: 10px 0 4px; gap: 10px; }
.stp { padding: 10px 12px; gap: 6px; }
.ticket-head { padding: 8px 12px; }
.ticket-body { padding: 10px 12px; }
.chart-box { height: 260px; }
.chart-box.tall { height: 320px; }
.chart-box.fill { height: 100%; }

/* ---- Relief : ombres et dégradés légers ---- */
:root {
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 6px 16px -4px rgba(15, 27, 45, .10);
  --shadow-md: 0 2px 4px rgba(15, 27, 45, .06), 0 14px 30px -6px rgba(15, 27, 45, .16);
  --grad-surface: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 95%, var(--primary)) 100%);
}
html[data-theme="dark"] {
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 16px -4px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 30px -6px rgba(0, 0, 0, .5);
}
.card, .kpi, .dw, .camp-tile, .dash-camp, .ctl, .stp, .ticket, .fe-card { background: var(--grad-surface); }
.dw-kpi, .dw[data-type="camps"] { background: transparent; }
.card.flat { background: var(--surface); }
.stp { box-shadow: var(--shadow-xs); transition: box-shadow .2s, transform .2s; }
.stp:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card, .dw, .ctl { transition: box-shadow .2s; }
.card:hover, .dw:hover, .ctl:hover { box-shadow: var(--shadow-md); }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; opacity: .8;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 35%, var(--violet))); }
.kpi .icon, .stp-ic { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent), 0 2px 5px rgba(15, 27, 45, .08); }
table.list th { background: linear-gradient(180deg, var(--surface-2), var(--surface-3)); }
.stp-bar i { background-image: linear-gradient(90deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0)); }
/* barres du haut : dégradé de la couleur principale foncée, ombre portée sur la page */
html .staff-top { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 42%, #050a14) 0%, var(--dark-bar) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.cband { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 9%, #010205) 0%, var(--dark-band) 100%);
  box-shadow: inset 0 7px 9px -7px rgba(0, 0, 0, .65), 0 6px 16px -8px rgba(15, 27, 45, .35); }
.cband.stuck { box-shadow: inset 0 7px 9px -7px rgba(0, 0, 0, .65), 0 10px 22px -6px rgba(15, 27, 45, .32); }
body:not(.has-ctabs) .staff-top { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 18px -6px rgba(15, 27, 45, .4); }
.staff-top .nav > a.active { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 8px rgba(0, 0, 0, .25); }
.ctab-pill { box-shadow: 0 -3px 10px -2px rgba(0, 0, 0, .35); }
/* sous l'onglet de la page : dégradé de la couleur de fond qui recouvre l'ombre du bandeau (pas de limite entre l'onglet et la page) */
.ctab-fade { position: absolute; left: 0; top: 100%; height: 22px; width: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--bg) 0, var(--bg) 20%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  transition: transform .38s cubic-bezier(.3, .9, .25, 1), width .38s cubic-bezier(.3, .9, .25, 1), opacity .2s; }

/* Bandeau d'onglets en clair (le menu du haut reste foncé) : presque blanc, un peu translucide et flou (la page se devine en défilant),
   plus étroit (46 px). Un liseré continu suit le bas du bandeau et le contour de l'onglet de la page, arrondis compris ;
   l'onglet de la page garde la couleur de fond de la page et se fond dedans. */
body.has-ctabs { --stick: 115px; }   /* menu (69 px) + bandeau (46 px) */
.cband { --line: color-mix(in srgb, var(--primary) 20%, var(--page-border-strong));
  --text: var(--page-text); --muted: var(--page-muted); --surface-3: color-mix(in srgb, var(--primary) 7%, var(--page-surface-3)); --surface: var(--page-surface);
  --primary-soft: var(--page-primary-soft); --primary-2: var(--page-primary-2); --brand: var(--page-primary-2); --border: var(--page-border);
  --border-strong: var(--page-border-strong); --field: var(--page-field); color: var(--text);
  background: color-mix(in srgb, color-mix(in srgb, var(--primary) 2%, var(--page-surface)) 74%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 6px 8px -7px rgba(15, 27, 45, .28), inset 0 -1px 0 var(--line), 0 6px 14px -10px rgba(15, 27, 45, .22); }
.cband.stuck { box-shadow: inset 0 6px 8px -7px rgba(15, 27, 45, .28), inset 0 -1px 0 var(--line), 0 10px 20px -8px rgba(15, 27, 45, .22); }
.cband-in { height: 46px; }
.ctab, .ctab-pill { height: 40px; }
.ctab { padding-bottom: 9px; }
/* jauges : toujours visibles, même à 0 % — fond teinté et creusé (ombre intérieure) */
.ctab i, .ctab.here i { bottom: 6px; height: 5px; background: color-mix(in srgb, var(--s) 20%, var(--page-surface-3));
  box-shadow: inset 0 1px 2px rgba(15, 27, 45, .32), inset 0 0 0 1px color-mix(in srgb, var(--s) 22%, transparent); }
/* onglet de la page : liseré sur le dessus et les côtés, raccordé au liseré du bandeau par les deux arrondis du bas */
.ctab-pill { box-sizing: border-box; border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -2px 6px -4px rgba(15, 27, 45, .2); }
.ctab-pill::before { left: -12px; background: radial-gradient(circle at 0 0, transparent 10.6px, var(--line) 11.1px, var(--line) 11.9px, var(--bg) 12.4px); }
.ctab-pill::after { right: -12px; background: radial-gradient(circle at 100% 0, transparent 10.6px, var(--line) 11.1px, var(--line) 11.9px, var(--bg) 12.4px); }


/* ---------- Bandeau d'une campagne : étapes reliées par un fil, un anneau d'avancement par étape ----------
   La vue d'ensemble (maison) est à gauche, hors du fil. Chaque étape est un nœud dans sa couleur (du jaune au violet) : anneau
   d'avancement (tracé vectoriel, bouts arrondis) autour de son icône, disque plein et coche une fois terminée. Le fil, allumé
   jusqu'à l'étape de la page affichée, passe en dégradé d'une couleur à la suivante. L'étape de la page est une pastille teintée
   (nom et pourcentage) qui glisse d'une étape à l'autre ; une étape réduite s'élargit au survol pour montrer son nom. */
body.has-ctabs { --stick: 121px; }   /* menu (69 px) + bandeau (52 px) */
.cband-in { height: 52px; }
.cband:has(.ctabs.thread) .cband-in { align-items: center; }
.cband:has(.ctabs.thread) > .ctab-fade { display: none; }
.ctabs.thread { --track: color-mix(in srgb, var(--page-text) 12%, transparent); --wire: color-mix(in srgb, var(--page-text) 14%, transparent);
  --node: var(--page-surface); --shade: rgba(15, 27, 45, .22); --hi: rgba(255, 255, 255, .6); --lit-glow: 0 0 0 transparent;
  --ease: cubic-bezier(.3, .9, .25, 1); align-items: center; gap: 0; height: 52px; padding: 0 14px; margin: 0 -14px; }
html[data-theme="dark"] .ctabs.thread { --track: color-mix(in srgb, var(--page-text) 18%, transparent); --wire: color-mix(in srgb, var(--page-text) 18%, transparent);
  --node: color-mix(in srgb, var(--page-text) 8%, var(--page-surface)); --shade: rgba(0, 0, 0, .6); --hi: rgba(255, 255, 255, .1);
  --lit-glow: 0 0 8px color-mix(in srgb, var(--k) 75%, transparent); }
.ctabs.thread .ctab { --k: var(--c, var(--primary)); height: 40px; padding: 0 13px 0 4px; margin-left: 22px; gap: 0; border-radius: 999px; background: none;
  color: var(--page-muted); transition: color .2s, padding .28s var(--ease); }
.ctabs.thread .ctab:hover, .ctabs.thread .ctab:focus-visible { color: var(--page-text); background: none; }
.ctabs.thread .ctab-home { margin-left: 0; padding: 0 12px; }
.ctabs.thread .ctab-home + .ctab { margin-left: 12px; }
.ctabs.thread .ctab .ic { position: relative; width: 15px; height: 15px; color: color-mix(in srgb, var(--k) 80%, var(--page-text)); }
.ctabs.thread .ctab-home .ic { width: 18px; height: 18px; color: currentColor; }
/* nom et pourcentage : ils se déplient (page affichée, survol) et se replient en douceur */
.ctabs.thread .ctab-lab, .ctabs.thread .ctab-pct { display: inline-block; overflow: hidden; max-width: 200px; margin-left: 8px;
  transition: max-width .28s var(--ease), margin .28s var(--ease), opacity .22s; }
.ctabs.thread .ctab-pct { margin-left: 5px; font-weight: 600; opacity: .78; font-variant-numeric: tabular-nums; }
.ctabs.thread .ctab:not(.here) .ctab-pct { max-width: 0; margin-left: 0; opacity: 0; }
.ctabs.thread.compact .ctab:not(.here) .ctab-lab { display: inline-block; }
.ctabs.thread.compact .ctab:not(.here) .ctab-lab { max-width: 0; margin-left: 0; opacity: 0; }
.ctabs.thread.compact .ctab:not(.here):not(.ctab-home) { padding-right: 4px; }
/* le fil : un segment à gauche de chaque étape (il passe sous l'anneau) ; allumé, il va de la couleur précédente à celle de l'étape */
.ctabs.thread .ctab:not(.ctab-home) + .ctab::before { content: ""; display: block; position: absolute; left: -26px; right: auto; top: 50%; bottom: auto;
  width: 34px; height: 3px; margin-top: -1.5px; border-radius: 3px; background: var(--wire); box-shadow: inset 0 1px 1px color-mix(in srgb, var(--shade) 45%, transparent);
  pointer-events: none; }
.ctabs.thread .ctab.here + .ctab::before { left: -21px; width: 29px; }
.ctabs.thread .ctab-home + .ctab::before { content: none; }   /* la première étape n'a pas de fil à sa gauche */
.ctabs.thread .ctab:not(.ctab-home) + .ctab:has(~ .ctab.here)::before,
.ctabs.thread .ctab:not(.ctab-home) + .ctab.here::before { background: linear-gradient(90deg, var(--c0, var(--k)), var(--k));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--k) 40%, transparent), var(--lit-glow); }
/* le nœud : pastille en léger relief, anneau d'avancement tracé autour de l'icône */
.ctabs.thread .ctab i, .ctabs.thread.compact .ctab:not(.here) i { position: relative; inset: auto; flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%; overflow: visible; background: var(--node);
  box-shadow: 0 1px 3px var(--shade), 0 0 0 .5px color-mix(in srgb, var(--page-text) 9%, transparent), inset 0 1px 0 var(--hi);
  transition: transform .25s var(--ease), box-shadow .25s; }
.ctabs.thread .ctab i::after { content: none; }
.ctabs.thread .ctab:not(.here):hover i, .ctabs.thread .ctab:not(.here):focus-visible i { z-index: 2; transform: scale(1.28); box-shadow: 0 3px 8px -1px color-mix(in srgb, var(--k) 45%, var(--shade)), 0 0 0 .5px color-mix(in srgb, var(--page-text) 9%, transparent), inset 0 1px 0 var(--hi); }
.ctab .ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; }
.ctab .ring .tr { stroke: var(--track); stroke-width: 3.6; }
.ctab .ring .pr { stroke: var(--k); stroke-width: 3.6; stroke-linecap: round; stroke-dasharray: var(--n, 0) 100; transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dasharray .6s var(--ease); filter: drop-shadow(0 1px 1.2px color-mix(in srgb, var(--k) 50%, transparent)); }
.ctab.zero .ring .pr, .ctab .ring .ck { display: none; }
.ctab .ring .ck { stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px .6px rgba(0, 0, 0, .28)); }
/* étape terminée : disque plein dans sa couleur, et coche */
.ctabs.thread .ctab.done i, .ctabs.thread.compact .ctab.done:not(.here) i {
  background: linear-gradient(160deg, color-mix(in srgb, var(--k) 84%, #fff) 0%, var(--k) 52%, color-mix(in srgb, var(--k) 86%, #000) 100%);
  box-shadow: 0 2px 6px -1px color-mix(in srgb, var(--k) 65%, transparent), inset 0 1px 0 rgba(255, 255, 255, .4), var(--lit-glow); }
.ctabs.thread .ctab.done .ring .tr, .ctabs.thread .ctab.done .ring .pr, .ctabs.thread .ctab.done i .ic { display: none; }
.ctabs.thread .ctab.done .ring .ck { display: block; }
/* étape en cours de la campagne (hors page affichée) : point sur l'anneau */
.ctabs.thread .ctab.cur:not(.here)::after { content: ""; position: absolute; left: 28px; top: 3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--k); box-shadow: 0 0 0 2px var(--page-surface), 0 1px 3px var(--shade); }
/* page affichée : pastille teintée dans la couleur de l'étape (elle glisse ; sans script, l'onglet porte lui-même le fond) */
.ctabs.thread .ctab.here { color: var(--page-text); font-weight: 700; background: color-mix(in srgb, var(--k) 36%, var(--page-surface)); }
.ctabs.thread.has-pill .ctab.here { background: none; }
.ctabs.thread .ctab.here .ic { color: color-mix(in srgb, var(--k) 70%, var(--page-text)); }
.ctabs.thread .ctab-home.here .ic { color: var(--primary); }
.ctabs.thread .ctab-pill { --pc: var(--primary); top: 6px; bottom: auto; height: 40px; box-sizing: border-box; border-radius: 999px; border: 0;
  /* pastille en léger relief : fond dans la couleur de l'étape, reflet en haut, bord plus sombre en bas, pas de liseré ni d'ombre portée */
  background-color: color-mix(in srgb, var(--pc) 36%, var(--page-surface));
  background-image: linear-gradient(180deg, var(--hi), transparent 50%, color-mix(in srgb, var(--pc) 22%, transparent));
  box-shadow: inset 0 1px 0 var(--hi), inset 0 -1.5px 0 color-mix(in srgb, var(--pc) 55%, var(--shade));
  transition: transform .38s var(--ease), width .38s var(--ease), opacity .2s, background-color .38s, box-shadow .38s; }
.ctabs.thread .ctab-pill::before, .ctabs.thread .ctab-pill::after { display: none; }
.ctabs.fit, .ctabs.fit * { transition: none !important; }   /* le temps de mesurer si les noms tiennent */
/* infobulle d'une étape réduite : son nom et son avancement, juste sous le bandeau, avec une pointe vers l'anneau */
.ctip { position: fixed; z-index: 60; transform: translate(-50%, -4px); padding: 6px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; color: var(--page-surface); background: var(--page-text); border-bottom: 2px solid var(--k, var(--primary));
  box-shadow: 0 6px 16px -6px rgba(15, 27, 45, .45); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s, transform .2s cubic-bezier(.3, .9, .25, 1), visibility 0s .16s; }
.ctip.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.ctip::before { content: ""; position: absolute; left: calc(50% + var(--ax, 0px)); top: -4px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 2px 0 0 0;
  background: inherit; transform: rotate(45deg); }
/* la maison (vue d'ensemble) grossit elle aussi au survol */
.ctabs.thread .ctab-home .ic { transition: transform .25s var(--ease); }
.ctabs.thread .ctab-home:not(.here):hover .ic, .ctabs.thread .ctab-home:not(.here):focus-visible .ic { transform: scale(1.28); }
/* menu du haut : la page ouverte est une touche en léger relief (reflet en haut, bord sombre en bas), comme la pastille des étapes */
.staff-top .nav > a.active, .staff-top .nav-drop > button.active { color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .05) 55%, rgba(0, 0, 0, .1)), color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1.5px 0 rgba(0, 0, 0, .4); }

/* ---------- Bandeau d'une campagne, visuel « fil » aux couleurs des étapes ----------
   Fil fin entre les étapes, allumé jusqu'à l'étape de la page en passant d'une couleur à la suivante. Chaque étape : anneau fin
   d'avancement dans sa couleur autour de l'icône, disque plein et coche une fois terminée. L'étape de la page s'élargit en pastille
   pleine dans sa couleur (--ink : encre lisible dessus), lumineuse en thème sombre. */
.ctabs.thread .ctab:not(.ctab-home) + .ctab::before { height: 2px; margin-top: -1px; border-radius: 0; background: var(--wire); box-shadow: none; }
.ctabs.thread .ctab:not(.ctab-home) + .ctab:has(~ .ctab.here)::before,
.ctabs.thread .ctab:not(.ctab-home) + .ctab.here::before { background: linear-gradient(90deg, var(--c0, var(--k)), var(--k)); box-shadow: var(--lit-glow); }
.ctabs.thread .ctab i, .ctabs.thread.compact .ctab:not(.here) i { background: none; box-shadow: none; }
.ctabs.thread .ctab:not(.here):hover i, .ctabs.thread .ctab:not(.here):focus-visible i { box-shadow: none; }
.ctabs.thread .ctab .ic { color: currentColor; }
.ctab .ring .tr { stroke: var(--track); stroke-width: 3.4; }
.ctab .ring .pr { stroke-width: 3.4; filter: none; }
.ctab .ring .ck { filter: none; }
.ctabs.thread .ctab.done i, .ctabs.thread.compact .ctab.done:not(.here) i { background: var(--k); box-shadow: var(--lit-glow); }
/* page affichée : pastille élargie, pleine, dans la couleur de l'étape ; anneau et icône dans l'encre de la pastille */
.ctabs.thread .ctab.here { color: var(--ink, var(--primary-ink, #fff)); background: var(--k); }
.ctabs.thread .ctab.here .ctab-pct { opacity: .85; }
.ctabs.thread .ctab.here .ic, .ctabs.thread .ctab-home.here .ic { color: currentColor; }
.ctabs.thread .ctab.here .ring .tr { stroke: color-mix(in srgb, currentColor 28%, transparent); }
.ctabs.thread .ctab.here .ring .pr { stroke: currentColor; }
.ctabs.thread .ctab.here.done i { background: currentColor; box-shadow: none; }
.ctabs.thread .ctab.here.done .ring .ck { stroke: var(--k); }
.ctabs.thread .ctab-pill { background-color: var(--pc); background-image: none; box-shadow: none; }
html[data-theme="dark"] .ctabs.thread .ctab-pill { box-shadow: 0 0 12px 1px color-mix(in srgb, var(--pc) 70%, transparent); }
/* une seule couleur, celle du client : anneaux, disques, fil allumé et pastille ; anneau et fil plus épais */
.ctabs.thread .ctab { --k: var(--primary); }
.ctabs.thread .ctab:not(.ctab-home) + .ctab::before { height: 4px; margin-top: -2px; border-radius: 2px; }
.ctabs.thread .ctab:not(.ctab-home) + .ctab:has(~ .ctab.here)::before,
.ctabs.thread .ctab:not(.ctab-home) + .ctab.here::before { background: var(--primary); }
.ctab .ring .tr, .ctab .ring .pr { stroke-width: 5.2; }
.ctabs.thread .ctab.here { color: var(--primary-ink, #fff); }
.ctabs.thread .ctab-pill { --pc: var(--primary) !important; }
.ctip { border-bottom-color: var(--primary); }
/* le fil s'arrête au bord des anneaux (il ne passe plus dessous) : un trait net entre deux étapes, de la pastille à l'anneau sinon */
.ctabs.thread .ctab:not(.ctab-home) + .ctab::before { left: -24.5px; width: 27px; }
.ctabs.thread .ctab.here + .ctab::before { left: -20.5px; width: 23px; }
.ctabs.thread .ctab:not(.ctab-home) + .ctab.here::before { width: 23px; }
/* bandeau d'onglets plus translucide (54 % au lieu de 74 %) */
.cband { background: color-mix(in srgb, color-mix(in srgb, var(--primary) 2%, var(--page-surface)) 54%, transparent); }

/* ---------- Style « FOX » : menu du haut à plat dans la couleur du client, sous-menus (hors campagne) en onglets à contour ----------
   Menu : fond uni couleur principale, entrée active en rectangle arrondi plus foncé, sélecteur de client en pastille blanche.
   Sous-menus (paramètres…) : icône + nom, l'onglet de la page est une pastille au contour de la couleur principale.
   Le bandeau d'une campagne garde ses étapes reliées par un fil. */
html .staff-top { background: var(--primary); box-shadow: none; }
body:not(.has-ctabs) .staff-top { box-shadow: 0 4px 14px -6px rgba(15, 27, 45, .35); }
.staff-top .nav > a, .staff-top .nav > .nav-drop > button { color: #fff; font-weight: 600; }
.staff-top .nav > a:hover, .staff-top .nav > .nav-drop > button:hover { background: color-mix(in srgb, #000 14%, transparent); }
.staff-top .nav > a.active, .staff-top .nav-drop > button.active { color: #fff; background: color-mix(in srgb, #000 30%, transparent); box-shadow: none; }
.staff-top .client-btn { border-color: transparent; border-radius: 999px; background: #fff; color: #1b2436; --text: #1b2436; --muted: #5b6577; }
.staff-top .client-btn:hover, .staff-top .nav-drop.open > .client-btn { background: color-mix(in srgb, var(--primary) 10%, #fff); }
.staff-top .theme-drop > button { border: 1px solid rgba(255, 255, 255, .45); border-radius: 10px; }
/* sous-menus hors campagne */
.cband:has(.ctabs:not(.thread)) .cband-in { align-items: center; }
.cband:has(.ctabs:not(.thread)) > .ctab-fade, .cband:has(.ctabs:not(.thread)) .ctabs-head { display: none; }
.ctabs:not(.thread) { align-items: center; gap: 4px; height: 52px; }
.ctabs:not(.thread) .ctab { height: 34px; padding: 0 13px; border-radius: 999px; font-weight: 550; color: var(--page-muted); background: none; }
.ctabs:not(.thread) .ctab .ic { color: currentColor; }
.ctabs:not(.thread) .ctab:hover { color: var(--page-text); background: var(--surface-3); }
.ctabs:not(.thread) .ctab.here { color: var(--page-primary-2); font-weight: 600; background: var(--page-primary-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 55%, transparent); }
.ctabs:not(.thread) .ctab.here::before, .ctabs:not(.thread) .ctab.here::after { display: none; }
.ctabs:not(.thread).has-pill .ctab.here { background: none; box-shadow: none; }
.ctabs:not(.thread) .ctab-pill { top: 50%; bottom: auto; height: 34px; margin-top: -17px; border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
  border-radius: 999px; background: var(--page-primary-soft); box-shadow: none; }
.ctabs:not(.thread) .ctab-pill::before, .ctabs:not(.thread) .ctab-pill::after { display: none; }
.staff-top .client-btn .cl-ava.all { background: var(--primary); color: #fff; }
.staff-top .client-btn .chev { color: #5b6577; }
/* mêmes hauteurs que FOX : menu 64 px, bandeau de sous-menus 44 px */
.staff-top, .staff-top .topbar-inner { height: 64px; }
body:has(.staff-top) { --stick: 64px; }
body.has-ctabs { --stick: 108px; }
.cband-in, .ctabs.thread, .ctabs:not(.thread) { height: 44px; }
.ctabs.thread .ctab-pill { top: 2px; }
.ctabs:not(.thread) .ctab { height: 32px; }
.ctabs:not(.thread) .ctab-pill { height: 32px; margin-top: -16px; }
.cband { top: 64px; }
/* tailles de FOX : entrées de menu de 32 px (14 px, demi-gras), pastille client de 32 px, bouton de thème de 28 px, onglets de 30 px (13,5 px) */
.staff-top .nav { gap: 1px; }
.staff-top .nav > a, .staff-top .nav > .nav-drop > button { height: 32px; box-sizing: border-box; padding: 0 12px; gap: 8px; border-radius: 7px; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.staff-top .nav .ic { width: 16px; height: 16px; }
.staff-top .client-btn { height: 32px; padding: 0 10px 0 4px; gap: 7px; font-size: 13px; font-weight: 550; }
.staff-top .client-btn .cl-ava { width: 24px; height: 24px; border-radius: 50%; }
.staff-top .client-btn .cl-ava.all svg.ic { width: 14px; height: 14px; }
.staff-top .client-btn .chev { width: 12px; height: 12px; }
.staff-top .theme-drop > button { height: 28px; box-sizing: border-box; padding: 0 9px; gap: 5px; border-radius: 8px; font-size: 13px; font-weight: 650; }
.staff-top .theme-drop > button .ic { width: 14px; height: 14px; }
.staff-top .user-box { gap: 10px; }
.staff-top .avatar { width: 34px; height: 34px; }
.ctabs:not(.thread) { gap: 3px; }
.ctabs:not(.thread) .ctab { height: 30px; padding: 0 12px; gap: 8px; font-size: 13.5px; font-weight: 500; }
.ctabs:not(.thread) .ctab.here { font-weight: 500; }
.ctabs:not(.thread) .ctab .ic { width: 15px; height: 15px; }
.ctabs:not(.thread) .ctab-pill { height: 30px; margin-top: -15px; }
.ctabs.thread .ctab { font-size: 13.5px; }
@media (max-width: 1280px) { .staff-top .nav > a, .staff-top .nav > .nav-drop > button { padding: 0 10px; } }
.staff-top .nav-drop > button.theme-btn.theme-btn { width: auto; height: 28px; box-sizing: border-box; padding: 0 9px; gap: 5px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 8px;
  font-size: 13px; font-weight: 650; color: #fff; background: transparent; }
.staff-top .nav-drop > button.theme-btn.theme-btn:hover, .staff-top .nav-drop.open > button.theme-btn.theme-btn { background: color-mix(in srgb, #000 14%, transparent); }

/* mêmes polices que FOX : Archivo (texte et titres, titres en version étroite) et IBM Plex Mono (codes), servies par l'application */
:root { --f-body: "Archivo", "Segoe UI", system-ui, sans-serif; --f-display: var(--f-body); --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; }
body, button, input, select, textarea, .tabulator { font-family: var(--f-body); }
h1 { font-family: var(--f-display); font-stretch: 75%; font-weight: 800; letter-spacing: -.01em; }
h2 { font-family: var(--f-display); font-stretch: 85%; font-weight: 700; }
.staff-top .brand { font-family: var(--f-display); font-stretch: 75%; font-weight: 800; }
.mono, code, .pw-generated code, .code-chip, input.code-input, .w-span, .cf-preview { font-family: var(--f-mono); }

/* ---------- Barres : règles reprises telles quelles de FOX (app.css + modern.css) ----------
   Menu : dégradé à 105° (couleur assombrie de 22 % à gauche), ombre portée sous la barre, entrée active « enfoncée » (noir 18 % + ombre interne).
   Sous-menus : barre translucide floutée avec filet et ombre légère ; onglet actif en pastille claire surélevée, liseré de la couleur principale. */
html .staff-top, body:not(.has-ctabs) .staff-top {
  background: linear-gradient(105deg, color-mix(in srgb, var(--primary) 78%, #000) 0%, var(--primary) 60%, var(--primary) 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 6px 18px -8px rgba(0, 0, 0, .35); border-bottom: 0; }
.staff-top, .staff-top .topbar-inner { height: 66px; }
body:has(.staff-top) { --stick: 66px; }
body.has-ctabs { --stick: 108px; }
.cband { top: 66px; }
.staff-top .nav { gap: 2px; }
.staff-top .nav > a, .staff-top .nav > .nav-drop > button:not(.theme-btn):not(.client-btn) { height: 32px; padding: 0 11px; gap: 7px; border-radius: 7px; font-size: 13.5px; font-weight: 600;
  color: color-mix(in srgb, #fff 88%, transparent); transition: background-color .15s, color .15s, box-shadow .15s; }
.staff-top .nav > a .ic { opacity: .85; }
.staff-top .nav > a:hover .ic, .staff-top .nav > a.active .ic { opacity: 1; }
.staff-top .nav > a:hover, .staff-top .nav > .nav-drop > button:not(.theme-btn):not(.client-btn):hover { color: #fff; background: color-mix(in srgb, #000 12%, transparent); }
.staff-top .nav > a.active, .staff-top .nav-drop > button.active { color: #fff; background: color-mix(in srgb, #000 18%, transparent); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18); }
/* sélecteur de client : pastille blanche quel que soit le thème */
.staff-top .client-btn { color: #1f2328; --text: #1f2328; font-weight: 650; background: #fff; border: 1px solid rgba(0, 0, 0, .08); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); max-width: 240px; }
.staff-top .client-btn:hover, .staff-top .nav-drop.open > .client-btn { background: #f1f3f5; }
.staff-top .client-btn .cl-ava { width: 22px; height: 22px; }
.staff-top .client-btn .chev { opacity: .8; }
/* bouton de thème : bouton fantôme de la barre */
.staff-top .nav-drop > button.theme-btn.theme-btn { height: auto; padding: 4px 9px; gap: 6px; border: 1px solid color-mix(in srgb, #fff 45%, transparent); border-radius: 9px;
  font-size: 12.5px; font-weight: 600; line-height: 1.45; color: #fff; background: transparent; box-shadow: none; transition: background-color .15s, transform .08s; }
.staff-top .nav-drop > button.theme-btn.theme-btn:hover, .staff-top .nav-drop.open > button.theme-btn.theme-btn { background: color-mix(in srgb, #000 12%, transparent); }
.staff-top .nav-drop > button.theme-btn.theme-btn:active { transform: translateY(1px); }
/* avatar : anneau clair et ombre */
.staff-top .avatar { box-shadow: 0 0 0 2px color-mix(in srgb, #fff 70%, transparent), 0 2px 6px rgba(0, 0, 0, .25); transition: box-shadow .15s; }
.staff-top .avatar:hover, .staff-top .nav-drop.open > .avatar { box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(0, 0, 0, .3); }
/* barre de sous-menus */
.cband { --sh-1: 0 1px 2px rgba(23, 30, 45, .05), 0 1px 1px rgba(23, 30, 45, .03); --sh-2: 0 1px 2px rgba(23, 30, 45, .05), 0 4px 12px -2px rgba(23, 30, 45, .07);
  background: color-mix(in srgb, var(--page-surface) 68%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid rgba(21, 25, 29, .07); box-shadow: var(--sh-1); }
html[data-theme="dark"] .cband { --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --sh-2: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 16px -4px rgba(0, 0, 0, .35); border-bottom-color: rgba(255, 255, 255, .08); }
.cband-in, .ctabs.thread, .ctabs:not(.thread) { height: 42px; }
.ctabs.thread .ctab-pill { top: 2px; }
.ctabs:not(.thread) { gap: 2px; }
.ctabs:not(.thread) .ctab { height: 29px; padding: 0 12px; gap: 7px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: color-mix(in srgb, var(--page-text) 76%, var(--page-surface)); transition: background-color .15s, color .15s, box-shadow .15s; }
.ctabs:not(.thread) .ctab .ic { opacity: .75; }
.ctabs:not(.thread) .ctab:hover { color: var(--page-text); background: var(--page-surface-3); }
.ctabs:not(.thread) .ctab.here { color: var(--page-primary-2, var(--primary)); font-weight: 600; background: var(--page-surface);
  box-shadow: var(--sh-2), inset 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent); }
.ctabs:not(.thread).has-pill .ctab.here { background: none; box-shadow: none; }
.ctabs:not(.thread) .ctab-pill { height: 29px; margin-top: -14.5px; border: 0; background: var(--page-surface);
  box-shadow: var(--sh-2), inset 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent); }
/* écarts restants avec FOX : la police affichée dans FOX est Nunito (préférence du compte), et le bandeau collé sous le menu ne change pas d'ombre */
:root { --f-body: "Nunito", "Archivo", "Segoe UI", system-ui, sans-serif; --f-display: var(--f-body); }
.cband.stuck { box-shadow: var(--sh-1); }

/* étape affichée : pastille de la hauteur des anneaux des autres étapes (32 px), son anneau réduit à 24 px */
.ctabs.thread .ctab { height: 32px; }
.ctabs.thread .ctab-pill { top: 5px; height: 32px; }
.ctabs.thread .ctab.here:not(.ctab-home) { padding-left: 4px; }
.ctabs.thread .ctab.here i { width: 24px; height: 24px; margin-right: 3px; }
.ctabs.thread .ctab.here i .ic { width: 12px; height: 12px; }
/* logo : sur la barre des gestionnaires, carré blanc où le signe est découpé (logo.svg) ; ailleurs, le signe seul dans la couleur du client */
.staff-top .brand-mark { border-radius: 9px; box-shadow: none; }
.brand-glyph { display: block; flex: none; border-radius: 0; box-shadow: none; background: var(--primary);
  -webkit-mask: url("logo-glyph.svg") center / contain no-repeat; mask: url("logo-glyph.svg") center / contain no-repeat; }
.brand-glyph.brand-mark, .sb-head .brand-glyph.brand-mark, .sb-mobilebar .brand-glyph.brand-mark, html[data-theme="dark"] .brand-glyph { border-radius: 0; box-shadow: none; }
html.ct-topbar .topbar-inner .brand-glyph, html.ct-topbar .sidebar .brand-glyph { background: var(--top-text, #fff); }

/* ---- Bandeau d'une campagne : étapes en cases (nom, pourcentage, barre d'avancement), regroupées en trois phases.
   Même hauteur et même style que les sous-menus des paramètres (pastilles de 29 px, survol gris clair, page affichée en blanc). ---- */
.ctabs.thread.seg { align-items: center; gap: 8px; background: none; }
.ctabs.thread.seg .ctab-pill { display: none; }
.ctabs.thread.seg .ctab::before, .ctabs.thread.seg .ctab::after { content: none !important; }
.ctabs.thread.seg .ctab, .ctabs.thread.seg .cseg { flex: none; height: 29px; margin: 0; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: color-mix(in srgb, var(--page-text) 76%, var(--page-surface)); background: none; box-shadow: none; text-decoration: none;
  transition: background-color .15s, color .15s, box-shadow .15s; }
.ctabs.thread.seg .cseg, .ctabs.thread.seg .ctab.here:not(.ctab-home) { padding: 0 10px; }
.ctabs.thread.seg .ctab-home { padding: 0 9px; }
.ctabs.thread.seg .ctab-home .ctab-lab { display: none; }
.ctabs.thread.seg .ctab-home .ic { opacity: .75; }
.ctabs.thread.seg a.ctab:hover, .ctabs.thread.seg a.ctab:focus-visible { color: var(--page-text); background: var(--page-surface-3); }
.ctabs.thread.seg a.ctab.here, .ctabs.thread.seg.has-pill a.ctab.here { color: var(--page-primary-2, var(--primary)); background: var(--page-surface);
  box-shadow: var(--sh-2), inset 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent); }
/* une phase : son nom écrit à la verticale, puis ses étapes */
.cgrp { flex: none; min-width: 0; display: flex; align-items: center; gap: 3px; padding-left: 7px;
  border-left: 1px solid color-mix(in srgb, var(--page-text) 12%, transparent); }
.cg-lab { flex: none; writing-mode: vertical-rl; transform: rotate(180deg); height: 34px; text-align: center; font-size: 8px; line-height: 1.2; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; color: var(--page-muted); cursor: default; }
.cgrp.locked .cg-lab { opacity: .6; }
.cg-row { display: flex; gap: 2px; min-width: 0; }
/* une étape : nom et pourcentage sur une ligne, barre d'avancement dessous, alignée à gauche sous le nom */
.ctabs.thread.seg .cseg { display: grid; grid-template-columns: auto auto; align-content: center; justify-content: start; column-gap: 5px; row-gap: 2px; }
.ctabs.thread.seg .cs-top { display: contents; }
.ctabs.thread.seg .cseg .ctab-lab { display: block; grid-column: 1; min-width: 0; max-width: none; margin: 0; opacity: 1; line-height: 15px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.ctabs.thread.seg .cseg .ctab-pct { display: block; grid-column: 2; max-width: none; margin: 0; opacity: 1; line-height: 15px; font-size: 11px; font-weight: 700;
  white-space: nowrap; color: var(--page-muted); font-variant-numeric: tabular-nums; }
.ctabs.thread.seg .cseg i.cs-bar, .ctabs.thread.seg .ctab.here i.cs-bar { display: block; grid-column: 1; grid-row: 2; justify-self: stretch; width: auto; height: 3px;
  margin: 0; border-radius: 3px; overflow: hidden; box-shadow: none;
  background: linear-gradient(var(--primary), var(--primary)) left center / calc(var(--n) * 1%) 100% no-repeat, color-mix(in srgb, var(--page-text) 13%, transparent); }
.ctabs.thread.seg .cseg i.cs-bar::before, .ctabs.thread.seg .cseg i.cs-bar::after { content: none; }   /* remplissage : fond de la barre, calé à gauche */
.ctabs.thread.seg a.cseg.here .ctab-pct, .ctabs.thread.seg a.cseg.done .ctab-pct { color: var(--primary); }
.ctabs.thread.seg .cseg.locked { opacity: .5; cursor: not-allowed; }
#ctabs.seg .cseg i.cs-bar { transform: none; box-shadow: none; z-index: auto; }   /* pas de grossissement au survol (ancienne règle des anneaux) */
/* survol : la barre se remplit rapidement de zéro à sa valeur */
@keyframes cs-fill { from { background-size: 0 100%, auto; } }
@media (prefers-reduced-motion: no-preference) {
  .ctabs.thread.seg a.cseg:hover i.cs-bar, .ctabs.thread.seg a.cseg:focus-visible i.cs-bar { animation: cs-fill .45s cubic-bezier(.3, .9, .25, 1); }
}
/* place insuffisante : les pourcentages s'effacent (la barre reste), sauf celui de la page affichée ; les noms se raccourcissent ensuite */
.ctabs.thread.seg.compact .cseg:not(.here) .ctab-pct { display: none; }
.ctabs.thread.seg.compact .cseg:not(.here) .ctab-lab { display: block; max-width: none; margin: 0; opacity: 1; }
.ctabs.thread.seg.compact .cseg:not(.here):not(.ctab-home) { padding: 0 9px; }
.ctabs.thread.seg.compact .cgrp, .ctabs.thread.seg.compact .cg-row, .ctabs.thread.seg.compact .cseg { flex: 0 1 auto; }
html[data-theme="dark"] .cgrp { border-left-color: color-mix(in srgb, var(--page-text) 18%, transparent); }
/* état de la campagne : pastille de couleur à gauche de son nom (le libellé s'affiche au survol) */
.ctabs-head .cst { border: 0; }
.cst { flex: none; position: relative; width: 18px; height: 18px; margin-right: -4px; display: inline-grid; place-items: center; cursor: help; --k: #94a3b8; }
.cst::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--k); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 22%, transparent); }
.cst.st-open { --k: var(--ok); } .cst.st-draft { --k: var(--violet); } .cst.st-scheduled { --k: var(--primary); }
@keyframes cst-pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .cst.st-open::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
    background: var(--k); animation: cst-pulse 2.2s ease-out infinite; pointer-events: none; }
}
/* vue d'ensemble : carte d'une étape verrouillée */
.stp.locked { opacity: .55; }
.stp.locked .sg-btn { display: none; }

/* ---- Avancement des cartes (widgets) d'une page de campagne : pourcentage en haut à droite, posé sur le bord de la carte ;
   coin supérieur droit souligné : vert si complète, orange sinon ; le bord droit est court ---- */
.wdg { position: relative; }
.wdg > .wpct { position: absolute; top: 0; right: 16px; z-index: 2; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 3px;
  height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  white-space: nowrap; cursor: help; color: #9a5b00; background: #fff4e0;
  box-shadow: 0 0 0 1px color-mix(in srgb, #e19a1c 45%, transparent), 0 1px 2px rgba(23, 30, 45, .06); }
.wdg > .wpct svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.wdg.w-ok > .wpct { color: #fff; background: var(--ok, #16a34a); box-shadow: 0 1px 3px color-mix(in srgb, var(--ok, #16a34a) 40%, transparent); }
.wdg::after { --wc: #e19a1c; content: ""; position: absolute; top: -1px; right: -1px; width: 56px; height: 34px; pointer-events: none; z-index: 1;
  border-top: 2px solid var(--wc); border-right: 2px solid var(--wc); border-top-right-radius: var(--radius, 12px); }
.wdg.w-ok::after { --wc: var(--ok, #16a34a); }
html[data-theme="dark"] .wdg.w-todo > .wpct { color: #ffcf7a; background: color-mix(in srgb, #e19a1c 22%, var(--page-surface, #1b2333)); }

/* ---- Logo animé (alvéoles, route /logo.svg) : image dans la couleur de logo du client, blanc par défaut.
   Remplace le signe teinté par masque (ancienne version dans static/ancien-logo/). ---- */
img.brand-glyph, html.ct-topbar .topbar-inner img.brand-glyph, html.ct-topbar .sidebar img.brand-glyph, html[data-theme="dark"] img.brand-glyph {
  background: none; -webkit-mask: none; mask: none; border-radius: 0; box-shadow: none; object-fit: contain; }

/* --- Consentements et signatures électroniques --- */
.sigrep { border: 1px solid var(--border); border-radius: var(--radius, 12px); padding: 12px; background: var(--surface-2, var(--surface)); }
.sigrep-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.sigrep-ico { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none;
  background: var(--surface-3); color: var(--muted); }
.sigrep-valide .sigrep-ico { background: var(--ok-soft); color: var(--ok); }
.sigrep-alteree .sigrep-ico, .sigrep-invalide .sigrep-ico { background: var(--err-soft); color: var(--err); }
.sigrep-inconnue .sigrep-ico { background: var(--warn-soft); color: var(--warn); }
.sigrep-valide { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.sigrep-alteree { border-color: color-mix(in srgb, var(--err) 35%, var(--border)); }
.sigrep-mk { margin: 4px 0 8px; } .sigrep-mk.ok { color: var(--ok); } .sigrep-mk.warn { color: var(--warn); }
.sigrep-t { margin: 8px 0; } .sigrep-t .pill { margin: 2px 4px 2px 0; }
code.hash { font-size: .72rem; word-break: break-all; }
.sig-counts { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.sig-counts > div { display: flex; flex-direction: column; } .sig-counts b { font-size: 1.4rem; }
.mandate-add { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.mandate-add summary { cursor: pointer; }
.esign-card { border-style: dashed; }
.esign-steps { margin: 6px 0 12px 18px; padding: 0; } .esign-steps li { margin: 3px 0; }
.ok-text { color: var(--ok); } .danger-text { color: var(--err) !important; }

/* ---- Aperçu PDF du mandat (volet à droite, 20 à 50 % de la largeur, comme les factures de FOX) ---- */
:root { --pdf: var(--err); --pdf-bg: var(--err-soft); }
.pdf-btn { display: inline-grid; place-items: center; padding: 1px 3px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; line-height: 0; }
.pdf-btn:hover, .pdf-btn:focus-visible { border-color: var(--pdf); background: var(--pdf-bg); }
tr.pdf-cur td { background: var(--primary-soft) !important; }
tr.pdf-cur .pdf-btn { border-color: var(--pdf); background: var(--pdf-bg); }
.pdf-pane { position: fixed; right: 0; bottom: 0; top: 0; width: var(--pdf-w, 30vw); z-index: 150; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: -14px 0 30px -18px rgba(0, 0, 0, .35); }
.pdf-pane[hidden] { display: none; }
.pdf-pane .pdf-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; min-width: 0; }
.pdf-pane .pdf-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pdf-pane .spacer { flex: 1; }
.pdf-pane iframe { flex: 1; width: 100%; border: 0; background: var(--surface-2); }
body.pdf-open > main { margin-right: var(--pdf-w, 30vw); }
.pdf-resize { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 2; touch-action: none; }
.pdf-resize::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.pdf-resize:hover::after, .pdf-resize:focus-visible::after, body.pdf-resizing .pdf-resize::after { background: var(--primary); }
.pdf-resize:focus-visible { outline: none; }
.pdf-resize i { position: absolute; left: 1px; top: 50%; width: 8px; height: 36px; margin-top: -18px; border-radius: 4px; background: var(--border-strong); border: 1px solid var(--surface); }
body.pdf-resizing { cursor: col-resize; user-select: none; }
body.pdf-resizing iframe { pointer-events: none; }
@media (max-width: 900px) {
  .pdf-pane { width: 100vw; }
  .pdf-resize { display: none; }
  body.pdf-open > main { margin-right: 0; }
}

/* ---- Échéance du mandat : normal, orange (< 3 mois), rouge (< 1 mois), expiré (rouge + alerte) ---- */
.mandate-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mandate-end { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mandate-end.m-ok { color: var(--text); }
.mandate-end.m-orange { color: var(--warn); font-weight: 700; }
.mandate-end.m-rouge { color: var(--err); font-weight: 700; }
.mandate-end.m-expire { color: var(--err); font-weight: 700; background: var(--err-soft); border-radius: 6px; padding: 1px 6px; }
.mandate-end.m-aucun { color: var(--muted); }
.alert-ic { width: 15px; height: 15px; flex: none; }
.flash .alert-ic { vertical-align: -3px; }

/* ---- Validateur européen DSS ---- */
.dssrep { border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: var(--surface-2); }
.dssrep.dss-valide { border-left-color: var(--ok); }
.dssrep.dss-indeterminee, .dssrep.dss-erreur { border-left-color: var(--warn); }
.dssrep.dss-invalide { border-left-color: var(--err); }
.dssrep-head { display: flex; gap: 10px; align-items: flex-start; }
.dss-flag { flex: none; display: inline-grid; place-items: center; width: 30px; height: 22px; border-radius: 4px; background: #003399; color: #ffcc00;
  font: 800 11px/1 system-ui, sans-serif; letter-spacing: .5px; }
.dssrep ul { margin: 6px 0 0 18px; padding: 0; }
.dss-mini { display: inline-block; margin-top: 3px; font-size: .74rem; font-weight: 700; padding: 0 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.dss-mini.dss-valide { background: var(--ok-soft); color: var(--ok); }
.dss-mini.dss-indeterminee, .dss-mini.dss-erreur { background: var(--warn-soft); color: var(--warn); }
.dss-mini.dss-invalide { background: var(--err-soft); color: var(--err); }

/* ---- Renouvellement anticipé (espace adhérent) ---- */
.renew-card > summary { cursor: pointer; display: flex; flex-direction: column; gap: 4px; list-style: none; }
.renew-card > summary::-webkit-details-marker { display: none; }
.renew-card > summary::after { content: "Renouveler maintenant ▸"; align-self: flex-start; margin-top: 6px; font-weight: 700; color: var(--primary); font-size: .9rem; }
.renew-card[open] > summary::after { content: none; }
.renew-card[open] > summary { margin-bottom: 12px; }
.renew-card { border: 1px solid #f2d3a2; background: linear-gradient(180deg, var(--warn-soft), var(--surface) 70%); }
.tpl-client { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 6px 0; }
.tpl-client > summary { cursor: pointer; font-weight: 600; }
.renew-mode { margin-bottom: 8px; }
.renew-mode label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 11px; font-size: .85rem; cursor: pointer; }

/* ---- Page Adhérents : onglets, tableau paginé ajusté à l'écran, sélection et actions groupées ---- */
.page-tabs { margin: -6px 0 12px; }
.page-tabs button { font-size: .92rem; padding: 6px 14px; }
.mtable-card { padding: 12px 16px 8px; }
.mtable-card .grid-toolbar { margin-bottom: 6px !important; }
.mtable-card .mt-bulk { padding: 6px 10px; }
.mtable-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.mtable { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.mtable th, table.mtable td { padding: 0 10px; height: 34px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.mtable thead th { background: var(--surface-2); font-size: .78rem; color: var(--muted); font-weight: 700; height: 32px; }
table.mtable thead th[data-sort] { cursor: pointer; user-select: none; }
table.mtable thead th[data-sort]:hover { color: var(--text); }
table.mtable thead th .sort-ar { opacity: .6; margin-left: 3px; }
table.mtable tbody tr:hover td { background: var(--row-hover); }
table.mtable tbody tr.sel td { background: var(--primary-soft); }
table.mtable tbody tr:last-child td { border-bottom: 0; }
table.mtable td.ck, table.mtable th.ck { width: 34px; padding: 0 0 0 12px; }
table.mtable td.name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
table.mtable td.name a { color: var(--text); font-weight: 600; text-decoration: none; }
table.mtable td.name a:hover { color: var(--primary); text-decoration: underline; }
table.mtable td.clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
table.mtable .empty { text-align: center; color: var(--muted); height: 80px; }
.mt-pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 2px 0; font-size: .84rem; }
.mt-pager .pages { display: flex; gap: 3px; }
.mt-pager .pages button { min-width: 30px; height: 28px; border: 1px solid var(--border); background: var(--field); border-radius: 7px; cursor: pointer; color: var(--text); }
.mt-pager .pages button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.mt-pager .pages button:disabled { opacity: .4; cursor: default; }
.mt-pager .pages .gap { padding: 0 4px; color: var(--muted); align-self: center; }
.mt-pager select { height: 28px; padding: 0 6px; width: auto; }
.mt-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); }
.mt-bulk .scope { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.mt-bulk .scope button { border: 0; background: var(--field); padding: 4px 11px; font-size: .82rem; cursor: pointer; color: var(--muted); }
.mt-bulk .scope button.on { background: var(--primary-soft); color: var(--primary-2); font-weight: 700; }
.mt-bulk .scope button:disabled { opacity: .45; cursor: default; }
.mt-bulk .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.mt-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mt-filters input[type=date] { height: 30px; padding: 0 6px; width: auto; }
.mt-filters select { height: 30px; padding: 0 6px; width: auto; }
.mt-filters .lbl { font-size: .8rem; color: var(--muted); }
.camp-pick { display: grid; gap: 6px; margin: 10px 0; max-height: 300px; overflow: auto; }
.camp-pick label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.camp-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.choice-row label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.choice-row label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
html.fit-page, html.fit-page body { overflow: hidden; }
html.fit-page main.container { padding-bottom: 12px; }

/* ---- Filtres et tri multicritère des tableaux (static/table_tools.js) ---- */
table.list.tt thead tr.tt-filters th { padding: 4px 6px; background: var(--surface-2); font-weight: 400; }
table.list.tt thead tr.tt-filters input, table.list.tt thead tr.tt-filters select,
table.mtable thead tr.mt-colf input, table.mtable thead tr.mt-colf select {
  width: 100%; min-width: 70px; height: 26px; padding: 0 6px; font-size: .78rem; border-radius: 6px; }
table.list.tt th.tt-sortable { cursor: pointer; user-select: none; }
table.list.tt th.tt-sortable:hover { color: var(--primary); }
table.list .tt-ar, table.mtable .sort-ar { margin-left: 4px; font-size: .72rem; color: var(--primary); opacity: 1; }
table.list .tt-ar sup, table.mtable .sort-ar sup { font-size: .62rem; margin-left: 1px; }
table.list tr.tt-hide { display: none; }
.tt-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin: 4px 0 6px; }
.tt-bar .tt-count { font-weight: 600; color: var(--text); }
.tt-bar .tt-count:empty { display: none; }
.tt-bar .tt-reset { margin-left: auto; border: 0; background: none; color: var(--primary); cursor: pointer; font-size: .78rem; padding: 0; }
.tt-bar .tt-reset:hover { text-decoration: underline; }
table.mtable thead tr.mt-colf th { height: 34px; padding: 3px 6px; background: var(--surface); }
.mandate-end.m-aucun { color: var(--warn); font-weight: 600; }
.mandate-end.m-aucun .alert-ic { color: var(--warn); }

/* ---- Suppression d'un consentement (administrateur général) ---- */
.danger-zone { border: 1px solid color-mix(in srgb, var(--err) 40%, var(--border)); }
.danger-zone > summary { cursor: pointer; color: var(--err); }
.danger-zone[open] > summary { margin-bottom: 10px; }
.danger-zone label { display: block; margin: 8px 0; }

/* ---- Logo agrandi dans la barre du haut : la barre garde sa hauteur, 6 px de marge en haut et en bas.
   Le dessin (alvéoles, 216,5 × 140) est plus large que haut : la boîte suit ses proportions. ---- */
.topbar .brand img.brand-mark { height: 52px; width: 80px; object-fit: contain; }
.staff-top .brand img.brand-mark { height: 54px; width: 84px; }
