/* Module repas — espace chef (catalogue, menus, commandes, avis, extras). */

/* ===== Lien retour discret (au-dessus du titre de page) ===== */
.chef-backlink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color 0.16s ease;
}
.chef-backlink:hover { color: var(--accent); }

/* ===== C1 — Recherche du catalogue ===== */
.chef-search {
  position: relative;
  max-width: 420px;
  margin-bottom: 22px;
}
.chef-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.chef-search__input { padding-left: 40px; }

/* ===== Sections de catégorie (catalogue + formulaire menu) ===== */
.chef-section { margin-bottom: 28px; }
.chef-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
/* Sélecteur de plats du formulaire menu : combobox d'ajout + puces retirables */
.dish-picker__select { width: min(360px, 100%); }
.dish-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.dish-picker__chips:empty { margin-top: 0; }
.dish-pick-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  background: #fff;
  border: 1px solid var(--gray-150);
  border-radius: 999px;
  font-size: var(--text-sm);
}
.dish-pick-chip__title {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.dish-pick-chip__price { color: var(--text-muted); }
.dish-pick-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  padding: 0;
}
.dish-pick-chip__remove:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger-fg);
}
.dish-pick-chip__remove .lucide {
  width: 12px;
  height: 12px;
}
.dish-picker > .text-muted { margin-top: 10px; }
.chef-section__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.chef-section__count {
  font-size: 12px;
  color: var(--gray-400);
}

/* ===== C1 — Grille de cartes plats ===== */
.chef-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.chef-dish {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--gray-150);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.chef-dish:hover {
  border-color: var(--gray-300);
  transform: translateY(-2px);
}
.chef-dish__photo {
  aspect-ratio: 4 / 3;
  background: #f8f9fb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
}
.chef-dish__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chef-dish__photo svg,
.chef-dish__photo i {
  width: 34px;
  height: 34px;
}
.chef-dish__body { padding: 12px 14px 14px; }
.chef-dish__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.chef-dish__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chef-dish__price {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.chef-dish__allergens {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Pastille icône de spécificité (allergène / régime) */
.chef-allergen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f4f5f9;
  color: var(--text-muted);
  flex: none;
  overflow: hidden;
}
.chef-allergen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chef-allergen svg,
.chef-allergen i {
  width: 13px;
  height: 13px;
}
.chef-allergen--lg { width: 30px; height: 30px; }
.chef-allergen--lg svg,
.chef-allergen--lg i { width: 16px; height: 16px; }

/* ===== C2 — Fiche plat ===== */
.chef-dish-sheet {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 26px;
  align-items: start;
}
.chef-dish-sheet__photo {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: #f8f9fb;
  border: 1px solid var(--gray-150);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  overflow: hidden;
}
.chef-dish-sheet__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chef-dish-sheet__photo svg,
.chef-dish-sheet__photo i {
  width: 44px;
  height: 44px;
}
.chef-dish-sheet__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.chef-dish-sheet__description {
  margin: 0;
  color: var(--text-secondary);
}
.chef-dish-sheet__price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chef-allergen-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.chef-allergen-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 5px;
  border: 1px solid var(--gray-150);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: #fff;
}

/* ===== Formulaires (plat, menu, deadline, extra…) ===== */
.chef-form-card { max-width: 720px; }
.chef-form-card--wide { max-width: none; }
.chef-form__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}
.chef-form__current-photo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.chef-form__current-photo img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 11px;
  border: 1px solid var(--gray-150);
}

