/* =========================================================================
   L'Atelier du Drainage — Design system v10
   Police : Plus Jakarta Sans (sans-serif, graisses douces 400/500/600)
   Aucune ombre sur les boutons. Cartes en ombre tres douce uniquement.
   ========================================================================= */

:root {
  /* Charte rose (conservee) */
  --rose:        #c98a9a;
  --rose-dark:   #b06c7e;
  --rose-deep:   #8e5364;
  --rose-mid:    #dda9b6;
  --rose-light:  #f7e9ec;
  --rose-pale:   #fdf6f7;
  --rose-wash:   #fbf1f3;

  /* Neutres */
  --ink:         #2b2730;
  --ink-soft:    #514a59;
  --muted:       #948c99;
  --muted-2:     #b3aab8;
  --line:        #efe6ea;
  --line-strong: #e4d8de;
  --border:      #efe6ea; /* alias historique de --line */
  --go:          #56ea70; /* bouton d'action principal du formulaire */
  --go-dark:     #3fd65a;
  --go-ink:      #0d3f1a;
  --surface:     #ffffff;
  --canvas:      #faf5f6;

  /* Etats */
  --green:     #2f9e63;
  --green-bg:  #eaf7ef;
  --green-line:#c9e9d7;
  --yellow:    #c5871a;
  --yellow-bg: #fdf5e4;
  --yellow-line:#f2e0b6;
  --red:       #d8455a;
  --red-bg:    #fdeef0;
  --red-line:  #f6ccd3;
  --blue:      #4a72b8;
  --blue-bg:   #eef3fb;

  /* Rayons */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --radius: 18px;

  /* Ombres : cartes uniquement, jamais sur les boutons */
  --shadow-xs: 0 1px 2px rgba(43, 39, 48, .04);
  --shadow-sm: 0 1px 2px rgba(43, 39, 48, .04), 0 6px 16px -10px rgba(142, 83, 100, .22);
  --shadow-md: 0 1px 2px rgba(43, 39, 48, .04), 0 14px 34px -18px rgba(142, 83, 100, .28);
  --shadow-lg: 0 2px 6px rgba(43, 39, 48, .05), 0 28px 60px -28px rgba(142, 83, 100, .34);
  --shadow: var(--shadow-sm);

  /* Gabarits */
  --bottomnav-h: 66px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;

  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--rose-dark); text-decoration: none; }
a:hover { color: var(--rose-deep); }

h1, h2, h3, h4 {
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p  { margin: 0 0 12px; }

strong, b { font-weight: 600; }

.muted     { color: var(--muted); }
.text-sm   { font-size: 13px; }
.text-xs   { font-size: 12px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

::selection { background: var(--rose-light); color: var(--rose-deep); }

/* Scrollbar discrete (desktop) */
@media (min-width: 901px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #e3d7db; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
  ::-webkit-scrollbar-thumb:hover { background: #d3c2c8; background-clip: content-box; }
}

/* Icones SVG en trait */
.icon { flex-shrink: 0; vertical-align: -0.18em; }

/* =========================================================================
   Boutons — AUCUNE ombre
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  box-shadow: none !important;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, opacity .16s ease, transform .08s ease;
}
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 2px; }

.btn-primary { background: var(--rose); color: #fff; }

/* Bouton « continuer / confirmer » du formulaire de réservation */
.btn-go { background: var(--go); color: var(--go-ink); }
.btn-go:hover { background: var(--go-dark); color: var(--go-ink); }
.btn-go[disabled], .btn-go:disabled { background: #dcefe0; color: #6f8a76; }
.btn-primary:hover { background: var(--rose-dark); color: #fff; }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1e1a23; color: #fff; }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #26834f; color: #fff; }

.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #c03950; color: #fff; }

.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--rose-pale); border-color: var(--rose-mid); color: var(--rose-deep); }

.btn-soft { background: var(--rose-light); color: var(--rose-deep); }
.btn-soft:hover { background: #f2dde2; color: var(--rose-deep); }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(43,39,48,.05); color: var(--ink); }

.btn-danger-soft { background: var(--red-bg); color: var(--red); }
.btn-danger-soft:hover { background: #fbdde2; color: var(--red); }

.btn-block { width: 100%; }
.btn-sm  { padding: 9px 14px; font-size: 13.5px; border-radius: var(--r-sm); gap: 6px; }
.btn-lg  { padding: 15px 26px; font-size: 15.5px; border-radius: var(--r-lg); }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Bouton icone */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: none !important;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--rose-pale); border-color: var(--rose-mid); color: var(--rose-deep); }
.icon-btn:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 2px; }
.icon-btn.primary { background: var(--rose); border-color: var(--rose); color: #fff; }
.icon-btn.primary:hover { background: var(--rose-dark); border-color: var(--rose-dark); color: #fff; }
.icon-btn.danger:hover { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 9px; }

/* =========================================================================
   Formulaires
   ========================================================================= */
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--rose-mid); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(201, 138, 154, .15);
}
input:disabled, select:disabled, textarea:disabled { background: var(--rose-pale); color: var(--muted); cursor: not-allowed; }
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23948c99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}
input[type="file"] { padding: 9px 12px; font-size: 13.5px; }
input[type="file"]::file-selector-button {
  border: none; background: var(--rose-light); color: var(--rose-deep);
  padding: 8px 14px; border-radius: 9px; font-family: inherit; font-weight: 600;
  font-size: 13px; margin-right: 12px; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--rose); }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink-soft);
  letter-spacing: 0;
}
.form-row { margin-bottom: 16px; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Checkbox en ligne, style carte */
.check-inline {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--rose-pale); cursor: pointer;
}
.check-inline input { flex-shrink: 0; }

/* =========================================================================
   Alertes / tags / badges
   ========================================================================= */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.alert .icon { margin-top: 2px; }
