/* ============================================================
   FQSG — Fédération Québécoise des Sociétés de Généalogie
   Thème clair pour le site d'avis de décès
   ============================================================ */

/* --- Variables --- */
:root {
  --navy:         #1a3663;
  --navy-light:   #2a4a7f;
  --steel:        #569AB8;
  --steel-light:  #7ab5cc;
  --mauve:        #ab3c83;
  --mauve-hover:  #be5999;
  --mauve-bg:     rgba(171, 60, 131, 0.08);
  --mauve-border: rgba(171, 60, 131, 0.2);
  --turquoise:    #0ca3a3;
  --turquoise-hover: #0fb8b8;
  --white:        #ffffff;
  --page-bg:      #f5f6f8;
  --card-bg:      #ffffff;
  --border:       #e0e3e8;
  --border-light: #ebebeb;
  --text:         #1a3663;
  --text-secondary: #6b7a8f;
  --text-muted:   #8a94a6;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-btn:   50px;
  --shadow:       0 1px 3px rgba(26, 54, 99, 0.08);
  --shadow-md:    0 2px 8px rgba(26, 54, 99, 0.10);
  --font:         'Outfit', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.container-wide {
  max-width: 900px;
}

.container-narrow {
  max-width: 600px;
}

/* --- Typography --- */
h1 {
  color: var(--navy);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

h2 {
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--mauve);
  display: inline-block;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

a {
  color: var(--steel);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--mauve);
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* --- Back link --- */
.back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.back:hover {
  color: var(--mauve);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.2rem;
}

label, .field-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(86, 154, 184, 0.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7a8f' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 45px;
  padding: 0 30px;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--mauve);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--mauve-hover);
  color: var(--white);
}

.btn-secondary {
  background: var(--turquoise);
  color: var(--white);
}
.btn-secondary:hover {
  background: var(--turquoise-hover);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  height: 36px;
  padding: 0 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}
.btn-outline:hover {
  border-color: var(--steel);
  color: var(--steel);
}

.btn-sm {
  height: 34px;
  padding: 0 16px;
  font-size: 0.85rem;
}

/* --- Search form (index & search pages) --- */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.main-row {
  display: flex;
  gap: 0.6rem;
}

.main-row input[type="text"] {
  flex: 1;
  font-size: 1.1rem;
  padding: 0.85rem 1.25rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  width: 100%;
}

.filters-row > label {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.filters-row > label span {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.7rem;
  font-weight: 500;
}

.search-tip {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.search-tip strong {
  color: var(--text-secondary);
}

/* --- Date picker wrapper --- */
.date-wrapper {
  display: flex;
  flex: 1;
  position: relative;
  min-width: 140px;
}

.date-wrapper input[type="text"] {
  flex: 1;
  border-radius: 10px 0 0 10px;
  min-width: 0;
  font-size: 0.9rem;
  padding: 0.75rem 0.75rem;
}

.calendar-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: none;
  padding: 0 0.6rem;
  border-radius: 0 10px 10px 0;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  transition: color 0.2s, border-color 0.2s;
}
.calendar-btn:hover {
  color: var(--steel);
  border-color: var(--steel);
}

.date-picker-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* --- Results --- */
.result-count {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow);
}
.result-card:hover {
  border-color: var(--mauve);
  box-shadow: var(--shadow-md);
}
.result-card a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.result-nom {
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 600;
}

.result-source {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.15rem;
  font-style: italic;
}

