/* static/css/insee.css */

/* ===========================
   VARIABLES ET ANIMATIONS
   =========================== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===========================
   LAYOUT PRINCIPAL
   =========================== */
.insee-search-arbre {
  max-width: 1000px;
  margin: 0rem auto;
  padding: 0 2rem;
}

/* ===========================
   FORMULAIRE DE RECHERCHE
   =========================== */

/* Formulaire principal */
.arbre-form {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Ligne principale de recherche */
.form-line {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
}

/* Champs de saisie */
.input-field {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: #a66107;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.input-field::placeholder {
  color: #999;
}

/* Container pour le lieu avec suggestions */
.place-container {
  flex: 2;
  position: relative;
}

.input-lieu {
  width: 100%;
}

/* Bouton rechercher */
.btn-rechercher {
  padding: 10px 24px;
  background: #a66107;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-rechercher:hover {
  background: #ca790f;
}

/* ===========================
   FILTRES
   =========================== */

/* Ligne des filtres */
.filters-line {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-icon {
  font-size: 16px;
  opacity: 0.6;
}

.filter-select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: #a66107;
}

.year-field {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  margin-left: 4px;
}

.btn-reset {
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset:hover {
  background: #f5f5f5;
}

/* ===========================
   DROPDOWN SUGGESTIONS
   =========================== */
.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  min-width: 100%;
  width: max-content;
  margin-top: 2px;
  background: white;
  border: 1px solid #a66107;
  border-radius: 4px;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.suggestions-dropdown.active {
  display: block;
}

.suggestion-item {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
  min-width: max-content;
}

.suggestion-item:hover {
  background: #E3F2FD;
}

.suggestion-item:last-child {
  border-bottom: none;
}

/* ===========================
   COMPTEUR
   =========================== */
.counter-line {
  text-align: center;
  margin: 1rem 0 2rem;
  color: #666;
  font-size: 14px;
}

.counter-line strong {
  color: #333;
  font-weight: 600;
}

/* ===========================
   SECTION RÉSULTATS
   =========================== */
.results-wrapper {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* ===========================
   ONGLETS
   =========================== */
.tabs-header {
  display: flex;
  gap: 2px;
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 10px 20px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.tab-btn.active {
  background: white;
  border-bottom: 1px solid white;
  position: relative;
  z-index: 1;
}

.tab-btn:hover:not(.active) {
  background: #eeeeee;
}

.tab-content {
  background: white;
  border: 1px solid #ddd;
  border-radius: 0 4px 4px 4px;
  padding: 1rem;
  display: none;
}

.tab-content.active {
  display: block;
}

#tab-results {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0rem;
}

/* ===========================
   INFO RÉSULTATS
   =========================== */
.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #9d9d9d6b;
  border-radius: 4px;
  margin-bottom: 0 !important;
  font-size: 14px;
}

.results-count {
  color: #666;
}

.results-count strong {
  color: #333;
  font-weight: 600;
}

.per-page-select {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  margin-left: 4px;
}

.results-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.btn-action:hover {
  background: #f5f5f5;
}

/* ===========================
   TABLEAU DE RÉSULTATS
   =========================== */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 0 !important;
}

#results-table {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.results-table tr {
  transition: none;
}

.results-table th {
  background: #ebebeb;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e0e0e0;
  color: #333;
}

.results-table td {
  padding: 14px 15px;
  border-bottom: 1px solid #f0f0f0;
  color: #555;
  line-height: 1.6;
  position: relative;
}

.results-table strong {
  font-weight: 700;
  color: inherit;
}

/* Bordure entre naissance et décès (lignes impaires) */
.results-table tr:nth-child(odd) td:not([rowspan]) {
  border-bottom: 1px solid #ebebeb;
}

/* Bordure entre chaque personne (lignes paires) */
.results-table tr:nth-child(even) td {
  border-bottom: 2px solid #e0e0e0;
}

