/* U4Partners — éditeur de mini-site (onglet « Mon site » + modération). */

/* ——— Onboarding ——— */
.u4p-se-intro { padding: clamp(22px, 3vw, 34px); }
.u4p-se-intro-body { max-width: 620px; }
.u4p-se-intro h3 { margin-top: 0; }
.u4p-se-intro-list { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 9px; }
.u4p-se-intro-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; }
.u4p-se-intro-list i { color: var(--u4p-ok); margin-top: 4px; }
.u4p-se-intro-ai {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--u4p-border);
  border-radius: var(--u4p-radius);
  background: var(--u4p-accent-soft);
  font-size: .9rem;
}
.u4p-se-intro-note { margin: 12px 0 0; font-size: .84rem; }

/* ——— Barre d'actions ——— */
.u4p-se-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
}
.u4p-se-bar-info { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: .9rem; }
.u4p-se-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.u4p-se-url { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.u4p-se-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--u4p-warn);
  font-size: .84rem;
}
.u4p-se-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--u4p-warn);
}

.u4p-se-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  background: #eef0f4;
  color: #4b5563;
}
.u4p-se-badge.is-published { background: var(--u4p-ok-bg); color: var(--u4p-ok); }
.u4p-se-badge.is-pending_review { background: #fff7ed; color: var(--u4p-warn); }
.u4p-se-badge.is-rejected, .u4p-se-badge.is-suspended { background: var(--u4p-err-bg); color: var(--u4p-err); }

.u4p-se-note { padding: 14px 18px; border-left: 4px solid var(--u4p-primary); }
.u4p-se-note.is-warn { border-left-color: var(--u4p-warn); }
.u4p-se-note p { margin: 6px 0 0; font-size: .9rem; color: var(--u4p-muted); }

/* ——— Indicateurs ——— */
.u4p-se-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 14px 0; }
.u4p-se-stats .u4p-panel { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.u4p-se-stats span { font-size: .8rem; color: var(--u4p-muted); }
.u4p-se-stats strong { font-family: var(--u4p-display); font-size: 1.5rem; }

/* ——— Disposition ——— */
.u4p-se-body { display: grid; grid-template-columns: 268px 1fr; gap: 16px; align-items: start; }

.u4p-se-list { padding: 12px; position: sticky; top: 16px; }
.u4p-se-list-title {
  margin: 10px 8px 6px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--u4p-muted);
}
.u4p-se-item {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--u4p-radius);
  transition: background .15s var(--u4p-ease);
}
.u4p-se-item:hover { background: #f3f4f9; }
.u4p-se-item.is-current { background: var(--u4p-accent-soft); }
.u4p-se-item.is-off .u4p-se-item-open { opacity: .45; }
.u4p-se-item-open {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border: 0;
  background: none;
  font: inherit;
  font-size: .9rem;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.u4p-se-item-open i { width: 18px; color: var(--u4p-primary); font-size: .9rem; }
.u4p-se-item-tools { display: flex; align-items: center; gap: 2px; padding-right: 6px; }
.u4p-se-move {
  width: 22px;
  height: 22px;
  border: 0;
  background: none;
  color: var(--u4p-muted);
  cursor: pointer;
  font-size: .7rem;
  border-radius: 4px;
}
.u4p-se-move:hover { background: #e6e8f0; color: var(--u4p-text); }

.u4p-se-switch { position: relative; display: inline-flex; width: 34px; height: 19px; flex: 0 0 auto; }
.u4p-se-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.u4p-se-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cfd3e0;
  transition: background .2s var(--u4p-ease);
  pointer-events: none;
}
.u4p-se-switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s var(--u4p-ease);
}
.u4p-se-switch input:checked + span { background: var(--u4p-ok); }
.u4p-se-switch input:checked + span::after { transform: translateX(15px); }
.u4p-se-switch input:disabled + span { opacity: .5; }

/* ——— Panneaux ——— */
.u4p-se-panel { padding: 20px 22px; display: grid; gap: 16px; }
.u4p-se-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--u4p-border);
}
.u4p-se-panel-head h3 { margin: 0 0 4px; }
.u4p-se-panel-head p { margin: 0; font-size: .86rem; }

