* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}


/* HEADER */

.header {
  margin-bottom: 32px;
}

.brand {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

h1 {
  font-size: 32px;
  margin: 0 0 8px;
}

.header p {
  margin: 0;
  color: #6b7280;
}


/* CARDS */

.card {
  background: white;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}


/* LOGIN */

.login-card {
  max-width: 420px;
}

.login-card input {
  width: 100%;
  margin-bottom: 16px;
}


/* FORMULAIRES */

label {
  display: block;
  font-size: 14px;
  margin-bottom: 7px;
  font-weight: 600;
}

input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  background: white;
}

input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}


/* BOUTONS */

button {
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 14px;
  cursor: pointer;
}

.primary-button {
  background: #2563eb;
  color: white;
  font-weight: 600;
  transition: background 0.2s ease;
}

.primary-button:hover {
  background: #1d4ed8;
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.secondary-button {
  background: white;
  border: 1px solid #d1d5db;
  color: #111827;
}

.secondary-button:hover {
  background: #f9fafb;
}


/* ACTIONS */

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
}


/* STATISTIQUES */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-label {
  display: block;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
}


/* CHOIX ENTREES / SORTIES */

.management-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.management-choice-card {
  min-height: 104px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid #dbe1ea;
  background: white;
  border-radius: 14px;
  color: #1f2937;
  position: relative;
  transition:
    border 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.management-choice-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.entry-choice.active {
  border-color: #2563eb;
  background: #f5f9ff;
}

.exit-choice.active {
  border-color: #ef8c8c;
  background: #fff7f7;
}

.choice-selector {
  width: 22px;
  height: 22px;
  border: 2px solid #a8b1bf;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.management-choice-card.active .choice-selector {
  border-color: #2563eb;
}

.exit-choice.active .choice-selector {
  border-color: #dc5353;
}

.selector-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
}

.entry-choice.active .selector-dot {
  background: #2563eb;
}

.exit-choice.active .selector-dot {
  background: #dc5353;
}

.choice-icon {
  width: 56px;
  height: 56px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.car-icon {
  font-size: 34px;
}

.choice-symbol {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 19px;
  font-weight: bold;
}

.choice-icon-entry .choice-symbol {
  background: #2563eb;
}

.choice-icon-exit .choice-symbol {
  background: #dc5353;
}

.choice-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 5px;
}

.entry-choice.active .choice-title {
  color: #2563eb;
}

.exit-choice.active .choice-title {
  color: #c93f3f;
}

.choice-subtitle {
  color: #6b7280;
  font-size: 14px;
}


/* BLOC GESTION */

.management-card {
  margin-bottom: 20px;
}

.management-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 34px;
  align-items: center;
}

.management-form {
  min-width: 0;
}

.management-form h2 {
  margin: 0 0 7px;
  font-size: 23px;
}

.panel-description {
  margin: 0 0 24px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}


/* UPLOAD */

.upload-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.upload-grid input {
  width: 100%;
}

.file-help {
  margin: 8px 0 0;
  color: #9ca3af;
  font-size: 12px;
}


/* FICHIER PERSONNALISE */

.hidden-file-input {
  display: none;
}

.file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 10px 15px;
  margin: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.file-picker-button:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}


/* FICHIERS SELECTIONNES */

