/* ====== Fond & layout (comme le mock) ====== */
.gestion-page{
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 35% 0%, rgba(124,92,255,.18), transparent 62%),
    radial-gradient(900px 480px at 80% 20%, rgba(155,134,255,.18), transparent 60%),
    #f3efff;
}

.gestion-col--right{
  padding: 18px 18px 28px;
}
.sidebar-gestion__wrap{
  position: sticky;
  top: 20px;

  padding: 16px;
  border-radius: 22px;

  background: rgba(255,255,255,0.60);
  border: 1px solid rgba(124,92,255,0.18);
  box-shadow: 0 20px 50px rgba(28,14,80,0.12);
  backdrop-filter: blur(18px);
}

/* ---------- Brand ---------- */
.sidebar-gestion__brand{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 6px 14px;
}

.sidebar-gestion__logo{
  width: 46px;
  height: 46px;
  border-radius: 14px;

  display: grid;
  place-items: center;

  font-weight: 900;
  font-size: 18px;
  color: #fff;

  background: linear-gradient(135deg, #7c5cff, #9b86ff);
  box-shadow: 0 14px 32px rgba(124,92,255,0.25);
}

.sidebar-gestion__brandName{
  font-size: 18px;
  font-weight: 900;
  color: #1f1b2e;
}

/* ---------- Admin Card ---------- */
.sidebar-gestion__adminCard{
  display: flex;
  align-items: center;
  gap: 14px;

  margin: 10px 0 18px;
  padding: 14px;

  border-radius: 18px;
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(124,92,255,0.16);
}

.sidebar-gestion__adminAvatar{
  width: 46px;
  height: 46px;
  border-radius: 16px;

  background: linear-gradient(135deg, rgba(124,92,255,0.35), rgba(155,134,255,0.25));
  border: 1px solid rgba(124,92,255,0.22);
}

.sidebar-gestion__adminTitle{
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: rgba(31,27,46,0.85);
}

.sidebar-gestion__adminSubtitle{
  font-size: 14px;
  font-weight: 800;
  color: rgba(31,27,46,0.65);
  margin-top: 2px;
}

/* ---------- Navigation ---------- */
.sidebar-gestion__nav{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Item */
.sidebar-gestion__item{
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 13px 14px;
  border-radius: 16px;

  text-decoration: none;
  font-weight: 900;
  font-size: 15px;
  color: rgba(31,27,46,0.85);

  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.sidebar-gestion__item:hover{
  background: rgba(255,255,255,0.75);
  border-color: rgba(124,92,255,0.18);
  transform: translateY(-1px);
}

/* Active */
.sidebar-gestion__item.is-active{
  background: rgba(124,92,255,0.15);
  border-color: rgba(124,92,255,0.28);
  box-shadow: 0 12px 28px rgba(124,92,255,0.18);
  color: #1f1b2e;
}

/* Icon */
.sidebar-gestion__icon{
  width: 36px;
  height: 36px;
  border-radius: 999px;

  display: grid;
  place-items: center;

  background: rgba(124,92,255,0.14);
  border: 1px solid rgba(124,92,255,0.20);
  font-size: 16px;
}

/* Label */
.sidebar-gestion__label{
  flex: 1;
}

/* Badge */
.sidebar-gestion__badge{
  padding: 4px 10px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 900;

  background: rgba(124,92,255,0.18);
  border: 1px solid rgba(124,92,255,0.28);
  color: rgba(31,27,46,0.85);
}

/* ---------- Divider ---------- */
.sidebar-gestion__divider{
  height: 1px;
  margin: 16px 0;
  background: rgba(124,92,255,0.18);
}

/* ---------- Bottom ---------- */
.sidebar-gestion__bottom{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Logout */
.sidebar-gestion__logout{
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 13px 14px;
  border-radius: 999px;

  text-decoration: none;
  font-weight: 900;
  font-size: 14px;

  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(124,92,255,0.18);
  color: rgba(31,27,46,0.85);

  transition: background 0.15s ease, transform 0.15s ease;
}

.sidebar-gestion__logout:hover{
  background: rgba(255,255,255,0.95);
  transform: translateY(-1px);
}

.sidebar-gestion__logoutIcon{
  opacity: 0.85;
}

/* Hint */
.sidebar-gestion__hint{
  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 13px;
  font-weight: 800;
  color: rgba(31,27,46,0.60);
}

.sidebar-gestion__hintDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #7c5cff;
  box-shadow: 0 0 0 4px rgba(124,92,255,0.20);
}
/* ===== MODALE INGREDIENT ===== */
.modaleIngredient{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.modaleIngredient.is-open{
  display: block;
}

.modaleIngredientOverlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
}

.modaleIngredientContent{
  position: relative;
  width: min(680px, calc(100% - 20px));
  margin: 10vh auto;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
  animation: tcModalUp .16s ease-out;
}

@keyframes tcModalUp{
  from{ transform: translateY(14px); opacity: .6; }
  to{ transform: translateY(0); opacity: 1; }
}

.closeModaleIngredient{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(124,92,255,.18);
  background: rgba(124,92,255,.10);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modaleIngredientHeader{
  padding: 18px 18px 10px;
  border-bottom: 1px solid rgba(124,92,255,.10);
}

.modaleIngredientHeader h2{
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.modaleIngredientHeader p{
  margin: 6px 0 0;
  font-size: 14px;
  opacity: .7;
}

.modaleIngredientBody{
  padding: 16px 18px 18px;
}

#formModaleIngredient{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#formModaleIngredient .form-control{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(124,92,255,.18);
  outline: none;
}

#formModaleIngredient .form-control:focus{
  box-shadow: 0 0 0 4px rgba(124,92,255,.12);
}

.erreurModaleIngredient{
  color: #b42318;
  font-weight: 600;
  font-size: 14px;
}

.loaderModaleIngredient{
  display: flex;
  justify-content: center;
}

.loaderModaleIngredient img{
  width: 42px;
  height: 42px;
}

.submitModaleIngredient .post-button{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: none;
  background: #7c5cff;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
/* ===========================
   MODALE (style TripCooking)
   Compatible :
   - #modaleIngredient
   - #modaleEditIngredient
=========================== */

.modaleIngredient{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

/* ouverte */
.modaleIngredient.is-open{
  display: flex;
}

/* overlay */
.modaleIngredientOverlay{
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 40, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* carte modale */
.modaleIngredientContent{
  position: relative;
  z-index: 2;

  width: min(560px, 92vw);
  max-height: min(680px, 86vh);

  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(124, 92, 255, 0.20);
  border-radius: 22px;

  box-shadow:
    0 30px 90px rgba(0,0,0,.18),
    0 10px 30px rgba(124,92,255,.10);

  overflow: hidden;

  animation: tcModalIn .18s ease-out;
}

@keyframes tcModalIn{
  from{
    transform: translateY(16px);
    opacity: 0;
  }
  to{
    transform: translateY(0);
    opacity: 1;
  }
}

/* bouton close */
.closeModaleIngredient,
.closeModaleEditIngredient{
  position: absolute;
  top: 14px;
  right: 14px;

  width: 42px;
  height: 42px;
  border-radius: 999px;

  border: 1px solid rgba(124, 92, 255, 0.16);
  background: rgba(124, 92, 255, 0.08);

  display: grid;
  place-items: center;

  font-size: 20px;
  line-height: 1;
  cursor: pointer;

  transition: transform .15s ease, background .15s ease;
}

.closeModaleIngredient:hover,
.closeModaleEditIngredient:hover{
  transform: scale(1.05);
  background: rgba(124, 92, 255, 0.14);
}

/* header */
.modaleIngredientHeader{
  padding: 20px 22px 14px 22px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.modaleIngredientHeader h2{
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #101017;
}

.modaleIngredientHeader p{
  margin: 6px 0 0 0;
  font-size: 13px;
  color: rgba(16,16,23,.65);
}

/* body */
.modaleIngredientBody{
  padding: 16px 22px 22px 22px;
  overflow: auto;
}

/* scrollbar */
.modaleIngredientBody::-webkit-scrollbar{
  width: 10px;
}
.modaleIngredientBody::-webkit-scrollbar-thumb{
  background: rgba(124,92,255,.18);
  border-radius: 999px;
}
.modaleIngredientBody::-webkit-scrollbar-track{
  background: transparent;
}

/* inputs */
.modaleIngredientBody .form-control{
  width: 100%;
  height: 44px;
  padding: 10px 14px;

  border-radius: 14px;
  border: 1px solid rgba(124,92,255,.20);
  background: rgba(124, 92, 255, 0.06);

  outline: none;
  font-size: 14px;

  transition: box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.modaleIngredientBody .form-control:focus{
  border-color: rgba(124,92,255,.55);
  background: rgba(124,92,255,.08);
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}

/* select */
.modaleIngredientBody select.form-control{
  cursor: pointer;
}


/* spacing form */
#formModaleIngredient,
#formEditIngredient{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* loader */
.loaderModaleIngredient,
.loaderEditIngredient{
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
}

.loaderModaleIngredient img,
.loaderEditIngredient img{
  width: 34px;
  height: 34px;
  opacity: .85;
}

/* error message box */
.erreurModaleIngredient,
.erreurEditIngredient{
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 12px;

  background: rgba(255, 80, 80, 0.10);
  border: 1px solid rgba(255, 80, 80, 0.20);

  color: #c72525;
}

/* submit */
.submitModaleIngredient input[type="submit"]{
  width: 100%;
  height: 46px;

  border: none;
  border-radius: 14px;
  cursor: pointer;

  background: linear-gradient(135deg, #7c5cff, #5f3dff);
  color: #fff;

  font-weight: 800;
  font-size: 14px;
  letter-spacing: .2px;

  box-shadow: 0 12px 30px rgba(124,92,255,.30);
  transition: transform .15s ease, filter .15s ease;
}

.submitModaleIngredient input[type="submit"]:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.submitModaleIngredient input[type="submit"]:active{
  transform: translateY(0);
}

/* Empêche scroll page derrière modale */
body.is-modal-open{
  overflow: hidden;
}


/* =========================================================
   MODALE : Ajouter du matériel
   IDs : #addMaterielOverlay, #addMaterielModal
   ========================================================= */

/* Empêche le scroll quand une modale est ouverte */
body.modal-open {
  overflow: hidden;
}

/* Overlay */
#addMaterielOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9998;
}

/* Wrapper modal */
#addMaterielModal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 18px;
}

/* Card */
#addMaterielModal .tc-modal__card {
  width: min(620px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;

  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0,0,0,.25);

  position: relative;
  padding: 18px 18px 16px;
}

/* Close button */
#addMaterielModal .tc-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border: none;
  background: transparent;
  border-radius: 999px;

  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

#addMaterielModal .tc-modal__close:hover {
  background: rgba(0,0,0,.06);
}

#addMaterielModal .tc-modal__close:active {
  background: rgba(0,0,0,.10);
}

#addMaterielModal .tc-modal__close:focus-visible {
  outline: 2px solid rgba(0,0,0,.35);
  outline-offset: 2px;
  border-radius: 999px;
}

/* Form spacing */
#addMaterielModal .tc-stack {
  display: grid;
  gap: 10px;
}

/* Input */
#addMaterielModal .form-control {
  border-radius: 14px;
}

/* Error */
#addMaterielModal #addMaterielError,
#addMaterielModal .erreurMateriel {
  color: #b00020;
  font-size: 14px;
  min-height: 18px; /* évite les sauts de layout */
}

