.ecurie-item {
  cursor: pointer;
}

.ecurie-info {
  cursor: pointer;
  flex-grow: 1;
  padding-right: 10px;
}

.remove-ecurie {
  font-weight: bold;
  padding: 4px 8px;
  margin-top: 2px;
  height: auto;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0; /* Empêche le bouton de rétrécir */
}

/* Animation pour la suppression des écuries de la liste carte */
#ecuries-items .ecurie-item {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#ecuries-items .ecurie-item:hover {
  background-color: #f8f9fa;
}

/* Style pour le bouton de suppression */
#ecuries-items .remove-ecurie {
  font-weight: bold;
  padding: 4px 8px;
  margin-top: 2px;
  height: auto;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

#ecuries-items .remove-ecurie:hover {
  background-color: #dc3545;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

#ecuries-items .remove-ecurie:active {
  transform: scale(0.95);
}

#ecuries-items .remove-ecurie i {
  font-size: 1.2rem;
  pointer-events: none;
}

/* Zone cliquable de l'écurie */
#ecuries-items .ecurie-info {
  cursor: pointer;
  flex-grow: 1;
  padding-right: 10px;
}

#ecuries-items .ecurie-info:hover {
  opacity: 0.8;
}


.alert-email-success, .alert-email-error {
  position: relative;
  padding-right: 30px;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.btn-close {
  position: absolute;
  top: 5px;
  right: 5px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 5px;
}

/* ========================================
   PROGRESS TRACKER - VERSION COMPACTE
   ======================================== */

.progress-container {
  margin: 1rem 0 0.5rem 0;
  width: 100%;
}

.progress-tracker {
  position: relative;
  padding: 0.5rem 0;
}

/* Barre de progression horizontale - Plus fine */
.progress-bar-container {
  position: absolute;
  top: 16px;
  left: 5%;
  width: 90%;
  height: 2px;
  background-color: #e9ecef;
  z-index: 1;
}

.progress-bar {
  height: 100%;
  background-color: #0d6efd;
  width: 0%;
  transition: width 0.4s ease-in-out;
}

/* Étapes de progression */
.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  padding: 0;
  margin: 0;
}

.progress-step {
  text-align: center;
  flex: 1;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.progress-step.active {
  opacity: 1;
}

.progress-step.completed {
  opacity: 0.9;
}

.progress-step.completed .step-indicator {
  background-color: #198754;
  border-color: #198754;
  color: white;
}

/* Indicateurs circulaires plus petits */
.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: white;
  border: 2px solid #dee2e6;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  position: relative;
}

.progress-step.active .step-indicator {
  transform: scale(1.1);
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* Labels plus petits */
.step-label {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #6c757d;
  transition: color 0.3s ease;
  line-height: 1.2;
}

.progress-step.active .step-label {
  color: #0d6efd;
  font-weight: 600;
}

.progress-step.completed .step-label {
  color: #198754;
}

/* Responsive */
@media (max-width: 768px) {
  .step-indicator {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    border-width: 2px;
  }
  
  .step-label {
    font-size: 0.6rem;
  }
  
  .progress-bar-container {
    top: 14px;
  }
  
  .progress-tracker {
    padding: 0.4rem 0;
  }
}

@media (max-width: 576px) {
  .step-indicator {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }
  
  .step-label {
    font-size: 0.55rem;
  }
  
  .progress-bar-container {
    top: 12px;
  }
}

/* Animation d'entrée - Plus rapide */
@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress-step {
  animation: fadeInStep 0.3s ease-out backwards;
}

.progress-step:nth-child(1) { animation-delay: 0.03s; }
.progress-step:nth-child(2) { animation-delay: 0.06s; }
.progress-step:nth-child(3) { animation-delay: 0.09s; }
.progress-step:nth-child(4) { animation-delay: 0.12s; }
.progress-step:nth-child(5) { animation-delay: 0.15s; }


/*=================================================*/

.empty-tab {
  min-width: 30px;
  height: 30px;
  padding: 0.5rem;
}

#previewModal .modal-dialog {
  max-width: 95vw !important;
  width: 95vw !important;
  height: 95vh !important;
  margin: 2.5vh auto !important;
}

#previewModal .modal-content {
  height: 100% !important;
  border: none !important;
}

#previewModal .modal-body {
  flex: 1 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#previewModal .preview-content {
  width: 100% !important;
  height: 100% !important;
  overflow: auto !important;
}

[data-controller="editor"]:fullscreen {
  background: white;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
}

.card-header[data-bs-toggle="collapse"] {
  transition: background-color 0.2s ease;
}

.card-header[data-bs-toggle="collapse"]:hover {
  background-color: #e9ecef !important;
}

