/* Wedding Manager – Public CSS */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Nunito:wght@300;400;600;700&display=swap');

:root {
  --wm-gold:   #c9a84c;
  --wm-rose:   #d4758a;
  --wm-sage:   #7a9e8e;
  --wm-cream:  #fdf8f2;
  --wm-dark:   #2c2420;
  --wm-border: #e8ddd0;
}

/* ── Stats strip ── */
.wm-pub-stats {
  display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap;
  margin: 1.5rem 0;
}
.wm-pub-stat {
  display: flex; flex-direction: column; align-items: center;
  background: #fff; border: 1px solid var(--wm-border); border-radius: 12px;
  padding: 1rem 1.8rem; min-width: 100px;
}
.wm-pub-stat-n { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-weight: 600; color: var(--wm-rose); line-height: 1; }
.wm-pub-stat-l { font-family: 'Nunito', sans-serif; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: #aaa; margin-top: .2rem; }

/* ── Notices ── */
.wm-notice {
  padding: .9rem 1.2rem; border-radius: 10px; margin: 1rem 0; font-family: 'Nunito', sans-serif; font-weight: 600; font-size: .95rem;
}
.wm-notice-success { background: #e8f5e9; color: #27ae60; border-left: 4px solid #27ae60; }
.wm-notice-error   { background: #fce4ec; color: #c0392b; border-left: 4px solid var(--wm-rose); }

/* ── Form ── */
.wm-pub-form-wrap {
  background: #fff;
  border: 1px solid var(--wm-border);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 24px rgba(44,36,32,.06);
}
.wm-pub-form-title {
  font-family: 'Cormorant Garamond', serif; font-size: 1.6rem;
  color: var(--wm-dark); margin: 0 0 1.5rem; text-align: center;
}

.wm-pub-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.2rem;
}
@media (max-width: 600px) { .wm-pub-form-grid { grid-template-columns: 1fr; } }

.wm-pub-field { display: flex; flex-direction: column; gap: .35rem; }
.wm-pub-field label { font-family: 'Nunito', sans-serif; font-weight: 600; font-size: .85rem; color: var(--wm-dark); }
.wm-pub-field input, .wm-pub-field textarea {
  border: 1.5px solid var(--wm-border); border-radius: 8px; padding: .55rem .9rem;
  font-family: 'Nunito', sans-serif; font-size: .95rem; transition: all .15s;
}
.wm-pub-field input:focus, .wm-pub-field textarea:focus { border-color: var(--wm-rose); outline: none; box-shadow: 0 0 0 3px rgba(212,117,138,.12); }
.wm-full-width { grid-column: 1/-1; margin-top: .5rem; }

/* Section labels */
.wm-pub-section-label {
  display: block; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .06em; color: #999; margin-bottom: .75rem;
}

/* Attendance */
.wm-pub-attendance { margin-bottom: 1.2rem; }
.wm-pub-att-cards { display: flex; gap: .75rem; flex-wrap: wrap; }
.wm-pub-att-card {
  flex: 1; min-width: 100px; display: flex; flex-direction: column; align-items: center;
  gap: .3rem; padding: .9rem; border: 2px solid var(--wm-border); border-radius: 12px;
  cursor: pointer; transition: all .15s; text-align: center;
}
.wm-pub-att-card input { display: none; }
.wm-pub-att-card.wm-selected, .wm-pub-att-card:has(input:checked) { border-color: var(--wm-rose); background: #fff0f3; }
.att-icon  { font-size: 1.6rem; }
.att-label { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: .85rem; }

/* Meals */
.wm-pub-meal-section { margin-bottom: 1.2rem; }
.wm-pub-meal-cards { display: flex; flex-wrap: wrap; gap: .7rem; }
.wm-pub-meal-card {
  display: flex; align-items: center; gap: .7rem; padding: .65rem 1rem;
  border: 2px solid var(--wm-border); border-radius: 10px; cursor: pointer; transition: all .15s;
}
.wm-pub-meal-card input { display: none; }
.wm-pub-meal-card.wm-selected, .wm-pub-meal-card:has(input:checked) { border-color: var(--wm-sage); background: #f0f7f4; }
.meal-name  { font-family: 'Nunito', sans-serif; font-weight: 600; font-size: .9rem; }
.meal-price { font-size: .85rem; color: var(--wm-sage); font-weight: 700; }

/* Persons */
.wm-pub-persons { margin-bottom: 1.2rem; }
.wm-pub-persons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
@media (max-width: 420px) { .wm-pub-persons-grid { grid-template-columns: 1fr 1fr; } }

/* Buttons */
.wm-pub-btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .75rem 1.5rem;
  border-radius: 10px; font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 700;
  cursor: pointer; border: 2px solid transparent; text-decoration: none; transition: all .15s;
}
.wm-pub-btn-primary  { background: var(--wm-rose); color: #fff; border-color: var(--wm-rose); }
.wm-pub-btn-primary:hover  { background: #c06278; color: #fff; }
.wm-pub-btn-danger   { background: transparent; color: #c0392b; border-color: #e0b0b0; }
.wm-pub-btn-danger:hover { background: #c0392b; color: #fff; }
.wm-pub-form-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; justify-content: center; }

/* ── Guest list section ── */
.wm-pub-list-section { margin-top: 2rem; }
.wm-pub-list-title {
  font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; text-align: center;
  color: var(--wm-dark); margin-bottom: 1rem;
}
.wm-pub-empty { text-align: center; color: #bbb; font-style: italic; padding: 2rem; }

.wm-pub-guest-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem;
}
.wm-pub-guest-card {
  background: #fff; border: 1px solid var(--wm-border); border-radius: 12px;
  padding: 1rem; transition: box-shadow .15s;
}
.wm-pub-guest-card:hover { box-shadow: 0 4px 16px rgba(44,36,32,.1); }
.wm-pub-guest-name { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; font-weight: 600; color: var(--wm-dark); margin-bottom: .4rem; }
.wm-pub-guest-meta { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .8rem; }
.wm-pub-att   { padding: .15rem .5rem; background: #fce4ec; color: var(--wm-rose); border-radius: 10px; }
.wm-pub-meal  { padding: .15rem .5rem; background: #f0f7f4; color: var(--wm-sage); border-radius: 10px; }
.wm-pub-pax   { padding: .15rem .5rem; background: var(--wm-cream); color: #888; border-radius: 10px; }
.wm-pub-edit-link { display: block; margin-top: .6rem; font-size: .8rem; color: var(--wm-gold); text-decoration: none; font-weight: 600; }
.wm-pub-edit-link:hover { color: var(--wm-rose); }

/* ── New guest CTA (after save) ── */
.wm-new-guest-cta {
  text-align: center;
  margin: .75rem 0 1.5rem;
}
.wm-pub-btn-new {
  background: #fff;
  color: var(--wm-rose);
  border: 2px solid var(--wm-rose);
  padding: .7rem 1.8rem;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: all .15s;
}
.wm-pub-btn-new:hover {
  background: var(--wm-rose);
  color: #fff;
}

/* ── Répartition des menus ── */
.wm-meal-table-wrap {
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--wm-border);
}
.wm-meal-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Nunito', sans-serif;
  font-size: .9rem;
}
.wm-meal-table thead tr {
  background: var(--wm-cream);
}
.wm-meal-table th {
  padding: .7rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #999;
  border-bottom: 1px solid var(--wm-border);
}
.wm-meal-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f5f0eb;
  color: var(--wm-dark);
}
.wm-meal-table tbody tr:last-child td { border-bottom: none; }
.wm-meal-table tbody tr:hover { background: #fdf8f2; }
.wm-meal-table tfoot tr {
  background: var(--wm-cream);
  border-top: 2px solid var(--wm-border);
}
.wm-meal-table tfoot td {
  font-weight: 700;
  font-size: .88rem;
  color: var(--wm-dark);
  border-bottom: none;
}
.wm-mt-name  { font-weight: 600; }
.wm-mt-price { color: var(--wm-sage); font-weight: 600; }
.wm-mt-count { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; font-weight: 600; color: var(--wm-rose); }
.wm-mt-pct   { color: #bbb; font-size: .85rem; }
.wm-mt-total { font-weight: 700; color: var(--wm-dark); text-align: right; }
.wm-meal-table th:last-child,
.wm-meal-table td:last-child { text-align: right; }
@media (max-width: 480px) {
  .wm-mt-price, .wm-mt-pct { display: none; }
}

.wm-mt-sub         { display: block; font-size: .75rem; color: #aaa; font-weight: 400; margin-top: .1rem; }
.wm-mt-child-price { font-size: .8rem; color: var(--wm-sage); }
.wm-mt-na          { color: #ccc; }

/* ── Rebond ── */
.wm-pub-rebound { margin-bottom: 1.2rem; }
.wm-pub-rebound-card {
  display: inline-flex; align-items: center; gap: .75rem; padding: .9rem 1.2rem;
  border: 2px solid var(--wm-border); border-radius: 12px; cursor: pointer; transition: all .15s;
}
.wm-pub-rebound-card input { display: none; }
.wm-pub-rebound-card.wm-selected,
.wm-pub-rebound-card:has(input:checked) { border-color: #5b9bd5; background: #f0f6fc; }
.rebound-icon  { font-size: 1.6rem; }
.rebound-label { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: .9rem; color: var(--wm-dark); }

.wm-pub-rebound-badge { padding: .15rem .5rem; background: #e8f2fc; color: #5b9bd5; border-radius: 10px; font-size: .8rem; }


/* ═══════════════════════════════════════════
   LISTE INVITÉS — Filtres + Tableau
═══════════════════════════════════════════ */

/* ── Filtres ── */
.wm-pub-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.2rem;
  padding: 1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--wm-border);
  border-radius: 12px;
}

.wm-pub-filter-group {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.wm-pub-ftab {
  padding: .4rem 1rem;
  border-radius: 6px;
  border: 1.5px solid var(--wm-border);
  background: #fff;
  color: #888;
  font-family: 'Nunito', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.wm-pub-ftab:hover {
  border-color: var(--wm-rose);
  color: var(--wm-rose);
  background: #fff0f3;
}
.wm-pub-ftab.wm-active {
  background: var(--wm-dark);
  color: #fff;
  border-color: var(--wm-dark);
}

.wm-pub-search-wrap { position: relative; }
.wm-pub-search-wrap::before {
  content: '';
  position: absolute;
  left: .75rem; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23bbb' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center/contain;
}
.wm-pub-search {
  padding: .45rem .8rem .45rem 2.1rem;
  border: 1.5px solid var(--wm-border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: .88rem;
  width: 220px;
  transition: border-color .15s;
  background: #fdf8f2;
}
.wm-pub-search:focus {
  border-color: var(--wm-rose);
  outline: none;
  background: #fff;
}

/* ── Tableau ── */
.wm-pub-table-wrap {
  background: #fff;
  border: 1px solid var(--wm-border);
  border-radius: 12px;
  overflow: hidden;
  overflow-x: auto;
  box-shadow: 0 2px 16px rgba(44,36,32,.05);
}

.wm-pub-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Nunito', sans-serif;
  font-size: .88rem;
}

.wm-pub-table thead tr {
  background: var(--wm-cream);
  border-bottom: 2px solid var(--wm-border);
}
.wm-pub-table th {
  padding: .75rem 1.1rem;
  text-align: left;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #aaa;
  white-space: nowrap;
}

.wm-pub-table td {
  padding: .75rem 1.1rem;
  border-bottom: 1px solid #f5f0eb;
  vertical-align: middle;
  color: var(--wm-dark);
}
.wm-pub-table tbody tr:last-child td { border-bottom: none; }
.wm-pub-table tbody tr { transition: background .1s; }
.wm-pub-table tbody tr:hover { background: #fdf8f2; }

/* Nom */
.wm-pub-td-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--wm-dark);
  white-space: nowrap;
}
.wm-pub-color-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: .55rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Badges présence */
.wm-pub-att-badge {
  display: inline-block;
  padding: .22rem .65rem;
  border-radius: 5px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.wm-pub-att-cocktail { background: #fff3e0; color: #c77b1a; }
.wm-pub-att-dinner   { background: #e8f5e9; color: #2e7d4f; }
.wm-pub-att-both     { background: #fce4ec; color: #b94f6a; }

/* Badge menu */
.wm-pub-meal-badge {
  display: inline-block;
  padding: .22rem .65rem;
  border-radius: 5px;
  font-size: .75rem;
  font-weight: 700;
  border: 1px solid;
  white-space: nowrap;
}

/* Personnes */
.wm-pub-td-pax {
  font-size: .82rem;
  color: #999;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Rebond */
.wm-pub-td-rebound { text-align: center; }
.wm-pub-rebound-yes {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 5px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  background: #e8f2fc;
  color: #3a7abf;
}
.wm-pub-na { color: #ddd; }

/* Lien modifier */
.wm-pub-edit-link {
  font-size: .78rem;
  font-weight: 700;
  color: var(--wm-gold);
  text-decoration: none;
  padding: .2rem .5rem;
  border-radius: 5px;
  border: 1px solid #e8d9a0;
  transition: all .12s;
  white-space: nowrap;
}
.wm-pub-edit-link:hover {
  background: var(--wm-gold);
  color: #fff;
  border-color: var(--wm-gold);
}

/* Footer compteur */
.wm-pub-table tfoot td {
  padding: .6rem 1.1rem;
  font-size: .78rem;
  color: #bbb;
  font-style: italic;
  background: var(--wm-cream);
  border-top: 1px solid var(--wm-border);
}

/* Ligne masquée */
.wm-pub-table tbody tr.wm-hidden { display: none; }

@media (max-width: 540px) {
  .wm-pub-filters { flex-direction: column; align-items: stretch; }
  .wm-pub-search  { width: 100%; }
  .wm-pub-table th:nth-child(4),
  .wm-pub-table td:nth-child(4) { display: none; }
}

/* ── Barre de totaux ── */
.wm-pub-totals {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding: .5rem 0;
}
.wm-pub-total-item {
  display: flex;
  align-items: baseline;
  gap: .35rem;
}
.wm-pub-total-n {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--wm-dark);
  line-height: 1;
  min-width: 1.5ch;
  text-align: right;
  transition: color .2s;
}
.wm-pub-total-l {
  font-family: 'Nunito', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #bbb;
}
.wm-pub-total-sep {
  width: 1px;
  height: 24px;
  background: var(--wm-border);
  flex-shrink: 0;
}

/* Filtre label */
.wm-pub-filter-label {
  font-family: 'Nunito', sans-serif;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #ccc;
  align-self: center;
  white-space: nowrap;
}

/* ── Read-only form ── */
.wm-pub-form-wrap.wm-readonly { background: #fdf8f2; border-color: #c9a84c; }
.wm-readonly-notice {
  text-align: center; padding: .65rem 1rem; margin-bottom: 1.2rem;
  background: #fff8ec; border: 1px solid #e8d58a; border-radius: 8px;
  color: #8a6a10; font-size: .85rem; font-weight: 600;
}
.wm-form-disabled fieldset,
.wm-pub-form-wrap.wm-readonly input,
.wm-pub-form-wrap.wm-readonly textarea,
.wm-pub-form-wrap.wm-readonly select { pointer-events: none; opacity: .6; }
.wm-pub-form-wrap.wm-readonly .wm-pub-att-card,
.wm-pub-form-wrap.wm-readonly .wm-pub-meal-card,
.wm-pub-form-wrap.wm-readonly .wm-pub-rebound-card { pointer-events: none; opacity: .7; }
.wm-pub-form-wrap.wm-readonly .wm-pub-btn-primary { display: none; }

/* ── Groupe public ── */
.wm-pub-td-group {
  font-size: .75rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: #bbb; white-space: nowrap;
}

/* ── Tableau — colonne Modifier fixée à droite ── */
.wm-pub-table-wrap { position: relative; }
.wm-pub-table th:last-child,
.wm-pub-table td:last-child {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -2px 0 6px rgba(44,36,32,.06);
  z-index: 1;
}
.wm-pub-table thead th:last-child { background: var(--wm-cream); }
.wm-pub-table tbody tr:hover td:last-child { background: #fdf8f2; }

/* Réduire taille tableau pour tenir dans la page */
.wm-pub-table { font-size: .82rem; }
.wm-pub-table th,
.wm-pub-table td { padding: .6rem .8rem; }
.wm-pub-td-group { font-size: .7rem; }