/* Loader */
#addMaterielModal #addMaterielLoader,
#addMaterielModal .loaderMateriel {
  display: none;
  margin-top: 6px;
}

#addMaterielModal #addMaterielLoader img,
#addMaterielModal .loaderMateriel img {
  width: 26px;
  height: 26px;
}

/* Bouton */
#addMaterielModal .tc-btn {
  border-radius: 14px;
}

/* Animation optionnelle (si ton JS ajoute .is-open) */
#addMaterielOverlay.is-open {
  animation: addMatFadeIn 140ms ease-out both;
}

#addMaterielModal.is-open .tc-modal__card {
  animation: addMatPopIn 160ms ease-out both;
}

@keyframes addMatFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes addMatPopIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive */
@media (max-width: 520px) {
  #addMaterielModal {
    padding: 10px;
  }

  #addMaterielModal .tc-modal__card {
    padding: 14px 14px 12px;
    border-radius: 14px;
    max-height: 88vh;
  }

  #addMaterielModal .tc-modal__close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
  }
}
/* =========================================
   OVERLAY
   ========================================= */
.tc-qty__overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9998;
}

/* =========================================
   MODAL WRAPPER
   ========================================= */
.tc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 18px;
}
.tc-modal[hidden],
.tc-qty__overlay[hidden] {
  display: none !important;
}