/* Pour les cellules avec rowspan, bordure épaisse uniquement */
.results-table td[rowspan="2"] {
  border-bottom: 2px solid #e0e0e0 !important;
}

/* Fond alterné pour chaque PERSONNE */
/* Personnes impaires (1ère, 3ème, 5ème...) = fond normal */
.results-table tbody tr:nth-child(4n-3),
.results-table tbody tr:nth-child(4n-2) {
  background: white;
}

/* Personnes paires (2ème, 4ème, 6ème...) = fond gris léger */
.results-table tbody tr:nth-child(4n-1),
.results-table tbody tr:nth-child(4n) {
  background: #f8f9fa;
}

.gender-icon {
  font-size: 16px;
  margin-left: 4px;
  opacity: 0.7;
}

/* ===========================
   PAGINATION
   =========================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
}

.pagination button {
  min-width: 32px;
  padding: 8px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: none;
}

.pagination button:hover:not(:disabled) {
  background: #dad9d9;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button.active {
  background: #a66107;
  color: white;
  border-color: #000000;
  font-weight: 600;
}

.pagination button.active:hover {
  background: #cc7b10;
}

.pagination-dots {
  padding: 8px 4px;
  color: #999;
  font-weight: normal;
  cursor: default;
}

/* ===========================
   LOADER
   =========================== */