.selected-files-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.selected-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.selected-file-name {
  font-size: 13px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-file-button {
  flex-shrink: 0;
  padding: 5px 8px;
  background: transparent;
  color: #dc5353;
  border: none;
  font-size: 12px;
  font-weight: 600;
}

.remove-file-button:hover {
  background: #fff1f1;
}


/* INFO */

.info-box {
  background: #eef6ff;
  border-radius: 12px;
  padding: 18px;
  color: #3a4b66;
}

.exit-info-box {
  background: #fff5f5;
}

.info-title {
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 9px;
}

.exit-info-box .info-title {
  color: #c94b4b;
}

.info-box p {
  font-size: 13px;
  margin: 0;
  line-height: 1.55;
}


/* RECHERCHE */

.search-section {
  margin-bottom: 15px;
}

.search-section input {
  width: 100%;
}


/* TABLEAU */

.table-card {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  color: #6b7280;
}

td {
  padding: 15px 12px;
  border-bottom: 1px solid #f0f1f3;
  font-size: 14px;
}

.registration-cell {
  font-weight: 700;
  color: #111827;
}

.table-message {
  text-align: center;
  padding: 30px 15px;
  color: #9ca3af;
}

.table-error {
  color: #dc5353;
}


/* STATUTS */

.status {
  display: inline-block;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-available {
  background: #e8f7ee;
  color: #247447;
}

.status-pending {
  background: #fff3d6;
  color: #8a6616;
}

.status-exit-requested {
  background: #fff0f0;
  color: #c94b4b;
}

.status-exited {
  background: #f3f4f6;
  color: #6b7280;
}

.status-default {
  background: #f3f4f6;
  color: #4b5563;
}


/* STATUTS HISTORIQUE */

.history-status {
  display: inline-block;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.history-status-treated {
  background: #e8f7ee;
  color: #247447;
}

.history-status-pending {
  background: #fff3d6;
  color: #8a6616;
}

.history-status-refused {
  background: #fff0f0;
  color: #c94b4b;
}


/* CARTE ASSURANCE */

.download-button {
  padding: 7px 11px;
  border: 1px solid #d1d5db;
  background: white;
  color: #2563eb;
  font-weight: 600;
}

.download-button:hover {
  background: #f5f9ff;
  border-color: #b9cdf8;
}

.download-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.insurance-unavailable {
  color: #9ca3af;
}


/* PASSWORD */

.password-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.password-wrapper input {
  width: 100%;
  margin-bottom: 0;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
}


/* UTILITAIRE */

.hidden {
  display: none !important;
}


/* RESPONSIVE */

@media (max-width: 850px) {

  .management-panel {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 700px) {

  .page {
    padding: 24px 15px;
  }

  h1 {
    font-size: 27px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .management-choice {
    grid-template-columns: 1fr;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    flex-wrap: wrap;
  }

}
/* Suggestions de sortie : seuls les vingt resultats de la recherche sont affiches. */
.exit-vehicle-suggestions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.exit-vehicle-suggestions button {
  text-align: left;
}

/* Filtres : même identité que les boutons Télécharger ADMIN. */
.vehicle-filter-table { min-width: 760px; }
.vehicle-filter-table .filter-cell { min-width: 164px; }
.vehicle-filter-table .table-title-row th {
  padding-bottom: 7px;
  border-bottom: 0;
  vertical-align: bottom;
}
.vehicle-filter-table .table-filter-row td {
  padding: 8px 12px;
  background: #F1F5F9;
  vertical-align: middle;
  font-size: 13px;
}
.vehicle-filter-table .table-filter-row input,
.vehicle-filter-table .table-filter-row select,
.table-search-tools > input,
.table-search-tools .search-wrapper input,
.vehicle-filter-table .table-filter-row .clear-table-filters,
.history-scope-filters input,
.history-scope-filters select {
  box-sizing: border-box;
  height: 34px;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  color: #2563eb;
  font: 600 14px Arial, sans-serif;
  line-height: 18px;
  box-shadow: none;
  text-decoration: none;
}
.vehicle-filter-table .table-filter-row input,
.vehicle-filter-table .table-filter-row select { display: block; width: 100%; max-width: 200px; }
.table-search-tools > input,
.table-search-tools .search-wrapper input { width: 280px; max-width: 100%; }
.table-search-tools input::placeholder { color: #667085; font-weight: 400; opacity: 1; }
.vehicle-filter-table .table-filter-row .clear-table-filters { cursor: pointer; white-space: nowrap; }
.vehicle-filter-table .table-filter-row input:hover,
.vehicle-filter-table .table-filter-row select:hover,
.table-search-tools input:hover,
.vehicle-filter-table .table-filter-row .clear-table-filters:hover,
.history-scope-filters input:hover,
.history-scope-filters select:hover {
  background: #f5f9ff;
  border-color: #b9cdf8;
}
.vehicle-filter-table .table-filter-row input:focus-visible,
.vehicle-filter-table .table-filter-row select:focus-visible,
.table-search-tools input:focus-visible,
.vehicle-filter-table .table-filter-row .clear-table-filters:focus-visible,
.history-scope-filters input:focus-visible,
.history-scope-filters select:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-color: #b9cdf8;
}
.table-search-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.send-history-filter-note { margin: 0 20px 12px; color: #667085; font-size: 12px; }
@media (max-width: 760px) {
  .table-search-tools { width: 100%; }
  .table-search-tools > input,
  .table-search-tools .search-wrapper { flex: 1 1 180px; width: auto; min-width: 0; }
  .table-search-tools .search-wrapper input { width: 100%; }
}

.vehicle-table-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.vehicle-table-toolbar h2 { margin: 0; font-size: 20px; }
.exit-history-search-tools { margin-bottom: 12px; }

.vehicle-filter-table .reset-filter-cell { min-width: 174px; white-space: nowrap; }
