/* Espace de gestion – L'Éveil des Sens */
:root {
  --fond: #f4f3ec; --panneau: #fff; --ligne: #e2dfd0; --texte: #34322b; --doux: #77725f;
  --vert: #3f8f45; --vert-fonce: #2f6e35; --or: #8a6a3b; --rouge: #b5482c; --bleu: #3d86b8; --ambre: #c98a1e;
  --side: #2f3b2c;
}
* { box-sizing: border-box; }
body { margin: 0; font: 500 15px/1.5 "Quicksand", "Segoe UI", system-ui, sans-serif; background: var(--fond); color: var(--texte); }
a { color: var(--vert-fonce); }
h1 { font: 400 1.7rem "Marcellus", serif; color: var(--or); margin: 0 0 1rem; }
h2 { font: 400 1.25rem "Marcellus", serif; color: var(--or); margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }

.cadre { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.lateral { background: var(--side); color: #dcdcc8; padding: 1.2rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.lateral .logo { display: flex; align-items: center; gap: .6rem; padding: 0 .5rem 1.2rem; color: #e9d7ae; text-decoration: none; font: 400 1.1rem "Marcellus", serif; }
.lateral .logo img { width: 42px; background: #f5f3e7; border-radius: 10px; padding: 2px; }
.lateral .groupe { font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; opacity: .55; margin: 1.2rem .6rem .4rem; }
.lateral a.lien { display: flex; justify-content: space-between; align-items: center; color: #e7e6d6; text-decoration: none; padding: .5rem .7rem; border-radius: 8px; font-weight: 600; }
.lateral a.lien:hover { background: rgba(255,255,255,.07); }
.lateral a.lien.actif { background: rgba(233,215,174,.16); color: #fff; }
.pastille { background: var(--ambre); color: #fff; font-size: .72rem; border-radius: 999px; padding: .05rem .5rem; }
.principal { padding: 1.6rem 2rem 4rem; min-width: 0; }
.barre-haut { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.barre-haut .moi { color: var(--doux); font-size: .9rem; }
.menu-mobile { display: none; }

@media (max-width: 900px) {
  .cadre { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .25s; }
  .lateral.ouvert { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .principal { padding: 1rem 16px 4rem; }
  .menu-mobile { display: inline-block; }
}

.carte { background: var(--panneau); border: 1px solid var(--ligne); border-radius: 12px; padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; }
.grille { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grille-2 { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .grille-2 { grid-template-columns: minmax(0, 1fr); } }
.carte, .principal { min-width: 0; }
.kpi { background: var(--panneau); border: 1px solid var(--ligne); border-radius: 12px; padding: 1rem 1.2rem; }
.kpi .lib { font-size: .78rem; color: var(--doux); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.kpi .val { font: 400 1.7rem "Marcellus", serif; margin-top: .2rem; white-space: nowrap; }
.kpi .val.pos { color: var(--vert-fonce); } .kpi .val.neg { color: var(--rouge); }

.btn { display: inline-flex; align-items: center; gap: .4em; padding: .55em 1.1em; border-radius: 8px; border: 1.5px solid var(--vert); background: var(--vert); color: #fff; font: 700 .9rem inherit; font-family: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.btn.ligne { background: #fff; color: var(--vert-fonce); }
.btn.ligne:hover { background: #eef5e6; }
.btn.rouge { background: #fff; color: var(--rouge); border-color: #e3b9ab; }
.btn.rouge:hover { background: #fbeee9; }
.btn.wa { background: #25d366; border-color: #25d366; }
.btn.petit { padding: .3em .7em; font-size: .82rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

table.tab { width: 100%; border-collapse: collapse; background: var(--panneau); }
.tab th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); padding: .6rem .7rem; border-bottom: 2px solid var(--ligne); white-space: nowrap; }
.tab td { padding: .6rem .7rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.tab tr:hover td { background: #fbfaf4; }
.tab .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.defile { overflow-x: auto; border: 1px solid var(--ligne); border-radius: 12px; }
.defile table.tab { border: 0; }

.statut { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15em .65em; border-radius: 999px; white-space: nowrap; }
.statut.en_attente { background: #fbefd5; color: #8a5a00; }
.statut.confirme { background: #e0efdc; color: #2c6a30; }
.statut.termine { background: #e1ecf5; color: #2d5f86; }
.statut.annule { background: #f2e1db; color: #9a3b22; }
.statut.absent { background: #eee; color: #555; }
.paye { color: var(--vert-fonce); font-weight: 700; font-size: .8rem; }
.impaye { color: var(--rouge); font-weight: 700; font-size: .8rem; }

form.f { display: grid; gap: .9rem; }
.f .ligne { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
input[type=file] { max-width: 100%; }
label { font-weight: 700; font-size: .85rem; display: block; margin-bottom: .25rem; }
label .opt { font-weight: 500; color: var(--doux); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: .55em .7em; border: 1.5px solid var(--ligne); border-radius: 8px; font: inherit; background: #fff; color: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--vert); }
input[type=color] { width: 60px; height: 36px; border: 1px solid var(--ligne); border-radius: 8px; padding: 2px; }
textarea { min-height: 90px; resize: vertical; }
.case { display: flex; gap: .5rem; align-items: center; font-weight: 600; font-size: .9rem; }
.case input { accent-color: var(--vert); width: 17px; height: 17px; }
.cases { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.aide { color: var(--doux); font-size: .82rem; margin-top: .2rem; }
.filtres { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filtres > * { flex: 0 1 auto; }
.filtres input[type=search] { min-width: 220px; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .6rem; font-weight: 600; }
.flash.ok { background: #e0efdc; color: #2c6a30; }
.flash.erreur { background: #f6e0d8; color: #8a3a22; }
.flash.info { background: #e1ecf5; color: #2d5f86; }

/* agenda */
.agenda-nav { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.agenda-nav .jour-btn { padding: .4em .7em; border-radius: 8px; border: 1.5px solid var(--ligne); background: #fff; text-decoration: none; color: var(--texte); font-weight: 600; font-size: .85rem; }
.agenda-nav .jour-btn.actif { border-color: var(--vert); background: #eef5e6; }
.agenda { display: grid; border: 1px solid var(--ligne); border-radius: 12px; background: #fff; overflow-x: auto; position: relative; }
.agenda .col-entete { position: sticky; top: 0; background: #faf9f3; border-bottom: 1px solid var(--ligne); padding: .5rem; font-weight: 700; font-size: .85rem; text-align: center; z-index: 2; min-width: 150px; }
.agenda .col-entete span { display: block; width: 100%; height: 3px; border-radius: 3px; margin-top: .3rem; }
.agenda .heures-col { border-right: 1px solid var(--ligne); }
.agenda .h { height: 60px; font-size: .75rem; color: var(--doux); padding: 2px 6px; border-top: 1px solid #f0eee4; }
.agenda .colonne { position: relative; border-right: 1px solid #f0eee4; min-width: 150px; }
.agenda .colonne .fond { height: 60px; border-top: 1px solid #f0eee4; display: block; }
.agenda .colonne .fond:hover { background: #f6faf1; }
.agenda .rdv { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 4px 7px; font-size: .78rem; line-height: 1.25; text-decoration: none; color: #2c2a22; overflow: hidden; border-left: 4px solid; box-shadow: 0 2px 6px -3px rgba(0,0,0,.3); }
.agenda .rdv strong { display: block; }
.agenda .rdv.en_attente { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,.55) 6px 12px); }
.agenda .rdv.termine { opacity: .7; }
.legende { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--doux); margin-top: .6rem; }

.vide { color: var(--doux); font-style: italic; padding: .6rem 0; }
.mini-liste { list-style: none; padding: 0; margin: 0; }
.mini-liste li { padding: .55rem 0; border-bottom: 1px solid var(--ligne); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.mini-liste li:last-child { border-bottom: 0; }
.connexion { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #e4e8d3, #f5f3e7); padding: 16px; }
.connexion .carte { width: min(380px, 100%); padding: 2rem; }
.barres { display: grid; gap: .35rem; }
.barre { display: grid; grid-template-columns: 150px 1fr 110px; gap: .6rem; align-items: center; font-size: .85rem; }
.barre .piste { height: 10px; background: #f0eee4; border-radius: 6px; overflow: hidden; }
.barre .rempli { height: 100%; border-radius: 6px; background: var(--vert); }
.barre .rempli.dep { background: #c9805f; }
@media (max-width: 600px) { .barre { grid-template-columns: 100px 1fr 90px; } }
details.pli summary { cursor: pointer; font-weight: 700; color: var(--vert-fonce); }
.photo-mini { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: #e4e8d3; display: inline-grid; place-items: center; font: 400 1.4rem "Marcellus", serif; color: var(--or); }
.btn.menu-mobile { display: none; }
@media (max-width: 900px) { .btn.menu-mobile { display: inline-flex; } }

/* ----- adaptation aux appareils (espace de gestion) */
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (min-width: 1900px) { html { font-size: 112.5%; } .principal { max-width: 110rem; } }
@media (min-width: 2400px) { html { font-size: 125%; } }
@media (pointer: coarse) {
  .btn, .btn.petit { min-height: 44px; }
  .lateral a.lien { padding: .75rem .8rem; }
  .agenda-nav .jour-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .case input, input[type=checkbox] { width: 22px; height: 22px; }
  .principal a:not(.btn):not(.rdv):not(.fond):not(.jour-btn) { display: inline-block; padding: .6rem 0; }
  input[type=file] { padding: .7rem 0; }
  label.case { min-height: 44px; }
}
@media (max-width: 900px) {
  input, select, textarea { font-size: 16px; }   /* évite le zoom automatique sur iPhone */
  .lateral { padding-bottom: calc(1.2rem + env(safe-area-inset-bottom)); }
  .tab-dispos, .tab-dispos tbody, .tab-dispos tr, .tab-dispos td { display: block; width: 100%; }
  .tab-dispos tr { padding: .5rem 0; border-bottom: 1px solid var(--ligne); }
  .tab-dispos td { border: 0; padding: .2rem 0; }
}
.tab-dispos td { white-space: normal !important; }
.tab-dispos input[type=time] { width: 6.6rem !important; padding: .45em .4em; }

/* modifier une réservation : bouton bien visible */
details.modifier-rdv { margin: .2rem 0 1rem; }
details.modifier-rdv summary { display: inline-block; padding: .55rem 1rem; border: 1.5px solid var(--vert-fonce); border-radius: 999px; list-style: none; min-height: 44px; line-height: 1.6; }
details.modifier-rdv summary::-webkit-details-marker { display: none; }
details.modifier-rdv[open] summary { background: var(--vert-fonce); color: #fff; }

/* statistiques */
.filtres-stats { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.filtres-stats .perso { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.filtres-stats input[type=date] { width: auto; min-height: 40px; }
.kpis-stats { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.evol { display: inline-block; margin-left: .3rem; font-weight: 700; font-size: .8rem; }
.evol.hausse { color: var(--vert-fonce); } .evol.baisse { color: var(--rouge); }
.piste-h { display: block; height: 10px; background: #f0eee4; border-radius: 6px; overflow: hidden; }
.piste-h > span { display: block; height: 100%; background: var(--vert-fonce); border-radius: 0 4px 4px 0; }
.tab tr.total td { border-top: 2px solid var(--ligne); font-weight: 700; }
.colonnes-mois { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .4rem; align-items: end; height: 220px; padding-top: 1.4rem; }
.colonnes-mois .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; text-decoration: none; color: inherit; gap: .25rem; }
.colonnes-mois .baton { width: 70%; max-width: 38px; min-height: 2px; background: var(--vert-fonce); border-radius: 4px 4px 0 0; transition: opacity .2s; }
.colonnes-mois .col:hover .baton { opacity: .75; }
.colonnes-mois .val { font-size: .72rem; color: var(--doux); white-space: nowrap; }
.colonnes-mois .mois { font-size: .72rem; color: var(--doux); }
@media (max-width: 600px) { .colonnes-mois .val { display: none; } .colonnes-mois { height: 160px; gap: .2rem; } }
