/* ================= Agenda ================= */
.agenda-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.date-forte { margin: 0; display: flex; align-items: flex-end; gap: 12px; line-height: 0.9; }
.date-forte .chiffre { font-size: 56px; font-weight: 800; letter-spacing: -0.045em; color: var(--encre); }
.vue-jour .date-forte .chiffre, .vue-semaine .date-forte .chiffre { font-variant-numeric: lining-nums tabular-nums; }
.date-forte .chiffre.aujourdhui { color: var(--sapin); }
.date-forte .chiffre { white-space: nowrap; }
.vue-semaine .date-forte .chiffre { font-size: 44px; }
.agenda-tete .sync { white-space: nowrap; padding-top: 6px; }
@media (max-width: 420px) { .agenda-tete .sync { font-size: 0; gap: 0; } .agenda-tete .sync i { width: 10px; height: 10px; } }
.date-forte .mots { display: flex; flex-direction: column; padding-bottom: 5px; font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--encre-2); }
.date-forte .mots span:first-child { color: var(--encre); font-weight: 700; }
.vue-mois .date-forte .chiffre, .vue-liste .date-forte .chiffre { font-size: 40px; }
@media (min-width: 768px) { .date-forte .chiffre { font-size: 72px; } .vue-mois .date-forte .chiffre, .vue-liste .date-forte .chiffre { font-size: 52px; } }

@media (max-width: 767px) {
  .agenda > .toolbar .segment { flex: 1 1 100%; }
  .agenda > .toolbar .segment button { flex: 1; }
  .agenda > .toolbar .spacer { display: none; }
  .agenda > .toolbar > .btn:not(.icone) { flex: 1; }
}

/* Grille horaire */
.grille-horaire { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.grille-corps { display: grid; grid-template-columns: 44px 1fr; position: relative; }
.heures { position: relative; border-right: 1px solid var(--trait); }
.semaine .heures { margin-top: 52px; }
.heures span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11.5px; font-weight: 600; color: var(--encre-3); }
.heures span:first-child { transform: none; }
.colonnes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-width: 0; }
.semaine .colonnes { overflow-x: auto; scroll-snap-type: x mandatory; grid-auto-columns: minmax(calc((100vw - 32px - 46px) / 3), 1fr); overscroll-behavior-x: contain; }
@media (min-width: 768px) { .semaine .colonnes { grid-auto-columns: 1fr; overflow: visible; } }
.jour-col { scroll-snap-align: start; border-left: 1px solid var(--trait); min-width: 0; }
.jour-col:first-child { border-left: 0; }
.jour-tete {
  position: sticky; top: 0; z-index: 2; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--encre-2); font-size: 12px; font-weight: 600; background: var(--surface); border-bottom: 1px solid var(--trait);
}
.jour-tete strong { font-size: 19px; color: var(--encre); line-height: 1.1; }
.jour-tete.aujourdhui strong { color: var(--on-sapin); background: var(--sapin); border-radius: 999px; min-width: 30px; padding: 0 6px; }
.colonne {
  position: relative; cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--trait) 0 1px, transparent 1px calc(60 * var(--minute)));
}
.colonne.aujourdhui { background-color: color-mix(in srgb, var(--sapin-pale) 35%, transparent); }
.maintenant { position: absolute; left: 0; right: 0; height: 2px; background: var(--ambre); z-index: 3; pointer-events: none; }
.maintenant::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ambre); }

