/* ============================================================
   GESTION INVITÉS — vue liste
   (le rail d'étapes et le bandeau de guidage sont partagés :
    voir css/step-rail.css)
   Aligné sur le design system editorial : aucun hex codé en dur,
   tout passe par les tokens (--surface, --line, --ink, --joy-*).
   ============================================================ */

/* ─── En-tête de la liste ────────────────────────────────────── */
.wg-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: var(--space-4, 18px);
}
.wg-header-titles { min-width: 0; }
.wg-page-title { margin: 2px 0 0; font-size: 1.9rem; }
.wg-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── KPIs ───────────────────────────────────────────────────── */
.wg-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: var(--space-4, 18px);
}
.wg-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.wg-stat-v { font-family: var(--font-heading, inherit); font-size: 1.7rem; line-height: 1.1; font-weight: 600; }
.wg-stat-l { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
  .wg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Bloc « les mariés remplissent leur liste » ─────────────── */
.wg-couple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: var(--space-4, 18px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.wg-couple.is-on {
  background: var(--joy-sage-tint);
  border-color: color-mix(in srgb, var(--joy-sage-ink) 30%, transparent);
}
.wg-couple-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.wg-couple-text p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.wg-couple-toggle { flex: 0 0 auto; position: relative; display: inline-block; width: 44px; height: 24px; }
.wg-couple-toggle input { opacity: 0; width: 0; height: 0; }
.wg-couple-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: 24px; transition: background .18s;
}
.wg-couple-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: var(--surface); border-radius: 50%; transition: transform .18s;
}
.wg-couple-toggle input:checked + .wg-couple-slider { background: var(--joy-sage-ink); }
.wg-couple-toggle input:checked + .wg-couple-slider::before { transform: translateX(20px); }
.wg-couple-toggle input:focus-visible + .wg-couple-slider { outline: 2px solid var(--joy-sky-ink); outline-offset: 2px; }

/* ─── Barre d'outils (recherche + tri) ───────────────────────── */
.wg-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.wg-search { flex: 1 1 240px; min-width: 0; }
.wg-search input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
}
.wg-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.wg-sort select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

/* ─── Chips de filtre ────────────────────────────────────────── */
.wg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3, 14px); }
.wg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.wg-chip:hover { color: var(--ink); }
.wg-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.wg-chip-n { font-weight: 600; opacity: .75; }

/* ─── Tableau ────────────────────────────────────────────────── */
.wg-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.wg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wg-table thead th {
  position: sticky; top: 0; z-index: 1;
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-deep) 40%, var(--surface));
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.wg-table th.wg-th-flag { text-align: center; width: 46px; }
.wg-table tbody td { padding: 8px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: middle; }
.wg-table tbody tr:last-child td { border-bottom: none; }
.wg-row:hover td { background: color-mix(in srgb, var(--bg-deep) 30%, transparent); }

.wg-name-btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: none; background: transparent; padding: 0;
  font-family: inherit; font-size: inherit; color: inherit;
  cursor: pointer; text-align: left; max-width: 100%;
}
.wg-avatar {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: var(--gh-tint, var(--bg-deep));
  color: var(--gh-ink, var(--ink));
}
.wg-name-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wg-name { font-weight: 500; }
.wg-name-btn:hover .wg-name { text-decoration: underline; }
.wg-marks { display: flex; flex-wrap: wrap; gap: 4px; }
.wg-mark {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: var(--bg-deep); color: var(--muted);
}
.wg-mark[data-tone="child"]   { background: var(--joy-apricot-tint); color: var(--joy-apricot-ink); }
.wg-mark[data-tone="allergy"] { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); }
.wg-mark[data-tone="diet"]    { background: var(--joy-sage-tint); color: var(--joy-sage-ink); }

.wg-side { font-size: 12.5px; color: var(--s-ink, var(--muted)); white-space: nowrap; }
.wg-dash { color: var(--muted); }
.wg-tablebadge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--joy-sky-tint); color: var(--joy-sky-ink);
  font-size: 11.5px; font-weight: 600;
}
.wg-rsvp {
  padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.wg-rsvp[data-rsvp="yes"]     { border-color: color-mix(in srgb, var(--joy-sage-ink) 45%, transparent); color: var(--joy-sage-ink); }
.wg-rsvp[data-rsvp="pending"],
.wg-rsvp[data-rsvp="maybe"]   { border-color: color-mix(in srgb, var(--joy-apricot-ink) 45%, transparent); color: var(--joy-apricot-ink); }
.wg-rsvp[data-rsvp="no"]      { border-color: color-mix(in srgb, var(--color-danger) 40%, transparent); color: var(--color-danger); }

.wg-td-flag { text-align: center; }
.wg-flag {
  border: 1px solid transparent; background: transparent;
  border-radius: 8px; padding: 4px 6px; cursor: pointer;
  font-size: 14px; line-height: 1;
  filter: grayscale(1); opacity: .35;
  transition: filter .15s, opacity .15s, background .15s;
}
.wg-flag:hover { opacity: .7; background: var(--bg-deep); }
.wg-flag.is-on { filter: none; opacity: 1; background: var(--bg-deep); border-color: var(--line); }
.wg-flag:focus-visible { outline: 2px solid var(--joy-sky-ink); outline-offset: 1px; }

.wg-td-act { text-align: right; white-space: nowrap; }
.wg-iconbtn {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 4px 9px; cursor: pointer;
  color: var(--muted); font-size: 13px; line-height: 1.4;
}
.wg-iconbtn:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 30%, transparent); }

.wg-nores {
  padding: 26px; text-align: center; color: var(--muted); font-size: 13.5px;
  background: var(--surface); border: 1px dashed var(--line); border-radius: 14px;
}

/* Mobile : le tableau se replie en cartes empilées. */
@media (max-width: 720px) {
  .wg-table thead { display: none; }
  .wg-table, .wg-table tbody, .wg-table tr, .wg-table td { display: block; width: 100%; }
  .wg-table tbody tr {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }
  .wg-table tbody td { border: none; padding: 3px 0; }
  .wg-td-name { margin-bottom: 4px; }
  .wg-td-side, .wg-td-rsvp, .wg-td-table, .wg-td-flag, .wg-td-act {
    display: inline-block; width: auto; margin-right: 10px;
  }
  .wg-td-act { float: right; }
}