/* =========================================
   CARD
   ========================================= */
.tc-modal__card {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;

  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);

  position: relative;
  padding: 18px;
}

/* =========================================
   CLOSE BUTTON
   ========================================= */
.tc-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 42px;
  height: 42px;
  border-radius: 12px;

  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;

  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;

  transition: transform 0.15s ease, background 0.15s ease;
}

.tc-modal__close:hover {
  transform: scale(1.05);
  background: #fff;
}

/* =========================================
   HEADER
   ========================================= */
.tc-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-right: 56px; /* laisse de la place au X */
}

.tc-modal__titleRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tc-modal__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #1f1f2a;
}

.tc-modal__subtitle {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 14px;
  color: rgba(31, 31, 42, 0.65);
}

/* =========================================
   BODY
   ========================================= */
.tc-modal__body {
  margin-top: 16px;
}

/* =========================================
   STACK
   ========================================= */
.tc-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================================
   FORM
   ========================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-control {
  width: 100%;
  height: 44px;

  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);

  padding: 0 14px;
  font-size: 15px;

  outline: none;
  background: #fff;

  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: rgba(140, 115, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(140, 115, 255, 0.15);
}

/* =========================================
   TOTAL ROW
   ========================================= */
.param-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(140, 115, 255, 0.07);
  border: 1px solid rgba(140, 115, 255, 0.12);
}