.alert-error   { background: var(--red-bg);   color: #a52c40; border-color: var(--red-line); }
.alert-success { background: var(--green-bg); color: #1f7346; border-color: var(--green-line); }
.alert-info    { background: var(--rose-light); color: var(--rose-deep); border-color: #efd8de; }
.alert-warn    { background: var(--yellow-bg); color: #96650f; border-color: var(--yellow-line); }
.alert a { color: inherit; text-decoration: underline; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.5;
}
.tag-pending   { background: var(--yellow-bg); color: #96650f; }
.tag-accepted  { background: var(--green-bg);  color: #1f7346; }
.tag-cancelled { background: var(--red-bg);    color: #a52c40; }
.tag-neutral   { background: var(--rose-light); color: var(--rose-deep); }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }

/* =========================================================================
   Cartes
   ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600; margin: 0 0 4px;
}
.card-title .icon { color: var(--rose-dark); }
.card-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.card-divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }

.empty-state {
  text-align: center;
  padding: 46px 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-state .empty-icon {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--rose-light); color: var(--rose-dark);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.empty-state h3 { margin: 0 0 4px; font-size: 15.5px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13.5px; }

/* Grilles */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px)  { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .grid-4 { grid-template-columns: 1fr; } }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
@media (max-width: 700px) { .info-grid { grid-template-columns: 1fr; } }
.info-box { background: rgba(255,255,255,.66); border: 1px solid rgba(255,255,255,.9); border-radius: var(--r-md); padding: 11px 14px; }
.info-box .label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; text-transform: uppercase; color: var(--muted);
  font-weight: 600; letter-spacing: .05em; margin-bottom: 3px;
}
.info-box .value { font-weight: 600; font-size: 13.5px; line-height: 1.45; }

/* =========================================================================
   Interrupteur
   ========================================================================= */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track { position: absolute; cursor: pointer; inset: 0; background: #ddd2d6; border-radius: 999px; transition: background-color .18s ease; }
.switch-track::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--rose-dark); outline-offset: 2px; }
.switch-inline {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer;
}

/* Créneaux dans la fenêtre de rendez-vous */
.slot-grid-compact { grid-template-columns: repeat(4, 1fr); gap: 7px; }
.slot-grid-compact .slot-btn { padding: 10px 4px; font-size: 13.5px; border-radius: var(--r-sm); }
@media (max-width: 480px) { .slot-grid-compact { grid-template-columns: repeat(3, 1fr); } }
.slot-state {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 13px; border-radius: var(--r-md);
  background: var(--yellow-bg); color: #96650f; border: 1px solid var(--yellow-line);
  font-size: 13.5px; margin-bottom: 10px;
}
.slot-state.closed { background: var(--rose-light); color: var(--rose-deep); border-color: #efd8de; }
.manual-time { margin-top: 4px; }

/* =========================================================================
   Sélecteur de client (fenêtre « Nouveau rendez-vous »)
   ========================================================================= */
.client-picker { position: relative; }

.client-picker-input { position: relative; display: flex; align-items: center; }
.client-picker-input > .icon {
  position: absolute; left: 13px; color: var(--muted-2); pointer-events: none;
}
.client-picker-input input { padding-left: 40px; padding-right: 40px; }
.client-picker-clear {
  position: absolute; right: 8px;
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(43, 39, 48, .06); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; box-shadow: none !important;
}
.client-picker-clear:hover { background: rgba(43, 39, 48, .11); color: var(--ink); }

.client-picker-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  max-height: 268px; overflow-y: auto;
  padding: 6px;
}
.client-picker-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; border: none; background: none; cursor: pointer;
  border-radius: var(--r-sm); text-align: left; font-family: inherit;
  color: var(--ink); box-shadow: none !important;
}
.client-picker-item + .client-picker-item { margin-top: 2px; }
.client-picker-item:hover { background: var(--rose-pale); }
.client-picker-text { min-width: 0; display: block; }
.client-picker-text strong {
  display: block; font-size: 14px; font-weight: 600; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-picker-text small {
  display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.avatar-xs { width: 32px; height: 32px; border-radius: 10px; font-size: 11.5px; }

.client-picker-new {
  margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.client-picker-new .client-picker-text strong { color: var(--rose-deep); }
.client-picker-plus {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: var(--rose-light); color: var(--rose-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; line-height: 1;
}
.client-picker-empty {
  padding: 16px 12px; text-align: center; color: var(--muted); font-size: 13.5px;
}

/* Indicateur de chargement (points qui tournent) */
.spinner {
  display: inline-block; width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; opacity: .85;
  animation: spin .7s linear infinite;
  vertical-align: -3px;
}
.spinner-sm { width: 13px; height: 13px; border-width: 1.8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading { pointer-events: none; opacity: .8; }
.btn.is-loading .spinner { margin-right: 8px; }

/* Bandeau discret « traitement en cours » */
.working-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 300; display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px -12px rgba(43,39,48,.5);
  animation: popIn .18s ease;
}
@media (max-width: 900px) { .working-toast { bottom: calc(var(--bottomnav-h) + 16px); } }

/* Pagination */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 22px 0 6px; flex-wrap: wrap;
}
.pager-info { font-size: 13px; color: var(--muted); font-weight: 600; }
@media (max-width: 900px) { .pager { margin-bottom: 12px; } }

/* Sélecteur de prestation */
.service-picker { position: relative; }
.service-picker-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 13px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-family: inherit; text-align: left; color: var(--ink);
  box-shadow: none !important; transition: border-color .15s ease, background-color .15s ease;
}
.service-picker-trigger:hover { border-color: var(--rose-mid); background: var(--rose-pale); }
.service-picker-trigger > .icon:last-child { margin-left: auto; color: var(--muted); flex-shrink: 0; }
.service-picker-thumb {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; overflow: hidden;
  background: var(--rose-light); color: var(--rose-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.service-picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.service-picker-text { min-width: 0; }
.service-picker-text strong {
  display: block; font-size: 14.5px; font-weight: 600; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.service-picker-text small {
  display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.service-picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  max-height: 300px; overflow-y: auto; padding: 6px;
}
.service-picker-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border: none; background: none; cursor: pointer;
  border-radius: var(--r-sm); text-align: left; font-family: inherit;
  color: var(--ink); box-shadow: none !important;
}
.service-picker-item + .service-picker-item { margin-top: 2px; }
.service-picker-item:hover { background: var(--rose-pale); }
.service-picker-item.selected { background: var(--rose-light); }

/* Choix de la formule (séance, forfait en cours, vente de forfait) */
.formula-options { display: flex; flex-direction: column; gap: 8px; }
.formula-option {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 13px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-family: inherit; text-align: left; color: var(--ink);
  box-shadow: none !important; transition: border-color .15s ease, background-color .15s ease;
}
.formula-option:hover { border-color: var(--rose-mid); background: var(--rose-pale); }
.formula-option.selected { border-color: var(--rose); background: var(--rose-pale); }
.formula-check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--line-strong); color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
}
.formula-option.selected .formula-check {
  background: var(--rose); border-color: var(--rose); color: #fff;
}
.formula-text { min-width: 0; }
.formula-text strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.formula-text small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* Bloc « nouveau client » */
.new-client-block {
  background: var(--rose-pale);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.new-client-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--rose-deep);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 14px;
}
.new-client-block input { background: var(--surface); }

/* =========================================================================
   Tableaux
   ========================================================================= */
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.data-table th, table.data-table td {
  padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px;
}
table.data-table th {
  background: var(--rose-pale); color: var(--rose-deep);
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr { transition: background-color .12s ease; }
table.data-table tbody tr:hover { background: var(--rose-pale); }

/* =========================================================================
   Modales / feuilles
   ========================================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(43, 39, 48, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; z-index: 200;
  animation: fadeIn .16s ease;
}
.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 26px;
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s cubic-bezier(.2,.8,.3,1);
}
.modal-box h2 { font-size: 18px; margin-bottom: 6px; padding-right: 34px; }
.modal-box > .muted:first-of-type { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(43,39,48,.05); cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: none !important;
}
.modal-close:hover { background: rgba(43,39,48,.09); color: var(--ink); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes expand { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================================
   Installation / authentification
   ========================================================================= */
.install-body, .auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background:
    radial-gradient(1000px 460px at 12% -8%, #fbe9ee 0%, rgba(251,233,238,0) 62%),
    radial-gradient(760px 420px at 96% 104%, #f7e6ea 0%, rgba(247,230,234,0) 60%),
    var(--canvas);
}
.install-wrap { width: 100%; max-width: 470px; }
.install-card, .auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 32px 30px;
  width: 100%;
  max-width: 470px;
}
.install-form h2 { font-size: 13px; color: var(--rose-dark); margin: 26px 0 14px; text-transform: uppercase; letter-spacing: .07em; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 24px; }
.auth-brand .brand-mark { margin-bottom: 12px; }
.auth-brand h1 { font-size: 20px; margin: 0 0 4px; }
.auth-brand p { color: var(--muted); font-size: 13.5px; margin: 0; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12.5px; margin: 24px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-footer-link { text-align: center; margin-top: 22px; font-size: 13.5px; }

/* Marque */
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(140deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-mark-sm { width: 34px; height: 34px; border-radius: 11px; }

/* =========================================================================
   Coque admin
   ========================================================================= */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 264px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 18px; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-text strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.sidebar-brand-text small { color: var(--muted); font-size: 11.5px; }

.sidebar-section {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted-2); font-weight: 600; padding: 16px 12px 7px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--ink-soft); font-weight: 500; font-size: 14.5px;
  transition: background-color .14s ease, color .14s ease;
}
.sidebar nav a .icon { color: var(--muted); transition: color .14s ease; }
.sidebar nav a span.label { flex: 1; min-width: 0; }
.sidebar nav a:hover { background: var(--rose-pale); color: var(--rose-deep); }
.sidebar nav a:hover .icon { color: var(--rose-dark); }
.sidebar nav a.active { background: var(--rose); color: #fff; font-weight: 600; }
.sidebar nav a.active .icon { color: #fff; }
.sidebar nav a .badge {
  background: rgba(43,39,48,.07); color: var(--ink-soft);
  border-radius: 999px; font-size: 11px; font-weight: 600; padding: 2px 8px; min-width: 24px; text-align: center;
}
.sidebar nav a.active .badge { background: rgba(255,255,255,.24); color: #fff; }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px 12px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  background: var(--rose-light); color: var(--rose-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0;
}
.avatar-lg { width: 46px; height: 46px; border-radius: 15px; font-size: 15px; }
.sidebar-user-info { min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13.5px; font-weight: 600; text-transform: capitalize; }
.sidebar-user-info small { color: var(--muted); font-size: 11.5px; }

.main {
  flex: 1; min-width: 0;
  padding: 26px 30px 40px;
  max-width: 1280px;
}

/* Barre superieure mobile */
.mobile-topbar {
  display: none;
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 11px 16px;
  align-items: center; justify-content: space-between; gap: 10px;
}
.mobile-topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.mobile-topbar-actions { display: flex; align-items: center; gap: 8px; }

/* En-tete de page */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head h1 {
  font-size: 23px; margin: 0;
  display: flex; align-items: center; gap: 11px;
}
.page-head h1 .icon { color: var(--rose-dark); }
.page-head-sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Barre de navigation basse (mobile admin + client) */
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
}
.bottom-nav a, .bottom-nav button {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--muted); background: none; border: none; cursor: pointer;
  padding: 6px 2px; border-radius: var(--r-md);
  box-shadow: none !important;
  transition: color .14s ease, background-color .14s ease;
  text-align: center;
}
.bottom-nav a span, .bottom-nav button span { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav a.active, .bottom-nav button.active { color: var(--rose-deep); background: var(--rose-light); }
.bottom-nav a:active, .bottom-nav button:active { transform: scale(.96); }

/* Feuille "Plus" */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(43,39,48,.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-end;
  animation: fadeIn .16s ease;
}
.sheet {
  width: 100%; background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 12px 18px calc(24px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
  animation: slideUp .22s cubic-bezier(.2,.8,.3,1);
}
.sheet-handle { width: 42px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 4px auto 16px; }
.sheet h3 { font-size: 15px; margin: 0 0 14px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px; border-radius: var(--r-lg);
  background: var(--rose-pale); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 11.5px; font-weight: 600; text-align: center;
  line-height: 1.3;
}
.sheet-item:hover, .sheet-item:active { background: var(--rose-light); color: var(--rose-deep); }
.sheet-item .sheet-icon {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--surface); color: var(--rose-dark);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.sheet-item.accent { background: var(--rose); border-color: var(--rose); color: #fff; }
.sheet-item.accent .sheet-icon { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
.sheet-item.danger { color: var(--red); }
.sheet-item.danger .sheet-icon { color: var(--red); }

/* =========================================================================
   Filtres / segments
   ========================================================================= */
.toolbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-bar .pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--rose-pale); border: 1px solid var(--line);
  font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-soft);
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.filter-bar .pill:hover { background: var(--rose-light); color: var(--rose-deep); border-color: var(--rose-mid); }
.filter-bar .pill.active { background: var(--rose); color: #fff; border-color: var(--rose); }
.filter-bar .pill .count {
  font-size: 11px; background: rgba(43,39,48,.07); border-radius: 999px; padding: 1px 7px; font-weight: 600;
}
.filter-bar .pill.active .count { background: rgba(255,255,255,.25); color: #fff; }
.filter-bar select, .filter-bar input { width: auto; }
.search-field { position: relative; flex: 1; min-width: 190px; max-width: 340px; }
.search-field .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.search-field input { padding-left: 40px; width: 100%; }
.search-input { max-width: 340px; }

.segmented {
  display: inline-flex; padding: 4px; gap: 3px;
  background: var(--rose-pale); border: 1px solid var(--line); border-radius: 999px;
}
.segmented a {
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.segmented a.active { background: var(--surface); color: var(--rose-deep); box-shadow: var(--shadow-xs); }

/* =========================================================================
   Calendrier admin (structure inchangee, habillage revu)
   ========================================================================= */
.calendar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.calendar-header {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: #fff;
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.calendar-header h2 {
  margin: 0; font-size: 18px; font-weight: 600; color: #fff;
  display: flex; align-items: center; gap: 10px; text-transform: capitalize;
}
.calendar-nav { display: flex; gap: 8px; }
.calendar-nav button {
  background: rgba(255,255,255,.18); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 11px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: none !important; transition: background-color .15s ease;
}
.calendar-nav button:hover { background: rgba(255,255,255,.3); }

.weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--rose-pale); }
.weekday-row div {
  padding: 11px 6px; text-align: center; font-weight: 600;
  color: var(--rose-deep); font-size: 11.5px; letter-spacing: .05em; min-width: 0;
}

.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.day-cell {
  min-height: 92px; min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  cursor: pointer; position: relative; overflow: hidden;
  transition: background-color .14s ease;
}
.day-cell:nth-child(7n) { border-right: none; }
.day-cell:hover { background: var(--rose-pale); }
.day-cell.other-month { background: #fcfafb; }
.day-cell.other-month .day-num { color: #d6cbd0; }
.day-cell.selected { background: var(--rose-pale); box-shadow: inset 0 0 0 2px var(--rose); }
/* Jours indisponibles : aucun aplat de couleur, seul le chiffre s'efface.
   Evite le gros bloc gris de la colonne dimanche. */
.day-cell.day-closed { background: transparent; }
.day-cell.day-closed .day-num { color: #cfc4c9; }
.day-cell.day-blocked { background: transparent; }
.day-cell.day-blocked .day-num { color: #c3b7bd; }
.day-cell.day-blocked::after {
  content: ""; position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  width: 16px; height: 2px; border-radius: 2px; background: #ddd0d5;
}
/* Colonne dimanche : légère séparation plutôt qu'un aplat */
.day-cell:nth-child(7n) { background-image: linear-gradient(to right, rgba(201,138,154,.05), rgba(201,138,154,.05)); }
.block-badge {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 4px;
  background: #efe6ea; color: #7d7280; border-radius: 8px;
  padding: 2px 7px; font-size: 10.5px; font-weight: 600;
}
.day-num { font-weight: 600; font-size: 14px; color: var(--ink); }
.day-num.today {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 13px;
}
/* Priorite renforcee : le jour du jour reste lisible meme sur un jour ferme,
   bloque ou hors du mois affiche (regles plus specifiques ajoutees ensuite). */
.calendar-card .day-cell .day-num.today,
.calendar-card .day-cell.day-closed .day-num.today,
.calendar-card .day-cell.day-blocked .day-num.today,
.calendar-card .day-cell.other-month .day-num.today {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}
.rdv-badge {
  margin-top: 7px; display: inline-flex; align-items: center; gap: 5px;
  clear: both;
  background: var(--rose-light); color: var(--rose-deep);
  border: 1px solid #efd8de; border-radius: 9px;
  padding: 3px 8px; font-size: 11.5px; font-weight: 600;
}
.rdv-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rose-dark); flex-shrink: 0; }
.rdv-badge .rdv-count { margin-left: 2px; }

.day-detail {
  border-top: 2px solid var(--rose);
  background: var(--rose-pale);
  padding: 20px 22px;
  animation: expand .18s ease;
}
.day-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.day-detail-head h3 { margin: 0; font-size: 16px; text-transform: capitalize; }
.day-detail-actions { display: flex; gap: 8px; }

/* Carte rendez-vous */
.rdv-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: var(--shadow-xs);
}
.rdv-item:last-child { margin-bottom: 0; }
.rdv-item.status-pending   { border-left-color: var(--yellow); }
.rdv-item.status-accepted  { border-left-color: var(--green); }
.rdv-item.status-cancelled { border-left-color: var(--red); opacity: .78; }
.rdv-item .rdv-time {
  display: flex; align-items: center; gap: 9px; font-weight: 600;
  margin-bottom: 9px; flex-wrap: wrap; font-size: 14px; color: var(--ink);
}
.rdv-item .rdv-time .icon { color: var(--rose-dark); }
.rdv-item .rdv-client { font-size: 15.5px; font-weight: 600; margin-bottom: 2px; }
.rdv-item .rdv-service { color: var(--rose-dark); font-weight: 500; font-size: 13.5px; margin-bottom: 8px; }
.rdv-item .rdv-contact {
  font-size: 13px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px;
}
.rdv-item .rdv-contact span { display: inline-flex; align-items: center; gap: 6px; }
.rdv-item .rdv-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Faits essentiels d'une réservation : pas de titres, juste l'information */
.rdv-facts {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  margin: 14px 0 16px; padding: 14px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.rdv-fact {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-soft); min-width: 0;
}
.rdv-fact .icon { color: var(--rose-dark); flex-shrink: 0; }
.rdv-fact-strong { font-weight: 600; color: var(--ink); }
a.rdv-fact:hover { color: var(--rose-deep); }
@media (max-width: 900px) {
  .rdv-facts { flex-direction: column; gap: 10px; margin: 12px 0 14px; }
  .rdv-fact { font-size: 13.5px; }
}
.rdv-item .info-box { background: var(--rose-pale); border-color: var(--line); }

/* =========================================================================
   Services (admin)
   ========================================================================= */
.svc-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.svc-admin-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px;
  display: flex; flex-direction: column;
}
.svc-admin-top { display: flex; gap: 14px; align-items: flex-start; }
.svc-admin-thumb {
  width: 62px; height: 62px; border-radius: var(--r-md); overflow: hidden; flex-shrink: 0;
  background: var(--rose-light); color: var(--rose-dark);
  display: flex; align-items: center; justify-content: center;
}
.svc-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.svc-admin-info { flex: 1; min-width: 0; }
.svc-admin-info h3 { margin: 0 0 3px; font-size: 15.5px; }
.svc-admin-info p.muted { margin: 0; font-size: 13px; line-height: 1.45; }
.svc-admin-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.svc-admin-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.svc-admin-price { font-weight: 600; color: var(--rose-deep); background: var(--rose-light); padding: 3px 10px; border-radius: 8px; }
.svc-admin-actions { display: flex; gap: 6px; flex-shrink: 0; }
.svc-admin-actions form { display: inline; }
.svc-admin-pack {
  margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.svc-admin-pack-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.svc-image-picker { display: flex; align-items: center; gap: 12px; }
.svc-image-picker img { width: 62px; height: 62px; border-radius: var(--r-md); object-fit: cover; background: var(--rose-light); flex-shrink: 0; }
.svc-image-picker input[type="file"] { flex: 1; min-width: 0; }

/* Horaires */
.hours-table { display: flex; flex-direction: column; gap: 8px; }
.hours-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px; border-radius: var(--r-md);
  background: var(--rose-pale); border: 1px solid var(--line); flex-wrap: wrap;
}
.hours-day { font-weight: 600; width: 92px; flex-shrink: 0; font-size: 14px; }
.hours-time-fields { display: flex; align-items: center; gap: 8px; transition: opacity .15s ease; }
.hours-time-fields input[type="time"] { width: 118px; padding: 8px 11px; }

.pack-block { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.pack-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.code-block {
  background: #2f272b; color: #f6ecef; padding: 14px 16px; border-radius: var(--r-md);
  overflow-x: auto; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 6px 0 0; line-height: 1.6;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--rose-light); color: var(--rose-deep); padding: 1px 6px; border-radius: 6px; }
.code-block code { background: none; color: inherit; padding: 0; }

details.settings-item {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px 18px; margin-bottom: 12px; background: var(--surface);
}
details.settings-item summary {
  cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
details.settings-item summary::-webkit-details-marker { display: none; }
details.settings-item summary::after {
  content: ""; width: 9px; height: 9px; flex-shrink: 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .18s ease; margin-right: 4px;
}
details.settings-item[open] summary::after { transform: rotate(-135deg); }

/* =========================================================================
   Statistiques
   ========================================================================= */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.kpi-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rose-light); color: var(--rose-dark); flex-shrink: 0;
}
.kpi-icon.green { background: var(--green-bg); color: var(--green); }
.kpi-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.kpi-icon.blue { background: var(--blue-bg); color: var(--blue); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.kpi-value small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-trend { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.kpi-trend.up   { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.kpi-trend.flat { color: var(--muted); }
.kpi-trend .muted { font-weight: 500; }

.chart-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 22px; margin-bottom: 18px;
}
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-head h2 { font-size: 15.5px; margin: 0; display: flex; align-items: center; gap: 9px; }
.chart-head h2 .icon { color: var(--rose-dark); }
.chart-sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 16px; }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); }
.chart-legend span.key { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.rank-list { display: flex; flex-direction: column; gap: 2px; }
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-md);
  transition: background-color .14s ease;
}
.rank-row:hover { background: var(--rose-pale); }
.rank-pos {
  width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  background: var(--rose-light); color: var(--rose-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.rank-main { flex: 1; min-width: 0; }
.rank-main strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-main small { color: var(--muted); font-size: 12.5px; }
.rank-value { font-weight: 600; font-size: 14px; color: var(--rose-deep); white-space: nowrap; }
.rank-bar { height: 5px; border-radius: 999px; background: var(--rose-light); margin-top: 6px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 999px; background: var(--rose); }

/* =========================================================================
   Formulaire de reservation public
   ========================================================================= */
.booking-body { background: var(--canvas); }
.booking-shell { display: flex; min-height: 100vh; align-items: stretch; }

.booking-side {
  width: 292px; flex-shrink: 0;
  background: linear-gradient(165deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: #fff; padding: 30px 24px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.booking-side-top { display: flex; flex-direction: column; gap: 16px; }
.booking-side-brand { display: flex; align-items: center; gap: 12px; }
.booking-side-brand .brand-mark { background: rgba(255,255,255,.18); }
.booking-side-brand h2 { margin: 0; color: #fff; font-size: 16px; line-height: 1.25; font-weight: 600; }
.booking-account-btn {
  background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.32); align-self: flex-start;
}
.booking-account-btn:hover { background: rgba(255,255,255,.26); color: #fff; border-color: rgba(255,255,255,.5); }
.booking-mobile-top { display: none; }
.booking-steps { margin-top: 28px; display: flex; flex-direction: column; gap: 4px; }
.booking-step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md);
  opacity: .62; font-size: 14.5px; transition: background-color .16s ease, opacity .16s ease;
}
.booking-step.active { background: rgba(255,255,255,.16); font-weight: 600; opacity: 1; }
.booking-step.done { opacity: .92; }
.booking-step .circle {
  width: 26px; height: 26px; border-radius: 50%; border: 1.6px solid rgba(255,255,255,.55);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600;
}
.booking-step.active .circle { background: #fff; color: var(--rose-dark); border-color: #fff; }
.booking-side-footer {
  margin-top: auto; font-size: 13px; opacity: .92; line-height: 1.7;
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,.22);
}
.booking-side-footer .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; display: block; margin-bottom: 6px; }
.booking-side-footer a { color: #fff; }

.booking-main { flex: 1; min-width: 0; padding: 34px 34px 40px; max-width: 860px; }
.booking-main > section > h1 { font-size: 24px; margin-bottom: 6px; }
.booking-intro { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.booking-search { max-width: 460px; margin-bottom: 20px; }
.btn-back {
  background: none; border: none; color: var(--rose-dark); font-family: inherit;
  font-weight: 600; font-size: 13.5px; padding: 0; margin-bottom: 12px; cursor: pointer;
  display: none; align-items: center; gap: 6px; box-shadow: none !important;
}
.btn-back:hover { color: var(--rose-deep); }

.svc-option {
  display: flex; gap: 16px; align-items: center;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  padding: 15px 17px; margin-bottom: 12px; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.svc-option:hover { border-color: var(--rose-mid); box-shadow: var(--shadow-sm); }
.svc-option:active { transform: scale(.995); }
.svc-option.selected { border-color: var(--rose); background: var(--rose-pale); }
.svc-thumb {
  width: 62px; height: 62px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--rose-light); color: var(--rose-dark);
  display: flex; align-items: center; justify-content: center;
}
.svc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.svc-info { flex: 1; min-width: 0; }
.svc-info strong { font-size: 15.5px; font-weight: 600; display: block; }
.svc-price {
  color: var(--rose-deep); font-weight: 600; background: var(--rose-light);
  padding: 7px 13px; border-radius: var(--r-sm); white-space: nowrap; font-size: 14.5px;
}
.svc-meta { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; margin: 5px 0; flex-wrap: wrap; }
.svc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.svc-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.svc-pack-tag {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--rose-deep);
  background: var(--rose-light); padding: 5px 11px; border-radius: 999px;
}

/* Creneaux */
.slots-heading { text-transform: capitalize; font-size: 15px; margin: 0 0 12px; font-weight: 600; }
.slot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.slot-btn {
  padding: 13px 8px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 14px; color: var(--ink);
  box-shadow: none !important; transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.slot-btn:hover { border-color: var(--rose); background: var(--rose-pale); color: var(--rose-deep); }
.slot-btn.selected { background: var(--rose); color: #fff; border-color: var(--rose); }

.booking-datetime-layout { display: flex; flex-direction: column; gap: 18px; }
.booking-slots-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px;
}
@media (min-width: 901px) {
  .booking-datetime-layout { flex-direction: row; align-items: flex-start; }
  .booking-datetime-layout .booking-cal-card { flex: 1; min-width: 0; margin-top: 0; }
  .booking-slots-panel { flex: 0 0 330px; max-width: 330px; }
  .booking-slots-panel .slot-grid { grid-template-columns: 1fr 1fr; }
}

.booking-footer-bar {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px;
}

/* Ordinateur : la barre reste visible et fixe au bas du formulaire */
@media (min-width: 901px) {
  .booking-footer-bar {
    position: fixed; left: 292px; right: 0; bottom: 0; z-index: 70;
    margin-top: 0; padding: 14px 34px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
    justify-content: flex-end; align-items: center; gap: 12px;
  }
  .booking-footer-bar .btn { min-width: 150px; }
  .booking-footer-bar .btn-go { min-width: 210px; }
  .booking-main { padding-bottom: 104px; }
}

/* Calendrier client (public + espace client) */
.booking-cal-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.booking-cal-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; }
.booking-cal-header h3 { margin: 0; font-size: 15.5px; text-transform: capitalize; font-weight: 600; }
.booking-cal-header button {
  width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 16px; box-shadow: none !important;
}
.booking-cal-header button:hover { background: var(--rose-pale); border-color: var(--rose-mid); color: var(--rose-deep); }
.booking-weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--rose-pale); }
.booking-weekday-row div {
  padding: 9px 2px; text-align: center; font-size: 10.5px; font-weight: 600;
  color: var(--rose-deep); letter-spacing: .05em;
}
.booking-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px; gap: 2px; }
.booking-day-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.booking-day-cell .day-num {
  width: 36px; height: 36px; max-width: 100%; max-height: 100%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 500; font-size: 14px; color: var(--ink);
  transition: background-color .14s ease, color .14s ease;
}
.booking-day-cell:hover:not(.disabled):not(.other-month) .day-num { background: var(--rose-light); color: var(--rose-deep); }
.booking-day-cell.selected .day-num { background: var(--rose); color: #fff; font-weight: 600; }
.booking-day-cell .day-num.today { box-shadow: inset 0 0 0 1.6px var(--rose); }
.booking-day-cell.other-month { cursor: default; }
.booking-day-cell.other-month .day-num { color: #ded4d8; }
.booking-day-cell.disabled { cursor: not-allowed; }
.booking-day-cell.disabled .day-num { color: #ded4d8; }
.booking-day-cell.unavailable { cursor: not-allowed; }
.booking-day-cell.unavailable .day-num {
  color: #c4b9bd; background: #f3edef; text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.booking-day-cell.unavailable:hover .day-num { background: #f3edef; color: #c4b9bd; }
.booking-cal-legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px 14px; font-size: 12px; color: var(--muted);
}
.booking-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.booking-cal-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* Popup choix pack */
.pack-choice-intro { font-size: 15.5px; font-weight: 600; margin: 4px 0 20px; padding-right: 28px; line-height: 1.45; }
.pack-choice-card {
  border: 1.5px solid var(--line-strong); border-radius: var(--r-lg); padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; margin-bottom: 18px; transition: border-color .14s ease, background-color .14s ease;
}
.pack-choice-card:hover { border-color: var(--rose); background: var(--rose-pale); }
.pack-choice-name { font-weight: 600; font-size: 15.5px; }
.pack-choice-price { font-weight: 600; background: var(--rose-light); color: var(--rose-deep); padding: 8px 14px; border-radius: var(--r-sm); white-space: nowrap; }
.pack-choice-divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12.5px; margin: 18px 0; }
.pack-choice-divider::before, .pack-choice-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pack-choice-single {
  width: 100%; background: var(--rose); color: #fff; border: none; border-radius: var(--r-lg);
  padding: 16px 18px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 600; font-size: 14.5px; box-shadow: none !important;
}
.pack-choice-single:hover { background: var(--rose-dark); }
.pack-choice-single-price { background: rgba(255,255,255,.2); padding: 6px 12px; border-radius: var(--r-sm); }

/* Bouton flottant info */
.info-fab {
  position: fixed; right: 18px; bottom: 18px; left: auto; z-index: 90;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md); border-radius: 999px;
  padding: 10px 16px; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 13px; color: var(--ink);
}
.info-fab:hover { background: var(--rose-pale); border-color: var(--rose-mid); }
.info-fab-icon { font-size: 15px; }
.info-modal-icon { font-size: 32px; margin-bottom: 8px; }

/* Recapitulatif etape 3 */
.booking-summary {
  background: var(--rose-pale); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 20px;
}
.booking-summary h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--rose-deep); margin: 0 0 12px; }
.booking-summary-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; font-size: 14px; border-bottom: 1px dashed var(--line-strong);
}
.booking-summary-row:last-child { border-bottom: none; }
.booking-summary-row .lbl { color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.booking-summary-row .val { font-weight: 600; text-align: right; }

/* =========================================================================
   Espace client
   ========================================================================= */
.client-body { background: var(--canvas); }
.client-shell { display: flex; flex-direction: column; min-height: 100vh; }

.client-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.client-topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }

.client-main { flex: 1; padding: 20px 18px calc(var(--bottomnav-h) + 26px); }
.client-main.has-action-bar { padding-bottom: calc(var(--bottomnav-h) + 88px); }
.client-main > h1 { font-size: 22px; margin-bottom: 4px; }

/* Bandeau d'accueil facon application mobile */
.client-hero {
  background: linear-gradient(140deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: #fff; border-radius: var(--r-xl); padding: 22px 22px 24px; margin-bottom: 22px;
  position: relative; overflow: hidden;
}
.client-hero::after {
  content: ""; position: absolute; right: -46px; top: -56px;
  width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.09);
}
.client-hero::before {
  content: ""; position: absolute; right: 34px; bottom: -74px;
  width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.07);
}
.client-hero-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.client-hero .avatar { background: rgba(255,255,255,.2); color: #fff; }
.client-hero h1 { color: #fff; font-size: 20px; margin: 0; text-transform: capitalize; }
.client-hero p { margin: 3px 0 0; font-size: 13.5px; opacity: .9; }
.client-hero-stats { display: flex; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }
.client-hero-stat {
  flex: 1; background: rgba(255,255,255,.15); border-radius: var(--r-md); padding: 11px 13px;
}
.client-hero-stat .n { font-size: 20px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.client-hero-stat .l { font-size: 11px; opacity: .88; margin-top: 3px; }

.client-section-title {
  font-size: 14px; margin: 26px 0 12px; color: var(--ink);
  display: flex; align-items: center; gap: 9px; font-weight: 600;
}
.client-section-title .icon { color: var(--rose-dark); }
.client-section-title a { margin-left: auto; font-size: 12.5px; font-weight: 600; }

.client-pack-card, .client-appt-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}
.client-appt-card .appt-date {
  width: 52px; flex-shrink: 0; text-align: center;
  background: var(--rose-light); color: var(--rose-deep);
  border-radius: var(--r-md); padding: 8px 4px;
}
.client-appt-card .appt-date .d { font-size: 18px; font-weight: 600; line-height: 1.05; }
.client-appt-card .appt-date .m { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.client-appt-body { flex: 1; min-width: 0; }
.client-appt-body strong { font-size: 14.5px; display: block; }
.pack-progress { width: 100%; height: 6px; background: var(--rose-light); border-radius: 999px; margin-top: 9px; overflow: hidden; }
.pack-progress-fill { height: 100%; background: linear-gradient(90deg, var(--rose) 0%, var(--rose-dark) 100%); border-radius: 999px; }

.client-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.client-quick {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-xs);
  color: var(--ink); font-weight: 600; font-size: 14px;
}
.client-quick .q-icon {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--rose-light); color: var(--rose-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.client-quick small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.client-quick:hover { border-color: var(--rose-mid); color: var(--rose-deep); }
.client-quick.accent { background: var(--rose); border-color: var(--rose); color: #fff; }
.client-quick.accent .q-icon { background: rgba(255,255,255,.2); color: #fff; }
.client-quick.accent small { color: rgba(255,255,255,.86); }

/* Coordonnées de l'institut (espace client) */
.venue-card { padding: 18px 20px; }
.venue-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5;
}
.venue-row + .venue-row { border-top: 1px solid var(--line); }
.venue-icon {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: var(--rose-light); color: var(--rose-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.venue-row a { font-weight: 500; }

/* Barre d'action fixe (client mobile) */
.client-action-bar {
  position: fixed; left: 0; right: 0; bottom: var(--bottomnav-h); z-index: 70;
  padding: 10px 16px calc(10px);
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  display: flex; gap: 10px;
}
.client-action-bar .btn { flex: 1; }

.client-bottom-nav { display: flex; }
.client-sidebar { display: none; }

/* Desktop espace client */
@media (min-width: 901px) {
  .client-body { background: var(--canvas); }
  .client-shell { flex-direction: row; align-items: stretch; }
  .client-topbar, .client-bottom-nav { display: none !important; }
  /* Barre d'action fixe au bas de l'écran, à droite de la barre latérale */
  .client-action-bar {
    position: fixed; left: 262px; right: 0; bottom: 0; z-index: 70;
    margin-top: 0; padding: 14px 40px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
    justify-content: flex-end; gap: 12px;
  }
  /* La barre latérale peut être réduite : la barre suit */
  body:has(#clientSidebar.collapsed) .client-action-bar { left: 82px; }
  .client-action-bar .btn { flex: 0 0 auto; min-width: 190px; }
  .client-main.has-action-bar { padding-bottom: 104px; }

  .client-sidebar {
    display: flex; flex-direction: column; width: 262px; flex-shrink: 0;
    background: linear-gradient(165deg, var(--rose) 0%, var(--rose-dark) 100%);
    color: #fff; padding: 24px 18px; min-height: 100vh; position: sticky; top: 0;
    transition: width .18s ease, padding .18s ease;
  }
  .client-sidebar.collapsed { width: 82px; padding: 24px 12px; }
  .client-sidebar.collapsed .client-sidebar-user span,
  .client-sidebar.collapsed .client-sidebar-nav a span,
  .client-sidebar.collapsed .client-sidebar-collapse span,
  .client-sidebar.collapsed .client-sidebar-logout span { display: none; }
  .client-sidebar.collapsed .client-sidebar-nav a,
  .client-sidebar.collapsed .client-sidebar-collapse,
  .client-sidebar.collapsed .client-sidebar-logout { justify-content: center; }

  .client-sidebar-user {
    display: flex; align-items: center; gap: 11px; font-weight: 600;
    padding-bottom: 18px; margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,.24); text-transform: capitalize; font-size: 14.5px;
  }
  .client-sidebar-user .avatar { background: rgba(255,255,255,.2); color: #fff; }
  .client-sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
  .client-sidebar-nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px;
    border-radius: var(--r-md); color: #fff; opacity: .84; font-weight: 500; font-size: 14.5px;
    transition: background-color .15s ease, opacity .15s ease;
  }
  .client-sidebar-nav a:hover { background: rgba(255,255,255,.14); opacity: 1; color: #fff; }
  .client-sidebar-nav a.active { background: #fff; color: var(--rose-deep); opacity: 1; font-weight: 600; }
  .client-sidebar-footer {
    margin-top: auto; display: flex; flex-direction: column; gap: 3px;
    padding-top: 14px; border-top: 1px solid rgba(255,255,255,.24);
  }
  .client-sidebar-collapse, .client-sidebar-logout {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-md);
    color: #fff; opacity: .84; font-size: 13.5px; font-weight: 500;
    background: none; border: none; cursor: pointer; text-align: left; font-family: inherit;
    box-shadow: none !important;
  }
  .client-sidebar-collapse:hover, .client-sidebar-logout:hover { background: rgba(255,255,255,.14); opacity: 1; color: #fff; }

  .client-main { flex: 1; padding: 34px 40px 56px; max-width: 1040px; }
  .client-main > h1 { font-size: 24px; }
  .client-hero { padding: 26px 28px 28px; }
  .client-hero h1 { font-size: 22px; }
  .client-pack-card, .client-appt-card { padding: 18px 22px; }
  .client-quick-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =========================================================================
   Responsive global (< 900px) — tout passe en mode application mobile
   ========================================================================= */
@media (max-width: 900px) {
  body { font-size: 15px; }

  .app-shell { flex-direction: column; }
  .sidebar { display: none; }
  .mobile-topbar { display: flex; }
  .main { padding: 16px 16px calc(var(--bottomnav-h) + 26px); max-width: none; }
  .main.has-action-bar { padding-bottom: calc(var(--bottomnav-h) + 84px); }

  .admin-bottom-nav { display: flex; }

  h1 { font-size: 20px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 20px; }

  /* Actions principales : barre fixe au-dessus de la navigation */
  .page-head-actions {
    position: fixed; left: 0; right: 0; bottom: var(--bottomnav-h); z-index: 70;
    padding: 10px 16px; gap: 10px;
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
  }
  .page-head-actions .btn { flex: 1; }

  .card { padding: 18px; border-radius: var(--r-lg); }
  .toolbar { padding: 12px; }
  .filter-bar { gap: 8px; }
  .filter-bar .pill { padding: 8px 13px; font-size: 13px; }
  .search-field, .search-input { max-width: none; width: 100%; }
  .filter-bar select { width: 100%; }

  /* Calendrier admin : jours fermes ou bloques simplement grises, sans libelle */
  .block-badge { display: none; }
  .day-cell:nth-child(7n) { background-image: none; }

  .calendar-card { border-radius: var(--r-lg); }
  .calendar-header { padding: 15px 16px; }
  .calendar-header h2 { font-size: 16px; }
  .day-cell { min-height: 62px; padding: 6px 4px; }
  .day-num { font-size: 13px; }
  .day-num.today { width: 25px; height: 25px; font-size: 12px; }
  /* Pastille de rendez-vous : sous le chiffre du jour, centrée, avec le nombre.
     Le fond rosé la distingue clairement du numéro de date. */
  .day-cell { display: flex; flex-direction: column; align-items: center; padding: 7px 2px; }
  .rdv-badge {
    margin-top: 5px; padding: 2px 7px; gap: 4px;
    font-size: 10.5px; line-height: 1.5; justify-content: center;
  }
  .rdv-badge .badge-label { display: none; }
  .rdv-badge .rdv-count { display: inline; margin-left: 0; font-weight: 600; }
  .rdv-badge .dot { width: 5px; height: 5px; }
  .rdv-badge .dot ~ .dot { display: none; }   /* un seul point : place limitée */
  .day-cell.day-blocked::after { bottom: 6px; width: 12px; }
  .weekday-row div { padding: 8px 2px; font-size: 10.5px; }
  .day-detail { padding: 16px 14px; }
  .day-detail-head { flex-wrap: wrap; }
  .rdv-item { padding: 14px 15px; }
  .rdv-item .rdv-actions { justify-content: stretch; }
  .rdv-item .rdv-actions .btn { flex: 1; min-width: 92px; }

  /* Tableaux -> cartes */
  .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr { display: block; }
  .data-table { border: none; background: none; box-shadow: none; border-radius: 0; overflow: visible; }
  .data-table thead { display: none; }
  .data-table tr {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
    margin-bottom: 12px; padding: 15px 16px;
  }
  .data-table tr:hover { background: var(--surface); }
  .data-table td { border: none; padding: 6px 0; }
  .data-table td:before {
    content: attr(data-label); display: block; font-size: 10.5px; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px;
  }
  .data-table td:empty { display: none; }

  /* Services admin */
  .svc-admin-grid { grid-template-columns: 1fr; gap: 14px; }
  .svc-admin-card { padding: 16px; }

  /* Statistiques */
  .kpi-card { padding: 15px; border-radius: var(--r-lg); }
  .kpi-value { font-size: 22px; }
  .kpi-icon { width: 34px; height: 34px; border-radius: 11px; }
  .chart-card { padding: 16px; border-radius: var(--r-lg); }

  /* Formulaire de reservation */
  .booking-mobile-top {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 16px; position: sticky; top: 0; z-index: 60;
    background: linear-gradient(135deg, var(--rose) 0%, var(--rose-dark) 100%); color: #fff;
  }
  .booking-mobile-top .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
  .booking-mobile-top .brand-mark { background: rgba(255,255,255,.2); }
  .booking-mobile-top .btn-outline { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.34); }
  .booking-shell { flex-direction: column; min-height: auto; }
  .booking-side { display: none; }
  .booking-main { padding: 18px 16px 104px; max-width: none; }
  .booking-main > section > h1 { font-size: 20px; }
  .btn-back { display: inline-flex; }

  .booking-steps-mobile {
    display: flex; gap: 6px; margin-bottom: 18px;
  }
  .booking-steps-mobile .sm-step {
    flex: 1; height: 4px; border-radius: 999px; background: var(--line-strong);
  }
  .booking-steps-mobile .sm-step.active { background: var(--rose); }

  .svc-option { padding: 13px 14px; gap: 13px; border-radius: var(--r-lg); }
  .svc-thumb { width: 54px; height: 54px; }
  .svc-meta { gap: 10px; font-size: 12px; }
  .svc-price { padding: 6px 11px; font-size: 13.5px; }
  .slot-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  .booking-footer-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: rgba(255,255,255,.95);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    margin-top: 0;
  }
  .booking-footer-bar .btn { flex: 1; }
  /* Mobile : pastille ronde compacte, au-dessus de la barre d'action */
  .info-fab {
    right: 14px; left: auto; bottom: 84px;
    width: 46px; height: 46px; padding: 0;
    border-radius: 50%; justify-content: center;
  }
  .info-fab .info-fab-text { display: none; }
  .info-fab .info-fab-icon { font-size: 20px; }

  /* Modales en feuille glissante */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    max-width: 100%; width: 100%;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 88vh; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    animation: slideUp .22s cubic-bezier(.2,.8,.3,1);
  }

  .install-card, .auth-card { padding: 26px 22px; border-radius: var(--r-xl); }
  .grid-2, .grid-3 { gap: 14px; }
  .info-grid { gap: 10px; }
}

@media (max-width: 420px) {
  .booking-day-cell .day-num { width: 32px; height: 32px; font-size: 13px; }
  .sheet-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sheet-item { padding: 13px 5px; font-size: 10.5px; }
  .client-quick-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 20px; }
}

/* Impression */
@media print {
  .sidebar, .mobile-topbar, .bottom-nav, .page-head-actions, .booking-footer-bar,
  .client-action-bar, .info-fab, .modal-overlay, .sheet-overlay { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  .card, .chart-card, .kpi-card { box-shadow: none; border: 1px solid #ddd; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
