/* BYC Study — espace équipe (console) et espace client.
   Mêmes fondations que la page d'accueil : Instrument Sans, bleu marine,
   bleu roi en accent, or en touches décoratives, rouge pour les erreurs. */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("instrument-sans-latin.e35fad09c70b.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("instrument-sans-latin-ext.e2385a017626.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+A720-A7FF;
}

:root {
  /* Couleurs BYC Study. L'or reste décoratif (trop clair pour du texte) ;
     le rouge est réservé aux erreurs : retard, refus, suppression. */
  --bg: #F7F8FB;
  --surface: #FFFFFF;
  --sunk: #EEF1F6;
  --ink: #06286D;          /* Navy Blue */
  --ink-dark: #041D52;
  --soft: #3F4A66;
  --muted: #5B6582;
  --faint: #8A93A8;
  --line: #E3E7EF;
  --line-strong: #D0D6E2;
  --accent: #0E6BD8;       /* Royal Blue */
  --accent-bg: #E3EEFC;
  --gold: #D8A73A;         /* Gold */
  --gold-bg: #FBF3E1;
  --danger: #C8372D;
  --danger-dark: #A12A22;
  --danger-bg: #FBEAE7;
  --ok: #2F7A3E;
  --ok-bg: #E4F0DF;
  --review: #0E6BD8;
  --peach: #F6D8C6;
  --sky: #D6E3F2;
  --butter: #F4E4A6;
  --sage: #D7E6CF;
  --lilac: #E6D7EA;
  --rose: #F2D2CD;
  --wa: #25D366;
  --wa-dark: #1EA854;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(6, 40, 109, .04), 0 4px 16px rgba(6, 40, 109, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--faint); }
.hint { font-size: 13px; color: var(--muted); }
.eyebrow { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }


/* ---- Menu latéral de l'équipe ---------------------------------------- */
.brand { font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; display: inline-flex; align-items: center; }
.brand-logo { display: block; height: 38px; width: auto; }
.brand-logo--lg { height: 64px; margin-bottom: 4px; }
.brand-sub { font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line-strong); }
.sb {
  position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 30; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px 12px;
}
.sb-brand { padding: 2px 8px 18px; }
.sb-nav { display: grid; gap: 2px; align-content: start; flex: 1; overflow-y: auto; }
.sb-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--soft); font-weight: 500;
}
.sb-nav a .ic { color: var(--faint); }
.sb-nav a:hover { background: var(--sunk); color: var(--ink); }
.sb-nav a[aria-current="page"] { background: var(--accent-bg); color: var(--ink); font-weight: 600; }
.sb-nav a[aria-current="page"] .ic { color: var(--accent); }
.sb-nav .nav-count { margin-left: auto; }
.sb-sep { font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 18px 10px 6px; }
.sb-foot { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 2px; }
.sb-foot form { margin: 0; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); text-decoration: none; min-width: 0; }
.sb-user:hover, .sb-user[aria-current="page"] { background: var(--sunk); }
.sb-user-txt { display: grid; min-width: 0; line-height: 1.25; }
.sb-user-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-txt small { font-size: 12px; color: var(--muted); }
.sb-out { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--muted); font-size: 13.5px; cursor: pointer; text-align: left; }
.sb-out:hover { background: var(--danger-bg); color: var(--danger); }
.sb-out .ic { width: 16px; height: 16px; }
.tb, .sb-veil { display: none; }
body[data-view="staff"] { padding-left: 232px; }
@media (max-width: 899px) {
  body[data-view="staff"] { padding-left: 0; }
  .tb { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .tb .brand-logo { height: 32px; }
  .tb-menu { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-sm); cursor: pointer; }
  .tb-menu:hover { background: var(--sunk); }
  .sb { transform: translateX(-100%); transition: transform .18s ease; width: 264px; box-shadow: var(--shadow); }
  .sb-toggle:checked ~ .sb { transform: none; }
  .sb-toggle:checked ~ .sb-veil { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(6, 40, 109, .28); }
}
@media print { .sb, .tb { display: none !important; } body[data-view="staff"] { padding-left: 0; } }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--lilac); color: var(--ink);
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 44px; height: 44px; font-size: 14px; }
.who { display: inline-flex; align-items: center; gap: 8px; }