.param-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.param-muted {
  font-size: 13px;
  color: rgba(31, 31, 42, 0.62);
}

/* =========================================
   LOADER + ERROR
   ========================================= */
.loaderTemps,
.loaderMateriel,
.loaderDifficulte {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.loaderTemps img,
.loaderMateriel img,
.loaderDifficulte img {
  width: 34px;
  height: 34px;
}

.erreurTemps,
.erreurMateriel,
.erreurDifficulte {
  min-height: 18px;
  font-size: 13px;
  color: #b00020;
}

/* =========================================
   BUTTONS
   ========================================= */
.tc-btn {
  height: 44px;
  padding: 0 16px;
  border-radius: 14px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  cursor: pointer;

  font-size: 14px;
  font-weight: 700;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.10);
}

/* bouton principal */
.tc-btn-primary {
  background: #8c73ff;
  border-color: #8c73ff;
  color: #fff;
}

.tc-btn-primary:hover {
  box-shadow: 0 12px 30px rgba(140, 115, 255, 0.35);
}

/* large */
.tc-btn-wide {
  width: 100%;
}

/* =========================================
   BODY LOCK (quand modale ouverte)
   ========================================= */
body.modal-open {
  overflow: hidden;
}

/* =========================================================
   MODALE IMAGE (TripCooking style)
   Cible : #modalImage.modaleIngredient
   ========================================================= */

/* base : cachée */
#modalImage.modaleIngredient{
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

/* ouverte */
#modalImage.modaleIngredient.is-open{
  display: flex;
}

/* overlay glass (doit être SOUS la carte) */
#modalImage .modaleIngredientOverlay{
  position: absolute;
  inset: 0;
  z-index: 1;

  background:
    radial-gradient(900px 520px at 30% 10%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(800px 520px at 80% 25%, rgba(155,134,255,.22), transparent 62%),
    rgba(20,16,40,.55);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* carte */
#modalImage .modaleIngredientContent{
  position: relative;
  z-index: 2;                /* au-dessus overlay */
  pointer-events: auto;      /* garantie cliquable */

  width: min(560px, 92vw);
  max-height: min(720px, 86vh);

  border-radius: 24px;
  overflow: hidden;

  background: rgba(255,255,255,.92);
  border: 1px solid rgba(124,92,255,.20);

  box-shadow:
    0 28px 90px rgba(0,0,0,.20),
    0 12px 34px rgba(124,92,255,.14);

  transform: translateY(10px);
  opacity: 0;
  animation: tcModalPop .18s ease-out forwards;
}

@keyframes tcModalPop{
  to { transform: translateY(0); opacity: 1; }
}

/* bouton fermer */
#modalImage .closeImage{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5; /* au-dessus de tout */

  width: 42px;
  height: 42px;
  border-radius: 999px;

  border: 1px solid rgba(124,92,255,.18);
  background: rgba(124,92,255,.10);

  display: grid;
  place-items: center;

  font-size: 22px;
  line-height: 1;
  cursor: pointer;

  transition: transform .15s ease, background .15s ease, filter .15s ease;
}

