/* =========================================================
   abpilates Premium · interface admin (admin.css)
   ========================================================= */

/* Déclencheur discret en pied de page */
.abp-admin-dot {
  margin: 14px auto 0;
  display: block;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: transparent;
  color: rgba(255, 255, 255, .35);
  font-size: 11px; line-height: 1;
  cursor: pointer;
  opacity: .4;
  transition: opacity .2s, border-color .2s;
}
.abp-admin-dot:hover { opacity: 1; border-color: var(--gold-light); color: var(--gold-light); }
/* Sur téléphone : cible tactile un peu plus grande (reste discrète). */
@media (hover: none) { .abp-admin-dot { width: 24px; height: 24px; font-size: 13px; opacity: .5; } }

/* Overlay + modale de connexion */
.abp-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(16, 31, 56, .6);
  backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
}
.abp-modal {
  background: #fff; border-radius: 16px; padding: 30px 28px;
  width: min(380px, 100%);
  box-shadow: 0 24px 60px rgba(16, 31, 56, .4);
  position: relative; text-align: center;
  font-family: var(--font-sans, system-ui, sans-serif);
}
.abp-modal h2 { font-size: 20px; color: var(--navy-dark); margin-bottom: 6px; }
.abp-modal__sub { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.abp-modal__x {
  position: absolute; top: 12px; right: 14px;
  border: none; background: none; font-size: 24px; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.abp-modal input[type=password] {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--frost-deep); border-radius: 10px;
  margin-bottom: 12px; box-sizing: border-box;
}
.abp-modal input[type=password]:focus { outline: none; border-color: var(--navy); }
.abp-login-err { color: #c0392b; font-size: 13px; min-height: 18px; margin-top: 10px; }

/* Boutons génériques admin */
.abp-btn {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 14px; font-weight: 500;
  padding: 10px 18px; border-radius: 100px;
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
  cursor: pointer; transition: background .2s, opacity .2s;
}
.abp-btn:hover { background: var(--navy-dark); }
.abp-btn--go { width: 100%; padding: 12px; }
.abp-btn--ghost { background: transparent; color: var(--navy); }
.abp-btn--ghost:hover { background: var(--frost-soft); }
.abp-btn--pub { background: var(--gold-deep); border-color: var(--gold-deep); }
.abp-btn--pub:hover:not(:disabled) { background: #6a5230; }
.abp-btn:disabled { opacity: .5; cursor: default; }

/* Barre d'outils admin (bas d'écran) */
.abp-toolbar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 9998;
  display: flex; align-items: center; gap: 10px;
  background: rgba(16, 31, 56, .96); backdrop-filter: blur(8px);
  padding: 10px 14px; border-radius: 100px;
  box-shadow: 0 12px 34px rgba(16, 31, 56, .45);
  border: 1px solid rgba(217, 188, 138, .3);
}
.abp-toolbar__tag { color: var(--gold-light); font-size: 13px; font-weight: 600; padding: 0 6px; }
.abp-toolbar .abp-btn { padding: 8px 15px; font-size: 13px; }

/* Éléments éditables */
.abp-admin-on [data-edit].abp-editable { cursor: text; border-radius: 4px; transition: box-shadow .15s, background .15s; }
.abp-admin-on [data-edit].abp-editable:hover { box-shadow: 0 0 0 2px var(--gold-light); background: rgba(217, 188, 138, .1); }
/* Écran tactile (pas de survol) : on montre en permanence les textes modifiables,
   sinon la cliente ne saurait pas où appuyer sur son téléphone. */
@media (hover: none) {
  /* transition:none — sinon l'ombre, partant de « none », reste bloquée invisible */
  .abp-admin-on [data-edit].abp-editable { transition: none; box-shadow: 0 0 0 1px rgba(184, 149, 92, .55); background: rgba(217, 188, 138, .07); }
  .abp-admin-on [data-edit].abp-editable:active { box-shadow: 0 0 0 2px var(--gold-light); background: rgba(217, 188, 138, .16); }
}
.abp-admin-on [data-edit].abp-editing { box-shadow: 0 0 0 2px var(--navy); background: rgba(42, 74, 123, .06); outline: none; border-radius: 4px; }

/* Mini barre valider/annuler */
.abp-editbar { position: absolute; z-index: 9999; display: flex; gap: 4px; }
.abp-eb { width: 28px; height: 28px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.abp-eb--ok { background: #2e8b57; }
.abp-eb--no { background: #c0392b; }

/* Panneau (formules) */
.abp-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 9999;
  width: min(500px, 100%);
  background: #fff; box-shadow: -14px 0 40px rgba(16, 31, 56, .3);
  display: flex; flex-direction: column;
  font-family: var(--font-sans, system-ui, sans-serif);
  animation: abp-slide .25s ease;
}
@keyframes abp-slide { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.abp-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--frost-deep); }
.abp-panel__head h2 { font-size: 18px; color: var(--navy-dark); }
.abp-panel__x { border: none; background: none; font-size: 26px; color: var(--muted); cursor: pointer; line-height: 1; }
.abp-panel__body { overflow-y: auto; padding: 18px 22px 40px; }

/* Éditeur de formules */
.abp-grp { border: 1px solid var(--frost-deep); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; background: var(--frost); }
.abp-grp__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.abp-grp__head strong { color: var(--navy-dark); font-size: 15px; }
.abp-cards { margin-top: 10px; }
.abp-card { border: 1px solid var(--frost-deep); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; }
.abp-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.abp-card__head strong { font-size: 14px; color: var(--navy); }
.abp-card__tools { display: flex; gap: 4px; }
.abp-card__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.abp-field { display: block; margin-top: 8px; }
.abp-field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.abp-field input, .abp-field textarea {
  width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 13.5px;
  border: 1px solid var(--frost-deep); border-radius: 8px; font-family: inherit;
}
.abp-field textarea { min-height: 52px; resize: vertical; }
.abp-field input:focus, .abp-field textarea:focus { outline: none; border-color: var(--navy); }

.abp-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink); cursor: pointer; }
.abp-mini { border: 1px solid var(--frost-deep); background: #fff; border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--navy); }
.abp-mini:hover { background: var(--frost-soft); }
.abp-mini--del { color: #c0392b; border-color: #e6b8b0; }
.abp-mini--add { display: block; width: 100%; margin-top: 6px; color: var(--gold-deep); border-color: var(--gold-light); }
.abp-add-group { display: block; width: 100%; margin-top: 8px; }

/* ---------- Panneau Agenda ---------- */
.abp-help {
  background: var(--frost);
  border: 1px solid var(--frost-deep);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.abp-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-dark);
  font-size: 14px;
  margin-bottom: 0;
}
.abp-help[open] summary { margin-bottom: 10px; }
.abp-help p { margin-bottom: 8px; }
.abp-help ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.abp-help li { padding-left: 14px; position: relative; }
.abp-help li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
}
.abp-help strong { color: var(--navy-dark); }

.abp-ag-form { display: block; }
.abp-ag-form select,
.abp-ag-form input[type=date],
.abp-ag-form input[type=time],
.abp-ag-form input[type=number] {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--frost-deep); border-radius: 8px;
  background: #fff; color: var(--ink);
}
.abp-ag-form select:focus, .abp-ag-form input:focus { outline: none; border-color: var(--navy); }
.abp-ag-form input:disabled { background: var(--frost); color: var(--muted); }
.abp-ag-form .abp-btn--go { margin-top: 14px; }

