body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 10px;
  padding: 0;
  margin-top: 60px;
  background-color: #f5f5f5;
}

.table-container {
  overflow-x: auto;
  margin: 10px 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: white;
  overflow-y: auto;
  max-height: 790px;
}

table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

th {
  background-color: gray;
  font-size: 90%;
  color: white;
  font-weight: 600;
  padding: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #dee2e6;
}

td {
  padding: 0;
  border: 1px solid #dee2e6;
}

td .input-container {
  position: relative;
  width: 100%;
}

td input,
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  box-sizing: border-box;
  border: 1px solid transparent;
  background-color: transparent;
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
}

td input:hover {
  background-color: #f8f9fa;
}

td input:focus {
  border-color: #007bff;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

tr:nth-child(even) {
  background-color: #f8f9fa;
}

tr:hover {
  background-color: #f2f2f2;
}

.button-container {
  bottom: 20px;
  right: 30px;
  display: flex;
  gap: 15px;
  z-index: 1000;
}

.story-button {
  background-color: #6e706e;
  color: white;
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.story-button:hover {
  background-color: #202020;
}

.export-button {
  background-color: #4caf50;
  white-space: nowrap;
  color: white;
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.export-button:hover {
  background-color: #45a049;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1010;
  border-radius: 6px;
  overflow: hidden;
  top: 100%;
  left: 0;
  margin-top: 5px;
  cursor: pointer;
}

.dropdown-item {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

#excelDropdownMenu a:hover {
  background-color: rgb(241, 241, 241);
  color: #ff7f50;
}

.dropdown-item:hover {
  background-color: #f1f1f1;
}

.show {
  display: block;
}

.loading {
  opacity: 0.7;
  cursor: wait;
}

.status-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 6px;
  font-weight: 500;
  z-index: 1100;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.status-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

.loading .spinner {
  display: inline-block;
}

/* Style personnalisé pour le select sans bordure */
.custom-select {
  border: none;
  padding: 8px 12px;
  background-color: transparent;
  font-size: 14px;
  appearance: none;
  align-items: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  cursor: pointer;
}

.content-bar {
  height: 50px;
  display: flex;
  align-items: center;
}

.content-bar input {
  width: 80%;
  padding: 18px;
  height: 24px;
  border: 1px solid #dee2e6;
  font-size: 14px;
  outline: none;
}

/* Style pour les icônes de tri */
.sort-icon {
  position: absolute;
  right: 5px;
  display: inline-block;
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.sort-icon.active {
  opacity: 1;
}

/* Style pour les filtres */
.filter-container {
  position: absolute;
  top: 100%;
  /* left: 0; */
  background: white;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
  min-width: 200px;
  padding: 10px;
  border-radius: 4px;
}

.filter-container input {
  width: 100%;
  padding: 5px;
  margin-bottom: 5px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.filter-container button {
  margin: 5px;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #007bff;
  color: white;
}

.filter-container button.clear {
  background-color: #6c757d;
}

/* Icône de filtre */
.filter-icon {
  position: absolute;
  right: 25px;
  display: inline-block;
  width: 16px;
  height: 16px;
  opacity: 0.5;
  cursor: pointer;
}

.filter-icon.active {
  opacity: 1;
  color: #007bff;
}

/* Style pour les cellules filtrées */
tr.filtered {
  display: none;
}

/* Positionnement du filtre actif */
th.filtered::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #007bff;
}

.column-filter {
  width: 80%;
  padding: 4px;
  margin: 2px 0;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
  box-sizing: border-box;
}
.sort-icon {
  position: relative;
  cursor: pointer;
}

.tooltip {
  visibility: hidden;
  position: absolute;
  background-color: #333;
  color: white;
  padding: 3px 3px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.2s;
}

.tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}

.sort-icon:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.sort-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.sort-icon:hover {
  color: #ff7f50;
}

th.sort-asc .sort-icon::after {
  content: "↑";
  color: white;
  font-weight: bold;
}

th.sort-desc .sort-icon::after {
  content: "↓";
  color: white;
  font-weight: bold;
}

th:not(.sort-asc):not(.sort-desc) .sort-icon::after {
  content: "⇕";
}

input.updated {
  animation: highlightUpdate 1s ease-out;
}

@keyframes highlightUpdate {
  0% {
    background-color: #c8e6c9;
  }

  100% {
    background-color: transparent;
  }
}

.row-validated input,
.row-validated select {
  background-color: #f8f9fa;
  border: none;
  cursor: not-allowed;
}

.btn-valider.validated {
  background: none;
  border: none;
  padding: 0;
  cursor: not-allowed;
}

.btn-valider {
  background-color: #4caf50;
  color: white;
  padding: 6px 12px;
  border: none;
  width: 70%;
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
}

.btn-valider:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.validated {
  background-color: #85ee8e !important;
}

.btn-valider:hover {
  background-color: #45a049;
}

.btn-valider.validated {
  background-color: #2196f3;
  cursor: default;
}

.btn-valider.validated svg {
  width: 20px;
  height: 20px;
  stroke: white;
  color: green;
}

/* Style pour les inputs désactivés */
input:disabled {
  background-color: #f5f5f5;
  color: #666;
  border: none;
}

.date-facture::placeholder {
  color: #45a049;
  opacity: 1;
}

/* Animation d'entrée pour la modale */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Style pour la modale */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 20px;
  border-radius: 5px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
  color: #2c3e50;
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #475569;
}

.form-group {
  margin-bottom: 15px;
  margin-top: 20px;
}

.select-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.select-group {
  flex: 1;
  min-width: 0;
}

.select-group label {
  display: block;
  margin-bottom: 5px;
}

.search-container {
  display: flex;
  gap: 10px;
}

.search-container input,
.search-container select {
  flex-grow: 1;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: #475569;
  margin-bottom: 0.25rem;
}

.form-group select,
.form-group input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.7rem;
  background-color: #f8fafc;
}

.form-group select:focus,
.form-group input[type="text"]:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.radio-group {
  display: flex;
  gap: 15px;
}

.radio-group label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  cursor: pointer;
}

