/* =========================================
   STYLE DU TABLEAU GLOBAL - AÉRÉ & LISIBLE
   ========================================= */
table.views-table {
  width: auto;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  
  background-color: #ffffff;
}

/* =========================================
   ✅ TITRES DES COLONNES - FOND BLEU MARINE + TEXTE BLANC
   ========================================= */
table.views-table thead th {
  text-align: left;
  padding: 12px 16px;
  
  background: #1a2644 !important;
  color: #ffffff !important;
  
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  
  white-space: nowrap !important;
  line-height: 1.3;
  vertical-align: middle;
  
  min-width: 120px;
  
  border-bottom: none !important;
  border-right: 1px solid #243356 !important;
}

table.views-table thead th:last-child {
  border-right: none !important;
}

/* ✅ LIENS DANS LES EN-TÊTES - BLANC + SOULIGNEMENT JAUNE */
table.views-table thead th a {
  color: #ffffff !important;
  text-decoration: underline !important;
  text-decoration-color: #ffcd01 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

table.views-table thead th a:hover {
  color: #ffcd01 !important;
  text-decoration-color: #ffcd01 !important;
}

/* =========================================
   CELLULES DU CORPS - AÉRÉ & LISIBLE
   ========================================= */
table.views-table tbody td {
  padding: 12px 16px;
  
  border: none;
  border-bottom: 1px solid #e2e8f0 !important;
  
  text-align: left;
  color: #334155 !important;
  vertical-align: middle;
  
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  
  min-width: 140px;
  
  font-size: 13px;
  line-height: 1.5;
  
  transition: background-color 0.15s ease;
}

table.views-table tbody tr:last-child td {
  border-bottom: none !important;
}

/* =========================================
   EFFET HOVER SUR LES RANGÉES
   ========================================= */
table.views-table tbody tr {
  transition: background-color 0.15s ease;
}

table.views-table tbody tr:hover {
  background-color: #f8fafc !important;
}

/* =========================================
   ✅ LIENS DANS LES CELLULES
   ✅ :not(.btn) EXCLUT TOUS LES BOUTONS BOOTSTRAP
   ========================================= */

table.views-table td a:not(.btn):not(.delete-row) {
  color: #1a2644 !important;
  text-decoration: underline !important;
  text-decoration-color: #ffcd01 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

table.views-table td a:not(.btn):not(.delete-row):hover {
  color: #ffcd01 !important;
  text-decoration: underline !important;
  text-decoration-color: #ffcd01 !important;
  text-decoration-thickness: 2px !important;
  background-color: rgba(255, 205, 1, 0.08) !important;
  border-radius: 3px !important;
}

table.views-table td a:not(.btn):not(.delete-row):visited {
  color: #475569 !important;
  text-decoration-color: #ffcd01 !important;
  text-decoration-thickness: 2px !important;
}

table.views-table td a:not(.btn):not(.delete-row):visited:hover {
  color: #ffcd01 !important;
  text-decoration-color: #ffcd01 !important;
}

table.views-table td a:not(.btn):not(.delete-row):focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255, 205, 1, 0.4) !important;
  border-radius: 3px !important;
}

/* ✅ Liens "Supprimer" en rouge */
table.views-table td a:not(.btn)[href*="/delete"],
table.views-table td a:not(.btn)[href*="delete"] {
  color: #dc2626 !important;
  text-decoration-color: #fca5a5 !important;
  text-decoration-thickness: 2px !important;
}

table.views-table td a:not(.btn)[href*="/delete"]:hover,
table.views-table td a:not(.btn)[href*="delete"]:hover {
  color: #991b1b !important;
  text-decoration-color: #991b1b !important;
}

/* ✅ Liens "Désactiver" en orange */
table.views-table td a:not(.btn)[href*="/disable"] {
  color: #ea580c !important;
  text-decoration-color: #fdba74 !important;
  text-decoration-thickness: 2px !important;
}

table.views-table td a:not(.btn)[href*="/disable"]:hover {
  color: #c2410c !important;
  text-decoration-color: #c2410c !important;
}

/* =========================================
   ✅ SÉLECTEURS (inputs, selects, textareas)
   ========================================= */
table.views-table input:not([type="submit"]):not([type="button"]),
table.views-table select,
table.views-table textarea {
  background-color: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  transition: all 0.15s ease !important;
}

table.views-table input:not([type="submit"]):not([type="button"]):hover,
table.views-table select:hover,
table.views-table textarea:hover {
  border-color: #1a2644 !important;
}

table.views-table input:not([type="submit"]):not([type="button"]):focus,
table.views-table select:focus,
table.views-table textarea:focus {
  outline: none !important;
  border-color: #ffcd01 !important;
  box-shadow: 0 0 0 2px rgba(255, 205, 1, 0.2) !important;
}

table.views-table input[type="checkbox"],
table.views-table input[type="radio"] {
  width: 16px !important;
  height: 16px !important;
  cursor: pointer !important;
  accent-color: #1a2644 !important;
}

/* =========================================
   BOUTON SUPPRESSION
   ========================================= */
.delete-row {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 6px !important;
  font-weight: 600;
  font-size: 11px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.delete-row:hover {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}

.delete-row:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* =========================================
   MESSAGE VIDE
   ========================================= */
.empty-message {
  text-align: center;
  font-style: italic;
  color: #64748b !important;
  padding: 32px 24px;
  font-size: 13px;
  background-color: #f8fafc !important;
  border-radius: 8px;
}

/* =========================================
   ENTÊTE FIXE (STICKY CLONE)
   ========================================= */
.sticky-clone {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  background: #ffffff;
  border-collapse: separate;
  border-spacing: 0;
  pointer-events: none;
  border-radius: 8px !important;
  overflow: hidden;
}

.sticky-clone thead th {
  background: #1a2644 !important;
  color: #ffffff !important;
  position: static !important;
  top: auto !important;
  z-index: 1200 !important;
  padding: 12px 16px;
  white-space: nowrap !important;
  line-height: 1.3;
  vertical-align: middle;
  min-width: 120px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: none !important;
  border-right: 1px solid #243356 !important;
}

.sticky-clone thead th:last-child {
  border-right: none !important;
}

.sticky-clone thead th a {
  color: #ffffff !important;
  text-decoration: underline !important;
  text-decoration-color: #ffcd01 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

.sticky-clone thead th a:hover {
  color: #ffcd01 !important;
  text-decoration-color: #ffcd01 !important;
}

/* =========================================
   TOOLBAR ADMIN
   ========================================= */
.admin-toolbar + .sticky-clone {
  top: 32px;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  table.views-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  table.views-table th,
  table.views-table td {
    padding: 10px 14px;
    font-size: 12px;
    min-width: 140px;
  }
}