#newDocumentGroupCard .card {
  border-top: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.transition-icon {
  transition: transform 0.3s ease-in-out;
}

[aria-expanded="false"] .transition-icon {
  transform: rotate(0deg);
}

[aria-expanded="true"] .transition-icon {
  transform: rotate(90deg);
}

.card-header[data-bs-toggle="collapse"] {
  border: 1px solid #dee2e6;
}

.cursor-pointer { cursor: pointer; }
.hover-bg-light:hover { background-color: rgba(248, 249, 250, 0.5) !important; }
.hover-shadow:hover { box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.04) !important; }
.hover-text-primary:hover { color: var(--bs-primary) !important; }
.hover-text-success-emphasis:hover { color: var(--bs-success-text-emphasis) !important; }
.transition-all { transition: all 0.15s ease-in-out; }
.transition-transform { transition: transform 0.15s ease-in-out; }

.icon-circle-subtle {
  background-color: rgba(108, 117, 125, 0.08) !important;
}

.icon-circle-success-subtle {
  background-color: rgba(25, 135, 84, 0.08) !important;
}

.badge-subtle {
  background-color: rgba(25, 135, 84, 0.1) !important;
  color: #198754 !important;
  font-weight: 500 !important;
}

#firefox-pdf-info-banner {
  position: sticky;
  top: 0;
  z-index: 1060;
}

.dropup-menu {
  position: absolute !important;
  bottom: 100% !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  margin-bottom: 2px !important;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1050;
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropup-menu.show {
  display: block !important;
}

.dropdown-item {
  transition: all 0.15s ease-in-out;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: #212529;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.dropdown-item:hover,
.dropdown-item.active {
  background-color: #0d6efd;
  color: white;
}

.dropdown-item:focus {
  background-color: #0d6efd;
  color: white;
  outline: 0;
}

.dropdown-item.disabled {
  color: #6c757d;
  pointer-events: none;
  background-color: transparent;
}

.position-relative {
  position: relative;
}

.commune-container {
  overflow: visible !important;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.badge.bg-info {
  background-color: rgba(13, 202, 240, 0.15) !important;
}

@keyframes pulse-vocal {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.btn.btn-outline-success {
  animation: success-pulse 0.5s ease-in-out;
}

@keyframes success-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5) !important;
  z-index: 1040 !important;
}

.modal {
  z-index: 1050 !important;
}

.modal-dialog {
  z-index: 1055 !important;
}

.modal-content {
  background-color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.modal-header {
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #dee2e6;
}

.modal-body {
  background-color: #ffffff !important;
  padding: 1.5rem;
}

.modal-footer {
  background-color: #f8f9fa !important;
  border-top: 1px solid #dee2e6;
}

.badge.bg-info.bg-opacity-15 {
  background-color: rgba(13, 202, 240, 0.15) !important;
  color: #0dcaf0 !important;
  border: 1px solid rgba(13, 202, 240, 0.3);
}

.badge.bg-success.bg-opacity-15 {
  background-color: rgba(25, 135, 84, 0.15) !important;
  color: #198754 !important;
  border: 1px solid rgba(25, 135, 84, 0.3);
}

.text-primary strong {
  color: #0d6efd !important;
  font-weight: 600;
}

@media (max-width: 768px) {
  .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}

.bi-person-heart {
  color: #e91e63 !important;
}

.dropdown-item.border-0.bg-transparent {
  background: none !important;
  border: none !important;
  text-align: left !important;
  width: 100% !important;
  padding: 0.25rem 1rem !important;
  font-size: inherit !important;
  color: #212529 !important;
  cursor: pointer !important;
}

.dropdown-item.border-0.bg-transparent:hover {
  background-color: #e9ecef !important;
  color: #1e2125 !important;
}

.dropdown-item.border-0.bg-transparent:focus {
  background-color: #e9ecef !important;
  color: #1e2125 !important;
  outline: none !important;
}

.navbar .dropdown-menu {
  z-index: 1060 !important;
}

.navbar {
  z-index: 1055 !important;
}

.card-header[data-bs-toggle="collapse"] {
  z-index: 1000 !important;
}

@keyframes highlightFade {
  0% { background-color: rgba(40, 167, 69, 0.3); }
  100% { background-color: transparent; }
}

@keyframes highlightUpdate {
  0% { background-color: rgba(23, 162, 184, 0.3); }
  100% { background-color: transparent; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.btn-group .btn.active {
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

@keyframes pulseHighlight {
  0% { background-color: rgba(0, 123, 255, 0.1); }
  100% { background-color: transparent; }
}

body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

@media (max-width: 576px) {
  .modal {
    padding-top: 4rem !important;
  }
}

.modal.show {
  z-index: 1055 !important;
  padding-top: 3rem !important;
}

.modal-header {
  position: relative !important;
  z-index: 1060 !important;
}

.modal-dialog {
  z-index: 1055 !important;
  position: relative !important;
  margin-top: 2rem !important;
}

body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

@media (max-width: 768px) {
  .modal {
    padding-top: 1rem !important;
  }
  
  .modal-dialog {
    margin: 1rem auto !important;
    max-width: 95vw !important;
  }
}

.badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  font-weight: 500;
}

.btn-group .btn.active {
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
  position: relative;
  z-index: 1;
}

.btn-warning.btn-sm {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
}

.btn-warning.btn-sm:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.btn-warning.btn-sm i {
  font-size: 0.85rem;
}

@keyframes pulse-success {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); 
  }
  50% { 
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.2); 
  }
}

.badge.bg-success {
  animation: pulse-success 2s ease-in-out infinite;
}

@keyframes pulse-danger {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); 
  }
  50% { 
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3); 
  }
}

