/* 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; }


/* ---- En-tête équipe ------------------------------------------------ */
.hd { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.hd-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 28px; }
.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); }
.hd-nav { display: flex; gap: 4px; }
.hd-nav a { text-decoration: none; color: var(--soft); padding: 7px 12px; border-radius: var(--radius-sm); font-weight: 500; }
.hd-nav a:hover { background: var(--sunk); color: var(--ink); }
.hd-nav a[aria-current="page"] { background: var(--sunk); color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
  .hd-in { gap: 12px; }
  .brand-sub, .umenu-name { display: none; }
}

.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); }