.loader {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top-color: #a66107;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}



/* ===========================
   RESPONSIVE MOBILE COMPLET
   =========================== */

/* Breakpoint principal mobile */
@media (max-width: 768px) {
  
  /* ===========================
     LAYOUT GÉNÉRAL MOBILE
     =========================== */
  .insee-search-arbre {
    padding: 0 0.75rem;
    max-width: 100%;
  }
  
  .results-wrapper {
    padding: 0;
    margin: 1rem 0;
  }
  
  /* ===========================
     FORMULAIRE MOBILE
     =========================== */
  .arbre-form {
    padding: 0.75rem;
    border-radius: 4px;
    box-shadow: none;
    border: none;
    background: #f9f9f9;
  }
  
  /* Ligne principale en colonne */
  .form-line {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
  }
  
  .input-field {
    width: 100%;
    padding: 12px;
    font-size: 16px; /* Évite le zoom iOS */
    border-radius: 6px;
  }
  
  .place-container {
    width: 100%;
  }
  
  .btn-rechercher {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
  }
  
  /* ===========================
     FILTRES MOBILE
     =========================== */
  .filters-line {
    flex-direction: column;
    gap: 10px;
    padding-top: 15px;
  }
  
  .filter-item {
    width: 100%;
    min-width: unset;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .filter-select {
    flex: 1;
    padding: 10px;
    font-size: 15px;
  }
  
  .year-field {
    width: 100px;
    padding: 10px;
    font-size: 15px;
  }
  
  /* Checkbox recherche étendue */
  .filter-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }
  
  .filter-item label {
    font-size: 14px !important;
  }
  
  .btn-reset {
    width: 100%;
    margin: 10px 0 0 0;
    padding: 10px;
    font-size: 14px;
  }
  
  /* ===========================
     SUGGESTIONS DROPDOWN MOBILE
     =========================== */
  .suggestions-dropdown {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
  }
  
  .suggestion-item {
    padding: 12px;
    font-size: 15px;
    white-space: normal;
    word-wrap: break-word;
  }
  
  /* ===========================
     COMPTEUR MOBILE
     =========================== */
  .counter-line {
    font-size: 13px;
    padding: 0 10px;
    line-height: 1.4;
  }
  
  /* ===========================
     INFO RÉSULTATS MOBILE
     =========================== */
  .results-info {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    font-size: 13px;
    align-items: stretch;
    background: #f5f5f5;
    border-radius: 6px;
    margin: 10px;
  }
  
  .results-count {
    text-align: center;
    line-height: 1.6;
  }
  
  .per-page-select,
  #filter-gender {
    padding: 8px;
    font-size: 14px;
    margin: 0 4px;
  }
  
  .results-actions {
    width: 100%;
  }
  
  .btn-action {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
  }
  
  /* ===========================
     TABLEAU MOBILE - CARDS
     =========================== */
  #tab-results {
    padding: 0;
    background: transparent;
    border: none;
  }
  
  #results-table {
    padding: 10px;
  }
  
  /* Masquer le tableau normal */
  .results-table {
    display: none !important;
  }
  
  /* Créer des cards pour mobile */
  .mobile-cards {
    display: block;
  }
  
  .person-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  
  .person-card:nth-child(even) {
    background: #f8f9fa;
  }
  
  .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
  }
  
  .card-gender {
    width: 24px;
    height: 24px;
  }
  
  .card-name {
    flex: 1;
  }
  
  .card-surname {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
  }
  
  .card-firstname {
    font-size: 14px;
    color: #666;
  }
  
  .card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .info-row {
    display: flex;
    padding: 8px;
    background: rgba(0,0,0,0.02);
    border-radius: 4px;
  }
  
  .info-label {
    font-size: 12px;
    color: #999;
    min-width: 70px;
    font-weight: 500;
  }
  
  .info-value {
    font-size: 14px;
    color: #333;
    flex: 1;
  }
  
  .info-value strong {
    color: #000;
    font-weight: 600;
  }
  
  .card-acte {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
    text-align: right;
    font-size: 12px;
    color: #666;
  }
  
  /* ===========================
     PAGINATION MOBILE
     =========================== */
  .pagination {
    padding: 15px 10px;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0;
    font-size: 14px;
    border-radius: 4px;
  }
  
  /* Boutons précédent/suivant plus grands */
  .pagination button:first-child,
  .pagination button:last-child,
  .pagination button:nth-child(2),
  .pagination button:nth-last-child(2) {
    min-width: 44px;
    font-weight: 600;
  }
  
  .pagination-dots {
    padding: 0 2px;
    font-size: 12px;
  }
  
  /* ===========================
     LOADER MOBILE
     =========================== */
  .loader {
    padding: 2rem 1rem;
  }
  
  .loader p {
    font-size: 14px;
  }
  
  .spinner {
    width: 36px;
    height: 36px;
  }
  
  /* ===========================
     INDICATEUR CHARGEMENT MOBILE
     =========================== */
  #background-loading {
    bottom: 10px !important;
    right: 10px !important;
    left: 10px !important;
    padding: 8px 12px !important;
    font-size: 11px !important;
    border-radius: 15px !important;
    text-align: center;
  }
  
  /* ===========================
     ONGLETS MOBILE
     =========================== */
  .tabs-header {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 15px;
    font-size: 14px;
    white-space: nowrap;
  }
  
}

/* ===========================
   PETITS ÉCRANS (< 375px)
   =========================== */