.radio-group input[type="radio"] {
  margin-right: 0.25rem;
  accent-color: #3b82f6;
}

.code-display-container input {
  text-align: center;
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 1px;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem;
  width: 100%;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-generer {
  background-color: #4caf50;
  color: white;
}

.btn-generer:hover {
  background-color: #4e6088;
}

.btn-cancel {
  background-color: #8f8989;
  color: white;
}

.btn-cancel:hover {
  background-color: #524e4e;
}

.btn-search {
  background-color: #2196f3;
  color: white;
}

.btn-search:hover {
  background-color: #0d5692;
}

/* Style pour les tableaux de clients (principal et résultats de recherche) */
.search-results-table,
.clients-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-family: inherit;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

/* En-têtes des tableaux */
.search-results-table thead th,
.clients-table th {
  background-color: #2c3e50;
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
}

/* Lignes des tableaux */
.search-results-table tbody tr,
.clients-table tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.2s ease;
}

/* Effet au survol des lignes */
.search-results-table tbody tr:hover,
.clients-table tr:hover {
  background-color: #f1f5f9;
}

/* Style alterné pour les lignes (meilleure lisibilité) */
.search-results-table tbody tr:nth-child(even),
.clients-table tr:nth-child(even) {
  background-color: #f8fafc;
}

/* Cellules des tableaux */
.search-results-table td,
.clients-table td {
  padding: 8px 12px;
  vertical-align: middle;
  font-size: 0.75rem;
  color: #475569;
}

/* Style du bouton Sélectionner dans le tableau de résultats */
.btn-select {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 0.7rem;
  font-weight: 500;
}

.btn-select:hover {
  background-color: #2563eb;
}

/* Style pour le message de recherche */
.search-message {
  margin: 15px 0;
  padding: 12px;
  background-color: #f1f5f9;
  border-left: 4px solid #3b82f6;
  color: #475569;
  font-size: 0.875rem;
  border-radius: 0 6px 6px 0;
}

/* Style pour les champs d'entrée dans le tableau principal */
.clients-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.75rem;
  background-color: #f8fafc;
  transition: all 0.2s;
}

