:root {
  --cdg-bleu: #0d6efd;
}

body {
  font-size: 0.95rem;
}

.navbar-brand span {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card {
  border: 1px solid rgba(0, 0, 0, 0.075);
}

.card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.075);
}

code {
  color: #495057;
  background: #f1f3f5;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.table > :not(caption) > * > * {
  padding: 0.6rem 0.75rem;
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-text {
  font-size: 0.8rem;
}

fieldset:disabled .form-control,
fieldset:disabled .form-select {
  background-color: #f8f9fa;
}

.htmx-request .table {
  opacity: 0.5;
  transition: opacity 150ms;
}

/* --- Grille d'edition des collectivites --- */
#grille input.form-control,
#grille select.form-select {
  border-color: transparent;
  background-color: transparent;
  box-shadow: none;
}

#grille input.form-control:hover,
#grille select.form-select:hover {
  border-color: #dee2e6;
  background-color: #fff;
}

#grille input.form-control:focus,
#grille select.form-select:focus {
  border-color: #0d6efd;
  background-color: #fff;
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.2);
}

td.cellule-ok {
  animation: flash-ok 1.4s ease-out;
}

@keyframes flash-ok {
  from { background-color: #a3cfbb; }
  to { background-color: transparent; }
}

td.cellule-erreur {
  background-color: #f8d7da;
}

/* Zone de defilement : les deux ascenseurs restent visibles a l'ecran */
.grille-zone {
  max-height: calc(100vh - 340px);
  min-height: 300px;
  overflow: auto;
  overscroll-behavior: contain;
}

#grille {
  font-size: 0.82rem;
}

#grille input.form-control-sm,
#grille select.form-select-sm {
  font-size: 0.82rem;
  padding: 0.15rem 0.3rem;
}

/* Le padding ci-dessus ecrase celui que Bootstrap reserve a droite pour la
   fleche du <select> (image de fond) : sans cet espace, la fleche se
   superpose au texte. On le restaure uniquement pour les select. */
#grille select.form-select-sm {
  padding-right: 1.75rem;
}

/* En-tete fige en haut */
#grille thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background-color: #f8f9fa;
}

/* Grille des agents (cote collectivite) : meme confort de saisie que la
   grille des collectivites, mais SANS colonnes figees. Matricule et
   Origine ne sont pas des donnees que la collectivite doit garder sous
   les yeux en permanence en scrollant. */
#grille-agents-table {
  font-size: 0.82rem;
}

#grille-agents-table input.form-control-sm,
#grille-agents-table select.form-select-sm {
  font-size: 0.82rem;
  padding: 0.15rem 0.3rem;
}

#grille-agents-table select.form-select-sm {
  padding-right: 1.75rem;
}

#grille-agents-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background-color: #f8f9fa;
}

/* Colonnes Code et Agents figees a gauche */
#grille th:nth-child(1),
#grille td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: #f1f3f5;
}

#grille th:nth-child(2),
#grille td:nth-child(2) {
  position: sticky;
  left: 90px;
  z-index: 2;
  background-color: #f1f3f5;
  box-shadow: 2px 0 4px -2px rgba(0, 0, 0, 0.15);
}

#grille thead th:nth-child(1),
#grille thead th:nth-child(2) {
  z-index: 4;
  background-color: #e9ecef;
}