.result-dates {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination a {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
}
.pagination a:hover {
  border-color: var(--mauve);
  color: var(--mauve);
}

.pagination .current {
  background: var(--mauve);
  color: var(--white);
  border: 1px solid var(--mauve);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- Detected badge (NLP detection) --- */
.detected-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--mauve-bg);
  border: 1px solid var(--mauve-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.detected-label {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}

.detected-nom {
  color: var(--mauve);
  font-weight: 600;
}

.detected-sep {
  color: var(--border);
}

.detected-prenom {
  color: var(--text);
}

/* --- Detail page --- */
.photo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.photo img {
  max-width: 100%;
  max-height: 350px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

h1 .prenom {
  font-weight: 400;
  color: var(--text-secondary);
}

.field {
  margin-bottom: 1rem;
}

.field-value {
  color: var(--text);
  font-size: 1.05rem;
  margin-top: 0.2rem;
}

.texte {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
  line-height: 1.6;
  white-space: pre-wrap;
  font-size: 0.95rem;
  max-height: 500px;
  overflow-y: auto;
  color: var(--text);
}

.parents {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.parents div {
  margin-bottom: 0.25rem;
}
.parents div:last-child {
  margin-bottom: 0;
}

.famille-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.famille-tag {
  background: var(--mauve-bg);
  border: 1px solid var(--mauve-border);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
}

.avis-lie {
  color: var(--mauve);
  text-decoration: none;
  font-weight: 500;
}
.avis-lie:hover {
  text-decoration: underline;
  color: var(--mauve-hover);
}

/* --- Meta & exports bar --- */
.meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta a {
  color: var(--text-secondary);
  text-decoration: none;
}
.meta a:hover {
  color: var(--mauve);
}

.meta .signaler {
  color: var(--text-muted);
}
.meta .signaler:hover {
  color: var(--mauve);
}

/* --- Export buttons in detail --- */
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: border-color 0.2s, color 0.2s;
}
.btn-export:hover {
  border-color: var(--steel);
  color: var(--steel);
}

/* --- Signaler/Merge confirmation --- */
.confirme {
  text-align: center;
  padding: 2rem;
}

.confirme h2 {
  color: var(--turquoise);
  font-size: 1.3rem;
  border-bottom: none;
  padding-bottom: 0;
}

.confirme p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* --- Error message --- */
.erreur {
  color: #c0392b;
  background: #fdecea;
  border: 1px solid #e74c3c44;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* --- Danger button --- */
.btn-danger {
  background: #c0392b;
  color: var(--white);
}
.btn-danger:hover {
  background: #e74c3c;
  color: var(--white);
}

/* --- Stat value color variants --- */
.stat-val-attente {
  color: #b8780a;
}
.stat-val-demandes {
  color: var(--mauve);
}

/* --- Utility spacing --- */
.hidden { display: none; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.text-secondary { color: var(--text-secondary); }

/* --- No-results message --- */
.no-results {
  color: var(--text-secondary);
}

/* --- Count (index) --- */
.count {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .container {
    padding: 1.5rem 1rem;
  }
  h1 {
    font-size: 1.5rem;
  }
  .main-row {
    flex-direction: column;
  }
  .card {
    padding: 1.25rem;
  }
  .meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   ADMIN PAGES — commun (tabs, tables, stats, badges)
   ============================================================ */

/* --- Stats row --- */
.stats {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
  min-width: 120px;
}

.stat-val {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.15rem;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-bottom: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--navy);
  background: rgba(26, 54, 99, 0.04);
}

.tab.actif {
  color: var(--mauve);
  background: var(--white);
  border-color: var(--border);
  border-bottom-color: var(--white);
  font-weight: 600;
}

.tab .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--border);
  color: var(--text-secondary);
}

.tab.actif .badge {
  background: var(--mauve-bg);
  color: var(--mauve);
}

/* --- Admin table --- */
.table-admin {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-admin th {
  text-align: left;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 0.75rem;
  background: #f8f9fb;
  border-bottom: 2px solid var(--border);
  font-weight: 500;
}

.table-admin td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.92rem;
  vertical-align: top;
  color: var(--text);
}

.table-admin tbody tr:hover td {
  background: #f8f9fb;
}

.table-admin tbody tr:last-child td {
  border-bottom: none;
}

/* --- Table cell types --- */
.type-modification {
  display: inline-block;
  background: #fef3e2;
  color: #b8780a;
  border: 1px solid #f0d89d;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.type-retrait {
  display: inline-block;
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #e8b4b4;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.description-cell {
  color: var(--text-secondary);
  min-width: 220px;
  max-width: 380px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.45;
  vertical-align: top;
}

.date-cell {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.email-cell {
  color: var(--steel);
  font-size: 0.85rem;
}

.avis-link {
  color: var(--mauve);
  text-decoration: none;
  font-weight: 500;
}
.avis-link:hover {
  text-decoration: underline;
  color: var(--mauve-hover);
}

/* --- Action buttons in table --- */
.actions-cell {
  white-space: nowrap;
  vertical-align: top;
}
.actions-cell form {
  display: inline;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* --- Doublon badge --- */
.doublon {
  display: inline-block;
  background: #fef3e2;
  color: #b8780a;
  border: 1px solid #f0d89d;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
.doublon a {
  color: #8b6914;
  text-decoration: underline;
  font-weight: 500;
}
.doublon a:hover {
  color: #b8780a;
}

/* --- Status badge --- */
.statut-badge {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8f9fb;
  line-height: 1.4;
  font-size: 0.85rem;
  color: var(--text);
  margin: 0.15rem 0;
}
.statut-badge .date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.3rem;
}

/* --- Admin empty state --- */
.vide {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

/* ============================================================
   FUSIONNER PAGE
   ============================================================ */

/* --- Diff info banner --- */
.diff-info {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.diff-info span {
  color: var(--text-secondary);
}
.diff-info strong {
  color: var(--navy);
}

/* --- Legend --- */
.legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.legend .dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}
.legend .dot.dot-new {
  background: var(--mauve);
}
.legend .dot.dot-old {
  background: var(--turquoise);
}

/* --- Source tags --- */
.source-tags {
  margin-bottom: 0.6rem;
  padding: 0.2rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.source-tag {
  display: inline-block;
  background: #eef2f7;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
  font-size: 0.73rem;
}

/* --- Fusion columns --- */
.fusion-columns {
  display: flex;
  gap: 0;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.fusion-col {
  min-width: 0;
}
.fusion-col-header {
  padding: 0.7rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.fusion-col-labels .fusion-col-header {
  background: #f0f2f5;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  text-align: right;
}
.fusion-col-nouveau .fusion-col-header {
  background: var(--mauve-bg);
  color: var(--mauve);
  border-right: 1px solid var(--border);
}
.fusion-col-doublon .fusion-col-header {
  background: rgba(12, 163, 163, 0.06);
  color: var(--turquoise);
}
.fusion-col-choix .fusion-col-header {
  background: #f8f9fb;
  color: var(--text-secondary);
}

.fusion-col-sub {
  font-weight: 300;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.fusion-col-body {
  background: var(--white);
}

.fusion-row {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--border-light);
  min-height: 2.6rem;
}
.fusion-row:last-child {
  border-bottom: none;
}

/* Labels column */
.fusion-col-labels .fusion-row {
  justify-content: flex-end;
  padding: 0.45rem 0.7rem 0.45rem 0.4rem;
  border-right: 1px solid var(--border);
}
.fusion-label-text {
  font-size: 0.73rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Value cells */
.fusion-col-nouveau .fusion-row,
.fusion-col-doublon .fusion-row {
  padding: 0.45rem 0.8rem;
}
.fusion-val {
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
  color: var(--text);
}
.fusion-val.empty {
  color: var(--text-muted);
  font-style: italic;
}

/* Chooser column */
.fusion-col-choix .fusion-row {
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.3rem;
  background: #f8f9fb;
}
.fusion-col-choix .fusion-row label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 2px solid transparent;
  font-size: 0.8rem;
  transition: all 0.15s;
  min-width: 2.8rem;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  margin-bottom: 0;
}
.fusion-col-choix .fusion-row label:hover {
  filter: brightness(0.95);
}
.fusion-col-choix .fusion-row input[type="radio"] {
  display: none;
  width: auto;
}

.pick-new {
  background: var(--mauve-bg);
  color: var(--mauve);
  border-color: var(--mauve-border) !important;
}
.pick-new:has(input:checked) {
  border-color: var(--mauve) !important;
  background: rgba(171, 60, 131, 0.15) !important;
}

.pick-old {
  background: rgba(12, 163, 163, 0.06);
  color: var(--turquoise);
  border-color: rgba(12, 163, 163, 0.2) !important;
}
.pick-old:has(input:checked) {
  border-color: var(--turquoise) !important;
  background: rgba(12, 163, 163, 0.12) !important;
}

/* --- Text section --- */
.texte-section {
  margin-top: 1.5rem;
}
.texte-section .bar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.texte-section .bar span {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}
.texte-section .bar button {
  background: var(--white);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.2s, color 0.2s;
}
.texte-section .bar button:hover {
  border-color: var(--steel);
  color: var(--steel);
}
.texte-section textarea {
  min-height: 200px;
}

/* --- Fusion actions --- */
.fusion-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 45px;
  padding: 0 30px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font);
  text-decoration: none;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s;
}
.btn-cancel:hover {
  border-color: var(--steel);
  color: var(--steel);
}

/* ============================================================
   REVISER PAGE
   ============================================================ */

/* --- Split layout --- */
.split {
  display: flex;
  gap: 1.5rem;
}

/* --- Panels --- */
.panel {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-width: 0;
  box-shadow: var(--shadow);
}
.panel h3 {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.panel.original h3 {
  color: var(--text-muted);
}
.panel.edition h3 {
  color: var(--mauve);
}

/* --- Read-only field value --- */
.panel.original .field-value {
  background: #f8f9fb;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 2.2rem;
  color: var(--text);
}
.panel.original .field-value.texte {
  max-height: 400px;
  overflow-y: auto;
}

/* --- Edition form inputs --- */
.panel.edition input[type="text"],
.panel.edition textarea {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
}
.panel.edition textarea {
  min-height: 100px;
}

/* --- Demande card --- */
.demande {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.demande-label {
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}
.demande-texte {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.demande-type {
  display: inline-block;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.demande-type.modification {
  background: #fef3e2;
  color: #b8780a;
  border: 1px solid #f0d89d;
}
.demande-type.retrait {
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #e8b4b4;
}

/* --- Demande contact --- */
.demande-contact {
  margin-top: 0.5rem;
  color: var(--steel);
  font-size: 0.85rem;
}

/* --- Photo retirer section --- */
.photo-retirer {
  border-color: #e8b4b4;
  background: #fef5f5;
}
.photo-retirer-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #c0392b;
  font-size: 0.85rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
.photo-retirer-label input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
}
.photo-file-input {
  width: 100%;
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
}

/* --- Monospace field value --- */
.field-value-mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  word-break: break-all;
}

/* --- Edition hint --- */
.edition-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* --- Reviser actions --- */
.reviser-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* --- Photo section in reviser --- */
.photo-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
  background: #f8f9fb;
  margin-bottom: 1rem;
}
.photo-section label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #c0392b;
  font-size: 0.85rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
.photo-section label input[type="checkbox"] {
  width: auto;
}

/* --- Responsive admin --- */
@media (max-width: 1100px) {
  .fusion-columns {
    flex-direction: column;
  }
  .fusion-col-labels .fusion-row {
    border-right: none;
  }
}

@media (max-width: 900px) {
  .split {
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .stats {
    flex-direction: column;
  }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .table-admin {
    font-size: 0.85rem;
  }
  .table-admin th,
  .table-admin td {
    padding: 0.5rem 0.5rem;
  }
}
/* Source filter */
.source-filter {
  width: 100%;
}
#source-select {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  min-height: 2.2rem;
  padding: 0.4rem 0.75rem;
  opacity: 0.85;
}
#source-select option:disabled {
  display: none;
}
/* Avis retiré */
.retrait-notice {
  text-align: center;
  padding: 3rem 1.5rem;
}
.retrait-notice h2 {
  font-size: 1.3rem;
  color: var(--mauve, #ab3c83);
  margin-bottom: 0.75rem;
  border: none;
}
.retrait-notice p {
  color: var(--text-secondary, #555);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.retrait-notice .retrait-date {
  font-size: 0.85rem;
  color: var(--text-muted, #999);
  margin-top: 1rem;
}