.abp-rep {
  margin-top: 10px; padding: 12px;
  border: 1px dashed var(--frost-deep); border-radius: 10px;
  background: var(--frost);
}
.abp-rep__lab { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.abp-days { display: flex; flex-wrap: wrap; gap: 6px; }
.abp-day { position: relative; cursor: pointer; }
.abp-day input { position: absolute; opacity: 0; pointer-events: none; }
.abp-day span {
  display: block; padding: 7px 12px; border-radius: 100px;
  border: 1px solid var(--frost-deep); background: #fff;
  font-size: 12.5px; color: var(--navy);
  transition: background .18s, color .18s, border-color .18s;
}
.abp-day input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }

.abp-ag-msg { font-size: 13px; min-height: 18px; margin-top: 10px; }
.abp-ag-msg.is-ok { color: #2e7d4f; }
.abp-ag-msg.is-err { color: #b5382b; }

.abp-ag-list { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--frost-deep); }
.abp-ag-list h3 { font-size: 14px; color: var(--navy-dark); margin-bottom: 10px; }
.abp-ag-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; margin-bottom: 7px;
  border: 1px solid var(--frost-deep); border-radius: 9px; background: #fff;
}
.abp-ag-item strong { display: block; font-size: 13px; color: var(--ink); font-weight: 600; }
.abp-ag-when { font-size: 11.5px; color: var(--muted); }
.abp-ag-empty { font-size: 12.5px; color: var(--muted); font-style: italic; }