.bloc {
  position: absolute; z-index: 1; overflow: hidden; text-align: left; display: flex; flex-direction: column; gap: 0;
  padding: 4px 7px; border: 0; border-left: 4px solid var(--couleur); border-radius: 6px;
  background: color-mix(in srgb, var(--couleur) 16%, var(--surface)); color: var(--encre);
  font-size: 12.5px; line-height: 1.3; min-height: 22px;
}
.bloc:hover { background: color-mix(in srgb, var(--couleur) 24%, var(--surface)); }
.bloc strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloc span { color: var(--encre-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloc.annulee { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); border-left-style: dashed; }
.bloc.annulee strong { text-decoration: line-through; color: var(--encre-2); }
.bloc.heure-inconnue { border-left-style: dotted; }

/* Mois */
.mois { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.mois-entetes, .mois-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mois-entetes span { padding: 8px 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--encre-3); border-bottom: 1px solid var(--trait); }
.mois-case {
  min-height: 64px; padding: 6px 4px; border: 0; border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait);
  background: transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: left;
}
.mois-case:nth-child(7n) { border-right: 0; }
.mois-case:hover { background: var(--surface-2); }
.mois-case.autre .num { color: var(--encre-3); opacity: 0.6; }
.mois-case .num { font-weight: 700; font-size: 14px; min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; }
.mois-case.aujourdhui .num { background: var(--sapin); color: var(--on-sapin); }
.points { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; align-items: center; }
.points .pastille { width: 7px; height: 7px; }
.points small { font-size: 10.5px; color: var(--encre-3); font-weight: 700; }
.libelles { display: none; }
@media (min-width: 900px) {
  .mois-case { min-height: 108px; align-items: stretch; padding: 6px; }
  .mois-case .num { align-self: flex-end; }
  .points { display: none; }
  .libelles { display: grid; gap: 2px; }
  .libelles span {
    font-size: 12px; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: color-mix(in srgb, var(--couleur) 15%, var(--surface)); border-left: 3px solid var(--couleur);
  }
}

/* Liste */
.liste { display: grid; gap: 18px; }
.liste-section { margin: 10px 0 0; font-size: 18px; color: var(--encre-2); }
.liste-jour h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--encre-2); }
.liste-jour h3::first-letter { text-transform: uppercase; }
.liste-jour h3.aujourdhui { color: var(--sapin); }
.liste-items { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.ligne-seance {
  width: 100%; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--trait); background: transparent; text-align: left;
}
.ligne-seance:last-child { border-bottom: 0; }
.ligne-seance:hover { background: var(--surface-2); }
.ligne-seance .heure { font-weight: 700; min-width: 46px; color: var(--encre); }
.ligne-seance .qui { display: flex; flex-direction: column; min-width: 0; }
.ligne-seance .qui strong, .ligne-seance .qui small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-seance .qui small { color: var(--encre-3); font-size: 13px; }
.ligne-seance .prix { font-weight: 600; color: var(--encre-2); }
input.recherche { max-width: 420px; }

/* ================= Formulaire de séance ================= */
.choix-client { display: grid; gap: 8px; }
.resultats { display: grid; border: 1px solid var(--trait); border-radius: var(--rayon-s); overflow: hidden; }
.resultat {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px;
  border: 0; border-bottom: 1px solid var(--trait); background: var(--surface); text-align: left; font-weight: 600;
}
.resultat:last-child { border-bottom: 0; }
.resultat:hover, .resultat:focus-visible { background: var(--surface-2); }
.resultat small { color: var(--encre-3); font-weight: 500; }
.resultat.nouveau { justify-content: flex-start; color: var(--sapin); }
.client-choisi { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 4px 4px 4px 14px; border-radius: var(--rayon-s); background: var(--sapin-pale); }
.client-choisi strong { font-size: 17px; }
.choix-types { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.type-choix {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 60px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--trait-fort); border-left: 5px solid var(--couleur); border-radius: var(--rayon-s); background: var(--surface);
}
.type-choix small { color: var(--encre-3); font-weight: 500; }
.type-choix[aria-checked='true'] { border-color: var(--couleur); background: color-mix(in srgb, var(--couleur) 13%, var(--surface)); box-shadow: inset 0 0 0 1px var(--couleur); }
.segment.statuts { display: flex; flex-wrap: wrap; }
.segment.statuts button { flex: 1 1 auto; }

