/* Ferrae : feuille de style de l'application. Aucun style « en ligne » n'est autorisé (politique de sécurité). */
@font-face { font-family: 'Fraunces'; src: url('/assets/fonts/fraunces-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/instrument-sans-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #f7f8fc; --surface: #fff; --surface2: #eef1f8; --ink: #141b2d; --muted: #5d667a;
  --line: #e3e7f0; --line2: #cfd5e3; --accent: #ff5a1f; --accent-ink: #1b0b03; --accent-text: #c4410a; --hl: #ffe1d2;
  --ok: #0f7a57; --ok-soft: #dcf4ea; --err: #b4290a; --err-soft: #fde5df;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 30px 70px -40px rgba(20, 27, 45, .4);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: var(--accent-text); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { margin: 0; } .muted { color: var(--muted); } .small { font-size: .86rem; } .right { text-align: right; }
.stack { display: grid; gap: 16px; } .stack-s { display: grid; gap: 8px; } .stack-l { display: grid; gap: 28px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; } .between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent; font: 500 .93rem var(--sans); cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .2s, border-color .2s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 6px 16px -10px var(--accent); } .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -12px var(--accent); }
.btn-ghost { background: var(--surface); border-color: var(--line2); color: var(--muted); } .btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--surface); border-color: #e7b9ad; color: var(--err); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: .86rem; border-radius: 999px; }
.btn-block { width: 100%; }

/* Formulaires */
label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.champ { display: grid; gap: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="color"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 15px; border: 1.5px solid var(--line2); border-radius: 14px; background: var(--surface); color: var(--ink); font: 500 16px var(--sans);
}
input[type="search"] { -webkit-appearance: none; appearance: none; }
.choix { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line2); border-radius: 14px; background: var(--surface); cursor: pointer; font-weight: 500; color: var(--ink); }
.choix:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 31, .10); }
.choix input { margin-top: 4px; accent-color: var(--accent); }
.avec-plus { display: flex; gap: 8px; align-items: stretch; } .avec-plus > .dd, .avec-plus > select { flex: 1; min-width: 0; }
.btn-plus { flex: none; width: 46px; min-height: 46px; padding: 0; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--surface); color: var(--ink); font: 600 1.5rem/1 var(--sans); cursor: pointer; transition: border-color .2s, color .2s, transform .15s; }
.actions { flex-wrap: nowrap; justify-content: flex-end; gap: 8px; } td:has(.actions) { white-space: nowrap; width: 1%; }
.btn-plus { display: inline-grid; place-items: center; text-decoration: none; }
.btn-plus-sm { width: 34px; min-height: 34px; border-radius: 50%; font-size: 1.2rem; }
.btn-plus:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
textarea { min-height: 110px; resize: vertical; } input[type="color"] { padding: 4px; min-height: 50px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 31, .12); }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface2); color: var(--muted); }
.case { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; font-size: .92rem; font-weight: 500; color: var(--ink); }
.case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.erreur { color: var(--err); font-size: .85rem; }
.alerte { padding: 13px 16px; border-radius: 14px; font-size: .92rem; } .alerte-ok { background: var(--ok-soft); color: var(--ok); } .alerte-err { background: var(--err-soft); color: var(--err); }

/* Pages d'accueil (connexion, inscription) */
.invite { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: radial-gradient(50% 50% at 85% 10%, rgba(255, 140, 90, .18), transparent 70%), var(--bg); }
.invite-carte { width: 100%; max-width: 460px; padding: 34px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.invite-carte .logo { display: block; width: 150px; margin: 0 auto 22px; color: var(--ink); } .invite-carte .logo svg { width: 100%; height: auto; display: block; }
.invite-carte h1 { text-align: center; margin-bottom: 6px; } .invite-carte .sous { text-align: center; color: var(--muted); margin-bottom: 22px; }
.invite-pied { margin-top: 18px; text-align: center; font-size: .9rem; color: var(--muted); }

/* Application */
.haut { position: sticky; top: 0; z-index: 20; background: rgba(247, 248, 252, .96); border-bottom: 1px solid var(--line); }
.haut .contenu { display: flex; align-items: center; gap: 20px; padding-block: 10px; }
.haut .logo { width: 112px; color: var(--ink); } .haut .logo svg { width: 100%; height: auto; display: block; }
.menu { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; } .menu::-webkit-scrollbar { display: none; }
.menu a { padding: 8px 14px; white-space: nowrap; border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--muted); } .menu a:hover { background: var(--surface2); color: var(--ink); text-decoration: none; }
.menu a.actif { background: var(--hl); color: var(--accent-text); }
.compte { position: relative; flex: none; }
.compte summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--ink); user-select: none; }
.compte summary::-webkit-details-marker { display: none; } .compte summary:hover, .compte[open] summary { border-color: var(--ink); }
.compte .avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: .82rem; }
.compte .dd-chev { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.compte[open] .dd-chev { transform: rotate(180deg); }
.compte-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(20, 27, 45, .35); }
.compte-menu a, .compte-menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font: 500 .92rem var(--sans); color: var(--ink); cursor: pointer; text-decoration: none; }
.compte-menu a:hover, .compte-menu button:hover { background: var(--surface2); } .compte-menu a.actif { background: var(--hl); color: var(--accent-text); }
.compte-menu form { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); } .compte-menu form button { color: var(--err); }
.contenu { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: 16px; }
main.contenu { padding-block: 32px 64px; }
@media (max-width: 800px) { .haut .contenu { flex-wrap: wrap; gap: 10px; } .menu { order: 3; flex-basis: 100%; } .compte-nom { display: none; } .compte summary { padding-right: 8px; } }

.carte { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.carte + .carte { margin-top: 0; }
.entete { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--surface2); font-size: .76rem; font-weight: 600; color: var(--muted); }
.badge-ok { background: var(--ok-soft); color: var(--ok); } .badge-hl { background: var(--hl); color: var(--accent-text); } .badge-err { background: var(--err-soft); color: var(--err); }