/* ---- Page ---------------------------------------------------------- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 16px 80px; }
@media (min-width: 900px) { .page { padding: 36px 32px 96px; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 30px; letter-spacing: -0.025em; }
.lead { color: var(--soft); margin-top: 6px; max-width: 640px; }
.h2 { font-size: 20px; margin: 40px 0 12px; }
.empty-page { max-width: 420px; margin: 60px auto; text-align: center; display: grid; gap: 12px; justify-items: center; color: var(--soft); }
.empty-page .ic { width: 32px; height: 32px; color: var(--faint); }
.empty-page h1 { color: var(--ink); font-size: 24px; }

/* ---- Boutons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: var(--faint); }
.btn .ic { width: 16px; height: 16px; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--ink-dark); border-color: var(--ink-dark); }
.btn--sm { padding: 5px 10px; font-size: 13px; gap: 5px; border-radius: 7px; }
.btn--sm .ic { width: 14px; height: 14px; }
.btn--ok { color: var(--ok); }
.btn--ok:hover { background: var(--ok-bg); border-color: var(--ok); }
.btn--ok-solid { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn--danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger-solid:hover { background: var(--danger-dark); }
.btn--wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-dark); border-color: var(--wa-dark); }
.btn--block { width: 100%; margin-top: 14px; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--sunk); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn--danger:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); }
.icon-btn .ic { width: 16px; height: 16px; }

/* ---- Puces, pastilles, badges -------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.chip--peach { background: var(--peach); }
.chip--rose { background: var(--rose); }
.chip--butter { background: var(--butter); }
.chip--sky { background: var(--sky); }
.chip--line { border-color: var(--line-strong); color: var(--soft); font-weight: 500; }
.chip--btn { border-color: var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; padding: 4px 10px; }
.chip--btn:hover { border-color: var(--ink); }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill--a_fournir, .pill--a_faire { background: var(--butter); }
.pill--envoye { background: var(--sky); color: var(--review); }
.pill--valide, .pill--fait { background: var(--ok-bg); color: var(--ok); }
.pill--refuse { background: var(--danger-bg); color: var(--danger); }
.pill--dispense, .pill--a_venir { background: var(--sunk); color: var(--muted); }
.pill--admin { background: var(--ink); color: var(--bg); }
.pill--advisor { background: var(--lilac); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin: 0 4px 4px 0; }
.badge--late { background: var(--danger-bg); color: var(--danger); }
.badge--review { background: var(--sky); color: var(--review); }
.late { color: var(--danger); font-weight: 600; }
.c-late { color: var(--danger); }
.c-review { color: var(--review); }

.tag { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--sunk); padding: 1px 7px; border-radius: 5px; white-space: nowrap; }
.tag--extra { background: var(--lilac); color: var(--ink); }

/* ---- Indicateurs ---------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 820px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi--btn { cursor: pointer; }
.kpi--btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

/* ---- Filtres -------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .search input, .fld input, .fld select, .fld textarea, .note-form textarea, .case-side select {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 14px; min-height: 38px;
}
.filters select { padding-right: 28px; }
.search { position: relative; flex: 1 1 240px; max-width: 340px; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search input { width: 100%; padding-left: 34px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--soft); cursor: pointer; padding: 0 4px; }
.switch input { width: 16px; height: 16px; accent-color: var(--ink); }

/* ---- Tableau -------------------------------------------------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 820px; }
.table--static { min-width: 560px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px; background: var(--sunk); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover td { background: #FAFBFD; }
.table .c { text-align: center; }
.table .y { color: var(--ok); }
.table .y .ic { width: 16px; height: 16px; }
.table--perm td:first-child { width: 46%; }
.row-link { text-decoration: none; }
.row-link:hover b { text-decoration: underline; }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.clamp { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px !important; }

.mini { display: inline-flex; gap: 3px; }
.mini i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.mini i.done { background: var(--ink); }
.mini i.cur { background: var(--accent); }

/* ---- Dossier -------------------------------------------------------- */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.back .ic { width: 16px; height: 16px; }
.case-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 24px; }
.case-head h1 { font-size: 30px; letter-spacing: -0.025em; margin: 4px 0 4px; }
.case-prog { font-size: 13.5px; color: var(--soft); margin-left: 4px; }
.case-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 600; }
.banner--ok { background: var(--ok-bg); color: var(--ok); }

.stepper { list-style: none; margin: 0 0 24px; padding: 18px 20px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.st { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; }
.st:not(:last-child)::after { content: ""; position: absolute; left: 40px; right: 6px; top: 15px; height: 2px; background: var(--line); z-index: 0; display: none; }
.st-node {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 700; background: var(--sunk); color: var(--muted); border: 2px solid var(--line);
}
.st-node .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.st-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.st-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-txt small { font-size: 12px; color: var(--muted); }
.st--done .st-node { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.st--cur .st-node { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-bg); }
.st--cur .st-txt small { color: var(--accent); font-weight: 600; }
.st--next .st-txt b { color: var(--muted); }
@media (max-width: 860px) {
  .stepper { grid-template-columns: 1fr; gap: 12px; }
}

.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .case-grid { grid-template-columns: 1fr; } }
.case-main { display: grid; gap: 12px; }

