/* =========================================================
   KoopKakao Admin — Thème personnalisé
   Palette cacao : brun, terre, crème
   ========================================================= */

:root {
  --koop-brun: #6f4e37;
  --koop-brun-dark: #5a3e2c;
  --koop-terre: #b08968;
  --koop-terre-light: #c9a584;
  --koop-creme: #f5ebe0;
  --koop-creme-light: #fdf8f3;

  --koop-success: #357d4d;
  --koop-warning: #d4a017;
  --koop-danger: #91443c;
  --koop-info: #476d92;
}

/* ---------- Body & layout ---------- */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--koop-creme);
  color: #2d2d2d;
}

.koop-main {
  background-color: var(--koop-creme);
  min-height: 100vh;
  padding: 24px 32px;
}

/* ---------- Sidebar ---------- */
.koop-sidebar {
  width: 260px;
  min-height: 100vh;
  background-color: var(--koop-brun);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 8px;
  background-color: #fff;
  border-radius: 50%;
  padding: 4px;
}

.sidebar-header h5 {
  color: #fff;
  font-weight: 600;
  margin: 0;
}

.koop-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.koop-sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.koop-sidebar .nav-link i {
  margin-right: 8px;
  width: 16px;
  display: inline-block;
}

.nav-section {
  margin-top: 18px;
  margin-bottom: 6px;
  padding: 0 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.user-info {
  padding: 8px 12px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
}

.user-info i {
  margin-right: 8px;
}

/* ---------- Flash container ---------- */
.flash-container {
  margin-bottom: 20px;
}

.flash-container .alert {
  margin-bottom: 8px;
}

/* ---------- Cartes de statistiques ---------- */
.stat-card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.stat-card .card-body {
  padding: 16px 20px;
}

.stat-card h2 {
  font-weight: 700;
  color: #2d2d2d;
}

.stat-card.stat-warning {
  border-left: 4px solid var(--koop-warning);
}

.stat-card.stat-info {
  border-left: 4px solid var(--koop-info);
}

.stat-card.stat-success {
  border-left: 4px solid var(--koop-success);
}

.stat-card.stat-danger {
  border-left: 4px solid var(--koop-danger);
}

/* ---------- Cartes ---------- */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  padding: 12px 16px;
}

/* ---------- Tables ---------- */
.table {
  margin-bottom: 0;
}

.table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
  border-bottom: 2px solid #dee2e6;
}

.table td {
  vertical-align: middle;
}

/* ---------- Badges ---------- */
.badge {
  font-weight: 500;
  padding: 4px 8px;
}

/* ---------- Annonce card ---------- */
.annonce-card {
  border: 1px solid #eee;
  transition: all 0.2s;
}

.annonce-card:hover {
  border-color: var(--koop-terre);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.annonce-card .card-img-top {
  border-radius: 7px 7px 0 0;
}

/* ---------- Login page ---------- */
.login-body {
  background: linear-gradient(135deg, var(--koop-brun) 0%, var(--koop-brun-dark) 100%);
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 400px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 50%;
  background-color: var(--koop-creme);
  padding: 8px;
}

.login-card .form-control:focus {
  border-color: var(--koop-terre);
  box-shadow: 0 0 0 0.2rem rgba(176, 137, 104, 0.25);
}

.login-card .btn-primary {
  background-color: var(--koop-brun);
  border-color: var(--koop-brun);
}

.login-card .btn-primary:hover {
  background-color: var(--koop-brun-dark);
  border-color: var(--koop-brun-dark);
}

/* ---------- Boutons ---------- */
.btn-primary {
  background-color: var(--koop-brun);
  border-color: var(--koop-brun);
}

.btn-primary:hover {
  background-color: var(--koop-brun-dark);
  border-color: var(--koop-brun-dark);
}

.btn-outline-primary {
  color: var(--koop-brun);
  border-color: var(--koop-brun);
}

.btn-outline-primary:hover {
  background-color: var(--koop-brun);
  border-color: var(--koop-brun);
}

/* ---------- Divers ---------- */
code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
  color: #555;
}

a.stretched-link::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  content: "";
}