#modalImage .closeImage:hover{
  transform: scale(1.06);
  background: rgba(124,92,255,.16);
}

#modalImage .closeImage:active{
  transform: scale(1.02);
}

/* header */
#modalImage .modaleIngredientHeader{
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(0,0,0,.06);

  background:
    linear-gradient(180deg, rgba(124,92,255,.14), rgba(255,255,255,.70));
}

#modalImage .modaleIngredientHeader h2{
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2px;
  color: #1f1b2e;
}

#modalImage .modaleIngredientHeader p{
  margin: 6px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(31,27,46,.65);
}

/* body */
#modalImage .modaleIngredientBody{
  padding: 16px 20px 20px;
  overflow: auto;

  position: relative;
  z-index: 2;
}

/* scrollbar */
#modalImage .modaleIngredientBody::-webkit-scrollbar{ width: 10px; }
#modalImage .modaleIngredientBody::-webkit-scrollbar-thumb{
  background: rgba(124,92,255,.18);
  border-radius: 999px;
}
#modalImage .modaleIngredientBody::-webkit-scrollbar-track{ background: transparent; }

/* upload label */
#modalImage .custom-upload-label{
  position: relative;
  z-index: 3;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 10px;
  width: 100%;
  padding: 12px 14px;

  border-radius: 16px;
  cursor: pointer;

  font-weight: 900;
  font-size: 14px;
  color: rgba(31,27,46,.90);

  background: rgba(255,255,255,.75);
  border: 1px dashed rgba(124,92,255,.35);

  box-shadow: 0 12px 26px rgba(28,14,80,.06);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

/* cache l'input file */
#modalImage .custom-upload-label input[type="file"]{
  display: none;
}

#modalImage .custom-upload-label:hover{
  background: rgba(255,255,255,.92);
  border-color: rgba(124,92,255,.55);
  transform: translateY(-1px);
}

/* preview : ne doit JAMAIS bloquer le clic du bouton */
#modalImage #ingredientImagePreview{
  margin-top: 12px;
  border-radius: 18px;
  overflow: hidden;

  background: rgba(124,92,255,.06);
  border: 1px solid rgba(124,92,255,.14);

  position: relative;
  z-index: 1;
  pointer-events: none; /* ✅ IMPORTANT : l'image ne "mange" pas les clics */
}

#modalImage #previewing{
  width: 100%;
  height: auto;
  display: block;
}

/* bouton submit */
#modalImage .upload-button{
  position: relative;
  z-index: 10; /* ✅ toujours au-dessus */
}

#modalImage .upload-button input[type="submit"],
#modalImage .upload-button .btn,
#modalImage .upload-button button{
  width: 100%;
  height: 46px;

  border: none;
  border-radius: 16px;

  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .2px;

  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #5f3dff);

  box-shadow: 0 14px 34px rgba(124,92,255,.28);
  transition: transform .15s ease, filter .15s ease;
}

#modalImage .upload-button input[type="submit"]:hover,
#modalImage .upload-button .btn:hover,
#modalImage .upload-button button:hover{
  transform: translateY(-1px);
  filter: brightness(1.04);
}

#modalImage .upload-button input[type="submit"]:active,
#modalImage .upload-button .btn:active,
#modalImage .upload-button button:active{
  transform: translateY(0);
}

/* loader */
#modalImage #uploadIngredientLoader{
  display: none;            /* ✅ caché par défaut */
  justify-content: center;
  padding-top: 10px;
}

#modalImage #uploadIngredientLoader img{
  opacity: .9;
}

/* stop scroll derrière */
body.is-modal-open{
  overflow: hidden;
}

/* responsive */
@media (max-width: 576px){
  #modalImage.modaleIngredient{ padding: 12px; }
  #modalImage .modaleIngredientContent{ border-radius: 18px; }
  #modalImage .modaleIngredientHeader{ padding: 16px 16px 12px; }
  #modalImage .modaleIngredientBody{ padding: 14px 16px 16px; }
  #modalImage .closeImage{ top: 10px; right: 10px; }
}


/* ====== TOPBAR (barre du haut) ====== */
.gestion-topbar{
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(124,92,255,.18);
  box-shadow: 0 12px 30px rgba(28,14,80,.08);
  backdrop-filter: blur(16px);
}

.gestion-topbar__search{
  flex: 1;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(124,92,255,.16);
}

.gestion-topbar__input{
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
}

