/* JaaPresta Booking — feuille de style unique (aucun style en ligne : CSP stricte) */
:root {
  --marque: #6d28d9;
  --marque-fonce: color-mix(in srgb, var(--marque) 80%, black);
  --marque-clair: color-mix(in srgb, var(--marque) 12%, white);
  --texte: #1f2937;
  --texte-doux: #6b7280;
  --fond: #f6f7fb;
  --carte: #ffffff;
  --bord: #e5e7eb;
  --ok: #047857; --ok-fond: #d1fae5;
  --attente: #b45309; --attente-fond: #fef3c7;
  --alerte: #b91c1c; --alerte-fond: #fee2e2;
  --info: #1d4ed8; --info-fond: #dbeafe;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(17,24,39,.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); line-height: 1.5; font-size: 16px; }
a { color: var(--marque); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.doux { color: var(--texte-doux); }
.petit { font-size: .875rem; }
.centre { text-align: center; }
.cache { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pot-de-miel { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Mise en page */
.conteneur { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.etroit { max-width: 560px; }
.moyen { max-width: 760px; }
.pile > * + * { margin-top: 1rem; }
.ligne { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.ligne.espace { justify-content: space-between; }
.grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grille-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .grille-2 { grid-template-columns: 1fr 1fr; } .grille-2-1 { grid-template-columns: 2fr 1fr; } }

/* Cartes */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.25rem; box-shadow: var(--ombre); }
.carte + .carte { margin-top: 1rem; }
.carte h2:first-child, .carte h3:first-child { margin-top: 0; }
.stat { font-size: 1.9rem; font-weight: 700; }
.stat-libelle { color: var(--texte-doux); font-size: .9rem; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid transparent;
  background: var(--marque); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 44px; }
.btn:hover { background: var(--marque-fonce); }
.btn:focus-visible, .champ:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--marque) 40%, white); outline-offset: 2px; }
.btn-secondaire { background: #fff; color: var(--texte); border-color: var(--bord); }
.btn-secondaire:hover { background: #f3f4f6; }
.btn-danger { background: var(--alerte); }
.btn-danger:hover { background: #991b1b; }
.btn-lien { background: none; border: none; color: var(--marque); padding: 0; min-height: 0; font-weight: 600; cursor: pointer; font: inherit; text-decoration: underline; }
.btn-petit { padding: .35rem .7rem; min-height: 34px; font-size: .9rem; }
.btn-large { width: 100%; }
form.inline { display: inline; }

/* Formulaires */
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.champ { width: 100%; padding: .65rem .8rem; border: 1px solid #d1d5db; border-radius: 10px; font: inherit; background: #fff; color: inherit; min-height: 44px; }
textarea.champ { min-height: 90px; }
input[type=color].champ { padding: .2rem; width: 80px; }
.champ-court { max-width: 140px; }
.groupe { margin-bottom: 1rem; }
.groupe .aide { color: var(--texte-doux); font-size: .85rem; margin-top: .25rem; }
.groupe .erreur, .erreurs-form { color: var(--alerte); font-size: .9rem; margin-top: .25rem; }
.erreurs-form { background: var(--alerte-fond); padding: .7rem 1rem; border-radius: 10px; }
.groupe-case { display: flex; gap: .6rem; align-items: flex-start; }
.groupe-case label { font-weight: 500; margin: 0; }
.case { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--marque); flex-shrink: 0; }
.choix-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.choix-liste label, ul.choix-liste label, div.choix-liste label { font-weight: 500; display: flex; gap: .5rem; align-items: center; }
.choix-liste input { accent-color: var(--marque); width: 18px; height: 18px; }
.formset-ligne { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: .5rem; align-items: end; margin-bottom: .5rem; }
@media (max-width: 600px) { .formset-ligne { grid-template-columns: 1fr 1fr; } }

/* Alertes / messages */
.messages { list-style: none; padding: 0; margin: 1rem 0; }
.message { padding: .8rem 1rem; border-radius: 10px; margin-bottom: .5rem; border: 1px solid transparent; }
.message.success { background: var(--ok-fond); color: var(--ok); }
.message.error { background: var(--alerte-fond); color: var(--alerte); }
.message.warning { background: var(--attente-fond); color: var(--attente); }
.message.info { background: var(--info-fond); color: var(--info); }
.bandeau { padding: .8rem 1rem; border-radius: 10px; background: var(--attente-fond); color: var(--attente); margin-bottom: 1rem; }
.bandeau.info { background: var(--info-fond); color: var(--info); }

/* Badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef2ff; color: #3730a3; white-space: nowrap; }
.badge.ok { background: var(--ok-fond); color: var(--ok); }
.badge.attente { background: var(--attente-fond); color: var(--attente); }
.badge.alerte, .badge.rupture { background: var(--alerte-fond); color: var(--alerte); }
.badge.annule { background: #f3f4f6; color: #6b7280; }
.badge.bas, .badge.peremption { background: var(--attente-fond); color: var(--attente); }

/* Tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texte-doux); background: #fafafa; }
.table tr:hover td { background: #fafafa; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* En-tête site public */
.entete { background: #fff; border-bottom: 1px solid var(--bord); }
.entete .conteneur { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.logo-site { font-weight: 800; font-size: 1.15rem; color: var(--texte); text-decoration: none; }
.logo-site span { color: var(--marque); }
.pied { padding: 2rem 0; color: var(--texte-doux); font-size: .9rem; }
.pied a { color: var(--texte-doux); }
.hero { padding: 3.5rem 0 2.5rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }

/* Tableau de bord */
.tdb { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 960px) { .tdb { grid-template-columns: 250px 1fr; } }
.barre { background: #111827; color: #e5e7eb; padding: 1rem; }
.barre a { color: #d1d5db; text-decoration: none; display: flex; gap: .6rem; align-items: center; padding: .55rem .7rem; border-radius: 8px; }
.barre a:hover { background: #1f2937; color: #fff; }
.barre a.actif { background: var(--marque); color: #fff; }
.barre .titre-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; margin: 1rem .7rem .3rem; }
.barre .marque { font-weight: 800; color: #fff; font-size: 1.05rem; margin-bottom: .25rem; }
.barre .entreprise-nom { color: #9ca3af; font-size: .85rem; margin-bottom: .75rem; word-break: break-word; }
.barre nav { display: none; }
.barre.ouverte nav { display: block; }
@media (min-width: 960px) { .barre nav { display: block; } .bouton-menu { display: none; } }
.bouton-menu { background: none; border: 1px solid #374151; color: #fff; border-radius: 8px; padding: .4rem .7rem; font: inherit; cursor: pointer; }
.principal { padding: 1.25rem 16px 3rem; min-width: 0; }
@media (min-width: 960px) { .principal { padding: 2rem; } }
.titre-page { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.titre-page h1 { margin: 0; }
.onglets { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--bord); margin-bottom: 1.25rem; }
.onglets a { padding: .6rem .9rem; text-decoration: none; color: var(--texte-doux); border-bottom: 2px solid transparent; font-weight: 600; }
.onglets a.actif { color: var(--marque); border-color: var(--marque); }
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filtres .champ { width: auto; min-width: 150px; }

/* Agenda */
.agenda { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .agenda.semaine { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.agenda-jour { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: .6rem; min-height: 120px; }
.agenda-jour.aujourdhui { border-color: var(--marque); box-shadow: 0 0 0 2px var(--marque-clair); }
.agenda-jour h3 { font-size: .9rem; margin: 0 0 .5rem; }
.rdv { display: block; text-decoration: none; color: var(--texte); background: var(--marque-clair); border-left: 4px solid var(--marque); border-radius: 6px; padding: .4rem .5rem; margin-bottom: .4rem; font-size: .85rem; }
.rdv.attente { background: var(--attente-fond); border-color: var(--attente); }
.rdv.alerte { background: var(--alerte-fond); border-color: var(--alerte); }
.rdv strong { display: block; }

/* Vitrine */
.couverture { height: 220px; background: var(--marque-clair) center / cover no-repeat; }
@media (min-width: 760px) { .couverture { height: 300px; } }
.couverture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vitrine-entete { display: flex; gap: 1rem; align-items: center; margin-top: -48px; position: relative; }
.vitrine-logo { width: 96px; height: 96px; border-radius: 20px; border: 4px solid #fff; background: #fff; object-fit: cover; box-shadow: var(--ombre); }
.vitrine-logo.vide { display: grid; place-items: center; font-size: 2.2rem; background: var(--marque); color: #fff; }
.prestation { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--bord); align-items: center; }
.prestation:last-child { border-bottom: 0; }
.prestation .prix { font-weight: 700; white-space: nowrap; }
.membre-equipe { display: flex; gap: .7rem; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--marque-clair); display: grid; place-items: center; font-weight: 700; color: var(--marque); flex-shrink: 0; }
.jours { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
.jour { flex: 0 0 auto; scroll-snap-align: start; min-width: 72px; text-align: center; padding: .55rem .4rem; border-radius: 12px; border: 1px solid var(--bord); background: #fff; text-decoration: none; color: var(--texte); cursor: pointer; font: inherit; }
.jour .num { font-size: 1.3rem; font-weight: 700; display: block; }
.jour .nom { font-size: .75rem; text-transform: uppercase; color: var(--texte-doux); }
.jour.actif { background: var(--marque); color: #fff; border-color: var(--marque); }
.jour.actif .nom { color: #fff; }
.creneaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.creneau { padding: .65rem .3rem; text-align: center; border: 1px solid var(--marque); color: var(--marque); border-radius: 10px; text-decoration: none; font-weight: 600; background: #fff; }
.creneau:hover { background: var(--marque); color: #fff; }
.etapes { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: .4rem; font-size: .85rem; color: var(--texte-doux); margin-bottom: 1rem; flex-wrap: wrap; }
.etapes .fait { color: var(--ok); } .etapes .courant { color: var(--marque); font-weight: 700; }
.recap { background: var(--marque-clair); border-radius: var(--rayon); padding: 1rem; }
.recap dt { font-size: .8rem; color: var(--texte-doux); } .recap dd { margin: 0 0 .5rem; font-weight: 600; }
.htmx-indicator { opacity: 0; transition: opacity .2s; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.qr { width: 180px; height: 180px; border: 1px solid var(--bord); border-radius: 10px; }
.codes { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.vide { padding: 2rem; text-align: center; color: var(--texte-doux); }
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; align-items: center; }
details summary { cursor: pointer; font-weight: 600; }
code { background: #f3f4f6; padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
@media print { .barre, .bouton-menu, .btn { display: none !important; } .tdb { display: block; } }
/* Ajustements */
.grille, .grille-2 { margin-bottom: 1rem; }
.grille > .carte, .grille-2 > .carte, .grille-2 > div > .carte:first-child { margin-top: 0; }
.grille-2 > div > .carte + .carte { margin-top: 1rem; }
.barre .btn-lien { color: #d1d5db; text-decoration: none; padding: .55rem .7rem; font-weight: 400; }
.barre .btn-lien:hover { color: #fff; }
.etapes li { white-space: nowrap; }