.u4p-se-field { display: flex; flex-direction: column; gap: 6px; }
.u4p-se-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--u4p-muted);
}
.u4p-se-count { font-style: normal; font-size: .74rem; color: #9aa1b4; font-weight: 500; }
.u4p-se-count.is-full { color: var(--u4p-err); }
.u4p-se-help { font-size: .78rem; color: var(--u4p-muted); }

.u4p-se-field input[type="text"],
.u4p-se-field input[type="email"],
.u4p-se-field input[type="tel"],
.u4p-se-field select,
.u4p-se-field textarea,
.u4p-se-slug-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--u4p-border);
  border-radius: var(--u4p-radius);
  background: #fff;
  color: var(--u4p-text);
  font: inherit;
  font-size: .92rem;
}
.u4p-se-field textarea { resize: vertical; line-height: 1.6; }
.u4p-se-field input:focus, .u4p-se-field select:focus, .u4p-se-field textarea:focus {
  border-color: var(--u4p-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(51, 50, 121, .12);
}
.u4p-se-bool label { display: flex; align-items: center; gap: 9px; font-size: .9rem; cursor: pointer; }

.u4p-se-group {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--u4p-border);
  border-radius: var(--u4p-radius);
  background: #fafbfe;
}
.u4p-se-group legend { padding: 0 6px; font-size: .8rem; font-weight: 700; color: var(--u4p-muted); }

/* ——— Répéteurs ——— */
.u4p-se-repeater { display: grid; gap: 10px; }
.u4p-se-repeater-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--u4p-muted);
}
.u4p-se-rows { display: grid; gap: 10px; }
.u4p-se-row {
  display: flex;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--u4p-border);
  border-radius: var(--u4p-radius);
  background: #fafbfe;
}
.u4p-se-row-fields { flex: 1; display: grid; gap: 10px; }
.u4p-se-row-tools { display: flex; flex-direction: column; gap: 4px; }
.u4p-se-row-move, .u4p-se-row-del {
  width: 26px;
  height: 26px;
  border: 1px solid var(--u4p-border);
  border-radius: 5px;
  background: #fff;
  color: var(--u4p-muted);
  font-size: .72rem;
  cursor: pointer;
}
.u4p-se-row-move:hover { color: var(--u4p-text); border-color: #b9bed0; }
.u4p-se-row-del:hover { color: var(--u4p-err); border-color: var(--u4p-err); }

/* ——— Image ——— */
.u4p-se-image-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px dashed var(--u4p-border);
  border-radius: var(--u4p-radius);
  background: #fafbfe;
}
.u4p-se-image-box.is-busy { opacity: .6; pointer-events: none; }
.u4p-se-image-box img {
  width: 108px;
  height: 68px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--u4p-border);
}
.u4p-se-image-actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* Champs de portrait : aperçu vertical, comme sur le site public. */
.u4p-se-image-box[data-placeholder] img { width: 84px; height: 105px; border-radius: 6px; }
.u4p-se-image-box.has-placeholder { border-color: var(--u4p-accent); background: #fffdf5; }
.u4p-se-image-box.has-placeholder img { opacity: .85; }

/* ——— Produits ——— */
.u4p-se-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.u4p-se-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--u4p-border);
  border-radius: 999px;
  background: #fff;
  font-size: .84rem;
}
.u4p-se-chip-x {
  border: 0;
  background: none;
  color: var(--u4p-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.u4p-se-chip-x:hover { color: var(--u4p-err); }
.u4p-se-products { gap: 10px; }
.u4p-se-products .u4p-btn { align-self: flex-start; }

/* ——— Réglages ——— */
.u4p-se-slug-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.u4p-se-slug-prefix { font-size: .86rem; color: var(--u4p-muted); font-family: ui-monospace, monospace; }
.u4p-se-slug-row input { flex: 1; min-width: 160px; }
.u4p-se-seo-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--u4p-radius);
  background: #f3f4f9;
  font-size: .82rem;
}

