/* Back-office des rendez-vous : neutre, pleine largeur, lisible au téléphone ; sombre si le système l'est. */

:root {
  --fond: #f5f6f7;
  --carte: #fff;
  --texte: #1d2327;
  --gris: #5c656b;
  --bord: #dfe3e6;
  --accent: #075664;
  --texte-accent: #fff;
  --ok: #e6f4ea;
  --erreur: #b3261e;
  --erreur-fond: #fce8e6;
  --facilitic: #075664;
  --trois: #8a6d00;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #15191c;
    --carte: #1f2529;
    --texte: #e7eaec;
    --gris: #a3adb3;
    --bord: #343c42;
    --accent: #6cc3d1;
    --texte-accent: #0b1215;
    --ok: #1c3324;
    --erreur: #ff9b92;
    --erreur-fond: #3b1f1d;
    --facilitic: #6cc3d1;
    --trois: #f2c94c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.entete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 12px 16px; background: var(--carte); border-bottom: 1px solid var(--bord); }
.marque { margin: 0; font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.nav form { margin: 0; }
.nav a[aria-current], .sous-nav a[aria-current] { font-weight: 700; text-decoration: none; }
.sous-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 16px; border-bottom: 1px solid var(--bord); }
.page { width: 95%; margin: 0 auto; padding: 16px 0 48px; }
h1 { font-size: 1.4rem; margin: 8px 0 16px; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
h4 { font-size: .95rem; margin: 12px 0 4px; }

.avis { padding: 10px 14px; border-radius: 8px; }
.avis.ok { background: var(--ok); }
.avis.erreur { background: var(--erreur-fond); color: var(--erreur); }
.discret { color: var(--gris); }
.avertir { color: var(--erreur); }

.cartes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 12px 14px; }
.carte.alerte { border-color: var(--erreur); }
.carte p { margin: 4px 0 0; }
.carte .titre { font-weight: 700; }
.pastille, .statut { display: inline-block; font-size: .8rem; padding: 1px 8px; border-radius: 99px; border: 1px solid currentColor; }
.pastille.facilitic { color: var(--facilitic); }
.pastille.trois { color: var(--trois); }
.statut { color: var(--gris); }
.statut.annule, .statut.absent { color: var(--erreur); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actions form { margin: 0; }
button, .bouton {
  display: inline-block; min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--texte-accent); cursor: pointer; text-decoration: none; font-weight: 600;
}
button.secondaire { background: transparent; color: var(--accent); }
button.danger { background: var(--erreur); border-color: var(--erreur); color: var(--carte); }
button.lien { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; font-weight: 400; }

.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 14px; margin: 0; }
.fiche dt { color: var(--gris); }
.fiche dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .fiche { grid-template-columns: 1fr; }
  .fiche dd { margin-bottom: 6px; }
}

.pile { display: grid; gap: 10px; max-width: 560px; }
.pile label, .filtres label { display: grid; gap: 4px; }
.case { display: flex !important; gap: 8px; align-items: flex-start; }
.case input { margin-top: 5px; }
input:not([type="checkbox"]), select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 8px; background: var(--carte); width: 100%; }
.filtres { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); align-items: end; margin-bottom: 16px; }

.defile { overflow-x: auto; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; }
.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tableau th, .tableau td { padding: 6px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--bord); }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau th { color: var(--gris); font-weight: 600; white-space: nowrap; }
.tableau .nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau td a { overflow-wrap: anywhere; }
.hausse { color: var(--facilitic); }
.baisse { color: var(--erreur); }

.liste-simple { margin: 0; padding-left: 20px; }
.histo { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 640px; }
.histo li { display: grid; grid-template-columns: 3.5em 1fr 2em; gap: 8px; align-items: center; }
.histo progress { width: 100%; height: 12px; accent-color: var(--accent); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* Stages (lot 2) : zones de texte et groupes de cases */
textarea { font: inherit; color: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 8px; background: var(--carte); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
legend { padding: 0; margin-bottom: 4px; }

/* Stage, lot 4 : préparation du sondage de dates. */
.jours { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 0; border-bottom: 1px solid #e5e7eb; }
.jours .case { display: inline-flex !important; }
.jour.pris { font-size: .9rem; padding-top: 3px; }
tr.suggere td { background: #f0f9f4; }

/* Barre du panel (mail.sylvainpellier.fr) en pied de page fixe, commune au mail et à la Zone admin. */
:root { --pied-h: 44px; }
.pied-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--pied-h); flex-wrap: nowrap; gap: 12px; padding: 0 12px; border-bottom: 0; border-top: 1px solid var(--bord); overflow-x: auto; scrollbar-width: none; font-size: .875rem; }
.pied-panel .marque { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); }
.pied-panel .nav { flex-wrap: nowrap; gap: 2px; white-space: nowrap; }
.pied-panel .nav a { padding: 5px 11px; border-radius: 999px; color: var(--texte); text-decoration: none; }
.pied-panel .nav a:hover { background: var(--fond); }
.pied-panel .nav a[aria-current] { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 600; }
body:has(> .pied-panel) { padding-bottom: var(--pied-h); }