@media (max-width: 374px) {
  .insee-search-arbre {
    padding: 0 0.5rem;
  }
  
  .arbre-form {
    padding: 0.5rem;
  }
  
  .input-field {
    font-size: 15px;
    padding: 10px;
  }
  
  .btn-rechercher {
    font-size: 15px;
  }
  
  .counter-line {
    font-size: 12px;
  }
  
  .card-surname {
    font-size: 15px;
  }
  
  .info-label {
    min-width: 60px;
    font-size: 11px;
  }
  
  .info-value {
    font-size: 13px;
  }
  
  .pagination button {
    min-width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

/* ===========================
   LANDSCAPE MOBILE
   =========================== */
@media (max-width: 768px) and (orientation: landscape) {
  .arbre-form {
    padding: 0.5rem;
  }
  
  .form-line {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .input-field {
    flex: 1;
    min-width: 45%;
  }
  
  .btn-rechercher {
    width: auto;
    min-width: 120px;
  }
  
  .filters-line {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .filter-item {
    flex: 1;
    min-width: 45%;
  }
}

/* ===========================
   TABLETTES (768px - 1024px)
   =========================== */
@media (min-width: 769px) and (max-width: 1024px) {
  .insee-search-arbre {
    padding: 0 1.5rem;
  }
  
  .form-line {
    flex-wrap: wrap;
  }
  
  .input-field {
    min-width: 45%;
  }
  
  .place-container {
    min-width: 60%;
  }
  
  .filters-line {
    flex-wrap: wrap;
  }
  
  /* Tableau adaptatif pour tablettes */
  .results-table {
    font-size: 13px;
  }
  
  .results-table th,
  .results-table td {
    padding: 10px 12px;
  }
}

/* ===========================
   MODE SOMBRE INSEE
   Inspiré du style Morts pour la France
   =========================== */

/* ===========================
   LAYOUT PRINCIPAL
   =========================== */
:root.theme-dark body {
  background: #0f0f0f;
}

:root.theme-dark .insee-search-arbre {
  color: #e0e0e0;
}

/* ===========================
   FORMULAIRE DE RECHERCHE
   =========================== */
:root.theme-dark .arbre-form {
  background: #1a1a1a;
  border-color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

:root.theme-dark .form-line {
  border-top-color: #333;
}

:root.theme-dark .input-field,
:root.theme-dark .filter-select,
:root.theme-dark .year-field {
  background: #2a2a2a;
  border-color: #444;
  color: #fff;
}

:root.theme-dark .input-field:focus,
:root.theme-dark .filter-select:focus {
  border-color: #ff9d00;
  box-shadow: 0 0 0 2px rgba(255, 157, 0, 0.2);
}

:root.theme-dark .input-field::placeholder {
  color: #888;
}

:root.theme-dark .btn-rechercher {
  background: #ff9d00;
  color: #1a1a1a;
  border: none;
}

:root.theme-dark .btn-rechercher:hover {
  background: #ffb233;
}

:root.theme-dark .btn-reset {
  border-color: #444;
  background: #2a2a2a;
  color: #e0e0e0;
}

:root.theme-dark .btn-reset:hover {
  background: #333;
}

/* ===========================
   FILTRES
   =========================== */
:root.theme-dark .filters-line {
  border-top-color: #333;
}

:root.theme-dark .filter-icon {
  color: #b0b0b0;
  opacity: 0.8;
}

/* ===========================
   DROPDOWN SUGGESTIONS
   =========================== */
:root.theme-dark .suggestions-dropdown {
  background: #2a2a2a;
  border-color: #ff9d00;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

:root.theme-dark .suggestion-item {
  border-bottom-color: #333;
  color: #e0e0e0;
}

:root.theme-dark .suggestion-item:hover {
  background: #3a2a00;
}

/* ===========================
   COMPTEUR
   =========================== */
:root.theme-dark .counter-line {
  color: #b0b0b0;
}

:root.theme-dark .counter-line strong {
  color: #ff9d00;
}

/* ===========================
   SECTION RÉSULTATS
   =========================== */
:root.theme-dark .results-wrapper {
  color: #e0e0e0;
}

/* ===========================
   ONGLETS
   =========================== */
:root.theme-dark .tab-btn {
  background: #2a2a2a;
  border-color: #444;
  color: #b0b0b0;
}

:root.theme-dark .tab-btn.active {
  background: #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  color: #ff9d00;
}

:root.theme-dark .tab-btn:hover:not(.active) {
  background: #333;
  color: #e0e0e0;
}

:root.theme-dark .tab-content {
  background: #1a1a1a;
  border-color: #444;
}

:root.theme-dark #tab-results {
  background: #1a1a1a;
  border-color: #444;
}

/* ===========================
   INFO RÉSULTATS
   =========================== */
:root.theme-dark .results-info {
  background: #3a2a00;
  border-color: #444;
}

:root.theme-dark .results-count {
  color: #b0b0b0;
}

:root.theme-dark .results-count strong {
  color: #ff9d00;
}

:root.theme-dark .per-page-select {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

:root.theme-dark #filter-gender {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

:root.theme-dark .btn-action {
  border-color: #ff9d00;
  background: #1a1a1a;
  color: #ff9d00;
}

:root.theme-dark .btn-action:hover {
  background: #ff9d00;
  color: #1a1a1a;
}

/* ===========================
   TABLEAU DE RÉSULTATS
   =========================== */
:root.theme-dark #results-table {
  background: #1a1a1a;
}

:root.theme-dark .results-table {
  background: #1a1a1a;
}

:root.theme-dark .results-table th {
  background: #2a2a2a;
  color: #f0f0f0;
  border-bottom-color: #444;
}

:root.theme-dark .results-table th:hover {
  background: #333;
}

:root.theme-dark .results-table th.sortable::after {
  color: #888;
}

:root.theme-dark .results-table th.sorted-asc::after,
:root.theme-dark .results-table th.sorted-desc::after {
  color: #ff9d00;
}

:root.theme-dark .results-table td {
  color: #ccc;
  border-bottom-color: #333;
}

:root.theme-dark .results-table strong {
  color: #ff9d00;
}

/* Bordures entre personnes */
:root.theme-dark .results-table tr:nth-child(odd) td:not([rowspan]) {
  border-bottom-color: #333;
}

:root.theme-dark .results-table tr:nth-child(even) td {
  border-bottom-color: #444;
}

:root.theme-dark .results-table td[rowspan="2"] {
  border-bottom-color: #444 !important;
}

/* Fond alterné pour chaque personne */
:root.theme-dark .results-table tbody tr:nth-child(4n-3),
:root.theme-dark .results-table tbody tr:nth-child(4n-2) {
  background: #1a1a1a !important;
}

:root.theme-dark .results-table tbody tr:nth-child(4n-1),
:root.theme-dark .results-table tbody tr:nth-child(4n) {
  background: #222 !important;
}

/* ===========================
   PAGINATION
   =========================== */
:root.theme-dark .pagination button {
  border-color: #444;
  background: #2a2a2a;
  color: #e0e0e0;
}

:root.theme-dark .pagination button:hover:not(:disabled) {
  background: #333;
}

:root.theme-dark .pagination button:disabled {
  opacity: 0.3;
  color: #666;
}

:root.theme-dark .pagination button.active {
  background: #ff9d00;
  color: #1a1a1a;
  border-color: #ff9d00;
}

:root.theme-dark .pagination-dots {
  color: #666;
}

/* ===========================
   LOADER
   =========================== */
:root.theme-dark .loader {
  color: #e0e0e0;
}

:root.theme-dark .spinner {
  border-color: #333;
  border-top-color: #ff9d00;
}

/* ===========================
   RESPONSIVE MOBILE - MODE SOMBRE
   =========================== */
@media (max-width: 768px) {
  :root.theme-dark .arbre-form {
    background: #1a1a1a;
    border: none;
  }
  
  :root.theme-dark .results-info {
    background: #2a2a2a;
    border-color: #444;
  }
  
  /* Cards mobile */
  :root.theme-dark .person-card {
    background: #1a1a1a;
    border-color: #444;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  }
  
  :root.theme-dark .person-card:nth-child(even) {
    background: #222;
  }
  
  :root.theme-dark .card-header {
    border-bottom-color: #444;
  }
  
  :root.theme-dark .card-surname {
    color: #f0f0f0;
  }
  
  :root.theme-dark .card-firstname {
    color: #b0b0b0;
  }
  
  :root.theme-dark .info-row {
    background: rgba(255,255,255,0.05);
  }
  
  :root.theme-dark .info-label {
    color: #888;
  }
  
  :root.theme-dark .info-value {
    color: #e0e0e0;
  }
  
  :root.theme-dark .info-value strong {
    color: #ff9d00;
  }
  
  :root.theme-dark .card-acte {
    border-top-color: #444;
    color: #888;
  }
  
  :root.theme-dark #background-loading {
    background: #ff9d00;
    color: #1a1a1a;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  }
}

/* ===========================
   FOCUS ET ACCESSIBILITÉ
   =========================== */
:root.theme-dark *:focus-visible {
  outline-color: #ff9d00;
}


/* ===========================
   FICHE MODALE
   =========================== */
.fiche-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fiche-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.fiche-header {
    background: linear-gradient(135deg, #a66107 0%, #d4831c 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fiche-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.fiche-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.fiche-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fiche-content {
    padding: 30px;
}

.fiche-photo-section {
    text-align: center;
    margin-bottom: 25px;
}

.fiche-photo {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #a66107;
}

.fiche-photo img {
    width: 60px;
    height: 60px;
}

.fiche-identity {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.fiche-identity h3 {
    margin: 0;
    font-size: 28px;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
}

.fiche-identity h4 {
    margin: 8px 0 0;
    font-size: 20px;
    color: #666;
    font-weight: 400;
}

.fiche-details {
    display: grid;
    gap: 20px;
}

.fiche-section {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.fiche-label {
    font-weight: 600;
    color: #a66107;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fiche-value {
    color: #333;
    line-height: 1.6;
}

.fiche-value strong {
    color: #000;
    font-size: 16px;
}

.fiche-value em {
    color: #666;
    font-size: 14px;
}

.fiche-footer {
    padding: 20px;
    background: #f5f5f5;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-fiche-action {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: white;
    color: #333;
    border: 2px solid #ddd;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-fiche-action:hover {
    background: #a66107;
    color: white;
    border-color: #a66107;
}

.btn-fiche-close {
    background: #a66107;
    color: white;
    border-color: #a66107;
}

.btn-fiche-close:hover {
    background: #8a5006;
    border-color: #8a5006;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fiche-modal {
        max-height: 100vh;
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .fiche-header {
        border-radius: 0;
    }
    
    .fiche-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .fiche-footer {
        flex-direction: column;
        border-radius: 0;
    }
    
    .btn-fiche-action {
        width: 100%;
        justify-content: center;
    }
}

/* Mode sombre pour la fiche */
:root.theme-dark .fiche-modal {
    background: #1a1a1a;
    color: #e0e0e0;
}

:root.theme-dark .fiche-header {
    background: linear-gradient(135deg, #ff9d00 0%, #ffb233 100%);
    color: #1a1a1a;
}

:root.theme-dark .fiche-close {
    color: #1a1a1a;
}

:root.theme-dark .fiche-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

:root.theme-dark .fiche-photo {
    background: #2a2a2a;
    border-color: #ff9d00;
}

:root.theme-dark .fiche-identity {
    border-bottom-color: #444;
}

:root.theme-dark .fiche-identity h3 {
    color: #f0f0f0;
}

:root.theme-dark .fiche-identity h4 {
    color: #b0b0b0;
}

:root.theme-dark .fiche-section {
    background: #2a2a2a;
}

:root.theme-dark .fiche-label {
    color: #ff9d00;
}

:root.theme-dark .fiche-value {
    color: #e0e0e0;
}

:root.theme-dark .fiche-value strong {
    color: #fff;
}

:root.theme-dark .fiche-footer {
    background: #2a2a2a;
}

:root.theme-dark .btn-fiche-action {
    background: #333;
    color: #e0e0e0;
    border-color: #444;
}

:root.theme-dark .btn-fiche-action:hover {
    background: #ff9d00;
    color: #1a1a1a;
    border-color: #ff9d00;
}

:root.theme-dark .btn-fiche-close {
    background: #ff9d00;
    color: #1a1a1a;
}

.fiche-id {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
  }
  
  .card-gender {
    width: 24px;
    height: 24px;
  }
  
  .card-name {
    flex: 1;
  }
  
  /* Bouton fiche pour mobile */
  .btn-fiche-mobile {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
  }
  
  .btn-fiche-mobile:hover,
  .btn-fiche-mobile:active {
    background: rgba(166, 97, 7, 0.1);
  }