.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage--cur { border-color: var(--line-strong); box-shadow: var(--shadow); }
.stage > summary, .pstage-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.stage > summary::-webkit-details-marker { display: none; }
.stage > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); margin: -4px 4px 0 4px; transition: transform .15s; }
.stage[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.stage[open] > summary { border-bottom: 1px solid var(--line); }
.stage-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--sunk); color: var(--muted); flex: none; }
.stage-num .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.stage--done .stage-num { background: var(--ink); color: var(--bg); }
.stage--cur .stage-num { background: var(--accent); color: #fff; }
.stage-name { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.stage-name b { font-size: 16px; }
.stage-name small { color: var(--muted); font-size: 13px; }
.stage-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dot-alert { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.grp { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 14px 18px 4px; }
.pad { padding: 16px 18px; }

.items, .pitems { list-style: none; margin: 0; padding: 0 8px 8px; }
.item, .pitem { display: flex; gap: 12px; padding: 12px 10px; border-radius: 10px; align-items: flex-start; }
.item + .item, .pitem + .pitem { border-top: 1px solid var(--line); }
.item.is-late { background: linear-gradient(90deg, var(--danger-bg), transparent 60%); }
.item--envoye { background: linear-gradient(90deg, #EAF2FD, transparent 60%); }
.item--a_venir .item-title b, .item--dispense .item-title b { color: var(--muted); }
.item--dispense .item-title b { text-decoration: line-through; }
.item-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.item-ic--doc { background: var(--sky); color: var(--review); }
.item-ic--step { background: var(--sage); color: var(--ok); }
.item--a_venir .item-ic, .item--dispense .item-ic { background: var(--sunk); color: var(--faint); }
.item-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.item-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item-title b { font-size: 14.5px; font-weight: 600; }
.item-meta { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.item-meta .ic { width: 15px; height: 15px; margin-top: 2px; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--soft); font-weight: 500; }
.due .ic { width: 14px; height: 14px; }
.due--late { color: var(--danger); font-weight: 600; }
.reason { font-size: 13px; background: var(--danger-bg); color: #7A2019; border-radius: 8px; padding: 8px 10px; margin-top: 4px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.item-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .item { flex-wrap: wrap; }
  .item-side { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; padding-left: 44px; }
}
.stage-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--sunk); border-top: 1px solid var(--line); font-size: 14px; color: var(--soft); }
.stage-foot .ok { color: var(--ok); font-weight: 600; }

/* ---- Colonne latérale ---------------------------------------------- */
.case-side { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card-h { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.case-side select { width: 100%; }
.dl { margin: 0; display: grid; gap: 8px; }
.dl div { display: grid; gap: 1px; }
.dl dt { font-size: 12.5px; color: var(--muted); }
.dl dd { margin: 0; font-size: 14px; word-break: break-word; }

.seg { display: flex; background: var(--sunk); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px 8px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--soft); cursor: pointer; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg--inline { display: inline-flex; }
.seg--inline button { flex: none; padding: 6px 12px; }
.card .hint { margin: 8px 0 10px; }
.notes { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.note { background: var(--sunk); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note--shared { background: var(--sage); }
.note small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.note-form { display: grid; gap: 8px; justify-items: end; }
.note-form textarea { width: 100%; resize: vertical; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; color: var(--soft); }
.log li { padding-left: 14px; position: relative; }
.log li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.log b { color: var(--ink); font-weight: 600; }
.log small { display: block; color: var(--faint); font-size: 12px; }

/* ---- Processus ------------------------------------------------------ */
.ptabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.ptab { text-decoration: none; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 600; display: flex; flex-direction: column; line-height: 1.25; min-width: 120px; }
.ptab small { font-weight: 500; font-size: 12px; color: var(--muted); }
.ptab:hover { border-color: var(--line-strong); }
.ptab.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ptab.is-on small { color: #A9B8D9; }
.pbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.pbar > div:first-child { display: flex; flex-direction: column; }
.pbar span { font-size: 13px; color: var(--muted); }
.pbar--draft { background: var(--gold-bg); border-color: #EBD39A; }
.pbar-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.preview { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.preview-lbl { font-size: 13px; font-weight: 600; color: var(--soft); }
.preview-count { font-size: 13px; color: var(--muted); margin-left: auto; }
.note-info { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.note-info .ic { width: 15px; height: 15px; }
.pstages { display: grid; gap: 14px; }
.pstage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pstage-h { cursor: default; border-bottom: 1px solid var(--line); background: #FAFBFD; }
.pstage .stage-num { background: var(--ink); color: var(--bg); }
.pitems { padding-top: 6px; }
.pitem { align-items: center; }
.pitem.is-off { opacity: .42; }
.pitem-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.ptag { font-size: 12px; color: var(--muted); background: var(--sunk); padding: 1px 8px; border-radius: 5px; }
.ptag--on { background: var(--lilac); color: var(--ink); font-weight: 600; }
.ptag--off { background: transparent; border: 1px dashed var(--line-strong); }
.pitem-acts { display: flex; gap: 2px; flex: none; }
@media (max-width: 640px) {
  .pitem { flex-wrap: wrap; }
  .pitem-acts { width: 100%; justify-content: flex-end; }
}
.add-row { display: flex; align-items: center; gap: 8px; width: calc(100% - 16px); margin: 0 8px 8px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: transparent; color: var(--soft); cursor: pointer; font-weight: 500; font-size: 14px; }
.add-row:hover { border-color: var(--ink); color: var(--ink); background: var(--bg); }
.add-row .ic { width: 16px; height: 16px; }

/* ---- Fenêtres ------------------------------------------------------- */
dialog { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(6,40,109,.22); }
dialog.m-wide { width: min(680px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(6, 40, 109, .38); }
.m { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.m-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.m-h h2 { font-size: 19px; }
.m-b { padding: 4px 20px 16px; overflow-y: auto; display: grid; gap: 14px; }
.m-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #FAFBFD; flex-wrap: wrap; }
.m-lead { color: var(--soft); }
.fld { display: grid; gap: 5px; border: 0; margin: 0; padding: 0; min-width: 0; }
.fld > span, .fld legend { font-size: 13px; font-weight: 600; color: var(--soft); padding: 0; margin-bottom: 5px; }
.fld input, .fld select, .fld textarea { width: 100%; }
.fld textarea { resize: vertical; }
.fld--row { grid-template-columns: auto 180px; align-items: center; justify-content: start; gap: 12px; }
.fld--row > span { margin: 0; }
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .fld-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--soft); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--ink); width: 16px; height: 16px; }
.radios { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.radios-sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }
.radio { position: relative; cursor: pointer; }
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--surface); }
.radio span .ic { width: 16px; height: 16px; }
.radio input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.radio input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.radio--check input:checked + span { background: var(--lilac); color: var(--ink); border-color: #BFA6C6; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.file-prev { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; background: var(--sunk); border-radius: var(--radius); text-align: center; }
.file-prev .ic { width: 40px; height: 40px; color: var(--review); }
.file-prev span { font-size: 13px; color: var(--muted); }
.file-prev em { font-size: 12.5px; color: var(--faint); margin-top: 8px; }
.warn { background: var(--gold-bg); border: 1px solid #EBD39A; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.miss { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.miss li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.miss li .pill { margin-left: auto; }
.miss .ic { width: 16px; height: 16px; color: var(--muted); }
.warn .miss li::before { content: "·"; color: var(--muted); }
.calc-note { display: flex; gap: 8px; align-items: flex-start; background: var(--sunk); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--soft); }
.calc-note .ic { width: 16px; height: 16px; margin-top: 2px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---- Espace client ------------------------------------------------- */
body[data-view="client"], body[data-view="preview"] { background: #F1F4F9; }
.preview-banner { background: var(--butter); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; font-size: 14px; font-weight: 500; }
.preview-banner > span { display: inline-flex; align-items: center; gap: 8px; }
.chd { background: var(--surface); border-bottom: 1px solid var(--line); }
.chd-in { max-width: 560px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.chd-user { font-size: 14px; color: var(--soft); font-weight: 500; }
.cpage { max-width: 560px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 16px; }
.chello h1 { font-size: 28px; letter-spacing: -0.025em; }
.chello p { color: var(--soft); margin-top: 4px; font-size: 14.5px; }
.stepper--client { margin: 0; padding: 14px; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stepper--client .st { flex-direction: column; text-align: center; gap: 6px; }
.stepper--client .st-txt b { font-size: 12px; white-space: normal; }
.stepper--client .st-txt small { font-size: 11px; }
.stepper--client .st-node { width: 28px; height: 28px; }
.cnow { background: var(--ink); color: var(--bg); border-radius: var(--radius-lg); padding: 20px; }
.cnow .eyebrow { color: #A9B8D9; }
.cnow h2 { font-size: 24px; margin: 4px 0 4px; }
.cnow p { color: #D6DEEF; }
.cnow small { color: #A9B8D9; font-size: 13px; }
.cbar { height: 6px; background: #1B3D82; border-radius: 3px; margin: 16px 0 8px; overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.csec h2 { font-size: 17px; margin: 8px 0 10px; display: flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.cmore .count { background: var(--line-strong); color: var(--ink); }
.ctasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ctask { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; }
.ctask--refuse { border-color: #E8B4AE; }
.ctask-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ctask-top b { font-size: 15.5px; }
.ctask-hint { font-size: 14px; color: var(--soft); }
.ctask-by { font-size: 12.5px; color: var(--muted); }
.ctask-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.cempty { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--soft); }
.cempty .ic { color: var(--ok); }
.clist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.clist li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; }
.clist li + li { border-top: 1px solid var(--line); }
.clist li > .ic { color: var(--muted); margin-top: 2px; }
.clist li.is-done > .ic { color: var(--ok); }
.clist span { display: flex; flex-direction: column; }
.clist b { font-weight: 600; font-size: 14.5px; }
.clist small { color: var(--muted); font-size: 13px; }
.cmsgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cmsgs li { background: var(--sage); border-radius: 14px 14px 14px 4px; padding: 12px 14px; }
.cmsgs small { display: block; color: var(--soft); font-size: 12px; margin-top: 4px; }
.cmore { margin-bottom: 8px; }
.cmore summary { cursor: pointer; font-weight: 600; padding: 8px 0; display: flex; align-items: center; gap: 8px; }
.cmore .hint { margin-bottom: 8px; }
.cadv { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.cadv div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.cadv small { color: var(--muted); font-size: 12.5px; }

/* ---- Ajouts Django --------------------------------------------------- */
.hd-logout { border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px 6px; }
.hd-logout:hover { color: var(--ink); text-decoration: underline; }
.msgs { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); animation: msg-out .3s ease 5s forwards; }
.msg { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.msg--error { background: var(--danger); color: #fff; }
@keyframes msg-out { to { opacity: 0; visibility: hidden; } }
.inline { display: inline; margin: 0; }
.item-acts form { margin: 0; }
.item-title a { color: inherit; }
.item { scroll-margin-top: 90px; }
.page-narrow { max-width: 720px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 18px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 24px; }
.login-card .btn--primary { width: 100%; padding: 11px; }
.login-demo { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; }
.login-demo p { font-size: 13px; color: var(--muted); }
.login-demo div { display: flex; flex-wrap: wrap; gap: 6px; }
.errorlist { list-style: none; margin: 0; padding: 10px 12px; background: var(--danger-bg); color: #7A2019; border-radius: 8px; font-size: 14px; }
.cform { margin: 0; }
.seg-a { flex: 1; text-align: center; text-decoration: none; padding: 6px 10px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--soft); }
.seg--inline .seg-a { flex: none; padding: 6px 12px; }
.seg-a[aria-selected="true"], .seg-a[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
a.icon-btn, a.add-row { text-decoration: none; }
.flag { width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); vertical-align: -1px; flex: none; object-fit: cover; }
.chip .flag { margin-right: 6px; }
.radio span .flag { margin-right: 2px; }
.ptab > span { display: inline-flex; align-items: center; gap: 6px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .02em; }
.chd-acts { display: flex; align-items: center; gap: 4px; }
.chd-acts form { margin: 0; }
a.hd-logout { text-decoration: none; }
.sel-sm { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 7px; padding: 4px 8px; font-size: 13px; }
.row-acts { white-space: nowrap; text-align: right; }
.row-acts form { margin-left: 4px; }
tr.is-inactive td { color: var(--muted); }
.creds { background: var(--ok-bg); border: 1px solid #B9D6AE; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; display: grid; gap: 10px; }
.creds-h { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.creds-h b { color: var(--ink); }
.creds-dl { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 32px; }
.creds-dl dt { font-size: 12.5px; color: var(--soft); }
.creds-dl dd { margin: 0; font-size: 17px; font-weight: 600; }
.creds-f { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.creds-f p { font-size: 13.5px; color: var(--soft); max-width: 560px; }

/* ---- Espace client : une colonne sur téléphone, deux sur grand écran ---- */
.chd-in, .cpage { max-width: 1120px; }
.cgrid { display: grid; gap: 16px; }
.cmain, .cside { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (min-width: 900px) {
  .cpage { padding: 36px 32px 80px; gap: 20px; }
  .chello h1 { font-size: 34px; }
  .cgrid { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .cside { position: sticky; top: 24px; }
  .stepper--client { padding: 18px 20px; gap: 8px; }
  .stepper--client .st { flex-direction: row; text-align: left; gap: 10px; }
  .stepper--client .st-txt b { font-size: 14px; white-space: nowrap; }
  .stepper--client .st-txt small { font-size: 12px; }
  .stepper--client .st-node { width: 30px; height: 30px; }
}
.cside .csec h2 { font-size: 15px; }

/* ---- Menu du compte (en-tête) --------------------------------------- */
.umenu { margin-left: auto; position: relative; }
.umenu-btn {
  display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer;
  padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent;
}
.umenu-btn::-webkit-details-marker { display: none; }
.umenu-btn:hover, .umenu[open] .umenu-btn { background: var(--sunk); border-color: var(--line); }
.umenu-name { font-size: 14px; font-weight: 600; }
.umenu-caret { width: 12px; height: 12px; color: var(--muted); transition: transform .15s; }
.umenu[open] .umenu-caret { transform: rotate(180deg); }
.umenu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 248px; z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(6, 40, 109, .12); padding: 6px;
}
.umenu-who { display: grid; gap: 2px; padding: 10px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.umenu-who b { font-size: 14px; }
.umenu-who span { font-size: 13px; color: var(--muted); word-break: break-all; }
.umenu-who .umenu-role {
  justify-self: start; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-bg); padding: 2px 8px; border-radius: 999px; word-break: normal;
}
.umenu-panel form { margin: 0; }
.umenu-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer;
}
.umenu-item:hover { background: var(--sunk); }
.umenu-item--out { color: var(--danger); }
.umenu-item--out:hover { background: var(--danger-bg); }

/* =====================================================================
   Parcours client : formulaire public, invitation, questionnaire, contrat.
   Pensé d'abord pour le téléphone : une colonne, cibles tactiles de 48 px,
   texte des champs à 16 px (pas de zoom automatique sur iPhone), barre
   d'actions collée en bas de l'écran.
   ===================================================================== */
.qpage { max-width: 640px; margin: 0 auto; padding: 20px 16px calc(120px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .qpage { padding-top: 36px; } }
.qhead { margin: 8px 0 18px; }
.qhead h1 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; }
.qhead p { color: var(--soft); margin-top: 6px; font-size: 15px; }
.qform { display: grid; gap: 14px; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; display: grid; gap: 16px; }
@media (min-width: 700px) { .qcard { padding: 22px 24px; } }
.qcard h2 { font-size: 17px; }
.qrow { display: grid; gap: 16px; }
@media (min-width: 520px) { .qrow { grid-template-columns: 1fr 1fr; } }
.qf { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.qf[hidden] { display: none; }
.ql { font-size: 14.5px; font-weight: 600; color: var(--ink); padding: 0; }
.qreq { color: var(--danger); }
.qhint { font-size: 13px; color: var(--muted); margin-top: -2px; }
.qf input:not([type=radio]):not([type=checkbox]), .qf select, .qf textarea {
  width: 100%; font-size: 16px; min-height: 48px; padding: 11px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.qf select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.qf textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.qf input:focus, .qf select:focus, .qf textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.qf--err input, .qf--err select, .qf--err textarea { border-color: var(--danger); }
.qerr { color: var(--danger); font-size: 13.5px; font-weight: 500; }
.qalert { background: var(--danger-bg); color: #7A2019; border-radius: 10px; padding: 12px 14px; font-size: 14.5px; }
.qstatic { font-size: 16px; padding: 4px 0; word-break: break-all; }
.qtrap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Choix : grandes pastilles, une par ligne sur téléphone. */
.qopts { display: grid; gap: 8px; }
.qopts--inline { grid-template-columns: 1fr 1fr; }
@media (min-width: 520px) { .qopts--grid { grid-template-columns: 1fr 1fr; } }
.qopt { position: relative; cursor: pointer; }
.qopt input { position: absolute; opacity: 0; pointer-events: none; }
.qopt span {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-size: 15.5px; font-weight: 500;
}
.qopt span::before { content: ""; width: 18px; height: 18px; flex: none; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); }
.qopt--check span::before { border-radius: 5px; }
.qopt input:checked + span { border-color: var(--accent); background: var(--accent-bg); color: var(--ink); }
.qopt input:checked + span::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
/* Destination pas encore ouverte : visible, grisée, non cochable. */
.qopt--off { cursor: not-allowed; }
.qopt--off span { color: var(--soft); background: var(--bg); border-style: dashed; }
.qopt--off small { margin-left: auto; font-size: 0.75rem; font-weight: 600; color: var(--soft); }
.qopt--check input:checked + span::before { box-shadow: none; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.qopt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.qopt .flag { margin-right: 2px; }
.qcheck { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; cursor: pointer; }
.qcheck input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.qcheck a { color: var(--accent); }
.qconsent { padding: 4px 2px; }
.qnotice { font-size: 13px; line-height: 1.5; color: var(--muted); }
.qnotice a { color: var(--accent); }

/* Groupes répétables (formations, voyages, famille…). */
.qrows { display: grid; gap: 10px; }
.qrowcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 12px; background: var(--bg); }
.qrowcard-h { display: flex; justify-content: space-between; align-items: center; }
.qrowcard-h b { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.qremove { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--danger); font-size: 13.5px; cursor: pointer; padding: 6px; min-height: 36px; }
.qremove .ic { width: 15px; height: 15px; }
.qf--sub .ql { font-size: 13.5px; font-weight: 500; color: var(--soft); }
.qadd { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: none; color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; }
.qadd:hover { border-color: var(--accent); background: var(--accent-bg); }
.qadd .ic { width: 18px; height: 18px; }

/* Progression et navigation. */
.qprog { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0 12px; margin: -4px 0 4px; }
.qprog-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.qprog-top span:last-child { font-weight: 600; color: var(--ink); text-align: right; }
.qprog-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.qprog-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.qnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 10px; justify-content: space-between;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
.qnav > * { flex: 1; }
.qnav > span:empty { display: none; }
.qnav--single > * { flex: 1; }
@media (min-width: 700px) {
  .qnav { position: static; background: none; border: 0; padding: 6px 0 0; backdrop-filter: none; }
  .qnav > * { flex: 0 0 auto; }
  .qnav > span:empty { display: block; }
  .qnav--single { justify-content: flex-end; }
}
/* Formulaire public en étapes : écrans, boutons et barre masqués par app.js. */
.qform [hidden] { display: none; }
.qnav [data-step-next], .qnav [data-step-submit] { margin-left: auto; }
.btn--lg { min-height: 50px; padding: 12px 20px; font-size: 16px; border-radius: 12px; }
.qsave-note { font-size: 13.5px; color: var(--muted); text-align: center; }
.qlink { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 4px; text-decoration: underline; }

/* Contrat. */
.qcontract-title { font-size: 18px; }
.qcontract-title small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.qcontract { max-height: 55vh; overflow-y: auto; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14.5px; line-height: 1.55; }
.qcontract p + p { margin-top: 10px; }
.qcontract--full { max-height: none; overflow: visible; }
.qmissing { margin: 0 0 6px 18px; display: grid; gap: 4px; }
.qproof { margin: 18px 0 0; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 14px; }
.qproof dt { color: var(--muted); font-size: 12.5px; }
.qproof dd { margin: 0; }
.qhash { font-size: 12px; word-break: break-all; }
.qprint-acts { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.qprint-acts > span { display: flex; gap: 8px; flex-wrap: wrap; }
.qsig { max-width: 240px; max-height: 90px; display: block; }
.qstatus { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }

/* Signature tracée. */
.sigpad { position: relative; height: 180px; border: 1.5px dashed var(--line-strong, #C9CFDA); border-radius: 12px; background: var(--surface); }
.sigpad canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; border-radius: 12px; }
.sigpad-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; pointer-events: none; }
.sigpad.is-signed .sigpad-ph { display: none; }
.sigpad-clear { position: absolute; right: 8px; bottom: 8px; }
.qcode { font-size: 26px; letter-spacing: 8px; text-align: center; max-width: 240px; font-variant-numeric: tabular-nums; }
.qresend { text-align: center; margin-top: 14px; }
@media print {
  .noprint, .chd, .hd, .msgs { display: none !important; }
  body { background: #fff; }
  .qpage { padding: 0; max-width: none; }
  .qcard { border: 0; padding: 0; }
}

/* Écrans de fin, résumé des réponses. */
.qdone { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 32px 4px 8px; }
.qdone h1 { font-size: 26px; }
.qdone p { color: var(--soft); max-width: 460px; }
.qdone-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.qdone-ic .ic { width: 28px; height: 28px; stroke-width: 2.2; }
.qdone-ic--warn { background: var(--gold-bg); color: #8A6414; }
.qdone-acts { display: grid; gap: 10px; width: 100%; max-width: 360px; margin-top: 8px; }
.qsum { margin-top: 12px; }
.qsum-dl { margin: 0; display: grid; gap: 10px; }
.qsum-dl div { display: grid; gap: 2px; }
@media (min-width: 700px) { .qsum-dl div { grid-template-columns: 220px 1fr; gap: 12px; } }
.qsum-dl dt { font-size: 13px; color: var(--muted); }
.qsum-dl dd { margin: 0; font-size: 14.5px; }
.qsum-line { display: block; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.qsum-line:last-child { border-bottom: 0; }

/* Invitation à remplir le questionnaire, dans l'espace client. */
.qcta { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--accent); color: #fff; text-decoration: none; box-shadow: 0 6px 20px rgba(14,107,216,.25); }
.qcta-txt { flex: 1; display: grid; gap: 2px; }
.qcta-txt b { font-size: 16px; }
.qcta-txt small { font-size: 13px; opacity: .9; }
.qcta-go { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.qcta--done { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.qcta--done .qcta-go { background: var(--sunk); }

/* ---- Équipe : demandes ---------------------------------------------- */
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: 14px; color: var(--soft); border: 1px solid var(--line); background: var(--surface); }
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs-n { opacity: .7; margin-left: 2px; }
.pill--lead-nouveau { background: var(--accent-bg); color: var(--accent); }
.pill--lead-contacte { background: var(--gold-bg); color: #8A6414; }
.pill--lead-converti { background: var(--ok-bg); color: var(--ok); }
.pill--lead-sans_suite { background: var(--sunk); color: var(--muted); }
.dl--2 { grid-template-columns: 1fr 1fr; gap: 12px 20px; }
@media (max-width: 560px) { .dl--2 { grid-template-columns: 1fr; } }
.lead-msg { margin-top: 14px; padding: 12px 14px; background: var(--bg); border-radius: 10px; font-size: 14.5px; }
.lead-msg dt { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.form-grid { display: grid; gap: 14px; }
.creds-url { font-size: 13.5px; word-break: break-all; background: var(--surface); border-radius: 8px; padding: 8px 10px; }
.creds-acts { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 760px) { .hd-nav { overflow-x: auto; scrollbar-width: none; } .hd-nav a { white-space: nowrap; } }

.item-ic--intake { background: var(--accent-bg); color: var(--accent); }


/* ---- Dossier : résumé, onglets, formulaires ---------------------------- */
.sum { display: grid; grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.sum > div { padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.sum > div + div { border-left: 1px solid var(--line); }
.sum-pct { flex-direction: row !important; align-items: center; gap: 14px !important; justify-content: flex-start !important; }
.sum-pct > div:last-child { display: grid; gap: 2px; }
.sum-k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sum-v { font-size: 15px; color: var(--soft); }
.sum-v b { color: var(--ink); font-size: 17px; }
.sum-sub { font-size: 13px; color: var(--muted); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; background: radial-gradient(closest-side, var(--surface) 78%, transparent 80%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.ring b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ring small { font-size: 11px; font-weight: 600; color: var(--muted); }
.track { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.track-i { display: grid; gap: 5px; min-width: 0; }
.track-i i { height: 6px; border-radius: 3px; background: var(--line); }
.track-i span { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-i--done i { background: var(--ink); }
.track-i--cur i { background: var(--accent); }
.track-i--cur span { color: var(--accent); font-weight: 600; }
.track-i--done span { color: var(--soft); }
.sum-next { border-radius: 0 var(--radius) var(--radius) 0; }
.sum-next--review { background: var(--accent-bg); }
.sum-next--late { background: var(--danger-bg); }
.sum-next--late .sum-v b { color: var(--danger); }
.sum-next--wait { background: var(--gold-bg); }
.sum-next--ok { background: var(--ok-bg); }
.sum-next--ok .sum-v b { color: var(--ok); }
@media (max-width: 1000px) {
  .sum { grid-template-columns: 1fr; }
  .sum > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .sum-next { border-radius: 0 0 var(--radius) var(--radius); }
}

.dtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.dtabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dtabs a:hover { color: var(--ink); }
.dtabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tab-n { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--sunk); border-radius: 999px; padding: 1px 8px; }

.grp { display: flex; align-items: center; gap: 8px; }
.grp span { font-size: 11.5px; background: var(--sunk); color: var(--muted); border-radius: 999px; padding: 0 7px; letter-spacing: 0; }
.grp--review { color: var(--review); }
.grp--client { color: #8A6414; }
.grp-done { border-top: 1px solid var(--line); }
.grp-done > summary { padding: 12px 18px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.grp-done > summary:hover { color: var(--ink); }
.stage-count { margin-left: auto; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.cols--2 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
@media (max-width: 860px) { .cols--2 { grid-template-columns: 1fr; } }
.cols select { width: 100%; }
.card-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-acts form { margin: 0; }

.forms-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.forms-head .lead { margin: 0; }
.forms { display: grid; gap: 12px; }
.form-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-name { flex: 1; min-width: 200px; display: grid; line-height: 1.3; }
.form-name b { font-size: 16px; }
.form-name small { color: var(--muted); font-size: 13px; }
.meter { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.meter b { white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 42px; }
.bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; max-width: 420px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar--ok i { background: var(--ok); }
.meter--sm { margin-top: 0; gap: 8px; }
.meter--sm .bar { width: 90px; flex: none; height: 6px; }
.meter--sm b { font-size: 13px; min-width: 0; }
.miss-d { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.miss-d > summary { font-size: 13.5px; font-weight: 600; color: #8A6414; cursor: pointer; }
.miss-l { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 20px; }
.miss-l li { display: grid; font-size: 14px; line-height: 1.3; padding-left: 12px; border-left: 2px solid var(--gold); }
.miss-l small { color: var(--faint); font-size: 12px; }
.next-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; }
.form-ok { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--ok); font-weight: 600; font-size: 14px; }
.form-ok .ic { width: 16px; height: 16px; }

.act { font-size: 13.5px; font-weight: 500; color: var(--soft); }
.act::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); margin-right: 7px; }
.act--review { color: var(--review); font-weight: 600; } .act--review::before { background: var(--review); }
.act--late { color: var(--danger); font-weight: 600; } .act--late::before { background: var(--danger); }
.act--wait::before { background: var(--gold); }
.act--team::before { background: var(--ink); }
.act--ok { color: var(--ok); font-weight: 600; } .act--ok::before { background: var(--ok); }

/* ---- Rapports ------------------------------------------------------- */
/* Couleurs des graphiques : une seule teinte (bleu), du plus clair au plus foncé selon
   l'avancement ; gris pour ce qui n'avance pas. Toujours avec une légende ou un libellé. */
.rep { --c-qualifie: #184f95; --c-atteint: #5598e7; --c-autre: #a9b2c3; --c-attente: #e2e6ee; }
.report-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rep .card + .card, .rep .card + .kpis, .rep .kpis + .card, .rep .todo + .kpis { margin-top: 12px; }
.rep-kpis { grid-template-columns: repeat(4, 1fr); margin: 12px 0; }
.kpi small { font-size: 12.5px; }
.rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 1000px) { .rep-grid { grid-template-columns: 1fr; } }

.todo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.todo li { display: flex; gap: 10px; align-items: flex-start; }
.todo li b { display: block; font-weight: 600; }
.todo li small { color: var(--muted); font-size: 13px; }
.todo-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px; }
.todo-bad .todo-ic { background: var(--danger); }
.todo-warn .todo-ic { background: #c98500; font-size: 10px; }
.todo-info .todo-ic { background: var(--accent); font-style: italic; font-family: Georgia, serif; }

.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--soft); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend--small { margin-top: 12px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-qualifie, .seg-qualifie { background: var(--c-qualifie); }
.sw-atteint, .seg-atteint { background: var(--c-atteint); }
.sw-autre, .seg-autre { background: var(--c-autre); }
.sw-attente, .seg-attente { background: var(--c-attente); }
.sw-attente, .seg-attente { box-shadow: inset 0 0 0 1px var(--line-strong); }

.cols-wrap { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 14px; }
.cols-axis { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 11.5px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 200px; padding-bottom: 20px; position: relative;
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) 0 90px / 100% 1px no-repeat, linear-gradient(var(--line-strong), var(--line-strong)) 0 180px / 100% 1px no-repeat; }
.col { flex: 1 1 0; min-width: 0; height: 180px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.col:hover .col-bar { filter: brightness(.92); }
.col-bar { width: 100%; max-width: 24px; display: flex; flex-direction: column-reverse; gap: 2px; }
.col-bar i { display: block; width: 100%; min-height: 2px; }
.col-bar i:last-child { border-radius: 4px 4px 0 0; }
.col-x { position: absolute; top: 184px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.table-view { margin-top: 10px; font-size: 13px; }
.table-view summary { cursor: pointer; color: var(--muted); }
.table-view .table-wrap { margin-top: 8px; max-height: 300px; overflow: auto; }

.hbars, .answers, .sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hbars li, .answers li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hb-label { overflow-wrap: anywhere; }
.hb-track { height: 12px; }
.hb-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.hb-val { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
.hb-val small, .answers small { color: var(--muted); font-size: 12px; }
.stack { display: flex; gap: 2px; height: 14px; margin: 8px 0 6px; }
.stack--thin { height: 12px; margin: 0; }
.stack i { display: block; height: 100%; min-width: 2px; }
.stack i:last-child { border-radius: 0 4px 4px 0; }
.sources li { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sources li:last-child { border-bottom: 0; padding-bottom: 0; }
.src-head { display: flex; justify-content: space-between; gap: 10px; }
.src-head span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.src-sub { font-size: 12.5px; color: var(--muted); }
.src-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); }
.src-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.connect ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.connect code { background: var(--sunk); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.health { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.defs { margin-top: 18px; }
.defs summary { cursor: pointer; }
.defs p { margin-top: 6px; }
.table--compact th, .table--compact td { padding: 8px 10px; }
@media (max-width: 820px) { .rep-kpis { grid-template-columns: repeat(2, 1fr); } .cols-axis { display: none; } .cols-wrap { grid-template-columns: 1fr; } }
.rep .pill { background: var(--sunk); color: var(--soft); }
.rep .pill--ok { background: var(--ok-bg); color: var(--ok); }