.clients-table input:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Style pour les boutons dans le tableau principal */
.clients-table .btn-valider {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.clients-table .btn-valider:hover {
  background-color: #3d8b40;
}

.clients-table .btn-valider:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

/* Container pour les résultats de recherche dans la modale */
.search-results {
  max-height: 250px;
  overflow-y: auto;
  margin-top: 15px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Personnalisation de la barre de défilement */
.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}

.search-results::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 6px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

/* Responsive design */
@media (max-width: 768px) {
  .modal-content {
    margin: 10% auto;
    padding: 1.5rem;
    width: 95%;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

input.date-facture::-webkit-datetime-edit {
  color: inherit !important;
  /* Utiliser la couleur définie en JS */
}

/* Styles pour les alertes personnalisées */
.custom-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

.custom-alert-box {
  width: 90%;
  max-width: 500px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
}

.alert-title {
  padding: 15px 20px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  display: flex;
  align-items: center;
}

.alert-title i {
  margin-right: 10px;
  font-size: 20px;
}

.alert-content {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.alert-actions {
  display: flex;
  justify-content: flex-end;
  padding: 15px 20px;
  background-color: #f5f5f5;
  border-top: 1px solid #e0e0e0;
}

.alert-button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.alert-button i {
  margin-right: 5px;
}

.alert-button:not(:last-child) {
  margin-right: 10px;
}

/* Styles spécifiques pour l'alerte de doublons */
.duplicate-alert .alert-title {
  background-color: #ff9800;
}

.duplicate-warning {
  font-weight: bold;
  margin-bottom: 15px;
  color: #e65100;
}

.duplicate-list {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 20px;
}

.duplicate-list li {
  padding: 8px 10px;
  margin-bottom: 5px;
  background-color: #fff3e0;
  border-left: 4px solid #ff9800;
  display: flex;
  align-items: center;
}

.duplicate-list li i {
  margin-right: 10px;
  color: #ff9800;
}

.existing-clients-title {
  font-weight: bold;
  margin: 15px 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #e0e0e0;
}

.existing-clients-container {
  max-height: 200px;
  overflow-y: auto;
  background-color: #f9f9f9;
  border-radius: 4px;
  padding: 5px;
}

.existing-client {
  margin-bottom: 10px;
  padding: 10px;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.client-code {
  font-weight: bold;
  color: #0277bd;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px dashed #e0e0e0;
}

.client-details {
  display: flex;
  flex-wrap: wrap;
}

.client-details div {
  margin-right: 15px;
  margin-bottom: 5px;
}

.client-details i {
  color: #757575;
  margin-right: 5px;
}

.cancel-button {
  background-color: #f5f5f5;
  color: #616161;
}

.cancel-button:hover {
  background-color: #e0e0e0;
}

.continue-button {
  background-color: #ff9800;
  color: white;
}

.continue-button:hover {
  background-color: #f57c00;
}

.error-alert .alert-title {
  background-color: #f44336;
}

.error-alert .alert-content {
  color: #d32f2f;
}

.error-alert .ok-button {
  background-color: #f44336;
  color: white;
}

.error-alert .ok-button:hover {
  background-color: #d32f2f;
}

.success-alert .alert-title {
  background-color: #4caf50;
}

.success-alert .alert-content {
  color: #2e7d32;
}

.success-alert .ok-button {
  background-color: #4caf50;
  color: white;
}

.success-alert .ok-button:hover {
  background-color: #388e3c;
}

.duplicate-item {
  margin-bottom: 15px;
  padding: 8px 10px;
  background-color: #fff3e0;
  border-left: 4px solid #ff9800;
}

.duplicate-details {
  margin-top: 5px;
  padding-left: 25px;
  list-style-type: disc;
}

.duplicate-details li {
  background: none;
  border: none;
  padding: 3px 0;
  margin-bottom: 2px;
}

.duplicate-details strong {
  color: #e65100;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal.show {
  display: block;
  opacity: 1;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background-color: #757370;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 5px;
}

.close-btn:hover {
  background-color: #525151;
}
.modal-title {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
  font-size: 1.5em;
}

.daily-counts-table {
  width: 100%;
  border-collapse: collapse;
}

.daily-counts-table th,
.daily-counts-table td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
}

.daily-counts-table thead {
  background-color: #f2f2f2;
}

.daily-counts-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.daily-counts-table tr:hover {
  background-color: #f5f5f5;
}

@media (max-width: 600px) {
  .modal-content {
    margin: 5% auto;
    width: 95%;
    padding: 15px;
  }

  .daily-counts-table {
    font-size: 0.9em;
  }
}

/* Pagination */
.pagination a {
  padding: 6px 10px;
  background-color: #f3f3f3;
  border: 1px solid #ddd;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
}
.pagination a:hover {
  background-color: #007bff;
  color: white;
}
.pagination-controls form {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
}

.pagination-controls label,
.pagination-controls span {
  white-space: nowrap;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.pagination-controls select {
  padding: 5px 8px;
  border: 1px solid #cfd4da;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 70px;
}

.pagination-controls select:hover {
  border-color: #007bff;
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.25);
}
