/* Grille des types d'activité (js/eb_types_grille.js) : le même rendu sur
   toutes les pages de paramétrage qui associent des types d'activité. */
.eb-tg { --tg-bord: var(--eb-border, rgba(15, 23, 42, .12)); --tg-fond: var(--eb-surface, #fff);
  --tg-doux: var(--eb-surface-muted, #f6f7f9); --tg-accent: var(--eb-primary, #2563eb);
  --tg-texte: inherit; width: 100%; text-align: left; }

select.eb-tg-source, select[data-eb-types-grille], .bootstrap-select:has(> select[data-eb-types-grille]) { display: none !important; }

.eb-tg-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.eb-tg-recherche { flex: 1 1 200px; max-width: 320px; }
.eb-tg-compte { margin-left: auto; font-size: .82rem; opacity: .7; white-space: nowrap; }
.eb-tg-barre .btn { white-space: nowrap; }

.eb-tg-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.eb-tg-tuile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 8px; padding: 14px 8px 10px; min-height: 112px; border: 1.5px solid var(--tg-bord); border-radius: 12px;
  background: var(--tg-fond); color: var(--tg-texte); cursor: pointer; text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .08s, background .15s; touch-action: manipulation; }
.eb-tg-tuile:hover:not(:disabled) { border-color: var(--tg-accent); box-shadow: 0 2px 10px rgba(15, 23, 42, .08); }
.eb-tg-tuile:active:not(:disabled) { transform: scale(.98); }
.eb-tg-tuile:focus-visible { outline: 2px solid var(--tg-accent); outline-offset: 2px; }
.eb-tg-tuile:disabled { cursor: not-allowed; opacity: .55; }
.eb-tg-tuile.choisi { border-color: var(--tg-accent); background: color-mix(in srgb, var(--tg-accent) 7%, var(--tg-fond));
  box-shadow: 0 0 0 1px var(--tg-accent) inset; }

.eb-tg-image { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--tg-doux); flex-shrink: 0; }
.eb-tg-image > * { width: 52px !important; height: 52px !important; max-width: none; object-fit: cover; border-radius: 14px;
  --eb-pt-size: 52px !important; margin: 0 !important; }
.eb-tg-image-vide { font-weight: 700; font-size: 1.3rem; color: #64748b; }
.eb-tg-tuile:not(.choisi) .eb-tg-image { filter: grayscale(.35); opacity: .85; }

.eb-tg-nom { font-size: .85rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }

.eb-tg-coche { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .7rem;
  border: 1.5px solid var(--tg-bord); background: var(--tg-fond); color: transparent; transition: all .15s; }
.eb-tg-tuile.choisi .eb-tg-coche { background: var(--tg-accent); border-color: var(--tg-accent); color: #fff; }

.eb-tg-vide { grid-column: 1 / -1; margin: 0; padding: 14px; text-align: center; opacity: .7;
  border: 1px dashed var(--tg-bord); border-radius: 10px; }

@media (max-width: 575px) {
  .eb-tg-grille { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .eb-tg-tuile { min-height: 100px; padding: 12px 6px 8px; }
  .eb-tg-image, .eb-tg-image > * { width: 44px !important; height: 44px !important; --eb-pt-size: 44px !important; }
  .eb-tg-recherche { max-width: none; flex-basis: 100%; }
  .eb-tg-compte { margin-left: 0; margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) { .eb-tg-tuile { transition: none; } }