.gestion-iconbtn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(124,92,255,.16);
  background: rgba(255,255,255,.60);
  box-shadow: 0 10px 24px rgba(28,14,80,.06);
}

.gestion-userpill{
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(124,92,255,.16);
  background: rgba(255,255,255,.60);
  box-shadow: 0 10px 24px rgba(28,14,80,.06);
}

.gestion-userpill__avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(155,134,255,.25));
  border: 1px solid rgba(124,92,255,.22);
}

/* ====== Grande carte header (comme le mock) ====== */
.gestion-header{
  margin-top: 16px;
  padding: 22px 22px;
  border-radius: 22px;

  background:
    linear-gradient(180deg, rgba(124,92,255,.14), rgba(255,255,255,.55));
  border: 1px solid rgba(124,92,255,.18);
  box-shadow: 0 18px 48px rgba(28,14,80,.10);
}

.gestion-header__title{
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  color: #1f1b2e;
}
.gestion-header__subtitle{
  margin: 6px 0 0;
  color: rgba(31,27,46,.68);
  font-size: 15px;
}

.gestion-header__actions{ display:none; } /* sur le mock: pas d’actions à droite */

/* ====== Tabs (Tous / Validé / En attente) ====== */
.gestion-tabs{
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 18px;

  display: flex;
  align-items: center;
  gap: 12px;

  background: rgba(255,255,255,.55);
  border: 1px solid rgba(124,92,255,.16);
  box-shadow: 0 12px 30px rgba(28,14,80,.08);
}

.gestion-tab{
  border: 1px solid rgba(124,92,255,.14);
  background: rgba(255,255,255,.65);
  color: rgba(31,27,46,.88);

  padding: 12px 18px;
  border-radius: 16px;

  font-weight: 900;
  cursor: pointer;
}

.gestion-tab.is-active{
  background: rgba(124,92,255,.14);
  border-color: rgba(124,92,255,.22);
  box-shadow: 0 10px 26px rgba(124,92,255,.10);
}

.gestion-tabselect{
  position: relative;
}

.gestion-tab--select{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.gestion-tab__count{
  display: inline-grid;
  place-items: center;
  height: 24px;
  min-width: 24px;
  padding: 0 8px;

  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;

  background: rgba(124,92,255,.16);
  border: 1px solid rgba(124,92,255,.22);
}

.gestion-tab__chev{ opacity: .7; }

/* Dropdown optionnel */
.gestion-dropdown{
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 240px;

  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(124,92,255,.18);
  box-shadow: 0 18px 48px rgba(28,14,80,.10);
  backdrop-filter: blur(12px);
}
.gestion-tabselect:hover .gestion-dropdown{ display: block; }
.gestion-dropdown a{
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(31,27,46,.88);
  font-weight: 800;
}
.gestion-dropdown a:hover{
  background: rgba(124,92,255,.10);
}

/* le select à droite (si tu le gardes) */
.gestion-select{
  margin-left: auto;
  border-radius: 999px;
  border: 1px solid rgba(124,92,255,.16);
  background: rgba(255,255,255,.70);
  padding: 10px 12px;
  font-weight: 800;
}

/* ====== Panel table (comme le mock) ====== */
.gestion-panel{
  margin-top: 14px;
  border-radius: 22px;
  overflow: hidden;

  background: rgba(255,255,255,.55);
  border: 1px solid rgba(124,92,255,.16);
  box-shadow: 0 18px 48px rgba(28,14,80,.10);
}

.gestion-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 0; /* important */
}

.gestion-table thead th{
  text-transform: uppercase;
  font-size: 12.5px;
  letter-spacing: .35px;
  color: rgba(31,27,46,.70);

  padding: 16px 14px;
  background: rgba(124,92,255,.12);
  border-bottom: 1px solid rgba(124,92,255,.14);
}

.gestion-table tbody td{
  padding: 18px 14px;
  border-bottom: 1px solid rgba(124,92,255,.10);
  background: rgba(255,255,255,.45);
  vertical-align: middle;
}

.gestion-table tbody tr:hover td{
  background: rgba(255,255,255,.62);
}

.gestion-col-check{ width: 44px; }
.gestion-col-img{ width: 110px; }
.gestion-col-date{ width: 180px; }
.gestion-col-action{ width: 240px; }