/* Toast */
.abp-toast {
  position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px);
  z-index: 10001; max-width: 90vw;
  background: var(--navy-dark); color: #fff; font-size: 14px;
  padding: 12px 20px; border-radius: 100px; box-shadow: 0 12px 30px rgba(16,31,56,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  font-family: var(--font-sans, system-ui, sans-serif);
}
.abp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.abp-toast--ok { background: #2e7d4f; }
.abp-toast--err { background: #b5382b; }

@media (max-width: 560px) {
  .abp-card__grid { grid-template-columns: 1fr; }
  .abp-toolbar { flex-wrap: wrap; justify-content: center; width: calc(100% - 24px); border-radius: 16px; }
}

/* ---------------------------------------------------------
   Garde-fous de publication
   La cliente n'est pas a l'aise avec le numerique : tant que
   rien n'est publie, on l'alerte de facon impossible a rater.
   --------------------------------------------------------- */

/* Bandeau permanent en haut de page */
.abp-rappel {
  position: fixed; inset: 0 0 auto 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap;
  padding: 11px 16px;
  background: linear-gradient(90deg, #8a2f22, #b5382b);
  color: #fff; font-size: 14px; line-height: 1.35; text-align: center;
  font-family: var(--font-sans, system-ui, sans-serif);
  box-shadow: 0 6px 22px rgba(16, 31, 56, .35);
  animation: abp-rappel-in .28s ease-out;
}
.abp-rappel__txt strong { font-weight: 700; }
.abp-rappel .abp-btn {
  padding: 7px 16px; font-size: 13px; white-space: nowrap;
  background: #fff; color: #8a2f22; border-color: #fff; font-weight: 700;
}
.abp-rappel .abp-btn:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--navy-dark); }
@keyframes abp-rappel-in { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* Bouton "Publier" qui reclame de l'attention */
.abp-btn--urgent {
  background: #2e7d4f !important; border-color: #2e7d4f !important;
  animation: abp-pulse 1.9s ease-in-out infinite;
}
.abp-btn--urgent:hover:not(:disabled) { background: #24663f !important; }
@keyframes abp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 79, .65); }
  50%      { box-shadow: 0 0 0 9px rgba(46, 125, 79, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .abp-btn--urgent, .abp-rappel { animation: none; }
}

/* Toast d'avertissement (sortie d'un texte modifie) */
.abp-toast--warn { background: #8a5a12; }


@media (max-width: 560px) {
  .abp-rappel { font-size: 13px; gap: 10px; padding: 10px 12px; }
  .abp-rappel .abp-btn { padding: 8px 14px; }
}

/* Le menu du site ne doit pas disparaitre sous le bandeau d'alerte */
.abp-admin-on .site-header { top: var(--abp-rappel-h, 0px); transition: top .2s; }

/* Un élément éditable devenu vide doit rester visible et cliquable,
   sinon impossible de le récupérer (leçon apprise). */
.abp-admin-on [data-edit]:empty {
  display: inline-block;
  min-width: 60px; min-height: 1.1em;
  outline: 1px dashed rgba(184, 149, 92, .8);
}
