/* Le thème sombre des espaces pro et patient (Jo, 12 oct., à la façon d'Agendario). Rien ici ne touche le thème clair :
   chaque règle commence par html[data-theme="dark"], posé par js/theme.js quand la personne choisit « Dark » dans le
   menu de son compte. Les surfaces passent par les jetons de portal.css (--card, --title…) ; ce qui reste ici, ce sont
   les couleurs écrites en dur dans les pages (pro*.html, patient/*.html) et les scripts (tel.js, bug.js).
   Le portail admin et les pages publiques restent clairs. */

html[data-theme="dark"] { color-scheme: dark; }
/* Les jetons, posés sur body : portal.css redéfinit déjà certains jetons sur body.espace-pro et body.espace-patient */
html[data-theme="dark"] body {
  --bg: #0e1218;
  --card: #171c24;
  --raised: #1e2430;   /* ce qui flotte au-dessus : menus, cloche, clic droit */
  --title: #eef2f8;
  --text: #dde3ec;
  --muted: #a7b1c1;
  --soft: #8892a4;
  --line: #2a313d;
  --line-2: #3a4456;   /* contours des champs et des boutons */
  --hover: #212833;
  --tint: #1b2230;
  --ic-bg: #1f2a3d;
  --amber: #f2a54a; --amber-bg: #3a2a14;
  --red: #f28b82; --red-bg: #3c1f1e;
  --green: #5cc995; --green-bg: #15301f;
  --teal: #3cb8ae; --violet: #a993f2; --blue: #82a7ff;
}
/* Le pro : le bleu, un cran plus clair pour se lire sur le fond sombre */
html[data-theme="dark"] body.espace-pro {
  --navy: #3e6ee0; --navy-deep: #0b1426; --link: #8fb1ff;
  --hover: #1f2836; --tint: #1a2333; --ic-bg: #1d2a44; --bg: #0d1219;
}
/* Le patient : le vert-bleu, des gris teintés de vert */
html[data-theme="dark"] body.espace-patient {
  --navy: #16897f; --navy-deep: #081b1a; --link: #5fd0c5; --teal: #3cc2b6;
  --bg: #0c1213; --card: #151d1e; --raised: #1b2526; --line: #263233; --line-2: #36484a;
  --hover: #1c2829; --tint: #172223; --ic-bg: #183232;
}