/* Image */
.gestion-imagewrap{
  width: 78px;
  height: 78px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(124,92,255,.18);
  box-shadow: 0 12px 26px rgba(28,14,80,.08);
  background: rgba(255,255,255,.65);
}
.gestion-avatar{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ingrédient cell */
.gestion-ingredientTitle{
  font-weight: 900;
  font-size: 18px;
  color: #1f1b2e;
  line-height: 1.2;
}
.gestion-ingredientMeta{
  margin-top: 6px;
  color: rgba(31,27,46,.60);
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gestion-ingredientMeta .dot{ opacity: .6; }

/* Badge état (optionnel) */
.gestion-badgeEtat{
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid transparent;
}
.gestion-badgeEtat--wait{
  background: rgba(124,92,255,.10);
  border-color: rgba(124,92,255,.18);
  color: rgba(31,27,46,.75);
}

/* Member */
.gestion-member{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: rgba(31,27,46,.85);
}
.gestion-member__avatar{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124,92,255,.28), rgba(155,134,255,.18));
  border: 1px solid rgba(124,92,255,.18);
}

/* Actions buttons (comme le mock) */
.gestion-actions{
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.gestion-btn{
  border: 1px solid transparent;
  border-radius: 14px; /* sur le mock : boutons plus “rectangles arrondis” */
  padding: 12px 18px;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(28,14,80,.08);
}
.gestion-btn--sm{ padding: 12px 18px; } /* on force le même look */

.gestion-btn--success{
  background: rgba(35,178,109,.65);
  border-color: rgba(20,110,70,.20);
  color: #fff;
}
.gestion-btn--danger{
  background: rgba(229,77,90,.78);
  border-color: rgba(160,30,42,.18);
  color: #fff;
}

.gestion-btn--success:hover,
.gestion-btn--danger:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
}

/* =========================================================
   MODALE : PROPOSER UN INGRÉDIENT  (#modaleIngredient)
   Style : glass + violet doux + carte arrondie
========================================================= */

/* Base : cachée */
#modaleIngredient.modaleIngredient{
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none; /* fermé */
  align-items: center;
  justify-content: center;

  padding: 18px;
}

/* Ouverte */
#modaleIngredient.modaleIngredient.is-open{
  display: flex;
}

/* Overlay (fond flou violet) */
#modaleIngredient .modaleIngredientOverlay{
  position: absolute;
  inset: 0;

  background:
    radial-gradient(900px 540px at 25% 12%, rgba(124,92,255,.28), transparent 60%),
    radial-gradient(800px 520px at 80% 25%, rgba(155,134,255,.22), transparent 62%),
    rgba(15,12,32,.55);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Carte principale */
#modaleIngredient .modaleIngredientContent{
  position: relative;
  z-index: 2;

  width: min(560px, 92vw);
  max-height: min(760px, 88vh);

  border-radius: 26px;
  overflow: hidden;

  background: rgba(255,255,255,.92);
  border: 1px solid rgba(124,92,255,.20);

  box-shadow:
    0 28px 90px rgba(0,0,0,.22),
    0 14px 36px rgba(124,92,255,.16);

  transform: translateY(12px);
  opacity: 0;
  animation: modalPopIngredient .18s ease-out forwards;
}

@keyframes modalPopIngredient{
  to{
    transform: translateY(0);
    opacity: 1;
  }
}

/* Header */
#modaleIngredient .modaleIngredientHeader{
  padding: 18px 20px 14px;

  border-bottom: 1px solid rgba(0,0,0,.06);

  background:
    linear-gradient(180deg, rgba(124,92,255,.14), rgba(255,255,255,.70));
}

#modaleIngredient .modaleIngredientHeader h2{
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2px;
  color: #1f1b2e;
}

#modaleIngredient .modaleIngredientHeader p{
  margin: 6px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(31,27,46,.65);
}

/* Body */
#modaleIngredient .modaleIngredientBody{
  padding: 16px 20px 20px;
  overflow: auto;
}

/* scrollbar clean */
#modaleIngredient .modaleIngredientBody::-webkit-scrollbar{ width: 10px; }
#modaleIngredient .modaleIngredientBody::-webkit-scrollbar-thumb{
  background: rgba(124,92,255,.18);
  border-radius: 999px;
}
#modaleIngredient .modaleIngredientBody::-webkit-scrollbar-track{
  background: transparent;
}