/* ---------- Scrollbar ---------- */
.koop-sidebar::-webkit-scrollbar {
  width: 6px;
}

.koop-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.koop-sidebar::-webkit-scrollbar-track {
  background: transparent;
}


/* =========================================================
   Adaptation mobile — sidebar off-canvas
   ========================================================= */

.koop-mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  background-color: var(--koop-brun);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 1050;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.koop-burger {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.koop-burger:hover,
.koop-burger:active {
  background-color: rgba(255,255,255,0.12);
}

.koop-mobile-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  background-color: #fff;
  border-radius: 50%;
  padding: 2px;
}

.koop-mobile-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.koop-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.25s;
}
.koop-sidebar-overlay-active {
  display: block;
  opacity: 1;
}

@media (max-width: 991.98px) {
  .koop-mobile-topbar {
    display: flex;
  }

  .koop-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 1045;
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
  }

  .koop-sidebar.koop-sidebar-open {
    transform: translateX(0);
  }

  .koop-main {
    padding: 16px;
    width: 100%;
  }

  .stat-card .card-body {
    padding: 12px 14px;
  }

  .table-responsive {
    font-size: 0.85rem;
  }
}

/* =========================================================
   PROFILS TRAVAILLEURS
   ========================================================= */

.travailleurs-page {
    width: 100%;
}

.travailleurs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.travailleurs-header h1 {
    margin: 0;
}

.travailleurs-header p {
    margin: 6px 0 0;
    color: #6b7280;
}

.travailleurs-filtres {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.travailleurs-filtres input,
.travailleurs-filtres select {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font: inherit;
}

.travailleurs-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.travailleurs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.travailleurs-table th,
.travailleurs-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #eef0f3;
    vertical-align: middle;
}

.travailleurs-table th {
    background: #f8fafc;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.travailleurs-table tbody tr:hover {
    background: #f9fafb;
}

.travailleurs-table tbody tr:last-child td {
    border-bottom: 0;
}