/* ——— Sélecteur de formations ——— */
.u4p-se-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 18, 34, .55);
}
.u4p-se-modal[hidden] { display: none; }
.u4p-se-modal-box {
  width: min(620px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--u4p-radius);
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  overflow: hidden;
}
.u4p-se-modal-box header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--u4p-border);
}
.u4p-se-modal-box header h3 { margin: 0; font-size: 1rem; }
.u4p-se-modal-x { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--u4p-muted); }
.u4p-se-picker-search { display: flex; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--u4p-border); }
.u4p-se-picker-search input, .u4p-se-picker-search select {
  padding: 9px 11px;
  border: 1px solid var(--u4p-border);
  border-radius: var(--u4p-radius);
  font: inherit;
  font-size: .9rem;
}
.u4p-se-picker-search input { flex: 1; }
.u4p-se-picker-list { overflow-y: auto; padding: 10px; display: grid; gap: 6px; }
.u4p-se-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--u4p-radius);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.u4p-se-picker-item:hover { background: #f3f4f9; border-color: var(--u4p-border); }
.u4p-se-picker-item img, .u4p-se-picker-ph {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  background: #e8eaf1;
  flex: 0 0 auto;
}
.u4p-se-picker-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.u4p-se-picker-meta strong { font-size: .9rem; font-weight: 600; }
.u4p-se-picker-meta small { color: var(--u4p-muted); font-size: .8rem; }

/* ——— Notifications ——— */
.u4p-se-toast {
  position: fixed;
  left: 50%;
  bottom: 92px; /* au-dessus de la barre d'actions collante */
  z-index: 1000;
  transform: translate(-50%, 20px);
  max-width: min(460px, calc(100vw - 32px));
  padding: 13px 20px;
  border-radius: var(--u4p-radius);
  background: #16182a;
  color: #fff;
  font-size: .89rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--u4p-ease), transform .2s var(--u4p-ease);
}
.u4p-se-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.u4p-se-toast.is-error { background: var(--u4p-err); }

.u4p-btn--xs { padding: 6px 11px !important; font-size: .78rem !important; }
.u4p-btn.is-busy, .u4p-btn:disabled { opacity: .65; cursor: progress; pointer-events: none; }

/* ——— Barre d'actions collante ——— */
.u4p-se-footbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 18px;
  border: 1px solid var(--u4p-border);
  border-radius: var(--u4p-radius);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(180%) blur(10px);
  box-shadow: 0 -8px 26px rgba(30, 30, 90, .12);
}
.u4p-se-footbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.u4p-se-footbar-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: .85rem;
  color: var(--u4p-muted);
}
.u4p-se-footbar-state i { color: var(--u4p-ok); }
.u4p-se-footbar-state.is-dirty { color: var(--u4p-warn); font-weight: 600; }
.u4p-se-footbar-state.is-dirty i { color: var(--u4p-warn); }

/* ——— Progression des opérations longues ——— */
.u4p-site-editor, #u4p-site-root { position: relative; }
.u4p-site-editor.is-working::before,
#u4p-site-root.is-working::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1001;
  background: linear-gradient(90deg, transparent, var(--u4p-accent), transparent);
  background-size: 38% 100%;
  background-repeat: no-repeat;
  animation: u4p-se-progress 1.1s linear infinite;
}
@keyframes u4p-se-progress {
  from { background-position: -38% 0; }
  to { background-position: 138% 0; }
}
.u4p-site-editor.is-working .u4p-se-panels { opacity: .6; pointer-events: none; }

/* ——— Modération ——— */
.u4p-sm-row { padding: 16px 18px; margin-bottom: 12px; }
.u4p-sm-row.is-done { opacity: .5; }
.u4p-sm-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}
.u4p-sm-head small { color: var(--u4p-muted); }
.u4p-sm-actions { gap: 6px !important; }
.u4p-sm-flags {
  margin: 12px 0 0;
  padding: 10px 13px;
  border-radius: var(--u4p-radius);
  background: #fff7ed;
  color: #7c2d12;
  font-size: .85rem;
}
.u4p-sm-flags i { margin-right: 6px; color: var(--u4p-warn); }

/* ——— Responsive ——— */
@media (max-width: 980px) {
  .u4p-se-body { grid-template-columns: 1fr; }
  .u4p-se-list { position: static; }
}
@media (max-width: 760px) {
  /* Le bouton flottant WhatsApp occupe le coin inférieur droit. */
  .u4p-se-footbar { padding-right: 80px; }
}
@media (max-width: 620px) {
  .u4p-se-bar, .u4p-se-bar-actions { flex-direction: column; align-items: stretch; }
  .u4p-se-bar-actions .u4p-btn { justify-content: center; }
  .u4p-se-row { flex-direction: column; }
  .u4p-se-row-tools { flex-direction: row; justify-content: flex-end; }
  .u4p-se-footbar { flex-direction: column; align-items: stretch; }
  .u4p-se-footbar-actions .u4p-btn { flex: 1; justify-content: center; }
}