/* Cartes-checkbox de sélection (plats d'un menu, spécificités d'un plat) */
.chef-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.chef-pick-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.chef-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--gray-150);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.chef-pick:hover { border-color: var(--gray-300); }
.chef-pick:has(.chef-pick__input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, #fff);
}
.chef-pick__input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: none;
}
.chef-pick__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chef-pick__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.chef-pick__hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== C5 — Barre de dates ===== */
.chef-datebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.chef-datebar__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* Empilement d'avatars (> 5 convives) : superposition + compteur */
.chef-datebar__pick { position: relative; display: inline-flex; }
.chef-datebar__current {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  margin: 0 2px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.chef-datebar__current:hover { background: var(--gray-100); }
.chef-datebar__current .lucide { color: var(--text-muted); }
/* Champ date natif invisible : sert d'ancre au calendrier de showPicker() */
.chef-datebar__picker-form,
.chef-datebar__picker-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}
.chef-datebar__week {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.chef-day {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--gray-150);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  text-transform: capitalize;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.chef-day:hover {
  border-color: var(--gray-300);
  color: var(--text-primary);
}
.chef-day.is-today { border-color: var(--gray-300); }
.chef-day.is-active {
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  border-color: color-mix(in srgb, var(--accent) 35%, #fff);
  color: var(--accent);
  font-weight: 600;
}

/* ===== C5 — Ligne menu + actions ===== */
.chef-menuline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.chef-menuline__info {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
}
.chef-menuline__link {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.chef-menuline__link:hover { color: var(--accent); }
.chef-menuline__edit {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}
.chef-menuline__edit:hover { text-decoration: underline; }
.chef-menuline__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== C5 — Compteurs ===== */
.chef-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}

/* ===== C5 — Récap par plat ===== */
/* Les lignes sont hautes dès qu'un plat rassemble du monde : le nom du plat et
   les compteurs se lisent en haut, en face du début de la liste. */
.chef-recap-table tbody td { vertical-align: top; }
.chef-recap-table td.fw-semibold { white-space: nowrap; }
/* Colonnes chiffrées au plus juste, et la place restante aux convives : la
   liste passe à la ligne au lieu d'être repliée derrière un « +N ». Les noms
   du midi tiennent plus large que les quantités à emporter, d'où le partage. */
.chef-recap-table th:nth-child(2) { width: 46%; }
.chef-recap-table th:nth-child(3) { width: 26%; }
.chef-recap-table th:nth-child(n+4) { width: 76px; }
.chef-recap-table__guests { min-width: 220px; }
.chef-guests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chef-guest,
.chef-qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 11px 3px 3px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.chef-guest {
  border: 1px solid var(--gray-150);
  background: #fff;
  font-weight: 500;
  color: var(--text-secondary);
}
.chef-qty-pill {
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  color: var(--accent);
  font-weight: 600;
}
.chef-guest__avatar { flex: none; }

/* ===== C8 — Avis ===== */
.chef-review { align-items: flex-start; }
.chef-review__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}
.chef-review__menu-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}
.chef-review__menu-link:hover { text-decoration: underline; }
.chef-review__comment {
  margin: 8px 0 0;
  padding: 8px 14px;
  border-left: 3px solid var(--gray-150);
  border-radius: 0 11px 11px 0;
  background: #f8f9fb;
  font-size: 13px;
  color: var(--text-secondary);
}
.chef-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.chef-stars__star {
  width: 16px;
  height: 16px;
  color: var(--gray-300);
}
.chef-stars svg { width: 16px; height: 16px; }
.chef-stars__star.is-filled {
  color: var(--accent);
  fill: var(--accent);
}

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
  .chef-dish-sheet { grid-template-columns: 1fr; }
  .chef-stats { grid-template-columns: 1fr; }
  .chef-datebar { flex-direction: column; align-items: stretch; }
  .chef-datebar__week { justify-content: space-between; }
  .chef-day { padding: 0 10px; }
  .chef-menuline { flex-direction: column; align-items: flex-start; }
  .chef-recap-table__guests { min-width: 180px; }
}

/* ── Catalogue : filtres, sélection multiple ───────────────────────────── */

.chef-filters {
  display: flex;
  gap: 8px;
  margin: 14px 0 4px;
  flex-wrap: wrap;
}
.chef-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--gray-150);
  background: #fff;
  color: var(--gray-600);
  font-size: 0.83rem;
  text-decoration: none;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.chef-chip:hover { border-color: var(--gray-300); color: var(--text-primary); }
.chef-chip.is-active {
  border-color: var(--brand-indigo);
  background: var(--brand-indigo-tint);
  color: var(--brand-indigo-hover);
}

/* La carte porte sa case : position relative pour l'ancrer sans la mettre
   dans le lien, où le clic ouvrirait la fiche. */
.chef-dish-cell { position: relative; }
.chef-dish__select {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 2;
  display: flex;
  padding: 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.chef-dish__select input { width: 16px; height: 16px; cursor: pointer; margin: 0; }

/* Barre d'action collante : elle suit le chef pendant qu'il descend la page. */
.chef-bulkbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--brand-indigo);
  background: var(--brand-indigo-tint);
  box-shadow: var(--shadow-card);
}
.chef-bulkbar__count {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--brand-indigo-hover);
  margin-right: auto;
}