.travailleur-identite {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.travailleur-identite strong {
    color: #111827;
}

.travailleur-identite small {
    color: #6b7280;
}

.travailleur-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.travailleur-actions form {
    display: inline;
    margin: 0;
}

.badge-statut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-en_attente {
    background: #fff7ed;
    color: #9a3412;
}

.badge-valide {
    background: #ecfdf5;
    color: #047857;
}

.badge-refuse {
    background: #fef2f2;
    color: #b91c1c;
}

.badge-disponible {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-indisponible {
    background: #f3f4f6;
    color: #4b5563;
}

.travailleur-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.travailleur-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.travailleur-detail-header h1 {
    margin: 0 0 6px;
}

.travailleur-detail-header p {
    margin: 0;
    color: #6b7280;
}

.travailleur-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.travailleur-field {
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.travailleur-field.full {
    grid-column: 1 / -1;
}

.travailleur-field label {
    display: block;
    margin-bottom: 7px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.travailleur-field-value {
    color: #111827;
    line-height: 1.6;
    white-space: pre-wrap;
}

.travailleur-form {
    margin-top: 24px;
}

.travailleur-form input,
.travailleur-form select,
.travailleur-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font: inherit;
}

.travailleur-form textarea {
    min-height: 130px;
    resize: vertical;
}

.travailleur-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border: 1px solid #dc2626;
}

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

.btn-success {
    background: #059669;
    color: #fff;
    border: 1px solid #059669;
}

.btn-success:hover {
    background: #047857;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
    border: 1px solid #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

@media (max-width: 768px) {
    .travailleur-grid {
        grid-template-columns: 1fr;
    }

    .travailleur-field.full {
        grid-column: auto;
    }

    .travailleurs-header,
    .travailleur-detail-header {
        align-items: stretch;
        flex-direction: column;
    }
}

/* =========================================================
   MENU ACTIF — PROFILS TRAVAILLEURS
   ========================================================= */

.koop-sidebar .nav-link.active {
  background-color: var(--koop-terre);
  color: #fff;
  font-weight: 600;
}

.koop-sidebar .nav-link.active i {
  color: #fff;
}

/* =========================================================
   PROFILS TRAVAILLEURS
   ========================================================= */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-header h1 {
  margin-bottom: 6px;
  color: var(--koop-brun-dark);
  font-weight: 700;
}

.page-header p {
  margin-bottom: 0;
}

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

.filter-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #555;
}

.filter-form select {
  min-width: 220px;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #fff;
}

.card {
  margin-bottom: 22px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--koop-brun-dark);
}

.table-responsive {
  border-radius: 0 0 8px 8px;
}

.table thead th {
  white-space: nowrap;
  background-color: var(--koop-creme-light);
}

.table tbody tr:hover {
  background-color: rgba(176, 137, 104, 0.08);
}

.badge-success {
  background-color: var(--koop-success);
  color: #fff;
}

.badge-warning {
  background-color: var(--koop-warning);
  color: #2d2d2d;
}

.badge-danger {
  background-color: var(--koop-danger);
  color: #fff;
}

.badge-secondary {
  background-color: #6c757d;
  color: #fff;
}

.empty-state {
  text-align: center;
  padding: 40px 20px !important;
  color: #777;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--koop-creme-light);
  border-radius: 8px;
  border: 1px solid #eee;
}

.detail-grid strong {
  color: var(--koop-brun-dark);
  font-size: 0.85rem;
}

.detail-grid span {
  overflow-wrap: anywhere;
}

.small-text {
  font-size: 0.8rem;
  color: #777;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  color: #4a4a4a;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.filter-form select:focus {
  outline: none;
  border-color: var(--koop-terre);
  box-shadow: 0 0 0 0.2rem rgba(176, 137, 104, 0.2);
}

.form-check {
  margin-bottom: 20px;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-row form {
  margin: 0;
}

@media (max-width: 768px) {
  .koop-main {
    padding: 20px 16px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-form select,
  .filter-form button,
  .filter-form a {
    width: 100%;
  }
}

/* =========================================================
   STATISTIQUES PROFILS TRAVAILLEURS
   ========================================================= */

.travailleurs-statistiques {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.travailleur-stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 90px;
  padding: 16px;
  background: #fff;
  border-radius: 10px;
  border-left: 4px solid var(--koop-brun);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.travailleur-stat-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--koop-creme);
  color: var(--koop-brun);
  font-size: 1.25rem;
}

.travailleur-stat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 1.65rem;
  line-height: 1;
  color: #2d2d2d;
}

.travailleur-stat-label {
  display: block;
  color: #6c757d;
  font-size: 0.8rem;
  font-weight: 600;
}

.travailleur-stat-card.stat-attente {
  border-left-color: var(--koop-warning);
}

.travailleur-stat-card.stat-attente .travailleur-stat-icon {
  color: #8a6500;
  background: #fff8df;
}

.travailleur-stat-card.stat-valide {
  border-left-color: var(--koop-success);
}

.travailleur-stat-card.stat-valide .travailleur-stat-icon {
  color: var(--koop-success);
  background: #eaf6ee;
}

.travailleur-stat-card.stat-refuse {
  border-left-color: var(--koop-danger);
}

.travailleur-stat-card.stat-refuse .travailleur-stat-icon {
  color: var(--koop-danger);
  background: #f9e9e7;
}

.travailleur-stat-card.stat-disponible {
  border-left-color: var(--koop-info);
}

.travailleur-stat-card.stat-disponible .travailleur-stat-icon {
  color: var(--koop-info);
  background: #eaf2f9;
}

@media (max-width: 1200px) {
  .travailleurs-statistiques {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .travailleurs-statistiques {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .travailleur-stat-card {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .travailleurs-statistiques {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   RECHERCHE ET FILTRES TRAVAILLEURS
   ========================================================= */

.filter-form {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #5f5f5f;
}

.search-field {
  flex: 1;
  min-width: 260px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper > i {
  position: absolute;
  left: 12px;
  color: #9a9a9a;
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  min-height: 38px;
  padding: 8px 38px 8px 36px;
  border: 1px solid #ced4da;
  border-radius: 7px;
  background: #fff;
  box-sizing: border-box;
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--koop-terre);
  box-shadow: 0 0 0 0.2rem rgba(176, 137, 104, 0.2);
}

.clear-search {
  position: absolute;
  right: 5px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #777;
}

.clear-search:hover {
  background: #f0f0f0;
  color: var(--koop-danger);
}

.experience-value {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--koop-creme);
  color: var(--koop-brun-dark);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.date-value {
  color: #6c757d;
  font-size: 0.85rem;
  white-space: nowrap;
}

.profil-travailleur-row {
  transition: background-color 0.15s ease;
}

@media (max-width: 768px) {
  .filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
    min-width: 0;
  }

  .filter-field,
  .filter-form select,
  .filter-form button,
  .filter-form a {
    width: 100%;
  }
}

/* =========================================================
   UTILISATEURS — INTERFACE ADMINISTRATIVE
   ========================================================= */

.utilisateurs-statistiques {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.utilisateur-stat-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #fff;
    border: 1px solid #eadfd6;
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 4px 14px rgba(61, 43, 32, 0.05);
}

.utilisateur-stat-card span {
    display: block;
    color: #8a7362;
    font-size: 0.82rem;
}

.utilisateur-stat-card strong {
    display: block;
    color: #3d2b20;
    font-size: 1.65rem;
    line-height: 1.2;
}

.utilisateur-stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f5ebe0;
    color: #6f4e37;
    font-size: 1.25rem;
}

.utilisateur-stat-icon.success {
    background: #e7f5ec;
    color: #198754;
}

.utilisateur-stat-icon.danger {
    background: #fbe8e8;
    color: #dc3545;
}

.utilisateur-stat-icon.info {
    background: #e7f1fb;
    color: #0d6efd;
}

.utilisateurs-card {
    overflow: hidden;
}

.utilisateurs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fff;
    border-bottom: 1px solid #eadfd6;
}

.utilisateurs-filtres {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.utilisateurs-filtres .input-group {
    width: 230px;
}

.utilisateurs-filtres .form-select {
    width: 160px;
}

.utilisateurs-table thead th {
    background: #faf7f4;
    color: #6f4e37;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

.utilisateurs-table td {
    padding: 0.95rem 1rem;
}

.utilisateur-identite {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 190px;
}

.utilisateur-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f4e37, #3d2b20);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fff;
}

.pagination .page-link {
    color: #6f4e37;
}

.pagination .page-item.active .page-link {
    background: #6f4e37;
    border-color: #6f4e37;
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-state > i {
    display: block;
    font-size: 3rem;
    color: #c9b5a5;
    margin-bottom: 1rem;
}

@media (max-width: 1100px) {
    .utilisateurs-statistiques {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .utilisateurs-statistiques {
        grid-template-columns: 1fr;
    }

    .utilisateurs-toolbar {
        align-items: stretch;
    }

    .utilisateurs-filtres {
        width: 100%;
    }

    .utilisateurs-filtres .input-group,
    .utilisateurs-filtres .form-select {
        width: 100%;
    }

    .pagination-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
   MEMBRES — ORGANISATIONS ET MEMBRES
   ========================================================= */

.membres-statistiques {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.membre-stat-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #fff;
    border: 1px solid #eadfd6;
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 4px 14px rgba(61, 43, 32, 0.05);
}

.membre-stat-card span {
    display: block;
    color: #8a7362;
    font-size: 0.82rem;
}

.membre-stat-card strong {
    display: block;
    color: #3d2b20;
    font-size: 1.65rem;
    line-height: 1.2;
}

.membre-stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f5ebe0;
    color: #6f4e37;
    font-size: 1.25rem;
}

.membre-stat-icon.success {
    background: #e7f5ec;
    color: #198754;
}

.membre-stat-icon.danger {
    background: #fbe8e8;
    color: #dc3545;
}

.membre-stat-icon.info {
    background: #e7f1fb;
    color: #0d6efd;
}

.membres-card {
    overflow: hidden;
}

.membres-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fff;
    border-bottom: 1px solid #eadfd6;
}

.membres-filtres {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.membres-filtres .input-group {
    width: 250px;
}

.membres-filtres .form-select {
    width: 170px;
}

.membre-organisation-card {
    border: 1px solid #eadfd6;
    border-radius: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.membre-organisation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(61, 43, 32, 0.09);
}

.membre-organisation-entete {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.membre-organisation-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 12px;
    background: #f5ebe0;
    color: #6f4e37;
    font-weight: 700;
    font-size: 1.15rem;
}

.membres-table thead th {
    background: #faf7f4;
    color: #6f4e37;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

.membres-table td {
    padding: 0.95rem 1rem;
}

.membre-identite {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 210px;
}

.membre-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f4e37, #3d2b20);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

@media (max-width: 1100px) {
    .membres-statistiques {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .membres-statistiques {
        grid-template-columns: 1fr;
    }

    .membres-toolbar {
        align-items: stretch;
    }

    .membres-filtres {
        width: 100%;
    }

    .membres-filtres .input-group,
    .membres-filtres .form-select {
        width: 100%;
    }
}

/* Fix : un tableau large (ex. /modules-utilisateurs) poussait le sidebar
   hors écran, car un enfant flex ignore l'overflow du parent sans min-width:0 */
.koop-main {
  min-width: 0;
  overflow-x: hidden;
}
.koop-sidebar {
  flex-shrink: 0;
}

/* ---- Pièces d'identité : visionneuse (modale) ---- */
.pi-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(0, 0, 0, .72);
}
.pi-modal[hidden] { display: none; }
.pi-modal__box {
  background: #fff; border-radius: 12px; width: 100%; max-width: 900px;
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.pi-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid #e9e1d8;
}
.pi-modal__close {
  border: 0; background: transparent; font-size: 1.75rem; line-height: 1;
  cursor: pointer; padding: 0 .25rem; color: #6f4e37;
}
.pi-modal__close:hover { color: #000; }
.pi-modal__body { padding: 1rem; overflow: auto; text-align: center; flex: 1; }
.pi-modal__body img { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: 8px; }
.pi-modal__body iframe { width: 100%; height: 75vh; border: 0; }
.pi-modal__msg { margin: 2rem 0; color: #6c757d; }
body.pi-modal-open { overflow: hidden; }

/* ---- Annonces : cartes et détail ---- */
.annonce-card { position: relative; overflow: hidden; }
.annonce-card .annonce-badge { position: absolute; top: .6rem; left: .6rem; z-index: 2; font-size: .85rem; }
.annonce-card .card-title {
  font-size: 1.05rem; line-height: 1.3; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.annonce-card .card-text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 4.2em;
}
.annonce-card .annonce-meta li { display: flex; align-items: center; gap: .45rem; padding: .1rem 0; }
.annonce-card .annonce-meta i { color: #6f4e37; }
.annonce-card .annonce-actions .btn { white-space: nowrap; }
.annonce-card.annonce-masquee .card-img-top,
.annonce-card.annonce-masquee .card-body { opacity: .6; }
.annonce-card.annonce-masquee .card-img-top { filter: grayscale(1); }
.annonce-card.annonce-masquee .annonce-actions { opacity: 1; }
.annonce-detail-meta li {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid #eee4d9;
}
.annonce-detail-meta li:last-child { border-bottom: 0; }


/* ---- Conversation (lecture admin) ---- */
.chat-zone { background: #f8f1e9; max-height: 70vh; overflow-y: auto; padding: 1rem; }
.chat-ligne { display: flex; margin-bottom: .75rem; }
.chat-ligne--employeur { justify-content: flex-start; }
.chat-ligne--travailleur { justify-content: flex-end; }
.chat-bulle { max-width: min(75%, 520px); padding: .55rem .8rem; border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.chat-bulle--employeur { background: #fff; border-top-left-radius: 2px; }
.chat-bulle--travailleur { background: #e6d3bf; border-top-right-radius: 2px; }
.chat-auteur { font-size: .75rem; font-weight: 600; color: #6f4e37; margin-bottom: .15rem; }
.chat-heure { font-size: .7rem; color: #8a7362; text-align: right; margin-top: .25rem; }
.chat-media { display: block; max-width: 100%; max-height: 260px; border-radius: 8px; margin-top: .4rem; object-fit: contain; }
