/* ====== Global table styles ====== */
.table-container {
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #444;
}

th, td {
  padding: 10px 14px;
  border: 1px solid #444;
  color: #eee;
  text-align: left;
}

th {
  background-color: #2c2c2c;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

tr:hover {
  background-color: #2a2a2a;
}

#clientsTable tbody tr:hover {
  background-color: #333;
}

/* ====== Pagination ====== */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 30px;
  margin-bottom: 100px;
  position: relative;
  z-index: 1;
}

.pagination-container button {
  padding: 8px 16px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  min-width: 36px;
  transition: background-color 0.2s ease;
}

.pagination-container button:hover:not(.disabled) {
  background-color: #666;
}

.pagination-container button.active {
  background-color: #88c;
}

.pagination-container button.disabled {
  background-color: #222;
  cursor: not-allowed;
  color: #666;
}

.pagination-container input[type="number"] {
  width: 60px;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid #555;
  background-color: #222;
  color: #fff;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease;
}

.pagination-container input[type="number"]:focus {
  border-color: #88c;
}

#pagination input[type="number"]::-webkit-inner-spin-button,
#pagination input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#pagination input[type="number"] {
  -moz-appearance: textfield;
}

#pagination {
  position: relative;
  z-index: 2;
}

/* ====== Loaders & No Results ====== */
#loader {
  text-align: center;
  padding: 20px;
  color: #ccc;
  font-size: 1.1rem;
}

.no-results {
  padding: 20px;
  text-align: center;
  color: #888;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.loader {
  display: none;
  text-align: center;
  padding: 20px;
  color: #888;
  grid-column: 1 / -1;
}

/* ====== Search bar ====== */
.search-bar-container {
  margin: 0 auto;
  max-width: 700px;
  padding: 0 20px 20px;
}

.search-bar {
  display: flex;
  background: #262b35;
  border-radius: 14px;
  padding: 10px 15px;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-bar input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  outline: none;
  font-size: 14px;
  padding: 6px;
}

.search-bar button#clearSearch {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 18px;
  padding: 0 6px;
  transition: color 0.2s ease;
}

.search-bar button#clearSearch:hover {
  color: #fff;
}

.search-bar label {
  color: white;
  white-space: nowrap;
  font-size: 14px;
}

.search-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-left,
.filter-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-left {
  flex: 1;
  min-width: 250px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.filter-right {
  justify-content: flex-end;
  flex: 1;
  min-width: 250px;
}

/* ====== Filter select ====== */
.filter-select {
  padding: 8px 14px;
  background-color: #1f2530;
  border: 1px solid #444;
  border-radius: 999px;
  color: white;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 32px;
  transition: border-color 0.2s ease;
}

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

/* ====== Calendar styles (remplacés par ta version) ====== */
.calendar-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #444;
  background-color: #1f2530;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-2 .89-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.11-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
  color: transparent;
  text-indent: -9999px;
  cursor: pointer;
  font-size: 0;
  padding: 0;
}

.calendar-button:hover {
  border-color: #666;
}

.calendar-button:focus {
  border-color: #88c;
  outline: none;
}

#customDateContainer {
  display: none;
}

#customDateContainer.visible {
  display: flex;
}

#customDateRange.calendar-button {
  margin-left: 5px;
}

.litepicker {
  background-color: #d3d3d3 !important;
  border-radius: 10px !important;
  padding: 10px;
  color: white !important;
  border: 2px solid #88c;
  box-shadow: 0 0 8px rgba(136, 136, 204, 0.6);
}

/* ====== Stats container ====== */
.stats-container {
  max-width: 600px;
  margin: 40px auto;
  background-color: #262b35;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  color: #f9f9f9;
  font-family: 'Roboto', sans-serif;
}

.stats-container h2 {
  margin-bottom: 20px;
}

.stats-container .stat {
  font-size: 1.1rem;
  margin: 10px 0;
}

.stats-container .bilan {
  margin-top: 20px;
  font-size: 1.3rem;
  font-weight: bold;
}

.bilan.positif {
  color: #10ff00;
}

.bilan.negatif {
  color: #ff4b4b;
}

/* ====== Other elements ====== */
.clickable-client {
  cursor: pointer;
}

.clickable-client:hover {
  background-color: #2a2a2a;
}

.type-cell {
  font-weight: bold;
  text-transform: uppercase;
}

.type-vente {
  color: #4fc3f7;
}

.type-achat {
  color: #7300ff;
}

.back-button-top {
  position: fixed;
  top: 80px;
  left: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1000;
}

.back-button-top img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: transform 0.2s ease-in-out;
}

.back-button-top:hover img {
  transform: scale(1.1);
}

.item-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px;
}
