:root {
  --rouge: #e53935;
  --orange: #fb8c00;
  --vert: #43a047;
  --gris: #757575;
  --fond: #f4f5f7;
  --carte: #ffffff;
  --bordure: #e0e0e0;
  --texte: #212121;

  /* Aligne la couleur "primary" de Bootstrap sur le rouge de la charte */
  --bs-primary: #e53935;
  --bs-primary-rgb: 229, 57, 53;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fond);
  color: var(--texte);
}

/* --- Login --- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--carte);
  border-radius: 12px;
  padding: 32px 28px;
  width: 320px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-card h1 {
  margin: 0;
  font-size: 22px;
  text-align: center;
  color: var(--rouge);
}

.login-card .subtitle {
  margin: 0 0 10px;
  text-align: center;
  color: var(--gris);
  font-size: 14px;
}

.login-card label {
  font-size: 13px;
  font-weight: bold;
}

.login-card input {
  padding: 10px;
  border: 1px solid var(--bordure);
  border-radius: 6px;
  font-size: 14px;
}

.login-card button {
  margin-top: 8px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: var(--rouge);
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}

.login-card button:hover {
  background: #c62828;
}

/* --- Layout (sidebar Bootstrap + contenu) --- */
.sidebar {
  width: 260px;
  min-height: 100vh;
  flex-shrink: 0;
}

.sidebar .nav-link {
  font-weight: 600;
}

.sidebar-logout {
  opacity: 0.85;
  font-size: 14px;
}

.sidebar-logout:hover {
  opacity: 1;
}

.admin-main {
  flex: 1;
  min-width: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  background: var(--carte);
  border-bottom: 1px solid var(--bordure);
}

.tab {
  padding: 10px 16px;
  text-decoration: none;
  color: var(--gris);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}

.tab-active {
  color: var(--rouge);
  border-bottom-color: var(--rouge);
}

.badge-count {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  margin-left: 4px;
  background: var(--rouge);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  text-align: center;
}

.content {
  padding: 20px 24px 40px;
}

.empty {
  color: var(--gris);
  text-align: center;
  margin-top: 60px;
  font-size: 15px;
}

.flash {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.flash-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.flash-error {
  background: #ffebee;
  color: #c62828;
}

/* --- Grille de cartes --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--carte);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.card-photo {
  height: 160px;
  background: #eeeeee;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge-etablissement {
  background: rgba(229, 57, 53, 0.12);
  color: var(--rouge);
}

.badge-evenement {
  background: rgba(251, 140, 0, 0.12);
  color: var(--orange);
}

.badge-statut-en_attente {
  background: rgba(117, 117, 117, 0.12);
  color: var(--gris);
}

.badge-statut-valide {
  background: rgba(67, 160, 71, 0.12);
  color: var(--vert);
}

.badge-statut-rejete {
  background: rgba(229, 57, 53, 0.12);
  color: var(--rouge);
}

.card h2 {
  font-size: 16px;
  margin: 0;
}

.card .meta {
  font-size: 12px;
  color: var(--gris);
  margin: 0;
}

.card .description {
  font-size: 13px;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
}

.btn-valider {
  background: var(--vert);
}

.btn-valider:hover {
  background: #2e7d32;
}

.btn-rejeter {
  background: var(--rouge);
}

.btn-rejeter:hover {
  background: #c62828;
}

.btn-supprimer {
  background: var(--gris);
}

.btn-supprimer:hover {
  background: #616161;
}

/* --- Barres d'outils, recherche, formulaires --- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-form input[type="text"],
.search-form select,
.form-inline input,
.form-inline select {
  padding: 8px 10px;
  border: 1px solid var(--bordure);
  border-radius: 6px;
  font-size: 14px;
}

.btn-primary {
  background: var(--rouge);
  color: #fff;
}

.btn-primary:hover {
  background: #c62828;
}

.btn-danger {
  background: var(--rouge);
  color: #fff;
}

.btn-danger:hover {
  background: #c62828;
}

.btn-neutral {
  background: var(--gris);
  color: #fff;
}

.btn-neutral:hover {
  background: #616161;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.form-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.form-inline .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-inline label {
  font-size: 11px;
  font-weight: bold;
  color: var(--gris);
  text-transform: uppercase;
}

/* --- Tableaux --- */
table.datatable {
  width: 100%;
  border-collapse: collapse;
  background: var(--carte);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

table.datatable th,
table.datatable td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--bordure);
  font-size: 13px;
}

table.datatable th {
  background: #fafafa;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gris);
}

table.datatable tr:last-child td {
  border-bottom: none;
}

table.datatable a {
  color: var(--rouge);
  text-decoration: none;
}

table.datatable a:hover {
  text-decoration: underline;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  gap: 8px;
  margin: 16px 0 32px;
  justify-content: center;
}

.pagination a,
.pagination .current {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--bordure);
  text-decoration: none;
  color: var(--texte);
  font-size: 13px;
}

.pagination .current {
  background: var(--rouge);
  color: #fff;
  border-color: var(--rouge);
}

/* --- Fiche détail utilisateur --- */
.detail-card {
  background: var(--carte);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  max-width: 760px;
  margin-bottom: 24px;
}

.detail-row {
  margin-bottom: 8px;
  font-size: 14px;
}

.detail-row strong {
  display: inline-block;
  width: 140px;
  color: var(--gris);
  font-weight: 600;
}

.id-photos {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.id-photos figure {
  margin: 0;
}

.id-photos img {
  width: 220px;
  border-radius: 8px;
  border: 1px solid var(--bordure);
  display: block;
}

.id-photos figcaption {
  font-size: 12px;
  color: var(--gris);
  margin-top: 4px;
  text-align: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--gris);
  text-decoration: none;
  font-size: 13px;
}

.back-link:hover {
  color: var(--rouge);
}