.badge.bg-danger {
  animation: pulse-danger 1.5s ease-in-out infinite;
}

.badge.bg-secondary {
  opacity: 0.8;
}

.badge[title] {
  cursor: help;
}

.badge i {
  vertical-align: middle;
  margin-right: 0.25rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-warning[disabled] i.bi-arrow-repeat {
  animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
  .btn-warning.btn-sm {
    padding: 0.1rem 0.3rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {
  .btn-warning.btn-sm {
    margin-top: 0.15rem;
  }
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.03);
  transition: background-color 0.15s ease;
}

tr.conforme {
  border-left: 3px solid #28a745;
}

.dropdown-menu {
  min-width: 200px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item i {
  width: 1.25rem;
  text-align: center;
}

.dropdown-toggle::after {
  margin-left: 0.25rem;
}

@keyframes slideInRow {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.table tbody tr {
  animation: slideInRow 0.3s ease-out;
}

.table tbody tr:nth-child(1) { animation-delay: 0s; }
.table tbody tr:nth-child(2) { animation-delay: 0.05s; }
.table tbody tr:nth-child(3) { animation-delay: 0.1s; }
.table tbody tr:nth-child(4) { animation-delay: 0.15s; }
.table tbody tr:nth-child(5) { animation-delay: 0.2s; }

.nested-fields .card {
  transition: all 0.2s ease;
  border: 2px solid #e9ecef;
}

.nested-fields .card:hover {
  border-color: #0d6efd;
  box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.15);
}

.nested-fields .card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 2px solid #dee2e6;
}

.ligne-number {
  display: inline-block;
  background: #0d6efd;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: bold;
  font-size: 0.9rem;
  min-width: 2rem;
  text-align: center;
}

.nested-fields .form-label i {
  opacity: 0.7;
}

.nested-fields .form-control:focus,
.nested-fields .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.nested-fields [data-ligne-facture-target="totalTtc"] {
  font-size: 1.1rem !important;
  animation: pulse-total 0.3s ease-in-out;
}

@keyframes pulse-total {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.nested-fields hr {
  border-top: 2px dashed #dee2e6;
  opacity: 0.5;
}

.nested-fields .btn-outline-danger:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.nested-fields {
  animation: slideInLine 0.3s ease-out;
}

@keyframes slideInLine {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .nested-fields .row > div {
    margin-bottom: 0.75rem;
  }
  
  .ligne-number {
    font-size: 0.8rem;
    min-width: 1.5rem;
  }
}

.list-group-item-danger .btn-outline-primary {
  white-space: nowrap;
}

.list-group-item-danger:hover {
  background-color: #f8d7da;
}

.list-group-item .btn-outline-primary:hover {
  transform: translateX(5px);
  transition: transform 0.2s ease;
}

#editEntrepriseModal .form-control-lg,
#editEcurieModal .form-control-lg {
  font-size: 1.1rem;
  padding: 0.75rem;
}

#editEntrepriseModal .modal-body,
#editEcurieModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.compact-list { 
  font-size: 0.875rem; 
}

.compact-list .list-group-item { 
  min-height: auto; 
  border-radius: 0.25rem; 
  margin-bottom: 0.25rem; 
  padding: 0.5rem; 
}

.compact-list .document-child-compact, 
.compact-item { 
  border-width: 1px; 
  box-shadow: none; 
  padding: 0.375rem; 
}

.compact-list .icon-circle-subtle, 
.icon-circle-success-subtle { 
  width: 28px; 
  height: 28px; 
  padding: 0.25rem; 
}

.hover-bg-light:hover { 
  background-color: rgba(0,0,0,0.05); 
  transition: background-color 0.2s; 
}

.bg-gradient-compact { 
  background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%); 
}