/* Assistant */
.etape { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.etape:first-child { border-top: 0; }
.etape .pastille { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.etape.fait .pastille { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.etape.fait b { text-decoration: line-through; color: var(--muted); }
.barre { height: 8px; border-radius: 999px; background: var(--surface2); overflow: hidden; } .barre i { display: block; height: 100%; background: var(--accent); }
.p0 { width: 0; } .p25 { width: 25%; } .p50 { width: 50%; } .p75 { width: 75%; } .p100 { width: 100%; }

/* Tableaux */
.tableau-defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
td select { min-height: 40px; padding: 6px 10px; border-radius: 10px; font-size: .88rem; }

/* Double authentification */
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; width: max-content; } .qr svg { display: block; width: 220px; height: 220px; }
.secret { font: 600 1rem ui-monospace, 'Cascadia Code', Consolas, monospace; letter-spacing: .08em; padding: 12px 14px; background: var(--surface2); border-radius: 12px; overflow-wrap: anywhere; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 18px; background: var(--hl); border-radius: 18px; }
.codes code { font: 600 1rem ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.saisie-code { font: 600 1.5rem ui-monospace, Consolas, monospace; letter-spacing: .3em; text-align: center; }

/* ---------- Menus déroulants soignés ---------- */
.dd { position: relative; }
.dd-native { display: none !important; }
.dd-btn { position: relative; display: flex; align-items: center; width: 100%; min-height: 50px; padding: 0 44px 0 16px; border-radius: 14px; border: 1.5px solid var(--line2); background: var(--surface); color: var(--ink); font: 500 16px var(--sans); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .2s; }
.dd-btn:hover:not(:disabled) { border-color: var(--ink); }
.dd-btn:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 31, .12); }
.dd-placeholder .dd-val { color: var(--muted); }
.dd-chev { position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.dd-btn[aria-expanded="true"] .dd-chev { transform: rotate(180deg); }
.dd-list { position: absolute; z-index: 80; left: 0; right: 0; top: calc(100% + 8px); max-height: 320px; overflow: auto; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 34px 60px -22px rgba(20, 27, 45, .4), 0 0 0 1px rgba(20, 27, 45, .04); animation: ddin .16s ease-out; overscroll-behavior: contain; }
.dd-list[hidden] { display: none; }
.dd-up .dd-list { top: auto; bottom: calc(100% + 8px); }
@keyframes ddin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 12px; font-weight: 500; font-size: .98rem; color: var(--ink); cursor: pointer; }
.dd-opt.act { background: var(--surface2); }
.dd-opt.sel { background: var(--hl); color: var(--accent-text); font-weight: 600; }
.dd-opt.sel::after { content: ""; flex: none; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.5 3.5 7.5-8' fill='none' stroke='%23c4410a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.dd-empty { color: var(--muted); }
.dd-group { padding: 12px 14px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
td .dd-btn { min-height: 40px; font-size: .9rem; border-radius: 10px; padding-left: 12px; }

/* ---------- Fenêtres ---------- */
dialog.fenetre { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line2); border-radius: 28px; background: var(--surface); color: var(--ink); overflow: auto; box-shadow: 0 60px 120px -30px rgba(20, 27, 45, .6); }
dialog.fenetre[open] { animation: fen .24s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes fen { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
dialog.fenetre::backdrop { background: rgba(20, 27, 45, .5); }
.fenetre-corps { padding: 26px 24px 24px; display: grid; gap: 18px; }
.fenetre-haut { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.fenetre-haut h2 { font-size: 1.5rem; line-height: 1.1; }
.fermer { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.fermer:hover { border-color: var(--ink); }
.fenetre-pied { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.ligne-zone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 10px; align-items: end; }
.ligne-zone .retirer { height: 50px; border-radius: 12px; border: 1px solid var(--line2); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.ligne-zone .retirer:hover { border-color: var(--err); color: var(--err); }
.resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; border-radius: 16px; background: var(--surface2); font-size: .92rem; }
.resume.a-faire { background: var(--hl); color: var(--accent-text); }
.choix { display: grid; gap: 10px; }
.choix .case { padding: 14px 16px; border: 1.5px solid var(--line2); border-radius: 14px; }
.unite { position: relative; } .unite input { padding-right: 56px; } .unite::after { content: attr(data-unite); position: absolute; right: 16px; bottom: 14px; color: var(--muted); font-size: .9rem; pointer-events: none; }

/* Pages d'erreur */
.code-erreur { margin: 0 0 4px; text-align: center; font: 700 4.5rem/1 var(--serif); letter-spacing: -.04em; color: var(--accent); }
.attente { margin: 0 0 20px; padding: 14px 16px; border-radius: 14px; background: var(--hl); color: var(--accent-text); text-align: center; font-size: .95rem; }

/* ---- Catégories d'articles : un bloc par catégorie, avec son contenu ---- */
.cat-bloc { padding: 0; overflow: hidden; }
.cat-haut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 16px 22px; background: var(--surface2); border-bottom: 1px solid var(--line); }
.cat-haut h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.cat-nb { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line2); font: 600 .78rem var(--sans); color: var(--muted); }
.cat-bloc .tableau-defile { padding: 4px 22px 10px; }
.cat-vide { padding: 18px 22px; color: var(--muted); font-size: .92rem; margin: 0; }

/* ---- Agenda : la semaine en cartes ---- */
.semaine { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.jour { padding: 16px; display: grid; gap: 10px; align-content: start; }
.jour h2 { font-size: 1.05rem; text-transform: capitalize; }
.jour-auj { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 31, .10); }
.jour-ferme { background: var(--surface2); }
.rdv { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface2); border-left: 4px solid var(--accent); color: var(--ink); text-decoration: none; font-size: .9rem; }
.rdv:hover { text-decoration: none; background: var(--hl); }
.rdv-en_attente { border-left-color: #d9a400; } .rdv-termine { border-left-color: var(--ok); opacity: .8; }
.horaires select { min-width: 92px; }
/* ---- Pages publiques ---- */
.annuaire-carte { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; align-items: center; }
.annuaire-carte h2 a { color: var(--ink); text-decoration: none; } .annuaire-carte h2 a:hover { color: var(--accent-text); }
.annuaire-actions { display: grid; gap: 8px; justify-items: end; text-align: right; }
.pied-visiteur { padding-block: 24px 40px; text-align: center; }
/* Champ piège à robots : invisible pour une personne, rempli par un robot. */
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Agenda en lignes : une ligne par jour, les rendez-vous en cartes ---- */
.agenda-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.agenda { display: grid; gap: 10px; }
.jour-ligne { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.jour-auj { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 31, .10); }
.jour-ferme { background: transparent; border-style: dashed; padding-block: 10px; }
.jour-date { display: grid; justify-items: center; align-content: center; gap: 0; padding: 8px 0; border-radius: 14px; background: var(--surface2); text-align: center; line-height: 1.1; }
.jour-auj .jour-date { background: var(--accent); color: var(--accent-ink); }
.jd-sem, .jd-mois { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.jd-num { font: 600 1.7rem var(--serif, 'Fraunces', serif); }
.jour-contenu { display: grid; gap: 8px; min-width: 0; align-content: center; min-height: 56px; }
.jour-note { color: var(--muted); font-size: .9rem; }
.rdv { display: flex; align-items: stretch; gap: 10px; padding: 0; border: 0; background: none; border-left: 0; }
.rdv-lien { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface2); border-left: 4px solid var(--accent); color: var(--ink); text-decoration: none; transition: background .15s; }
.rdv-lien:hover { background: var(--hl); text-decoration: none; }
.rdv-en_attente .rdv-lien { border-left-color: #d9a400; } .rdv-termine .rdv-lien { border-left-color: var(--ok); opacity: .85; }
.rdv-heure { display: grid; font: 700 1rem var(--sans); line-height: 1.2; } .rdv-heure small { font-weight: 500; font-size: .78rem; color: var(--muted); }
.rdv-corps { display: grid; gap: 2px; min-width: 0; } .rdv-corps b, .rdv-corps span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdv-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tick { flex: none; display: grid; place-items: center; width: 44px; border-radius: 14px; border: 1.5px solid var(--line2); background: var(--surface); transition: border-color .15s, background .15s; }
.tick svg { width: 20px; height: 20px; fill: none; stroke: var(--line2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s; }
.tick:hover { border-color: var(--ok); } .tick:hover svg { stroke: var(--ok); }
.tick-fait { background: var(--ok); border-color: var(--ok); } .tick-fait svg { stroke: #fff; } .tick-fait:hover svg { stroke: #fff; }
.jour-ligne > .btn-plus { align-self: center; }
@media (max-width: 720px) { .jour-ligne { grid-template-columns: 56px 1fr; } .jour-ligne > .btn-plus { display: none; } .rdv-lien { grid-template-columns: auto 1fr; } .rdv-badges { grid-column: 1 / -1; justify-content: flex-start; } }
/* ---- Tableau de bord ---- */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.chiffre { display: grid; gap: 2px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.chiffre:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.chiffre b { font: 600 2rem var(--serif, 'Fraunces', serif); } .chiffre span { color: var(--muted); font-size: .9rem; }
/* ---- Rendez-vous : clients et chevaux ---- */
.client-bloc { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface2); }
.client-bloc[hidden] { display: none; }
.liste-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; max-height: 260px; overflow: auto; padding: 4px 2px; }
.liste-choix [hidden] { display: none; }

/* ---- Petits utilitaires (la CSP interdit les styles écrits dans les pages) ---- */
.pre { white-space: pre-line; }
.grow { flex: 1; min-width: 200px; }
.centree { max-width: 620px; margin: 40px auto; }
.col-qte { width: 140px; }
.align-fin { align-self: end; }
.sans-cadre { border: 0; padding: 0; margin: 0; } .legende { font-weight: 600; margin-bottom: 8px; }
.espace-bas { margin-bottom: 28px; } .espace-haut { margin-top: 24px; } .espace-haut-m { margin-top: 20px; } .espace-haut-s { margin-top: 8px; }
.row.nowrap, .nowrap { flex-wrap: nowrap; }

/* ---- Planning ---- */
.planning-grille { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .planning-grille { grid-template-columns: 1fr; } }
.passage { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface2); }
.passage-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; flex: none; }
.passage-corps { display: grid; flex: 1; min-width: 160px; } .passage-heure { font-weight: 600; white-space: nowrap; }
.trajet { margin: 0; padding-left: 12px; color: var(--muted); font-size: .85rem; }
.chiffre-ok b { color: var(--ok); }
.carte-svg { width: 100%; height: auto; background: var(--surface2); border-radius: 14px; }
.carte-svg .trace-actuel { fill: none; stroke: var(--line2); stroke-width: 3; stroke-dasharray: 6 6; }
.carte-svg .trace-propose { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.carte-svg .pt { fill: var(--ink); } .carte-svg .pt-depot { fill: var(--accent); }
.carte-svg .pt-num { fill: #fff; font: 700 12px var(--sans); }
.legende-propose { color: var(--accent-text); }

/* ---- Planning : roue dentée, carte, message d'information ---- */
.roue { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line2); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .2s, transform .3s; }
.roue svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.roue:hover { border-color: var(--accent); color: var(--accent); transform: rotate(45deg); }
.alerte-info { background: var(--hl); color: var(--accent-text); display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.carte-vive { min-height: 320px; border-radius: 14px; overflow: hidden; } .carte-active { height: 360px; }
.carte-vive .leaflet-container { font-family: var(--sans); }
.repere { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 .8rem var(--sans); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(20, 27, 45, .4); }
.repere-depot { background: var(--accent); border-radius: 6px; width: 22px; height: 22px; }

/* ---- Mode hors ligne ---- */
.hl-carte { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.hl-carte:hover { background: var(--hl); } .hl-fait { border-left-color: var(--ok); opacity: .85; }
.hl-heure { font: 700 1.1rem var(--sans); min-width: 56px; } .hl-corps { display: grid; flex: 1; min-width: 160px; } .hl-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.hl-note { padding: 8px 12px; border-radius: 10px; background: var(--surface2); }
#hl-app [hidden] { display: none; }

/* ---- Lignes de facture / devis ---- */
.ligne-zone.ligne-doc, .ligne-doc { display: grid; grid-template-columns: minmax(180px, 3fr) 80px 110px 80px 90px 38px; gap: 8px; align-items: center; margin-bottom: 8px; min-width: 640px; }
.ligne-entete { font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.ligne-doc input, .ligne-doc select { min-height: 42px; padding: 6px 10px; }
/* ---- Document imprimable ---- */
.document { max-width: 820px; margin: 0 auto; padding: 36px; background: #fff; color: #111; border: 1px solid var(--line); border-radius: 16px; }
.document-haut { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.document h1 { font-size: 1.6rem; letter-spacing: .04em; } .document h2 { font-size: 1.15rem; }
.document-titre { text-align: right; } .document-numero { font: 700 1.1rem var(--sans); }
.document-client { margin-bottom: 22px; padding: 14px 16px; border: 1px solid #ddd; border-radius: 10px; max-width: 360px; margin-left: auto; }
.document-lignes { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.document-lignes th, .document-lignes td { padding: 8px 6px; border-bottom: 1px solid #e3e3e3; text-align: left; font-size: .92rem; } .document .num { text-align: right; white-space: nowrap; }
.document-totaux { margin-left: auto; max-width: 320px; } .document-totaux p { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.document-ttc { border-top: 2px solid #111; font-size: 1.1rem; margin-top: 4px; padding-top: 8px !important; }
.document-mentions { margin-top: 26px; padding-top: 12px; border-top: 1px solid #ddd; color: #444; }
code { word-break: break-all; font-size: .8rem; }
@media print {
  .haut, .noprint, .alerte, footer.pied-visiteur { display: none !important; }
  body { background: #fff; } main.contenu { padding: 0; max-width: none; }
  .document { border: 0; border-radius: 0; padding: 0; max-width: none; }
  @page { margin: 16mm; }
}

/* ---- Onglets de rubrique (sous la barre du haut) ---- */
.sous-menu { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 2px; }
.sous-menu a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); color: var(--muted); font-size: .9rem; font-weight: 500; text-decoration: none; transition: border-color .15s, color .15s; }
.sous-menu a:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.sous-menu a.actif { background: var(--ink); border-color: var(--ink); color: var(--surface); }
main.contenu { padding-top: 20px; }

.apercu { position: relative; } .apercu-bandeau { text-align: center; margin: 0 auto 12px; padding: 8px 14px; max-width: 820px; border-radius: 10px; background: var(--hl); color: var(--accent-text); font-weight: 600; font-size: .85rem; letter-spacing: .04em; }
.apercu .document { background-image: repeating-linear-gradient(-30deg, transparent 0 140px, rgba(255, 90, 31, .035) 140px 142px); }

/* Même famille de formes partout : pastilles et ronds. */
.roue { border-radius: 50%; border-width: 1px; } .tick { border-radius: 999px; border-width: 1px; }
.hl-carte, .passage { border-radius: 18px; }
.document-logo { max-width: 200px; max-height: 90px; margin-bottom: 10px; display: block; }
.logo-reglage { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .logo-reglage img { max-width: 200px; max-height: 90px; padding: 8px; border: 1px dashed var(--line2); border-radius: 12px; background: #fff; }

.grille-articles input[type="number"] { width: 78px; min-height: 40px; padding: 4px 10px; text-align: right; } .grille-articles th.num, .grille-articles td.num { text-align: right; white-space: nowrap; }

/* ---- Écran de facture : actions à gauche, saisie au milieu, aperçu en direct à droite ---- */
.facture-deux { display: grid; grid-template-columns: 52px minmax(0, 1.15fr) minmax(380px, 1fr); gap: 20px; align-items: start; }
.rail { position: sticky; top: 84px; display: grid; gap: 10px; justify-items: center; }
.btn-icone { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .15s, color .15s, transform .15s; }
.btn-icone svg, .btn-emettre svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-icone:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-icone-danger:hover { border-color: var(--err); color: var(--err); }
.btn-emettre svg { width: 20px; height: 20px; }
.facture-apercu { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; border-radius: 16px; }
.facture-apercu .apercu-bandeau { margin-bottom: 8px; max-width: none; }
.facture-apercu .document { padding: 22px; font-size: .82rem; border-radius: 16px; }
.facture-apercu .document h1 { font-size: 1.2rem; } .facture-apercu .document h2 { font-size: 1rem; }
.facture-apercu .document-haut { gap: 14px; margin-bottom: 16px; } .facture-apercu .document-client { margin-bottom: 14px; }
.facture-apercu .document-lignes th, .facture-apercu .document-lignes td { padding: 6px 4px; font-size: .8rem; }
[data-apercu-chevaux][hidden] { display: none; }
@media (max-width: 1100px) { .facture-deux { grid-template-columns: 1fr; } .rail { position: static; display: flex; justify-content: flex-start; } .facture-apercu { position: static; max-height: none; } }

/* ---- Pleine largeur pour l'écran de facture, saisie plus grande, boutons de la liste ---- */
.contenu.contenu-large { max-width: min(1800px, 100% - 32px); }
.contenu-large .facture-deux { grid-template-columns: 64px minmax(0, 1.4fr) minmax(420px, 1fr); gap: 24px; }
.contenu-large .rail { gap: 14px; }
.contenu-large .btn-icone { width: 56px; height: 56px; }
.contenu-large .btn-icone svg { width: 26px; height: 26px; }
.contenu-large .ligne-doc { grid-template-columns: minmax(140px, 4fr) 84px 112px 84px 92px 44px; gap: 10px; min-width: 0; margin-bottom: 12px; }
.contenu-large .ligne-doc input, .contenu-large .ligne-doc select { min-height: 52px; font-size: 1.02rem; padding: 8px 14px; }
.contenu-large .ligne-entete { font-size: .85rem; }
.contenu-large .facture-apercu .document { font-size: .95rem; padding: 30px; }
.contenu-large .facture-apercu .document-lignes th, .contenu-large .facture-apercu .document-lignes td { font-size: .92rem; padding: 8px 6px; }
.contenu-large .facture-apercu .document h1 { font-size: 1.4rem; }
.actions-brouillon { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions-brouillon .btn-icone { width: 40px; height: 40px; }
.actions-brouillon .btn-icone svg, .actions-brouillon .btn-emettre svg { width: 19px; height: 19px; }
.btn-emettre { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 1100px) { .contenu-large .facture-deux { grid-template-columns: 1fr; } .contenu-large .ligne-doc { min-width: 640px; } }
/* ---- Copropriété d'un cheval ---- */
.copropriete { border: 1px dashed var(--line2); border-radius: 14px; padding: 12px 16px; }
.copropriete summary { cursor: pointer; font-weight: 600; }
.copro-ligne { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: end; margin-top: 10px; }
.copro-nom { align-self: center; color: var(--muted); font-size: .9rem; }
@media (max-width: 600px) { .copro-ligne { grid-template-columns: 1fr; } }
/* ---- Roue dentée, réglages des factures, interrupteurs ---- */
.sous-menu a.roue { margin-left: auto; padding: 8px 11px; }
.sous-menu a.roue svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sans-cadre { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 24px; }
.interrupteur { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.interrupteur input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.interrupteur small { display: block; color: var(--muted); font-size: .82rem; font-weight: 400; }
.aide { border: 1px dashed var(--line2); border-radius: 14px; padding: 10px 16px; }
.aide summary { cursor: pointer; font-weight: 600; }
.aide ol { margin: 10px 0 6px 20px; display: grid; gap: 6px; }
.btn-icone-petit { width: 36px; height: 36px; }
.btn-icone-petit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* ---- Onglets de rubrique en capsule, cases des relances, choix de phrases ---- */
.sous-menu { justify-content: space-between; align-items: center; flex-wrap: nowrap; }
.sous-menu .onglets { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.sous-menu .onglets a { border: 0; background: transparent; padding: 9px 20px; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.sous-menu .onglets a:hover { background: rgba(255,255,255,.75); color: var(--ink); }
.sous-menu .onglets a.actif { background: var(--ink); color: var(--surface); box-shadow: 0 4px 12px rgba(20,27,45,.22); }
.sous-menu a.roue { margin-left: 12px; flex: none; width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line2); color: var(--ink); }
.sous-menu a.roue:hover { border-color: var(--accent); color: var(--accent); transform: rotate(40deg); }
.sous-menu a.roue.actif { background: var(--ink); color: var(--surface); }
.sous-menu a.roue svg { width: 22px; height: 22px; }
.relances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.relance-case { display: grid; gap: 8px; padding: 14px 16px; border: 1.5px solid var(--line2); border-radius: 16px; background: var(--surface); font-weight: 600; }
.relance-saisie { display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--muted); }
.relance-saisie input { width: 96px; text-align: center; font-size: 1.25rem; font-weight: 700; }
.etiquette { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.bloc { display: block; color: var(--muted); font-weight: 400; font-size: .88rem; margin-top: 2px; }
@media (max-width: 700px) { .relances { grid-template-columns: 1fr; } .sous-menu .onglets a { padding: 9px 14px; } }
/* ---- Onglets : cartes blanches avec pictogramme, l'onglet actif en orange ---- */
.sous-menu .onglets { background: transparent; padding: 6px 2px 10px; gap: 10px; overflow-x: auto; }
.sous-menu .onglets a { display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: .95rem; box-shadow: 0 1px 2px rgba(20,27,45,.06), 0 4px 14px rgba(20,27,45,.06); transition: transform .15s, box-shadow .15s, background .15s; }
.sous-menu .onglets a svg { width: 21px; height: 21px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s; }
.sous-menu .onglets a:hover { background: var(--surface); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20,27,45,.06), 0 10px 22px rgba(20,27,45,.1); }
.sous-menu .onglets a:hover svg { stroke: var(--accent-text); }
.sous-menu .onglets a.actif { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(255,90,31,.35); transform: none; }
.sous-menu .onglets a.actif svg { stroke: var(--accent-ink); }
@media (max-width: 700px) { .sous-menu .onglets a { padding: 0 14px 0 12px; height: 42px; } }

/* ---- Tableau de bord : gros boutons pour les gestes de tous les jours ---- */
.titre-tuiles { margin: 22px 0 10px; font-size: 1.15rem; }
.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tuile { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 22px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(20,27,45,.06), 0 8px 22px rgba(20,27,45,.07); transition: transform .15s, box-shadow .15s; }
.tuile:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(20,27,45,.06), 0 16px 30px rgba(20,27,45,.12); text-decoration: none; }
.tuile-rond { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--hl); color: var(--accent-text); }
.tuile-rond svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tuile:hover .tuile-rond { background: var(--accent); color: var(--accent-ink); }
.tuile-texte { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.tuile-texte small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
@media (max-width: 900px) { .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tuile { flex-direction: column; text-align: center; padding: 16px 10px; } }
.tuiles { margin-bottom: 18px; }

/* ---- Étapes numérotées (formulaires guidés) et prestations par cheval ---- */
.num-etape { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 .95rem var(--sans); vertical-align: middle; }
.nom-cheval { font-size: 1.05rem; }
.prest-liste { display: grid; gap: 8px; margin-top: 8px; }
.prest-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; border: 1.5px solid var(--line2); border-radius: 14px; background: var(--surface); font-weight: 500; }
.prest-ligne input { width: 84px; min-height: 42px; text-align: center; font-weight: 700; }
.num-etape { display: inline-flex; align-items: center; justify-content: center; line-height: 1; padding-bottom: 1px; }

/* Étapes : juste le numéro, sans bulle */
.num-etape { display: inline; width: auto; height: auto; margin-right: 6px; padding: 0; border-radius: 0; background: none; color: var(--accent); font: inherit; vertical-align: baseline; }
.num-etape::after { content: "."; }

/* Quantités : − et + bien visibles */
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper input[type=number] { width: 64px; min-height: 48px; text-align: center; font-size: 1.15rem; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.stepper input[type=number]::-webkit-outer-spin-button, .stepper input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .pas { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--surface); color: var(--ink); font: 600 1.6rem/1 var(--sans); cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; transition: background .15s, border-color .15s, transform .1s; }
.stepper .pas:hover { border-color: var(--accent); color: var(--accent-text); }
.stepper .pas:active { transform: scale(.92); background: var(--hl); }

/* Quantités : un peu moins gros, texte des prestations plus lisible */
.stepper { gap: 6px; }
.stepper input[type=number] { width: 52px; min-height: 38px; font-size: 1.05rem; }
.stepper .pas { width: 38px; height: 38px; font-size: 1.3rem; padding-bottom: 2px; }
.prest-ligne { font-size: 1.05rem; padding: 6px 8px 6px 14px; }
.prest-ligne small { font-size: .85rem; }

/* ---- Historique d'un cheval et espace client ---- */
.historique { display: grid; gap: 10px; }
.histo-resume { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.histo-ligne { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface2); }
.histo-date { font-weight: 700; color: var(--ink); }
.histo-corps { display: grid; gap: 4px; }
.histo-note { padding-left: 10px; border-left: 3px solid var(--line2); }
.cheval-espace h3 { margin: 6px 0 8px; font-size: 1.1rem; }
.facture-espace { padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .histo-ligne { grid-template-columns: 1fr; gap: 4px; } }

/* Historique : point vert = terminé, point orange = à venir */
.point { display: inline-block; width: 12px; height: 12px; margin-right: 9px; border-radius: 50%; vertical-align: baseline; flex: none; }
.point-fait { background: #2fb36d; box-shadow: 0 0 0 3px rgba(47,179,109,.18); }
.point-prevu { background: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,31,.2); }

/* ---- Mon activité : graphique en barres (SVG, sans style en ligne) ---- */
.graphe { width: 100%; height: auto; display: block; }
.graphe .barre { fill: var(--accent); }
.graphe .barre:hover { fill: var(--accent-text); }
.graphe-mois { fill: var(--muted); font: 600 12px var(--sans); }
.graphe-valeur { fill: var(--ink); font: 700 11px var(--sans); }
.alerte-info.alerte-texte { display: block; }

/* ---- Achats ---- */
.mois-nav { align-items: center; }
.mois-titre { font-size: 1.1rem; }
.achat-ligne { padding: 10px 0; border-top: 1px solid var(--line); gap: 12px; }
.achat-ligne:first-child { border-top: 0; }
.achat-retire { opacity: .55; }
.choix-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tva-final { font-size: 1.05rem; padding: 12px 14px; border-radius: 14px; background: var(--hl); }

/* Listes déroulantes avec pictogrammes */
.dd-val, .dd-opt { display: flex; align-items: center; }
.dd-ico { width: 22px; height: 22px; margin-right: 12px; flex: none; fill: none; stroke: var(--accent-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Abonnement, administration, santé ---- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { display: grid; gap: 10px; justify-items: start; padding: 22px; border-radius: 22px; background: var(--surface); box-shadow: 0 1px 2px rgba(20,27,45,.06), 0 8px 22px rgba(20,27,45,.07); }
.plan h3 { margin: 0; }
.plan-prix { font: 700 2rem var(--serif, inherit); margin: 0; }
.plan-prix small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.bandeau-abo { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 9px 16px; background: var(--hl); color: var(--accent-text); font-size: .92rem; }
.bandeau-abo-rouge { background: var(--err-soft); color: var(--err); }
.sante-ligne { padding: 8px 0; border-top: 1px solid var(--line); gap: 14px; }
.sante-ligne:first-of-type { border-top: 0; }
.point-alerte { background: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.2); }
.point-info { background: #9aa3b5; box-shadow: 0 0 0 3px rgba(154,163,181,.25); }

/* ---- Administration : utilisateurs, appareils, problèmes ; fenêtre d'aide du maréchal ---- */
.utilisateur-admin { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.utilisateur-admin:first-of-type { border-top: 0; }
.appareil { margin: 0; padding-left: 4px; }
.probleme { margin: 0; display: flex; align-items: baseline; gap: 2px; }
.aide-liste { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.aide-liste li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.aide-coche { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line2); color: var(--accent-ink); font-weight: 700; font-size: .85rem; }
.aide-liste li.fait .aide-coche { background: var(--accent); border-color: var(--accent); }
.aide-liste li.fait { color: var(--muted); }
.aide-mot { margin: 4px 0 0; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--hl); border-radius: 0 12px 12px 0; }
.aide-mot footer { margin-top: 4px; }

/* ---- Bulle de chat avec le support ---- */
.chat { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.chat-bulle { position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(255,90,31,.4); transition: transform .15s; }
.chat-bulle:hover { transform: scale(1.06); }
.chat-bulle svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-pastille { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #e5484d; color: #fff; font: 700 .75rem/22px var(--sans); text-align: center; }
.chat-fenetre { width: min(360px, calc(100vw - 36px)); max-height: min(520px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; box-shadow: 0 18px 50px rgba(20,27,45,.25); overflow: hidden; }
.chat-haut { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: var(--ink); color: var(--surface); }
.chat-haut small { display: block; opacity: .75; font-size: .75rem; }
.chat-fermer { border: 0; background: transparent; color: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.chat-liste { flex: 1; min-height: 160px; overflow-y: auto; padding: 14px; display: grid; gap: 10px; align-content: start; }
.chat-msg { display: grid; gap: 2px; max-width: 86%; }
.chat-texte { padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg small { color: var(--muted); font-size: .72rem; padding: 0 6px; }
.chat-msg-moi { justify-self: end; text-align: right; }
.chat-msg-moi .chat-texte { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.chat-msg-support { justify-self: start; }
.chat-msg-support .chat-texte { background: var(--surface2); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { min-height: 44px; resize: none; }
.chat-erreur { margin: 0; padding: 0 14px 10px; }
.conversation-ligne { padding: 12px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; gap: 14px; }
.conversation-ligne:first-child { border-top: 0; }
.conversation-ligne:hover { background: var(--surface2); }
.carte .chat-msg { max-width: 70%; }
.transfert-zone { margin-top: 4px; }
.transfert { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.transfert:first-child { border-top: 0; }
.transfert-traite { opacity: .6; }

/* ---- Plusieurs plannings ---- */
.plannings-choix { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.planning-pastille { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none; box-shadow: 0 1px 2px rgba(20,27,45,.06), 0 4px 12px rgba(20,27,45,.06); }
.planning-pastille:hover { text-decoration: none; transform: translateY(-1px); }
.planning-pastille.actif { background: var(--ink); color: var(--surface); }
.pl-point { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 50%; vertical-align: baseline; flex: none; background: #ff5a1f; }
.planning-pastille .pl-point { margin-right: 0; }
.pl-point-gros { width: 26px; height: 26px; margin: 0; }
.pl-c1 { background: #ff5a1f; } .pl-c2 { background: #2f7de1; } .pl-c3 { background: #2fb36d; } .pl-c4 { background: #8a5cf6; } .pl-c5 { background: #e5489a; } .pl-c6 { background: #e8b100; }
.couleurs { display: flex; gap: 10px; flex-wrap: wrap; }
.couleur-choix { cursor: pointer; display: inline-flex; }
.couleur-choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.couleur-choix .pl-point { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px transparent; transition: box-shadow .15s; }
.couleur-choix input:checked + .pl-point { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.couleur-choix input:focus-visible + .pl-point { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.planning-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-weight: 600; }
.planning-badge .pl-point { width: 9px; height: 9px; margin: 0; }
.sr-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Réorganiser la semaine ---- */
.reorg-appel { align-items: center; gap: 16px; flex-wrap: wrap; }
.idee { padding: 10px 14px; border-radius: 14px; background: var(--surface2); align-items: center; gap: 12px; }
.reorg-ligne { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface2); }
.reorg-heure { font-weight: 700; }
.reorg-corps { display: grid; }
.reorg-champ { display: grid; gap: 2px; }
.reorg-champ select { min-height: 42px; min-width: 150px; }
.reorg-champ input { width: 76px; min-height: 42px; text-align: center; font-weight: 700; }
.reorg-petit { font-size: .72rem; color: var(--muted); text-align: center; }
.jour-reorg h3 { margin: 0; }
@media (max-width: 640px) { .reorg-ligne { grid-template-columns: 56px minmax(0, 1fr); } .reorg-champ { grid-column: 1 / -1; } }

/* ---- Bulle de chat : la fenêtre se ferme vraiment (display:flex écrasait l'attribut hidden) ---- */
.chat [hidden] { display: none !important; }
.chat-fermer { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.chat-fermer:hover { background: rgba(255,255,255,.14); }
/* ---- Onglets : les rubriques de réglage à droite, plus discrètes ---- */
.sous-menu .onglets-reglage { margin-left: auto; }
.sous-menu .onglets-reglage a { height: 40px; font-size: .88rem; box-shadow: none; border: 1px solid var(--line2); }
@media (max-width: 900px) { .sous-menu .onglets-reglage { margin-left: 0; } }
/* ---- Réglages : raccourcis en haut, sections bien séparées, bouton toujours visible ---- */
.saut { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; position: sticky; top: 0; z-index: 5; padding: 10px 0; background: var(--bg, #f6f7fb); }
.saut a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none; box-shadow: 0 1px 2px rgba(20,27,45,.06); }
.saut a:hover { box-shadow: 0 4px 14px rgba(20,27,45,.12); text-decoration: none; }
.saut svg { width: 20px; height: 20px; fill: none; stroke: var(--accent-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ancre { scroll-margin-top: 70px; }
.barre-enregistrer { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg, #f6f7fb) 40%); }

/* ---- Statistiques du tableau de bord (patron) ---- */
.stats h2 { margin: 0; } .stats h3 { margin: 0 0 12px; font-size: 1rem; }
.stats-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 14px 0; }
.stat-tuile { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 2px 10px; padding: 16px 18px; }
.stat-tuile small { grid-column: 1; color: var(--muted); font-weight: 600; }
.stat-tuile b { grid-column: 1 / -1; font: 700 1.6rem/1.2 var(--sans); color: var(--ink); }
.stat-tuile > .muted { grid-column: 1 / -1; }
.stat-rond { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.stat-rond svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-rond.s0 { background: var(--hl); color: var(--accent-text); } .stat-rond.s1 { background: var(--err-soft); color: var(--err); }
.stat-rond.s2 { background: var(--ok-soft); color: var(--ok); } .stat-rond.s3 { background: #fdf0d5; color: #8a5a00; } .stat-rond.s4 { background: var(--surface2); color: var(--ink); }
.stat-hausse { color: var(--ok); font-weight: 600; } .stat-baisse { color: var(--err); font-weight: 600; }
.stats-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 10px; }
.stats-grille .stat-grand:first-child { grid-column: 1 / -1; }
@media (max-width: 800px) { .stats-grille { grid-template-columns: 1fr; } }
.gs0 { fill: var(--accent); background: var(--accent); } .gs1 { fill: var(--ink); background: var(--ink); } .gs2 { fill: #0f7a57; background: #0f7a57; }
.gs3 { fill: #e8a33a; background: #e8a33a; } .gs4 { fill: #4b6cb7; background: #4b6cb7; } .gs5 { fill: #9aa3b8; background: #9aa3b8; }
.gc0 { stroke: var(--accent); } .gc1 { stroke: var(--ink); } .gc2 { stroke: #0f7a57; } .gc3 { stroke: #e8a33a; } .gc4 { stroke: #4b6cb7; } .gc5 { stroke: #9aa3b8; }
.graphe-grille { stroke: var(--line); stroke-width: 1; } .graphe-ligne { stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; } .graphe-point { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.stat-legende { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; color: var(--muted); font-size: .85rem; }
.stat-legende i, .stat-liste i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 7px; vertical-align: -1px; } .stat-legende i.gl { height: 3px; background: var(--ink); border-radius: 2px; vertical-align: 3px; }
.stat-anneau { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 18px; } .stat-anneau svg { width: 100%; height: auto; }
.stat-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .stat-liste li { display: flex; align-items: center; } .stat-liste li span { flex: 1; } .stat-liste b { font-weight: 700; }
@media (max-width: 480px) { .stat-anneau { grid-template-columns: 1fr; } .stat-anneau svg { max-width: 190px; margin: 0 auto; } }
.stats-vide { text-align: center; padding: 26px; }

/* ---- Moyens de paiement (réglages des factures) ---- */
.moyens-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.moyens-liste li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface2); }
.moyens-liste form { margin: 0; }
.moyens-ajout { align-items: flex-end; } .moyens-ajout .champ { flex: 1; min-width: 220px; }

/* ---- Info-bulle des graphiques (au survol ou au clavier) ---- */
.graphe-zone { fill: transparent; cursor: pointer; outline: none; } .graphe-zone:hover, .graphe-zone:focus { fill: rgba(255, 90, 31, .09); }
.gc0, .gc1, .gc2, .gc3, .gc4, .gc5 { cursor: pointer; } .gc0:hover, .gc1:hover, .gc2:hover, .gc3:hover, .gc4:hover, .gc5:hover { stroke-width: 26; }
.bulle-graphe { position: fixed; z-index: 60; pointer-events: none; min-width: 150px; max-width: 260px; padding: 10px 14px; border-radius: 14px; background: var(--ink); color: var(--surface); box-shadow: 0 12px 30px rgba(20, 27, 45, .3); font-size: .85rem; line-height: 1.45; }
.bulle-graphe[hidden] { display: none; } .bulle-graphe b { display: block; font-size: .95rem; } .bulle-graphe strong { display: block; font-size: 1.1rem; color: #ffb28f; }

/* ---- Accueil des réglages : de grosses cartes rangées par sujet ---- */
.reglage-groupe { margin-top: 26px; } .reglage-groupe h2 { margin: 0 0 2px; } .reglage-groupe > .muted { margin: 0 0 12px; }
.reglage-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.reglage-carte, .reglage-alerte { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--ink); text-decoration: none; min-height: 76px; transition: transform .15s, box-shadow .15s; }
.reglage-carte:hover, .reglage-alerte:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20, 27, 45, .12); text-decoration: none; }
.reglage-carte b, .reglage-alerte b { display: block; font-size: 1rem; } .reglage-carte small, .reglage-alerte small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.reglage-carte .badge { margin-left: auto; white-space: nowrap; }
.reglage-rond { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--hl); color: var(--accent-text); display: grid; place-items: center; }
.reglage-rond svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.reglage-rond-alerte { background: var(--err-soft); color: var(--err); }
.reglage-alerte { margin-bottom: 6px; border: 1px solid #f0c7bb; background: #fff7f4; }
.retour-reglages { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 27, 45, .08); color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none; }
.retour-reglages:hover { text-decoration: none; box-shadow: 0 4px 12px rgba(20, 27, 45, .14); }
.retour-reglages svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Statistiques : tuiles plus aérées, 3 par ligne (2 lignes), pictogramme à gauche ---- */
.stats-chiffres { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-tuile { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 16px; padding: 20px 22px; }
.stat-tuile .stat-rond { grid-column: 1; grid-row: 1 / span 3; width: 52px; height: 52px; border-radius: 16px; }
.stat-tuile .stat-rond svg { width: 26px; height: 26px; }
.stat-tuile small { grid-column: 2; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-tuile b { grid-column: 2; font-size: 1.75rem; line-height: 1.15; }
.stat-tuile > .muted { grid-column: 2; font-size: .82rem; }
@media (max-width: 1000px) { .stats-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats-chiffres { grid-template-columns: 1fr; } .stat-tuile { padding: 16px 18px; } }

/* ---- Registre des traitements ---- */
.registre { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; margin: 0; } .registre dt { color: var(--muted); font-weight: 600; } .registre dd { margin: 0; }
@media (max-width: 600px) { .registre { grid-template-columns: 1fr; } .registre dt { margin-top: 6px; } }

/* ---- Pages juridiques, pied de page, incidents ---- */
.texte-juridique { max-width: 820px; margin: 0 auto; } .texte-juridique h1 { margin-bottom: 4px; } .texte-juridique h2 { margin: 24px 0 6px; font-size: 1.1rem; } .texte-juridique li { margin-bottom: 6px; }
.pied-legal { text-align: center; margin: 24px 0 18px; } .pied-legal a { color: var(--muted); } .invite-legal { padding: 0 16px; }
.registre-presta { padding: 8px 0; border-bottom: 1px solid var(--line); } .registre-presta:last-child { border-bottom: 0; }
.incident { padding: 12px 0; border-bottom: 1px solid var(--line); } .incident:last-child { border-bottom: 0; }
.modele-message { white-space: pre-wrap; background: var(--surface2); padding: 14px 16px; border-radius: 14px; font: inherit; font-size: .9rem; overflow-wrap: anywhere; }

/* ---- Téléphone : rien ne doit dépasser de l'écran (tableaux dans leur cadre défilant, listes à cocher alignées) ---- */
.stack > *, .stack-l > *, .stack-s > *, .carte, .tableau-defile { min-width: 0; max-width: 100%; }
.aide-liste li > :not(.aide-coche):not(.badge) { flex: 1 1 0; min-width: 0; }
.carte.espace-haut, .stack.espace-haut { margin-top: 24px; }
.carte.espace-bas, .stack.espace-bas { margin-bottom: 24px; }