/* ---------- En-tête, menus, pied de page ---------- */
html[data-theme="dark"] .p-logo .agen { color: #eef2f8; }
html[data-theme="dark"] .p-logo .viva { color: #3cc2b6; }
html[data-theme="dark"] body.espace-pro .p-header { background: #0b1830; box-shadow: inset 0 -1px 0 #1c2a45; }
html[data-theme="dark"] body.espace-pro .p-header .p-bell .dot { border-color: #0b1830; }
html[data-theme="dark"] body.espace-patient .p-header { background: #10282a; box-shadow: inset 0 -1px 0 #1e3c3e; }
html[data-theme="dark"] body.espace-patient .p-home { color: var(--link); }
html[data-theme="dark"] body.espace-patient .p-home .i { fill: var(--link); stroke: var(--link); }
html[data-theme="dark"] body.espace-patient.defile .p-header { box-shadow: inset 0 -1px 0 #1e3c3e, 0 6px 18px rgba(0, 0, 0, .45); }
html[data-theme="dark"] body.defile .p-header { box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .p-bell .dot { border-color: var(--bg); }
html[data-theme="dark"] .p-nlist, html[data-theme="dark"] .p-menu, html[data-theme="dark"] .ctx-menu, html[data-theme="dark"] .av-plus-m {
  background: var(--raised); border-color: var(--line-2); box-shadow: 0 14px 36px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .p-nx:hover { background: var(--hover); }
:where(html[data-theme="dark"]) .avatar { background: #3a4556; }
/* :where() : la même force que la règle de portal.css, pour que l'onglet actif et le survol gardent la leur */
:where(html[data-theme="dark"]) .p-nav a { background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .p-nav .sep { background: var(--line); }
html[data-theme="dark"] .av-lang select { border-color: var(--line-2); color: var(--link); }
html[data-theme="dark"] .p-header .av-lang select { background: var(--card); }
@media (max-width: 700px) { html[data-theme="dark"] .p-right .av-lang { border-color: var(--line-2); color: var(--link); } }  /* le globe du téléphone */
html[data-theme="dark"] .p-banner { border-bottom-color: #4a3818; }
html[data-theme="dark"] .p-banner a { color: var(--link); }
html[data-theme="dark"] .p-notice { background: #16213a; color: var(--link); border-top-color: #26355a; }
html[data-theme="dark"] .p-notice-x { color: var(--link); }
html[data-theme="dark"] .p-notice-x:hover { background: rgba(143, 177, 255, .12); }
/* Le choix de la langue rendu par Django (agenviva/langues.py, MENU_CSS) : portail patient */
html[data-theme="dark"] .av-lang select { background: var(--card); }

/* ---------- La pilule du thème, dans le menu du compte (js/theme.js) ---------- */
.av-theme { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 6px 0 12px; font-size: 15px; font-weight: 500; color: var(--text); }
.p-nav .av-theme { display: none; }
.av-theme-l { flex: 1; display: flex; align-items: center; gap: 12px; }
.av-theme-l .i { width: 20px; height: 20px; }
.av-theme-p { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.av-theme-p button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border: 0; border-radius: 999px;
  background: none; color: var(--soft); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.av-theme-p button:hover { color: var(--text); }
.av-theme-p button .i { width: 18px; height: 18px; }
.av-theme-p button span { display: none; }
.av-theme-p button[aria-pressed="true"] { padding: 0 12px 0 10px; background: var(--card); color: var(--title); box-shadow: 0 1px 3px rgba(9, 20, 45, .18); }
.av-theme-p button[aria-pressed="true"] span { display: inline; }
.av-theme-p button:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
html[data-theme="dark"] .av-theme-p { background: var(--bg); }
html[data-theme="dark"] .av-theme-p button[aria-pressed="true"] { background: var(--line-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }

/* ---------- Éléments communs ---------- */
html[data-theme="dark"] .info-texte, html[data-theme="dark"] .chip[data-tip]::after { background: #2c3546; box-shadow: 0 0 0 1px #3d4860; }
html[data-theme="dark"] .btn.outline { box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--link); }
html[data-theme="dark"] .btn.outline:hover { box-shadow: inset 0 0 0 1.5px var(--link); }
html[data-theme="dark"] .btn.teal:hover { background: var(--hover); }
html[data-theme="dark"] .btn.danger { box-shadow: inset 0 0 0 1.5px rgba(242, 139, 130, .45); }
html[data-theme="dark"] .btn.primary { box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .chip.booked { background: #1f2b42; color: #a9bff0; }
html[data-theme="dark"] .chip.done, html[data-theme="dark"] .chip.muted { background: #252c37; }
html[data-theme="dark"] .no { color: #566173; }
html[data-theme="dark"] .tbl tbody tr:hover { background: var(--hover); }
html[data-theme="dark"] .tbl tr.sel { background: var(--tint); }
:where(html[data-theme="dark"]) .input, :where(html[data-theme="dark"]) select.input, :where(html[data-theme="dark"]) textarea.input { border-color: var(--line-2); }
html[data-theme="dark"] .input:focus, html[data-theme="dark"] av-heure.input:focus-within { outline-color: rgba(130, 167, 255, .45); }
html[data-theme="dark"] av-heure select:focus { background: var(--hover); }
html[data-theme="dark"] .m-overlay { background: rgba(0, 0, 0, .62); }
html[data-theme="dark"] .m-box { box-shadow: 0 20px 50px rgba(0, 0, 0, .55), 0 0 0 1px var(--line); }
html[data-theme="dark"] .opt:hover { border-color: #445066; }
html[data-theme="dark"] .warn { color: var(--amber); }
html[data-theme="dark"] .toast { box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .ctx-menu .ctx-sep, html[data-theme="dark"] .p-menu .sep { background: var(--line-2); }

/* ---------- Le dossier patient (js/dossier.js) ---------- */
html[data-theme="dark"] .dos-fiche .hist li.annule .h1 { text-decoration-color: rgba(255, 255, 255, .3); }
html[data-theme="dark"] .nb-act button:hover, html[data-theme="dark"] .nb-c:hover, html[data-theme="dark"] .nb-share:hover,
html[data-theme="dark"] .dos-ico:hover { background: var(--hover); }
html[data-theme="dark"] .dos-tools { background: var(--tint); }
html[data-theme="dark"] .dos-tools button { color: var(--title); }
html[data-theme="dark"] .dos-tools button:hover { background: var(--hover); }
html[data-theme="dark"] .dos-tools button.on { background: #26324a; color: var(--link); }
html[data-theme="dark"] .dos-tools .dos-col span { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
html[data-theme="dark"] .dos-tools .dos-col:first-of-type span { background: var(--title) !important; }  /* « Default color » : le texte clair */
html[data-theme="dark"] .dos-sep { background: var(--line-2); }
:where(html[data-theme="dark"]) .dos-ico { color: #6b778a; }
html[data-theme="dark"] .dos-ico:hover { color: var(--link); }
html[data-theme="dark"] .dos-ico.plein { color: var(--link); }
html[data-theme="dark"] .dos-ico span { box-shadow: 0 0 0 2px var(--card); }
html[data-theme="dark"] .nb-share:not(.on) .sw { background: var(--line-2); }
html[data-theme="dark"] .nb.partagee { border-color: #2b5c59; background: #142424; }
/* Les couleurs des notes, plus claires pour se lire sur le fond sombre */
html[data-theme="dark"] .c-red { color: #ff8a80; }
html[data-theme="dark"] .c-blue { color: #8fb1ff; }
html[data-theme="dark"] .c-green { color: #7bd389; }
html[data-theme="dark"] .c-orange { color: #f5b25f; }

/* ---------- Communication preferences ---------- */
html[data-theme="dark"] .tgl { background: var(--line-2); }
html[data-theme="dark"] .tgl[aria-checked="true"] { background: var(--teal); }
html[data-theme="dark"] .comms-alerte { background: var(--amber-bg); color: var(--amber); }
html[data-theme="dark"] .comms-rappel { color: var(--link); }
html[data-theme="dark"] .canal-nom { color: var(--title); }
html[data-theme="dark"] .canal-etat::before { background: #5a6577; }
html[data-theme="dark"] .canal-etat.orange { color: var(--amber); }
html[data-theme="dark"] .comms-toast { background: #2c3546; }

/* ---------- Le champ de téléphone (js/tel.js) ---------- */
html[data-theme="dark"] av-tel .avt-box { background: var(--card); border-color: var(--line-2); }
html[data-theme="dark"] av-tel .avt-box:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px rgba(130, 167, 255, .18); }
html[data-theme="dark"] av-tel.input .avt-box:focus-within { outline-color: rgba(130, 167, 255, .45); }
html[data-theme="dark"] av-tel .avt-cc { background: var(--tint); color: var(--text); border-right-color: var(--line-2); }
html[data-theme="dark"] av-tel .avt-cc:focus-within { background: var(--hover); }
html[data-theme="dark"] av-tel .avt-cc svg { stroke: var(--soft); }
html[data-theme="dark"] av-tel .avt-apercu { color: var(--muted); }
html[data-theme="dark"] av-tel .avt-apercu.avt-mal { color: var(--amber); }
html[data-theme="dark"] av-tel[disabled] .avt-box { background: var(--tint); }

/* ---------- Le bouton « Bug » et sa fenêtre (js/bug.js) ---------- */
html[data-theme="dark"] .avb-ov { background: rgba(0, 0, 0, .62); color: var(--text); }
html[data-theme="dark"] .avb-box { background: var(--card); box-shadow: 0 20px 50px rgba(0, 0, 0, .55), 0 0 0 1px var(--line); }
html[data-theme="dark"] .avb-box h3 { color: var(--title); }
html[data-theme="dark"] .avb-box p { color: var(--soft); }
html[data-theme="dark"] .avb-box input, html[data-theme="dark"] .avb-box textarea, html[data-theme="dark"] .avb-box select { background: var(--card); border-color: var(--line-2); }
html[data-theme="dark"] .avb-row button { background: var(--card); border-color: var(--line-2); color: var(--link); }
html[data-theme="dark"] .avb-row button.ok { background: var(--navy); border-color: var(--navy); color: #fff; }
html[data-theme="dark"] .avb-err { color: var(--red); }
html[data-theme="dark"] .avb-box a { color: var(--link); }

/* ---------- Vivi dans l'espace pro (js/vivi.js ; Jo, 16 oct. : la fenêtre restait claire en sombre) ---------- */
html[data-theme="dark"] .vv-win { background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px var(--line); }
@media (min-width: 601px) {  /* son liseré qui tourne (js/vivi.js), sur le fond sombre */
  html[data-theme="dark"] .vv-win { background: linear-gradient(var(--card), var(--card)) padding-box,
    conic-gradient(from var(--vv-a), #152a52 0deg, #2d4a85 70deg, #3b6fe0 130deg, #0e7676 190deg, #3ddc97 250deg,
      #e8fff6 285deg, #3ddc97 315deg, #152a52 360deg) border-box; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
}
html[data-theme="dark"] .vv-b { background: var(--bg); }
html[data-theme="dark"] .vv-hist, html[data-theme="dark"] .vv-aide { background: var(--raised); border-color: var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .vv-hist button { color: var(--text); }
html[data-theme="dark"] .vv-hist button:hover { background: var(--hover); }
html[data-theme="dark"] .vv-hist .r:hover { background: var(--hover); }
html[data-theme="dark"] .vv-hist .r .x:hover { background: var(--red-bg); color: var(--red); }
html[data-theme="dark"] .vv-hist button span, html[data-theme="dark"] .vv-hist .vide { color: var(--soft); }
html[data-theme="dark"] .vv-aide li { color: var(--muted); }
html[data-theme="dark"] .vv-aide li b { color: var(--text); }
html[data-theme="dark"] .vv-aide .oui > b { color: var(--green); }
html[data-theme="dark"] .vv-aide .non > b { color: var(--red); }
html[data-theme="dark"] .vv-aide p { border-top-color: var(--line); color: var(--soft); }
html[data-theme="dark"] .vv-m.user { background: var(--navy); }
html[data-theme="dark"] .vv-m.vivi .bulle { background: var(--raised); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
html[data-theme="dark"] .vv-m.vivi a { color: var(--link); }
html[data-theme="dark"] .vv-m.vivi code { background: var(--hover); }
html[data-theme="dark"] .vv-m.vivi pre { background: var(--tint); }
html[data-theme="dark"] .vv-m.vivi th, html[data-theme="dark"] .vv-m.vivi td { border-color: var(--line); }
html[data-theme="dark"] .vv-m .meta, html[data-theme="dark"] .vv-tape { color: var(--soft); }
html[data-theme="dark"] .vv-accueil { color: var(--muted); }
html[data-theme="dark"] .vv-accueil b { color: var(--title); }
html[data-theme="dark"] .vv-idees button { background: var(--card); border-color: var(--line-2); color: var(--link); }
html[data-theme="dark"] .vv-idees button:hover { background: var(--hover); border-color: var(--teal); }
html[data-theme="dark"] .vv-f { background: var(--card); border-top-color: var(--line); }
html[data-theme="dark"] .vv-f textarea { background: var(--bg); border-color: var(--line-2); color: var(--text); }
html[data-theme="dark"] .vv-f textarea::placeholder { color: var(--soft); }
html[data-theme="dark"] .vv-f textarea:focus { outline-color: #2d4a85; border-color: var(--link); }
html[data-theme="dark"] .vv-f .env { background: var(--navy); }
html[data-theme="dark"] .vv-f .clip { color: var(--soft); }
html[data-theme="dark"] .vv-f .clip:hover { color: var(--text); background: var(--bg); }
html[data-theme="dark"] .vv-f .bas { color: var(--soft); }
html[data-theme="dark"] .vv-err { background: var(--red-bg); color: var(--red); }
html[data-theme="dark"] .vv-m.vivi a.vv-noms-lien { background: var(--ic-bg); }
html[data-theme="dark"] .vv-noms { background: var(--raised); border-color: var(--line); color: var(--muted); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .vv-noms b { color: var(--title); }
html[data-theme="dark"] .vv-noms ul.ex li { background: var(--ic-bg); color: var(--link); }
html[data-theme="dark"] .vv-noms ul.ex .bientot { background: var(--card); color: var(--soft); }
html[data-theme="dark"] .vv-noms .act button { background: var(--card); border-color: var(--line-2); color: var(--link); }
html[data-theme="dark"] .vv-noms .act button.oui { background: var(--navy); border-color: var(--navy); color: #fff; }
html[data-theme="dark"] .vv-pied-noms { color: var(--muted); }
html[data-theme="dark"] .vv-pied-noms.on { color: var(--green); }
html[data-theme="dark"] .vv-pied-noms::after { background: #2c3546; box-shadow: 0 0 0 1px #3d4860; }
html[data-theme="dark"] .vv-sw { background: var(--line-2); }
html[data-theme="dark"] .vv-sw[aria-checked="true"] { background: var(--green); }
html[data-theme="dark"] .vv-note { color: var(--green); }
html[data-theme="dark"] .vv-carte { background: var(--raised); border-color: #2d4a85; }
html[data-theme="dark"] .vv-carte > b { color: var(--title); }
html[data-theme="dark"] .vv-carte dt { color: var(--soft); }
html[data-theme="dark"] .vv-carte dd { color: var(--text); }
html[data-theme="dark"] .vv-carte .al { background: rgba(245, 158, 11, .12); color: #f5b453; }
html[data-theme="dark"] .vv-carte .act small, html[data-theme="dark"] .vv-carte .exp { color: var(--soft); }
html[data-theme="dark"] .vv-carte .ens { background: var(--hover); color: var(--muted); }
html[data-theme="dark"] .vv-carte .act button { background: var(--card); border-color: var(--line-2); color: var(--link); }
html[data-theme="dark"] .vv-carte .act button.oui { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Résumé du pro (pro.html) ---------- */
html[data-theme="dark"] .rdv-l .h, html[data-theme="dark"] .rdv-l a { text-decoration-color: #4a5568; }
html[data-theme="dark"] .rdv-l .chev { color: #5d687b; }
html[data-theme="dark"] .rdv-av.c1 { background: #163432; color: #6fd6cc; }
html[data-theme="dark"] .rdv-av.c2 { background: #1d2a4a; color: #9db6ff; }
html[data-theme="dark"] .rdv-av.c3 { background: #3a2618; color: #f0a877; }
html[data-theme="dark"] .rdv-av.c4 { background: #2c2142; color: #c3a5f5; }
html[data-theme="dark"] .rdv-av.c5 { background: #183420; color: #7fd18f; }
html[data-theme="dark"] .rdv-av.c6 { background: #3d1d26; color: #f28ba5; }
@keyframes av-veille-sombre { 0%, 100% { background-color: var(--card); } 50% { background-color: #3d2a12; } }
html[data-theme="dark"] .rdv-l.veille { animation-name: av-veille-sombre; }
html[data-theme="dark"] .chip.veille-chip, html[data-theme="dark"] .k-veille .dem-tag { background: var(--amber-bg); color: var(--amber); }
html[data-theme="dark"] .k-resa .dem-tag { background: var(--green-bg); color: var(--green); }
html[data-theme="dark"] .k-dep .dem-tag { background: #1d2a4a; color: #9db6ff; }
html[data-theme="dark"] .k-chg .dem-tag { background: var(--red-bg); color: var(--red); }
html[data-theme="dark"] .dep-pas > div:not(.fait):not(.maintenant) .num { box-shadow: inset 0 0 0 1.5px var(--line-2); }
html[data-theme="dark"] .dep-pas .maintenant { box-shadow: inset 0 0 0 2px var(--navy), 0 10px 24px rgba(0, 0, 0, .35); }

/* ---------- My information, My patients ---------- */
html[data-theme="dark"] .tag { background: var(--ic-bg); color: var(--link); }
html[data-theme="dark"] input.sw:not(:checked) { background: var(--line-2); }
html[data-theme="dark"] tbody tr:hover { background: var(--hover); }

/* ---------- L'agenda (pro-citas.html, FullCalendar) ---------- */
html[data-theme="dark"] .fc {
  --fc-border-color: #262e3a; --fc-today-bg-color: #172033; --fc-non-business-color: #12161d; --fc-page-bg-color: var(--card);
  --fc-neutral-bg-color: #1b212a; --fc-list-event-hover-bg-color: var(--hover); --fc-highlight-color: rgba(130, 167, 255, .16);
}
html[data-theme="dark"] .fc .fc-button { border-color: var(--line-2); color: var(--link); }
html[data-theme="dark"] .fc .fc-button:hover { color: var(--link); border-color: var(--line-2); }
html[data-theme="dark"] .fc .fc-button-primary:not(:disabled).fc-button-active,
html[data-theme="dark"] .fc .fc-button-primary:not(:disabled):active { background: var(--navy); border-color: var(--navy); color: #fff; }
html[data-theme="dark"] .fc .fc-button-primary:disabled { border-color: var(--line-2); color: var(--link); }
html[data-theme="dark"] .fc .fc-day-today .fc-col-header-cell-cushion { color: var(--link); }
html[data-theme="dark"] .mode-g button { color: var(--link); }
html[data-theme="dark"] .mode-g button.on { color: #fff; }
/* Les blocs : le fond teinté devient sombre (portal.js, typeStyles : la couleur du type mêlée à --card), le texte clair */
html[data-theme="dark"] .fc .appt:not(.s-wait):not(.req):not(.s-done):not(.s-noshow) {
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 55%), var(--tb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 3px 0 var(--tranche); }
html[data-theme="dark"] .fc .appt:not(.s-wait):not(.req):not(.s-done):not(.s-noshow):hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 0 var(--tranche); }
html[data-theme="dark"] .fc .appt:not(.s-wait):not(.req):not(.s-done):not(.s-noshow):active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 1px 0 var(--tranche); }
html[data-theme="dark"] .fc .appt:not(.s-wait):not(.req):not(.s-done):not(.s-noshow) { --tranche: color-mix(in srgb, var(--tc) 55%, var(--card)); }
html[data-theme="dark"] .fc .ev-name { color: color-mix(in srgb, var(--tc, #8fb1ff) 30%, #fff); }
html[data-theme="dark"] .fc .ev-meta { color: color-mix(in srgb, var(--tc, #a7b1c1) 30%, #b4bdcb); }
html[data-theme="dark"] .fc .ev-mbn { color: color-mix(in srgb, var(--tc, #a7b1c1) 10%, #6f7888); }
html[data-theme="dark"] .fc .fc-daygrid-day:hover { background: rgba(130, 167, 255, .06); }
html[data-theme="dark"] .survol { background: rgba(130, 167, 255, .12); }
html[data-theme="dark"] .fc .ev-req { color: var(--amber); }
@keyframes av-attente-sombre { 0%, 100% { background-color: var(--card); } 50% { background-color: #3d2a12; } }
html[data-theme="dark"] .fc .appt.req { animation-name: av-attente-sombre; }
html[data-theme="dark"] .fc .blk-rule { background: repeating-linear-gradient(135deg, #242b36 0 5px, #1a2029 5px 10px); }
html[data-theme="dark"] .fc .blk-once { background: repeating-linear-gradient(135deg, #3e2a1c 0 5px, #2a1f18 5px 10px); }
html[data-theme="dark"] .fc .blk .fc-event-title { color: #9aa5b6; }
html[data-theme="dark"] .fc .blk-once .fc-event-title { color: #f0a877; }
html[data-theme="dark"] .fc .fc-v-event.blk-mb { background: repeating-linear-gradient(135deg, #242b36 0 6px, #1a2029 6px 12px); border-color: #364153; }
html[data-theme="dark"] .fc .blk-mb .ev-blk { color: #9aa5b6; }
html[data-theme="dark"] .fc .fc-bg-event.annule-bg { background: rgba(23, 28, 36, .7); border-color: #4a5568; }
html[data-theme="dark"] .sw.rule { background: repeating-linear-gradient(135deg, #2c3441 0 3px, #1d232c 3px 6px); }
html[data-theme="dark"] .sw.once { background: repeating-linear-gradient(135deg, #4a2f1c 0 3px, #2e2119 3px 6px); }
html[data-theme="dark"] .sw.off { background: #12161d; border-color: var(--line); }
html[data-theme="dark"] .blist li { background: var(--tint); }
html[data-theme="dark"] .blist li:hover { background: var(--hover); }
/* New appointment : « Ask the patient to confirm », et le RDV noté dans le passé */
html[data-theme="dark"] .n-passe { background: var(--tint); }
html[data-theme="dark"] .n-conf:hover { border-color: #3d4c6a; }
html[data-theme="dark"] .n-conf.on { border-color: #3e5584; }
html[data-theme="dark"] .n-conf.dis { background: var(--tint); }
html[data-theme="dark"] .n-tgl { background: var(--line-2); }
html[data-theme="dark"] .n-conf input:checked + .n-tgl { background: var(--navy); }
html[data-theme="dark"] .n-conf input:disabled + .n-tgl { background: #2a313d; }

/* ---------- Portail patient (patient/*.html) ---------- */
html[data-theme="dark"] .msgs li { background: var(--green-bg); color: var(--green); }
html[data-theme="dark"] .msgs li.error, html[data-theme="dark"] .formulaire .errorlist { background: var(--red-bg); color: var(--red); }
html[data-theme="dark"] .x-btn:hover, html[data-theme="dark"] .raccourcis button:hover, html[data-theme="dark"] .slot:not(.choisi):hover { background: var(--hover); }
html[data-theme="dark"] .cal-g .d.libre, html[data-theme="dark"] .cal-leg .libre { background: #163331; border-color: #2b5c58; }
html[data-theme="dark"] .cal-g .d.libre:hover { background: #1c403d; }
html[data-theme="dark"] .cal-g .d.libre.choisi { background: var(--teal); border-color: var(--teal); color: #fff; }
html[data-theme="dark"] .cal-g .d.complet, html[data-theme="dark"] .cal-leg .complet { background: #3a1f1d; color: #f0958b; }
html[data-theme="dark"] .cal-g .d.ferme { background: repeating-linear-gradient(135deg, #182021 0 5px, #1f2829 5px 10px); color: #5d6869; }
html[data-theme="dark"] .cal-leg .ferme { background: repeating-linear-gradient(135deg, #182021 0 3px, #222b2c 3px 6px); }
html[data-theme="dark"] .cal-g .d.hors { color: #3e4849; }
html[data-theme="dark"] .rdv { background: var(--tint); border-color: var(--line); }
html[data-theme="dark"] .tbox { background: var(--tint); }
html[data-theme="dark"] .demande { color: var(--amber); }
html[data-theme="dark"] .refus { background: #232a2c; }
/* Les tâches (ticket #202) : la case ronde sur le fond sombre */
html[data-theme="dark"] .tk-ok { border-color: #4a5a75; }
html[data-theme="dark"] .tk-barre .seg button.on { box-shadow: none; }
html[data-theme="dark"] .tk-jour.retard { background: #3a1d1d; color: #f2a39b; }
html[data-theme="dark"] .tk-d.retard { color: #f2a39b; }