/* Bouton fermer */
#modaleIngredient .closeModaleIngredient{
  position: absolute;
  top: 14px;
  right: 14px;

  width: 42px;
  height: 42px;
  border-radius: 999px;

  border: 1px solid rgba(124,92,255,.18);
  background: rgba(124,92,255,.10);

  display: grid;
  place-items: center;

  font-size: 22px;
  line-height: 1;
  cursor: pointer;

  transition: transform .15s ease, background .15s ease, filter .15s ease;
}

#modaleIngredient .closeModaleIngredient:hover{
  transform: scale(1.06);
  background: rgba(124,92,255,.16);
}

#modaleIngredient .closeModaleIngredient:active{
  transform: scale(1.02);
}

/* Form layout */
#modaleIngredient #formModaleIngredient{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Select + input style */
#modaleIngredient select.form-control,
#modaleIngredient input.form-control{
  width: 100%;
  height: 48px;

  border-radius: 16px;
  padding: 10px 14px;

  border: 1px solid rgba(124,92,255,.20);
  background: rgba(255,255,255,.90);

  font-weight: 800;
  font-size: 14px;
  color: rgba(31,27,46,.90);

  box-shadow: 0 12px 26px rgba(28,14,80,.06);

  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

#modaleIngredient select.form-control:focus,
#modaleIngredient input.form-control:focus{
  border-color: rgba(124,92,255,.55);
  box-shadow:
    0 0 0 4px rgba(124,92,255,.14),
    0 18px 36px rgba(28,14,80,.08);
  transform: translateY(-1px);
}

#modaleIngredient input.form-control::placeholder{
  font-weight: 700;
  color: rgba(31,27,46,.45);
}

/* Erreur */
#modaleIngredient .erreurModaleIngredient{
  display: block;
  padding: 10px 12px;

  border-radius: 14px;

  background: rgba(255, 85, 85, 0.10);
  border: 1px solid rgba(255, 85, 85, 0.25);

  color: rgba(170, 20, 20, .95);
  font-weight: 800;
  font-size: 13px;
}

/* Bouton envoyer */
#modaleIngredient .submitModaleIngredient input[type="submit"],
#modaleIngredient .submitModaleIngredient button{
  width: 100%;
  height: 48px;

  border: none;
  border-radius: 16px;

  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .2px;

  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #5f3dff);

  box-shadow: 0 14px 34px rgba(124,92,255,.28);
  transition: transform .15s ease, filter .15s ease;
}

#modaleIngredient .submitModaleIngredient input[type="submit"]:hover,
#modaleIngredient .submitModaleIngredient button:hover{
  transform: translateY(-1px);
  filter: brightness(1.04);
}

#modaleIngredient .submitModaleIngredient input[type="submit"]:active,
#modaleIngredient .submitModaleIngredient button:active{
  transform: translateY(0);
}

/* Loader */
#modaleIngredient #loaderModaleIngredient{
  display: none;
  justify-content: center;
  align-items: center;

  padding-top: 10px;
}

#modaleIngredient #loaderModaleIngredient img{
  width: 46px;
  opacity: .9;
}

/* Bloque le scroll derrière si tu utilises body.is-modal-open */
body.is-modal-open{
  overflow: hidden;
}

/* Responsive */
@media (max-width: 576px){
  #modaleIngredient.modaleIngredient{
    padding: 12px;
  }

  #modaleIngredient .modaleIngredientContent{
    border-radius: 18px;
  }

  #modaleIngredient .modaleIngredientHeader{
    padding: 16px 16px 12px;
  }

  #modaleIngredient .modaleIngredientBody{
    padding: 14px 16px 16px;
  }

  #modaleIngredient .closeModaleIngredient{
    top: 10px;
    right: 10px;
  }
}

/* ====== Responsive ====== */
@media (max-width: 992px){
  .gestion-topbar{ border-radius: 16px; }
  .gestion-header__title{ font-size: 24px; }
  .gestion-actions{ justify-content: flex-start; }
  .gestion-select{ margin-left: 0; width: 100%; }

  .gestion-tabs{
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 576px){
  .gestion-topbar{
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }
  .gestion-topbar__search{ max-width: 100%; }
  .gestion-userpill__name{ display: none; }

  /* Table -> scroll */
  .gestion-tablewrap{ overflow-x: auto; }
  .gestion-table{ min-width: 760px; }

  /* Boutons plus compacts */
  .gestion-btn{ padding: 10px 14px; font-size: 14px; }
}
