/* Identite Studio Smile : police Public Sans et couleurs du site (ardoise #354b61, or #f0b100). */
@font-face {
  font-family: 'Public Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/public-sans-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Public Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/public-sans-latin-wght-normal.woff2') format('woff2-variations');
  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;
}

:root {
  --bg: #f0f4fa;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --text: #1f2e3d;
  --muted: #5b6b7d;
  --border: #d9e2ee;
  --primary: #354b61;
  --primary-soft: #dde6f3;
  --primary-ink: #ffffff;
  --brand: #354b61;
  --brand-deep: #27384a;
  --brand-ink: #ffffff;
  --brand-muted: #bdd1e9;
  --gold: #f0b100;
  --gold-ink: #1f2e3d;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --ok: #1f7a3d;
  --ok-soft: #e7f5ec;
  --now: #e5484d;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 14px;
  --nav-h: 64px;
  /* Vue Jour du planning : couleurs du classeur Excel du cabinet (salles, hygiène, volante, réception, renfort, pauses, absences). */
  --pl-soins: #9dc3e6; --pl-hygiene: #ffd966; --pl-assiste: #d9e2f3; --pl-volante: #f4b183; --pl-reception: #c9b2d9;
  --pl-renfort: #d9e2f3; --pl-autre: #e4e9ef; --pl-pause: #f2f2f2; --pl-absent: #f4cccc; --pl-alerte: #fff2cc;
  --pl-ink: #1f2933; --pl-pause-ink: #5b6770; --pl-absent-ink: #9c0006; --pl-alerte-ink: #7f6000;
  /* Statuts du jour (02/10/2026) : repos, vacances, formation, école ; absence et OFF reprennent --pl-absent. */
  --st-repos: #e4e9ef; --st-repos-ink: #3d4b5c; --st-vacances: #d6f0df; --st-vacances-ink: #1f6b3a;
  --st-formation: #e6dcf7; --st-formation-ink: #5a3796; --st-ecole: #fde3c4; --st-ecole-ink: #8a4b00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141d27;
    --surface: #1b2733;
    --surface-2: #223140;
    --text: #eef2f7;
    --muted: #a3b3c6;
    --border: #2d3e50;
    --primary: #98b9dd;
    --primary-soft: #26374a;
    --primary-ink: #14202c;
    --brand: #1b2733;
    --brand-deep: #111922;
    --brand-muted: #98b9dd;
    --danger: #ff6b6b;
    --danger-soft: #3a1c1e;
    --warn: #f4c46b;
    --warn-soft: #3a2f16;
    --ok: #5fd08a;
    --ok-soft: #173424;
    --now: #ff6369;
    --shadow: none;
    --pl-soins: #2f5a80; --pl-hygiene: #7a6420; --pl-assiste: #2e4058; --pl-volante: #8a5330; --pl-reception: #5c4a70;
    --pl-renfort: #2e4058; --pl-autre: #2a3441; --pl-pause: #2a3441; --pl-absent: #5a2a2e; --pl-alerte: #5a4a1a;
    --pl-ink: #eef2f7; --pl-pause-ink: #b7c3d0; --pl-absent-ink: #ffb3b3; --pl-alerte-ink: #f4dd9a;
    --st-repos: #2a3441; --st-repos-ink: #c5d0dc; --st-vacances: #1d3a2a; --st-vacances-ink: #8fdcae;
    --st-formation: #33284d; --st-formation-ink: #cbb6f5; --st-ecole: #42311b; --st-ecole-ink: #f5c27a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 'Public Sans Variable', 'Public Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Ecrans de connexion ---------- */
.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: calc(28px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 22px;
  box-shadow: 0 18px 40px rgba(10, 18, 28, .28);
}
.brand { text-align: center; }
.brand h1 { margin: 0; line-height: 0; }
.brand img { width: 220px; max-width: 70vw; height: auto; }
.brand p {
  margin: 10px 0 0; color: var(--brand-muted);
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.auth-foot { margin: 0; color: var(--brand-muted); font-size: 13px; text-align: center; }
.auth h2 { font-size: 18px; margin: 0 0 6px; }
.auth p.lead { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.steps { margin: 0 0 18px; padding-left: 20px; font-size: 15px; }
.steps li { margin-bottom: 10px; }
.qr { display: block; width: 200px; max-width: 100%; height: auto; margin: 10px 0 12px; border-radius: 10px; border: 1px solid var(--border); image-rendering: pixelated; }
.secret {
  display: block; margin-top: 6px; padding: 10px 12px;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px;
  font: 600 15px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .06em; word-break: break-all;
}

/* ---------- Formulaires ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  outline: none;
}
textarea.input { min-height: 140px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; }
.check input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 15px;
  text-decoration: none; color: var(--text);
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn.icon { width: 44px; padding: 0; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn svg { width: 20px; height: 20px; flex: 0 0 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.alert { padding: 11px 13px; border-radius: 11px; font-size: 14.5px; margin-bottom: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--primary-soft); color: var(--text); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Structure de l'application ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
.topbar .emblem { width: 34px; height: 30px; flex: 0 0 34px; }
.topbar h1 { font-size: 19px; font-weight: 650; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--gold); color: var(--gold-ink);
  font-weight: 700; font-size: 14px; cursor: pointer;
}
main.page {
  max-width: 760px; margin: 0 auto;
  padding: 14px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tabbar a {
  position: relative;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 16px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 4px 8px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  color: var(--text); text-decoration: none;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
/* Cabinet d'une reservation en ligne (19/10/2026) : ardoise, bien visible dans la file. */
.badge.cabinet { background: var(--primary); color: var(--primary-ink, #fff); }

/* ---------- Agenda ---------- */
.daybar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.daybar .day { flex: 1; min-width: 0; text-align: center; }
.daybar .day strong { display: block; font-size: 17px; }
.daybar .day input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.daybar .day label { cursor: pointer; }
.summary { font-size: 14px; color: var(--muted); margin: 0 2px 10px; }
.rdv-list { display: flex; flex-direction: column; gap: 8px; }
.rdv {
  display: flex; gap: 12px; padding: 11px 12px 11px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.rdv .bar { width: 5px; flex: 0 0 5px; border-radius: 0 4px 4px 0; background: var(--primary); margin: -11px 0; }
/* Rendez-vous touchable : detail et attestation à qui de droit (08/11/2026). */
.rdv.tap { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rdv.tap:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.att-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.att-incap { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 10px; margin: -4px 0 4px 28px; }
.att-incap.hidden { display: none; }
.att-list { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
.att-list h3 { font-size: 15px; margin: 0 0 8px; }
.att-item { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.att-item:last-child { border-bottom: 0; }
/* Contrôle RDV (08/11/2026 ; poste ordinateur seulement depuis le 08/11/2026). Nom du patient dans les taches et les
   rapports : seulement sur un poste enregistre. */
.pat-name { font-weight: 600; color: var(--text); }
.ctl-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.ctl-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.ctl-dur { flex: none; display: grid; justify-items: center; min-width: 62px; padding: 6px 8px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); line-height: 1.1; }
.ctl-dur strong { font-size: 22px; }
.ctl-dur span { font-size: 11.5px; font-weight: 700; }
.ctl-sec { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.ctl-sec h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.ctl-sec h4 { font-size: 14px; margin: 10px 0 4px; }
.ctl-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14.5px; }
.ctl-row span { color: var(--muted); }
.ctl-row strong { text-align: right; overflow-wrap: anywhere; }
.ctl-row.ok strong, .ctl-ok { color: var(--ok); }
.ctl-row.warn strong { color: var(--warn); }
.ctl-row.danger strong { color: var(--danger); }
.ctl-row.muted strong { color: var(--muted); font-weight: 600; }
.ctl-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.ctl-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; font-size: 14px; padding: 7px 9px; border-radius: 10px; background: var(--surface-2); overflow-wrap: anywhere; }
.ctl-list.next li { background: var(--warn-soft); }
.ctl-day { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; padding-top: 1px; }
.ctl-more { margin: 2px 0 4px; }
.ctl-more summary { cursor: pointer; color: var(--primary); font-size: 14px; font-weight: 600; padding: 6px 0; }
.ctl-more[open] summary { margin-bottom: 6px; }
/* Quatre parties (08/11/2026) : temps du rendez-vous, compte, dernier traitement, notes administratives ; deux colonnes
   dans la fenetre d'un ecran large ; barre « Contrôle fait » (qui et quand). */
.ctl-time { display: flex; align-items: center; gap: 12px; }
.ctl-time strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.ctl-badge { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ctl-badge svg { width: 14px; height: 14px; }
.ctl-list.adm li > span:last-child > div + div { margin-top: 2px; }
.ctl-done { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: 1 1 100%; margin-bottom: 4px; }
.ctl-done.ok { justify-content: space-between; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); }
.ctl-done-t { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; }
.ctl-done-t svg { width: 18px; height: 18px; flex: none; }
.ctl-done.ok .btn { color: var(--ok); }
.ctl-panel .ctl-head > div:first-child { display: none; }
.ctl-panel .ctl-head { justify-content: flex-end; margin: 0; }
.ctl-panel .ctl-head:not(:has(.badge)) { display: none; }
.ctl-panel .ctl-sec:first-child { margin-top: 4px; }
.ctl-grid { display: flex; flex-direction: column; }
.ctl-col { display: contents; }
.ctl-sec.o1 { order: 1; } .ctl-sec.o2 { order: 2; } .ctl-sec.o3 { order: 3; } .ctl-sec.o4 { order: 4; } .ctl-sec.o5 { order: 5; } .ctl-sec.o6 { order: 6; }
/* Statut social (09/11/2026) : gradations du cavalier, valeur du point. */
.ctl-grads { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.ctl-grads .badge { font-weight: 700; }
.ctl-pts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
/* Laboratoire recu (NEXT avec « pose ») : oui / non et date, avant « Contrôle fait ». */
.ctl-lab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; flex: 1 1 100%; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); font-size: 14.5px; }
.ctl-lab strong { color: var(--warn); }
.ctl-lab label { display: inline-flex; align-items: center; gap: 6px; }
.ctl-lab .input { width: 160px; }
.ctl-lab-t { display: block; font-weight: 500; font-size: 13.5px; }
@media (min-width: 1000px) {
  .sheet.ctl-wide { max-width: 1000px; }
  .sheet.ctl-wide .ctl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .sheet.ctl-wide .ctl-col { display: block; min-width: 0; }
}
.att-item .actions { margin-top: 4px; }
@media (max-width: 420px) { .att-incap { grid-template-columns: 1fr 1fr; margin-left: 0; } }
.rdv .time { width: 52px; flex: 0 0 52px; font-variant-numeric: tabular-nums; }
.rdv .time b { display: block; font-size: 16px; }
.rdv .time span { font-size: 12.5px; color: var(--muted); }
.rdv .body { flex: 1; min-width: 0; }
.rdv .l1 { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdv .l2 { color: var(--muted); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdv .l3 { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.rdv.past { opacity: .62; }
.now-line { display: flex; align-items: center; gap: 8px; color: var(--now); font-size: 13px; font-weight: 700; margin: 2px 0; }
.now-line::after { content: ""; flex: 1; height: 2px; background: var(--now); border-radius: 2px; }

/* ---------- Chiffre d'affaires ---------- */
.kpi { padding: 18px 16px; }
.kpi .value { font-size: 32px; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .label { color: var(--muted); font-size: 14px; }
.kpi .split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.kpi .split span { display: block; color: var(--muted); font-size: 13px; }
.kpi .split strong { font-size: clamp(15px, 4.5vw, 18px); font-weight: 700; font-variant-numeric: tabular-nums; }
.delta { font-size: 14px; font-weight: 650; margin-top: 6px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.months { padding: 6px 0; }
.month { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 10px; padding: 9px 16px; font-size: 14.5px; }
.month + .month { border-top: 1px solid var(--border); }
.month .track { position: relative; height: 10px; background: var(--surface-2); border-radius: 6px; }
.month .fill, .goal .fill { height: 100%; background: var(--primary); border-radius: 6px; }
.month .fill.done, .goal .fill.done { background: var(--ok); }
/* Objectif : trait vertical sur la barre, lisible sur le fond comme sur le remplissage. */
.tick {
  position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px;
  background: var(--text); box-shadow: 0 0 0 1.5px var(--surface); pointer-events: none;
}
.prat-pick { margin-bottom: 12px; }
.goal { padding: 14px 16px; margin-top: 12px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.goal-head span { color: var(--muted); font-size: 14px; }
.goal-head strong { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.goal .track { position: relative; height: 12px; background: var(--surface-2); border-radius: 6px; }
.goal .goal-line { font-size: 14px; margin-top: 10px; }
.goal .delta { margin-top: 8px; }
.goal .small { margin-top: 6px; }
.month.current { font-weight: 700; }
.month.future { color: var(--muted); }

/* ---------- Listes (documents, taches, admin) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; }
.list > li + li { border-top: 1px solid var(--border); }
/* Fichiers du planning : le nom sur toute la largeur, les boutons dessous. */
.list > li.file-row { flex-wrap: wrap; gap: 8px; }
.list > li.file-row > .grow { flex-basis: 100%; }
.list .ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.list .ico svg { width: 20px; height: 20px; }
.list button.item { all: unset; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.todo input[type=checkbox] { width: 24px; height: 24px; flex: 0 0 24px; accent-color: var(--primary); }
.todo.done .txt { text-decoration: line-through; color: var(--muted); }
.todo .due { font-size: 13px; color: var(--muted); }
.todo .due.late { color: var(--danger); font-weight: 600; }
.addbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.addbar .input { flex: 1 1 140px; }
.addbar .input:first-child { flex-basis: 100%; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 8px 4px; }

/* ---------- Actualites ---------- */
.news { padding: 16px; }
.news + .news { margin-top: 12px; }
.news h3 { margin: 6px 0 4px; font-size: 17px; }
.news .meta { font-size: 13px; color: var(--muted); }
.news .content p { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Administration ---------- */
.subtabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
table.grid input.input { min-height: 36px; padding: 6px 8px; width: 110px; }
table.grid input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.checklist { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 11px; padding: 4px 12px; }
/* Roles d'un compte : case, nom du role et ce qu'il permet. */
.checklist.roles { max-height: none; }
.checklist.roles .check { align-items: flex-start; padding: 8px 0; }
.checklist.roles .check + .check { border-top: 1px solid var(--border); }
.checklist.roles .check input { flex: 0 0 20px; margin-top: 1px; }
.checklist.roles .check > span { display: flex; flex-direction: column; gap: 1px; }
.checklist.roles small { margin-top: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.diag li { margin: 4px 0; }

/* ---------- Feuilles modales et notifications ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 12, 16, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 20px; }
}
.sheet h2 { margin: 0 0 14px; font-size: 19px; }
.sheet .menu a, .sheet .menu button {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 0 6px; cursor: pointer; font-weight: 600; border-radius: 10px;
}
.sheet .menu svg { width: 22px; height: 22px; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg);
  padding: 11px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Choix de vue, navigation ---------- */
.seg {
  display: flex; gap: 3px; padding: 3px; margin-bottom: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
}
.seg button {
  flex: 1; min-height: 36px; padding: 0 6px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
/* Choix du site du Pilotage : noms de site parfois longs, sur deux lignes plutot que hors de l'ecran. */
.seg.sites button { white-space: normal; line-height: 1.15; padding: 4px 6px; }
@media (prefers-color-scheme: dark) { .seg button.on { background: var(--primary-soft); } }
.chip svg { width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.period-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; align-items: end; margin-bottom: 12px; }
.period-bar .btn { grid-column: 1 / -1; }
.period-bar .input, .grid2 .input { min-width: 0; }
.period-bar .field { margin: 0; }
.period-bar .input { padding: 8px; }
h2.group-title { font-size: 17px; margin: 26px 4px 2px; }
.day-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; width: 100%;
  margin: 18px 0 8px; padding: 0 4px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left;
}
.day-head strong { font-size: 15px; }
.day-head > span { white-space: nowrap; }
.day-head.today strong { color: var(--primary); }
.day-head.today strong::after { content: " · aujourd’hui"; font-weight: 600; color: var(--muted); font-size: 13px; }

/* ---------- Chiffre d'affaires : lignes cliquables ---------- */
button.month { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
button.month:disabled { cursor: default; }
button.month + button.month { border-top: 1px solid var(--border); }
.months.wide .month { grid-template-columns: 104px 1fr auto; }

/* ---------- Menu « Plus » et pastilles ---------- */
.list a.item { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.list a.item > svg, .list button.item > svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted); }
.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700;
}
.tabbar a .dot {
  position: absolute; top: 9px; left: calc(50% + 7px); width: 10px; height: 10px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--surface);
}

/* ---------- Taches DentaGest ---------- */
.memo .ico { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.memo .ico svg { width: 18px; height: 18px; }
.memo .note {
  font-size: 13.5px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Planning ---------- */
.plan-wrap { padding: 6px 4px; overflow-x: auto; }
table.plan { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
table.plan th { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 2px 0 4px; line-height: 1.2; }
table.plan th.today { color: var(--primary); }
table.plan th.name, table.plan td.name { width: 28%; }
table.plan td.name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
table.plan tr.me td.name { color: var(--primary); }
.pc {
  display: grid; place-items: center; align-content: center; width: 100%; height: 44px; padding: 2px;
  border: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted);
  font-weight: 700; font-size: 14px; line-height: 1.05; cursor: pointer; overflow: hidden;
}
.pc small { display: block; max-width: 100%; font-size: 10px; font-weight: 600; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc.J { background: var(--primary); color: var(--primary-ink); }
.pc.M, .pc.A { background: var(--primary-soft); color: var(--primary); }
.pc.C { background: var(--warn-soft); color: var(--warn); }
.pc.F { background: repeating-linear-gradient(45deg, var(--surface-2) 0 5px, var(--border) 5px 10px); color: var(--muted); }
.pc.changed { box-shadow: inset 0 0 0 2px var(--gold); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 4px; font-size: 12.5px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .pc { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.cal .d { min-height: 56px; display: flex; flex-direction: column; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; }
.cal .d.out { visibility: hidden; }
.cal .d.today { border-color: var(--primary); }
.cal .d .n { font-size: 11.5px; font-weight: 700; color: var(--muted); padding-left: 2px; }
.cal .d .pc { height: 30px; font-size: 12px; border-radius: 6px; }
.tpl + .tpl { margin-top: 8px; }
.tpl summary { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; cursor: pointer; }
.tpl-body { padding: 0 14px 14px; }
/* Horaires habituels : une ligne par jour de la semaine, touchee pour regler le creneau. */
.tpl-row { all: unset; display: grid; grid-template-columns: 78px minmax(0, 1fr) 18px; gap: 8px; align-items: center; width: 100%; box-sizing: border-box; padding: 9px 0; font-size: 14px; cursor: pointer; }
.tpl-row + .tpl-row { border-top: 1px solid var(--border); }
.tpl-row .wd { font-weight: 700; }
.tpl-row .what { color: var(--muted); overflow-wrap: anywhere; }
.tpl-row svg { width: 18px; height: 18px; color: var(--muted); }
table.plan .th-day { all: unset; display: block; width: 100%; cursor: pointer; }
/* Vue Jour : le cabinet salle par salle, comme une case du classeur du cabinet. */
.dv .sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 2px 6px; }
.dv .sec-title:first-child { margin-top: 0; }
.pl { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; text-align: left; border: 0; border-radius: 10px; padding: 9px 11px; margin-bottom: 5px; font: inherit; font-size: 14px; line-height: 1.3; color: var(--pl-ink); background: var(--pl-autre); }
button.pl { cursor: pointer; }
.pl .post { flex: 0 0 auto; min-width: 28px; font-weight: 800; }
.pl .who { font-weight: 700; }
.pl .helper { color: inherit; opacity: .85; overflow-wrap: anywhere; }
.pl .when { margin-left: auto; flex: 0 0 auto; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl.soins { background: var(--pl-soins); } .pl.hygiene { background: var(--pl-hygiene); } .pl.assiste { background: var(--pl-assiste); }
.pl.volante { background: var(--pl-volante); } .pl.reception { background: var(--pl-reception); } .pl.renfort { background: var(--pl-renfort); }
.pl.pause { background: var(--pl-pause); color: var(--pl-pause-ink); flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.pl.pause .pz { white-space: nowrap; }
.pl.absent { background: var(--pl-absent); color: var(--pl-absent-ink); }
.pl.alerte { background: var(--pl-alerte); color: var(--pl-alerte-ink); font-weight: 600; }
/* Statuts du jour (02/10/2026) : cases (R, V, Fo, É, Ab, OFF), lignes de la vue Jour, totaux de la vue Mois. */
.pc.st { font-size: 13px; }
/* Case avec heures : la lettre, puis le debut et la fin sur deux petites lignes. */
.pc.hrs { font-size: 12px; line-height: 1; gap: 1px; }
.pc.hrs small { font-size: 9.5px; line-height: 1.05; }
.cal .d .pc.hrs { height: 40px; font-size: 11px; }
.pc.st.repos, .pl.st-repos { background: var(--st-repos); color: var(--st-repos-ink); }
.pc.st.vacances, .pl.st-vacances { background: var(--st-vacances); color: var(--st-vacances-ink); }
.pc.st.formation, .pl.st-formation { background: var(--st-formation); color: var(--st-formation-ink); }
.pc.st.ecole, .pl.st-ecole { background: var(--st-ecole); color: var(--st-ecole-ink); }
.pc.st.absent, .pc.st.off { background: var(--pl-absent); color: var(--pl-absent-ink); }
.pc.st.off { font-size: 11px; }
.legend .pc.st.off, .dayrow .pc.st.off { font-size: 8.5px; letter-spacing: -.02em; }
/* Demi-journee dont l'autre moitie est en repos, école… : un trait sous la case. */
.pc.half-st { background-image: linear-gradient(to top, var(--gold) 4px, transparent 4px); }
.pl.absent .when, .pl[class*="st-"] .when { white-space: normal; text-align: right; }
table.plan td.name .nm { overflow: hidden; text-overflow: ellipsis; }
table.plan td.name small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 4px 6px; font-size: 13px; }
.st-count { display: inline-flex; align-items: center; gap: 6px; }
.st-count .pc { width: 14px; height: 14px; border-radius: 4px; cursor: default; }
/* Vue Mois, jour par jour : case, jour, horaires et pause, heures de travail. */
.days-list > li { padding: 0; min-height: 0; }
.dayrow { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 30px 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 8px 12px; font-size: 14px; cursor: pointer; }
.dayrow .pc { width: 30px; height: 30px; font-size: 12px; border-radius: 7px; }
.dayrow .dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.dayrow .grow > div:first-child { font-variant-numeric: tabular-nums; }
.dayrow .num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dayrow.today .dd { color: var(--primary); }
/* Acces : numero DentaGest de chacun, une ligne par personne. */
.num-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; align-items: center; padding: 5px 0; }
.num-row + .num-row { border-top: 1px solid var(--border); }
.num-row span { font-size: 15px; overflow-wrap: anywhere; }
.num-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.num-row .input { min-width: 0; min-height: 38px; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.input:disabled { background: var(--surface-2); color: var(--muted); border-style: dashed; cursor: not-allowed; }
/* Acces : listes de taches, une ligne par personne, un bouton par nom (retour a la ligne, pas de defilement). */
.task-row { padding: 12px 0; }
.task-row + .task-row { border-top: 1px solid var(--border); }
.task-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 2px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 6px 0 0; }
.chips.wrap .chip { white-space: normal; text-align: left; }
.chip:disabled { cursor: default; opacity: .55; }
/* Objectifs (administration) : meme montant pour l'annee, puis les 12 mois. */
.goal-same { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 12px; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0 8px; }
.goal-grid .field { margin-bottom: 10px; }
.goal-grid .input, .goal-same .input { min-width: 0; min-height: 38px; padding: 6px 8px; font-variant-numeric: tabular-nums; }
/* Pilotage du cabinet (administrateur) : saisie mensuelle et compte de resultat. */
.pilot-grid .field { margin-bottom: 10px; }
.pilot-grid .field > span { font-size: 13px; }
.pilot-grid .input { font-variant-numeric: tabular-nums; }
.pilot-form .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kpi .value.muted { color: var(--muted); }
table.pnl td.num, table.pnl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.pnl tr.total td { font-weight: 700; border-top: 1px solid var(--text); }
table.pnl td.muted { color: var(--muted); }
table.pnl th, table.pnl td { padding-left: 10px; padding-right: 10px; }
@media (max-width: 420px) { .pilot-grid { grid-template-columns: minmax(0, 1fr); } }
/* Heures reservees par agenda : nom d'agenda plus long qu'un mois. */
.months .agenda-row { grid-template-columns: minmax(0, 1.1fr) minmax(50px, 1fr) 68px; }
.agenda-row .num { text-align: right; }
.months .agenda-row.occ-row { grid-template-columns: minmax(0, 1.1fr) minmax(40px, 1fr) auto; }
.occ-row .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Activite par periode et par praticien (26/10/2026) : tableau etroit, lisible sur telephone. */
table.grid.act th, table.grid.act td { padding: 8px 8px; }
table.grid.act th:first-child, table.grid.act td:first-child { padding-left: 12px; }
table.grid.act th:last-child, table.grid.act td:last-child { padding-right: 12px; }
table.grid.act .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid.act .sub { font-size: 12px; font-weight: 400; color: var(--muted); }
table.grid.act td button { all: unset; cursor: pointer; color: var(--primary); font-weight: 600; }
table.grid.act td button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
table.grid.act tr.future td { opacity: .6; }
table.grid.act tr.on td { background: var(--primary-soft); }
table.grid.act tfoot td { font-weight: 700; border-top: 1px solid var(--text); border-bottom: 0; }
.act-who { margin: -4px 0 12px; }
.act-who select.input { width: 100%; }
@media (max-width: 420px) { table.grid.act th, table.grid.act td { padding: 8px 5px; } table.grid.act th { font-size: 11px; letter-spacing: .02em; } }
/* Provenance des nouveaux patients : nombre et pourcentage, lignes « Autres » et « Non renseigné » en retrait. */
.months .source-row { grid-template-columns: minmax(0, 1.8fr) minmax(36px, 1fr) 80px; }
.source-row.muted > span:first-child { color: var(--muted); font-style: italic; }
.month .fill.muted { background: var(--muted); opacity: .45; }
.agenda-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Factures ouvertes par praticien (Pilotage, 03/10/2026) : nom et montant sur la première ligne, détail dessous. */
.inv-list .inv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.inv-list .inv-head strong { min-width: 0; overflow-wrap: anywhere; }
.inv-list .inv-head .num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-list .small { margin-top: 3px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; margin-bottom: 8px; }
.checklist .check-list { margin-bottom: 0; }
/* Pilotage en rubriques (03/10/2026) : barre des rubriques collee sous l'en-tete pendant le defilement (fond de page
   autour, pour masquer ce qui passe dessous), puis les cases du Resume. */
.pilot-nav { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 10; margin: -6px 0 6px; padding: 6px 0 8px; background: var(--bg); }
.pilot-tabs { display: grid; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.pilot-tabs button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 52px; padding: 5px 2px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 650; font-size: 12.5px; cursor: pointer;
}
.pilot-tabs button svg { width: 20px; height: 20px; flex: 0 0 20px; }
.pilot-tabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilot-tabs button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .pilot-tabs button.on { background: var(--primary-soft); } }
@media (min-width: 560px) { .pilot-tabs button { flex-direction: row; gap: 7px; min-height: 42px; font-size: 14px; } .pilot-tabs button svg { width: 18px; height: 18px; flex-basis: 18px; } }
.ptiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .ptiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ptile {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; min-height: 112px; padding: 12px 12px 12px 14px;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.ptile:active { transform: scale(.98); }
.ptile .t { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--muted); }
.ptile .t svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.ptile .v { margin: 4px 0 2px; font-size: clamp(19px, 5.4vw, 24px); font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptile .v.muted { color: var(--muted); }
.ptile .s { font-size: 12.5px; font-weight: 650; line-height: 1.3; color: var(--muted); }
.ptile .s.up { color: var(--ok); }
.ptile .s.down { color: var(--danger); }
.alert .actions { margin-top: 8px; }

/* ---------- Conges ---------- */
.leave { padding: 14px 16px; }
.leave + .leave, details .leave { margin-top: 10px; }
.leave .when { font-weight: 650; }
.leave .meta { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.leave .note { font-size: 14px; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.leave .reply { font-size: 14px; margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); overflow-wrap: anywhere; }

/* ---------- Procedures ---------- */
.search { position: relative; margin-bottom: 6px; }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 38px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px; font-weight: 600; text-decoration: none; }
.back svg { width: 18px; height: 18px; }
.proc h2 { font-size: 21px; margin: 8px 0 4px; }
.proc .body { margin-top: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }

/* Page Acces (30/09/2026, 2e version) : cartes par theme, une ligne ou un bloc par personne, phrases completes. */
.acc-card + .section-title { margin-top: 18px; }
.acc-h { font-size: 16px; margin: 0 0 6px; }
.acc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; }
.acc-row + .acc-row { border-top: 1px solid var(--border); }
.acc-row.col { grid-template-columns: 1fr; }
.acc-row.hl { background: color-mix(in srgb, var(--accent, #f0b100) 14%, transparent); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.acc-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.acc-num { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.acc-num .input { width: 96px; min-height: 38px; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.acc-check { font-size: 12.5px; color: var(--muted); text-align: right; max-width: 190px; }
.acc-check.ok { color: var(--ok, #1a7f4b); }
.acc-check.warn { color: var(--warn, #b26a00); }
.acc-check.bad { color: var(--danger, #b3261e); }
.acc-sentence { font-size: 15px; margin: 2px 0 6px; }
.acc-row.col .checklist { max-height: none; }
.check.strong span { font-weight: 600; }
.check span small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.check.dim { opacity: .55; }
/* Etape 1 d'Acces : la liste deroulante prend toute la largeur, sous le nom, pour lire « N° 17 · Cécile · 9 en cours ». */
.acc-num.wide { align-items: stretch; }
.acc-num.wide .input { width: 100%; }
.acc-num.wide .acc-check { text-align: left; max-width: none; }
/* Etape 1 d'Acces : nom de chaque utilisateur DentaGest, champ large. */
.num-row.names { grid-template-columns: 118px minmax(0, 1fr); }

/* Navigateur du dossier personnel (30/09/2026). */
.folder .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 14px; margin: 0 4px 8px; }
.folder .crumb { background: none; border: 0; padding: 2px 0; color: var(--primary); font: inherit; cursor: pointer; }
.folder .item .muted svg { width: 18px; height: 18px; }

/* Visionneuse de documents (30/09/2026) : plein ecran dans le portail. */
.viewer { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); padding-top: max(10px, env(safe-area-inset-top)); }
.viewer-head .grow { min-width: 0; }
.viewer-body { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; background: #2b3542; }
.viewer-img { max-width: 100%; height: auto; margin: auto; display: block; }
.viewer-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.pdf { width: 100%; min-width: max-content; display: flex; flex-direction: column; }
.pdf-bar { position: sticky; top: 0; left: 0; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px; color: #fff; background: #2b3542; width: 100%; box-sizing: border-box; }
.pdf-bar .btn { min-width: 44px; color: #fff; border-color: rgba(255, 255, 255, .35); background: transparent; font-size: 20px; line-height: 1; }
.pdf-pages { display: grid; justify-items: center; gap: 10px; padding: 8px; min-width: max-content; }
.pdf-page { display: block; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.viewer-text { width: 100%; margin: 0; padding: 14px; background: var(--surface); color: var(--text); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.viewer-none { margin: auto; padding: 24px; text-align: center; color: #fff; max-width: 360px; }
.viewer-none svg { width: 48px; height: 48px; margin-bottom: 8px; }
.viewer-none .actions { justify-content: center; }

/* Requêtes DentaGest (04/10/2026) : réglages de la requête, tableau générique triable, recherche. */
h2.req-title { font-size: 19px; margin: 0 4px 12px; }
.req-tools { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.req-tools .field { flex: 1 1 220px; margin: 0; }
.req-search { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.req-search .input { flex: 1; min-width: 0; }
.req-count { white-space: nowrap; }
table.grid.req th, table.grid.req td { padding: 8px 10px; }
table.grid.req .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid.req th button { all: unset; cursor: pointer; }
table.grid.req th button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
table.grid.req tfoot td { font-weight: 700; border-top: 1px solid var(--text); border-bottom: 0; }
.req-notes { margin: 12px 4px 0; }
.req-notes p { margin: 0 0 6px; overflow-wrap: anywhere; }

/* Rubrique Appels du Pilotage (Peoplefone, 04/10/2026) : heures de pointe (jours en colonnes, demi-heures en lignes,
   couleur selon le nombre), barres jour par jour, reglage des files. Une case seule en fin de Resume prend la ligne. */
.heat { display: grid; gap: 3px; align-items: center; padding: 10px 10px 12px; margin-top: 10px; }
.heat .hd { font-size: 12px; font-weight: 650; color: var(--muted); text-align: center; }
.heat .sl { font-size: 11.5px; color: var(--muted); text-align: right; padding-right: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.heat .c {
  min-width: 0; height: 26px; padding: 0; border: 0; border-radius: 5px; background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer;
}
.heat .c:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.month .fill.low { background: var(--danger); }
.tel-q + .tel-q { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
.tel-q .grid2 { margin-left: 30px; }
.tel-add { display: flex; gap: 8px; }
.tel-add .input { flex: 1; min-width: 0; }
/* Journal des appels (07/10/2026) : jour choisi, compteurs, liste des appels (perdus en tete), appels a rappeler. */
.tel-journal-bar { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; }
.tel-journal-bar .day { flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: 15px; }
.tel-journal-bar .day small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.tel-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 4px 10px; font-size: 13.5px; color: var(--muted); }
.tel-counts b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.tel-counts .missed b { color: var(--danger); }
.list > li.tel-call { align-items: flex-start; padding: 11px 14px; }
.tel-call .ico { margin-top: 2px; }
.tel-call.missed .ico { background: var(--danger-soft); color: var(--danger); }
.tel-call.answered .ico { background: var(--ok-soft); color: var(--ok); }
.tel-call.outgoing .ico { background: var(--surface-2); color: var(--muted); }
.tel-call.ringing .ico { background: var(--warn-soft); color: var(--warn); }
.tel-call.internal .ico { background: var(--surface-2); color: var(--muted); }
.tel-call .grow { flex: 1; min-width: 0; }
.tel-call .num { font-weight: 700; font-size: 15.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tel-call .num a { color: inherit; text-decoration: none; }
.tel-call .num a:active { color: var(--primary); }
.tel-call.missed:not(.done) .num { color: var(--danger); }
.tel-call .num .lbl { font-weight: 500; color: var(--muted); font-size: 14px; }
.tel-call .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tel-call .sub .time { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.tel-call .act { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tel-call .done-txt { font-size: 12.5px; color: var(--ok); text-align: right; max-width: 120px; }
.tel-call .undo { all: unset; cursor: pointer; font-size: 12px; color: var(--muted); text-decoration: underline; }
.tel-pending { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.tel-pending .section-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font-weight: 700; }
.tel-pending .section-head svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--danger); }
.tel-pending .section-head .badge { margin-left: auto; }
.tel-call .act .btn.sm { gap: 4px; padding-inline: 10px; }
.tel-call .act .btn.sm svg { width: 16px; height: 16px; flex-basis: 16px; }
/* Sur un telephone : le bouton « Rappelé » sous le texte, a droite, pour laisser la place au numero et au detail. */
@media (max-width: 559px) {
  .list > li.tel-call { flex-wrap: wrap; }
  .tel-call .act { flex: 1 0 100%; flex-direction: row; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 2px; }
  .tel-call .done-txt { max-width: none; }
}
.tel-hook { display: grid; gap: 6px; }
.tel-hook .st { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tel-hook .st .badge { flex: 0 0 auto; }
.tel-hook .st .who { flex: 1; min-width: 0; }
.tel-hook .st .who small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.ptiles > .ptile:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 620px) {
  .ptiles > .ptile:last-child:nth-child(odd) { grid-column: auto; }
  .ptiles > .ptile:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
}
/* Six rubriques sur un telephone : libelles un peu plus petits pour qu'ils tiennent en entier. */
@media (max-width: 559px) { .pilot-tabs.many button { font-size: 11.5px; padding-inline: 1px; letter-spacing: -.015em; } }

/* Factures fournisseurs (06/10/2026) : en-tete du dossier, badges d'etat, champs corriges, texte lu. */
.fourn-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.fourn-head .grow { min-width: 200px; }
.fourn-dir { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.fourn-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fourn-list .inv-head strong { font-size: 15px; }
.fourn-form .field.fourn-manual > span { color: var(--primary); }
.fourn-form .field.fourn-manual .input { border-color: var(--primary); }
.fourn-range { margin-top: 12px; }
.fourn-dups { margin: 6px 0 0 18px; padding: 0; font-size: 14px; }
.fourn-dups a { color: inherit; overflow-wrap: anywhere; }
.fourn-company { margin: 10px 0 2px; }
.fourn-co + .fourn-co { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.fourn-co .btn { margin-bottom: 10px; }
.fourn-text { padding: 12px 14px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
table.grid.fourn-rules input.input { width: 100%; min-width: 110px; }
table.grid.fourn-rules select.input { min-height: 36px; padding: 6px 8px; min-width: 120px; }
table.grid.fourn-rules th:last-child, table.grid.fourn-rules td:last-child { width: 44px; padding-left: 0; }
/* Rapprochement bancaire (06/10/2026) : paires facture / paiement, choix d'une facture pour un paiement. */
.fourn-bank { margin-top: 12px; margin-bottom: 0; }
.fourn-bank + .fourn-range { margin-top: 12px; }
.fourn-pairs li.fourn-pair { display: block; padding: 12px 14px; }
.fourn-pairs.plain { padding: 0; margin: 8px 0 0; list-style: none; }
.fourn-pairs.plain li.fourn-pair { padding: 8px 0; border-top: 1px solid var(--border); }
.fourn-pay-inv { display: block; color: inherit; text-decoration: none; }
.fourn-pay-inv:hover strong { text-decoration: underline; }
.fourn-pair-sep { margin: 6px 0 2px; }
.fourn-pay-detail { overflow-wrap: anywhere; margin-top: 2px; }
.fourn-pick { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.fourn-pick select { flex: 1; min-width: 0; }
.fourn-pair .actions { margin-top: 10px; }

/* ===================== Formations obligatoires (08/10/2026) ===================== */
/* Contenu du module (public/formations/<id>.html) : classes prefixees « fm- », couleurs du portail. */
:root { --fm-gold-soft: #fff6d6; --fm-gold-ink: #7a5a00;
  --fm-z-red: #d23f3f; --fm-z-red-ink: #a52a2a; --fm-z-yellow: #e0a800; --fm-z-yellow-ink: #7a5a00; --fm-z-green: #2e9a62; --fm-z-green-ink: #1d6b43; }
@media (prefers-color-scheme: dark) { :root { --fm-gold-soft: #3a3115; --fm-gold-ink: #f5c033;
  --fm-z-red: #f07272; --fm-z-red-ink: #f59a9a; --fm-z-yellow: #f5c033; --fm-z-yellow-ink: #f5c033; --fm-z-green: #5cc795; --fm-z-green-ink: #7fd8ac; } }
.fm-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.fm-head { padding: 14px 16px; margin-bottom: 12px; }
.fm-head .fm-title { font-weight: 750; font-size: 17px; line-height: 1.25; }
.fm-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.fm-track { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.fm-fill { height: 100%; width: 0; background: var(--gold); border-radius: 99px; }
.fm-toc { margin-top: 10px; }
.fm-toc summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--primary); }
.fm-toc ol { list-style: none; margin: 8px 0 0; padding: 0; }
.fm-toc a { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 7px 4px; color: var(--text); text-decoration: none; font-size: 14.5px; border-radius: 8px; }
.fm-toc a.on { font-weight: 700; background: var(--surface-2); }
.fm-toc .fm-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--border); color: var(--muted); }
.fm-toc .seen .fm-n { background: var(--gold); border-color: var(--gold); color: #2b2100; }
.fm-toc .fm-m { font-size: 12px; color: var(--muted); }
.fm-body { padding: 18px 16px 20px; }
.fm-body h2 { font-size: 22px; line-height: 1.2; margin: 0 0 8px; }
.fm-body h3 { font-size: 16.5px; margin: 0 0 8px; line-height: 1.3; }
.fm-body p { margin: 0 0 10px; }
.fm-body ul, .fm-body ol { margin: 0 0 10px; padding-left: 1.2em; }
.fm-body li { margin: 4px 0; }
:is(.fm-body, .fm-step) > * + :is(section, .fm-grid, .fm-dodont, .fm-table-wrap, .fm-stats, .fm-videos) { margin-top: 22px; }
.fm-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--fm-gold-ink); margin-bottom: 8px; }
.fm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.fm-lead { font-size: 16.5px; color: var(--muted); }
.fm-grid { display: grid; gap: 10px; }
.fm-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.fm-grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.fm-grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.fm-tile { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); }
.fm-tile h3 { display: flex; align-items: center; gap: 10px; }
.fm-grid-4 .fm-tile h3 { flex-direction: column; align-items: flex-start; font-size: 15.5px; }
.fm-tile p, .fm-tile ul { font-size: 14.5px; color: var(--muted); }
.fm-tile p:last-child, .fm-tile ul:last-child { margin-bottom: 0; }
.fm-tag { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.fm-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fm-gold-soft); color: var(--fm-gold-ink); }
.fm-ico svg { width: 19px; height: 19px; }
.fm-callout { display: flex; gap: 12px; align-items: flex-start; background: var(--fm-gold-soft); border-radius: 12px; padding: 14px; margin-top: 20px; }
.fm-callout .fm-ico { background: var(--gold); color: #2b2100; }
.fm-callout p:last-child { margin-bottom: 0; }
.fm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fm-stat { background: var(--surface-2); border-radius: 12px; padding: 14px; }
.fm-stat .fm-big { font-size: 28px; font-weight: 800; line-height: 1.05; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fm-stat .fm-label { font-size: 14px; color: var(--muted); margin-top: 6px; }
.fm-stat .fm-src { font-size: 12px; color: var(--muted); margin-top: 6px; opacity: .85; }
.fm-dodont { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.fm-dodont > div { border-radius: 12px; padding: 14px; }
.fm-do { background: var(--ok-soft); }
.fm-dont { background: var(--danger-soft); }
.fm-do h3 { color: var(--ok); }
.fm-dont h3 { color: var(--danger); }
.fm-dodont ul { margin: 0; font-size: 14.5px; }
.fm-steps { list-style: none; padding: 0 !important; display: grid; gap: 10px; counter-reset: fmst; }
.fm-steps li { counter-increment: fmst; display: grid; grid-template-columns: 34px 1fr; gap: 12px; margin: 0; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.fm-steps li::before { content: counter(fmst); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 800; }
.fm-steps b { display: block; }
.fm-table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.fm-table-wrap th, .fm-table-wrap td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.fm-table-wrap th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
@media (max-width: 640px) {
  .fm-table-wrap table, .fm-table-wrap tbody, .fm-table-wrap tr, .fm-table-wrap td { display: block; width: 100%; }
  .fm-table-wrap thead { display: none; }
  .fm-table-wrap tr { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
  .fm-table-wrap td { border: 0; padding: 4px 0; }
  .fm-table-wrap td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .fm-table-wrap td:first-child { font-weight: 700; }
  .fm-table-wrap td:first-child::before { display: none; }
}
.fm-sources { margin-top: 20px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }
.fm-sources a { color: var(--muted); }
/* Mises en situation */
.fm-scenario { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 20px; }
.fm-situation { font-weight: 600; margin-bottom: 10px; }
.fm-situation::before { content: "Mise en situation · "; color: var(--fm-gold-ink); font-weight: 800; }
.fm-opts { display: grid; gap: 8px; }
.fm-opt { text-align: left; font: inherit; font-size: 15px; color: var(--text); background: var(--surface-2); border: 2px solid transparent; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.fm-opt[disabled] { cursor: default; }
.fm-opt .fm-why { display: none; margin-top: 6px; font-size: 14px; color: var(--muted); }
.fm-answered .fm-opt .fm-why { display: block; }
.fm-answered .fm-opt.fm-right { background: var(--ok-soft); border-color: var(--ok); }
.fm-answered .fm-opt.fm-wrong.fm-chosen { background: var(--danger-soft); border-color: var(--danger); }
.fm-answered .fm-opt.fm-wrong:not(.fm-chosen) { opacity: .75; }
.fm-verdict { margin: 10px 0 0; font-weight: 700; }
.fm-verdict.good { color: var(--ok); }
.fm-verdict.bad { color: var(--danger); }
/* Videos : lien vers la page de la video, sans image exterieure */
.fm-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.fm-video { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; color: var(--text); text-decoration: none; background: var(--surface); }
.fm-thumb { position: relative; display: block; aspect-ratio: 16 / 7; background: var(--brand-deep); }
.fm-thumb.fm-rts { background: #7a1220; }
.fm-thumb.fm-yt { background: #3b1414; }
.fm-thumb::after { content: ""; position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 24px no-repeat; }
.fm-thumb .fm-src { position: absolute; left: 10px; top: 8px; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.fm-thumb .fm-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; }
.fm-video .fm-meta { padding: 10px 12px 12px; }
.fm-video .fm-meta b { display: block; font-size: 14.5px; line-height: 1.35; }
.fm-video .fm-meta span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
/* Circuit de stérilisation (formation hygiène) : zones rouge, jaune, verte, et pastille de l'étape */
.fm-eyebrow.fm-z-red .fm-dot { background: var(--fm-z-red); }
.fm-eyebrow.fm-z-yellow .fm-dot { background: var(--fm-z-yellow); }
.fm-eyebrow.fm-z-green .fm-dot { background: var(--fm-z-green); }
.fm-zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 18px; }
.fm-zone { position: relative; background: var(--surface-2); border-radius: 12px; border-top: 6px solid var(--border); padding: 12px 14px 10px; }
.fm-zone.fm-red { border-top-color: var(--fm-z-red); }
.fm-zone.fm-yellow { border-top-color: var(--fm-z-yellow); }
.fm-zone.fm-green { border-top-color: var(--fm-z-green); }
.fm-ztag { display: block; font-weight: 800; font-size: 14.5px; margin-bottom: 4px; }
.fm-red .fm-ztag { color: var(--fm-z-red-ink); }
.fm-yellow .fm-ztag { color: var(--fm-z-yellow-ink); }
.fm-green .fm-ztag { color: var(--fm-z-green-ink); }
.fm-zone ul { margin: 0; font-size: 14.5px; }
.fm-zone:not(:last-child)::after { content: "→"; position: absolute; right: -20px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--muted); }
@media (max-width: 760px) {
  .fm-zones { grid-template-columns: 1fr; gap: 24px; }
  .fm-zone:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -22px; transform: translateX(-50%); }
}
/* Quiz */
.fm-quiz fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; }
.fm-quiz legend { font-weight: 700; padding: 0 6px; margin-left: -6px; }
.fm-quiz label { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.fm-quiz input { margin-top: 4px; accent-color: var(--primary); }
.fm-quiz .fm-qexp { display: none; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.fm-quiz.fm-corrected .fm-qexp { display: block; }
.fm-quiz.fm-corrected label.fm-right { background: var(--ok-soft); }
.fm-quiz.fm-corrected label.fm-wrong { background: var(--danger-soft); }
.fm-quiz.fm-corrected fieldset.fm-ok legend::after { content: " ✓"; color: var(--ok); }
.fm-quiz.fm-corrected fieldset.fm-ko legend::after { content: " ✗"; color: var(--danger); }
/* Accueil du module */
.fm-hero { background: var(--brand-deep); color: #f3f6fa; border-radius: 12px; padding: 18px 16px; }
.fm-hero h2 { color: #fff; }
.fm-hero .fm-eyebrow { color: var(--gold); }
.fm-hero .fm-lead { color: #c9d5e3; }
.fm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.fm-chips span { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.fm-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.fm-pager .btn { flex: 1 1 auto; }
/* Liste des formations */
.fm-card { padding: 16px; }
.fm-card + .fm-card { margin-top: 12px; }
.fm-card .fm-row { display: flex; gap: 12px; align-items: flex-start; }
.fm-card .fm-row .fm-ico { width: 42px; height: 42px; }
.fm-status { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* Attestation */
/* Comme un document papier, aussi en theme sombre (logo sur fond clair). */
.fm-cert { border: 2px solid #d9e2ee; border-radius: 16px; padding: 22px 16px; text-align: center; background: #fff; color: #1f2e3d; }
.fm-cert img { height: 34px; display: block; margin: 0 auto 16px; }
.fm-cert .fm-t { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #5b6b7d; font-weight: 700; }
.fm-cert .fm-who { font-size: 26px; font-weight: 800; margin: 12px auto; padding: 0 12px 6px; border-bottom: 2px solid #f0b100; display: inline-block; }
.fm-cert .fm-what { max-width: 52ch; margin: 0 auto; color: #45556c; font-size: 15px; }
.fm-cert .fm-cols { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; color: #5b6b7d; }
.fm-cert .fm-cols b { display: block; color: #1f2e3d; font-size: 15.5px; }
.fm-cert .fm-sig { display: block; width: 170px; height: 30px; border-bottom: 1px solid #5b6b7d; }
.alert.fm-pass { background: var(--ok-soft); color: var(--ok); }
.fm-nudge { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.fm-nudge svg { width: 22px; height: 22px; flex: 0 0 22px; }
/* Administration */
.fm-admin-row { display: flex; align-items: center; gap: 10px; }
.fm-admin-row .grow { min-width: 0; }
.fm-bulk { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.fm-public { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14.5px; }
.fm-public .grow { flex: 1 1 200px; }
.fm-bulk .input { width: auto; flex: 1 1 160px; }
/* Impression de l'attestation seule */
.fm-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 14mm; }
  body.fm-printing > :not(.fm-print) { display: none !important; }
  body.fm-printing { background: #fff; color: #000; }
  body.fm-printing .fm-print { display: block; }
  .fm-print .fm-cert { border-color: #999; background: #fff; }
  .fm-print .fm-cert .fm-who, .fm-print .fm-cert .fm-cols b, .fm-print .fm-cert .fm-what, .fm-print .fm-cert .fm-cols { color: #000; }
}

/* ---------- Messagerie interne (19/10/2026) ---------- */
.conv-row .avatar-sm, .msg-head .avatar-sm {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 14px;
}
.avatar-sm.team { background: var(--gold); color: var(--gold-ink); }
.conv-row.unread strong { font-weight: 760; }
.conv-row .row svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 16px; }
.msg-head { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; }
.msg-head-title { all: unset; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; padding: 6px 8px; border-radius: 12px; }
.msg-head-title:hover { background: var(--surface-2); }
.msg-head-title > svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted); }
.msg-head-title .ellipsis svg { width: 14px; height: 14px; vertical-align: -2px; margin-left: 4px; color: var(--muted); }
.msg-thread { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px; }
.msg-day { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.msg { max-width: min(86%, 520px); display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.msg .who { font-size: 12.5px; font-weight: 650; color: var(--muted); margin: 0 8px 2px; }
.msg .bubble {
  padding: 9px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); font-size: 15px; line-height: 1.4;
  box-shadow: var(--shadow);
}
.msg .bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .bubble .photo + .text, .msg .bubble .audio + .text, .msg .bubble .file + .text { margin-top: 6px; }
.msg.mine .bubble { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); border-bottom-right-radius: 6px; }
.msg.theirs .bubble { border-bottom-left-radius: 6px; }
.msg.deleted .bubble { font-style: italic; color: var(--muted); background: var(--surface-2); border-style: dashed; box-shadow: none; }
.msg .meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin: 3px 8px 0; min-height: 18px; }
.msg .meta .read:empty { display: none; }
.msg .meta .del { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 22px; height: 18px; color: var(--muted); opacity: .7; }
.msg .meta .del svg { width: 14px; height: 14px; }
.msg .meta .del:hover { color: var(--danger); opacity: 1; }
.msg img.photo { display: block; max-width: 100%; max-height: 340px; width: auto; border-radius: 12px; cursor: zoom-in; margin: -3px -6px 0; }
.msg .audio audio { display: block; width: min(300px, 72vw); max-width: 100%; height: 40px; }
.msg .audio .small { margin-top: 4px; opacity: .85; }
.msg .file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg .file > svg { width: 22px; height: 22px; flex: 0 0 22px; }
.msg .file .grow { min-width: 120px; }
.msg .file .small { opacity: .8; }
.msg.mine .file .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: var(--primary-ink); }
.msg-compose-wrap { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--bg); padding: 6px 0 4px; margin-top: 8px; }
.msg-rule { margin: 0 4px 6px; font-size: 12px; }
.msg-compose { display: flex; gap: 6px; align-items: flex-end; }
.msg-compose textarea.input { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 10px 12px; line-height: 1.35; }
.msg-compose .btn.icon { flex: 0 0 44px; height: 44px; }
.msg-pending { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.msg-pending img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: 0 0 56px; }
.msg-pending audio { height: 40px; max-width: 200px; }
.msg-pending > svg { width: 28px; height: 28px; flex: 0 0 28px; color: var(--muted); }
.msg-rec { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.msg-rec .rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: msg-blink 1s infinite; }
@keyframes msg-blink { 50% { opacity: .25; } }
@media (prefers-color-scheme: dark) {
  .msg.mine .bubble { background: var(--primary-soft); color: var(--text); border-color: var(--primary-soft); }
  .msg.mine .file .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: var(--text); }
}
.msg-rec[hidden], .msg-pending[hidden] { display: none; }

/* ---------- Lecture protegee (19/10/2026) : filigrane nominatif, rien a enregistrer ---------- */
.pv, .pv * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pv .wm { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; opacity: .9; z-index: 2; }
.pv .viewer-head { position: relative; z-index: 3; }
.pv .viewer-head .badge { display: inline-flex; align-items: center; gap: 4px; background: var(--ok-soft); color: var(--ok); flex: 0 0 auto; }
.pv .viewer-head .badge svg { width: 14px; height: 14px; }
.pv-body { position: relative; -webkit-overflow-scrolling: touch; }
.pv-img { display: block; max-width: 100%; height: auto; margin: auto; }
.pv-audio { margin: auto; padding: 24px; text-align: center; color: #fff; }
.pv-audio svg { width: 40px; height: 40px; margin-bottom: 10px; }
.pv-audio audio { display: block; width: min(320px, 80vw); }
/* Messagerie : une piece est une tuile a ouvrir (rien n'est affiche ni charge avant le geste) ; un son s'ecoute sur place. */
.msg .piece { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; cursor: pointer; width: 100%; min-width: 200px; padding: 2px 0; }
.msg .piece > svg { width: 26px; height: 26px; flex: 0 0 26px; }
.msg .piece .grow { min-width: 0; }
.msg .piece .small { opacity: .8; }
.msg .piece .open { font-size: 12.5px; font-weight: 650; padding: 5px 10px; border-radius: 999px; border: 1px solid currentColor; flex: 0 0 auto; }
.msg .audio audio { display: block; width: min(300px, 72vw); max-width: 100%; height: 40px; }
/* SMS « recouvrement dans 48 h » (23/10/2026) : colonne d'action de la requete des patients au 3e rappel. */
table.grid.req td.req-act { min-width: 150px; }
.req-sent .btn { margin-top: 4px; padding-inline: 8px; min-height: 30px; }
/* Rapports des praticiens (30/10/2026) : signature dessinee, texte du rapport. */
.sigpad { display: block; width: 100%; height: 170px; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); touch-action: none; cursor: crosshair; }
.ink-box { padding: 8px 0 4px; color: var(--text); }
.ink-box canvas { display: block; max-width: 100%; }
.report-text { min-height: 320px; line-height: 1.5; }
/* Rubriques du rapport (05/11/2026) et textes ajoutes par le portail. */
.report-part { min-height: 104px; line-height: 1.5; }
.report-fixed { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.report-fixed > div + div { margin-top: 4px; }
.report-read { white-space: pre-wrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.report-who { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }

/* Rappels de factures (07/11/2026) : chaine des etapes, lignes a cocher, apercu du SMS. */
.deb-flow { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.deb-flow li { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; background: var(--surface); cursor: pointer; font-size: 13px; line-height: 1.3; }
.deb-flow li.dg { background: var(--surface-2); }
.deb-flow li.on { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.deb-flow li .n { font-size: 18px; font-weight: 700; }
.deb-step { margin-top: 14px; scroll-margin-top: 70px; }
.deb-step .list.plain > li { padding: 10px 0; min-height: 0; }
.deb-row { display: flex; gap: 10px; align-items: flex-start; }
.deb-row > input { margin-top: 3px; flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--primary); }
.deb-row .grow { flex: 1; min-width: 0; }
.deb-inv { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.deb-sms { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.deb-one { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 0 30px; }
.deb-one details { flex: 1 1 220px; }
/* Coordination relances / rappels (07/11/2026) : suivi de la facture electronique, dernier message, liste « Messages ». */
.deb-ef { margin-top: 1px; }
.deb-ef.warn { color: var(--warn); }
.deb-last { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.deb-msgs li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 6px 0; }
.deb-msgs li.muted { opacity: .7; }
.deb-msg-day { min-width: 118px; color: var(--muted); }

/* Connexion par cle d'acces (14/11/2026) */
.passkey-login { margin-top: 14px; }
.passkey-login .or { text-align: center; margin-bottom: 10px; }