/* ================= Clients ================= */
.liste-clients { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.ligne-client {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px;
  border-bottom: 1px solid var(--trait); text-decoration: none; color: inherit;
}
.ligne-client:last-child { border-bottom: 0; }
.ligne-client:hover { background: var(--surface-2); }
.ligne-client strong { display: block; font-size: 16.5px; }
.ligne-client small { color: var(--encre-3); font-size: 13.5px; }
.ligne-client .compte { text-align: right; font-size: 13.5px; color: var(--encre-2); }
.fiche { display: grid; gap: 16px; }
@media (min-width: 1000px) { .fiche { grid-template-columns: 320px 1fr; align-items: start; } }
.coordonnees { display: grid; gap: 10px; }
.coordonnees dl { margin: 0; display: grid; gap: 10px; }
.coordonnees dt { font-size: 12.5px; font-weight: 700; color: var(--encre-3); }
.coordonnees dd { margin: 0; overflow-wrap: anywhere; }
.coordonnees a { color: var(--sapin); }
.mois-client { display: grid; gap: 6px; }
.mois-client header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mois-client h3 { margin: 0; font-size: 15px; }
.mois-client h3::first-letter { text-transform: uppercase; }

/* ================= Récap ================= */
.chiffres { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 900px) { .chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.chiffre-carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; }
.chiffre-carte .valeur { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.chiffre-carte .libelle { font-size: 13.5px; font-weight: 600; color: var(--encre-2); }
.chiffre-carte .detail { display: block; font-size: 12.5px; color: var(--encre-3); margin-top: 2px; }
.chiffre-carte.principal { background: var(--sapin); border-color: var(--sapin); color: var(--on-sapin); grid-column: span 2; }
.chiffre-carte.principal .libelle, .chiffre-carte.principal .detail { color: color-mix(in srgb, var(--on-sapin) 80%, transparent); }
.chiffre-carte.principal .valeur { font-size: 34px; }
.repartition { margin-bottom: 18px; }
.repartition .barre { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.repartition .barre span { display: block; height: 100%; background: var(--couleur); }
.repartition ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--encre-2); }
.repartition li { display: flex; align-items: center; gap: 6px; }
.tableau-wrap { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow-x: auto; }
table.recap { width: 100%; border-collapse: collapse; font-size: 14px; }
table.recap th, table.recap td { padding: 10px 10px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: middle; }
table.recap th { font-size: 12.5px; color: var(--encre-3); font-weight: 700; white-space: nowrap; background: var(--surface-2); }
table.recap td.num, table.recap th.num { text-align: right; white-space: nowrap; }
table.recap tfoot td { font-weight: 800; border-bottom: 0; }
table.recap input:not([type='checkbox']) { width: 100%; min-width: 96px; min-height: 38px; padding: 6px 8px; border: 1px solid var(--trait); border-radius: 6px; background: var(--surface); font-size: 14px; }
table.recap input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--sapin); }
table.recap .dates { color: var(--encre-2); font-size: 13px; }
.cartes-recap { display: grid; gap: 12px; }
.carte-recap { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; display: grid; gap: 10px; }
.carte-recap header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.carte-recap header strong { font-size: 17px; }
.carte-recap .montants { text-align: right; font-weight: 800; font-size: 17px; }
.carte-recap .montants small { display: block; font-weight: 500; font-size: 12.5px; color: var(--encre-3); }
.carte-recap .dates { color: var(--encre-2); font-size: 13.5px; }
.carte-recap .champs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vue-large { display: none; }
@media (min-width: 1000px) { .vue-large { display: block; } .vue-etroite { display: none; } }
table.annee td.mois-nom::first-letter { text-transform: uppercase; }
.annee .barre-mini { display: inline-block; height: 8px; border-radius: 4px; background: var(--sapin); vertical-align: middle; }

/* ================= Réglages ================= */
.reglages { display: grid; gap: 16px; max-width: 760px; }
.reglages h2 { margin: 0 0 4px; font-size: 18px; }
.reglages p { margin: 0; color: var(--encre-2); }
.reglages .carte { display: grid; gap: 12px; }
.adresse-flux { font-size: 13px; word-break: break-all; padding: 10px 12px; border-radius: var(--rayon-s); background: var(--surface-2); border: 1px dashed var(--trait-fort); }
.etapes { margin: 0; padding-left: 20px; color: var(--encre-2); display: grid; gap: 4px; }
.ligne-type { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.ligne-type:last-child { border-bottom: 0; }
.ligne-type .pastille { width: 14px; height: 14px; }
.ligne-type small { display: block; color: var(--encre-3); }
.ligne-type.inactif { opacity: 0.55; }
.nuancier { display: flex; flex-wrap: wrap; gap: 10px; }
.nuancier button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; background: var(--c); }
.nuancier button[aria-pressed='true'] { border-color: var(--encre); box-shadow: inset 0 0 0 2px var(--surface); }
.radios { display: grid; gap: 4px; }
.periode { display: flex; gap: 8px; }
@media (max-width: 767px) {
  .toolbar > .periode { flex: 1 1 auto; }
  .toolbar > .periode .btn:not(.icone) { flex: 1; }
  .toolbar > .spacer { display: none; }
  .toolbar > select.btn { flex: 1 1 auto; }
}
@media (min-width: 900px) {
  .chiffres { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); }
  .chiffre-carte.principal { grid-column: auto; }
}
table.recap td:first-child a { white-space: nowrap; }
